sage-team 3.5.3 → 3.7.0

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 (96) hide show
  1. package/README.md +40 -9
  2. package/dist/cli/commands/setup-claude.d.ts +3 -0
  3. package/dist/cli/commands/setup-claude.d.ts.map +1 -0
  4. package/dist/cli/commands/setup-claude.js +75 -0
  5. package/dist/cli/commands/setup-claude.js.map +1 -0
  6. package/dist/cli/index.d.ts.map +1 -1
  7. package/dist/cli/index.js +3 -1
  8. package/dist/cli/index.js.map +1 -1
  9. package/dist/engine/__tests__/ceo-brain.test.js +2 -2
  10. package/dist/engine/__tests__/ceo-brain.test.js.map +1 -1
  11. package/dist/engine/ceo-brain.d.ts +15 -8
  12. package/dist/engine/ceo-brain.d.ts.map +1 -1
  13. package/dist/engine/ceo-brain.js +326 -208
  14. package/dist/engine/ceo-brain.js.map +1 -1
  15. package/dist/engine/orchestrator.d.ts +1 -0
  16. package/dist/engine/orchestrator.d.ts.map +1 -1
  17. package/dist/engine/orchestrator.js +27 -1
  18. package/dist/engine/orchestrator.js.map +1 -1
  19. package/dist/mcp/server.js +1 -1
  20. package/dist/server/index.d.ts.map +1 -1
  21. package/dist/server/index.js +9 -3
  22. package/dist/server/index.js.map +1 -1
  23. package/dist/server/routes/api.d.ts.map +1 -1
  24. package/dist/server/routes/api.js +10 -3
  25. package/dist/server/routes/api.js.map +1 -1
  26. package/dist/state/repositories/agents.js +1 -1
  27. package/dist/state/repositories/agents.js.map +1 -1
  28. package/{src/web/dist/assets/BufferResource-CnEVFTWO.js → dist/web/dist/assets/BufferResource-BGsixSHO.js} +1 -1
  29. package/dist/web/dist/assets/BufferResource-BbpTIQ85.js +185 -0
  30. package/dist/web/dist/assets/BufferResource-BjJe3r2a.js +185 -0
  31. package/dist/web/dist/assets/BufferResource-C7ypptTD.js +185 -0
  32. package/dist/web/dist/assets/BufferResource-CuR0zQl9.js +185 -0
  33. package/dist/web/dist/assets/BufferResource-_EbXUkK9.js +185 -0
  34. package/dist/web/dist/assets/BufferResource-dCF0GA9M.js +185 -0
  35. package/{src/web/dist/assets/CanvasRenderer-DJddxDJS.js → dist/web/dist/assets/CanvasRenderer-BGC-Rjpm.js} +1 -1
  36. package/dist/web/dist/assets/CanvasRenderer-BQ7ScDtX.js +1 -0
  37. package/dist/web/dist/assets/CanvasRenderer-CBkg7qb3.js +1 -0
  38. package/dist/web/dist/assets/CanvasRenderer-CcFmL3Lw.js +1 -0
  39. package/dist/web/dist/assets/CanvasRenderer-CwKoxkGD.js +1 -0
  40. package/dist/web/dist/assets/CanvasRenderer-YM8daXJu.js +1 -0
  41. package/dist/web/dist/assets/CanvasRenderer-yT9JOc5o.js +1 -0
  42. package/{src/web/dist/assets/Filter-DWNM0gBH.js → dist/web/dist/assets/Filter-BzM7i9ln.js} +1 -1
  43. package/dist/web/dist/assets/Filter-CJvSyeWH.js +1 -0
  44. package/dist/web/dist/assets/Filter-CUPFlJF_.js +1 -0
  45. package/dist/web/dist/assets/Filter-D2kh6Lyn.js +1 -0
  46. package/dist/web/dist/assets/Filter-DMjNMMPy.js +1 -0
  47. package/dist/web/dist/assets/Filter-GQK6iqrb.js +1 -0
  48. package/dist/web/dist/assets/Filter-nUtqhIEl.js +1 -0
  49. package/{src/web/dist/assets/RenderTargetSystem-C4fzbyMy.js → dist/web/dist/assets/RenderTargetSystem-B-ekYymr.js} +1 -1
  50. package/dist/web/dist/assets/RenderTargetSystem-BylEtp0F.js +172 -0
  51. package/dist/web/dist/assets/RenderTargetSystem-D2L3KLdt.js +172 -0
  52. package/dist/web/dist/assets/RenderTargetSystem-DNsILH5P.js +172 -0
  53. package/dist/web/dist/assets/RenderTargetSystem-lhfSOVIz.js +172 -0
  54. package/dist/web/dist/assets/RenderTargetSystem-nRg6zEP8.js +172 -0
  55. package/dist/web/dist/assets/RenderTargetSystem-uCCnK3Aw.js +172 -0
  56. package/{src/web/dist/assets/WebGLRenderer-Dl5dddTJ.js → dist/web/dist/assets/WebGLRenderer-BEupTZT-.js} +1 -1
  57. package/dist/web/dist/assets/WebGLRenderer-BJuclWjv.js +156 -0
  58. package/dist/web/dist/assets/WebGLRenderer-BONohh1V.js +156 -0
  59. package/dist/web/dist/assets/WebGLRenderer-Bsr1n0Uu.js +156 -0
  60. package/dist/web/dist/assets/WebGLRenderer-Da_BkFlZ.js +156 -0
  61. package/dist/web/dist/assets/WebGLRenderer-DiL4ivWY.js +156 -0
  62. package/dist/web/dist/assets/WebGLRenderer-DqRhyEby.js +156 -0
  63. package/{src/web/dist/assets/WebGPURenderer-DHzWrTEL.js → dist/web/dist/assets/WebGPURenderer-C0BJNyre.js} +1 -1
  64. package/dist/web/dist/assets/WebGPURenderer-Clrsu_cP.js +41 -0
  65. package/dist/web/dist/assets/WebGPURenderer-DbGOPnSE.js +41 -0
  66. package/dist/web/dist/assets/WebGPURenderer-Ds8VNo2-.js +41 -0
  67. package/dist/web/dist/assets/WebGPURenderer-Du7e_Agz.js +41 -0
  68. package/dist/web/dist/assets/WebGPURenderer-pLgFan3y.js +41 -0
  69. package/dist/web/dist/assets/WebGPURenderer-pd03jK7j.js +41 -0
  70. package/{src/web/dist/assets/browserAll-CrRQwob6.js → dist/web/dist/assets/browserAll-1QqybVac.js} +1 -1
  71. package/dist/web/dist/assets/browserAll-Bd3WFbs9.js +14 -0
  72. package/dist/web/dist/assets/browserAll-Bv-Fa9BT.js +14 -0
  73. package/dist/web/dist/assets/browserAll-C9HRyLf9.js +14 -0
  74. package/dist/web/dist/assets/browserAll-D7SUz7ce.js +14 -0
  75. package/dist/web/dist/assets/browserAll-TAEt2LTG.js +14 -0
  76. package/dist/web/dist/assets/browserAll-d1yltqWP.js +14 -0
  77. package/dist/web/dist/assets/index-BQx3wJPr.css +1 -0
  78. package/dist/web/dist/assets/index-C1XGJE1t.js +298 -0
  79. package/dist/web/dist/assets/index-C6hoHqN5.js +298 -0
  80. package/dist/web/dist/assets/index-CFVD9jMF.js +298 -0
  81. package/dist/web/dist/assets/index-CO3-IuiC.js +298 -0
  82. package/dist/web/dist/assets/index-CRT2SA6d.js +298 -0
  83. package/dist/web/dist/assets/index-CVcQAOB6.css +1 -0
  84. package/dist/web/dist/assets/index-CwYVpEl9.js +298 -0
  85. package/dist/web/dist/assets/index-DBSQsI6C.js +298 -0
  86. package/{src/web/dist/assets/webworkerAll-B9FNurHh.js → dist/web/dist/assets/webworkerAll-B3fxgx9g.js} +1 -1
  87. package/dist/web/dist/assets/webworkerAll-BILg7nF2.js +83 -0
  88. package/dist/web/dist/assets/webworkerAll-C7T1zoFZ.js +83 -0
  89. package/dist/web/dist/assets/webworkerAll-CMt6Ulvh.js +83 -0
  90. package/dist/web/dist/assets/webworkerAll-CREQA0I8.js +83 -0
  91. package/dist/web/dist/assets/webworkerAll-CykNhAo8.js +83 -0
  92. package/dist/web/dist/assets/webworkerAll-WnWYpa5G.js +83 -0
  93. package/{src → dist}/web/dist/index.html +2 -2
  94. package/package.json +2 -3
  95. package/src/web/dist/assets/index-8Qtg1JIx.css +0 -1
  96. package/src/web/dist/assets/index-PrNo7ukG.js +0 -298
@@ -0,0 +1,298 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/browserAll-C9HRyLf9.js","assets/webworkerAll-WnWYpa5G.js","assets/Filter-nUtqhIEl.js","assets/WebGPURenderer-Du7e_Agz.js","assets/BufferResource-_EbXUkK9.js","assets/RenderTargetSystem-lhfSOVIz.js","assets/WebGLRenderer-BJuclWjv.js","assets/CanvasRenderer-YM8daXJu.js"])))=>i.map(i=>d[i]);
2
+ var S1=Object.defineProperty;var T1=(l,t,n)=>t in l?S1(l,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):l[t]=n;var Xt=(l,t,n)=>T1(l,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const u of r)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&s(c)}).observe(document,{childList:!0,subtree:!0});function n(r){const u={};return r.integrity&&(u.integrity=r.integrity),r.referrerPolicy&&(u.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?u.credentials="include":r.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function s(r){if(r.ep)return;r.ep=!0;const u=n(r);fetch(r.href,u)}})();function Dh(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var Ec={exports:{}},Va={};/**
3
+ * @license React
4
+ * react-jsx-runtime.production.js
5
+ *
6
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */var Zg;function w1(){if(Zg)return Va;Zg=1;var l=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(s,r,u){var c=null;if(u!==void 0&&(c=""+u),r.key!==void 0&&(c=""+r.key),"key"in r){u={};for(var h in r)h!=="key"&&(u[h]=r[h])}else u=r;return r=u.ref,{$$typeof:l,type:s,key:c,ref:r!==void 0?r:null,props:u}}return Va.Fragment=t,Va.jsx=n,Va.jsxs=n,Va}var Ig;function A1(){return Ig||(Ig=1,Ec.exports=w1()),Ec.exports}var O=A1(),Rc={exports:{}},mt={};/**
11
+ * @license React
12
+ * react.production.js
13
+ *
14
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
15
+ *
16
+ * This source code is licensed under the MIT license found in the
17
+ * LICENSE file in the root directory of this source tree.
18
+ */var Kg;function C1(){if(Kg)return mt;Kg=1;var l=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),b=Symbol.iterator;function _(R){return R===null||typeof R!="object"?null:(R=b&&R[b]||R["@@iterator"],typeof R=="function"?R:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,S={};function A(R,q,W){this.props=R,this.context=q,this.refs=S,this.updater=W||T}A.prototype.isReactComponent={},A.prototype.setState=function(R,q){if(typeof R!="object"&&typeof R!="function"&&R!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,R,q,"setState")},A.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function C(){}C.prototype=A.prototype;function E(R,q,W){this.props=R,this.context=q,this.refs=S,this.updater=W||T}var G=E.prototype=new C;G.constructor=E,w(G,A.prototype),G.isPureReactComponent=!0;var P=Array.isArray;function k(){}var B={H:null,A:null,T:null,S:null},K=Object.prototype.hasOwnProperty;function Q(R,q,W){var J=W.ref;return{$$typeof:l,type:R,key:q,ref:J!==void 0?J:null,props:W}}function Z(R,q){return Q(R.type,q,R.props)}function I(R){return typeof R=="object"&&R!==null&&R.$$typeof===l}function tt(R){var q={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(W){return q[W]})}var it=/\/+/g;function nt(R,q){return typeof R=="object"&&R!==null&&R.key!=null?tt(""+R.key):q.toString(36)}function wt(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(k,k):(R.status="pending",R.then(function(q){R.status==="pending"&&(R.status="fulfilled",R.value=q)},function(q){R.status==="pending"&&(R.status="rejected",R.reason=q)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function D(R,q,W,J,rt){var ct=typeof R;(ct==="undefined"||ct==="boolean")&&(R=null);var dt=!1;if(R===null)dt=!0;else switch(ct){case"bigint":case"string":case"number":dt=!0;break;case"object":switch(R.$$typeof){case l:case t:dt=!0;break;case p:return dt=R._init,D(dt(R._payload),q,W,J,rt)}}if(dt)return rt=rt(R),dt=J===""?"."+nt(R,0):J,P(rt)?(W="",dt!=null&&(W=dt.replace(it,"$&/")+"/"),D(rt,q,W,"",function(Fe){return Fe})):rt!=null&&(I(rt)&&(rt=Z(rt,W+(rt.key==null||R&&R.key===rt.key?"":(""+rt.key).replace(it,"$&/")+"/")+dt)),q.push(rt)),1;dt=0;var jt=J===""?".":J+":";if(P(R))for(var Et=0;Et<R.length;Et++)J=R[Et],ct=jt+nt(J,Et),dt+=D(J,q,W,ct,rt);else if(Et=_(R),typeof Et=="function")for(R=Et.call(R),Et=0;!(J=R.next()).done;)J=J.value,ct=jt+nt(J,Et++),dt+=D(J,q,W,ct,rt);else if(ct==="object"){if(typeof R.then=="function")return D(wt(R),q,W,J,rt);throw q=String(R),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return dt}function L(R,q,W){if(R==null)return R;var J=[],rt=0;return D(R,J,"","",function(ct){return q.call(W,ct,rt++)}),J}function et(R){if(R._status===-1){var q=R._result;q=q(),q.then(function(W){(R._status===0||R._status===-1)&&(R._status=1,R._result=W)},function(W){(R._status===0||R._status===-1)&&(R._status=2,R._result=W)}),R._status===-1&&(R._status=0,R._result=q)}if(R._status===1)return R._result.default;throw R._result}var $=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},at={map:L,forEach:function(R,q,W){L(R,function(){q.apply(this,arguments)},W)},count:function(R){var q=0;return L(R,function(){q++}),q},toArray:function(R){return L(R,function(q){return q})||[]},only:function(R){if(!I(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return mt.Activity=x,mt.Children=at,mt.Component=A,mt.Fragment=n,mt.Profiler=r,mt.PureComponent=E,mt.StrictMode=s,mt.Suspense=m,mt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,mt.__COMPILER_RUNTIME={__proto__:null,c:function(R){return B.H.useMemoCache(R)}},mt.cache=function(R){return function(){return R.apply(null,arguments)}},mt.cacheSignal=function(){return null},mt.cloneElement=function(R,q,W){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var J=w({},R.props),rt=R.key;if(q!=null)for(ct in q.key!==void 0&&(rt=""+q.key),q)!K.call(q,ct)||ct==="key"||ct==="__self"||ct==="__source"||ct==="ref"&&q.ref===void 0||(J[ct]=q[ct]);var ct=arguments.length-2;if(ct===1)J.children=W;else if(1<ct){for(var dt=Array(ct),jt=0;jt<ct;jt++)dt[jt]=arguments[jt+2];J.children=dt}return Q(R.type,rt,J)},mt.createContext=function(R){return R={$$typeof:c,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:u,_context:R},R},mt.createElement=function(R,q,W){var J,rt={},ct=null;if(q!=null)for(J in q.key!==void 0&&(ct=""+q.key),q)K.call(q,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(rt[J]=q[J]);var dt=arguments.length-2;if(dt===1)rt.children=W;else if(1<dt){for(var jt=Array(dt),Et=0;Et<dt;Et++)jt[Et]=arguments[Et+2];rt.children=jt}if(R&&R.defaultProps)for(J in dt=R.defaultProps,dt)rt[J]===void 0&&(rt[J]=dt[J]);return Q(R,ct,rt)},mt.createRef=function(){return{current:null}},mt.forwardRef=function(R){return{$$typeof:h,render:R}},mt.isValidElement=I,mt.lazy=function(R){return{$$typeof:p,_payload:{_status:-1,_result:R},_init:et}},mt.memo=function(R,q){return{$$typeof:g,type:R,compare:q===void 0?null:q}},mt.startTransition=function(R){var q=B.T,W={};B.T=W;try{var J=R(),rt=B.S;rt!==null&&rt(W,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(k,$)}catch(ct){$(ct)}finally{q!==null&&W.types!==null&&(q.types=W.types),B.T=q}},mt.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},mt.use=function(R){return B.H.use(R)},mt.useActionState=function(R,q,W){return B.H.useActionState(R,q,W)},mt.useCallback=function(R,q){return B.H.useCallback(R,q)},mt.useContext=function(R){return B.H.useContext(R)},mt.useDebugValue=function(){},mt.useDeferredValue=function(R,q){return B.H.useDeferredValue(R,q)},mt.useEffect=function(R,q){return B.H.useEffect(R,q)},mt.useEffectEvent=function(R){return B.H.useEffectEvent(R)},mt.useId=function(){return B.H.useId()},mt.useImperativeHandle=function(R,q,W){return B.H.useImperativeHandle(R,q,W)},mt.useInsertionEffect=function(R,q){return B.H.useInsertionEffect(R,q)},mt.useLayoutEffect=function(R,q){return B.H.useLayoutEffect(R,q)},mt.useMemo=function(R,q){return B.H.useMemo(R,q)},mt.useOptimistic=function(R,q){return B.H.useOptimistic(R,q)},mt.useReducer=function(R,q,W){return B.H.useReducer(R,q,W)},mt.useRef=function(R){return B.H.useRef(R)},mt.useState=function(R){return B.H.useState(R)},mt.useSyncExternalStore=function(R,q,W){return B.H.useSyncExternalStore(R,q,W)},mt.useTransition=function(){return B.H.useTransition()},mt.version="19.2.4",mt}var $g;function Nh(){return $g||($g=1,Rc.exports=C1()),Rc.exports}var Ve=Nh();const jr=Dh(Ve);var zc={exports:{}},Pa={},Dc={exports:{}},Nc={};/**
19
+ * @license React
20
+ * scheduler.production.js
21
+ *
22
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
23
+ *
24
+ * This source code is licensed under the MIT license found in the
25
+ * LICENSE file in the root directory of this source tree.
26
+ */var Jg;function M1(){return Jg||(Jg=1,(function(l){function t(D,L){var et=D.length;D.push(L);t:for(;0<et;){var $=et-1>>>1,at=D[$];if(0<r(at,L))D[$]=L,D[et]=at,et=$;else break t}}function n(D){return D.length===0?null:D[0]}function s(D){if(D.length===0)return null;var L=D[0],et=D.pop();if(et!==L){D[0]=et;t:for(var $=0,at=D.length,R=at>>>1;$<R;){var q=2*($+1)-1,W=D[q],J=q+1,rt=D[J];if(0>r(W,et))J<at&&0>r(rt,W)?(D[$]=rt,D[J]=et,$=J):(D[$]=W,D[q]=et,$=q);else if(J<at&&0>r(rt,et))D[$]=rt,D[J]=et,$=J;else break t}}return L}function r(D,L){var et=D.sortIndex-L.sortIndex;return et!==0?et:D.id-L.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;l.unstable_now=function(){return u.now()}}else{var c=Date,h=c.now();l.unstable_now=function(){return c.now()-h}}var m=[],g=[],p=1,x=null,b=3,_=!1,T=!1,w=!1,S=!1,A=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function G(D){for(var L=n(g);L!==null;){if(L.callback===null)s(g);else if(L.startTime<=D)s(g),L.sortIndex=L.expirationTime,t(m,L);else break;L=n(g)}}function P(D){if(w=!1,G(D),!T)if(n(m)!==null)T=!0,k||(k=!0,tt());else{var L=n(g);L!==null&&wt(P,L.startTime-D)}}var k=!1,B=-1,K=5,Q=-1;function Z(){return S?!0:!(l.unstable_now()-Q<K)}function I(){if(S=!1,k){var D=l.unstable_now();Q=D;var L=!0;try{t:{T=!1,w&&(w=!1,C(B),B=-1),_=!0;var et=b;try{e:{for(G(D),x=n(m);x!==null&&!(x.expirationTime>D&&Z());){var $=x.callback;if(typeof $=="function"){x.callback=null,b=x.priorityLevel;var at=$(x.expirationTime<=D);if(D=l.unstable_now(),typeof at=="function"){x.callback=at,G(D),L=!0;break e}x===n(m)&&s(m),G(D)}else s(m);x=n(m)}if(x!==null)L=!0;else{var R=n(g);R!==null&&wt(P,R.startTime-D),L=!1}}break t}finally{x=null,b=et,_=!1}L=void 0}}finally{L?tt():k=!1}}}var tt;if(typeof E=="function")tt=function(){E(I)};else if(typeof MessageChannel<"u"){var it=new MessageChannel,nt=it.port2;it.port1.onmessage=I,tt=function(){nt.postMessage(null)}}else tt=function(){A(I,0)};function wt(D,L){B=A(function(){D(l.unstable_now())},L)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(D){D.callback=null},l.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<D?Math.floor(1e3/D):5},l.unstable_getCurrentPriorityLevel=function(){return b},l.unstable_next=function(D){switch(b){case 1:case 2:case 3:var L=3;break;default:L=b}var et=b;b=L;try{return D()}finally{b=et}},l.unstable_requestPaint=function(){S=!0},l.unstable_runWithPriority=function(D,L){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var et=b;b=D;try{return L()}finally{b=et}},l.unstable_scheduleCallback=function(D,L,et){var $=l.unstable_now();switch(typeof et=="object"&&et!==null?(et=et.delay,et=typeof et=="number"&&0<et?$+et:$):et=$,D){case 1:var at=-1;break;case 2:at=250;break;case 5:at=1073741823;break;case 4:at=1e4;break;default:at=5e3}return at=et+at,D={id:p++,callback:L,priorityLevel:D,startTime:et,expirationTime:at,sortIndex:-1},et>$?(D.sortIndex=et,t(g,D),n(m)===null&&D===n(g)&&(w?(C(B),B=-1):w=!0,wt(P,et-$))):(D.sortIndex=at,t(m,D),T||_||(T=!0,k||(k=!0,tt()))),D},l.unstable_shouldYield=Z,l.unstable_wrapCallback=function(D){var L=b;return function(){var et=b;b=L;try{return D.apply(this,arguments)}finally{b=et}}}})(Nc)),Nc}var tp;function E1(){return tp||(tp=1,Dc.exports=M1()),Dc.exports}var Bc={exports:{}},pe={};/**
27
+ * @license React
28
+ * react-dom.production.js
29
+ *
30
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
31
+ *
32
+ * This source code is licensed under the MIT license found in the
33
+ * LICENSE file in the root directory of this source tree.
34
+ */var ep;function R1(){if(ep)return pe;ep=1;var l=Nh();function t(m){var g="https://react.dev/errors/"+m;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)g+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+m+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var s={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},r=Symbol.for("react.portal");function u(m,g,p){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:x==null?null:""+x,children:m,containerInfo:g,implementation:p}}var c=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(m,g){if(m==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return pe.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,pe.createPortal=function(m,g){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(t(299));return u(m,g,null,p)},pe.flushSync=function(m){var g=c.T,p=s.p;try{if(c.T=null,s.p=2,m)return m()}finally{c.T=g,s.p=p,s.d.f()}},pe.preconnect=function(m,g){typeof m=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,s.d.C(m,g))},pe.prefetchDNS=function(m){typeof m=="string"&&s.d.D(m)},pe.preinit=function(m,g){if(typeof m=="string"&&g&&typeof g.as=="string"){var p=g.as,x=h(p,g.crossOrigin),b=typeof g.integrity=="string"?g.integrity:void 0,_=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;p==="style"?s.d.S(m,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:x,integrity:b,fetchPriority:_}):p==="script"&&s.d.X(m,{crossOrigin:x,integrity:b,fetchPriority:_,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},pe.preinitModule=function(m,g){if(typeof m=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var p=h(g.as,g.crossOrigin);s.d.M(m,{crossOrigin:p,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&s.d.M(m)},pe.preload=function(m,g){if(typeof m=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var p=g.as,x=h(p,g.crossOrigin);s.d.L(m,p,{crossOrigin:x,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},pe.preloadModule=function(m,g){if(typeof m=="string")if(g){var p=h(g.as,g.crossOrigin);s.d.m(m,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:p,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else s.d.m(m)},pe.requestFormReset=function(m){s.d.r(m)},pe.unstable_batchedUpdates=function(m,g){return m(g)},pe.useFormState=function(m,g,p){return c.H.useFormState(m,g,p)},pe.useFormStatus=function(){return c.H.useHostTransitionStatus()},pe.version="19.2.4",pe}var ip;function z1(){if(ip)return Bc.exports;ip=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(t){console.error(t)}}return l(),Bc.exports=R1(),Bc.exports}/**
35
+ * @license React
36
+ * react-dom-client.production.js
37
+ *
38
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
39
+ *
40
+ * This source code is licensed under the MIT license found in the
41
+ * LICENSE file in the root directory of this source tree.
42
+ */var np;function D1(){if(np)return Pa;np=1;var l=E1(),t=Nh(),n=z1();function s(e){var i="https://react.dev/errors/"+e;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)i+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var i=e,a=e;if(e.alternate)for(;i.return;)i=i.return;else{e=i;do i=e,(i.flags&4098)!==0&&(a=i.return),e=i.return;while(e)}return i.tag===3?a:null}function c(e){if(e.tag===13){var i=e.memoizedState;if(i===null&&(e=e.alternate,e!==null&&(i=e.memoizedState)),i!==null)return i.dehydrated}return null}function h(e){if(e.tag===31){var i=e.memoizedState;if(i===null&&(e=e.alternate,e!==null&&(i=e.memoizedState)),i!==null)return i.dehydrated}return null}function m(e){if(u(e)!==e)throw Error(s(188))}function g(e){var i=e.alternate;if(!i){if(i=u(e),i===null)throw Error(s(188));return i!==e?null:e}for(var a=e,o=i;;){var f=a.return;if(f===null)break;var d=f.alternate;if(d===null){if(o=f.return,o!==null){a=o;continue}break}if(f.child===d.child){for(d=f.child;d;){if(d===a)return m(f),e;if(d===o)return m(f),i;d=d.sibling}throw Error(s(188))}if(a.return!==o.return)a=f,o=d;else{for(var y=!1,v=f.child;v;){if(v===a){y=!0,a=f,o=d;break}if(v===o){y=!0,o=f,a=d;break}v=v.sibling}if(!y){for(v=d.child;v;){if(v===a){y=!0,a=d,o=f;break}if(v===o){y=!0,o=d,a=f;break}v=v.sibling}if(!y)throw Error(s(189))}}if(a.alternate!==o)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?e:i}function p(e){var i=e.tag;if(i===5||i===26||i===27||i===6)return e;for(e=e.child;e!==null;){if(i=p(e),i!==null)return i;e=e.sibling}return null}var x=Object.assign,b=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),E=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),Q=Symbol.for("react.activity"),Z=Symbol.for("react.memo_cache_sentinel"),I=Symbol.iterator;function tt(e){return e===null||typeof e!="object"?null:(e=I&&e[I]||e["@@iterator"],typeof e=="function"?e:null)}var it=Symbol.for("react.client.reference");function nt(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===it?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case A:return"Profiler";case S:return"StrictMode";case P:return"Suspense";case k:return"SuspenseList";case Q:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case E:return e.displayName||"Context";case C:return(e._context.displayName||"Context")+".Consumer";case G:var i=e.render;return e=e.displayName,e||(e=i.displayName||i.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case B:return i=e.displayName||null,i!==null?i:nt(e.type)||"Memo";case K:i=e._payload,e=e._init;try{return nt(e(i))}catch{}}return null}var wt=Array.isArray,D=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,et={pending:!1,data:null,method:null,action:null},$=[],at=-1;function R(e){return{current:e}}function q(e){0>at||(e.current=$[at],$[at]=null,at--)}function W(e,i){at++,$[at]=e.current,e.current=i}var J=R(null),rt=R(null),ct=R(null),dt=R(null);function jt(e,i){switch(W(ct,i),W(rt,e),W(J,null),i.nodeType){case 9:case 11:e=(e=i.documentElement)&&(e=e.namespaceURI)?xg(e):0;break;default:if(e=i.tagName,i=i.namespaceURI)i=xg(i),e=_g(i,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}q(J),W(J,e)}function Et(){q(J),q(rt),q(ct)}function Fe(e){e.memoizedState!==null&&W(dt,e);var i=J.current,a=_g(i,e.type);i!==a&&(W(rt,e),W(J,a))}function Zi(e){rt.current===e&&(q(J),q(rt)),dt.current===e&&(q(dt),La._currentValue=et)}var ui,pi;function _e(e){if(ui===void 0)try{throw Error()}catch(a){var i=a.stack.trim().match(/\n( *(at )?)/);ui=i&&i[1]||"",pi=-1<a.stack.indexOf(`
43
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
44
+ `+ui+e+pi}var ci=!1;function Ks(e,i){if(!e||ci)return"";ci=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(i){var F=function(){throw Error()};if(Object.defineProperty(F.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(F,[])}catch(Y){var H=Y}Reflect.construct(e,[],F)}else{try{F.call()}catch(Y){H=Y}e.call(F.prototype)}}else{try{throw Error()}catch(Y){H=Y}(F=e())&&typeof F.catch=="function"&&F.catch(function(){})}}catch(Y){if(Y&&H&&typeof Y.stack=="string")return[Y.stack,H.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=o.DetermineComponentFrameRoot(),y=d[0],v=d[1];if(y&&v){var M=y.split(`
45
+ `),j=v.split(`
46
+ `);for(f=o=0;o<M.length&&!M[o].includes("DetermineComponentFrameRoot");)o++;for(;f<j.length&&!j[f].includes("DetermineComponentFrameRoot");)f++;if(o===M.length||f===j.length)for(o=M.length-1,f=j.length-1;1<=o&&0<=f&&M[o]!==j[f];)f--;for(;1<=o&&0<=f;o--,f--)if(M[o]!==j[f]){if(o!==1||f!==1)do if(o--,f--,0>f||M[o]!==j[f]){var X=`
47
+ `+M[o].replace(" at new "," at ");return e.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",e.displayName)),X}while(1<=o&&0<=f);break}}}finally{ci=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?_e(a):""}function xl(e,i){switch(e.tag){case 26:case 27:case 5:return _e(e.type);case 16:return _e("Lazy");case 13:return e.child!==i&&i!==null?_e("Suspense Fallback"):_e("Suspense");case 19:return _e("SuspenseList");case 0:case 15:return Ks(e.type,!1);case 11:return Ks(e.type.render,!1);case 1:return Ks(e.type,!0);case 31:return _e("Activity");default:return""}}function _l(e){try{var i="",a=null;do i+=xl(e,a),a=e,e=e.return;while(e);return i}catch(o){return`
48
+ Error generating stack: `+o.message+`
49
+ `+o.stack}}var bl=Object.prototype.hasOwnProperty,mo=l.unstable_scheduleCallback,go=l.unstable_cancelCallback,tx=l.unstable_shouldYield,ex=l.unstable_requestPaint,Be=l.unstable_now,ix=l.unstable_getCurrentPriorityLevel,Zh=l.unstable_ImmediatePriority,Ih=l.unstable_UserBlockingPriority,vl=l.unstable_NormalPriority,nx=l.unstable_LowPriority,Kh=l.unstable_IdlePriority,sx=l.log,ax=l.unstable_setDisableYieldValue,$s=null,Oe=null;function Ii(e){if(typeof sx=="function"&&ax(e),Oe&&typeof Oe.setStrictMode=="function")try{Oe.setStrictMode($s,e)}catch{}}var Ge=Math.clz32?Math.clz32:ox,lx=Math.log,rx=Math.LN2;function ox(e){return e>>>=0,e===0?32:31-(lx(e)/rx|0)|0}var Sl=256,Tl=262144,wl=4194304;function Cn(e){var i=e&42;if(i!==0)return i;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Al(e,i,a){var o=e.pendingLanes;if(o===0)return 0;var f=0,d=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var v=o&134217727;return v!==0?(o=v&~d,o!==0?f=Cn(o):(y&=v,y!==0?f=Cn(y):a||(a=v&~e,a!==0&&(f=Cn(a))))):(v=o&~d,v!==0?f=Cn(v):y!==0?f=Cn(y):a||(a=o&~e,a!==0&&(f=Cn(a)))),f===0?0:i!==0&&i!==f&&(i&d)===0&&(d=f&-f,a=i&-i,d>=a||d===32&&(a&4194048)!==0)?i:f}function Js(e,i){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&i)===0}function ux(e,i){switch(e){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function $h(){var e=wl;return wl<<=1,(wl&62914560)===0&&(wl=4194304),e}function po(e){for(var i=[],a=0;31>a;a++)i.push(e);return i}function ta(e,i){e.pendingLanes|=i,i!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function cx(e,i,a,o,f,d){var y=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var v=e.entanglements,M=e.expirationTimes,j=e.hiddenUpdates;for(a=y&~a;0<a;){var X=31-Ge(a),F=1<<X;v[X]=0,M[X]=-1;var H=j[X];if(H!==null)for(j[X]=null,X=0;X<H.length;X++){var Y=H[X];Y!==null&&(Y.lane&=-536870913)}a&=~F}o!==0&&Jh(e,o,0),d!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=d&~(y&~i))}function Jh(e,i,a){e.pendingLanes|=i,e.suspendedLanes&=~i;var o=31-Ge(i);e.entangledLanes|=i,e.entanglements[o]=e.entanglements[o]|1073741824|a&261930}function tf(e,i){var a=e.entangledLanes|=i;for(e=e.entanglements;a;){var o=31-Ge(a),f=1<<o;f&i|e[o]&i&&(e[o]|=i),a&=~f}}function ef(e,i){var a=i&-i;return a=(a&42)!==0?1:yo(a),(a&(e.suspendedLanes|i))!==0?0:a}function yo(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function xo(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function nf(){var e=L.p;return e!==0?e:(e=window.event,e===void 0?32:qg(e.type))}function sf(e,i){var a=L.p;try{return L.p=e,i()}finally{L.p=a}}var Ki=Math.random().toString(36).slice(2),ce="__reactFiber$"+Ki,Te="__reactProps$"+Ki,ts="__reactContainer$"+Ki,_o="__reactEvents$"+Ki,hx="__reactListeners$"+Ki,fx="__reactHandles$"+Ki,af="__reactResources$"+Ki,ea="__reactMarker$"+Ki;function bo(e){delete e[ce],delete e[Te],delete e[_o],delete e[hx],delete e[fx]}function es(e){var i=e[ce];if(i)return i;for(var a=e.parentNode;a;){if(i=a[ts]||a[ce]){if(a=i.alternate,i.child!==null||a!==null&&a.child!==null)for(e=Cg(e);e!==null;){if(a=e[ce])return a;e=Cg(e)}return i}e=a,a=e.parentNode}return null}function is(e){if(e=e[ce]||e[ts]){var i=e.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return e}return null}function ia(e){var i=e.tag;if(i===5||i===26||i===27||i===6)return e.stateNode;throw Error(s(33))}function ns(e){var i=e[af];return i||(i=e[af]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function le(e){e[ea]=!0}var lf=new Set,rf={};function Mn(e,i){ss(e,i),ss(e+"Capture",i)}function ss(e,i){for(rf[e]=i,e=0;e<i.length;e++)lf.add(i[e])}var dx=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),of={},uf={};function mx(e){return bl.call(uf,e)?!0:bl.call(of,e)?!1:dx.test(e)?uf[e]=!0:(of[e]=!0,!1)}function Cl(e,i,a){if(mx(i))if(a===null)e.removeAttribute(i);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(i);return;case"boolean":var o=i.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(i);return}}e.setAttribute(i,""+a)}}function Ml(e,i,a){if(a===null)e.removeAttribute(i);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttribute(i,""+a)}}function wi(e,i,a,o){if(o===null)e.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(i,a,""+o)}}function We(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function cf(e){var i=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function gx(e,i,a){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,i);if(!e.hasOwnProperty(i)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var f=o.get,d=o.set;return Object.defineProperty(e,i,{configurable:!0,get:function(){return f.call(this)},set:function(y){a=""+y,d.call(this,y)}}),Object.defineProperty(e,i,{enumerable:o.enumerable}),{getValue:function(){return a},setValue:function(y){a=""+y},stopTracking:function(){e._valueTracker=null,delete e[i]}}}}function vo(e){if(!e._valueTracker){var i=cf(e)?"checked":"value";e._valueTracker=gx(e,i,""+e[i])}}function hf(e){if(!e)return!1;var i=e._valueTracker;if(!i)return!0;var a=i.getValue(),o="";return e&&(o=cf(e)?e.checked?"true":"false":e.value),e=o,e!==a?(i.setValue(e),!0):!1}function El(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var px=/[\n"\\]/g;function Qe(e){return e.replace(px,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function So(e,i,a,o,f,d,y,v){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.type=y:e.removeAttribute("type"),i!=null?y==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+We(i)):e.value!==""+We(i)&&(e.value=""+We(i)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),i!=null?To(e,y,We(i)):a!=null?To(e,y,We(a)):o!=null&&e.removeAttribute("value"),f==null&&d!=null&&(e.defaultChecked=!!d),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.name=""+We(v):e.removeAttribute("name")}function ff(e,i,a,o,f,d,y,v){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),i!=null||a!=null){if(!(d!=="submit"&&d!=="reset"||i!=null)){vo(e);return}a=a!=null?""+We(a):"",i=i!=null?""+We(i):a,v||i===e.value||(e.value=i),e.defaultValue=i}o=o??f,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=v?e.checked:!!o,e.defaultChecked=!!o,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y),vo(e)}function To(e,i,a){i==="number"&&El(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function as(e,i,a,o){if(e=e.options,i){i={};for(var f=0;f<a.length;f++)i["$"+a[f]]=!0;for(a=0;a<e.length;a++)f=i.hasOwnProperty("$"+e[a].value),e[a].selected!==f&&(e[a].selected=f),f&&o&&(e[a].defaultSelected=!0)}else{for(a=""+We(a),i=null,f=0;f<e.length;f++){if(e[f].value===a){e[f].selected=!0,o&&(e[f].defaultSelected=!0);return}i!==null||e[f].disabled||(i=e[f])}i!==null&&(i.selected=!0)}}function df(e,i,a){if(i!=null&&(i=""+We(i),i!==e.value&&(e.value=i),a==null)){e.defaultValue!==i&&(e.defaultValue=i);return}e.defaultValue=a!=null?""+We(a):""}function mf(e,i,a,o){if(i==null){if(o!=null){if(a!=null)throw Error(s(92));if(wt(o)){if(1<o.length)throw Error(s(93));o=o[0]}a=o}a==null&&(a=""),i=a}a=We(i),e.defaultValue=a,o=e.textContent,o===a&&o!==""&&o!==null&&(e.value=o),vo(e)}function ls(e,i){if(i){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=i;return}}e.textContent=i}var yx=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function gf(e,i,a){var o=i.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?o?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="":o?e.setProperty(i,a):typeof a!="number"||a===0||yx.has(i)?i==="float"?e.cssFloat=a:e[i]=(""+a).trim():e[i]=a+"px"}function pf(e,i,a){if(i!=null&&typeof i!="object")throw Error(s(62));if(e=e.style,a!=null){for(var o in a)!a.hasOwnProperty(o)||i!=null&&i.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="");for(var f in i)o=i[f],i.hasOwnProperty(f)&&a[f]!==o&&gf(e,f,o)}else for(var d in i)i.hasOwnProperty(d)&&gf(e,d,i[d])}function wo(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var xx=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),_x=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Rl(e){return _x.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ai(){}var Ao=null;function Co(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var rs=null,os=null;function yf(e){var i=is(e);if(i&&(e=i.stateNode)){var a=e[Te]||null;t:switch(e=i.stateNode,i.type){case"input":if(So(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),i=a.name,a.type==="radio"&&i!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Qe(""+i)+'"][type="radio"]'),i=0;i<a.length;i++){var o=a[i];if(o!==e&&o.form===e.form){var f=o[Te]||null;if(!f)throw Error(s(90));So(o,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(i=0;i<a.length;i++)o=a[i],o.form===e.form&&hf(o)}break t;case"textarea":df(e,a.value,a.defaultValue);break t;case"select":i=a.value,i!=null&&as(e,!!a.multiple,i,!1)}}}var Mo=!1;function xf(e,i,a){if(Mo)return e(i,a);Mo=!0;try{var o=e(i);return o}finally{if(Mo=!1,(rs!==null||os!==null)&&(pr(),rs&&(i=rs,e=os,os=rs=null,yf(i),e)))for(i=0;i<e.length;i++)yf(e[i])}}function na(e,i){var a=e.stateNode;if(a===null)return null;var o=a[Te]||null;if(o===null)return null;a=o[i];t:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break t;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(s(231,i,typeof a));return a}var Ci=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Eo=!1;if(Ci)try{var sa={};Object.defineProperty(sa,"passive",{get:function(){Eo=!0}}),window.addEventListener("test",sa,sa),window.removeEventListener("test",sa,sa)}catch{Eo=!1}var $i=null,Ro=null,zl=null;function _f(){if(zl)return zl;var e,i=Ro,a=i.length,o,f="value"in $i?$i.value:$i.textContent,d=f.length;for(e=0;e<a&&i[e]===f[e];e++);var y=a-e;for(o=1;o<=y&&i[a-o]===f[d-o];o++);return zl=f.slice(e,1<o?1-o:void 0)}function Dl(e){var i=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&i===13&&(e=13)):e=i,e===10&&(e=13),32<=e||e===13?e:0}function Nl(){return!0}function bf(){return!1}function we(e){function i(a,o,f,d,y){this._reactName=a,this._targetInst=f,this.type=o,this.nativeEvent=d,this.target=y,this.currentTarget=null;for(var v in e)e.hasOwnProperty(v)&&(a=e[v],this[v]=a?a(d):d[v]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Nl:bf,this.isPropagationStopped=bf,this}return x(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Nl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Nl)},persist:function(){},isPersistent:Nl}),i}var En={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bl=we(En),aa=x({},En,{view:0,detail:0}),bx=we(aa),zo,Do,la,Ol=x({},aa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bo,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==la&&(la&&e.type==="mousemove"?(zo=e.screenX-la.screenX,Do=e.screenY-la.screenY):Do=zo=0,la=e),zo)},movementY:function(e){return"movementY"in e?e.movementY:Do}}),vf=we(Ol),vx=x({},Ol,{dataTransfer:0}),Sx=we(vx),Tx=x({},aa,{relatedTarget:0}),No=we(Tx),wx=x({},En,{animationName:0,elapsedTime:0,pseudoElement:0}),Ax=we(wx),Cx=x({},En,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Mx=we(Cx),Ex=x({},En,{data:0}),Sf=we(Ex),Rx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zx={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Dx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Nx(e){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(e):(e=Dx[e])?!!i[e]:!1}function Bo(){return Nx}var Bx=x({},aa,{key:function(e){if(e.key){var i=Rx[e.key]||e.key;if(i!=="Unidentified")return i}return e.type==="keypress"?(e=Dl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?zx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bo,charCode:function(e){return e.type==="keypress"?Dl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Dl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ox=we(Bx),Gx=x({},Ol,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Tf=we(Gx),kx=x({},aa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bo}),Ux=we(kx),jx=x({},En,{propertyName:0,elapsedTime:0,pseudoElement:0}),Hx=we(jx),Lx=x({},Ol,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Yx=we(Lx),qx=x({},En,{newState:0,oldState:0}),Xx=we(qx),Vx=[9,13,27,32],Oo=Ci&&"CompositionEvent"in window,ra=null;Ci&&"documentMode"in document&&(ra=document.documentMode);var Px=Ci&&"TextEvent"in window&&!ra,wf=Ci&&(!Oo||ra&&8<ra&&11>=ra),Af=" ",Cf=!1;function Mf(e,i){switch(e){case"keyup":return Vx.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ef(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var us=!1;function Fx(e,i){switch(e){case"compositionend":return Ef(i);case"keypress":return i.which!==32?null:(Cf=!0,Af);case"textInput":return e=i.data,e===Af&&Cf?null:e;default:return null}}function Wx(e,i){if(us)return e==="compositionend"||!Oo&&Mf(e,i)?(e=_f(),zl=Ro=$i=null,us=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return wf&&i.locale!=="ko"?null:i.data;default:return null}}var Qx={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Rf(e){var i=e&&e.nodeName&&e.nodeName.toLowerCase();return i==="input"?!!Qx[e.type]:i==="textarea"}function zf(e,i,a,o){rs?os?os.push(o):os=[o]:rs=o,i=Tr(i,"onChange"),0<i.length&&(a=new Bl("onChange","change",null,a,o),e.push({event:a,listeners:i}))}var oa=null,ua=null;function Zx(e){fg(e,0)}function Gl(e){var i=ia(e);if(hf(i))return e}function Df(e,i){if(e==="change")return i}var Nf=!1;if(Ci){var Go;if(Ci){var ko="oninput"in document;if(!ko){var Bf=document.createElement("div");Bf.setAttribute("oninput","return;"),ko=typeof Bf.oninput=="function"}Go=ko}else Go=!1;Nf=Go&&(!document.documentMode||9<document.documentMode)}function Of(){oa&&(oa.detachEvent("onpropertychange",Gf),ua=oa=null)}function Gf(e){if(e.propertyName==="value"&&Gl(ua)){var i=[];zf(i,ua,e,Co(e)),xf(Zx,i)}}function Ix(e,i,a){e==="focusin"?(Of(),oa=i,ua=a,oa.attachEvent("onpropertychange",Gf)):e==="focusout"&&Of()}function Kx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Gl(ua)}function $x(e,i){if(e==="click")return Gl(i)}function Jx(e,i){if(e==="input"||e==="change")return Gl(i)}function t_(e,i){return e===i&&(e!==0||1/e===1/i)||e!==e&&i!==i}var ke=typeof Object.is=="function"?Object.is:t_;function ca(e,i){if(ke(e,i))return!0;if(typeof e!="object"||e===null||typeof i!="object"||i===null)return!1;var a=Object.keys(e),o=Object.keys(i);if(a.length!==o.length)return!1;for(o=0;o<a.length;o++){var f=a[o];if(!bl.call(i,f)||!ke(e[f],i[f]))return!1}return!0}function kf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Uf(e,i){var a=kf(e);e=0;for(var o;a;){if(a.nodeType===3){if(o=e+a.textContent.length,e<=i&&o>=i)return{node:a,offset:i-e};e=o}t:{for(;a;){if(a.nextSibling){a=a.nextSibling;break t}a=a.parentNode}a=void 0}a=kf(a)}}function jf(e,i){return e&&i?e===i?!0:e&&e.nodeType===3?!1:i&&i.nodeType===3?jf(e,i.parentNode):"contains"in e?e.contains(i):e.compareDocumentPosition?!!(e.compareDocumentPosition(i)&16):!1:!1}function Hf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var i=El(e.document);i instanceof e.HTMLIFrameElement;){try{var a=typeof i.contentWindow.location.href=="string"}catch{a=!1}if(a)e=i.contentWindow;else break;i=El(e.document)}return i}function Uo(e){var i=e&&e.nodeName&&e.nodeName.toLowerCase();return i&&(i==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||i==="textarea"||e.contentEditable==="true")}var e_=Ci&&"documentMode"in document&&11>=document.documentMode,cs=null,jo=null,ha=null,Ho=!1;function Lf(e,i,a){var o=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Ho||cs==null||cs!==El(o)||(o=cs,"selectionStart"in o&&Uo(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),ha&&ca(ha,o)||(ha=o,o=Tr(jo,"onSelect"),0<o.length&&(i=new Bl("onSelect","select",null,i,a),e.push({event:i,listeners:o}),i.target=cs)))}function Rn(e,i){var a={};return a[e.toLowerCase()]=i.toLowerCase(),a["Webkit"+e]="webkit"+i,a["Moz"+e]="moz"+i,a}var hs={animationend:Rn("Animation","AnimationEnd"),animationiteration:Rn("Animation","AnimationIteration"),animationstart:Rn("Animation","AnimationStart"),transitionrun:Rn("Transition","TransitionRun"),transitionstart:Rn("Transition","TransitionStart"),transitioncancel:Rn("Transition","TransitionCancel"),transitionend:Rn("Transition","TransitionEnd")},Lo={},Yf={};Ci&&(Yf=document.createElement("div").style,"AnimationEvent"in window||(delete hs.animationend.animation,delete hs.animationiteration.animation,delete hs.animationstart.animation),"TransitionEvent"in window||delete hs.transitionend.transition);function zn(e){if(Lo[e])return Lo[e];if(!hs[e])return e;var i=hs[e],a;for(a in i)if(i.hasOwnProperty(a)&&a in Yf)return Lo[e]=i[a];return e}var qf=zn("animationend"),Xf=zn("animationiteration"),Vf=zn("animationstart"),i_=zn("transitionrun"),n_=zn("transitionstart"),s_=zn("transitioncancel"),Pf=zn("transitionend"),Ff=new Map,Yo="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Yo.push("scrollEnd");function hi(e,i){Ff.set(e,i),Mn(i,[e])}var kl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Ze=[],fs=0,qo=0;function Ul(){for(var e=fs,i=qo=fs=0;i<e;){var a=Ze[i];Ze[i++]=null;var o=Ze[i];Ze[i++]=null;var f=Ze[i];Ze[i++]=null;var d=Ze[i];if(Ze[i++]=null,o!==null&&f!==null){var y=o.pending;y===null?f.next=f:(f.next=y.next,y.next=f),o.pending=f}d!==0&&Wf(a,f,d)}}function jl(e,i,a,o){Ze[fs++]=e,Ze[fs++]=i,Ze[fs++]=a,Ze[fs++]=o,qo|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function Xo(e,i,a,o){return jl(e,i,a,o),Hl(e)}function Dn(e,i){return jl(e,null,null,i),Hl(e)}function Wf(e,i,a){e.lanes|=a;var o=e.alternate;o!==null&&(o.lanes|=a);for(var f=!1,d=e.return;d!==null;)d.childLanes|=a,o=d.alternate,o!==null&&(o.childLanes|=a),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(f=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,f&&i!==null&&(f=31-Ge(a),e=d.hiddenUpdates,o=e[f],o===null?e[f]=[i]:o.push(i),i.lane=a|536870912),d):null}function Hl(e){if(50<Ba)throw Ba=0,$u=null,Error(s(185));for(var i=e.return;i!==null;)e=i,i=e.return;return e.tag===3?e.stateNode:null}var ds={};function a_(e,i,a,o){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ue(e,i,a,o){return new a_(e,i,a,o)}function Vo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Mi(e,i){var a=e.alternate;return a===null?(a=Ue(e.tag,i,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=i,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,i=e.dependencies,a.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Qf(e,i){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=i,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,i=a.dependencies,e.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),e}function Ll(e,i,a,o,f,d){var y=0;if(o=e,typeof e=="function")Vo(e)&&(y=1);else if(typeof e=="string")y=c1(e,a,J.current)?26:e==="html"||e==="head"||e==="body"?27:5;else t:switch(e){case Q:return e=Ue(31,a,i,f),e.elementType=Q,e.lanes=d,e;case w:return Nn(a.children,f,d,i);case S:y=8,f|=24;break;case A:return e=Ue(12,a,i,f|2),e.elementType=A,e.lanes=d,e;case P:return e=Ue(13,a,i,f),e.elementType=P,e.lanes=d,e;case k:return e=Ue(19,a,i,f),e.elementType=k,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case E:y=10;break t;case C:y=9;break t;case G:y=11;break t;case B:y=14;break t;case K:y=16,o=null;break t}y=29,a=Error(s(130,e===null?"null":typeof e,"")),o=null}return i=Ue(y,a,i,f),i.elementType=e,i.type=o,i.lanes=d,i}function Nn(e,i,a,o){return e=Ue(7,e,o,i),e.lanes=a,e}function Po(e,i,a){return e=Ue(6,e,null,i),e.lanes=a,e}function Zf(e){var i=Ue(18,null,null,0);return i.stateNode=e,i}function Fo(e,i,a){return i=Ue(4,e.children!==null?e.children:[],e.key,i),i.lanes=a,i.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},i}var If=new WeakMap;function Ie(e,i){if(typeof e=="object"&&e!==null){var a=If.get(e);return a!==void 0?a:(i={value:e,source:i,stack:_l(i)},If.set(e,i),i)}return{value:e,source:i,stack:_l(i)}}var ms=[],gs=0,Yl=null,fa=0,Ke=[],$e=0,Ji=null,yi=1,xi="";function Ei(e,i){ms[gs++]=fa,ms[gs++]=Yl,Yl=e,fa=i}function Kf(e,i,a){Ke[$e++]=yi,Ke[$e++]=xi,Ke[$e++]=Ji,Ji=e;var o=yi;e=xi;var f=32-Ge(o)-1;o&=~(1<<f),a+=1;var d=32-Ge(i)+f;if(30<d){var y=f-f%5;d=(o&(1<<y)-1).toString(32),o>>=y,f-=y,yi=1<<32-Ge(i)+f|a<<f|o,xi=d+e}else yi=1<<d|a<<f|o,xi=e}function Wo(e){e.return!==null&&(Ei(e,1),Kf(e,1,0))}function Qo(e){for(;e===Yl;)Yl=ms[--gs],ms[gs]=null,fa=ms[--gs],ms[gs]=null;for(;e===Ji;)Ji=Ke[--$e],Ke[$e]=null,xi=Ke[--$e],Ke[$e]=null,yi=Ke[--$e],Ke[$e]=null}function $f(e,i){Ke[$e++]=yi,Ke[$e++]=xi,Ke[$e++]=Ji,yi=i.id,xi=i.overflow,Ji=e}var he=null,Ht=null,Tt=!1,tn=null,Je=!1,Zo=Error(s(519));function en(e){var i=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw da(Ie(i,e)),Zo}function Jf(e){var i=e.stateNode,a=e.type,o=e.memoizedProps;switch(i[ce]=e,i[Te]=o,a){case"dialog":_t("cancel",i),_t("close",i);break;case"iframe":case"object":case"embed":_t("load",i);break;case"video":case"audio":for(a=0;a<Ga.length;a++)_t(Ga[a],i);break;case"source":_t("error",i);break;case"img":case"image":case"link":_t("error",i),_t("load",i);break;case"details":_t("toggle",i);break;case"input":_t("invalid",i),ff(i,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":_t("invalid",i);break;case"textarea":_t("invalid",i),mf(i,o.value,o.defaultValue,o.children)}a=o.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||i.textContent===""+a||o.suppressHydrationWarning===!0||pg(i.textContent,a)?(o.popover!=null&&(_t("beforetoggle",i),_t("toggle",i)),o.onScroll!=null&&_t("scroll",i),o.onScrollEnd!=null&&_t("scrollend",i),o.onClick!=null&&(i.onclick=Ai),i=!0):i=!1,i||en(e,!0)}function td(e){for(he=e.return;he;)switch(he.tag){case 5:case 31:case 13:Je=!1;return;case 27:case 3:Je=!0;return;default:he=he.return}}function ps(e){if(e!==he)return!1;if(!Tt)return td(e),Tt=!0,!1;var i=e.tag,a;if((a=i!==3&&i!==27)&&((a=i===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||dc(e.type,e.memoizedProps)),a=!a),a&&Ht&&en(e),td(e),i===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));Ht=Ag(e)}else if(i===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));Ht=Ag(e)}else i===27?(i=Ht,pn(e.type)?(e=xc,xc=null,Ht=e):Ht=i):Ht=he?ei(e.stateNode.nextSibling):null;return!0}function Bn(){Ht=he=null,Tt=!1}function Io(){var e=tn;return e!==null&&(Ee===null?Ee=e:Ee.push.apply(Ee,e),tn=null),e}function da(e){tn===null?tn=[e]:tn.push(e)}var Ko=R(null),On=null,Ri=null;function nn(e,i,a){W(Ko,i._currentValue),i._currentValue=a}function zi(e){e._currentValue=Ko.current,q(Ko)}function $o(e,i,a){for(;e!==null;){var o=e.alternate;if((e.childLanes&i)!==i?(e.childLanes|=i,o!==null&&(o.childLanes|=i)):o!==null&&(o.childLanes&i)!==i&&(o.childLanes|=i),e===a)break;e=e.return}}function Jo(e,i,a,o){var f=e.child;for(f!==null&&(f.return=e);f!==null;){var d=f.dependencies;if(d!==null){var y=f.child;d=d.firstContext;t:for(;d!==null;){var v=d;d=f;for(var M=0;M<i.length;M++)if(v.context===i[M]){d.lanes|=a,v=d.alternate,v!==null&&(v.lanes|=a),$o(d.return,a,e),o||(y=null);break t}d=v.next}}else if(f.tag===18){if(y=f.return,y===null)throw Error(s(341));y.lanes|=a,d=y.alternate,d!==null&&(d.lanes|=a),$o(y,a,e),y=null}else y=f.child;if(y!==null)y.return=f;else for(y=f;y!==null;){if(y===e){y=null;break}if(f=y.sibling,f!==null){f.return=y.return,y=f;break}y=y.return}f=y}}function ys(e,i,a,o){e=null;for(var f=i,d=!1;f!==null;){if(!d){if((f.flags&524288)!==0)d=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var y=f.alternate;if(y===null)throw Error(s(387));if(y=y.memoizedProps,y!==null){var v=f.type;ke(f.pendingProps.value,y.value)||(e!==null?e.push(v):e=[v])}}else if(f===dt.current){if(y=f.alternate,y===null)throw Error(s(387));y.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(La):e=[La])}f=f.return}e!==null&&Jo(i,e,a,o),i.flags|=262144}function ql(e){for(e=e.firstContext;e!==null;){if(!ke(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Gn(e){On=e,Ri=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function fe(e){return ed(On,e)}function Xl(e,i){return On===null&&Gn(e),ed(e,i)}function ed(e,i){var a=i._currentValue;if(i={context:i,memoizedValue:a,next:null},Ri===null){if(e===null)throw Error(s(308));Ri=i,e.dependencies={lanes:0,firstContext:i},e.flags|=524288}else Ri=Ri.next=i;return a}var l_=typeof AbortController<"u"?AbortController:function(){var e=[],i=this.signal={aborted:!1,addEventListener:function(a,o){e.push(o)}};this.abort=function(){i.aborted=!0,e.forEach(function(a){return a()})}},r_=l.unstable_scheduleCallback,o_=l.unstable_NormalPriority,te={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function tu(){return{controller:new l_,data:new Map,refCount:0}}function ma(e){e.refCount--,e.refCount===0&&r_(o_,function(){e.controller.abort()})}var ga=null,eu=0,xs=0,_s=null;function u_(e,i){if(ga===null){var a=ga=[];eu=0,xs=sc(),_s={status:"pending",value:void 0,then:function(o){a.push(o)}}}return eu++,i.then(id,id),i}function id(){if(--eu===0&&ga!==null){_s!==null&&(_s.status="fulfilled");var e=ga;ga=null,xs=0,_s=null;for(var i=0;i<e.length;i++)(0,e[i])()}}function c_(e,i){var a=[],o={status:"pending",value:null,reason:null,then:function(f){a.push(f)}};return e.then(function(){o.status="fulfilled",o.value=i;for(var f=0;f<a.length;f++)(0,a[f])(i)},function(f){for(o.status="rejected",o.reason=f,f=0;f<a.length;f++)(0,a[f])(void 0)}),o}var nd=D.S;D.S=function(e,i){Lm=Be(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&u_(e,i),nd!==null&&nd(e,i)};var kn=R(null);function iu(){var e=kn.current;return e!==null?e:kt.pooledCache}function Vl(e,i){i===null?W(kn,kn.current):W(kn,i.pool)}function sd(){var e=iu();return e===null?null:{parent:te._currentValue,pool:e}}var bs=Error(s(460)),nu=Error(s(474)),Pl=Error(s(542)),Fl={then:function(){}};function ad(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ld(e,i,a){switch(a=e[a],a===void 0?e.push(i):a!==i&&(i.then(Ai,Ai),i=a),i.status){case"fulfilled":return i.value;case"rejected":throw e=i.reason,od(e),e;default:if(typeof i.status=="string")i.then(Ai,Ai);else{if(e=kt,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=i,e.status="pending",e.then(function(o){if(i.status==="pending"){var f=i;f.status="fulfilled",f.value=o}},function(o){if(i.status==="pending"){var f=i;f.status="rejected",f.reason=o}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw e=i.reason,od(e),e}throw jn=i,bs}}function Un(e){try{var i=e._init;return i(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(jn=a,bs):a}}var jn=null;function rd(){if(jn===null)throw Error(s(459));var e=jn;return jn=null,e}function od(e){if(e===bs||e===Pl)throw Error(s(483))}var vs=null,pa=0;function Wl(e){var i=pa;return pa+=1,vs===null&&(vs=[]),ld(vs,e,i)}function ya(e,i){i=i.props.ref,e.ref=i!==void 0?i:null}function Ql(e,i){throw i.$$typeof===b?Error(s(525)):(e=Object.prototype.toString.call(i),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":e)))}function ud(e){function i(N,z){if(e){var U=N.deletions;U===null?(N.deletions=[z],N.flags|=16):U.push(z)}}function a(N,z){if(!e)return null;for(;z!==null;)i(N,z),z=z.sibling;return null}function o(N){for(var z=new Map;N!==null;)N.key!==null?z.set(N.key,N):z.set(N.index,N),N=N.sibling;return z}function f(N,z){return N=Mi(N,z),N.index=0,N.sibling=null,N}function d(N,z,U){return N.index=U,e?(U=N.alternate,U!==null?(U=U.index,U<z?(N.flags|=67108866,z):U):(N.flags|=67108866,z)):(N.flags|=1048576,z)}function y(N){return e&&N.alternate===null&&(N.flags|=67108866),N}function v(N,z,U,V){return z===null||z.tag!==6?(z=Po(U,N.mode,V),z.return=N,z):(z=f(z,U),z.return=N,z)}function M(N,z,U,V){var ot=U.type;return ot===w?X(N,z,U.props.children,V,U.key):z!==null&&(z.elementType===ot||typeof ot=="object"&&ot!==null&&ot.$$typeof===K&&Un(ot)===z.type)?(z=f(z,U.props),ya(z,U),z.return=N,z):(z=Ll(U.type,U.key,U.props,null,N.mode,V),ya(z,U),z.return=N,z)}function j(N,z,U,V){return z===null||z.tag!==4||z.stateNode.containerInfo!==U.containerInfo||z.stateNode.implementation!==U.implementation?(z=Fo(U,N.mode,V),z.return=N,z):(z=f(z,U.children||[]),z.return=N,z)}function X(N,z,U,V,ot){return z===null||z.tag!==7?(z=Nn(U,N.mode,V,ot),z.return=N,z):(z=f(z,U),z.return=N,z)}function F(N,z,U){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=Po(""+z,N.mode,U),z.return=N,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case _:return U=Ll(z.type,z.key,z.props,null,N.mode,U),ya(U,z),U.return=N,U;case T:return z=Fo(z,N.mode,U),z.return=N,z;case K:return z=Un(z),F(N,z,U)}if(wt(z)||tt(z))return z=Nn(z,N.mode,U,null),z.return=N,z;if(typeof z.then=="function")return F(N,Wl(z),U);if(z.$$typeof===E)return F(N,Xl(N,z),U);Ql(N,z)}return null}function H(N,z,U,V){var ot=z!==null?z.key:null;if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return ot!==null?null:v(N,z,""+U,V);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case _:return U.key===ot?M(N,z,U,V):null;case T:return U.key===ot?j(N,z,U,V):null;case K:return U=Un(U),H(N,z,U,V)}if(wt(U)||tt(U))return ot!==null?null:X(N,z,U,V,null);if(typeof U.then=="function")return H(N,z,Wl(U),V);if(U.$$typeof===E)return H(N,z,Xl(N,U),V);Ql(N,U)}return null}function Y(N,z,U,V,ot){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return N=N.get(U)||null,v(z,N,""+V,ot);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case _:return N=N.get(V.key===null?U:V.key)||null,M(z,N,V,ot);case T:return N=N.get(V.key===null?U:V.key)||null,j(z,N,V,ot);case K:return V=Un(V),Y(N,z,U,V,ot)}if(wt(V)||tt(V))return N=N.get(U)||null,X(z,N,V,ot,null);if(typeof V.then=="function")return Y(N,z,U,Wl(V),ot);if(V.$$typeof===E)return Y(N,z,U,Xl(z,V),ot);Ql(z,V)}return null}function st(N,z,U,V){for(var ot=null,Ct=null,lt=z,pt=z=0,vt=null;lt!==null&&pt<U.length;pt++){lt.index>pt?(vt=lt,lt=null):vt=lt.sibling;var Mt=H(N,lt,U[pt],V);if(Mt===null){lt===null&&(lt=vt);break}e&&lt&&Mt.alternate===null&&i(N,lt),z=d(Mt,z,pt),Ct===null?ot=Mt:Ct.sibling=Mt,Ct=Mt,lt=vt}if(pt===U.length)return a(N,lt),Tt&&Ei(N,pt),ot;if(lt===null){for(;pt<U.length;pt++)lt=F(N,U[pt],V),lt!==null&&(z=d(lt,z,pt),Ct===null?ot=lt:Ct.sibling=lt,Ct=lt);return Tt&&Ei(N,pt),ot}for(lt=o(lt);pt<U.length;pt++)vt=Y(lt,N,pt,U[pt],V),vt!==null&&(e&&vt.alternate!==null&&lt.delete(vt.key===null?pt:vt.key),z=d(vt,z,pt),Ct===null?ot=vt:Ct.sibling=vt,Ct=vt);return e&&lt.forEach(function(vn){return i(N,vn)}),Tt&&Ei(N,pt),ot}function ut(N,z,U,V){if(U==null)throw Error(s(151));for(var ot=null,Ct=null,lt=z,pt=z=0,vt=null,Mt=U.next();lt!==null&&!Mt.done;pt++,Mt=U.next()){lt.index>pt?(vt=lt,lt=null):vt=lt.sibling;var vn=H(N,lt,Mt.value,V);if(vn===null){lt===null&&(lt=vt);break}e&&lt&&vn.alternate===null&&i(N,lt),z=d(vn,z,pt),Ct===null?ot=vn:Ct.sibling=vn,Ct=vn,lt=vt}if(Mt.done)return a(N,lt),Tt&&Ei(N,pt),ot;if(lt===null){for(;!Mt.done;pt++,Mt=U.next())Mt=F(N,Mt.value,V),Mt!==null&&(z=d(Mt,z,pt),Ct===null?ot=Mt:Ct.sibling=Mt,Ct=Mt);return Tt&&Ei(N,pt),ot}for(lt=o(lt);!Mt.done;pt++,Mt=U.next())Mt=Y(lt,N,pt,Mt.value,V),Mt!==null&&(e&&Mt.alternate!==null&&lt.delete(Mt.key===null?pt:Mt.key),z=d(Mt,z,pt),Ct===null?ot=Mt:Ct.sibling=Mt,Ct=Mt);return e&&lt.forEach(function(v1){return i(N,v1)}),Tt&&Ei(N,pt),ot}function Ot(N,z,U,V){if(typeof U=="object"&&U!==null&&U.type===w&&U.key===null&&(U=U.props.children),typeof U=="object"&&U!==null){switch(U.$$typeof){case _:t:{for(var ot=U.key;z!==null;){if(z.key===ot){if(ot=U.type,ot===w){if(z.tag===7){a(N,z.sibling),V=f(z,U.props.children),V.return=N,N=V;break t}}else if(z.elementType===ot||typeof ot=="object"&&ot!==null&&ot.$$typeof===K&&Un(ot)===z.type){a(N,z.sibling),V=f(z,U.props),ya(V,U),V.return=N,N=V;break t}a(N,z);break}else i(N,z);z=z.sibling}U.type===w?(V=Nn(U.props.children,N.mode,V,U.key),V.return=N,N=V):(V=Ll(U.type,U.key,U.props,null,N.mode,V),ya(V,U),V.return=N,N=V)}return y(N);case T:t:{for(ot=U.key;z!==null;){if(z.key===ot)if(z.tag===4&&z.stateNode.containerInfo===U.containerInfo&&z.stateNode.implementation===U.implementation){a(N,z.sibling),V=f(z,U.children||[]),V.return=N,N=V;break t}else{a(N,z);break}else i(N,z);z=z.sibling}V=Fo(U,N.mode,V),V.return=N,N=V}return y(N);case K:return U=Un(U),Ot(N,z,U,V)}if(wt(U))return st(N,z,U,V);if(tt(U)){if(ot=tt(U),typeof ot!="function")throw Error(s(150));return U=ot.call(U),ut(N,z,U,V)}if(typeof U.then=="function")return Ot(N,z,Wl(U),V);if(U.$$typeof===E)return Ot(N,z,Xl(N,U),V);Ql(N,U)}return typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint"?(U=""+U,z!==null&&z.tag===6?(a(N,z.sibling),V=f(z,U),V.return=N,N=V):(a(N,z),V=Po(U,N.mode,V),V.return=N,N=V),y(N)):a(N,z)}return function(N,z,U,V){try{pa=0;var ot=Ot(N,z,U,V);return vs=null,ot}catch(lt){if(lt===bs||lt===Pl)throw lt;var Ct=Ue(29,lt,null,N.mode);return Ct.lanes=V,Ct.return=N,Ct}finally{}}}var Hn=ud(!0),cd=ud(!1),sn=!1;function su(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function au(e,i){e=e.updateQueue,i.updateQueue===e&&(i.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function an(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ln(e,i,a){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Rt&2)!==0){var f=o.pending;return f===null?i.next=i:(i.next=f.next,f.next=i),o.pending=i,i=Hl(e),Wf(e,null,a),i}return jl(e,o,i,a),Hl(e)}function xa(e,i,a){if(i=i.updateQueue,i!==null&&(i=i.shared,(a&4194048)!==0)){var o=i.lanes;o&=e.pendingLanes,a|=o,i.lanes=a,tf(e,a)}}function lu(e,i){var a=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,a===o)){var f=null,d=null;if(a=a.firstBaseUpdate,a!==null){do{var y={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};d===null?f=d=y:d=d.next=y,a=a.next}while(a!==null);d===null?f=d=i:d=d.next=i}else f=d=i;a={baseState:o.baseState,firstBaseUpdate:f,lastBaseUpdate:d,shared:o.shared,callbacks:o.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=i:e.next=i,a.lastBaseUpdate=i}var ru=!1;function _a(){if(ru){var e=_s;if(e!==null)throw e}}function ba(e,i,a,o){ru=!1;var f=e.updateQueue;sn=!1;var d=f.firstBaseUpdate,y=f.lastBaseUpdate,v=f.shared.pending;if(v!==null){f.shared.pending=null;var M=v,j=M.next;M.next=null,y===null?d=j:y.next=j,y=M;var X=e.alternate;X!==null&&(X=X.updateQueue,v=X.lastBaseUpdate,v!==y&&(v===null?X.firstBaseUpdate=j:v.next=j,X.lastBaseUpdate=M))}if(d!==null){var F=f.baseState;y=0,X=j=M=null,v=d;do{var H=v.lane&-536870913,Y=H!==v.lane;if(Y?(bt&H)===H:(o&H)===H){H!==0&&H===xs&&(ru=!0),X!==null&&(X=X.next={lane:0,tag:v.tag,payload:v.payload,callback:null,next:null});t:{var st=e,ut=v;H=i;var Ot=a;switch(ut.tag){case 1:if(st=ut.payload,typeof st=="function"){F=st.call(Ot,F,H);break t}F=st;break t;case 3:st.flags=st.flags&-65537|128;case 0:if(st=ut.payload,H=typeof st=="function"?st.call(Ot,F,H):st,H==null)break t;F=x({},F,H);break t;case 2:sn=!0}}H=v.callback,H!==null&&(e.flags|=64,Y&&(e.flags|=8192),Y=f.callbacks,Y===null?f.callbacks=[H]:Y.push(H))}else Y={lane:H,tag:v.tag,payload:v.payload,callback:v.callback,next:null},X===null?(j=X=Y,M=F):X=X.next=Y,y|=H;if(v=v.next,v===null){if(v=f.shared.pending,v===null)break;Y=v,v=Y.next,Y.next=null,f.lastBaseUpdate=Y,f.shared.pending=null}}while(!0);X===null&&(M=F),f.baseState=M,f.firstBaseUpdate=j,f.lastBaseUpdate=X,d===null&&(f.shared.lanes=0),hn|=y,e.lanes=y,e.memoizedState=F}}function hd(e,i){if(typeof e!="function")throw Error(s(191,e));e.call(i)}function fd(e,i){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)hd(a[e],i)}var Ss=R(null),Zl=R(0);function dd(e,i){e=Hi,W(Zl,e),W(Ss,i),Hi=e|i.baseLanes}function ou(){W(Zl,Hi),W(Ss,Ss.current)}function uu(){Hi=Zl.current,q(Ss),q(Zl)}var je=R(null),ti=null;function rn(e){var i=e.alternate;W(It,It.current&1),W(je,e),ti===null&&(i===null||Ss.current!==null||i.memoizedState!==null)&&(ti=e)}function cu(e){W(It,It.current),W(je,e),ti===null&&(ti=e)}function md(e){e.tag===22?(W(It,It.current),W(je,e),ti===null&&(ti=e)):on()}function on(){W(It,It.current),W(je,je.current)}function He(e){q(je),ti===e&&(ti=null),q(It)}var It=R(0);function Il(e){for(var i=e;i!==null;){if(i.tag===13){var a=i.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||pc(a)||yc(a)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break;for(;i.sibling===null;){if(i.return===null||i.return===e)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Di=0,gt=null,Nt=null,ee=null,Kl=!1,Ts=!1,Ln=!1,$l=0,va=0,ws=null,h_=0;function Pt(){throw Error(s(321))}function hu(e,i){if(i===null)return!1;for(var a=0;a<i.length&&a<e.length;a++)if(!ke(e[a],i[a]))return!1;return!0}function fu(e,i,a,o,f,d){return Di=d,gt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,D.H=e===null||e.memoizedState===null?Kd:Mu,Ln=!1,d=a(o,f),Ln=!1,Ts&&(d=pd(i,a,o,f)),gd(e),d}function gd(e){D.H=wa;var i=Nt!==null&&Nt.next!==null;if(Di=0,ee=Nt=gt=null,Kl=!1,va=0,ws=null,i)throw Error(s(300));e===null||ie||(e=e.dependencies,e!==null&&ql(e)&&(ie=!0))}function pd(e,i,a,o){gt=e;var f=0;do{if(Ts&&(ws=null),va=0,Ts=!1,25<=f)throw Error(s(301));if(f+=1,ee=Nt=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}D.H=$d,d=i(a,o)}while(Ts);return d}function f_(){var e=D.H,i=e.useState()[0];return i=typeof i.then=="function"?Sa(i):i,e=e.useState()[0],(Nt!==null?Nt.memoizedState:null)!==e&&(gt.flags|=1024),i}function du(){var e=$l!==0;return $l=0,e}function mu(e,i,a){i.updateQueue=e.updateQueue,i.flags&=-2053,e.lanes&=~a}function gu(e){if(Kl){for(e=e.memoizedState;e!==null;){var i=e.queue;i!==null&&(i.pending=null),e=e.next}Kl=!1}Di=0,ee=Nt=gt=null,Ts=!1,va=$l=0,ws=null}function be(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ee===null?gt.memoizedState=ee=e:ee=ee.next=e,ee}function Kt(){if(Nt===null){var e=gt.alternate;e=e!==null?e.memoizedState:null}else e=Nt.next;var i=ee===null?gt.memoizedState:ee.next;if(i!==null)ee=i,Nt=e;else{if(e===null)throw gt.alternate===null?Error(s(467)):Error(s(310));Nt=e,e={memoizedState:Nt.memoizedState,baseState:Nt.baseState,baseQueue:Nt.baseQueue,queue:Nt.queue,next:null},ee===null?gt.memoizedState=ee=e:ee=ee.next=e}return ee}function Jl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Sa(e){var i=va;return va+=1,ws===null&&(ws=[]),e=ld(ws,e,i),i=gt,(ee===null?i.memoizedState:ee.next)===null&&(i=i.alternate,D.H=i===null||i.memoizedState===null?Kd:Mu),e}function tr(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Sa(e);if(e.$$typeof===E)return fe(e)}throw Error(s(438,String(e)))}function pu(e){var i=null,a=gt.updateQueue;if(a!==null&&(i=a.memoCache),i==null){var o=gt.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(i={data:o.data.map(function(f){return f.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),a===null&&(a=Jl(),gt.updateQueue=a),a.memoCache=i,a=i.data[i.index],a===void 0)for(a=i.data[i.index]=Array(e),o=0;o<e;o++)a[o]=Z;return i.index++,a}function Ni(e,i){return typeof i=="function"?i(e):i}function er(e){var i=Kt();return yu(i,Nt,e)}function yu(e,i,a){var o=e.queue;if(o===null)throw Error(s(311));o.lastRenderedReducer=a;var f=e.baseQueue,d=o.pending;if(d!==null){if(f!==null){var y=f.next;f.next=d.next,d.next=y}i.baseQueue=f=d,o.pending=null}if(d=e.baseState,f===null)e.memoizedState=d;else{i=f.next;var v=y=null,M=null,j=i,X=!1;do{var F=j.lane&-536870913;if(F!==j.lane?(bt&F)===F:(Di&F)===F){var H=j.revertLane;if(H===0)M!==null&&(M=M.next={lane:0,revertLane:0,gesture:null,action:j.action,hasEagerState:j.hasEagerState,eagerState:j.eagerState,next:null}),F===xs&&(X=!0);else if((Di&H)===H){j=j.next,H===xs&&(X=!0);continue}else F={lane:0,revertLane:j.revertLane,gesture:null,action:j.action,hasEagerState:j.hasEagerState,eagerState:j.eagerState,next:null},M===null?(v=M=F,y=d):M=M.next=F,gt.lanes|=H,hn|=H;F=j.action,Ln&&a(d,F),d=j.hasEagerState?j.eagerState:a(d,F)}else H={lane:F,revertLane:j.revertLane,gesture:j.gesture,action:j.action,hasEagerState:j.hasEagerState,eagerState:j.eagerState,next:null},M===null?(v=M=H,y=d):M=M.next=H,gt.lanes|=F,hn|=F;j=j.next}while(j!==null&&j!==i);if(M===null?y=d:M.next=v,!ke(d,e.memoizedState)&&(ie=!0,X&&(a=_s,a!==null)))throw a;e.memoizedState=d,e.baseState=y,e.baseQueue=M,o.lastRenderedState=d}return f===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function xu(e){var i=Kt(),a=i.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=e;var o=a.dispatch,f=a.pending,d=i.memoizedState;if(f!==null){a.pending=null;var y=f=f.next;do d=e(d,y.action),y=y.next;while(y!==f);ke(d,i.memoizedState)||(ie=!0),i.memoizedState=d,i.baseQueue===null&&(i.baseState=d),a.lastRenderedState=d}return[d,o]}function yd(e,i,a){var o=gt,f=Kt(),d=Tt;if(d){if(a===void 0)throw Error(s(407));a=a()}else a=i();var y=!ke((Nt||f).memoizedState,a);if(y&&(f.memoizedState=a,ie=!0),f=f.queue,vu(bd.bind(null,o,f,e),[e]),f.getSnapshot!==i||y||ee!==null&&ee.memoizedState.tag&1){if(o.flags|=2048,As(9,{destroy:void 0},_d.bind(null,o,f,a,i),null),kt===null)throw Error(s(349));d||(Di&127)!==0||xd(o,i,a)}return a}function xd(e,i,a){e.flags|=16384,e={getSnapshot:i,value:a},i=gt.updateQueue,i===null?(i=Jl(),gt.updateQueue=i,i.stores=[e]):(a=i.stores,a===null?i.stores=[e]:a.push(e))}function _d(e,i,a,o){i.value=a,i.getSnapshot=o,vd(i)&&Sd(e)}function bd(e,i,a){return a(function(){vd(i)&&Sd(e)})}function vd(e){var i=e.getSnapshot;e=e.value;try{var a=i();return!ke(e,a)}catch{return!0}}function Sd(e){var i=Dn(e,2);i!==null&&Re(i,e,2)}function _u(e){var i=be();if(typeof e=="function"){var a=e;if(e=a(),Ln){Ii(!0);try{a()}finally{Ii(!1)}}}return i.memoizedState=i.baseState=e,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ni,lastRenderedState:e},i}function Td(e,i,a,o){return e.baseState=a,yu(e,Nt,typeof o=="function"?o:Ni)}function d_(e,i,a,o,f){if(sr(e))throw Error(s(485));if(e=i.action,e!==null){var d={payload:f,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){d.listeners.push(y)}};D.T!==null?a(!0):d.isTransition=!1,o(d),a=i.pending,a===null?(d.next=i.pending=d,wd(i,d)):(d.next=a.next,i.pending=a.next=d)}}function wd(e,i){var a=i.action,o=i.payload,f=e.state;if(i.isTransition){var d=D.T,y={};D.T=y;try{var v=a(f,o),M=D.S;M!==null&&M(y,v),Ad(e,i,v)}catch(j){bu(e,i,j)}finally{d!==null&&y.types!==null&&(d.types=y.types),D.T=d}}else try{d=a(f,o),Ad(e,i,d)}catch(j){bu(e,i,j)}}function Ad(e,i,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(o){Cd(e,i,o)},function(o){return bu(e,i,o)}):Cd(e,i,a)}function Cd(e,i,a){i.status="fulfilled",i.value=a,Md(i),e.state=a,i=e.pending,i!==null&&(a=i.next,a===i?e.pending=null:(a=a.next,i.next=a,wd(e,a)))}function bu(e,i,a){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do i.status="rejected",i.reason=a,Md(i),i=i.next;while(i!==o)}e.action=null}function Md(e){e=e.listeners;for(var i=0;i<e.length;i++)(0,e[i])()}function Ed(e,i){return i}function Rd(e,i){if(Tt){var a=kt.formState;if(a!==null){t:{var o=gt;if(Tt){if(Ht){e:{for(var f=Ht,d=Je;f.nodeType!==8;){if(!d){f=null;break e}if(f=ei(f.nextSibling),f===null){f=null;break e}}d=f.data,f=d==="F!"||d==="F"?f:null}if(f){Ht=ei(f.nextSibling),o=f.data==="F!";break t}}en(o)}o=!1}o&&(i=a[0])}}return a=be(),a.memoizedState=a.baseState=i,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ed,lastRenderedState:i},a.queue=o,a=Qd.bind(null,gt,o),o.dispatch=a,o=_u(!1),d=Cu.bind(null,gt,!1,o.queue),o=be(),f={state:i,dispatch:null,action:e,pending:null},o.queue=f,a=d_.bind(null,gt,f,d,a),f.dispatch=a,o.memoizedState=e,[i,a,!1]}function zd(e){var i=Kt();return Dd(i,Nt,e)}function Dd(e,i,a){if(i=yu(e,i,Ed)[0],e=er(Ni)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var o=Sa(i)}catch(y){throw y===bs?Pl:y}else o=i;i=Kt();var f=i.queue,d=f.dispatch;return a!==i.memoizedState&&(gt.flags|=2048,As(9,{destroy:void 0},m_.bind(null,f,a),null)),[o,d,e]}function m_(e,i){e.action=i}function Nd(e){var i=Kt(),a=Nt;if(a!==null)return Dd(i,a,e);Kt(),i=i.memoizedState,a=Kt();var o=a.queue.dispatch;return a.memoizedState=e,[i,o,!1]}function As(e,i,a,o){return e={tag:e,create:a,deps:o,inst:i,next:null},i=gt.updateQueue,i===null&&(i=Jl(),gt.updateQueue=i),a=i.lastEffect,a===null?i.lastEffect=e.next=e:(o=a.next,a.next=e,e.next=o,i.lastEffect=e),e}function Bd(){return Kt().memoizedState}function ir(e,i,a,o){var f=be();gt.flags|=e,f.memoizedState=As(1|i,{destroy:void 0},a,o===void 0?null:o)}function nr(e,i,a,o){var f=Kt();o=o===void 0?null:o;var d=f.memoizedState.inst;Nt!==null&&o!==null&&hu(o,Nt.memoizedState.deps)?f.memoizedState=As(i,d,a,o):(gt.flags|=e,f.memoizedState=As(1|i,d,a,o))}function Od(e,i){ir(8390656,8,e,i)}function vu(e,i){nr(2048,8,e,i)}function g_(e){gt.flags|=4;var i=gt.updateQueue;if(i===null)i=Jl(),gt.updateQueue=i,i.events=[e];else{var a=i.events;a===null?i.events=[e]:a.push(e)}}function Gd(e){var i=Kt().memoizedState;return g_({ref:i,nextImpl:e}),function(){if((Rt&2)!==0)throw Error(s(440));return i.impl.apply(void 0,arguments)}}function kd(e,i){return nr(4,2,e,i)}function Ud(e,i){return nr(4,4,e,i)}function jd(e,i){if(typeof i=="function"){e=e();var a=i(e);return function(){typeof a=="function"?a():i(null)}}if(i!=null)return e=e(),i.current=e,function(){i.current=null}}function Hd(e,i,a){a=a!=null?a.concat([e]):null,nr(4,4,jd.bind(null,i,e),a)}function Su(){}function Ld(e,i){var a=Kt();i=i===void 0?null:i;var o=a.memoizedState;return i!==null&&hu(i,o[1])?o[0]:(a.memoizedState=[e,i],e)}function Yd(e,i){var a=Kt();i=i===void 0?null:i;var o=a.memoizedState;if(i!==null&&hu(i,o[1]))return o[0];if(o=e(),Ln){Ii(!0);try{e()}finally{Ii(!1)}}return a.memoizedState=[o,i],o}function Tu(e,i,a){return a===void 0||(Di&1073741824)!==0&&(bt&261930)===0?e.memoizedState=i:(e.memoizedState=a,e=qm(),gt.lanes|=e,hn|=e,a)}function qd(e,i,a,o){return ke(a,i)?a:Ss.current!==null?(e=Tu(e,a,o),ke(e,i)||(ie=!0),e):(Di&42)===0||(Di&1073741824)!==0&&(bt&261930)===0?(ie=!0,e.memoizedState=a):(e=qm(),gt.lanes|=e,hn|=e,i)}function Xd(e,i,a,o,f){var d=L.p;L.p=d!==0&&8>d?d:8;var y=D.T,v={};D.T=v,Cu(e,!1,i,a);try{var M=f(),j=D.S;if(j!==null&&j(v,M),M!==null&&typeof M=="object"&&typeof M.then=="function"){var X=c_(M,o);Ta(e,i,X,qe(e))}else Ta(e,i,o,qe(e))}catch(F){Ta(e,i,{then:function(){},status:"rejected",reason:F},qe())}finally{L.p=d,y!==null&&v.types!==null&&(y.types=v.types),D.T=y}}function p_(){}function wu(e,i,a,o){if(e.tag!==5)throw Error(s(476));var f=Vd(e).queue;Xd(e,f,i,et,a===null?p_:function(){return Pd(e),a(o)})}function Vd(e){var i=e.memoizedState;if(i!==null)return i;i={memoizedState:et,baseState:et,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ni,lastRenderedState:et},next:null};var a={};return i.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ni,lastRenderedState:a},next:null},e.memoizedState=i,e=e.alternate,e!==null&&(e.memoizedState=i),i}function Pd(e){var i=Vd(e);i.next===null&&(i=e.alternate.memoizedState),Ta(e,i.next.queue,{},qe())}function Au(){return fe(La)}function Fd(){return Kt().memoizedState}function Wd(){return Kt().memoizedState}function y_(e){for(var i=e.return;i!==null;){switch(i.tag){case 24:case 3:var a=qe();e=an(a);var o=ln(i,e,a);o!==null&&(Re(o,i,a),xa(o,i,a)),i={cache:tu()},e.payload=i;return}i=i.return}}function x_(e,i,a){var o=qe();a={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},sr(e)?Zd(i,a):(a=Xo(e,i,a,o),a!==null&&(Re(a,e,o),Id(a,i,o)))}function Qd(e,i,a){var o=qe();Ta(e,i,a,o)}function Ta(e,i,a,o){var f={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(sr(e))Zd(i,f);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=i.lastRenderedReducer,d!==null))try{var y=i.lastRenderedState,v=d(y,a);if(f.hasEagerState=!0,f.eagerState=v,ke(v,y))return jl(e,i,f,0),kt===null&&Ul(),!1}catch{}finally{}if(a=Xo(e,i,f,o),a!==null)return Re(a,e,o),Id(a,i,o),!0}return!1}function Cu(e,i,a,o){if(o={lane:2,revertLane:sc(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},sr(e)){if(i)throw Error(s(479))}else i=Xo(e,a,o,2),i!==null&&Re(i,e,2)}function sr(e){var i=e.alternate;return e===gt||i!==null&&i===gt}function Zd(e,i){Ts=Kl=!0;var a=e.pending;a===null?i.next=i:(i.next=a.next,a.next=i),e.pending=i}function Id(e,i,a){if((a&4194048)!==0){var o=i.lanes;o&=e.pendingLanes,a|=o,i.lanes=a,tf(e,a)}}var wa={readContext:fe,use:tr,useCallback:Pt,useContext:Pt,useEffect:Pt,useImperativeHandle:Pt,useLayoutEffect:Pt,useInsertionEffect:Pt,useMemo:Pt,useReducer:Pt,useRef:Pt,useState:Pt,useDebugValue:Pt,useDeferredValue:Pt,useTransition:Pt,useSyncExternalStore:Pt,useId:Pt,useHostTransitionStatus:Pt,useFormState:Pt,useActionState:Pt,useOptimistic:Pt,useMemoCache:Pt,useCacheRefresh:Pt};wa.useEffectEvent=Pt;var Kd={readContext:fe,use:tr,useCallback:function(e,i){return be().memoizedState=[e,i===void 0?null:i],e},useContext:fe,useEffect:Od,useImperativeHandle:function(e,i,a){a=a!=null?a.concat([e]):null,ir(4194308,4,jd.bind(null,i,e),a)},useLayoutEffect:function(e,i){return ir(4194308,4,e,i)},useInsertionEffect:function(e,i){ir(4,2,e,i)},useMemo:function(e,i){var a=be();i=i===void 0?null:i;var o=e();if(Ln){Ii(!0);try{e()}finally{Ii(!1)}}return a.memoizedState=[o,i],o},useReducer:function(e,i,a){var o=be();if(a!==void 0){var f=a(i);if(Ln){Ii(!0);try{a(i)}finally{Ii(!1)}}}else f=i;return o.memoizedState=o.baseState=f,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:f},o.queue=e,e=e.dispatch=x_.bind(null,gt,e),[o.memoizedState,e]},useRef:function(e){var i=be();return e={current:e},i.memoizedState=e},useState:function(e){e=_u(e);var i=e.queue,a=Qd.bind(null,gt,i);return i.dispatch=a,[e.memoizedState,a]},useDebugValue:Su,useDeferredValue:function(e,i){var a=be();return Tu(a,e,i)},useTransition:function(){var e=_u(!1);return e=Xd.bind(null,gt,e.queue,!0,!1),be().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,i,a){var o=gt,f=be();if(Tt){if(a===void 0)throw Error(s(407));a=a()}else{if(a=i(),kt===null)throw Error(s(349));(bt&127)!==0||xd(o,i,a)}f.memoizedState=a;var d={value:a,getSnapshot:i};return f.queue=d,Od(bd.bind(null,o,d,e),[e]),o.flags|=2048,As(9,{destroy:void 0},_d.bind(null,o,d,a,i),null),a},useId:function(){var e=be(),i=kt.identifierPrefix;if(Tt){var a=xi,o=yi;a=(o&~(1<<32-Ge(o)-1)).toString(32)+a,i="_"+i+"R_"+a,a=$l++,0<a&&(i+="H"+a.toString(32)),i+="_"}else a=h_++,i="_"+i+"r_"+a.toString(32)+"_";return e.memoizedState=i},useHostTransitionStatus:Au,useFormState:Rd,useActionState:Rd,useOptimistic:function(e){var i=be();i.memoizedState=i.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=a,i=Cu.bind(null,gt,!0,a),a.dispatch=i,[e,i]},useMemoCache:pu,useCacheRefresh:function(){return be().memoizedState=y_.bind(null,gt)},useEffectEvent:function(e){var i=be(),a={impl:e};return i.memoizedState=a,function(){if((Rt&2)!==0)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},Mu={readContext:fe,use:tr,useCallback:Ld,useContext:fe,useEffect:vu,useImperativeHandle:Hd,useInsertionEffect:kd,useLayoutEffect:Ud,useMemo:Yd,useReducer:er,useRef:Bd,useState:function(){return er(Ni)},useDebugValue:Su,useDeferredValue:function(e,i){var a=Kt();return qd(a,Nt.memoizedState,e,i)},useTransition:function(){var e=er(Ni)[0],i=Kt().memoizedState;return[typeof e=="boolean"?e:Sa(e),i]},useSyncExternalStore:yd,useId:Fd,useHostTransitionStatus:Au,useFormState:zd,useActionState:zd,useOptimistic:function(e,i){var a=Kt();return Td(a,Nt,e,i)},useMemoCache:pu,useCacheRefresh:Wd};Mu.useEffectEvent=Gd;var $d={readContext:fe,use:tr,useCallback:Ld,useContext:fe,useEffect:vu,useImperativeHandle:Hd,useInsertionEffect:kd,useLayoutEffect:Ud,useMemo:Yd,useReducer:xu,useRef:Bd,useState:function(){return xu(Ni)},useDebugValue:Su,useDeferredValue:function(e,i){var a=Kt();return Nt===null?Tu(a,e,i):qd(a,Nt.memoizedState,e,i)},useTransition:function(){var e=xu(Ni)[0],i=Kt().memoizedState;return[typeof e=="boolean"?e:Sa(e),i]},useSyncExternalStore:yd,useId:Fd,useHostTransitionStatus:Au,useFormState:Nd,useActionState:Nd,useOptimistic:function(e,i){var a=Kt();return Nt!==null?Td(a,Nt,e,i):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:pu,useCacheRefresh:Wd};$d.useEffectEvent=Gd;function Eu(e,i,a,o){i=e.memoizedState,a=a(o,i),a=a==null?i:x({},i,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Ru={enqueueSetState:function(e,i,a){e=e._reactInternals;var o=qe(),f=an(o);f.payload=i,a!=null&&(f.callback=a),i=ln(e,f,o),i!==null&&(Re(i,e,o),xa(i,e,o))},enqueueReplaceState:function(e,i,a){e=e._reactInternals;var o=qe(),f=an(o);f.tag=1,f.payload=i,a!=null&&(f.callback=a),i=ln(e,f,o),i!==null&&(Re(i,e,o),xa(i,e,o))},enqueueForceUpdate:function(e,i){e=e._reactInternals;var a=qe(),o=an(a);o.tag=2,i!=null&&(o.callback=i),i=ln(e,o,a),i!==null&&(Re(i,e,a),xa(i,e,a))}};function Jd(e,i,a,o,f,d,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,d,y):i.prototype&&i.prototype.isPureReactComponent?!ca(a,o)||!ca(f,d):!0}function tm(e,i,a,o){e=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(a,o),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(a,o),i.state!==e&&Ru.enqueueReplaceState(i,i.state,null)}function Yn(e,i){var a=i;if("ref"in i){a={};for(var o in i)o!=="ref"&&(a[o]=i[o])}if(e=e.defaultProps){a===i&&(a=x({},a));for(var f in e)a[f]===void 0&&(a[f]=e[f])}return a}function em(e){kl(e)}function im(e){console.error(e)}function nm(e){kl(e)}function ar(e,i){try{var a=e.onUncaughtError;a(i.value,{componentStack:i.stack})}catch(o){setTimeout(function(){throw o})}}function sm(e,i,a){try{var o=e.onCaughtError;o(a.value,{componentStack:a.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function zu(e,i,a){return a=an(a),a.tag=3,a.payload={element:null},a.callback=function(){ar(e,i)},a}function am(e){return e=an(e),e.tag=3,e}function lm(e,i,a,o){var f=a.type.getDerivedStateFromError;if(typeof f=="function"){var d=o.value;e.payload=function(){return f(d)},e.callback=function(){sm(i,a,o)}}var y=a.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(e.callback=function(){sm(i,a,o),typeof f!="function"&&(fn===null?fn=new Set([this]):fn.add(this));var v=o.stack;this.componentDidCatch(o.value,{componentStack:v!==null?v:""})})}function __(e,i,a,o,f){if(a.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(i=a.alternate,i!==null&&ys(i,a,f,!0),a=je.current,a!==null){switch(a.tag){case 31:case 13:return ti===null?yr():a.alternate===null&&Ft===0&&(Ft=3),a.flags&=-257,a.flags|=65536,a.lanes=f,o===Fl?a.flags|=16384:(i=a.updateQueue,i===null?a.updateQueue=new Set([o]):i.add(o),ec(e,o,f)),!1;case 22:return a.flags|=65536,o===Fl?a.flags|=16384:(i=a.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([o])},a.updateQueue=i):(a=i.retryQueue,a===null?i.retryQueue=new Set([o]):a.add(o)),ec(e,o,f)),!1}throw Error(s(435,a.tag))}return ec(e,o,f),yr(),!1}if(Tt)return i=je.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=f,o!==Zo&&(e=Error(s(422),{cause:o}),da(Ie(e,a)))):(o!==Zo&&(i=Error(s(423),{cause:o}),da(Ie(i,a))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,o=Ie(o,a),f=zu(e.stateNode,o,f),lu(e,f),Ft!==4&&(Ft=2)),!1;var d=Error(s(520),{cause:o});if(d=Ie(d,a),Na===null?Na=[d]:Na.push(d),Ft!==4&&(Ft=2),i===null)return!0;o=Ie(o,a),a=i;do{switch(a.tag){case 3:return a.flags|=65536,e=f&-f,a.lanes|=e,e=zu(a.stateNode,o,e),lu(a,e),!1;case 1:if(i=a.type,d=a.stateNode,(a.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(fn===null||!fn.has(d))))return a.flags|=65536,f&=-f,a.lanes|=f,f=am(f),lm(f,e,a,o),lu(a,f),!1}a=a.return}while(a!==null);return!1}var Du=Error(s(461)),ie=!1;function de(e,i,a,o){i.child=e===null?cd(i,null,a,o):Hn(i,e.child,a,o)}function rm(e,i,a,o,f){a=a.render;var d=i.ref;if("ref"in o){var y={};for(var v in o)v!=="ref"&&(y[v]=o[v])}else y=o;return Gn(i),o=fu(e,i,a,y,d,f),v=du(),e!==null&&!ie?(mu(e,i,f),Bi(e,i,f)):(Tt&&v&&Wo(i),i.flags|=1,de(e,i,o,f),i.child)}function om(e,i,a,o,f){if(e===null){var d=a.type;return typeof d=="function"&&!Vo(d)&&d.defaultProps===void 0&&a.compare===null?(i.tag=15,i.type=d,um(e,i,d,o,f)):(e=Ll(a.type,null,o,i,i.mode,f),e.ref=i.ref,e.return=i,i.child=e)}if(d=e.child,!Hu(e,f)){var y=d.memoizedProps;if(a=a.compare,a=a!==null?a:ca,a(y,o)&&e.ref===i.ref)return Bi(e,i,f)}return i.flags|=1,e=Mi(d,o),e.ref=i.ref,e.return=i,i.child=e}function um(e,i,a,o,f){if(e!==null){var d=e.memoizedProps;if(ca(d,o)&&e.ref===i.ref)if(ie=!1,i.pendingProps=o=d,Hu(e,f))(e.flags&131072)!==0&&(ie=!0);else return i.lanes=e.lanes,Bi(e,i,f)}return Nu(e,i,a,o,f)}function cm(e,i,a,o){var f=o.children,d=e!==null?e.memoizedState:null;if(e===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((i.flags&128)!==0){if(d=d!==null?d.baseLanes|a:a,e!==null){for(o=i.child=e.child,f=0;o!==null;)f=f|o.lanes|o.childLanes,o=o.sibling;o=f&~d}else o=0,i.child=null;return hm(e,i,d,a,o)}if((a&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},e!==null&&Vl(i,d!==null?d.cachePool:null),d!==null?dd(i,d):ou(),md(i);else return o=i.lanes=536870912,hm(e,i,d!==null?d.baseLanes|a:a,a,o)}else d!==null?(Vl(i,d.cachePool),dd(i,d),on(),i.memoizedState=null):(e!==null&&Vl(i,null),ou(),on());return de(e,i,f,a),i.child}function Aa(e,i){return e!==null&&e.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function hm(e,i,a,o,f){var d=iu();return d=d===null?null:{parent:te._currentValue,pool:d},i.memoizedState={baseLanes:a,cachePool:d},e!==null&&Vl(i,null),ou(),md(i),e!==null&&ys(e,i,o,!0),i.childLanes=f,null}function lr(e,i){return i=or({mode:i.mode,children:i.children},e.mode),i.ref=e.ref,e.child=i,i.return=e,i}function fm(e,i,a){return Hn(i,e.child,null,a),e=lr(i,i.pendingProps),e.flags|=2,He(i),i.memoizedState=null,e}function b_(e,i,a){var o=i.pendingProps,f=(i.flags&128)!==0;if(i.flags&=-129,e===null){if(Tt){if(o.mode==="hidden")return e=lr(i,o),i.lanes=536870912,Aa(null,e);if(cu(i),(e=Ht)?(e=wg(e,Je),e=e!==null&&e.data==="&"?e:null,e!==null&&(i.memoizedState={dehydrated:e,treeContext:Ji!==null?{id:yi,overflow:xi}:null,retryLane:536870912,hydrationErrors:null},a=Zf(e),a.return=i,i.child=a,he=i,Ht=null)):e=null,e===null)throw en(i);return i.lanes=536870912,null}return lr(i,o)}var d=e.memoizedState;if(d!==null){var y=d.dehydrated;if(cu(i),f)if(i.flags&256)i.flags&=-257,i=fm(e,i,a);else if(i.memoizedState!==null)i.child=e.child,i.flags|=128,i=null;else throw Error(s(558));else if(ie||ys(e,i,a,!1),f=(a&e.childLanes)!==0,ie||f){if(o=kt,o!==null&&(y=ef(o,a),y!==0&&y!==d.retryLane))throw d.retryLane=y,Dn(e,y),Re(o,e,y),Du;yr(),i=fm(e,i,a)}else e=d.treeContext,Ht=ei(y.nextSibling),he=i,Tt=!0,tn=null,Je=!1,e!==null&&$f(i,e),i=lr(i,o),i.flags|=4096;return i}return e=Mi(e.child,{mode:o.mode,children:o.children}),e.ref=i.ref,i.child=e,e.return=i,e}function rr(e,i){var a=i.ref;if(a===null)e!==null&&e.ref!==null&&(i.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(e===null||e.ref!==a)&&(i.flags|=4194816)}}function Nu(e,i,a,o,f){return Gn(i),a=fu(e,i,a,o,void 0,f),o=du(),e!==null&&!ie?(mu(e,i,f),Bi(e,i,f)):(Tt&&o&&Wo(i),i.flags|=1,de(e,i,a,f),i.child)}function dm(e,i,a,o,f,d){return Gn(i),i.updateQueue=null,a=pd(i,o,a,f),gd(e),o=du(),e!==null&&!ie?(mu(e,i,d),Bi(e,i,d)):(Tt&&o&&Wo(i),i.flags|=1,de(e,i,a,d),i.child)}function mm(e,i,a,o,f){if(Gn(i),i.stateNode===null){var d=ds,y=a.contextType;typeof y=="object"&&y!==null&&(d=fe(y)),d=new a(o,d),i.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Ru,i.stateNode=d,d._reactInternals=i,d=i.stateNode,d.props=o,d.state=i.memoizedState,d.refs={},su(i),y=a.contextType,d.context=typeof y=="object"&&y!==null?fe(y):ds,d.state=i.memoizedState,y=a.getDerivedStateFromProps,typeof y=="function"&&(Eu(i,a,y,o),d.state=i.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(y=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),y!==d.state&&Ru.enqueueReplaceState(d,d.state,null),ba(i,o,d,f),_a(),d.state=i.memoizedState),typeof d.componentDidMount=="function"&&(i.flags|=4194308),o=!0}else if(e===null){d=i.stateNode;var v=i.memoizedProps,M=Yn(a,v);d.props=M;var j=d.context,X=a.contextType;y=ds,typeof X=="object"&&X!==null&&(y=fe(X));var F=a.getDerivedStateFromProps;X=typeof F=="function"||typeof d.getSnapshotBeforeUpdate=="function",v=i.pendingProps!==v,X||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(v||j!==y)&&tm(i,d,o,y),sn=!1;var H=i.memoizedState;d.state=H,ba(i,o,d,f),_a(),j=i.memoizedState,v||H!==j||sn?(typeof F=="function"&&(Eu(i,a,F,o),j=i.memoizedState),(M=sn||Jd(i,a,M,o,H,j,y))?(X||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(i.flags|=4194308)):(typeof d.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=o,i.memoizedState=j),d.props=o,d.state=j,d.context=y,o=M):(typeof d.componentDidMount=="function"&&(i.flags|=4194308),o=!1)}else{d=i.stateNode,au(e,i),y=i.memoizedProps,X=Yn(a,y),d.props=X,F=i.pendingProps,H=d.context,j=a.contextType,M=ds,typeof j=="object"&&j!==null&&(M=fe(j)),v=a.getDerivedStateFromProps,(j=typeof v=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(y!==F||H!==M)&&tm(i,d,o,M),sn=!1,H=i.memoizedState,d.state=H,ba(i,o,d,f),_a();var Y=i.memoizedState;y!==F||H!==Y||sn||e!==null&&e.dependencies!==null&&ql(e.dependencies)?(typeof v=="function"&&(Eu(i,a,v,o),Y=i.memoizedState),(X=sn||Jd(i,a,X,o,H,Y,M)||e!==null&&e.dependencies!==null&&ql(e.dependencies))?(j||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(o,Y,M),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(o,Y,M)),typeof d.componentDidUpdate=="function"&&(i.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof d.componentDidUpdate!="function"||y===e.memoizedProps&&H===e.memoizedState||(i.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&H===e.memoizedState||(i.flags|=1024),i.memoizedProps=o,i.memoizedState=Y),d.props=o,d.state=Y,d.context=M,o=X):(typeof d.componentDidUpdate!="function"||y===e.memoizedProps&&H===e.memoizedState||(i.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&H===e.memoizedState||(i.flags|=1024),o=!1)}return d=o,rr(e,i),o=(i.flags&128)!==0,d||o?(d=i.stateNode,a=o&&typeof a.getDerivedStateFromError!="function"?null:d.render(),i.flags|=1,e!==null&&o?(i.child=Hn(i,e.child,null,f),i.child=Hn(i,null,a,f)):de(e,i,a,f),i.memoizedState=d.state,e=i.child):e=Bi(e,i,f),e}function gm(e,i,a,o){return Bn(),i.flags|=256,de(e,i,a,o),i.child}var Bu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ou(e){return{baseLanes:e,cachePool:sd()}}function Gu(e,i,a){return e=e!==null?e.childLanes&~a:0,i&&(e|=Ye),e}function pm(e,i,a){var o=i.pendingProps,f=!1,d=(i.flags&128)!==0,y;if((y=d)||(y=e!==null&&e.memoizedState===null?!1:(It.current&2)!==0),y&&(f=!0,i.flags&=-129),y=(i.flags&32)!==0,i.flags&=-33,e===null){if(Tt){if(f?rn(i):on(),(e=Ht)?(e=wg(e,Je),e=e!==null&&e.data!=="&"?e:null,e!==null&&(i.memoizedState={dehydrated:e,treeContext:Ji!==null?{id:yi,overflow:xi}:null,retryLane:536870912,hydrationErrors:null},a=Zf(e),a.return=i,i.child=a,he=i,Ht=null)):e=null,e===null)throw en(i);return yc(e)?i.lanes=32:i.lanes=536870912,null}var v=o.children;return o=o.fallback,f?(on(),f=i.mode,v=or({mode:"hidden",children:v},f),o=Nn(o,f,a,null),v.return=i,o.return=i,v.sibling=o,i.child=v,o=i.child,o.memoizedState=Ou(a),o.childLanes=Gu(e,y,a),i.memoizedState=Bu,Aa(null,o)):(rn(i),ku(i,v))}var M=e.memoizedState;if(M!==null&&(v=M.dehydrated,v!==null)){if(d)i.flags&256?(rn(i),i.flags&=-257,i=Uu(e,i,a)):i.memoizedState!==null?(on(),i.child=e.child,i.flags|=128,i=null):(on(),v=o.fallback,f=i.mode,o=or({mode:"visible",children:o.children},f),v=Nn(v,f,a,null),v.flags|=2,o.return=i,v.return=i,o.sibling=v,i.child=o,Hn(i,e.child,null,a),o=i.child,o.memoizedState=Ou(a),o.childLanes=Gu(e,y,a),i.memoizedState=Bu,i=Aa(null,o));else if(rn(i),yc(v)){if(y=v.nextSibling&&v.nextSibling.dataset,y)var j=y.dgst;y=j,o=Error(s(419)),o.stack="",o.digest=y,da({value:o,source:null,stack:null}),i=Uu(e,i,a)}else if(ie||ys(e,i,a,!1),y=(a&e.childLanes)!==0,ie||y){if(y=kt,y!==null&&(o=ef(y,a),o!==0&&o!==M.retryLane))throw M.retryLane=o,Dn(e,o),Re(y,e,o),Du;pc(v)||yr(),i=Uu(e,i,a)}else pc(v)?(i.flags|=192,i.child=e.child,i=null):(e=M.treeContext,Ht=ei(v.nextSibling),he=i,Tt=!0,tn=null,Je=!1,e!==null&&$f(i,e),i=ku(i,o.children),i.flags|=4096);return i}return f?(on(),v=o.fallback,f=i.mode,M=e.child,j=M.sibling,o=Mi(M,{mode:"hidden",children:o.children}),o.subtreeFlags=M.subtreeFlags&65011712,j!==null?v=Mi(j,v):(v=Nn(v,f,a,null),v.flags|=2),v.return=i,o.return=i,o.sibling=v,i.child=o,Aa(null,o),o=i.child,v=e.child.memoizedState,v===null?v=Ou(a):(f=v.cachePool,f!==null?(M=te._currentValue,f=f.parent!==M?{parent:M,pool:M}:f):f=sd(),v={baseLanes:v.baseLanes|a,cachePool:f}),o.memoizedState=v,o.childLanes=Gu(e,y,a),i.memoizedState=Bu,Aa(e.child,o)):(rn(i),a=e.child,e=a.sibling,a=Mi(a,{mode:"visible",children:o.children}),a.return=i,a.sibling=null,e!==null&&(y=i.deletions,y===null?(i.deletions=[e],i.flags|=16):y.push(e)),i.child=a,i.memoizedState=null,a)}function ku(e,i){return i=or({mode:"visible",children:i},e.mode),i.return=e,e.child=i}function or(e,i){return e=Ue(22,e,null,i),e.lanes=0,e}function Uu(e,i,a){return Hn(i,e.child,null,a),e=ku(i,i.pendingProps.children),e.flags|=2,i.memoizedState=null,e}function ym(e,i,a){e.lanes|=i;var o=e.alternate;o!==null&&(o.lanes|=i),$o(e.return,i,a)}function ju(e,i,a,o,f,d){var y=e.memoizedState;y===null?e.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:o,tail:a,tailMode:f,treeForkCount:d}:(y.isBackwards=i,y.rendering=null,y.renderingStartTime=0,y.last=o,y.tail=a,y.tailMode=f,y.treeForkCount=d)}function xm(e,i,a){var o=i.pendingProps,f=o.revealOrder,d=o.tail;o=o.children;var y=It.current,v=(y&2)!==0;if(v?(y=y&1|2,i.flags|=128):y&=1,W(It,y),de(e,i,o,a),o=Tt?fa:0,!v&&e!==null&&(e.flags&128)!==0)t:for(e=i.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ym(e,a,i);else if(e.tag===19)ym(e,a,i);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===i)break t;for(;e.sibling===null;){if(e.return===null||e.return===i)break t;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(f){case"forwards":for(a=i.child,f=null;a!==null;)e=a.alternate,e!==null&&Il(e)===null&&(f=a),a=a.sibling;a=f,a===null?(f=i.child,i.child=null):(f=a.sibling,a.sibling=null),ju(i,!1,f,a,d,o);break;case"backwards":case"unstable_legacy-backwards":for(a=null,f=i.child,i.child=null;f!==null;){if(e=f.alternate,e!==null&&Il(e)===null){i.child=f;break}e=f.sibling,f.sibling=a,a=f,f=e}ju(i,!0,a,null,d,o);break;case"together":ju(i,!1,null,null,void 0,o);break;default:i.memoizedState=null}return i.child}function Bi(e,i,a){if(e!==null&&(i.dependencies=e.dependencies),hn|=i.lanes,(a&i.childLanes)===0)if(e!==null){if(ys(e,i,a,!1),(a&i.childLanes)===0)return null}else return null;if(e!==null&&i.child!==e.child)throw Error(s(153));if(i.child!==null){for(e=i.child,a=Mi(e,e.pendingProps),i.child=a,a.return=i;e.sibling!==null;)e=e.sibling,a=a.sibling=Mi(e,e.pendingProps),a.return=i;a.sibling=null}return i.child}function Hu(e,i){return(e.lanes&i)!==0?!0:(e=e.dependencies,!!(e!==null&&ql(e)))}function v_(e,i,a){switch(i.tag){case 3:jt(i,i.stateNode.containerInfo),nn(i,te,e.memoizedState.cache),Bn();break;case 27:case 5:Fe(i);break;case 4:jt(i,i.stateNode.containerInfo);break;case 10:nn(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,cu(i),null;break;case 13:var o=i.memoizedState;if(o!==null)return o.dehydrated!==null?(rn(i),i.flags|=128,null):(a&i.child.childLanes)!==0?pm(e,i,a):(rn(i),e=Bi(e,i,a),e!==null?e.sibling:null);rn(i);break;case 19:var f=(e.flags&128)!==0;if(o=(a&i.childLanes)!==0,o||(ys(e,i,a,!1),o=(a&i.childLanes)!==0),f){if(o)return xm(e,i,a);i.flags|=128}if(f=i.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),W(It,It.current),o)break;return null;case 22:return i.lanes=0,cm(e,i,a,i.pendingProps);case 24:nn(i,te,e.memoizedState.cache)}return Bi(e,i,a)}function _m(e,i,a){if(e!==null)if(e.memoizedProps!==i.pendingProps)ie=!0;else{if(!Hu(e,a)&&(i.flags&128)===0)return ie=!1,v_(e,i,a);ie=(e.flags&131072)!==0}else ie=!1,Tt&&(i.flags&1048576)!==0&&Kf(i,fa,i.index);switch(i.lanes=0,i.tag){case 16:t:{var o=i.pendingProps;if(e=Un(i.elementType),i.type=e,typeof e=="function")Vo(e)?(o=Yn(e,o),i.tag=1,i=mm(null,i,e,o,a)):(i.tag=0,i=Nu(null,i,e,o,a));else{if(e!=null){var f=e.$$typeof;if(f===G){i.tag=11,i=rm(null,i,e,o,a);break t}else if(f===B){i.tag=14,i=om(null,i,e,o,a);break t}}throw i=nt(e)||e,Error(s(306,i,""))}}return i;case 0:return Nu(e,i,i.type,i.pendingProps,a);case 1:return o=i.type,f=Yn(o,i.pendingProps),mm(e,i,o,f,a);case 3:t:{if(jt(i,i.stateNode.containerInfo),e===null)throw Error(s(387));o=i.pendingProps;var d=i.memoizedState;f=d.element,au(e,i),ba(i,o,null,a);var y=i.memoizedState;if(o=y.cache,nn(i,te,o),o!==d.cache&&Jo(i,[te],a,!0),_a(),o=y.element,d.isDehydrated)if(d={element:o,isDehydrated:!1,cache:y.cache},i.updateQueue.baseState=d,i.memoizedState=d,i.flags&256){i=gm(e,i,o,a);break t}else if(o!==f){f=Ie(Error(s(424)),i),da(f),i=gm(e,i,o,a);break t}else{switch(e=i.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Ht=ei(e.firstChild),he=i,Tt=!0,tn=null,Je=!0,a=cd(i,null,o,a),i.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Bn(),o===f){i=Bi(e,i,a);break t}de(e,i,o,a)}i=i.child}return i;case 26:return rr(e,i),e===null?(a=zg(i.type,null,i.pendingProps,null))?i.memoizedState=a:Tt||(a=i.type,e=i.pendingProps,o=wr(ct.current).createElement(a),o[ce]=i,o[Te]=e,me(o,a,e),le(o),i.stateNode=o):i.memoizedState=zg(i.type,e.memoizedProps,i.pendingProps,e.memoizedState),null;case 27:return Fe(i),e===null&&Tt&&(o=i.stateNode=Mg(i.type,i.pendingProps,ct.current),he=i,Je=!0,f=Ht,pn(i.type)?(xc=f,Ht=ei(o.firstChild)):Ht=f),de(e,i,i.pendingProps.children,a),rr(e,i),e===null&&(i.flags|=4194304),i.child;case 5:return e===null&&Tt&&((f=o=Ht)&&(o=K_(o,i.type,i.pendingProps,Je),o!==null?(i.stateNode=o,he=i,Ht=ei(o.firstChild),Je=!1,f=!0):f=!1),f||en(i)),Fe(i),f=i.type,d=i.pendingProps,y=e!==null?e.memoizedProps:null,o=d.children,dc(f,d)?o=null:y!==null&&dc(f,y)&&(i.flags|=32),i.memoizedState!==null&&(f=fu(e,i,f_,null,null,a),La._currentValue=f),rr(e,i),de(e,i,o,a),i.child;case 6:return e===null&&Tt&&((e=a=Ht)&&(a=$_(a,i.pendingProps,Je),a!==null?(i.stateNode=a,he=i,Ht=null,e=!0):e=!1),e||en(i)),null;case 13:return pm(e,i,a);case 4:return jt(i,i.stateNode.containerInfo),o=i.pendingProps,e===null?i.child=Hn(i,null,o,a):de(e,i,o,a),i.child;case 11:return rm(e,i,i.type,i.pendingProps,a);case 7:return de(e,i,i.pendingProps,a),i.child;case 8:return de(e,i,i.pendingProps.children,a),i.child;case 12:return de(e,i,i.pendingProps.children,a),i.child;case 10:return o=i.pendingProps,nn(i,i.type,o.value),de(e,i,o.children,a),i.child;case 9:return f=i.type._context,o=i.pendingProps.children,Gn(i),f=fe(f),o=o(f),i.flags|=1,de(e,i,o,a),i.child;case 14:return om(e,i,i.type,i.pendingProps,a);case 15:return um(e,i,i.type,i.pendingProps,a);case 19:return xm(e,i,a);case 31:return b_(e,i,a);case 22:return cm(e,i,a,i.pendingProps);case 24:return Gn(i),o=fe(te),e===null?(f=iu(),f===null&&(f=kt,d=tu(),f.pooledCache=d,d.refCount++,d!==null&&(f.pooledCacheLanes|=a),f=d),i.memoizedState={parent:o,cache:f},su(i),nn(i,te,f)):((e.lanes&a)!==0&&(au(e,i),ba(i,null,null,a),_a()),f=e.memoizedState,d=i.memoizedState,f.parent!==o?(f={parent:o,cache:o},i.memoizedState=f,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=f),nn(i,te,o)):(o=d.cache,nn(i,te,o),o!==f.cache&&Jo(i,[te],a,!0))),de(e,i,i.pendingProps.children,a),i.child;case 29:throw i.pendingProps}throw Error(s(156,i.tag))}function Oi(e){e.flags|=4}function Lu(e,i,a,o,f){if((i=(e.mode&32)!==0)&&(i=!1),i){if(e.flags|=16777216,(f&335544128)===f)if(e.stateNode.complete)e.flags|=8192;else if(Fm())e.flags|=8192;else throw jn=Fl,nu}else e.flags&=-16777217}function bm(e,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Gg(i))if(Fm())e.flags|=8192;else throw jn=Fl,nu}function ur(e,i){i!==null&&(e.flags|=4),e.flags&16384&&(i=e.tag!==22?$h():536870912,e.lanes|=i,Rs|=i)}function Ca(e,i){if(!Tt)switch(e.tailMode){case"hidden":i=e.tail;for(var a=null;i!==null;)i.alternate!==null&&(a=i),i=i.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var o=null;a!==null;)a.alternate!==null&&(o=a),a=a.sibling;o===null?i||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function Lt(e){var i=e.alternate!==null&&e.alternate.child===e.child,a=0,o=0;if(i)for(var f=e.child;f!==null;)a|=f.lanes|f.childLanes,o|=f.subtreeFlags&65011712,o|=f.flags&65011712,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)a|=f.lanes|f.childLanes,o|=f.subtreeFlags,o|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=o,e.childLanes=a,i}function S_(e,i,a){var o=i.pendingProps;switch(Qo(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Lt(i),null;case 1:return Lt(i),null;case 3:return a=i.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),i.memoizedState.cache!==o&&(i.flags|=2048),zi(te),Et(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(ps(i)?Oi(i):e===null||e.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Io())),Lt(i),null;case 26:var f=i.type,d=i.memoizedState;return e===null?(Oi(i),d!==null?(Lt(i),bm(i,d)):(Lt(i),Lu(i,f,null,o,a))):d?d!==e.memoizedState?(Oi(i),Lt(i),bm(i,d)):(Lt(i),i.flags&=-16777217):(e=e.memoizedProps,e!==o&&Oi(i),Lt(i),Lu(i,f,e,o,a)),null;case 27:if(Zi(i),a=ct.current,f=i.type,e!==null&&i.stateNode!=null)e.memoizedProps!==o&&Oi(i);else{if(!o){if(i.stateNode===null)throw Error(s(166));return Lt(i),null}e=J.current,ps(i)?Jf(i):(e=Mg(f,o,a),i.stateNode=e,Oi(i))}return Lt(i),null;case 5:if(Zi(i),f=i.type,e!==null&&i.stateNode!=null)e.memoizedProps!==o&&Oi(i);else{if(!o){if(i.stateNode===null)throw Error(s(166));return Lt(i),null}if(d=J.current,ps(i))Jf(i);else{var y=wr(ct.current);switch(d){case 1:d=y.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:d=y.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":d=y.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":d=y.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":d=y.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof o.is=="string"?y.createElement("select",{is:o.is}):y.createElement("select"),o.multiple?d.multiple=!0:o.size&&(d.size=o.size);break;default:d=typeof o.is=="string"?y.createElement(f,{is:o.is}):y.createElement(f)}}d[ce]=i,d[Te]=o;t:for(y=i.child;y!==null;){if(y.tag===5||y.tag===6)d.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===i)break t;for(;y.sibling===null;){if(y.return===null||y.return===i)break t;y=y.return}y.sibling.return=y.return,y=y.sibling}i.stateNode=d;t:switch(me(d,f,o),f){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break t;case"img":o=!0;break t;default:o=!1}o&&Oi(i)}}return Lt(i),Lu(i,i.type,e===null?null:e.memoizedProps,i.pendingProps,a),null;case 6:if(e&&i.stateNode!=null)e.memoizedProps!==o&&Oi(i);else{if(typeof o!="string"&&i.stateNode===null)throw Error(s(166));if(e=ct.current,ps(i)){if(e=i.stateNode,a=i.memoizedProps,o=null,f=he,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}e[ce]=i,e=!!(e.nodeValue===a||o!==null&&o.suppressHydrationWarning===!0||pg(e.nodeValue,a)),e||en(i,!0)}else e=wr(e).createTextNode(o),e[ce]=i,i.stateNode=e}return Lt(i),null;case 31:if(a=i.memoizedState,e===null||e.memoizedState!==null){if(o=ps(i),a!==null){if(e===null){if(!o)throw Error(s(318));if(e=i.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[ce]=i}else Bn(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Lt(i),e=!1}else a=Io(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return i.flags&256?(He(i),i):(He(i),null);if((i.flags&128)!==0)throw Error(s(558))}return Lt(i),null;case 13:if(o=i.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=ps(i),o!==null&&o.dehydrated!==null){if(e===null){if(!f)throw Error(s(318));if(f=i.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(s(317));f[ce]=i}else Bn(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Lt(i),f=!1}else f=Io(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return i.flags&256?(He(i),i):(He(i),null)}return He(i),(i.flags&128)!==0?(i.lanes=a,i):(a=o!==null,e=e!==null&&e.memoizedState!==null,a&&(o=i.child,f=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(f=o.alternate.memoizedState.cachePool.pool),d=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),d!==f&&(o.flags|=2048)),a!==e&&a&&(i.child.flags|=8192),ur(i,i.updateQueue),Lt(i),null);case 4:return Et(),e===null&&oc(i.stateNode.containerInfo),Lt(i),null;case 10:return zi(i.type),Lt(i),null;case 19:if(q(It),o=i.memoizedState,o===null)return Lt(i),null;if(f=(i.flags&128)!==0,d=o.rendering,d===null)if(f)Ca(o,!1);else{if(Ft!==0||e!==null&&(e.flags&128)!==0)for(e=i.child;e!==null;){if(d=Il(e),d!==null){for(i.flags|=128,Ca(o,!1),e=d.updateQueue,i.updateQueue=e,ur(i,e),i.subtreeFlags=0,e=a,a=i.child;a!==null;)Qf(a,e),a=a.sibling;return W(It,It.current&1|2),Tt&&Ei(i,o.treeForkCount),i.child}e=e.sibling}o.tail!==null&&Be()>mr&&(i.flags|=128,f=!0,Ca(o,!1),i.lanes=4194304)}else{if(!f)if(e=Il(d),e!==null){if(i.flags|=128,f=!0,e=e.updateQueue,i.updateQueue=e,ur(i,e),Ca(o,!0),o.tail===null&&o.tailMode==="hidden"&&!d.alternate&&!Tt)return Lt(i),null}else 2*Be()-o.renderingStartTime>mr&&a!==536870912&&(i.flags|=128,f=!0,Ca(o,!1),i.lanes=4194304);o.isBackwards?(d.sibling=i.child,i.child=d):(e=o.last,e!==null?e.sibling=d:i.child=d,o.last=d)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Be(),e.sibling=null,a=It.current,W(It,f?a&1|2:a&1),Tt&&Ei(i,o.treeForkCount),e):(Lt(i),null);case 22:case 23:return He(i),uu(),o=i.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(i.flags|=8192):o&&(i.flags|=8192),o?(a&536870912)!==0&&(i.flags&128)===0&&(Lt(i),i.subtreeFlags&6&&(i.flags|=8192)):Lt(i),a=i.updateQueue,a!==null&&ur(i,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),o=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),o!==a&&(i.flags|=2048),e!==null&&q(kn),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),i.memoizedState.cache!==a&&(i.flags|=2048),zi(te),Lt(i),null;case 25:return null;case 30:return null}throw Error(s(156,i.tag))}function T_(e,i){switch(Qo(i),i.tag){case 1:return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 3:return zi(te),Et(),e=i.flags,(e&65536)!==0&&(e&128)===0?(i.flags=e&-65537|128,i):null;case 26:case 27:case 5:return Zi(i),null;case 31:if(i.memoizedState!==null){if(He(i),i.alternate===null)throw Error(s(340));Bn()}return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 13:if(He(i),e=i.memoizedState,e!==null&&e.dehydrated!==null){if(i.alternate===null)throw Error(s(340));Bn()}return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 19:return q(It),null;case 4:return Et(),null;case 10:return zi(i.type),null;case 22:case 23:return He(i),uu(),e!==null&&q(kn),e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 24:return zi(te),null;case 25:return null;default:return null}}function vm(e,i){switch(Qo(i),i.tag){case 3:zi(te),Et();break;case 26:case 27:case 5:Zi(i);break;case 4:Et();break;case 31:i.memoizedState!==null&&He(i);break;case 13:He(i);break;case 19:q(It);break;case 10:zi(i.type);break;case 22:case 23:He(i),uu(),e!==null&&q(kn);break;case 24:zi(te)}}function Ma(e,i){try{var a=i.updateQueue,o=a!==null?a.lastEffect:null;if(o!==null){var f=o.next;a=f;do{if((a.tag&e)===e){o=void 0;var d=a.create,y=a.inst;o=d(),y.destroy=o}a=a.next}while(a!==f)}}catch(v){Dt(i,i.return,v)}}function un(e,i,a){try{var o=i.updateQueue,f=o!==null?o.lastEffect:null;if(f!==null){var d=f.next;o=d;do{if((o.tag&e)===e){var y=o.inst,v=y.destroy;if(v!==void 0){y.destroy=void 0,f=i;var M=a,j=v;try{j()}catch(X){Dt(f,M,X)}}}o=o.next}while(o!==d)}}catch(X){Dt(i,i.return,X)}}function Sm(e){var i=e.updateQueue;if(i!==null){var a=e.stateNode;try{fd(i,a)}catch(o){Dt(e,e.return,o)}}}function Tm(e,i,a){a.props=Yn(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(o){Dt(e,i,o)}}function Ea(e,i){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:o=e.stateNode;break;default:o=e.stateNode}typeof a=="function"?e.refCleanup=a(o):a.current=o}}catch(f){Dt(e,i,f)}}function _i(e,i){var a=e.ref,o=e.refCleanup;if(a!==null)if(typeof o=="function")try{o()}catch(f){Dt(e,i,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(f){Dt(e,i,f)}else a.current=null}function wm(e){var i=e.type,a=e.memoizedProps,o=e.stateNode;try{t:switch(i){case"button":case"input":case"select":case"textarea":a.autoFocus&&o.focus();break t;case"img":a.src?o.src=a.src:a.srcSet&&(o.srcset=a.srcSet)}}catch(f){Dt(e,e.return,f)}}function Yu(e,i,a){try{var o=e.stateNode;P_(o,e.type,a,i),o[Te]=i}catch(f){Dt(e,e.return,f)}}function Am(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&pn(e.type)||e.tag===4}function qu(e){t:for(;;){for(;e.sibling===null;){if(e.return===null||Am(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&pn(e.type)||e.flags&2||e.child===null||e.tag===4)continue t;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xu(e,i,a){var o=e.tag;if(o===5||o===6)e=e.stateNode,i?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,i):(i=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,i.appendChild(e),a=a._reactRootContainer,a!=null||i.onclick!==null||(i.onclick=Ai));else if(o!==4&&(o===27&&pn(e.type)&&(a=e.stateNode,i=null),e=e.child,e!==null))for(Xu(e,i,a),e=e.sibling;e!==null;)Xu(e,i,a),e=e.sibling}function cr(e,i,a){var o=e.tag;if(o===5||o===6)e=e.stateNode,i?a.insertBefore(e,i):a.appendChild(e);else if(o!==4&&(o===27&&pn(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(cr(e,i,a),e=e.sibling;e!==null;)cr(e,i,a),e=e.sibling}function Cm(e){var i=e.stateNode,a=e.memoizedProps;try{for(var o=e.type,f=i.attributes;f.length;)i.removeAttributeNode(f[0]);me(i,o,a),i[ce]=e,i[Te]=a}catch(d){Dt(e,e.return,d)}}var Gi=!1,ne=!1,Vu=!1,Mm=typeof WeakSet=="function"?WeakSet:Set,re=null;function w_(e,i){if(e=e.containerInfo,hc=Dr,e=Hf(e),Uo(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else t:{a=(a=e.ownerDocument)&&a.defaultView||window;var o=a.getSelection&&a.getSelection();if(o&&o.rangeCount!==0){a=o.anchorNode;var f=o.anchorOffset,d=o.focusNode;o=o.focusOffset;try{a.nodeType,d.nodeType}catch{a=null;break t}var y=0,v=-1,M=-1,j=0,X=0,F=e,H=null;e:for(;;){for(var Y;F!==a||f!==0&&F.nodeType!==3||(v=y+f),F!==d||o!==0&&F.nodeType!==3||(M=y+o),F.nodeType===3&&(y+=F.nodeValue.length),(Y=F.firstChild)!==null;)H=F,F=Y;for(;;){if(F===e)break e;if(H===a&&++j===f&&(v=y),H===d&&++X===o&&(M=y),(Y=F.nextSibling)!==null)break;F=H,H=F.parentNode}F=Y}a=v===-1||M===-1?null:{start:v,end:M}}else a=null}a=a||{start:0,end:0}}else a=null;for(fc={focusedElem:e,selectionRange:a},Dr=!1,re=i;re!==null;)if(i=re,e=i.child,(i.subtreeFlags&1028)!==0&&e!==null)e.return=i,re=e;else for(;re!==null;){switch(i=re,d=i.alternate,e=i.flags,i.tag){case 0:if((e&4)!==0&&(e=i.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)f=e[a],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,a=i,f=d.memoizedProps,d=d.memoizedState,o=a.stateNode;try{var st=Yn(a.type,f);e=o.getSnapshotBeforeUpdate(st,d),o.__reactInternalSnapshotBeforeUpdate=e}catch(ut){Dt(a,a.return,ut)}}break;case 3:if((e&1024)!==0){if(e=i.stateNode.containerInfo,a=e.nodeType,a===9)gc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":gc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(s(163))}if(e=i.sibling,e!==null){e.return=i.return,re=e;break}re=i.return}}function Em(e,i,a){var o=a.flags;switch(a.tag){case 0:case 11:case 15:Ui(e,a),o&4&&Ma(5,a);break;case 1:if(Ui(e,a),o&4)if(e=a.stateNode,i===null)try{e.componentDidMount()}catch(y){Dt(a,a.return,y)}else{var f=Yn(a.type,i.memoizedProps);i=i.memoizedState;try{e.componentDidUpdate(f,i,e.__reactInternalSnapshotBeforeUpdate)}catch(y){Dt(a,a.return,y)}}o&64&&Sm(a),o&512&&Ea(a,a.return);break;case 3:if(Ui(e,a),o&64&&(e=a.updateQueue,e!==null)){if(i=null,a.child!==null)switch(a.child.tag){case 27:case 5:i=a.child.stateNode;break;case 1:i=a.child.stateNode}try{fd(e,i)}catch(y){Dt(a,a.return,y)}}break;case 27:i===null&&o&4&&Cm(a);case 26:case 5:Ui(e,a),i===null&&o&4&&wm(a),o&512&&Ea(a,a.return);break;case 12:Ui(e,a);break;case 31:Ui(e,a),o&4&&Dm(e,a);break;case 13:Ui(e,a),o&4&&Nm(e,a),o&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=B_.bind(null,a),J_(e,a))));break;case 22:if(o=a.memoizedState!==null||Gi,!o){i=i!==null&&i.memoizedState!==null||ne,f=Gi;var d=ne;Gi=o,(ne=i)&&!d?ji(e,a,(a.subtreeFlags&8772)!==0):Ui(e,a),Gi=f,ne=d}break;case 30:break;default:Ui(e,a)}}function Rm(e){var i=e.alternate;i!==null&&(e.alternate=null,Rm(i)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(i=e.stateNode,i!==null&&bo(i)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Yt=null,Ae=!1;function ki(e,i,a){for(a=a.child;a!==null;)zm(e,i,a),a=a.sibling}function zm(e,i,a){if(Oe&&typeof Oe.onCommitFiberUnmount=="function")try{Oe.onCommitFiberUnmount($s,a)}catch{}switch(a.tag){case 26:ne||_i(a,i),ki(e,i,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:ne||_i(a,i);var o=Yt,f=Ae;pn(a.type)&&(Yt=a.stateNode,Ae=!1),ki(e,i,a),Ua(a.stateNode),Yt=o,Ae=f;break;case 5:ne||_i(a,i);case 6:if(o=Yt,f=Ae,Yt=null,ki(e,i,a),Yt=o,Ae=f,Yt!==null)if(Ae)try{(Yt.nodeType===9?Yt.body:Yt.nodeName==="HTML"?Yt.ownerDocument.body:Yt).removeChild(a.stateNode)}catch(d){Dt(a,i,d)}else try{Yt.removeChild(a.stateNode)}catch(d){Dt(a,i,d)}break;case 18:Yt!==null&&(Ae?(e=Yt,Sg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Us(e)):Sg(Yt,a.stateNode));break;case 4:o=Yt,f=Ae,Yt=a.stateNode.containerInfo,Ae=!0,ki(e,i,a),Yt=o,Ae=f;break;case 0:case 11:case 14:case 15:un(2,a,i),ne||un(4,a,i),ki(e,i,a);break;case 1:ne||(_i(a,i),o=a.stateNode,typeof o.componentWillUnmount=="function"&&Tm(a,i,o)),ki(e,i,a);break;case 21:ki(e,i,a);break;case 22:ne=(o=ne)||a.memoizedState!==null,ki(e,i,a),ne=o;break;default:ki(e,i,a)}}function Dm(e,i){if(i.memoizedState===null&&(e=i.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Us(e)}catch(a){Dt(i,i.return,a)}}}function Nm(e,i){if(i.memoizedState===null&&(e=i.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Us(e)}catch(a){Dt(i,i.return,a)}}function A_(e){switch(e.tag){case 31:case 13:case 19:var i=e.stateNode;return i===null&&(i=e.stateNode=new Mm),i;case 22:return e=e.stateNode,i=e._retryCache,i===null&&(i=e._retryCache=new Mm),i;default:throw Error(s(435,e.tag))}}function hr(e,i){var a=A_(e);i.forEach(function(o){if(!a.has(o)){a.add(o);var f=O_.bind(null,e,o);o.then(f,f)}})}function Ce(e,i){var a=i.deletions;if(a!==null)for(var o=0;o<a.length;o++){var f=a[o],d=e,y=i,v=y;t:for(;v!==null;){switch(v.tag){case 27:if(pn(v.type)){Yt=v.stateNode,Ae=!1;break t}break;case 5:Yt=v.stateNode,Ae=!1;break t;case 3:case 4:Yt=v.stateNode.containerInfo,Ae=!0;break t}v=v.return}if(Yt===null)throw Error(s(160));zm(d,y,f),Yt=null,Ae=!1,d=f.alternate,d!==null&&(d.return=null),f.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Bm(i,e),i=i.sibling}var fi=null;function Bm(e,i){var a=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ce(i,e),Me(e),o&4&&(un(3,e,e.return),Ma(3,e),un(5,e,e.return));break;case 1:Ce(i,e),Me(e),o&512&&(ne||a===null||_i(a,a.return)),o&64&&Gi&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?o:a.concat(o))));break;case 26:var f=fi;if(Ce(i,e),Me(e),o&512&&(ne||a===null||_i(a,a.return)),o&4){var d=a!==null?a.memoizedState:null;if(o=e.memoizedState,a===null)if(o===null)if(e.stateNode===null){t:{o=e.type,a=e.memoizedProps,f=f.ownerDocument||f;e:switch(o){case"title":d=f.getElementsByTagName("title")[0],(!d||d[ea]||d[ce]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=f.createElement(o),f.head.insertBefore(d,f.querySelector("head > title"))),me(d,o,a),d[ce]=e,le(d),o=d;break t;case"link":var y=Bg("link","href",f).get(o+(a.href||""));if(y){for(var v=0;v<y.length;v++)if(d=y[v],d.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&d.getAttribute("rel")===(a.rel==null?null:a.rel)&&d.getAttribute("title")===(a.title==null?null:a.title)&&d.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){y.splice(v,1);break e}}d=f.createElement(o),me(d,o,a),f.head.appendChild(d);break;case"meta":if(y=Bg("meta","content",f).get(o+(a.content||""))){for(v=0;v<y.length;v++)if(d=y[v],d.getAttribute("content")===(a.content==null?null:""+a.content)&&d.getAttribute("name")===(a.name==null?null:a.name)&&d.getAttribute("property")===(a.property==null?null:a.property)&&d.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&d.getAttribute("charset")===(a.charSet==null?null:a.charSet)){y.splice(v,1);break e}}d=f.createElement(o),me(d,o,a),f.head.appendChild(d);break;default:throw Error(s(468,o))}d[ce]=e,le(d),o=d}e.stateNode=o}else Og(f,e.type,e.stateNode);else e.stateNode=Ng(f,o,e.memoizedProps);else d!==o?(d===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):d.count--,o===null?Og(f,e.type,e.stateNode):Ng(f,o,e.memoizedProps)):o===null&&e.stateNode!==null&&Yu(e,e.memoizedProps,a.memoizedProps)}break;case 27:Ce(i,e),Me(e),o&512&&(ne||a===null||_i(a,a.return)),a!==null&&o&4&&Yu(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Ce(i,e),Me(e),o&512&&(ne||a===null||_i(a,a.return)),e.flags&32){f=e.stateNode;try{ls(f,"")}catch(st){Dt(e,e.return,st)}}o&4&&e.stateNode!=null&&(f=e.memoizedProps,Yu(e,f,a!==null?a.memoizedProps:f)),o&1024&&(Vu=!0);break;case 6:if(Ce(i,e),Me(e),o&4){if(e.stateNode===null)throw Error(s(162));o=e.memoizedProps,a=e.stateNode;try{a.nodeValue=o}catch(st){Dt(e,e.return,st)}}break;case 3:if(Mr=null,f=fi,fi=Ar(i.containerInfo),Ce(i,e),fi=f,Me(e),o&4&&a!==null&&a.memoizedState.isDehydrated)try{Us(i.containerInfo)}catch(st){Dt(e,e.return,st)}Vu&&(Vu=!1,Om(e));break;case 4:o=fi,fi=Ar(e.stateNode.containerInfo),Ce(i,e),Me(e),fi=o;break;case 12:Ce(i,e),Me(e);break;case 31:Ce(i,e),Me(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,hr(e,o)));break;case 13:Ce(i,e),Me(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(dr=Be()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,hr(e,o)));break;case 22:f=e.memoizedState!==null;var M=a!==null&&a.memoizedState!==null,j=Gi,X=ne;if(Gi=j||f,ne=X||M,Ce(i,e),ne=X,Gi=j,Me(e),o&8192)t:for(i=e.stateNode,i._visibility=f?i._visibility&-2:i._visibility|1,f&&(a===null||M||Gi||ne||qn(e)),a=null,i=e;;){if(i.tag===5||i.tag===26){if(a===null){M=a=i;try{if(d=M.stateNode,f)y=d.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{v=M.stateNode;var F=M.memoizedProps.style,H=F!=null&&F.hasOwnProperty("display")?F.display:null;v.style.display=H==null||typeof H=="boolean"?"":(""+H).trim()}}catch(st){Dt(M,M.return,st)}}}else if(i.tag===6){if(a===null){M=i;try{M.stateNode.nodeValue=f?"":M.memoizedProps}catch(st){Dt(M,M.return,st)}}}else if(i.tag===18){if(a===null){M=i;try{var Y=M.stateNode;f?Tg(Y,!0):Tg(M.stateNode,!1)}catch(st){Dt(M,M.return,st)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===e)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break t;for(;i.sibling===null;){if(i.return===null||i.return===e)break t;a===i&&(a=null),i=i.return}a===i&&(a=null),i.sibling.return=i.return,i=i.sibling}o&4&&(o=e.updateQueue,o!==null&&(a=o.retryQueue,a!==null&&(o.retryQueue=null,hr(e,a))));break;case 19:Ce(i,e),Me(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,hr(e,o)));break;case 30:break;case 21:break;default:Ce(i,e),Me(e)}}function Me(e){var i=e.flags;if(i&2){try{for(var a,o=e.return;o!==null;){if(Am(o)){a=o;break}o=o.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var f=a.stateNode,d=qu(e);cr(e,d,f);break;case 5:var y=a.stateNode;a.flags&32&&(ls(y,""),a.flags&=-33);var v=qu(e);cr(e,v,y);break;case 3:case 4:var M=a.stateNode.containerInfo,j=qu(e);Xu(e,j,M);break;default:throw Error(s(161))}}catch(X){Dt(e,e.return,X)}e.flags&=-3}i&4096&&(e.flags&=-4097)}function Om(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var i=e;Om(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),e=e.sibling}}function Ui(e,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Em(e,i.alternate,i),i=i.sibling}function qn(e){for(e=e.child;e!==null;){var i=e;switch(i.tag){case 0:case 11:case 14:case 15:un(4,i,i.return),qn(i);break;case 1:_i(i,i.return);var a=i.stateNode;typeof a.componentWillUnmount=="function"&&Tm(i,i.return,a),qn(i);break;case 27:Ua(i.stateNode);case 26:case 5:_i(i,i.return),qn(i);break;case 22:i.memoizedState===null&&qn(i);break;case 30:qn(i);break;default:qn(i)}e=e.sibling}}function ji(e,i,a){for(a=a&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var o=i.alternate,f=e,d=i,y=d.flags;switch(d.tag){case 0:case 11:case 15:ji(f,d,a),Ma(4,d);break;case 1:if(ji(f,d,a),o=d,f=o.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(j){Dt(o,o.return,j)}if(o=d,f=o.updateQueue,f!==null){var v=o.stateNode;try{var M=f.shared.hiddenCallbacks;if(M!==null)for(f.shared.hiddenCallbacks=null,f=0;f<M.length;f++)hd(M[f],v)}catch(j){Dt(o,o.return,j)}}a&&y&64&&Sm(d),Ea(d,d.return);break;case 27:Cm(d);case 26:case 5:ji(f,d,a),a&&o===null&&y&4&&wm(d),Ea(d,d.return);break;case 12:ji(f,d,a);break;case 31:ji(f,d,a),a&&y&4&&Dm(f,d);break;case 13:ji(f,d,a),a&&y&4&&Nm(f,d);break;case 22:d.memoizedState===null&&ji(f,d,a),Ea(d,d.return);break;case 30:break;default:ji(f,d,a)}i=i.sibling}}function Pu(e,i){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(e=i.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&ma(a))}function Fu(e,i){e=null,i.alternate!==null&&(e=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==e&&(i.refCount++,e!=null&&ma(e))}function di(e,i,a,o){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Gm(e,i,a,o),i=i.sibling}function Gm(e,i,a,o){var f=i.flags;switch(i.tag){case 0:case 11:case 15:di(e,i,a,o),f&2048&&Ma(9,i);break;case 1:di(e,i,a,o);break;case 3:di(e,i,a,o),f&2048&&(e=null,i.alternate!==null&&(e=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==e&&(i.refCount++,e!=null&&ma(e)));break;case 12:if(f&2048){di(e,i,a,o),e=i.stateNode;try{var d=i.memoizedProps,y=d.id,v=d.onPostCommit;typeof v=="function"&&v(y,i.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(M){Dt(i,i.return,M)}}else di(e,i,a,o);break;case 31:di(e,i,a,o);break;case 13:di(e,i,a,o);break;case 23:break;case 22:d=i.stateNode,y=i.alternate,i.memoizedState!==null?d._visibility&2?di(e,i,a,o):Ra(e,i):d._visibility&2?di(e,i,a,o):(d._visibility|=2,Cs(e,i,a,o,(i.subtreeFlags&10256)!==0||!1)),f&2048&&Pu(y,i);break;case 24:di(e,i,a,o),f&2048&&Fu(i.alternate,i);break;default:di(e,i,a,o)}}function Cs(e,i,a,o,f){for(f=f&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var d=e,y=i,v=a,M=o,j=y.flags;switch(y.tag){case 0:case 11:case 15:Cs(d,y,v,M,f),Ma(8,y);break;case 23:break;case 22:var X=y.stateNode;y.memoizedState!==null?X._visibility&2?Cs(d,y,v,M,f):Ra(d,y):(X._visibility|=2,Cs(d,y,v,M,f)),f&&j&2048&&Pu(y.alternate,y);break;case 24:Cs(d,y,v,M,f),f&&j&2048&&Fu(y.alternate,y);break;default:Cs(d,y,v,M,f)}i=i.sibling}}function Ra(e,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var a=e,o=i,f=o.flags;switch(o.tag){case 22:Ra(a,o),f&2048&&Pu(o.alternate,o);break;case 24:Ra(a,o),f&2048&&Fu(o.alternate,o);break;default:Ra(a,o)}i=i.sibling}}var za=8192;function Ms(e,i,a){if(e.subtreeFlags&za)for(e=e.child;e!==null;)km(e,i,a),e=e.sibling}function km(e,i,a){switch(e.tag){case 26:Ms(e,i,a),e.flags&za&&e.memoizedState!==null&&h1(a,fi,e.memoizedState,e.memoizedProps);break;case 5:Ms(e,i,a);break;case 3:case 4:var o=fi;fi=Ar(e.stateNode.containerInfo),Ms(e,i,a),fi=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=za,za=16777216,Ms(e,i,a),za=o):Ms(e,i,a));break;default:Ms(e,i,a)}}function Um(e){var i=e.alternate;if(i!==null&&(e=i.child,e!==null)){i.child=null;do i=e.sibling,e.sibling=null,e=i;while(e!==null)}}function Da(e){var i=e.deletions;if((e.flags&16)!==0){if(i!==null)for(var a=0;a<i.length;a++){var o=i[a];re=o,Hm(o,e)}Um(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)jm(e),e=e.sibling}function jm(e){switch(e.tag){case 0:case 11:case 15:Da(e),e.flags&2048&&un(9,e,e.return);break;case 3:Da(e);break;case 12:Da(e);break;case 22:var i=e.stateNode;e.memoizedState!==null&&i._visibility&2&&(e.return===null||e.return.tag!==13)?(i._visibility&=-3,fr(e)):Da(e);break;default:Da(e)}}function fr(e){var i=e.deletions;if((e.flags&16)!==0){if(i!==null)for(var a=0;a<i.length;a++){var o=i[a];re=o,Hm(o,e)}Um(e)}for(e=e.child;e!==null;){switch(i=e,i.tag){case 0:case 11:case 15:un(8,i,i.return),fr(i);break;case 22:a=i.stateNode,a._visibility&2&&(a._visibility&=-3,fr(i));break;default:fr(i)}e=e.sibling}}function Hm(e,i){for(;re!==null;){var a=re;switch(a.tag){case 0:case 11:case 15:un(8,a,i);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var o=a.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:ma(a.memoizedState.cache)}if(o=a.child,o!==null)o.return=a,re=o;else t:for(a=e;re!==null;){o=re;var f=o.sibling,d=o.return;if(Rm(o),o===a){re=null;break t}if(f!==null){f.return=d,re=f;break t}re=d}}}var C_={getCacheForType:function(e){var i=fe(te),a=i.data.get(e);return a===void 0&&(a=e(),i.data.set(e,a)),a},cacheSignal:function(){return fe(te).controller.signal}},M_=typeof WeakMap=="function"?WeakMap:Map,Rt=0,kt=null,xt=null,bt=0,zt=0,Le=null,cn=!1,Es=!1,Wu=!1,Hi=0,Ft=0,hn=0,Xn=0,Qu=0,Ye=0,Rs=0,Na=null,Ee=null,Zu=!1,dr=0,Lm=0,mr=1/0,gr=null,fn=null,se=0,dn=null,zs=null,Li=0,Iu=0,Ku=null,Ym=null,Ba=0,$u=null;function qe(){return(Rt&2)!==0&&bt!==0?bt&-bt:D.T!==null?sc():nf()}function qm(){if(Ye===0)if((bt&536870912)===0||Tt){var e=Tl;Tl<<=1,(Tl&3932160)===0&&(Tl=262144),Ye=e}else Ye=536870912;return e=je.current,e!==null&&(e.flags|=32),Ye}function Re(e,i,a){(e===kt&&(zt===2||zt===9)||e.cancelPendingCommit!==null)&&(Ds(e,0),mn(e,bt,Ye,!1)),ta(e,a),((Rt&2)===0||e!==kt)&&(e===kt&&((Rt&2)===0&&(Xn|=a),Ft===4&&mn(e,bt,Ye,!1)),bi(e))}function Xm(e,i,a){if((Rt&6)!==0)throw Error(s(327));var o=!a&&(i&127)===0&&(i&e.expiredLanes)===0||Js(e,i),f=o?z_(e,i):tc(e,i,!0),d=o;do{if(f===0){Es&&!o&&mn(e,i,0,!1);break}else{if(a=e.current.alternate,d&&!E_(a)){f=tc(e,i,!1),d=!1;continue}if(f===2){if(d=i,e.errorRecoveryDisabledLanes&d)var y=0;else y=e.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){i=y;t:{var v=e;f=Na;var M=v.current.memoizedState.isDehydrated;if(M&&(Ds(v,y).flags|=256),y=tc(v,y,!1),y!==2){if(Wu&&!M){v.errorRecoveryDisabledLanes|=d,Xn|=d,f=4;break t}d=Ee,Ee=f,d!==null&&(Ee===null?Ee=d:Ee.push.apply(Ee,d))}f=y}if(d=!1,f!==2)continue}}if(f===1){Ds(e,0),mn(e,i,0,!0);break}t:{switch(o=e,d=f,d){case 0:case 1:throw Error(s(345));case 4:if((i&4194048)!==i)break;case 6:mn(o,i,Ye,!cn);break t;case 2:Ee=null;break;case 3:case 5:break;default:throw Error(s(329))}if((i&62914560)===i&&(f=dr+300-Be(),10<f)){if(mn(o,i,Ye,!cn),Al(o,0,!0)!==0)break t;Li=i,o.timeoutHandle=bg(Vm.bind(null,o,a,Ee,gr,Zu,i,Ye,Xn,Rs,cn,d,"Throttled",-0,0),f);break t}Vm(o,a,Ee,gr,Zu,i,Ye,Xn,Rs,cn,d,null,-0,0)}}break}while(!0);bi(e)}function Vm(e,i,a,o,f,d,y,v,M,j,X,F,H,Y){if(e.timeoutHandle=-1,F=i.subtreeFlags,F&8192||(F&16785408)===16785408){F={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ai},km(i,d,F);var st=(d&62914560)===d?dr-Be():(d&4194048)===d?Lm-Be():0;if(st=f1(F,st),st!==null){Li=d,e.cancelPendingCommit=st($m.bind(null,e,i,d,a,o,f,y,v,M,X,F,null,H,Y)),mn(e,d,y,!j);return}}$m(e,i,d,a,o,f,y,v,M)}function E_(e){for(var i=e;;){var a=i.tag;if((a===0||a===11||a===15)&&i.flags&16384&&(a=i.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var o=0;o<a.length;o++){var f=a[o],d=f.getSnapshot;f=f.value;try{if(!ke(d(),f))return!1}catch{return!1}}if(a=i.child,i.subtreeFlags&16384&&a!==null)a.return=i,i=a;else{if(i===e)break;for(;i.sibling===null;){if(i.return===null||i.return===e)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function mn(e,i,a,o){i&=~Qu,i&=~Xn,e.suspendedLanes|=i,e.pingedLanes&=~i,o&&(e.warmLanes|=i),o=e.expirationTimes;for(var f=i;0<f;){var d=31-Ge(f),y=1<<d;o[d]=-1,f&=~y}a!==0&&Jh(e,a,i)}function pr(){return(Rt&6)===0?(Oa(0),!1):!0}function Ju(){if(xt!==null){if(zt===0)var e=xt.return;else e=xt,Ri=On=null,gu(e),vs=null,pa=0,e=xt;for(;e!==null;)vm(e.alternate,e),e=e.return;xt=null}}function Ds(e,i){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Q_(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Li=0,Ju(),kt=e,xt=a=Mi(e.current,null),bt=i,zt=0,Le=null,cn=!1,Es=Js(e,i),Wu=!1,Rs=Ye=Qu=Xn=hn=Ft=0,Ee=Na=null,Zu=!1,(i&8)!==0&&(i|=i&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=i;0<o;){var f=31-Ge(o),d=1<<f;i|=e[f],o&=~d}return Hi=i,Ul(),a}function Pm(e,i){gt=null,D.H=wa,i===bs||i===Pl?(i=rd(),zt=3):i===nu?(i=rd(),zt=4):zt=i===Du?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Le=i,xt===null&&(Ft=1,ar(e,Ie(i,e.current)))}function Fm(){var e=je.current;return e===null?!0:(bt&4194048)===bt?ti===null:(bt&62914560)===bt||(bt&536870912)!==0?e===ti:!1}function Wm(){var e=D.H;return D.H=wa,e===null?wa:e}function Qm(){var e=D.A;return D.A=C_,e}function yr(){Ft=4,cn||(bt&4194048)!==bt&&je.current!==null||(Es=!0),(hn&134217727)===0&&(Xn&134217727)===0||kt===null||mn(kt,bt,Ye,!1)}function tc(e,i,a){var o=Rt;Rt|=2;var f=Wm(),d=Qm();(kt!==e||bt!==i)&&(gr=null,Ds(e,i)),i=!1;var y=Ft;t:do try{if(zt!==0&&xt!==null){var v=xt,M=Le;switch(zt){case 8:Ju(),y=6;break t;case 3:case 2:case 9:case 6:je.current===null&&(i=!0);var j=zt;if(zt=0,Le=null,Ns(e,v,M,j),a&&Es){y=0;break t}break;default:j=zt,zt=0,Le=null,Ns(e,v,M,j)}}R_(),y=Ft;break}catch(X){Pm(e,X)}while(!0);return i&&e.shellSuspendCounter++,Ri=On=null,Rt=o,D.H=f,D.A=d,xt===null&&(kt=null,bt=0,Ul()),y}function R_(){for(;xt!==null;)Zm(xt)}function z_(e,i){var a=Rt;Rt|=2;var o=Wm(),f=Qm();kt!==e||bt!==i?(gr=null,mr=Be()+500,Ds(e,i)):Es=Js(e,i);t:do try{if(zt!==0&&xt!==null){i=xt;var d=Le;e:switch(zt){case 1:zt=0,Le=null,Ns(e,i,d,1);break;case 2:case 9:if(ad(d)){zt=0,Le=null,Im(i);break}i=function(){zt!==2&&zt!==9||kt!==e||(zt=7),bi(e)},d.then(i,i);break t;case 3:zt=7;break t;case 4:zt=5;break t;case 7:ad(d)?(zt=0,Le=null,Im(i)):(zt=0,Le=null,Ns(e,i,d,7));break;case 5:var y=null;switch(xt.tag){case 26:y=xt.memoizedState;case 5:case 27:var v=xt;if(y?Gg(y):v.stateNode.complete){zt=0,Le=null;var M=v.sibling;if(M!==null)xt=M;else{var j=v.return;j!==null?(xt=j,xr(j)):xt=null}break e}}zt=0,Le=null,Ns(e,i,d,5);break;case 6:zt=0,Le=null,Ns(e,i,d,6);break;case 8:Ju(),Ft=6;break t;default:throw Error(s(462))}}D_();break}catch(X){Pm(e,X)}while(!0);return Ri=On=null,D.H=o,D.A=f,Rt=a,xt!==null?0:(kt=null,bt=0,Ul(),Ft)}function D_(){for(;xt!==null&&!tx();)Zm(xt)}function Zm(e){var i=_m(e.alternate,e,Hi);e.memoizedProps=e.pendingProps,i===null?xr(e):xt=i}function Im(e){var i=e,a=i.alternate;switch(i.tag){case 15:case 0:i=dm(a,i,i.pendingProps,i.type,void 0,bt);break;case 11:i=dm(a,i,i.pendingProps,i.type.render,i.ref,bt);break;case 5:gu(i);default:vm(a,i),i=xt=Qf(i,Hi),i=_m(a,i,Hi)}e.memoizedProps=e.pendingProps,i===null?xr(e):xt=i}function Ns(e,i,a,o){Ri=On=null,gu(i),vs=null,pa=0;var f=i.return;try{if(__(e,f,i,a,bt)){Ft=1,ar(e,Ie(a,e.current)),xt=null;return}}catch(d){if(f!==null)throw xt=f,d;Ft=1,ar(e,Ie(a,e.current)),xt=null;return}i.flags&32768?(Tt||o===1?e=!0:Es||(bt&536870912)!==0?e=!1:(cn=e=!0,(o===2||o===9||o===3||o===6)&&(o=je.current,o!==null&&o.tag===13&&(o.flags|=16384))),Km(i,e)):xr(i)}function xr(e){var i=e;do{if((i.flags&32768)!==0){Km(i,cn);return}e=i.return;var a=S_(i.alternate,i,Hi);if(a!==null){xt=a;return}if(i=i.sibling,i!==null){xt=i;return}xt=i=e}while(i!==null);Ft===0&&(Ft=5)}function Km(e,i){do{var a=T_(e.alternate,e);if(a!==null){a.flags&=32767,xt=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!i&&(e=e.sibling,e!==null)){xt=e;return}xt=e=a}while(e!==null);Ft=6,xt=null}function $m(e,i,a,o,f,d,y,v,M){e.cancelPendingCommit=null;do _r();while(se!==0);if((Rt&6)!==0)throw Error(s(327));if(i!==null){if(i===e.current)throw Error(s(177));if(d=i.lanes|i.childLanes,d|=qo,cx(e,a,d,y,v,M),e===kt&&(xt=kt=null,bt=0),zs=i,dn=e,Li=a,Iu=d,Ku=f,Ym=o,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,G_(vl,function(){return ng(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||o){o=D.T,D.T=null,f=L.p,L.p=2,y=Rt,Rt|=4;try{w_(e,i,a)}finally{Rt=y,L.p=f,D.T=o}}se=1,Jm(),tg(),eg()}}function Jm(){if(se===1){se=0;var e=dn,i=zs,a=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||a){a=D.T,D.T=null;var o=L.p;L.p=2;var f=Rt;Rt|=4;try{Bm(i,e);var d=fc,y=Hf(e.containerInfo),v=d.focusedElem,M=d.selectionRange;if(y!==v&&v&&v.ownerDocument&&jf(v.ownerDocument.documentElement,v)){if(M!==null&&Uo(v)){var j=M.start,X=M.end;if(X===void 0&&(X=j),"selectionStart"in v)v.selectionStart=j,v.selectionEnd=Math.min(X,v.value.length);else{var F=v.ownerDocument||document,H=F&&F.defaultView||window;if(H.getSelection){var Y=H.getSelection(),st=v.textContent.length,ut=Math.min(M.start,st),Ot=M.end===void 0?ut:Math.min(M.end,st);!Y.extend&&ut>Ot&&(y=Ot,Ot=ut,ut=y);var N=Uf(v,ut),z=Uf(v,Ot);if(N&&z&&(Y.rangeCount!==1||Y.anchorNode!==N.node||Y.anchorOffset!==N.offset||Y.focusNode!==z.node||Y.focusOffset!==z.offset)){var U=F.createRange();U.setStart(N.node,N.offset),Y.removeAllRanges(),ut>Ot?(Y.addRange(U),Y.extend(z.node,z.offset)):(U.setEnd(z.node,z.offset),Y.addRange(U))}}}}for(F=[],Y=v;Y=Y.parentNode;)Y.nodeType===1&&F.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v<F.length;v++){var V=F[v];V.element.scrollLeft=V.left,V.element.scrollTop=V.top}}Dr=!!hc,fc=hc=null}finally{Rt=f,L.p=o,D.T=a}}e.current=i,se=2}}function tg(){if(se===2){se=0;var e=dn,i=zs,a=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||a){a=D.T,D.T=null;var o=L.p;L.p=2;var f=Rt;Rt|=4;try{Em(e,i.alternate,i)}finally{Rt=f,L.p=o,D.T=a}}se=3}}function eg(){if(se===4||se===3){se=0,ex();var e=dn,i=zs,a=Li,o=Ym;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?se=5:(se=0,zs=dn=null,ig(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(fn=null),xo(a),i=i.stateNode,Oe&&typeof Oe.onCommitFiberRoot=="function")try{Oe.onCommitFiberRoot($s,i,void 0,(i.current.flags&128)===128)}catch{}if(o!==null){i=D.T,f=L.p,L.p=2,D.T=null;try{for(var d=e.onRecoverableError,y=0;y<o.length;y++){var v=o[y];d(v.value,{componentStack:v.stack})}}finally{D.T=i,L.p=f}}(Li&3)!==0&&_r(),bi(e),f=e.pendingLanes,(a&261930)!==0&&(f&42)!==0?e===$u?Ba++:(Ba=0,$u=e):Ba=0,Oa(0)}}function ig(e,i){(e.pooledCacheLanes&=i)===0&&(i=e.pooledCache,i!=null&&(e.pooledCache=null,ma(i)))}function _r(){return Jm(),tg(),eg(),ng()}function ng(){if(se!==5)return!1;var e=dn,i=Iu;Iu=0;var a=xo(Li),o=D.T,f=L.p;try{L.p=32>a?32:a,D.T=null,a=Ku,Ku=null;var d=dn,y=Li;if(se=0,zs=dn=null,Li=0,(Rt&6)!==0)throw Error(s(331));var v=Rt;if(Rt|=4,jm(d.current),Gm(d,d.current,y,a),Rt=v,Oa(0,!1),Oe&&typeof Oe.onPostCommitFiberRoot=="function")try{Oe.onPostCommitFiberRoot($s,d)}catch{}return!0}finally{L.p=f,D.T=o,ig(e,i)}}function sg(e,i,a){i=Ie(a,i),i=zu(e.stateNode,i,2),e=ln(e,i,2),e!==null&&(ta(e,2),bi(e))}function Dt(e,i,a){if(e.tag===3)sg(e,e,a);else for(;i!==null;){if(i.tag===3){sg(i,e,a);break}else if(i.tag===1){var o=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(fn===null||!fn.has(o))){e=Ie(a,e),a=am(2),o=ln(i,a,2),o!==null&&(lm(a,o,i,e),ta(o,2),bi(o));break}}i=i.return}}function ec(e,i,a){var o=e.pingCache;if(o===null){o=e.pingCache=new M_;var f=new Set;o.set(i,f)}else f=o.get(i),f===void 0&&(f=new Set,o.set(i,f));f.has(a)||(Wu=!0,f.add(a),e=N_.bind(null,e,i,a),i.then(e,e))}function N_(e,i,a){var o=e.pingCache;o!==null&&o.delete(i),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,kt===e&&(bt&a)===a&&(Ft===4||Ft===3&&(bt&62914560)===bt&&300>Be()-dr?(Rt&2)===0&&Ds(e,0):Qu|=a,Rs===bt&&(Rs=0)),bi(e)}function ag(e,i){i===0&&(i=$h()),e=Dn(e,i),e!==null&&(ta(e,i),bi(e))}function B_(e){var i=e.memoizedState,a=0;i!==null&&(a=i.retryLane),ag(e,a)}function O_(e,i){var a=0;switch(e.tag){case 31:case 13:var o=e.stateNode,f=e.memoizedState;f!==null&&(a=f.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(s(314))}o!==null&&o.delete(i),ag(e,a)}function G_(e,i){return mo(e,i)}var br=null,Bs=null,ic=!1,vr=!1,nc=!1,gn=0;function bi(e){e!==Bs&&e.next===null&&(Bs===null?br=Bs=e:Bs=Bs.next=e),vr=!0,ic||(ic=!0,U_())}function Oa(e,i){if(!nc&&vr){nc=!0;do for(var a=!1,o=br;o!==null;){if(e!==0){var f=o.pendingLanes;if(f===0)var d=0;else{var y=o.suspendedLanes,v=o.pingedLanes;d=(1<<31-Ge(42|e)+1)-1,d&=f&~(y&~v),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(a=!0,ug(o,d))}else d=bt,d=Al(o,o===kt?d:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(d&3)===0||Js(o,d)||(a=!0,ug(o,d));o=o.next}while(a);nc=!1}}function k_(){lg()}function lg(){vr=ic=!1;var e=0;gn!==0&&W_()&&(e=gn);for(var i=Be(),a=null,o=br;o!==null;){var f=o.next,d=rg(o,i);d===0?(o.next=null,a===null?br=f:a.next=f,f===null&&(Bs=a)):(a=o,(e!==0||(d&3)!==0)&&(vr=!0)),o=f}se!==0&&se!==5||Oa(e),gn!==0&&(gn=0)}function rg(e,i){for(var a=e.suspendedLanes,o=e.pingedLanes,f=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var y=31-Ge(d),v=1<<y,M=f[y];M===-1?((v&a)===0||(v&o)!==0)&&(f[y]=ux(v,i)):M<=i&&(e.expiredLanes|=v),d&=~v}if(i=kt,a=bt,a=Al(e,e===i?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,a===0||e===i&&(zt===2||zt===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&go(o),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Js(e,a)){if(i=a&-a,i===e.callbackPriority)return i;switch(o!==null&&go(o),xo(a)){case 2:case 8:a=Ih;break;case 32:a=vl;break;case 268435456:a=Kh;break;default:a=vl}return o=og.bind(null,e),a=mo(a,o),e.callbackPriority=i,e.callbackNode=a,i}return o!==null&&o!==null&&go(o),e.callbackPriority=2,e.callbackNode=null,2}function og(e,i){if(se!==0&&se!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(_r()&&e.callbackNode!==a)return null;var o=bt;return o=Al(e,e===kt?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(Xm(e,o,i),rg(e,Be()),e.callbackNode!=null&&e.callbackNode===a?og.bind(null,e):null)}function ug(e,i){if(_r())return null;Xm(e,i,!0)}function U_(){Z_(function(){(Rt&6)!==0?mo(Zh,k_):lg()})}function sc(){if(gn===0){var e=xs;e===0&&(e=Sl,Sl<<=1,(Sl&261888)===0&&(Sl=256)),gn=e}return gn}function cg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Rl(""+e)}function hg(e,i){var a=i.ownerDocument.createElement("input");return a.name=i.name,a.value=i.value,e.id&&a.setAttribute("form",e.id),i.parentNode.insertBefore(a,i),e=new FormData(e),a.parentNode.removeChild(a),e}function j_(e,i,a,o,f){if(i==="submit"&&a&&a.stateNode===f){var d=cg((f[Te]||null).action),y=o.submitter;y&&(i=(i=y[Te]||null)?cg(i.formAction):y.getAttribute("formAction"),i!==null&&(d=i,y=null));var v=new Bl("action","action",null,o,f);e.push({event:v,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(gn!==0){var M=y?hg(f,y):new FormData(f);wu(a,{pending:!0,data:M,method:f.method,action:d},null,M)}}else typeof d=="function"&&(v.preventDefault(),M=y?hg(f,y):new FormData(f),wu(a,{pending:!0,data:M,method:f.method,action:d},d,M))},currentTarget:f}]})}}for(var ac=0;ac<Yo.length;ac++){var lc=Yo[ac],H_=lc.toLowerCase(),L_=lc[0].toUpperCase()+lc.slice(1);hi(H_,"on"+L_)}hi(qf,"onAnimationEnd"),hi(Xf,"onAnimationIteration"),hi(Vf,"onAnimationStart"),hi("dblclick","onDoubleClick"),hi("focusin","onFocus"),hi("focusout","onBlur"),hi(i_,"onTransitionRun"),hi(n_,"onTransitionStart"),hi(s_,"onTransitionCancel"),hi(Pf,"onTransitionEnd"),ss("onMouseEnter",["mouseout","mouseover"]),ss("onMouseLeave",["mouseout","mouseover"]),ss("onPointerEnter",["pointerout","pointerover"]),ss("onPointerLeave",["pointerout","pointerover"]),Mn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Mn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Mn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Mn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Mn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Mn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ga="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Y_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ga));function fg(e,i){i=(i&4)!==0;for(var a=0;a<e.length;a++){var o=e[a],f=o.event;o=o.listeners;t:{var d=void 0;if(i)for(var y=o.length-1;0<=y;y--){var v=o[y],M=v.instance,j=v.currentTarget;if(v=v.listener,M!==d&&f.isPropagationStopped())break t;d=v,f.currentTarget=j;try{d(f)}catch(X){kl(X)}f.currentTarget=null,d=M}else for(y=0;y<o.length;y++){if(v=o[y],M=v.instance,j=v.currentTarget,v=v.listener,M!==d&&f.isPropagationStopped())break t;d=v,f.currentTarget=j;try{d(f)}catch(X){kl(X)}f.currentTarget=null,d=M}}}}function _t(e,i){var a=i[_o];a===void 0&&(a=i[_o]=new Set);var o=e+"__bubble";a.has(o)||(dg(i,e,2,!1),a.add(o))}function rc(e,i,a){var o=0;i&&(o|=4),dg(a,e,o,i)}var Sr="_reactListening"+Math.random().toString(36).slice(2);function oc(e){if(!e[Sr]){e[Sr]=!0,lf.forEach(function(a){a!=="selectionchange"&&(Y_.has(a)||rc(a,!1,e),rc(a,!0,e))});var i=e.nodeType===9?e:e.ownerDocument;i===null||i[Sr]||(i[Sr]=!0,rc("selectionchange",!1,i))}}function dg(e,i,a,o){switch(qg(i)){case 2:var f=g1;break;case 8:f=p1;break;default:f=Tc}a=f.bind(null,i,a,e),f=void 0,!Eo||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(f=!0),o?f!==void 0?e.addEventListener(i,a,{capture:!0,passive:f}):e.addEventListener(i,a,!0):f!==void 0?e.addEventListener(i,a,{passive:f}):e.addEventListener(i,a,!1)}function uc(e,i,a,o,f){var d=o;if((i&1)===0&&(i&2)===0&&o!==null)t:for(;;){if(o===null)return;var y=o.tag;if(y===3||y===4){var v=o.stateNode.containerInfo;if(v===f)break;if(y===4)for(y=o.return;y!==null;){var M=y.tag;if((M===3||M===4)&&y.stateNode.containerInfo===f)return;y=y.return}for(;v!==null;){if(y=es(v),y===null)return;if(M=y.tag,M===5||M===6||M===26||M===27){o=d=y;continue t}v=v.parentNode}}o=o.return}xf(function(){var j=d,X=Co(a),F=[];t:{var H=Ff.get(e);if(H!==void 0){var Y=Bl,st=e;switch(e){case"keypress":if(Dl(a)===0)break t;case"keydown":case"keyup":Y=Ox;break;case"focusin":st="focus",Y=No;break;case"focusout":st="blur",Y=No;break;case"beforeblur":case"afterblur":Y=No;break;case"click":if(a.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Y=vf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=Sx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=Ux;break;case qf:case Xf:case Vf:Y=Ax;break;case Pf:Y=Hx;break;case"scroll":case"scrollend":Y=bx;break;case"wheel":Y=Yx;break;case"copy":case"cut":case"paste":Y=Mx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=Tf;break;case"toggle":case"beforetoggle":Y=Xx}var ut=(i&4)!==0,Ot=!ut&&(e==="scroll"||e==="scrollend"),N=ut?H!==null?H+"Capture":null:H;ut=[];for(var z=j,U;z!==null;){var V=z;if(U=V.stateNode,V=V.tag,V!==5&&V!==26&&V!==27||U===null||N===null||(V=na(z,N),V!=null&&ut.push(ka(z,V,U))),Ot)break;z=z.return}0<ut.length&&(H=new Y(H,st,null,a,X),F.push({event:H,listeners:ut}))}}if((i&7)===0){t:{if(H=e==="mouseover"||e==="pointerover",Y=e==="mouseout"||e==="pointerout",H&&a!==Ao&&(st=a.relatedTarget||a.fromElement)&&(es(st)||st[ts]))break t;if((Y||H)&&(H=X.window===X?X:(H=X.ownerDocument)?H.defaultView||H.parentWindow:window,Y?(st=a.relatedTarget||a.toElement,Y=j,st=st?es(st):null,st!==null&&(Ot=u(st),ut=st.tag,st!==Ot||ut!==5&&ut!==27&&ut!==6)&&(st=null)):(Y=null,st=j),Y!==st)){if(ut=vf,V="onMouseLeave",N="onMouseEnter",z="mouse",(e==="pointerout"||e==="pointerover")&&(ut=Tf,V="onPointerLeave",N="onPointerEnter",z="pointer"),Ot=Y==null?H:ia(Y),U=st==null?H:ia(st),H=new ut(V,z+"leave",Y,a,X),H.target=Ot,H.relatedTarget=U,V=null,es(X)===j&&(ut=new ut(N,z+"enter",st,a,X),ut.target=U,ut.relatedTarget=Ot,V=ut),Ot=V,Y&&st)e:{for(ut=q_,N=Y,z=st,U=0,V=N;V;V=ut(V))U++;V=0;for(var ot=z;ot;ot=ut(ot))V++;for(;0<U-V;)N=ut(N),U--;for(;0<V-U;)z=ut(z),V--;for(;U--;){if(N===z||z!==null&&N===z.alternate){ut=N;break e}N=ut(N),z=ut(z)}ut=null}else ut=null;Y!==null&&mg(F,H,Y,ut,!1),st!==null&&Ot!==null&&mg(F,Ot,st,ut,!0)}}t:{if(H=j?ia(j):window,Y=H.nodeName&&H.nodeName.toLowerCase(),Y==="select"||Y==="input"&&H.type==="file")var Ct=Df;else if(Rf(H))if(Nf)Ct=Jx;else{Ct=Kx;var lt=Ix}else Y=H.nodeName,!Y||Y.toLowerCase()!=="input"||H.type!=="checkbox"&&H.type!=="radio"?j&&wo(j.elementType)&&(Ct=Df):Ct=$x;if(Ct&&(Ct=Ct(e,j))){zf(F,Ct,a,X);break t}lt&&lt(e,H,j),e==="focusout"&&j&&H.type==="number"&&j.memoizedProps.value!=null&&To(H,"number",H.value)}switch(lt=j?ia(j):window,e){case"focusin":(Rf(lt)||lt.contentEditable==="true")&&(cs=lt,jo=j,ha=null);break;case"focusout":ha=jo=cs=null;break;case"mousedown":Ho=!0;break;case"contextmenu":case"mouseup":case"dragend":Ho=!1,Lf(F,a,X);break;case"selectionchange":if(e_)break;case"keydown":case"keyup":Lf(F,a,X)}var pt;if(Oo)t:{switch(e){case"compositionstart":var vt="onCompositionStart";break t;case"compositionend":vt="onCompositionEnd";break t;case"compositionupdate":vt="onCompositionUpdate";break t}vt=void 0}else us?Mf(e,a)&&(vt="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(vt="onCompositionStart");vt&&(wf&&a.locale!=="ko"&&(us||vt!=="onCompositionStart"?vt==="onCompositionEnd"&&us&&(pt=_f()):($i=X,Ro="value"in $i?$i.value:$i.textContent,us=!0)),lt=Tr(j,vt),0<lt.length&&(vt=new Sf(vt,e,null,a,X),F.push({event:vt,listeners:lt}),pt?vt.data=pt:(pt=Ef(a),pt!==null&&(vt.data=pt)))),(pt=Px?Fx(e,a):Wx(e,a))&&(vt=Tr(j,"onBeforeInput"),0<vt.length&&(lt=new Sf("onBeforeInput","beforeinput",null,a,X),F.push({event:lt,listeners:vt}),lt.data=pt)),j_(F,e,j,a,X)}fg(F,i)})}function ka(e,i,a){return{instance:e,listener:i,currentTarget:a}}function Tr(e,i){for(var a=i+"Capture",o=[];e!==null;){var f=e,d=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||d===null||(f=na(e,a),f!=null&&o.unshift(ka(e,f,d)),f=na(e,i),f!=null&&o.push(ka(e,f,d))),e.tag===3)return o;e=e.return}return[]}function q_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function mg(e,i,a,o,f){for(var d=i._reactName,y=[];a!==null&&a!==o;){var v=a,M=v.alternate,j=v.stateNode;if(v=v.tag,M!==null&&M===o)break;v!==5&&v!==26&&v!==27||j===null||(M=j,f?(j=na(a,d),j!=null&&y.unshift(ka(a,j,M))):f||(j=na(a,d),j!=null&&y.push(ka(a,j,M)))),a=a.return}y.length!==0&&e.push({event:i,listeners:y})}var X_=/\r\n?/g,V_=/\u0000|\uFFFD/g;function gg(e){return(typeof e=="string"?e:""+e).replace(X_,`
50
+ `).replace(V_,"")}function pg(e,i){return i=gg(i),gg(e)===i}function Bt(e,i,a,o,f,d){switch(a){case"children":typeof o=="string"?i==="body"||i==="textarea"&&o===""||ls(e,o):(typeof o=="number"||typeof o=="bigint")&&i!=="body"&&ls(e,""+o);break;case"className":Ml(e,"class",o);break;case"tabIndex":Ml(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Ml(e,a,o);break;case"style":pf(e,o,d);break;case"data":if(i!=="object"){Ml(e,"data",o);break}case"src":case"href":if(o===""&&(i!=="a"||a!=="href")){e.removeAttribute(a);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(a);break}o=Rl(""+o),e.setAttribute(a,o);break;case"action":case"formAction":if(typeof o=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof d=="function"&&(a==="formAction"?(i!=="input"&&Bt(e,i,"name",f.name,f,null),Bt(e,i,"formEncType",f.formEncType,f,null),Bt(e,i,"formMethod",f.formMethod,f,null),Bt(e,i,"formTarget",f.formTarget,f,null)):(Bt(e,i,"encType",f.encType,f,null),Bt(e,i,"method",f.method,f,null),Bt(e,i,"target",f.target,f,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(a);break}o=Rl(""+o),e.setAttribute(a,o);break;case"onClick":o!=null&&(e.onclick=Ai);break;case"onScroll":o!=null&&_t("scroll",e);break;case"onScrollEnd":o!=null&&_t("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(s(61));if(a=o.__html,a!=null){if(f.children!=null)throw Error(s(60));e.innerHTML=a}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}a=Rl(""+o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(a,""+o):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":o===!0?e.setAttribute(a,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(a,o):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(a,o):e.removeAttribute(a);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(a):e.setAttribute(a,o);break;case"popover":_t("beforetoggle",e),_t("toggle",e),Cl(e,"popover",o);break;case"xlinkActuate":wi(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":wi(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":wi(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":wi(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":wi(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":wi(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":wi(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":wi(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":wi(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Cl(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=xx.get(a)||a,Cl(e,a,o))}}function cc(e,i,a,o,f,d){switch(a){case"style":pf(e,o,d);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(s(61));if(a=o.__html,a!=null){if(f.children!=null)throw Error(s(60));e.innerHTML=a}}break;case"children":typeof o=="string"?ls(e,o):(typeof o=="number"||typeof o=="bigint")&&ls(e,""+o);break;case"onScroll":o!=null&&_t("scroll",e);break;case"onScrollEnd":o!=null&&_t("scrollend",e);break;case"onClick":o!=null&&(e.onclick=Ai);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!rf.hasOwnProperty(a))t:{if(a[0]==="o"&&a[1]==="n"&&(f=a.endsWith("Capture"),i=a.slice(2,f?a.length-7:void 0),d=e[Te]||null,d=d!=null?d[a]:null,typeof d=="function"&&e.removeEventListener(i,d,f),typeof o=="function")){typeof d!="function"&&d!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(i,o,f);break t}a in e?e[a]=o:o===!0?e.setAttribute(a,""):Cl(e,a,o)}}}function me(e,i,a){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":_t("error",e),_t("load",e);var o=!1,f=!1,d;for(d in a)if(a.hasOwnProperty(d)){var y=a[d];if(y!=null)switch(d){case"src":o=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:Bt(e,i,d,y,a,null)}}f&&Bt(e,i,"srcSet",a.srcSet,a,null),o&&Bt(e,i,"src",a.src,a,null);return;case"input":_t("invalid",e);var v=d=y=f=null,M=null,j=null;for(o in a)if(a.hasOwnProperty(o)){var X=a[o];if(X!=null)switch(o){case"name":f=X;break;case"type":y=X;break;case"checked":M=X;break;case"defaultChecked":j=X;break;case"value":d=X;break;case"defaultValue":v=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(s(137,i));break;default:Bt(e,i,o,X,a,null)}}ff(e,d,v,M,j,y,f,!1);return;case"select":_t("invalid",e),o=y=d=null;for(f in a)if(a.hasOwnProperty(f)&&(v=a[f],v!=null))switch(f){case"value":d=v;break;case"defaultValue":y=v;break;case"multiple":o=v;default:Bt(e,i,f,v,a,null)}i=d,a=y,e.multiple=!!o,i!=null?as(e,!!o,i,!1):a!=null&&as(e,!!o,a,!0);return;case"textarea":_t("invalid",e),d=f=o=null;for(y in a)if(a.hasOwnProperty(y)&&(v=a[y],v!=null))switch(y){case"value":o=v;break;case"defaultValue":f=v;break;case"children":d=v;break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(s(91));break;default:Bt(e,i,y,v,a,null)}mf(e,o,f,d);return;case"option":for(M in a)if(a.hasOwnProperty(M)&&(o=a[M],o!=null))switch(M){case"selected":e.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:Bt(e,i,M,o,a,null)}return;case"dialog":_t("beforetoggle",e),_t("toggle",e),_t("cancel",e),_t("close",e);break;case"iframe":case"object":_t("load",e);break;case"video":case"audio":for(o=0;o<Ga.length;o++)_t(Ga[o],e);break;case"image":_t("error",e),_t("load",e);break;case"details":_t("toggle",e);break;case"embed":case"source":case"link":_t("error",e),_t("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(j in a)if(a.hasOwnProperty(j)&&(o=a[j],o!=null))switch(j){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:Bt(e,i,j,o,a,null)}return;default:if(wo(i)){for(X in a)a.hasOwnProperty(X)&&(o=a[X],o!==void 0&&cc(e,i,X,o,a,void 0));return}}for(v in a)a.hasOwnProperty(v)&&(o=a[v],o!=null&&Bt(e,i,v,o,a,null))}function P_(e,i,a,o){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,d=null,y=null,v=null,M=null,j=null,X=null;for(Y in a){var F=a[Y];if(a.hasOwnProperty(Y)&&F!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":M=F;default:o.hasOwnProperty(Y)||Bt(e,i,Y,null,o,F)}}for(var H in o){var Y=o[H];if(F=a[H],o.hasOwnProperty(H)&&(Y!=null||F!=null))switch(H){case"type":d=Y;break;case"name":f=Y;break;case"checked":j=Y;break;case"defaultChecked":X=Y;break;case"value":y=Y;break;case"defaultValue":v=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(s(137,i));break;default:Y!==F&&Bt(e,i,H,Y,o,F)}}So(e,y,v,M,j,X,d,f);return;case"select":Y=y=v=H=null;for(d in a)if(M=a[d],a.hasOwnProperty(d)&&M!=null)switch(d){case"value":break;case"multiple":Y=M;default:o.hasOwnProperty(d)||Bt(e,i,d,null,o,M)}for(f in o)if(d=o[f],M=a[f],o.hasOwnProperty(f)&&(d!=null||M!=null))switch(f){case"value":H=d;break;case"defaultValue":v=d;break;case"multiple":y=d;default:d!==M&&Bt(e,i,f,d,o,M)}i=v,a=y,o=Y,H!=null?as(e,!!a,H,!1):!!o!=!!a&&(i!=null?as(e,!!a,i,!0):as(e,!!a,a?[]:"",!1));return;case"textarea":Y=H=null;for(v in a)if(f=a[v],a.hasOwnProperty(v)&&f!=null&&!o.hasOwnProperty(v))switch(v){case"value":break;case"children":break;default:Bt(e,i,v,null,o,f)}for(y in o)if(f=o[y],d=a[y],o.hasOwnProperty(y)&&(f!=null||d!=null))switch(y){case"value":H=f;break;case"defaultValue":Y=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(s(91));break;default:f!==d&&Bt(e,i,y,f,o,d)}df(e,H,Y);return;case"option":for(var st in a)if(H=a[st],a.hasOwnProperty(st)&&H!=null&&!o.hasOwnProperty(st))switch(st){case"selected":e.selected=!1;break;default:Bt(e,i,st,null,o,H)}for(M in o)if(H=o[M],Y=a[M],o.hasOwnProperty(M)&&H!==Y&&(H!=null||Y!=null))switch(M){case"selected":e.selected=H&&typeof H!="function"&&typeof H!="symbol";break;default:Bt(e,i,M,H,o,Y)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ut in a)H=a[ut],a.hasOwnProperty(ut)&&H!=null&&!o.hasOwnProperty(ut)&&Bt(e,i,ut,null,o,H);for(j in o)if(H=o[j],Y=a[j],o.hasOwnProperty(j)&&H!==Y&&(H!=null||Y!=null))switch(j){case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(s(137,i));break;default:Bt(e,i,j,H,o,Y)}return;default:if(wo(i)){for(var Ot in a)H=a[Ot],a.hasOwnProperty(Ot)&&H!==void 0&&!o.hasOwnProperty(Ot)&&cc(e,i,Ot,void 0,o,H);for(X in o)H=o[X],Y=a[X],!o.hasOwnProperty(X)||H===Y||H===void 0&&Y===void 0||cc(e,i,X,H,o,Y);return}}for(var N in a)H=a[N],a.hasOwnProperty(N)&&H!=null&&!o.hasOwnProperty(N)&&Bt(e,i,N,null,o,H);for(F in o)H=o[F],Y=a[F],!o.hasOwnProperty(F)||H===Y||H==null&&Y==null||Bt(e,i,F,H,o,Y)}function yg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function F_(){if(typeof performance.getEntriesByType=="function"){for(var e=0,i=0,a=performance.getEntriesByType("resource"),o=0;o<a.length;o++){var f=a[o],d=f.transferSize,y=f.initiatorType,v=f.duration;if(d&&v&&yg(y)){for(y=0,v=f.responseEnd,o+=1;o<a.length;o++){var M=a[o],j=M.startTime;if(j>v)break;var X=M.transferSize,F=M.initiatorType;X&&yg(F)&&(M=M.responseEnd,y+=X*(M<v?1:(v-j)/(M-j)))}if(--o,i+=8*(d+y)/(f.duration/1e3),e++,10<e)break}}if(0<e)return i/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var hc=null,fc=null;function wr(e){return e.nodeType===9?e:e.ownerDocument}function xg(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function _g(e,i){if(e===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&i==="foreignObject"?0:e}function dc(e,i){return e==="textarea"||e==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var mc=null;function W_(){var e=window.event;return e&&e.type==="popstate"?e===mc?!1:(mc=e,!0):(mc=null,!1)}var bg=typeof setTimeout=="function"?setTimeout:void 0,Q_=typeof clearTimeout=="function"?clearTimeout:void 0,vg=typeof Promise=="function"?Promise:void 0,Z_=typeof queueMicrotask=="function"?queueMicrotask:typeof vg<"u"?function(e){return vg.resolve(null).then(e).catch(I_)}:bg;function I_(e){setTimeout(function(){throw e})}function pn(e){return e==="head"}function Sg(e,i){var a=i,o=0;do{var f=a.nextSibling;if(e.removeChild(a),f&&f.nodeType===8)if(a=f.data,a==="/$"||a==="/&"){if(o===0){e.removeChild(f),Us(i);return}o--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")o++;else if(a==="html")Ua(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Ua(a);for(var d=a.firstChild;d;){var y=d.nextSibling,v=d.nodeName;d[ea]||v==="SCRIPT"||v==="STYLE"||v==="LINK"&&d.rel.toLowerCase()==="stylesheet"||a.removeChild(d),d=y}}else a==="body"&&Ua(e.ownerDocument.body);a=f}while(a);Us(i)}function Tg(e,i){var a=e;e=0;do{var o=a.nextSibling;if(a.nodeType===1?i?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(i?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),o&&o.nodeType===8)if(a=o.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=o}while(a)}function gc(e){var i=e.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var a=i;switch(i=i.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":gc(a),bo(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function K_(e,i,a,o){for(;e.nodeType===1;){var f=a;if(e.nodeName.toLowerCase()!==i.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[ea])switch(i){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==f.rel||e.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||e.getAttribute("title")!==(f.title==null?null:f.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(f.src==null?null:f.src)||e.getAttribute("type")!==(f.type==null?null:f.type)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(i==="input"&&e.type==="hidden"){var d=f.name==null?null:""+f.name;if(f.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=ei(e.nextSibling),e===null)break}return null}function $_(e,i,a){if(i==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=ei(e.nextSibling),e===null))return null;return e}function wg(e,i){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=ei(e.nextSibling),e===null))return null;return e}function pc(e){return e.data==="$?"||e.data==="$~"}function yc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function J_(e,i){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=i;else if(e.data!=="$?"||a.readyState!=="loading")i();else{var o=function(){i(),a.removeEventListener("DOMContentLoaded",o)};a.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function ei(e){for(;e!=null;e=e.nextSibling){var i=e.nodeType;if(i===1||i===3)break;if(i===8){if(i=e.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return e}var xc=null;function Ag(e){e=e.nextSibling;for(var i=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(i===0)return ei(e.nextSibling);i--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||i++}e=e.nextSibling}return null}function Cg(e){e=e.previousSibling;for(var i=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(i===0)return e;i--}else a!=="/$"&&a!=="/&"||i++}e=e.previousSibling}return null}function Mg(e,i,a){switch(i=wr(a),e){case"html":if(e=i.documentElement,!e)throw Error(s(452));return e;case"head":if(e=i.head,!e)throw Error(s(453));return e;case"body":if(e=i.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function Ua(e){for(var i=e.attributes;i.length;)e.removeAttributeNode(i[0]);bo(e)}var ii=new Map,Eg=new Set;function Ar(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Yi=L.d;L.d={f:t1,r:e1,D:i1,C:n1,L:s1,m:a1,X:r1,S:l1,M:o1};function t1(){var e=Yi.f(),i=pr();return e||i}function e1(e){var i=is(e);i!==null&&i.tag===5&&i.type==="form"?Pd(i):Yi.r(e)}var Os=typeof document>"u"?null:document;function Rg(e,i,a){var o=Os;if(o&&typeof i=="string"&&i){var f=Qe(i);f='link[rel="'+e+'"][href="'+f+'"]',typeof a=="string"&&(f+='[crossorigin="'+a+'"]'),Eg.has(f)||(Eg.add(f),e={rel:e,crossOrigin:a,href:i},o.querySelector(f)===null&&(i=o.createElement("link"),me(i,"link",e),le(i),o.head.appendChild(i)))}}function i1(e){Yi.D(e),Rg("dns-prefetch",e,null)}function n1(e,i){Yi.C(e,i),Rg("preconnect",e,i)}function s1(e,i,a){Yi.L(e,i,a);var o=Os;if(o&&e&&i){var f='link[rel="preload"][as="'+Qe(i)+'"]';i==="image"&&a&&a.imageSrcSet?(f+='[imagesrcset="'+Qe(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(f+='[imagesizes="'+Qe(a.imageSizes)+'"]')):f+='[href="'+Qe(e)+'"]';var d=f;switch(i){case"style":d=Gs(e);break;case"script":d=ks(e)}ii.has(d)||(e=x({rel:"preload",href:i==="image"&&a&&a.imageSrcSet?void 0:e,as:i},a),ii.set(d,e),o.querySelector(f)!==null||i==="style"&&o.querySelector(ja(d))||i==="script"&&o.querySelector(Ha(d))||(i=o.createElement("link"),me(i,"link",e),le(i),o.head.appendChild(i)))}}function a1(e,i){Yi.m(e,i);var a=Os;if(a&&e){var o=i&&typeof i.as=="string"?i.as:"script",f='link[rel="modulepreload"][as="'+Qe(o)+'"][href="'+Qe(e)+'"]',d=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=ks(e)}if(!ii.has(d)&&(e=x({rel:"modulepreload",href:e},i),ii.set(d,e),a.querySelector(f)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Ha(d)))return}o=a.createElement("link"),me(o,"link",e),le(o),a.head.appendChild(o)}}}function l1(e,i,a){Yi.S(e,i,a);var o=Os;if(o&&e){var f=ns(o).hoistableStyles,d=Gs(e);i=i||"default";var y=f.get(d);if(!y){var v={loading:0,preload:null};if(y=o.querySelector(ja(d)))v.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":i},a),(a=ii.get(d))&&_c(e,a);var M=y=o.createElement("link");le(M),me(M,"link",e),M._p=new Promise(function(j,X){M.onload=j,M.onerror=X}),M.addEventListener("load",function(){v.loading|=1}),M.addEventListener("error",function(){v.loading|=2}),v.loading|=4,Cr(y,i,o)}y={type:"stylesheet",instance:y,count:1,state:v},f.set(d,y)}}}function r1(e,i){Yi.X(e,i);var a=Os;if(a&&e){var o=ns(a).hoistableScripts,f=ks(e),d=o.get(f);d||(d=a.querySelector(Ha(f)),d||(e=x({src:e,async:!0},i),(i=ii.get(f))&&bc(e,i),d=a.createElement("script"),le(d),me(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},o.set(f,d))}}function o1(e,i){Yi.M(e,i);var a=Os;if(a&&e){var o=ns(a).hoistableScripts,f=ks(e),d=o.get(f);d||(d=a.querySelector(Ha(f)),d||(e=x({src:e,async:!0,type:"module"},i),(i=ii.get(f))&&bc(e,i),d=a.createElement("script"),le(d),me(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},o.set(f,d))}}function zg(e,i,a,o){var f=(f=ct.current)?Ar(f):null;if(!f)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(i=Gs(a.href),a=ns(f).hoistableStyles,o=a.get(i),o||(o={type:"style",instance:null,count:0,state:null},a.set(i,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Gs(a.href);var d=ns(f).hoistableStyles,y=d.get(e);if(y||(f=f.ownerDocument||f,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,y),(d=f.querySelector(ja(e)))&&!d._p&&(y.instance=d,y.state.loading=5),ii.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},ii.set(e,a),d||u1(f,e,a,y.state))),i&&o===null)throw Error(s(528,""));return y}if(i&&o!==null)throw Error(s(529,""));return null;case"script":return i=a.async,a=a.src,typeof a=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=ks(a),a=ns(f).hoistableScripts,o=a.get(i),o||(o={type:"script",instance:null,count:0,state:null},a.set(i,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function Gs(e){return'href="'+Qe(e)+'"'}function ja(e){return'link[rel="stylesheet"]['+e+"]"}function Dg(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function u1(e,i,a,o){e.querySelector('link[rel="preload"][as="style"]['+i+"]")?o.loading=1:(i=e.createElement("link"),o.preload=i,i.addEventListener("load",function(){return o.loading|=1}),i.addEventListener("error",function(){return o.loading|=2}),me(i,"link",a),le(i),e.head.appendChild(i))}function ks(e){return'[src="'+Qe(e)+'"]'}function Ha(e){return"script[async]"+e}function Ng(e,i,a){if(i.count++,i.instance===null)switch(i.type){case"style":var o=e.querySelector('style[data-href~="'+Qe(a.href)+'"]');if(o)return i.instance=o,le(o),o;var f=x({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),le(o),me(o,"style",f),Cr(o,a.precedence,e),i.instance=o;case"stylesheet":f=Gs(a.href);var d=e.querySelector(ja(f));if(d)return i.state.loading|=4,i.instance=d,le(d),d;o=Dg(a),(f=ii.get(f))&&_c(o,f),d=(e.ownerDocument||e).createElement("link"),le(d);var y=d;return y._p=new Promise(function(v,M){y.onload=v,y.onerror=M}),me(d,"link",o),i.state.loading|=4,Cr(d,a.precedence,e),i.instance=d;case"script":return d=ks(a.src),(f=e.querySelector(Ha(d)))?(i.instance=f,le(f),f):(o=a,(f=ii.get(d))&&(o=x({},a),bc(o,f)),e=e.ownerDocument||e,f=e.createElement("script"),le(f),me(f,"link",o),e.head.appendChild(f),i.instance=f);case"void":return null;default:throw Error(s(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(o=i.instance,i.state.loading|=4,Cr(o,a.precedence,e));return i.instance}function Cr(e,i,a){for(var o=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=o.length?o[o.length-1]:null,d=f,y=0;y<o.length;y++){var v=o[y];if(v.dataset.precedence===i)d=v;else if(d!==f)break}d?d.parentNode.insertBefore(e,d.nextSibling):(i=a.nodeType===9?a.head:a,i.insertBefore(e,i.firstChild))}function _c(e,i){e.crossOrigin==null&&(e.crossOrigin=i.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=i.referrerPolicy),e.title==null&&(e.title=i.title)}function bc(e,i){e.crossOrigin==null&&(e.crossOrigin=i.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=i.referrerPolicy),e.integrity==null&&(e.integrity=i.integrity)}var Mr=null;function Bg(e,i,a){if(Mr===null){var o=new Map,f=Mr=new Map;f.set(a,o)}else f=Mr,o=f.get(a),o||(o=new Map,f.set(a,o));if(o.has(e))return o;for(o.set(e,null),a=a.getElementsByTagName(e),f=0;f<a.length;f++){var d=a[f];if(!(d[ea]||d[ce]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var y=d.getAttribute(i)||"";y=e+y;var v=o.get(y);v?v.push(d):o.set(y,[d])}}return o}function Og(e,i,a){e=e.ownerDocument||e,e.head.insertBefore(a,i==="title"?e.querySelector("head > title"):null)}function c1(e,i,a){if(a===1||i.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return e=i.disabled,typeof i.precedence=="string"&&e==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function Gg(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function h1(e,i,a,o){if(a.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var f=Gs(o.href),d=i.querySelector(ja(f));if(d){i=d._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(e.count++,e=Er.bind(e),i.then(e,e)),a.state.loading|=4,a.instance=d,le(d);return}d=i.ownerDocument||i,o=Dg(o),(f=ii.get(f))&&_c(o,f),d=d.createElement("link"),le(d);var y=d;y._p=new Promise(function(v,M){y.onload=v,y.onerror=M}),me(d,"link",o),a.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,i),(i=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Er.bind(e),i.addEventListener("load",a),i.addEventListener("error",a))}}var vc=0;function f1(e,i){return e.stylesheets&&e.count===0&&zr(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var o=setTimeout(function(){if(e.stylesheets&&zr(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+i);0<e.imgBytes&&vc===0&&(vc=62500*F_());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&zr(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>vc?50:800)+i);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function Er(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)zr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Rr=null;function zr(e,i){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Rr=new Map,i.forEach(d1,e),Rr=null,Er.call(e))}function d1(e,i){if(!(i.state.loading&4)){var a=Rr.get(e);if(a)var o=a.get(null);else{a=new Map,Rr.set(e,a);for(var f=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<f.length;d++){var y=f[d];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(a.set(y.dataset.precedence,y),o=y)}o&&a.set(null,o)}f=i.instance,y=f.getAttribute("data-precedence"),d=a.get(y)||o,d===o&&a.set(null,f),a.set(y,f),this.count++,o=Er.bind(this),f.addEventListener("load",o),f.addEventListener("error",o),d?d.parentNode.insertBefore(f,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(f,e.firstChild)),i.state.loading|=4}}var La={$$typeof:E,Provider:null,Consumer:null,_currentValue:et,_currentValue2:et,_threadCount:0};function m1(e,i,a,o,f,d,y,v,M){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=po(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=po(0),this.hiddenUpdates=po(null),this.identifierPrefix=o,this.onUncaughtError=f,this.onCaughtError=d,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=M,this.incompleteTransitions=new Map}function kg(e,i,a,o,f,d,y,v,M,j,X,F){return e=new m1(e,i,a,y,M,j,X,F,v),i=1,d===!0&&(i|=24),d=Ue(3,null,null,i),e.current=d,d.stateNode=e,i=tu(),i.refCount++,e.pooledCache=i,i.refCount++,d.memoizedState={element:o,isDehydrated:a,cache:i},su(d),e}function Ug(e){return e?(e=ds,e):ds}function jg(e,i,a,o,f,d){f=Ug(f),o.context===null?o.context=f:o.pendingContext=f,o=an(i),o.payload={element:a},d=d===void 0?null:d,d!==null&&(o.callback=d),a=ln(e,o,i),a!==null&&(Re(a,e,i),xa(a,e,i))}function Hg(e,i){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<i?a:i}}function Sc(e,i){Hg(e,i),(e=e.alternate)&&Hg(e,i)}function Lg(e){if(e.tag===13||e.tag===31){var i=Dn(e,67108864);i!==null&&Re(i,e,67108864),Sc(e,67108864)}}function Yg(e){if(e.tag===13||e.tag===31){var i=qe();i=yo(i);var a=Dn(e,i);a!==null&&Re(a,e,i),Sc(e,i)}}var Dr=!0;function g1(e,i,a,o){var f=D.T;D.T=null;var d=L.p;try{L.p=2,Tc(e,i,a,o)}finally{L.p=d,D.T=f}}function p1(e,i,a,o){var f=D.T;D.T=null;var d=L.p;try{L.p=8,Tc(e,i,a,o)}finally{L.p=d,D.T=f}}function Tc(e,i,a,o){if(Dr){var f=wc(o);if(f===null)uc(e,i,o,Nr,a),Xg(e,o);else if(x1(f,e,i,a,o))o.stopPropagation();else if(Xg(e,o),i&4&&-1<y1.indexOf(e)){for(;f!==null;){var d=is(f);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var y=Cn(d.pendingLanes);if(y!==0){var v=d;for(v.pendingLanes|=2,v.entangledLanes|=2;y;){var M=1<<31-Ge(y);v.entanglements[1]|=M,y&=~M}bi(d),(Rt&6)===0&&(mr=Be()+500,Oa(0))}}break;case 31:case 13:v=Dn(d,2),v!==null&&Re(v,d,2),pr(),Sc(d,2)}if(d=wc(o),d===null&&uc(e,i,o,Nr,a),d===f)break;f=d}f!==null&&o.stopPropagation()}else uc(e,i,o,null,a)}}function wc(e){return e=Co(e),Ac(e)}var Nr=null;function Ac(e){if(Nr=null,e=es(e),e!==null){var i=u(e);if(i===null)e=null;else{var a=i.tag;if(a===13){if(e=c(i),e!==null)return e;e=null}else if(a===31){if(e=h(i),e!==null)return e;e=null}else if(a===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;e=null}else i!==e&&(e=null)}}return Nr=e,null}function qg(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ix()){case Zh:return 2;case Ih:return 8;case vl:case nx:return 32;case Kh:return 268435456;default:return 32}default:return 32}}var Cc=!1,yn=null,xn=null,_n=null,Ya=new Map,qa=new Map,bn=[],y1="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Xg(e,i){switch(e){case"focusin":case"focusout":yn=null;break;case"dragenter":case"dragleave":xn=null;break;case"mouseover":case"mouseout":_n=null;break;case"pointerover":case"pointerout":Ya.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":qa.delete(i.pointerId)}}function Xa(e,i,a,o,f,d){return e===null||e.nativeEvent!==d?(e={blockedOn:i,domEventName:a,eventSystemFlags:o,nativeEvent:d,targetContainers:[f]},i!==null&&(i=is(i),i!==null&&Lg(i)),e):(e.eventSystemFlags|=o,i=e.targetContainers,f!==null&&i.indexOf(f)===-1&&i.push(f),e)}function x1(e,i,a,o,f){switch(i){case"focusin":return yn=Xa(yn,e,i,a,o,f),!0;case"dragenter":return xn=Xa(xn,e,i,a,o,f),!0;case"mouseover":return _n=Xa(_n,e,i,a,o,f),!0;case"pointerover":var d=f.pointerId;return Ya.set(d,Xa(Ya.get(d)||null,e,i,a,o,f)),!0;case"gotpointercapture":return d=f.pointerId,qa.set(d,Xa(qa.get(d)||null,e,i,a,o,f)),!0}return!1}function Vg(e){var i=es(e.target);if(i!==null){var a=u(i);if(a!==null){if(i=a.tag,i===13){if(i=c(a),i!==null){e.blockedOn=i,sf(e.priority,function(){Yg(a)});return}}else if(i===31){if(i=h(a),i!==null){e.blockedOn=i,sf(e.priority,function(){Yg(a)});return}}else if(i===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Br(e){if(e.blockedOn!==null)return!1;for(var i=e.targetContainers;0<i.length;){var a=wc(e.nativeEvent);if(a===null){a=e.nativeEvent;var o=new a.constructor(a.type,a);Ao=o,a.target.dispatchEvent(o),Ao=null}else return i=is(a),i!==null&&Lg(i),e.blockedOn=a,!1;i.shift()}return!0}function Pg(e,i,a){Br(e)&&a.delete(i)}function _1(){Cc=!1,yn!==null&&Br(yn)&&(yn=null),xn!==null&&Br(xn)&&(xn=null),_n!==null&&Br(_n)&&(_n=null),Ya.forEach(Pg),qa.forEach(Pg)}function Or(e,i){e.blockedOn===i&&(e.blockedOn=null,Cc||(Cc=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,_1)))}var Gr=null;function Fg(e){Gr!==e&&(Gr=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){Gr===e&&(Gr=null);for(var i=0;i<e.length;i+=3){var a=e[i],o=e[i+1],f=e[i+2];if(typeof o!="function"){if(Ac(o||a)===null)continue;break}var d=is(a);d!==null&&(e.splice(i,3),i-=3,wu(d,{pending:!0,data:f,method:a.method,action:o},o,f))}}))}function Us(e){function i(M){return Or(M,e)}yn!==null&&Or(yn,e),xn!==null&&Or(xn,e),_n!==null&&Or(_n,e),Ya.forEach(i),qa.forEach(i);for(var a=0;a<bn.length;a++){var o=bn[a];o.blockedOn===e&&(o.blockedOn=null)}for(;0<bn.length&&(a=bn[0],a.blockedOn===null);)Vg(a),a.blockedOn===null&&bn.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(o=0;o<a.length;o+=3){var f=a[o],d=a[o+1],y=f[Te]||null;if(typeof d=="function")y||Fg(a);else if(y){var v=null;if(d&&d.hasAttribute("formAction")){if(f=d,y=d[Te]||null)v=y.formAction;else if(Ac(f)!==null)continue}else v=y.action;typeof v=="function"?a[o+1]=v:(a.splice(o,3),o-=3),Fg(a)}}}function Wg(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(y){return f=y})},focusReset:"manual",scroll:"manual"})}function i(){f!==null&&(f(),f=null),o||setTimeout(a,20)}function a(){if(!o&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,f=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(a,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),f!==null&&(f(),f=null)}}}function Mc(e){this._internalRoot=e}kr.prototype.render=Mc.prototype.render=function(e){var i=this._internalRoot;if(i===null)throw Error(s(409));var a=i.current,o=qe();jg(a,o,e,i,null,null)},kr.prototype.unmount=Mc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var i=e.containerInfo;jg(e.current,2,null,e,null,null),pr(),i[ts]=null}};function kr(e){this._internalRoot=e}kr.prototype.unstable_scheduleHydration=function(e){if(e){var i=nf();e={blockedOn:null,target:e,priority:i};for(var a=0;a<bn.length&&i!==0&&i<bn[a].priority;a++);bn.splice(a,0,e),a===0&&Vg(e)}};var Qg=t.version;if(Qg!=="19.2.4")throw Error(s(527,Qg,"19.2.4"));L.findDOMNode=function(e){var i=e._reactInternals;if(i===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=g(i),e=e!==null?p(e):null,e=e===null?null:e.stateNode,e};var b1={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ur=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ur.isDisabled&&Ur.supportsFiber)try{$s=Ur.inject(b1),Oe=Ur}catch{}}return Pa.createRoot=function(e,i){if(!r(e))throw Error(s(299));var a=!1,o="",f=em,d=im,y=nm;return i!=null&&(i.unstable_strictMode===!0&&(a=!0),i.identifierPrefix!==void 0&&(o=i.identifierPrefix),i.onUncaughtError!==void 0&&(f=i.onUncaughtError),i.onCaughtError!==void 0&&(d=i.onCaughtError),i.onRecoverableError!==void 0&&(y=i.onRecoverableError)),i=kg(e,1,!1,null,null,a,o,null,f,d,y,Wg),e[ts]=i.current,oc(e),new Mc(i)},Pa.hydrateRoot=function(e,i,a){if(!r(e))throw Error(s(299));var o=!1,f="",d=em,y=im,v=nm,M=null;return a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(f=a.identifierPrefix),a.onUncaughtError!==void 0&&(d=a.onUncaughtError),a.onCaughtError!==void 0&&(y=a.onCaughtError),a.onRecoverableError!==void 0&&(v=a.onRecoverableError),a.formState!==void 0&&(M=a.formState)),i=kg(e,1,!0,i,a??null,o,f,M,d,y,v,Wg),i.context=Ug(null),a=i.current,o=qe(),o=yo(o),f=an(o),f.callback=null,ln(a,f,o),a=o,i.current.lanes=a,ta(i,a),bi(i),e[ts]=i.current,oc(e),new kr(i)},Pa.version="19.2.4",Pa}var sp;function N1(){if(sp)return zc.exports;sp=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(t){console.error(t)}}return l(),zc.exports=D1(),zc.exports}var B1=N1();const ap=l=>{let t;const n=new Set,s=(g,p)=>{const x=typeof g=="function"?g(t):g;if(!Object.is(x,t)){const b=t;t=p??(typeof x!="object"||x===null)?x:Object.assign({},t,x),n.forEach(_=>_(t,b))}},r=()=>t,h={setState:s,getState:r,getInitialState:()=>m,subscribe:g=>(n.add(g),()=>n.delete(g))},m=t=l(s,r,h);return h},O1=(l=>l?ap(l):ap),G1=l=>l;function k1(l,t=G1){const n=jr.useSyncExternalStore(l.subscribe,jr.useCallback(()=>t(l.getState()),[l,t]),jr.useCallback(()=>t(l.getInitialState()),[l,t]));return jr.useDebugValue(n),n}const lp=l=>{const t=O1(l),n=s=>k1(t,s);return Object.assign(n,t),n},U1=(l=>l?lp(l):lp);let j1=0;const ht=U1(l=>({connected:!1,agents:[],tasks:[],messages:[],prs:[],sprint:null,selectedPR:null,selectedAgent:null,wowEvents:[],activity:[],setConnected:t=>l({connected:t}),setAgents:t=>l({agents:t}),setTasks:t=>l({tasks:t}),setSprint:t=>l({sprint:t}),setPRs:t=>l({prs:t}),setSelectedPR:t=>l({selectedPR:t}),setSelectedAgent:t=>l({selectedAgent:t}),addMessage:t=>l(n=>({messages:[...n.messages.slice(-199),t]})),updateAgent:(t,n)=>l(s=>({agents:s.agents.map(r=>r.id===t?{...r,...n}:r)})),updateTask:(t,n)=>l(s=>({tasks:s.tasks.map(r=>r.id===t?{...r,...n}:r)})),addPR:t=>l(n=>({prs:[...n.prs,t]})),updatePR:(t,n)=>l(s=>({prs:s.prs.map(r=>r.id===t?{...r,...n}:r)})),pushWow:t=>l(n=>({wowEvents:[...n.wowEvents,t]})),popWow:()=>{const n=ht.getState().wowEvents;if(n.length===0)return;const s=n[0];return ht.setState({wowEvents:n.slice(1)}),s},pushActivity:t=>l(n=>({activity:[...n.activity.slice(-299),{...t,id:`act-${++j1}`,time:new Date().toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}]}))})),si=[{id:"ceo-office",label:"CEO Office",col:0,row:0,w:4,h:3,color:"#ffd700",floorColor:"#c4b08c",wallColor:"#6e6e80",icon:"👑"},{id:"cto-office",label:"CTO Office",col:4,row:0,w:4,h:3,color:"#00bfff",floorColor:"#b8a888",wallColor:"#6a6a7c",icon:"🔬"},{id:"arch-lab",label:"Arch Lab",col:8,row:0,w:4,h:3,color:"#b57edc",floorColor:"#bca890",wallColor:"#6c6c7e",icon:"🏛️"},{id:"meeting-room",label:"Meeting Room",col:12,row:0,w:4,h:3,color:"#4169e1",floorColor:"#c0a888",wallColor:"#6e6e80",icon:"🤝"},{id:"dev-bullpen",label:"Dev Bullpen",col:0,row:3,w:8,h:4,color:"#50c878",floorColor:"#b8a480",wallColor:"#686878",icon:"⚡"},{id:"qa-lab",label:"QA Lab",col:8,row:3,w:4,h:4,color:"#ff8c00",floorColor:"#c0a480",wallColor:"#6a6a7a",icon:"🔍"},{id:"design-studio",label:"Design Studio",col:12,row:3,w:4,h:4,color:"#8a2be2",floorColor:"#bca488",wallColor:"#6c6c7c",icon:"🎨"},{id:"data-lab",label:"Data Lab",col:0,row:7,w:4,h:4,color:"#708090",floorColor:"#b0a088",wallColor:"#686878",icon:"📊"},{id:"crisis-room",label:"War Room",col:4,row:7,w:4,h:4,color:"#dc143c",floorColor:"#b8a080",wallColor:"#6a6a7a",icon:"🚨"},{id:"lounge",label:"Lounge",col:8,row:7,w:8,h:4,color:"#ff6347",floorColor:"#c8b090",wallColor:"#6c6c7c",icon:"☕"}],Oc={col:0,row:0,w:16,h:11},H1=[{room:"ceo-office",seat:0,col:2,row:1.5},{room:"cto-office",seat:0,col:6,row:1.5},{room:"arch-lab",seat:0,col:10,row:1.5},{room:"meeting-room",seat:0,col:13.2,row:.8},{room:"meeting-room",seat:1,col:14.8,row:.8},{room:"meeting-room",seat:2,col:13.2,row:2.2},{room:"meeting-room",seat:3,col:14.8,row:2.2},{room:"meeting-room",seat:4,col:12.5,row:1.5},{room:"meeting-room",seat:5,col:15.5,row:1.5},{room:"meeting-room",seat:6,col:13.5,row:.4},{room:"meeting-room",seat:7,col:14.5,row:.4},{room:"meeting-room",seat:8,col:13.5,row:2.6},{room:"meeting-room",seat:9,col:14.5,row:2.6},{room:"meeting-room",seat:10,col:14,row:1.5},{room:"dev-bullpen",seat:0,col:2,row:5},{room:"dev-bullpen",seat:1,col:5.5,row:5.5},{room:"qa-lab",seat:0,col:9.5,row:5},{room:"qa-lab",seat:1,col:11,row:5.5},{room:"design-studio",seat:0,col:13.5,row:5},{room:"design-studio",seat:1,col:15,row:5.5},{room:"data-lab",seat:0,col:2,row:9},{room:"crisis-room",seat:0,col:6,row:9},{room:"lounge",seat:0,col:12,row:9}],nl={sage:{room:"ceo-office",seat:0},nova:{room:"cto-office",seat:0},aria:{room:"arch-lab",seat:0},dex:{room:"dev-bullpen",seat:0},flux:{room:"dev-bullpen",seat:1},quinn:{room:"qa-lab",seat:0},gage:{room:"qa-lab",seat:1},uma:{room:"design-studio",seat:0},morgan:{room:"design-studio",seat:1},river:{room:"lounge",seat:0},atlas:{room:"data-lab",seat:0}},rp={sage:0,nova:1,aria:2,dex:3,flux:4,quinn:5,gage:6,morgan:7,uma:8,river:9,atlas:10},L1=[{room:"ceo-office",type:"desk",col:1.5,row:1},{room:"ceo-office",type:"monitor",col:1.8,row:.7},{room:"ceo-office",type:"plant",col:.5,row:.4},{room:"ceo-office",type:"shelf",col:3.2,row:.4},{room:"cto-office",type:"desk",col:5.5,row:1},{room:"cto-office",type:"monitor",col:5.8,row:.7},{room:"cto-office",type:"monitor",col:6.4,row:.7},{room:"cto-office",type:"server",col:7.2,row:.4},{room:"arch-lab",type:"desk",col:9.5,row:1},{room:"arch-lab",type:"monitor",col:9.8,row:.7},{room:"arch-lab",type:"whiteboard",col:11.2,row:.5},{room:"meeting-room",type:"table",col:14,row:1.3},{room:"meeting-room",type:"whiteboard",col:12.5,row:.3},{room:"dev-bullpen",type:"desk",col:1.5,row:4.5},{room:"dev-bullpen",type:"monitor",col:1.8,row:4.2},{room:"dev-bullpen",type:"desk",col:5,row:5},{room:"dev-bullpen",type:"monitor",col:5.3,row:4.7},{room:"dev-bullpen",type:"plant",col:7,row:3.4},{room:"qa-lab",type:"desk",col:9,row:4.5},{room:"qa-lab",type:"monitor",col:9.3,row:4.2},{room:"qa-lab",type:"server",col:11.2,row:3.4},{room:"design-studio",type:"desk",col:13,row:4.5},{room:"design-studio",type:"monitor",col:13.3,row:4.2},{room:"design-studio",type:"whiteboard",col:15,row:3.5},{room:"data-lab",type:"desk",col:1.5,row:8.5},{room:"data-lab",type:"monitor",col:1.8,row:8.2},{room:"data-lab",type:"server",col:3,row:7.5},{room:"data-lab",type:"server",col:3.5,row:7.5},{room:"crisis-room",type:"table",col:6,row:8.5},{room:"crisis-room",type:"monitor",col:5,row:7.5},{room:"crisis-room",type:"monitor",col:7,row:7.5},{room:"lounge",type:"couch",col:10,row:8.5},{room:"lounge",type:"couch",col:14,row:8.5},{room:"lounge",type:"coffee",col:12,row:9},{room:"lounge",type:"plant",col:9,row:7.5},{room:"lounge",type:"plant",col:15,row:7.5}];function Ay(l,t){return H1.find(n=>n.room===l&&n.seat===t)}const Gc={sage:"👑",nova:"🔬",aria:"🏛️",dex:"⚡",flux:"🌊",quinn:"🔍",gage:"🚀",morgan:"📋",uma:"🎨",river:"🌀",atlas:"📊"},Y1={sage:"Sage",nova:"Nova",aria:"Aria",dex:"Dex",flux:"Flux",quinn:"Quinn",gage:"Gage",morgan:"Morgan",uma:"Uma",river:"River",atlas:"Atlas"},q1={Edit:"editing",Write:"creating",Read:"reading",Bash:"running",Grep:"searching for",Glob:"looking for",Agent:"delegating to sub-agent"},X1={coding:"is writing code",reviewing:"is reviewing files",testing:"is running tests",planning:"is planning the sprint",blocked:"is blocked!",deploying:"is deploying",thinking:"is thinking...",idle:"finished and is idle"};function V1(){const l=Ve.useRef(null),t=Ve.useRef({}),{setAgents:n,setTasks:s,setPRs:r,addMessage:u,updateAgent:c,updateTask:h,addPR:m,updatePR:g,pushActivity:p}=ht.getState();Ve.useEffect(()=>{function x(){const S=window.location.protocol==="https:"?"wss:":"ws:",A=new WebSocket(`${S}//${window.location.host}`);l.current=A,A.onopen=()=>{ht.setState({connected:!0}),p({agentId:null,icon:"🟢",text:"Connected to Sage Team HQ",type:"system"})},A.onclose=()=>{ht.setState({connected:!1}),setTimeout(x,2e3)},A.onerror=()=>{A.close()},A.onmessage=C=>{try{const E=JSON.parse(C.data);w(E)}catch{}}}function b(S){return Y1[S]||S}function _(S){return`${Gc[S]||"🤖"} ${b(S)}`}function T(S,A,C){const E=b(S),G=q1[A]||`using ${A}`;if(A==="Edit"||A==="Write"||A==="Read")return C?`${E} ${G} ${C}`:`${E} ${G} a file`;if(A==="Bash"){if(!C)return`${E} running a command`;const P=C.length>60?C.slice(0,57)+"...":C;return`${E} $ ${P}`}return A==="Grep"||A==="Glob"?C?`${E} ${G} "${C}"`:`${E} searching the codebase`:`${E} ${G}`}function w(S){var G,P;const A=S.type,C=S.agentId,E=S.data||{};switch(A){case"snapshot":{if(S.agents){const k=S.agents.map(K=>({...K,position_room:"lounge",position_seat:0}));n(k);const B=S.agents;for(let K=0;K<B.length;K++){const Q=B[K],Z=nl[Q.id];Z&&setTimeout(()=>{c(Q.id,{position_room:Z.room,position_seat:Z.seat})},800+K*400)}}S.tasks&&s(S.tasks),S.prs&&r(S.prs),S.sprint&&ht.setState({sprint:S.sprint}),p({agentId:null,icon:"🏢",text:`Office online — ${((G=S.agents)==null?void 0:G.length)||0} agents, ${((P=S.tasks)==null?void 0:P.length)||0} tasks loaded`,type:"system"});break}case"agent:status":{const k=E.status||S.status;if(c(C,{status:k}),E.tool&&k!=="idle"){const B=T(C,E.tool,E.detail||"");t.current[C]!==B&&(t.current[C]=B,p({agentId:C,icon:Gc[C]||"🤖",text:B,type:"agent"}))}else if(k&&k!=="idle"&&!E.tool){const B=X1[k]||`is ${k}`,K=`${b(C)} ${B}`;t.current[C]!==K&&(t.current[C]=K,p({agentId:C,icon:Gc[C]||"🤖",text:K,type:"agent"}))}break}case"agent:narration":p({agentId:C,icon:"💭",text:`${b(C)}: "${E.text}"`,type:"agent"});break;case"agent:move":c(C,{position_room:E.room||S.room,position_seat:E.seat||S.seat});break;case"task:status":h(E.taskId||S.taskId,{status:E.status||S.status});break;case"task:assigned":{const k=E.taskId||S.taskId;h(k,{assigned_to:C,status:"in_progress"}),c(C,{current_task_id:k,status:"coding"});const B=nl[C];B&&c(C,{position_room:B.room,position_seat:B.seat});const Q=ht.getState().tasks.find(I=>I.id===k),Z=(Q==null?void 0:Q.title)||"a new task";p({agentId:C,icon:"🎯",text:`${_(C)} picked up: ${Z}`,type:"task"});break}case"task:completed":{const k=E.taskId||S.taskId;h(k,{status:"done"});const K=ht.getState().tasks.find(tt=>tt.id===k),Q=(K==null?void 0:K.title)||"task",Z=E.cost?` ($${E.cost.toFixed(3)})`:"",I=E.duration?` in ${Math.round(E.duration/1e3)}s`:"";p({agentId:C,icon:"✅",text:`${_(C)} completed "${Q}"${I}${Z}`,type:"success"}),E.result&&E.result.length>10&&p({agentId:C,icon:"📝",text:`Summary: ${E.result.slice(0,150)}`,type:"info"}),t.current[C]="";break}case"task:failed":p({agentId:C,icon:"❌",text:`${_(C)} task failed (exit ${E.exitCode||"?"})`,type:"warning"}),t.current[C]="";break;case"message":u(S.message||E);break;case"pr:created":m(S.pr||E),p({agentId:E.agentId||C,icon:"📦",text:`${_(C)} opened PR on branch ${E.branch||"?"}`,type:"info"});break;case"pr:updated":g(S.prId||E.prId,S.updates||E);break;case"pr:merged":ht.getState().pushWow({type:"pr:merged",agentId:C||E.agentId,title:E.title||S.title||""}),p({agentId:C,icon:"🎉",text:`PR merged! ${E.title||""}`,type:"success"});break;case"sprint:created":ht.setState({sprint:S.sprint||E}),p({agentId:null,icon:"🏁",text:`Sprint "${(S.sprint||E).name}" created — let's go!`,type:"system"});break;case"sprint:completed":ht.setState(k=>({sprint:k.sprint?{...k.sprint,status:"completed"}:null})),ht.getState().pushWow({type:"sprint:complete"}),p({agentId:null,icon:"🏆",text:"Sprint completed! All tasks done.",type:"success"});break;case"system":p({agentId:C,icon:"💬",text:E.message||"System event",type:"system"});break;case"meeting:start":ht.getState().pushWow({type:"meeting:start",agents:S.agents||E.agents||[]}),p({agentId:null,icon:"🤝",text:"Team standup meeting started",type:"info"});break;case"meeting:end":ht.getState().pushWow({type:"meeting:end"}),p({agentId:null,icon:"👋",text:"Meeting ended — back to work!",type:"info"});break;case"crisis:start":ht.getState().pushWow({type:"crisis:start",reason:S.reason||E.reason||""}),p({agentId:null,icon:"🚨",text:`Crisis: ${E.reason||S.reason||"unknown"}`,type:"warning"});break;case"crisis:resolved":ht.getState().pushWow({type:"crisis:resolved"}),p({agentId:null,icon:"✅",text:"Crisis resolved — all clear",type:"success"});break;case"deploy:success":ht.getState().pushWow({type:"deploy:success"}),p({agentId:null,icon:"🚀",text:"Deployment successful!",type:"success"});break;case"pair:start":ht.getState().pushWow({type:"pair:start",agents:S.agents||E.agents||[]});break;case"pair:end":ht.getState().pushWow({type:"pair:end"});break}}return x(),()=>{var S;(S=l.current)==null||S.close()}},[])}const P1="modulepreload",F1=function(l){return"/"+l},op={},sl=function(t,n,s){let r=Promise.resolve();if(n&&n.length>0){let c=function(g){return Promise.all(g.map(p=>Promise.resolve(p).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};document.getElementsByTagName("link");const h=document.querySelector("meta[property=csp-nonce]"),m=(h==null?void 0:h.nonce)||(h==null?void 0:h.getAttribute("nonce"));r=c(n.map(g=>{if(g=F1(g),g in op)return;op[g]=!0;const p=g.endsWith(".css"),x=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${x}`))return;const b=document.createElement("link");if(b.rel=p?"stylesheet":P1,p||(b.as="script"),b.crossOrigin="",b.href=g,m&&b.setAttribute("nonce",m),document.head.appendChild(b),p)return new Promise((_,T)=>{b.addEventListener("load",_),b.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${g}`)))})}))}function u(c){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=c,window.dispatchEvent(h),!h.defaultPrevented)throw c}return r.then(c=>{for(const h of c||[])h.status==="rejected"&&u(h.reason);return t().catch(u)})};var yt=(l=>(l.Application="application",l.WebGLPipes="webgl-pipes",l.WebGLPipesAdaptor="webgl-pipes-adaptor",l.WebGLSystem="webgl-system",l.WebGPUPipes="webgpu-pipes",l.WebGPUPipesAdaptor="webgpu-pipes-adaptor",l.WebGPUSystem="webgpu-system",l.CanvasSystem="canvas-system",l.CanvasPipesAdaptor="canvas-pipes-adaptor",l.CanvasPipes="canvas-pipes",l.Asset="asset",l.LoadParser="load-parser",l.ResolveParser="resolve-parser",l.CacheParser="cache-parser",l.DetectionParser="detection-parser",l.MaskEffect="mask-effect",l.BlendMode="blend-mode",l.TextureSource="texture-source",l.Environment="environment",l.ShapeBuilder="shape-builder",l.Batcher="batcher",l))(yt||{});const hh=l=>{if(typeof l=="function"||typeof l=="object"&&l.extension){if(!l.extension)throw new Error("Extension class must have an extension object");l={...typeof l.extension!="object"?{type:l.extension}:l.extension,ref:l}}if(typeof l=="object")l={...l};else throw new Error("Invalid extension type");return typeof l.type=="string"&&(l.type=[l.type]),l},Hr=(l,t)=>hh(l).priority??t,Jt={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...l){return l.map(hh).forEach(t=>{t.type.forEach(n=>{var s,r;return(r=(s=this._removeHandlers)[n])==null?void 0:r.call(s,t)})}),this},add(...l){return l.map(hh).forEach(t=>{t.type.forEach(n=>{var u,c;const s=this._addHandlers,r=this._queue;s[n]?(c=s[n])==null||c.call(s,t):(r[n]=r[n]||[],(u=r[n])==null||u.push(t))})}),this},handle(l,t,n){var c;const s=this._addHandlers,r=this._removeHandlers;if(s[l]||r[l])throw new Error(`Extension type ${l} already has a handler`);s[l]=t,r[l]=n;const u=this._queue;return u[l]&&((c=u[l])==null||c.forEach(h=>t(h)),delete u[l]),this},handleByMap(l,t){return this.handle(l,n=>{n.name&&(t[n.name]=n.ref)},n=>{n.name&&delete t[n.name]})},handleByNamedList(l,t,n=-1){return this.handle(l,s=>{t.findIndex(u=>u.name===s.name)>=0||(t.push({name:s.name,value:s.ref}),t.sort((u,c)=>Hr(c.value,n)-Hr(u.value,n)))},s=>{const r=t.findIndex(u=>u.name===s.name);r!==-1&&t.splice(r,1)})},handleByList(l,t,n=-1){return this.handle(l,s=>{t.includes(s.ref)||(t.push(s.ref),t.sort((r,u)=>Hr(u,n)-Hr(r,n)))},s=>{const r=t.indexOf(s.ref);r!==-1&&t.splice(r,1)})},mixin(l,...t){for(const n of t)Object.defineProperties(l.prototype,Object.getOwnPropertyDescriptors(n))}},W1={extension:{type:yt.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await sl(()=>import("./browserAll-C9HRyLf9.js"),__vite__mapDeps([0,1,2]))}},Q1={extension:{type:yt.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await sl(()=>import("./webworkerAll-WnWYpa5G.js"),__vite__mapDeps([1,2]))}};class ge{constructor(t,n,s){this._x=n||0,this._y=s||0,this._observer=t}clone(t){return new ge(t??this._observer,this._x,this._y)}set(t=0,n=t){return(this._x!==t||this._y!==n)&&(this._x=t,this._y=n,this._observer._onUpdate(this)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this._observer._onUpdate(this)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.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(t){this._x!==t&&(this._x=t,this._observer._onUpdate(this))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this._observer._onUpdate(this))}}var kc={exports:{}},up;function Z1(){return up||(up=1,(function(l){var t=Object.prototype.hasOwnProperty,n="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(n=!1));function r(m,g,p){this.fn=m,this.context=g,this.once=p||!1}function u(m,g,p,x,b){if(typeof p!="function")throw new TypeError("The listener must be a function");var _=new r(p,x||m,b),T=n?n+g:g;return m._events[T]?m._events[T].fn?m._events[T]=[m._events[T],_]:m._events[T].push(_):(m._events[T]=_,m._eventsCount++),m}function c(m,g){--m._eventsCount===0?m._events=new s:delete m._events[g]}function h(){this._events=new s,this._eventsCount=0}h.prototype.eventNames=function(){var g=[],p,x;if(this._eventsCount===0)return g;for(x in p=this._events)t.call(p,x)&&g.push(n?x.slice(1):x);return Object.getOwnPropertySymbols?g.concat(Object.getOwnPropertySymbols(p)):g},h.prototype.listeners=function(g){var p=n?n+g:g,x=this._events[p];if(!x)return[];if(x.fn)return[x.fn];for(var b=0,_=x.length,T=new Array(_);b<_;b++)T[b]=x[b].fn;return T},h.prototype.listenerCount=function(g){var p=n?n+g:g,x=this._events[p];return x?x.fn?1:x.length:0},h.prototype.emit=function(g,p,x,b,_,T){var w=n?n+g:g;if(!this._events[w])return!1;var S=this._events[w],A=arguments.length,C,E;if(S.fn){switch(S.once&&this.removeListener(g,S.fn,void 0,!0),A){case 1:return S.fn.call(S.context),!0;case 2:return S.fn.call(S.context,p),!0;case 3:return S.fn.call(S.context,p,x),!0;case 4:return S.fn.call(S.context,p,x,b),!0;case 5:return S.fn.call(S.context,p,x,b,_),!0;case 6:return S.fn.call(S.context,p,x,b,_,T),!0}for(E=1,C=new Array(A-1);E<A;E++)C[E-1]=arguments[E];S.fn.apply(S.context,C)}else{var G=S.length,P;for(E=0;E<G;E++)switch(S[E].once&&this.removeListener(g,S[E].fn,void 0,!0),A){case 1:S[E].fn.call(S[E].context);break;case 2:S[E].fn.call(S[E].context,p);break;case 3:S[E].fn.call(S[E].context,p,x);break;case 4:S[E].fn.call(S[E].context,p,x,b);break;default:if(!C)for(P=1,C=new Array(A-1);P<A;P++)C[P-1]=arguments[P];S[E].fn.apply(S[E].context,C)}}return!0},h.prototype.on=function(g,p,x){return u(this,g,p,x,!1)},h.prototype.once=function(g,p,x){return u(this,g,p,x,!0)},h.prototype.removeListener=function(g,p,x,b){var _=n?n+g:g;if(!this._events[_])return this;if(!p)return c(this,_),this;var T=this._events[_];if(T.fn)T.fn===p&&(!b||T.once)&&(!x||T.context===x)&&c(this,_);else{for(var w=0,S=[],A=T.length;w<A;w++)(T[w].fn!==p||b&&!T[w].once||x&&T[w].context!==x)&&S.push(T[w]);S.length?this._events[_]=S.length===1?S[0]:S:c(this,_)}return this},h.prototype.removeAllListeners=function(g){var p;return g?(p=n?n+g:g,this._events[p]&&c(this,p)):(this._events=new s,this._eventsCount=0),this},h.prototype.off=h.prototype.removeListener,h.prototype.addListener=h.prototype.on,h.prefixed=n,h.EventEmitter=h,l.exports=h})(kc)),kc.exports}var I1=Z1();const Ti=Dh(I1),K1=Math.PI*2,$1=180/Math.PI,J1=Math.PI/180;class xe{constructor(t=0,n=0){this.x=0,this.y=0,this.x=t,this.y=n}clone(){return new xe(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,n=t){return this.x=t,this.y=n,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return Uc.x=0,Uc.y=0,Uc}}const Uc=new xe;class St{constructor(t=1,n=0,s=0,r=1,u=0,c=0){this.array=null,this.a=t,this.b=n,this.c=s,this.d=r,this.tx=u,this.ty=c}fromArray(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}set(t,n,s,r,u,c){return this.a=t,this.b=n,this.c=s,this.d=r,this.tx=u,this.ty=c,this}toArray(t,n){this.array||(this.array=new Float32Array(9));const s=n||this.array;return t?(s[0]=this.a,s[1]=this.b,s[2]=0,s[3]=this.c,s[4]=this.d,s[5]=0,s[6]=this.tx,s[7]=this.ty,s[8]=1):(s[0]=this.a,s[1]=this.c,s[2]=this.tx,s[3]=this.b,s[4]=this.d,s[5]=this.ty,s[6]=0,s[7]=0,s[8]=1),s}apply(t,n){n=n||new xe;const s=t.x,r=t.y;return n.x=this.a*s+this.c*r+this.tx,n.y=this.b*s+this.d*r+this.ty,n}applyInverse(t,n){n=n||new xe;const s=this.a,r=this.b,u=this.c,c=this.d,h=this.tx,m=this.ty,g=1/(s*c+u*-r),p=t.x,x=t.y;return n.x=c*g*p+-u*g*x+(m*u-h*c)*g,n.y=s*g*x+-r*g*p+(-m*s+h*r)*g,n}translate(t,n){return this.tx+=t,this.ty+=n,this}scale(t,n){return this.a*=t,this.d*=n,this.c*=t,this.b*=n,this.tx*=t,this.ty*=n,this}rotate(t){const n=Math.cos(t),s=Math.sin(t),r=this.a,u=this.c,c=this.tx;return this.a=r*n-this.b*s,this.b=r*s+this.b*n,this.c=u*n-this.d*s,this.d=u*s+this.d*n,this.tx=c*n-this.ty*s,this.ty=c*s+this.ty*n,this}append(t){const n=this.a,s=this.b,r=this.c,u=this.d;return this.a=t.a*n+t.b*r,this.b=t.a*s+t.b*u,this.c=t.c*n+t.d*r,this.d=t.c*s+t.d*u,this.tx=t.tx*n+t.ty*r+this.tx,this.ty=t.tx*s+t.ty*u+this.ty,this}appendFrom(t,n){const s=t.a,r=t.b,u=t.c,c=t.d,h=t.tx,m=t.ty,g=n.a,p=n.b,x=n.c,b=n.d;return this.a=s*g+r*x,this.b=s*p+r*b,this.c=u*g+c*x,this.d=u*p+c*b,this.tx=h*g+m*x+n.tx,this.ty=h*p+m*b+n.ty,this}setTransform(t,n,s,r,u,c,h,m,g){return this.a=Math.cos(h+g)*u,this.b=Math.sin(h+g)*u,this.c=-Math.sin(h-m)*c,this.d=Math.cos(h-m)*c,this.tx=t-(s*this.a+r*this.c),this.ty=n-(s*this.b+r*this.d),this}prepend(t){const n=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){const s=this.a,r=this.c;this.a=s*t.a+this.b*t.c,this.b=s*t.b+this.b*t.d,this.c=r*t.a+this.d*t.c,this.d=r*t.b+this.d*t.d}return this.tx=n*t.a+this.ty*t.c+t.tx,this.ty=n*t.b+this.ty*t.d+t.ty,this}decompose(t){const n=this.a,s=this.b,r=this.c,u=this.d,c=t.pivot,h=-Math.atan2(-r,u),m=Math.atan2(s,n),g=Math.abs(h+m);return g<1e-5||Math.abs(K1-g)<1e-5?(t.rotation=m,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=h,t.skew.y=m),t.scale.x=Math.sqrt(n*n+s*s),t.scale.y=Math.sqrt(r*r+u*u),t.position.x=this.tx+(c.x*n+c.y*r),t.position.y=this.ty+(c.x*s+c.y*u),t}invert(){const t=this.a,n=this.b,s=this.c,r=this.d,u=this.tx,c=t*r-n*s;return this.a=r/c,this.b=-n/c,this.c=-s/c,this.d=t/c,this.tx=(s*this.ty-r*u)/c,this.ty=-(t*this.ty-n*u)/c,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 t=new St;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyFrom(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}equals(t){return t.a===this.a&&t.b===this.b&&t.c===this.c&&t.d===this.d&&t.tx===this.tx&&t.ty===this.ty}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 eb.identity()}static get shared(){return tb.identity()}}const tb=new St,eb=new St,Fn=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Wn=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Qn=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Zn=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],fh=[],Cy=[],Lr=Math.sign;function ib(){for(let l=0;l<16;l++){const t=[];fh.push(t);for(let n=0;n<16;n++){const s=Lr(Fn[l]*Fn[n]+Qn[l]*Wn[n]),r=Lr(Wn[l]*Fn[n]+Zn[l]*Wn[n]),u=Lr(Fn[l]*Qn[n]+Qn[l]*Zn[n]),c=Lr(Wn[l]*Qn[n]+Zn[l]*Zn[n]);for(let h=0;h<16;h++)if(Fn[h]===s&&Wn[h]===r&&Qn[h]===u&&Zn[h]===c){t.push(h);break}}}for(let l=0;l<16;l++){const t=new St;t.set(Fn[l],Wn[l],Qn[l],Zn[l],0,0),Cy.push(t)}}ib();const Ut={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:l=>Fn[l],uY:l=>Wn[l],vX:l=>Qn[l],vY:l=>Zn[l],inv:l=>l&8?l&15:-l&7,add:(l,t)=>fh[l][t],sub:(l,t)=>fh[l][Ut.inv(t)],rotate180:l=>l^4,isVertical:l=>(l&3)===2,byDirection:(l,t)=>Math.abs(l)*2<=Math.abs(t)?t>=0?Ut.S:Ut.N:Math.abs(t)*2<=Math.abs(l)?l>0?Ut.E:Ut.W:t>0?l>0?Ut.SE:Ut.SW:l>0?Ut.NE:Ut.NW,matrixAppendRotationInv:(l,t,n=0,s=0,r=0,u=0)=>{const c=Cy[Ut.inv(t)],h=c.a,m=c.b,g=c.c,p=c.d,x=n-Math.min(0,h*r,g*u,h*r+g*u),b=s-Math.min(0,m*r,p*u,m*r+p*u),_=l.a,T=l.b,w=l.c,S=l.d;l.a=h*_+m*w,l.b=h*T+m*S,l.c=g*_+p*w,l.d=g*T+p*S,l.tx=x*_+b*w+l.tx,l.ty=x*T+b*S+l.ty},transformRectCoords:(l,t,n,s)=>{const{x:r,y:u,width:c,height:h}=l,{x:m,y:g,width:p,height:x}=t;return n===Ut.E?(s.set(r+m,u+g,c,h),s):n===Ut.S?s.set(p-u-h+m,r+g,h,c):n===Ut.W?s.set(p-r-c+m,x-u-h+g,c,h):n===Ut.N?s.set(u+m,x-r-c+g,h,c):s.set(r+m,u+g,c,h)}},Yr=[new xe,new xe,new xe,new xe];class $t{constructor(t=0,n=0,s=0,r=0){this.type="rectangle",this.x=Number(t),this.y=Number(n),this.width=Number(s),this.height=Number(r)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new $t(0,0,0,0)}clone(){return new $t(this.x,this.y,this.width,this.height)}copyFromBounds(t){return this.x=t.minX,this.y=t.minY,this.width=t.maxX-t.minX,this.height=t.maxY-t.minY,this}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,n){return this.width<=0||this.height<=0?!1:t>=this.x&&t<this.x+this.width&&n>=this.y&&n<this.y+this.height}strokeContains(t,n,s,r=.5){const{width:u,height:c}=this;if(u<=0||c<=0)return!1;const h=this.x,m=this.y,g=s*(1-r),p=s-g,x=h-g,b=h+u+g,_=m-g,T=m+c+g,w=h+p,S=h+u-p,A=m+p,C=m+c-p;return t>=x&&t<=b&&n>=_&&n<=T&&!(t>w&&t<S&&n>A&&n<C)}intersects(t,n){if(!n){const K=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=K)return!1;const Z=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>Z}const s=this.left,r=this.right,u=this.top,c=this.bottom;if(r<=s||c<=u)return!1;const h=Yr[0].set(t.left,t.top),m=Yr[1].set(t.left,t.bottom),g=Yr[2].set(t.right,t.top),p=Yr[3].set(t.right,t.bottom);if(g.x<=h.x||m.y<=h.y)return!1;const x=Math.sign(n.a*n.d-n.b*n.c);if(x===0||(n.apply(h,h),n.apply(m,m),n.apply(g,g),n.apply(p,p),Math.max(h.x,m.x,g.x,p.x)<=s||Math.min(h.x,m.x,g.x,p.x)>=r||Math.max(h.y,m.y,g.y,p.y)<=u||Math.min(h.y,m.y,g.y,p.y)>=c))return!1;const b=x*(m.y-h.y),_=x*(h.x-m.x),T=b*s+_*u,w=b*r+_*u,S=b*s+_*c,A=b*r+_*c;if(Math.max(T,w,S,A)<=b*h.x+_*h.y||Math.min(T,w,S,A)>=b*p.x+_*p.y)return!1;const C=x*(h.y-g.y),E=x*(g.x-h.x),G=C*s+E*u,P=C*r+E*u,k=C*s+E*c,B=C*r+E*c;return!(Math.max(G,P,k,B)<=C*h.x+E*h.y||Math.min(G,P,k,B)>=C*p.x+E*p.y)}pad(t=0,n=t){return this.x-=t,this.y-=n,this.width+=t*2,this.height+=n*2,this}fit(t){const n=Math.max(this.x,t.x),s=Math.min(this.x+this.width,t.x+t.width),r=Math.max(this.y,t.y),u=Math.min(this.y+this.height,t.y+t.height);return this.x=n,this.width=Math.max(s-n,0),this.y=r,this.height=Math.max(u-r,0),this}ceil(t=1,n=.001){const s=Math.ceil((this.x+this.width-n)*t)/t,r=Math.ceil((this.y+this.height-n)*t)/t;return this.x=Math.floor((this.x+n)*t)/t,this.y=Math.floor((this.y+n)*t)/t,this.width=s-this.x,this.height=r-this.y,this}scale(t,n=t){return this.x*=t,this.y*=n,this.width*=t,this.height*=n,this}enlarge(t){const n=Math.min(this.x,t.x),s=Math.max(this.x+this.width,t.x+t.width),r=Math.min(this.y,t.y),u=Math.max(this.y+this.height,t.y+t.height);return this.x=n,this.width=s-n,this.y=r,this.height=u-r,this}getBounds(t){return t||(t=new $t),t.copyFrom(this),t}containsRect(t){if(this.width<=0||this.height<=0)return!1;const n=t.x,s=t.y,r=t.x+t.width,u=t.y+t.height;return n>=this.x&&n<this.x+this.width&&s>=this.y&&s<this.y+this.height&&r>=this.x&&r<this.x+this.width&&u>=this.y&&u<this.y+this.height}set(t,n,s,r){return this.x=t,this.y=n,this.width=s,this.height=r,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const jc={default:-1};function Zt(l="default"){return jc[l]===void 0&&(jc[l]=-1),++jc[l]}const cp=new Set,Qt="8.0.0",nb="8.3.4",Vs={quiet:!1,noColor:!1},At=((l,t,n=3)=>{if(Vs.quiet||cp.has(t))return;let s=new Error().stack;const r=`${t}
51
+ Deprecated since v${l}`,u=typeof console.groupCollapsed=="function"&&!Vs.noColor;typeof s>"u"?console.warn("PixiJS Deprecation Warning: ",r):(s=s.split(`
52
+ `).splice(n).join(`
53
+ `),u?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",r),console.warn(s),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",r),console.warn(s))),cp.add(t)});Object.defineProperties(At,{quiet:{get:()=>Vs.quiet,set:l=>{Vs.quiet=l},enumerable:!0,configurable:!1},noColor:{get:()=>Vs.noColor,set:l=>{Vs.noColor=l},enumerable:!0,configurable:!1}});const My=()=>{};function Ws(l){return l+=l===0?1:0,--l,l|=l>>>1,l|=l>>>2,l|=l>>>4,l|=l>>>8,l|=l>>>16,l+1}function hp(l){return!(l&l-1)&&!!l}function Ey(l){const t={};for(const n in l)l[n]!==void 0&&(t[n]=l[n]);return t}const fp=Object.create(null);function sb(l){const t=fp[l];return t===void 0&&(fp[l]=Zt("resource")),t}const Ry=class zy extends Ti{constructor(t={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,t={...zy.defaultOptions,...t},this.addressMode=t.addressMode,this.addressModeU=t.addressModeU??this.addressModeU,this.addressModeV=t.addressModeV??this.addressModeV,this.addressModeW=t.addressModeW??this.addressModeW,this.scaleMode=t.scaleMode,this.magFilter=t.magFilter??this.magFilter,this.minFilter=t.minFilter??this.minFilter,this.mipmapFilter=t.mipmapFilter??this.mipmapFilter,this.lodMinClamp=t.lodMinClamp,this.lodMaxClamp=t.lodMaxClamp,this.compare=t.compare,this.maxAnisotropy=t.maxAnisotropy??1}set addressMode(t){this.addressModeU=t,this.addressModeV=t,this.addressModeW=t}get addressMode(){return this.addressModeU}set wrapMode(t){At(Qt,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=t}get wrapMode(){return this.addressMode}set scaleMode(t){this.magFilter=t,this.minFilter=t,this.mipmapFilter=t}get scaleMode(){return this.magFilter}set maxAnisotropy(t){this._maxAnisotropy=Math.min(t,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 t=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=sb(t),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};Ry.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let Qs=Ry;const Dy=class Ny extends Ti{constructor(t={}){super(),this.options=t,this._gpuData=Object.create(null),this._gcLastUsed=-1,this.uid=Zt("textureSource"),this._resourceType="textureSource",this._resourceId=Zt("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,t={...Ny.defaultOptions,...t},this.label=t.label??"",this.resource=t.resource,this.autoGarbageCollect=t.autoGarbageCollect,this._resolution=t.resolution,t.width?this.pixelWidth=t.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,t.height?this.pixelHeight=t.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=t.format,this.dimension=t.dimensions,this.viewDimension=t.viewDimension??t.dimensions,this.arrayLayerCount=t.arrayLayerCount,this.mipLevelCount=t.mipLevelCount,this.autoGenerateMipmaps=t.autoGenerateMipmaps,this.sampleCount=t.sampleCount,this.antialias=t.antialias,this.alphaMode=t.alphaMode,this.style=new Qs(Ey(t)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(t){var n,s;this.style!==t&&((n=this._style)==null||n.off("change",this._onStyleChange,this),this._style=t,(s=this._style)==null||s.on("change",this._onStyleChange,this),this._onStyleChange())}set maxAnisotropy(t){this._style.maxAnisotropy=t}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(t){this._style.addressMode=t}get repeatMode(){return this._style.addressMode}set repeatMode(t){this._style.addressMode=t}get magFilter(){return this._style.magFilter}set magFilter(t){this._style.magFilter=t}get minFilter(){return this._style.minFilter}set minFilter(t){this._style.minFilter=t}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(t){this._style.mipmapFilter=t}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(t){this._style.lodMinClamp=t}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(t){this._style.lodMaxClamp=t}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){const t=this._resolution;if(this.resize(this.resourceWidth/t,this.resourceHeight/t))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(){var t,n;this._resourceId=Zt("resource"),this.emit("change",this),this.emit("unload",this);for(const s in this._gpuData)(n=(t=this._gpuData[s])==null?void 0:t.destroy)==null||n.call(t);this._gpuData=Object.create(null)}get resourceWidth(){const{resource:t}=this;return t.naturalWidth||t.videoWidth||t.displayWidth||t.width}get resourceHeight(){const{resource:t}=this;return t.naturalHeight||t.videoHeight||t.displayHeight||t.height}get resolution(){return this._resolution}set resolution(t){this._resolution!==t&&(this._resolution=t,this.width=this.pixelWidth/t,this.height=this.pixelHeight/t)}resize(t,n,s){s||(s=this._resolution),t||(t=this.width),n||(n=this.height);const r=Math.round(t*s),u=Math.round(n*s);return this.width=r/s,this.height=u/s,this._resolution=s,this.pixelWidth===r&&this.pixelHeight===u?!1:(this._refreshPOT(),this.pixelWidth=r,this.pixelHeight=u,this.emit("resize",this),this._resourceId=Zt("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(t){this._style.wrapMode=t}get wrapMode(){return this._style.wrapMode}set scaleMode(t){this._style.scaleMode=t}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=hp(this.pixelWidth)&&hp(this.pixelHeight)}static test(t){throw new Error("Unimplemented")}};Dy.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 oi=Dy;class Bh extends oi{constructor(t){const n=t.resource||new Float32Array(t.width*t.height*4);let s=t.format;s||(n instanceof Float32Array?s="rgba32float":n instanceof Int32Array||n instanceof Uint32Array?s="rgba32uint":n instanceof Int16Array||n instanceof Uint16Array?s="rgba16uint":(n instanceof Int8Array,s="bgra8unorm")),super({...t,resource:n,format:s}),this.uploadMethodId="buffer"}static test(t){return t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array}}Bh.extension=yt.TextureSource;const dp=new St;class ab{constructor(t,n){this.mapCoord=new St,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,typeof n>"u"?this.clampMargin=t.width<10?0:.5:this.clampMargin=n,this.isSimple=!1,this.texture=t}get texture(){return this._texture}set texture(t){var n;this.texture!==t&&((n=this._texture)==null||n.removeListener("update",this.update,this),this._texture=t,this._texture.addListener("update",this.update,this),this.update())}multiplyUvs(t,n){n===void 0&&(n=t);const s=this.mapCoord;for(let r=0;r<t.length;r+=2){const u=t[r],c=t[r+1];n[r]=u*s.a+c*s.c+s.tx,n[r+1]=u*s.b+c*s.d+s.ty}return n}update(){const t=this._texture;this._updateID++;const n=t.uvs;this.mapCoord.set(n.x1-n.x0,n.y1-n.y0,n.x3-n.x0,n.y3-n.y0,n.x0,n.y0);const s=t.orig,r=t.trim;r&&(dp.set(s.width/r.width,0,0,s.height/r.height,-r.x/r.width,-r.y/r.height),this.mapCoord.append(dp));const u=t.source,c=this.uClampFrame,h=this.clampMargin/u._resolution,m=this.clampOffset/u._resolution;return c[0]=(t.frame.x+h+m)/u.width,c[1]=(t.frame.y+h+m)/u.height,c[2]=(t.frame.x+t.frame.width-h+m)/u.width,c[3]=(t.frame.y+t.frame.height-h+m)/u.height,this.uClampOffset[0]=this.clampOffset/u.pixelWidth,this.uClampOffset[1]=this.clampOffset/u.pixelHeight,this.isSimple=t.frame.width===u.width&&t.frame.height===u.height&&t.rotate===0,!0}}class Gt extends Ti{constructor({source:t,label:n,frame:s,orig:r,trim:u,defaultAnchor:c,defaultBorders:h,rotate:m,dynamic:g}={}){if(super(),this.uid=Zt("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new $t,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=n,this.source=(t==null?void 0:t.source)??new oi,this.noFrame=!s,s)this.frame.copyFrom(s);else{const{width:p,height:x}=this._source;this.frame.width=p,this.frame.height=x}this.orig=r||this.frame,this.trim=u,this.rotate=m??0,this.defaultAnchor=c,this.defaultBorders=h,this.destroyed=!1,this.dynamic=g||!1,this.updateUvs()}set source(t){this._source&&this._source.off("resize",this.update,this),this._source=t,t.on("resize",this.update,this),this.emit("update",this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new ab(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){const{uvs:t,frame:n}=this,{width:s,height:r}=this._source,u=n.x/s,c=n.y/r,h=n.width/s,m=n.height/r;let g=this.rotate;if(g){const p=h/2,x=m/2,b=u+p,_=c+x;g=Ut.add(g,Ut.NW),t.x0=b+p*Ut.uX(g),t.y0=_+x*Ut.uY(g),g=Ut.add(g,2),t.x1=b+p*Ut.uX(g),t.y1=_+x*Ut.uY(g),g=Ut.add(g,2),t.x2=b+p*Ut.uX(g),t.y2=_+x*Ut.uY(g),g=Ut.add(g,2),t.x3=b+p*Ut.uX(g),t.y3=_+x*Ut.uY(g)}else t.x0=u,t.y0=c,t.x1=u+h,t.y1=c,t.x2=u+h,t.y2=c+m,t.x3=u,t.y3=c+m}destroy(t=!1){this._source&&(this._source.off("resize",this.update,this),t&&(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 At(Qt,"Texture.baseTexture is now Texture.source"),this._source}}Gt.EMPTY=new Gt({label:"EMPTY",source:new oi({label:"EMPTY"})});Gt.EMPTY.destroy=My;Gt.WHITE=new Gt({source:new Bh({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"});Gt.WHITE.destroy=My;function By(l,t,n){const{width:s,height:r}=n.orig,u=n.trim;if(u){const c=u.width,h=u.height;l.minX=u.x-t._x*s,l.maxX=l.minX+c,l.minY=u.y-t._y*r,l.maxY=l.minY+h}else l.minX=-t._x*s,l.maxX=l.minX+s,l.minY=-t._y*r,l.maxY=l.minY+r}const mp=new St;class ri{constructor(t=1/0,n=1/0,s=-1/0,r=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=mp,this.minX=t,this.minY=n,this.maxX=s,this.maxY=r}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new $t);const t=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(t.x=0,t.y=0,t.width=0,t.height=0):t.copyFromBounds(this),t}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=mp,this}set(t,n,s,r){this.minX=t,this.minY=n,this.maxX=s,this.maxY=r}addFrame(t,n,s,r,u){u||(u=this.matrix);const c=u.a,h=u.b,m=u.c,g=u.d,p=u.tx,x=u.ty;let b=this.minX,_=this.minY,T=this.maxX,w=this.maxY,S=c*t+m*n+p,A=h*t+g*n+x;S<b&&(b=S),A<_&&(_=A),S>T&&(T=S),A>w&&(w=A),S=c*s+m*n+p,A=h*s+g*n+x,S<b&&(b=S),A<_&&(_=A),S>T&&(T=S),A>w&&(w=A),S=c*t+m*r+p,A=h*t+g*r+x,S<b&&(b=S),A<_&&(_=A),S>T&&(T=S),A>w&&(w=A),S=c*s+m*r+p,A=h*s+g*r+x,S<b&&(b=S),A<_&&(_=A),S>T&&(T=S),A>w&&(w=A),this.minX=b,this.minY=_,this.maxX=T,this.maxY=w}addRect(t,n){this.addFrame(t.x,t.y,t.x+t.width,t.y+t.height,n)}addBounds(t,n){this.addFrame(t.minX,t.minY,t.maxX,t.maxY,n)}addBoundsMask(t){this.minX=this.minX>t.minX?this.minX:t.minX,this.minY=this.minY>t.minY?this.minY:t.minY,this.maxX=this.maxX<t.maxX?this.maxX:t.maxX,this.maxY=this.maxY<t.maxY?this.maxY:t.maxY}applyMatrix(t){const n=this.minX,s=this.minY,r=this.maxX,u=this.maxY,{a:c,b:h,c:m,d:g,tx:p,ty:x}=t;let b=c*n+m*s+p,_=h*n+g*s+x;this.minX=b,this.minY=_,this.maxX=b,this.maxY=_,b=c*r+m*s+p,_=h*r+g*s+x,this.minX=b<this.minX?b:this.minX,this.minY=_<this.minY?_:this.minY,this.maxX=b>this.maxX?b:this.maxX,this.maxY=_>this.maxY?_:this.maxY,b=c*n+m*u+p,_=h*n+g*u+x,this.minX=b<this.minX?b:this.minX,this.minY=_<this.minY?_:this.minY,this.maxX=b>this.maxX?b:this.maxX,this.maxY=_>this.maxY?_:this.maxY,b=c*r+m*u+p,_=h*r+g*u+x,this.minX=b<this.minX?b:this.minX,this.minY=_<this.minY?_:this.minY,this.maxX=b>this.maxX?b:this.maxX,this.maxY=_>this.maxY?_:this.maxY}fit(t){return this.minX<t.left&&(this.minX=t.left),this.maxX>t.right&&(this.maxX=t.right),this.minY<t.top&&(this.minY=t.top),this.maxY>t.bottom&&(this.maxY=t.bottom),this}fitBounds(t,n,s,r){return this.minX<t&&(this.minX=t),this.maxX>n&&(this.maxX=n),this.minY<s&&(this.minY=s),this.maxY>r&&(this.maxY=r),this}pad(t,n=t){return this.minX-=t,this.maxX+=t,this.minY-=n,this.maxY+=n,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 ri(this.minX,this.minY,this.maxX,this.maxY)}scale(t,n=t){return this.minX*=t,this.minY*=n,this.maxX*=t,this.maxY*=n,this}get x(){return this.minX}set x(t){const n=this.maxX-this.minX;this.minX=t,this.maxX=t+n}get y(){return this.minY}set y(t){const n=this.maxY-this.minY;this.minY=t,this.maxY=t+n}get width(){return this.maxX-this.minX}set width(t){this.maxX=this.minX+t}get height(){return this.maxY-this.minY}set height(t){this.maxY=this.minY+t}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(t,n,s,r){let u=this.minX,c=this.minY,h=this.maxX,m=this.maxY;r||(r=this.matrix);const g=r.a,p=r.b,x=r.c,b=r.d,_=r.tx,T=r.ty;for(let w=n;w<s;w+=2){const S=t[w],A=t[w+1],C=g*S+x*A+_,E=p*S+b*A+T;u=C<u?C:u,c=E<c?E:c,h=C>h?C:h,m=E>m?E:m}this.minX=u,this.minY=c,this.maxX=h,this.maxY=m}containsPoint(t,n){return this.minX<=t&&this.minY<=n&&this.maxX>=t&&this.maxY>=n}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(t){return this.minX=t.minX,this.minY=t.minY,this.maxX=t.maxX,this.maxY=t.maxY,this}}var lb={grad:.9,turn:360,rad:360/(2*Math.PI)},qi=function(l){return typeof l=="string"?l.length>0:typeof l=="number"},ue=function(l,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*l)/n+0},ai=function(l,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),l>n?n:l>t?l:t},Oy=function(l){return(l=isFinite(l)?l%360:0)>0?l:l+360},gp=function(l){return{r:ai(l.r,0,255),g:ai(l.g,0,255),b:ai(l.b,0,255),a:ai(l.a)}},Hc=function(l){return{r:ue(l.r),g:ue(l.g),b:ue(l.b),a:ue(l.a,3)}},rb=/^#([0-9a-f]{3,8})$/i,qr=function(l){var t=l.toString(16);return t.length<2?"0"+t:t},Gy=function(l){var t=l.r,n=l.g,s=l.b,r=l.a,u=Math.max(t,n,s),c=u-Math.min(t,n,s),h=c?u===t?(n-s)/c:u===n?2+(s-t)/c:4+(t-n)/c:0;return{h:60*(h<0?h+6:h),s:u?c/u*100:0,v:u/255*100,a:r}},ky=function(l){var t=l.h,n=l.s,s=l.v,r=l.a;t=t/360*6,n/=100,s/=100;var u=Math.floor(t),c=s*(1-n),h=s*(1-(t-u)*n),m=s*(1-(1-t+u)*n),g=u%6;return{r:255*[s,h,c,c,m,s][g],g:255*[m,s,s,h,c,c][g],b:255*[c,c,m,s,s,h][g],a:r}},pp=function(l){return{h:Oy(l.h),s:ai(l.s,0,100),l:ai(l.l,0,100),a:ai(l.a)}},yp=function(l){return{h:ue(l.h),s:ue(l.s),l:ue(l.l),a:ue(l.a,3)}},xp=function(l){return ky((n=(t=l).s,{h:t.h,s:(n*=((s=t.l)<50?s:100-s)/100)>0?2*n/(s+n)*100:0,v:s+n,a:t.a}));var t,n,s},al=function(l){return{h:(t=Gy(l)).h,s:(r=(200-(n=t.s))*(s=t.v)/100)>0&&r<200?n*s/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,s,r},ob=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ub=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,cb=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,hb=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,dh={string:[[function(l){var t=rb.exec(l);return t?(l=t[1]).length<=4?{r:parseInt(l[0]+l[0],16),g:parseInt(l[1]+l[1],16),b:parseInt(l[2]+l[2],16),a:l.length===4?ue(parseInt(l[3]+l[3],16)/255,2):1}:l.length===6||l.length===8?{r:parseInt(l.substr(0,2),16),g:parseInt(l.substr(2,2),16),b:parseInt(l.substr(4,2),16),a:l.length===8?ue(parseInt(l.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(l){var t=cb.exec(l)||hb.exec(l);return t?t[2]!==t[4]||t[4]!==t[6]?null:gp({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(l){var t=ob.exec(l)||ub.exec(l);if(!t)return null;var n,s,r=pp({h:(n=t[1],s=t[2],s===void 0&&(s="deg"),Number(n)*(lb[s]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return xp(r)},"hsl"]],object:[[function(l){var t=l.r,n=l.g,s=l.b,r=l.a,u=r===void 0?1:r;return qi(t)&&qi(n)&&qi(s)?gp({r:Number(t),g:Number(n),b:Number(s),a:Number(u)}):null},"rgb"],[function(l){var t=l.h,n=l.s,s=l.l,r=l.a,u=r===void 0?1:r;if(!qi(t)||!qi(n)||!qi(s))return null;var c=pp({h:Number(t),s:Number(n),l:Number(s),a:Number(u)});return xp(c)},"hsl"],[function(l){var t=l.h,n=l.s,s=l.v,r=l.a,u=r===void 0?1:r;if(!qi(t)||!qi(n)||!qi(s))return null;var c=(function(h){return{h:Oy(h.h),s:ai(h.s,0,100),v:ai(h.v,0,100),a:ai(h.a)}})({h:Number(t),s:Number(n),v:Number(s),a:Number(u)});return ky(c)},"hsv"]]},_p=function(l,t){for(var n=0;n<t.length;n++){var s=t[n][0](l);if(s)return[s,t[n][1]]}return[null,void 0]},fb=function(l){return typeof l=="string"?_p(l.trim(),dh.string):typeof l=="object"&&l!==null?_p(l,dh.object):[null,void 0]},Lc=function(l,t){var n=al(l);return{h:n.h,s:ai(n.s+100*t,0,100),l:n.l,a:n.a}},Yc=function(l){return(299*l.r+587*l.g+114*l.b)/1e3/255},bp=function(l,t){var n=al(l);return{h:n.h,s:n.s,l:ai(n.l+100*t,0,100),a:n.a}},mh=(function(){function l(t){this.parsed=fb(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return l.prototype.isValid=function(){return this.parsed!==null},l.prototype.brightness=function(){return ue(Yc(this.rgba),2)},l.prototype.isDark=function(){return Yc(this.rgba)<.5},l.prototype.isLight=function(){return Yc(this.rgba)>=.5},l.prototype.toHex=function(){return t=Hc(this.rgba),n=t.r,s=t.g,r=t.b,c=(u=t.a)<1?qr(ue(255*u)):"","#"+qr(n)+qr(s)+qr(r)+c;var t,n,s,r,u,c},l.prototype.toRgb=function(){return Hc(this.rgba)},l.prototype.toRgbString=function(){return t=Hc(this.rgba),n=t.r,s=t.g,r=t.b,(u=t.a)<1?"rgba("+n+", "+s+", "+r+", "+u+")":"rgb("+n+", "+s+", "+r+")";var t,n,s,r,u},l.prototype.toHsl=function(){return yp(al(this.rgba))},l.prototype.toHslString=function(){return t=yp(al(this.rgba)),n=t.h,s=t.s,r=t.l,(u=t.a)<1?"hsla("+n+", "+s+"%, "+r+"%, "+u+")":"hsl("+n+", "+s+"%, "+r+"%)";var t,n,s,r,u},l.prototype.toHsv=function(){return t=Gy(this.rgba),{h:ue(t.h),s:ue(t.s),v:ue(t.v),a:ue(t.a,3)};var t},l.prototype.invert=function(){return vi({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},l.prototype.saturate=function(t){return t===void 0&&(t=.1),vi(Lc(this.rgba,t))},l.prototype.desaturate=function(t){return t===void 0&&(t=.1),vi(Lc(this.rgba,-t))},l.prototype.grayscale=function(){return vi(Lc(this.rgba,-1))},l.prototype.lighten=function(t){return t===void 0&&(t=.1),vi(bp(this.rgba,t))},l.prototype.darken=function(t){return t===void 0&&(t=.1),vi(bp(this.rgba,-t))},l.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},l.prototype.alpha=function(t){return typeof t=="number"?vi({r:(n=this.rgba).r,g:n.g,b:n.b,a:t}):ue(this.rgba.a,3);var n},l.prototype.hue=function(t){var n=al(this.rgba);return typeof t=="number"?vi({h:t,s:n.s,l:n.l,a:n.a}):ue(n.h)},l.prototype.isEqual=function(t){return this.toHex()===vi(t).toHex()},l})(),vi=function(l){return l instanceof mh?l:new mh(l)},vp=[],db=function(l){l.forEach(function(t){vp.indexOf(t)<0&&(t(mh,dh),vp.push(t))})};function mb(l,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},s={};for(var r in n)s[n[r]]=r;var u={};l.prototype.toName=function(c){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var h,m,g=s[this.toHex()];if(g)return g;if(c!=null&&c.closest){var p=this.toRgb(),x=1/0,b="black";if(!u.length)for(var _ in n)u[_]=new l(n[_]).toRgb();for(var T in n){var w=(h=p,m=u[T],Math.pow(h.r-m.r,2)+Math.pow(h.g-m.g,2)+Math.pow(h.b-m.b,2));w<x&&(x=w,b=T)}return b}},t.string.push([function(c){var h=c.toLowerCase(),m=h==="transparent"?"#0000":n[h];return m?new l(m).toRgb():null},"name"])}db([mb]);const Zs=class tl{constructor(t=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=t}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(t){return this.value=t,this}set value(t){if(t instanceof tl)this._value=this._cloneSource(t._value),this._int=t._int,this._components.set(t._components);else{if(t===null)throw new Error("Cannot set Color#value to null");(this._value===null||!this._isSourceEqual(this._value,t))&&(this._value=this._cloneSource(t),this._normalize(this._value))}}get value(){return this._value}_cloneSource(t){return typeof t=="string"||typeof t=="number"||t instanceof Number||t===null?t:Array.isArray(t)||ArrayBuffer.isView(t)?t.slice(0):typeof t=="object"&&t!==null?{...t}:t}_isSourceEqual(t,n){const s=typeof t;if(s!==typeof n)return!1;if(s==="number"||s==="string"||t instanceof Number)return t===n;if(Array.isArray(t)&&Array.isArray(n)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(n))return t.length!==n.length?!1:t.every((u,c)=>u===n[c]);if(t!==null&&n!==null){const u=Object.keys(t),c=Object.keys(n);return u.length!==c.length?!1:u.every(h=>t[h]===n[h])}return t===n}toRgba(){const[t,n,s,r]=this._components;return{r:t,g:n,b:s,a:r}}toRgb(){const[t,n,s]=this._components;return{r:t,g:n,b:s}}toRgbaString(){const[t,n,s]=this.toUint8RgbArray();return`rgba(${t},${n},${s},${this.alpha})`}toUint8RgbArray(t){const[n,s,r]=this._components;return this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb),t[0]=Math.round(n*255),t[1]=Math.round(s*255),t[2]=Math.round(r*255),t}toArray(t){this._arrayRgba||(this._arrayRgba=[]),t||(t=this._arrayRgba);const[n,s,r,u]=this._components;return t[0]=n,t[1]=s,t[2]=r,t[3]=u,t}toRgbArray(t){this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb);const[n,s,r]=this._components;return t[0]=n,t[1]=s,t[2]=r,t}toNumber(){return this._int}toBgrNumber(){const[t,n,s]=this.toUint8RgbArray();return(s<<16)+(n<<8)+t}toLittleEndianNumber(){const t=this._int;return(t>>16)+(t&65280)+((t&255)<<16)}multiply(t){const[n,s,r,u]=tl._temp.setValue(t)._components;return this._components[0]*=n,this._components[1]*=s,this._components[2]*=r,this._components[3]*=u,this._refreshInt(),this._value=null,this}premultiply(t,n=!0){return n&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this._refreshInt(),this._value=null,this}toPremultiplied(t,n=!0){if(t===1)return(255<<24)+this._int;if(t===0)return n?0:this._int;let s=this._int>>16&255,r=this._int>>8&255,u=this._int&255;return n&&(s=s*t+.5|0,r=r*t+.5|0,u=u*t+.5|0),(t*255<<24)+(s<<16)+(r<<8)+u}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const n=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-n.length)+n}setAlpha(t){return this._components[3]=this._clamp(t),this._value=null,this}_normalize(t){let n,s,r,u;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215){const c=t;n=(c>>16&255)/255,s=(c>>8&255)/255,r=(c&255)/255,u=1}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[n,s,r,u=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[n,s,r,u=255]=t,n/=255,s/=255,r/=255,u/=255;else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){const h=tl.HEX_PATTERN.exec(t);h&&(t=`#${h[2]}`)}const c=vi(t);c.isValid()&&({r:n,g:s,b:r,a:u}=c.rgba,n/=255,s/=255,r/=255)}if(n!==void 0)this._components[0]=n,this._components[1]=s,this._components[2]=r,this._components[3]=u,this._refreshInt();else throw new Error(`Unable to convert color ${t}`)}_refreshInt(){this._clamp(this._components);const[t,n,s]=this._components;this._int=(t*255<<16)+(n*255<<8)+(s*255|0)}_clamp(t,n=0,s=1){return typeof t=="number"?Math.min(Math.max(t,n),s):(t.forEach((r,u)=>{t[u]=Math.min(Math.max(r,n),s)}),t)}static isColorLike(t){return typeof t=="number"||typeof t=="string"||t instanceof Number||t instanceof tl||Array.isArray(t)||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Float32Array||t.r!==void 0&&t.g!==void 0&&t.b!==void 0||t.r!==void 0&&t.g!==void 0&&t.b!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0&&t.a!==void 0}};Zs.shared=new Zs;Zs._temp=new Zs;Zs.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let ae=Zs;const gb={cullArea:null,cullable:!1,cullableChildren:!0};let qc=0;const Sp=500;function Se(...l){qc!==Sp&&(qc++,qc===Sp?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...l))}const pl={_registeredResources:new Set,register(l){this._registeredResources.add(l)},unregister(l){this._registeredResources.delete(l)},release(){this._registeredResources.forEach(l=>l.clear())},get registeredCount(){return this._registeredResources.size},isRegistered(l){return this._registeredResources.has(l)},reset(){this._registeredResources.clear()}};class pb{constructor(t,n){this._pool=[],this._count=0,this._index=0,this._classType=t,n&&this.prepopulate(n)}prepopulate(t){for(let n=0;n<t;n++)this._pool[this._index++]=new this._classType;this._count+=t}get(t){var s;let n;return this._index>0?n=this._pool[--this._index]:(n=new this._classType,this._count++),(s=n.init)==null||s.call(n,t),n}return(t){var n;(n=t.reset)==null||n.call(t),this._pool[this._index++]=t}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 t=0;t<this._index;t++)this._pool[t].destroy();this._pool.length=0,this._count=0,this._index=0}}class yb{constructor(){this._poolsByClass=new Map}prepopulate(t,n){this.getPool(t).prepopulate(n)}get(t,n){return this.getPool(t).get(n)}return(t){this.getPool(t.constructor).return(t)}getPool(t){return this._poolsByClass.has(t)||this._poolsByClass.set(t,new pb(t)),this._poolsByClass.get(t)}stats(){const t={};return this._poolsByClass.forEach(n=>{const s=t[n._classType.name]?n._classType.name+n._classType.ID:n._classType.name;t[s]={free:n.totalFree,used:n.totalUsed,size:n.totalSize}}),t}clear(){this._poolsByClass.forEach(t=>t.clear()),this._poolsByClass.clear()}}const Ne=new yb;pl.register(Ne);const xb={get isCachedAsTexture(){var l;return!!((l=this.renderGroup)!=null&&l.isCachedAsTexture)},cacheAsTexture(l){typeof l=="boolean"&&l===!1?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(l===!0?{}:l))},updateCacheTexture(){var l;(l=this.renderGroup)==null||l.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(l){At("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(l)}};function _b(l,t,n){const s=l.length;let r;if(t>=s||n===0)return;n=t+n>s?s-t:n;const u=s-n;for(r=t;r<u;++r)l[r]=l[r+n];l.length=u}const bb={allowChildren:!0,removeChildren(l=0,t){var u;const n=t??this.children.length,s=n-l,r=[];if(s>0&&s<=n){for(let h=n-1;h>=l;h--){const m=this.children[h];m&&(r.push(m),m.parent=null)}_b(this.children,l,n);const c=this.renderGroup||this.parentRenderGroup;c&&c.removeChildren(r);for(let h=0;h<r.length;++h){const m=r[h];(u=m.parentRenderLayer)==null||u.detach(m),this.emit("childRemoved",m,this,h),r[h].emit("removed",this)}return r.length>0&&this._didViewChangeTick++,r}else if(s===0&&this.children.length===0)return r;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(l){const t=this.getChildAt(l);return this.removeChild(t)},getChildAt(l){if(l<0||l>=this.children.length)throw new Error(`getChildAt: Index (${l}) does not exist.`);return this.children[l]},setChildIndex(l,t){if(t<0||t>=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);this.getChildIndex(l),this.addChildAt(l,t)},getChildIndex(l){const t=this.children.indexOf(l);if(t===-1)throw new Error("The supplied Container must be a child of the caller");return t},addChildAt(l,t){this.allowChildren||At(Qt,"addChildAt: Only Containers will be allowed to add children in v8.0.0");const{children:n}=this;if(t<0||t>n.length)throw new Error(`${l}addChildAt: The index ${t} supplied is out of bounds ${n.length}`);const s=l.parent===this;if(l.parent){const u=l.parent.children.indexOf(l);if(s){if(u===t)return l;l.parent.children.splice(u,1)}else l.removeFromParent()}t===n.length?n.push(l):n.splice(t,0,l),l.parent=this,l.didChange=!0,l._updateFlags=15;const r=this.renderGroup||this.parentRenderGroup;return r&&r.addChild(l),this.sortableChildren&&(this.sortDirty=!0),s||(this.emit("childAdded",l,this,t),l.emit("added",this)),l},swapChildren(l,t){if(l===t)return;const n=this.getChildIndex(l),s=this.getChildIndex(t);this.children[n]=t,this.children[s]=l;const r=this.renderGroup||this.parentRenderGroup;r&&(r.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){var l;(l=this.parent)==null||l.removeChild(this)},reparentChild(...l){return l.length===1?this.reparentChildAt(l[0],this.children.length):(l.forEach(t=>this.reparentChildAt(t,this.children.length)),l[0])},reparentChildAt(l,t){if(l.parent===this)return this.setChildIndex(l,t),l;const n=l.worldTransform.clone();l.removeFromParent(),this.addChildAt(l,t);const s=this.worldTransform.clone();return s.invert(),n.prepend(s),l.setFromMatrix(n),l},replaceChild(l,t){l.updateLocalTransform(),this.addChildAt(t,this.getChildIndex(l)),t.setFromMatrix(l.localTransform),t.updateLocalTransform(),this.removeChild(l)}},vb={collectRenderables(l,t,n){this.parentRenderLayer&&this.parentRenderLayer!==n||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(l,t,n):this.renderGroup?t.renderPipes.renderGroup.addRenderGroup(this.renderGroup,l):this.collectRenderablesWithEffects(l,t,n))},collectRenderablesSimple(l,t,n){const s=this.children,r=s.length;for(let u=0;u<r;u++)s[u].collectRenderables(l,t,n)},collectRenderablesWithEffects(l,t,n){const{renderPipes:s}=t;for(let r=0;r<this.effects.length;r++){const u=this.effects[r];s[u.pipe].push(u,this,l)}this.collectRenderablesSimple(l,t,n);for(let r=this.effects.length-1;r>=0;r--){const u=this.effects[r];s[u.pipe].pop(u,this,l)}}};class Tp{constructor(){this.pipe="filter",this.priority=1}destroy(){for(let t=0;t<this.filters.length;t++)this.filters[t].destroy();this.filters=null,this.filterArea=null}}class Sb{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEach(t=>{this.add({test:t.test,maskClass:t})}))}add(t){this._tests.push(t)}getMaskEffect(t){this._initialized||this.init();for(let n=0;n<this._tests.length;n++){const s=this._tests[n];if(s.test(t))return Ne.get(s.maskClass,t)}return t}returnMaskEffect(t){Ne.return(t)}}const gh=new Sb;Jt.handleByList(yt.MaskEffect,gh._effectClasses);const Tb={_maskEffect:null,_maskOptions:{inverse:!1},_filterEffect:null,effects:[],_markStructureAsChanged(){const l=this.renderGroup||this.parentRenderGroup;l&&(l.structureDidChange=!0)},addEffect(l){this.effects.indexOf(l)===-1&&(this.effects.push(l),this.effects.sort((n,s)=>n.priority-s.priority),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(l){const t=this.effects.indexOf(l);t!==-1&&(this.effects.splice(t,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(l){const t=this._maskEffect;(t==null?void 0:t.mask)!==l&&(t&&(this.removeEffect(t),gh.returnMaskEffect(t),this._maskEffect=null),l!=null&&(this._maskEffect=gh.getMaskEffect(l),this.addEffect(this._maskEffect)))},get mask(){var l;return(l=this._maskEffect)==null?void 0:l.mask},setMask(l){this._maskOptions={...this._maskOptions,...l},l.mask&&(this.mask=l.mask),this._markStructureAsChanged()},set filters(l){var u;!Array.isArray(l)&&l&&(l=[l]);const t=this._filterEffect||(this._filterEffect=new Tp);l=l;const n=(l==null?void 0:l.length)>0,s=((u=t.filters)==null?void 0:u.length)>0,r=n!==s;l=Array.isArray(l)?l.slice(0):l,t.filters=Object.freeze(l),r&&(n?this.addEffect(t):(this.removeEffect(t),t.filters=l??null))},get filters(){var l;return(l=this._filterEffect)==null?void 0:l.filters},set filterArea(l){this._filterEffect||(this._filterEffect=new Tp),this._filterEffect.filterArea=l},get filterArea(){var l;return(l=this._filterEffect)==null?void 0:l.filterArea}},wb={label:null,get name(){return At(Qt,"Container.name property has been removed, use Container.label instead"),this.label},set name(l){At(Qt,"Container.name property has been removed, use Container.label instead"),this.label=l},getChildByName(l,t=!1){return this.getChildByLabel(l,t)},getChildByLabel(l,t=!1){const n=this.children;for(let s=0;s<n.length;s++){const r=n[s];if(r.label===l||l instanceof RegExp&&l.test(r.label))return r}if(t)for(let s=0;s<n.length;s++){const u=n[s].getChildByLabel(l,!0);if(u)return u}return null},getChildrenByLabel(l,t=!1,n=[]){const s=this.children;for(let r=0;r<s.length;r++){const u=s[r];(u.label===l||l instanceof RegExp&&l.test(u.label))&&n.push(u)}if(t)for(let r=0;r<s.length;r++)s[r].getChildrenByLabel(l,!0,n);return n}},ve=Ne.getPool(St),Pi=Ne.getPool(ri),Ab=new St,Cb={getFastGlobalBounds(l,t){t||(t=new ri),t.clear(),this._getGlobalBoundsRecursive(!!l,t,this.parentRenderLayer),t.isValid||t.set(0,0,0,0);const n=this.renderGroup||this.parentRenderGroup;return t.applyMatrix(n.worldTransform),t},_getGlobalBoundsRecursive(l,t,n){let s=t;if(l&&this.parentRenderLayer&&this.parentRenderLayer!==n||this.localDisplayStatus!==7||!this.measurable)return;const r=!!this.effects.length;if((this.renderGroup||r)&&(s=Pi.get().clear()),this.boundsArea)t.addRect(this.boundsArea,this.worldTransform);else{if(this.renderPipeId){const c=this.bounds;s.addFrame(c.minX,c.minY,c.maxX,c.maxY,this.groupTransform)}const u=this.children;for(let c=0;c<u.length;c++)u[c]._getGlobalBoundsRecursive(l,s,n)}if(r){let u=!1;const c=this.renderGroup||this.parentRenderGroup;for(let h=0;h<this.effects.length;h++)this.effects[h].addBounds&&(u||(u=!0,s.applyMatrix(c.worldTransform)),this.effects[h].addBounds(s,!0));u&&s.applyMatrix(c.worldTransform.copyTo(Ab).invert()),t.addBounds(s),Pi.return(s)}else this.renderGroup&&(t.addBounds(s,this.relativeGroupTransform),Pi.return(s))}};function Uy(l,t,n){n.clear();let s,r;return l.parent?t?s=l.parent.worldTransform:(r=ve.get().identity(),s=Oh(l,r)):s=St.IDENTITY,jy(l,n,s,t),r&&ve.return(r),n.isValid||n.set(0,0,0,0),n}function jy(l,t,n,s){var h,m;if(!l.visible||!l.measurable)return;let r;s?r=l.worldTransform:(l.updateLocalTransform(),r=ve.get(),r.appendFrom(l.localTransform,n));const u=t,c=!!l.effects.length;if(c&&(t=Pi.get().clear()),l.boundsArea)t.addRect(l.boundsArea,r);else{const g=l.bounds;g&&!g.isEmpty()&&(t.matrix=r,t.addBounds(g));for(let p=0;p<l.children.length;p++)jy(l.children[p],t,r,s)}if(c){for(let g=0;g<l.effects.length;g++)(m=(h=l.effects[g]).addBounds)==null||m.call(h,t);u.addBounds(t,St.IDENTITY),Pi.return(t)}s||ve.return(r)}function Oh(l,t){const n=l.parent;return n&&(Oh(n,t),n.updateLocalTransform(),t.append(n.localTransform)),t}function Hy(l,t){if(l===16777215||!t)return t;if(t===16777215||!l)return l;const n=l>>16&255,s=l>>8&255,r=l&255,u=t>>16&255,c=t>>8&255,h=t&255,m=n*u/255|0,g=s*c/255|0,p=r*h/255|0;return(m<<16)+(g<<8)+p}const wp=16777215;function Ap(l,t){return l===wp?t:t===wp?l:Hy(l,t)}function to(l){return((l&255)<<16)+(l&65280)+(l>>16&255)}const Mb={getGlobalAlpha(l){if(l)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let t=this.alpha,n=this.parent;for(;n;)t*=n.alpha,n=n.parent;return t},getGlobalTransform(l=new St,t){if(t)return l.copyFrom(this.worldTransform);this.updateLocalTransform();const n=Oh(this,ve.get().identity());return l.appendFrom(this.localTransform,n),ve.return(n),l},getGlobalTint(l){if(l)return this.renderGroup?to(this.renderGroup.worldColor):this.parentRenderGroup?to(Ap(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let t=this.localColor,n=this.parent;for(;n;)t=Ap(t,n.localColor),n=n.parent;return to(t)}};function Ly(l,t,n){return t.clear(),n||(n=St.IDENTITY),Yy(l,t,n,l,!0),t.isValid||t.set(0,0,0,0),t}function Yy(l,t,n,s,r){var m,g;let u;if(r)u=ve.get(),u=n.copyTo(u);else{if(!l.visible||!l.measurable)return;l.updateLocalTransform();const p=l.localTransform;u=ve.get(),u.appendFrom(p,n)}const c=t,h=!!l.effects.length;if(h&&(t=Pi.get().clear()),l.boundsArea)t.addRect(l.boundsArea,u);else{l.renderPipeId&&(t.matrix=u,t.addBounds(l.bounds));const p=l.children;for(let x=0;x<p.length;x++)Yy(p[x],t,u,s,!1)}if(h){for(let p=0;p<l.effects.length;p++)(g=(m=l.effects[p]).addLocalBounds)==null||g.call(m,t,s);c.addBounds(t,St.IDENTITY),Pi.return(t)}ve.return(u)}function qy(l,t){const n=l.children;for(let s=0;s<n.length;s++){const r=n[s],u=r.uid,c=(r._didViewChangeTick&65535)<<16|r._didContainerChangeTick&65535,h=t.index;(t.data[h]!==u||t.data[h+1]!==c)&&(t.data[t.index]=u,t.data[t.index+1]=c,t.didChange=!0),t.index=h+2,r.children.length&&qy(r,t)}return t.didChange}const Eb=new St,Rb={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(l,t){const n=Math.sign(this.scale.x)||1;t!==0?this.scale.x=l/t*n:this.scale.x=n},_setHeight(l,t){const n=Math.sign(this.scale.y)||1;t!==0?this.scale.y=l/t*n:this.scale.y=n},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:!1,localBounds:new ri});const l=this._localBoundsCacheData;return l.index=1,l.didChange=!1,l.data[0]!==this._didViewChangeTick&&(l.didChange=!0,l.data[0]=this._didViewChangeTick),qy(this,l),l.didChange&&Ly(this,l.localBounds,Eb),l.localBounds},getBounds(l,t){return Uy(this,l,t||new ri)}},zb={_onRender:null,set onRender(l){const t=this.renderGroup||this.parentRenderGroup;if(!l){this._onRender&&(t==null||t.removeOnRender(this)),this._onRender=null;return}this._onRender||t==null||t.addOnRender(this),this._onRender=l},get onRender(){return this._onRender}},Db={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(l){this._zIndex!==l&&(this._zIndex=l,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(Nb))}};function Nb(l,t){return l._zIndex-t._zIndex}const Bb={getGlobalPosition(l=new xe,t=!1){return this.parent?this.parent.toGlobal(this._position,l,t):(l.x=this._position.x,l.y=this._position.y),l},toGlobal(l,t,n=!1){const s=this.getGlobalTransform(ve.get(),n);return t=s.apply(l,t),ve.return(s),t},toLocal(l,t,n,s){t&&(l=t.toGlobal(l,n,s));const r=this.getGlobalTransform(ve.get(),s);return n=r.applyInverse(l,n),ve.return(r),n}};class Gh{constructor(){this.uid=Zt("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(t){this.instructions[this.instructionSize++]=t}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"])}}let Ob=0;class Gb{constructor(t){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this.textureStyle=new Qs(this.textureOptions)}createTexture(t,n,s,r){const u=new oi({...this.textureOptions,width:t,height:n,resolution:1,antialias:s,autoGarbageCollect:!1,autoGenerateMipmaps:r});return new Gt({source:u,label:`texturePool_${Ob++}`})}getOptimalTexture(t,n,s=1,r,u=!1){let c=Math.ceil(t*s-1e-6),h=Math.ceil(n*s-1e-6);c=Ws(c),h=Ws(h);const m=r?1:0,g=u?1:0,p=(c<<17)+(h<<2)+(g<<1)+m;this._texturePool[p]||(this._texturePool[p]=[]);let x=this._texturePool[p].pop();return x||(x=this.createTexture(c,h,r,u)),x.source._resolution=s,x.source.width=c/s,x.source.height=h/s,x.source.pixelWidth=c,x.source.pixelHeight=h,x.frame.x=0,x.frame.y=0,x.frame.width=t,x.frame.height=n,x.updateUvs(),this._poolKeyHash[x.uid]=p,x}getSameSizeTexture(t,n=!1){const s=t.source;return this.getOptimalTexture(t.width,t.height,s._resolution,n)}returnTexture(t,n=!1){const s=this._poolKeyHash[t.uid];n&&(t.source.style=this.textureStyle),this._texturePool[s].push(t)}clear(t){if(t=t!==!1,t)for(const n in this._texturePool){const s=this._texturePool[n];if(s)for(let r=0;r<s.length;r++)s[r].destroy(!0)}this._texturePool={}}}const oo=new Gb;pl.register(oo);class kb{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new St,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 Gh,this._onRenderContainers=[],this.textureNeedsUpdate=!0,this.isCachedAsTexture=!1,this._matrixDirty=7}init(t){this.root=t,t._onRender&&this.addOnRender(t),t.didChange=!0;const n=t.children;for(let s=0;s<n.length;s++){const r=n[s];r._updateFlags=15,this.addChild(r)}}enableCacheAsTexture(t={}){this.textureOptions=t,this.isCachedAsTexture=!0,this.textureNeedsUpdate=!0}disableCacheAsTexture(){this.isCachedAsTexture=!1,this.texture&&(oo.returnTexture(this.texture,!0),this.texture=null)}updateCacheTexture(){this.textureNeedsUpdate=!0;const t=this._parentCacheAsTextureRenderGroup;t&&!t.textureNeedsUpdate&&t.updateCacheTexture()}reset(){this.renderGroupChildren.length=0;for(const t in this.childrenToUpdate){const n=this.childrenToUpdate[t];n.list.fill(null),n.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(t){t.renderGroupParent&&t.renderGroupParent._removeRenderGroupChild(t),t.renderGroupParent=this,this.renderGroupChildren.push(t)}_removeRenderGroupChild(t){const n=this.renderGroupChildren.indexOf(t);n>-1&&this.renderGroupChildren.splice(n,1),t.renderGroupParent=null}addChild(t){if(this.structureDidChange=!0,t.parentRenderGroup=this,t.updateTick=-1,t.parent===this.root?t.relativeRenderGroupDepth=1:t.relativeRenderGroupDepth=t.parent.relativeRenderGroupDepth+1,t.didChange=!0,this.onChildUpdate(t),t.renderGroup){this.addRenderGroupChild(t.renderGroup);return}t._onRender&&this.addOnRender(t);const n=t.children;for(let s=0;s<n.length;s++)this.addChild(n[s])}removeChild(t){if(this.structureDidChange=!0,t._onRender&&(t.renderGroup||this.removeOnRender(t)),t.parentRenderGroup=null,t.renderGroup){this._removeRenderGroupChild(t.renderGroup);return}const n=t.children;for(let s=0;s<n.length;s++)this.removeChild(n[s])}removeChildren(t){for(let n=0;n<t.length;n++)this.removeChild(t[n])}onChildUpdate(t){let n=this.childrenToUpdate[t.relativeRenderGroupDepth];n||(n=this.childrenToUpdate[t.relativeRenderGroupDepth]={index:0,list:[]}),n.list[n.index++]=t}updateRenderable(t){t.globalDisplayStatus<7||(this.instructionSet.renderPipes[t.renderPipeId].updateRenderable(t),t.didViewUpdate=!1)}onChildViewUpdate(t){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=t}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(t){this._onRenderContainers.push(t)}removeOnRender(t){this._onRenderContainers.splice(this._onRenderContainers.indexOf(t),1)}runOnRender(t){for(let n=0;n<this._onRenderContainers.length;n++)this._onRenderContainers[n]._onRender(t)}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(t=[]){const n=this.root.children;for(let s=0;s<n.length;s++)this._getChildren(n[s],t);return t}_getChildren(t,n=[]){if(n.push(t),t.renderGroup)return n;const s=t.children;for(let r=0;r<s.length;r++)this._getChildren(s[r],n);return n}invalidateMatrices(){this._matrixDirty=7}get inverseWorldTransform(){return(this._matrixDirty&1)===0?this._inverseWorldTransform:(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new St),this._inverseWorldTransform.copyFrom(this.worldTransform).invert())}get textureOffsetInverseTransform(){return(this._matrixDirty&2)===0?this._textureOffsetInverseTransform:(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new St),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 t=this._parentCacheAsTextureRenderGroup;return t?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new St),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(t.inverseWorldTransform).translate(-t._textureBounds.x,-t._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this.isCachedAsTexture?this.textureOffsetInverseTransform:this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}}function Ub(l,t,n={}){for(const s in t)!n[s]&&t[s]!==void 0&&(l[s]=t[s])}const Xc=new ge(null),Xr=new ge(null),Vc=new ge(null,1,1),Vr=new ge(null),Cp=1,jb=2,Pc=4;class De extends Ti{constructor(t={}){var n,s;super(),this.uid=Zt("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 St,this.relativeGroupTransform=new St,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new ge(this,0,0),this._scale=Vc,this._pivot=Xr,this._origin=Vr,this._skew=Xc,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=[],Ub(this,t,{children:!0,parent:!0,effects:!0}),(n=t.children)==null||n.forEach(r=>this.addChild(r)),(s=t.parent)==null||s.addChild(this)}static mixin(t){At("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),Jt.mixin(De,t)}set _didChangeId(t){this._didViewChangeTick=t>>12&4095,this._didContainerChangeTick=t&4095}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...t){if(this.allowChildren||At(Qt,"addChild: Only Containers will be allowed to add children in v8.0.0"),t.length>1){for(let r=0;r<t.length;r++)this.addChild(t[r]);return t[0]}const n=t[0],s=this.renderGroup||this.parentRenderGroup;return n.parent===this?(this.children.splice(this.children.indexOf(n),1),this.children.push(n),s&&(s.structureDidChange=!0),n):(n.parent&&n.parent.removeChild(n),this.children.push(n),this.sortableChildren&&(this.sortDirty=!0),n.parent=this,n.didChange=!0,n._updateFlags=15,s&&s.addChild(n),this.emit("childAdded",n,this,this.children.length-1),n.emit("added",this),this._didViewChangeTick++,n._zIndex!==0&&n.depthOfChildModified(),n)}removeChild(...t){if(t.length>1){for(let r=0;r<t.length;r++)this.removeChild(t[r]);return t[0]}const n=t[0],s=this.children.indexOf(n);return s>-1&&(this._didViewChangeTick++,this.children.splice(s,1),this.renderGroup?this.renderGroup.removeChild(n):this.parentRenderGroup&&this.parentRenderGroup.removeChild(n),n.parentRenderLayer&&n.parentRenderLayer.detach(n),n.parent=null,this.emit("childRemoved",n,this,s),n.emit("removed",this)),n}_onUpdate(t){t&&t===this._skew&&this._updateSkew(),this._didContainerChangeTick++,!this.didChange&&(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(t){!!this.renderGroup!==t&&(t?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;const t=this.parentRenderGroup;t==null||t.removeChild(this),this.renderGroup=Ne.get(kb,this),this.groupTransform=St.IDENTITY,t==null||t.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;const t=this.parentRenderGroup;t==null||t.removeChild(this),Ne.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,t==null||t.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0}get worldTransform(){return this._worldTransform||(this._worldTransform=new St),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(t){this._position.x=t}get y(){return this._position.y}set y(t){this._position.y=t}get position(){return this._position}set position(t){this._position.copyFrom(t)}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this._onUpdate(this._skew))}get angle(){return this.rotation*$1}set angle(t){this.rotation=t*J1}get pivot(){return this._pivot===Xr&&(this._pivot=new ge(this,0,0)),this._pivot}set pivot(t){this._pivot===Xr&&(this._pivot=new ge(this,0,0),this._origin!==Vr&&Se("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof t=="number"?this._pivot.set(t):this._pivot.copyFrom(t)}get skew(){return this._skew===Xc&&(this._skew=new ge(this,0,0)),this._skew}set skew(t){this._skew===Xc&&(this._skew=new ge(this,0,0)),this._skew.copyFrom(t)}get scale(){return this._scale===Vc&&(this._scale=new ge(this,1,1)),this._scale}set scale(t){this._scale===Vc&&(this._scale=new ge(this,0,0)),typeof t=="string"&&(t=parseFloat(t)),typeof t=="number"?this._scale.set(t):this._scale.copyFrom(t)}get origin(){return this._origin===Vr&&(this._origin=new ge(this,0,0)),this._origin}set origin(t){this._origin===Vr&&(this._origin=new ge(this,0,0),this._pivot!==Xr&&Se("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof t=="number"?this._origin.set(t):this._origin.copyFrom(t)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(t){const n=this.getLocalBounds().width;this._setWidth(t,n)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(t){const n=this.getLocalBounds().height;this._setHeight(t,n)}getSize(t){t||(t={});const n=this.getLocalBounds();return t.width=Math.abs(this.scale.x*n.width),t.height=Math.abs(this.scale.y*n.height),t}setSize(t,n){const s=this.getLocalBounds();typeof t=="object"?(n=t.height??t.width,t=t.width):n??(n=t),t!==void 0&&this._setWidth(t,s.width),n!==void 0&&this._setHeight(n,s.height)}_updateSkew(){const t=this._rotation,n=this._skew;this._cx=Math.cos(t+n._y),this._sx=Math.sin(t+n._y),this._cy=-Math.sin(t-n._x),this._sy=Math.cos(t-n._x)}updateTransform(t){return this.position.set(typeof t.x=="number"?t.x:this.position.x,typeof t.y=="number"?t.y:this.position.y),this.scale.set(typeof t.scaleX=="number"?t.scaleX||1:this.scale.x,typeof t.scaleY=="number"?t.scaleY||1:this.scale.y),this.rotation=typeof t.rotation=="number"?t.rotation:this.rotation,this.skew.set(typeof t.skewX=="number"?t.skewX:this.skew.x,typeof t.skewY=="number"?t.skewY:this.skew.y),this.pivot.set(typeof t.pivotX=="number"?t.pivotX:this.pivot.x,typeof t.pivotY=="number"?t.pivotY:this.pivot.y),this.origin.set(typeof t.originX=="number"?t.originX:this.origin.x,typeof t.originY=="number"?t.originY:this.origin.y),this}setFromMatrix(t){t.decompose(this)}updateLocalTransform(){const t=this._didContainerChangeTick;if(this._didLocalTransformChangeId===t)return;this._didLocalTransformChangeId=t;const n=this.localTransform,s=this._scale,r=this._pivot,u=this._origin,c=this._position,h=s._x,m=s._y,g=r._x,p=r._y,x=-u._x,b=-u._y;n.a=this._cx*h,n.b=this._sx*h,n.c=this._cy*m,n.d=this._sy*m,n.tx=c._x-(g*n.a+p*n.c)+(x*n.a+b*n.c)-x,n.ty=c._y-(g*n.b+p*n.d)+(x*n.b+b*n.d)-b}set alpha(t){t!==this.localAlpha&&(this.localAlpha=t,this._updateFlags|=Cp,this._onUpdate())}get alpha(){return this.localAlpha}set tint(t){const s=ae.shared.setValue(t??16777215).toBgrNumber();s!==this.localColor&&(this.localColor=s,this._updateFlags|=Cp,this._onUpdate())}get tint(){return to(this.localColor)}set blendMode(t){this.localBlendMode!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=jb,this.localBlendMode=t,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(this.localDisplayStatus&2)}set visible(t){const n=t?2:0;(this.localDisplayStatus&2)!==n&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Pc,this.localDisplayStatus^=2,this._onUpdate(),this.emit("visibleChanged",t))}get culled(){return!(this.localDisplayStatus&4)}set culled(t){const n=t?0:4;(this.localDisplayStatus&4)!==n&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Pc,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(this.localDisplayStatus&1)}set renderable(t){const n=t?1:0;(this.localDisplayStatus&1)!==n&&(this._updateFlags|=Pc,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(t=!1){var r;if(this.destroyed)return;this.destroyed=!0;let n;if(this.children.length&&(n=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 t=="boolean"?t:t==null?void 0:t.children)&&n)for(let u=0;u<n.length;++u)n[u].destroy(t);(r=this.renderGroup)==null||r.destroy(),this.renderGroup=null}}Jt.mixin(De,bb,Cb,Bb,zb,Rb,Tb,wb,Db,gb,xb,Mb,vb);class kh extends De{constructor(t){super(t),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 ri(0,1,0,0),this._boundsDirty=!0,this.autoGarbageCollect=t.autoGarbageCollect??!0}get bounds(){return this._boundsDirty?(this.updateBounds(),this._boundsDirty=!1,this._bounds):this._bounds}get roundPixels(){return!!this._roundPixels}set roundPixels(t){this._roundPixels=t?1:0}containsPoint(t){const n=this.bounds,{x:s,y:r}=t;return s>=n.minX&&s<=n.maxX&&r>=n.minY&&r<=n.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;const t=this.renderGroup||this.parentRenderGroup;t&&t.onChildViewUpdate(this)}unload(){var t;this.emit("unload",this);for(const n in this._gpuData)(t=this._gpuData[n])==null||t.destroy();this._gpuData=Object.create(null),this.onViewUpdate()}destroy(t){this.unload(),super.destroy(t),this._bounds=null}collectRenderablesSimple(t,n,s){const{renderPipes:r}=n;r.blendMode.pushBlendMode(this,this.groupBlendMode,t);const c=r[this.renderPipeId];c!=null&&c.addRenderable&&c.addRenderable(this,t),this.didViewUpdate=!1;const h=this.children,m=h.length;for(let g=0;g<m;g++)h[g].collectRenderables(t,n,s);r.blendMode.popBlendMode(t)}}class ul extends kh{constructor(t=Gt.EMPTY){t instanceof Gt&&(t={texture:t});const{texture:n=Gt.EMPTY,anchor:s,roundPixels:r,width:u,height:c,...h}=t;super({label:"Sprite",...h}),this.renderPipeId="sprite",this.batched=!0,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new ge({_onUpdate:()=>{this.onViewUpdate()}}),s?this.anchor=s:n.defaultAnchor&&(this.anchor=n.defaultAnchor),this.texture=n,this.allowChildren=!1,this.roundPixels=r??!1,u!==void 0&&(this.width=u),c!==void 0&&(this.height=c)}static from(t,n=!1){return t instanceof Gt?new ul(t):new ul(Gt.from(t,n))}set texture(t){t||(t=Gt.EMPTY);const n=this._texture;n!==t&&(n&&n.dynamic&&n.off("update",this.onViewUpdate,this),t.dynamic&&t.on("update",this.onViewUpdate,this),this._texture=t,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 By(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return At("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){const t=this._anchor,n=this._texture,s=this._bounds,{width:r,height:u}=n.orig;s.minX=-t._x*r,s.maxX=s.minX+r,s.minY=-t._y*u,s.maxY=s.minY+u}destroy(t=!1){if(super.destroy(t),typeof t=="boolean"?t:t==null?void 0:t.texture){const s=typeof t=="boolean"?t:t==null?void 0:t.textureSource;this._texture.destroy(s)}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(t){this._setWidth(t,this._texture.orig.width),this._width=t}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(t){this._setHeight(t,this._texture.orig.height),this._height=t}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this._texture.orig.width,t.height=Math.abs(this.scale.y)*this._texture.orig.height,t}setSize(t,n){typeof t=="object"?(n=t.height??t.width,t=t.width):n??(n=t),t!==void 0&&this._setWidth(t,this._texture.orig.width),n!==void 0&&this._setHeight(n,this._texture.orig.height)}}const Hb=new ri;function Xy(l,t,n){const s=Hb;l.measurable=!0,Uy(l,n,s),t.addBoundsMask(s),l.measurable=!1}function Vy(l,t,n){const s=Pi.get();l.measurable=!0;const r=ve.get().identity(),u=Py(l,n,r);Ly(l,s,u),l.measurable=!1,t.addBoundsMask(s),ve.return(r),Pi.return(s)}function Py(l,t,n){return l?(l!==t&&(Py(l.parent,t,n),l.updateLocalTransform(),n.append(l.localTransform)),n):(Se("Mask bounds, renderable is not inside the root container"),n)}class Fy{constructor(t){this.priority=0,this.inverse=!1,this.pipe="alphaMask",t!=null&&t.mask&&this.init(t.mask)}init(t){this.mask=t,this.renderMaskToTexture=!(t instanceof ul),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(t,n){this.inverse||Xy(this.mask,t,n)}addLocalBounds(t,n){Vy(this.mask,t,n)}containsPoint(t,n){const s=this.mask;return n(s,t)}destroy(){this.reset()}static test(t){return t instanceof ul}}Fy.extension=yt.MaskEffect;class Wy{constructor(t){this.priority=0,this.pipe="colorMask",t!=null&&t.mask&&this.init(t.mask)}init(t){this.mask=t}destroy(){}static test(t){return typeof t=="number"}}Wy.extension=yt.MaskEffect;class Qy{constructor(t){this.priority=0,this.pipe="stencilMask",t!=null&&t.mask&&this.init(t.mask)}init(t){this.mask=t,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null)}addBounds(t,n){Xy(this.mask,t,n)}addLocalBounds(t,n){Vy(this.mask,t,n)}containsPoint(t,n){const s=this.mask;return n(s,t)}destroy(){this.reset()}static test(t){return t instanceof De}}Qy.extension=yt.MaskEffect;const Lb={createCanvas:(l,t)=>{const n=document.createElement("canvas");return n.width=l,n.height=t,n},createImage:()=>new Image,getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(l,t)=>fetch(l,t),parseXML:l=>new DOMParser().parseFromString(l,"text/xml")};let Mp=Lb;const Pe={get(){return Mp},set(l){Mp=l}};class Zy extends oi{constructor(t){t.resource||(t.resource=Pe.get().createCanvas()),t.width||(t.width=t.resource.width,t.autoDensity||(t.width/=t.resolution)),t.height||(t.height=t.resource.height,t.autoDensity||(t.height/=t.resolution)),super(t),this.uploadMethodId="image",this.autoDensity=t.autoDensity,this.resizeCanvas(),this.transparent=!!t.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(t=this.width,n=this.height,s=this._resolution){const r=super.resize(t,n,s);return r&&this.resizeCanvas(),r}static test(t){return globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&t instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}}Zy.extension=yt.TextureSource;class io extends oi{constructor(t){super(t),this.uploadMethodId="image",this.autoGarbageCollect=!0}static test(t){return globalThis.HTMLImageElement&&t instanceof HTMLImageElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap||globalThis.VideoFrame&&t instanceof VideoFrame}}io.extension=yt.TextureSource;var no=(l=>(l[l.INTERACTION=50]="INTERACTION",l[l.HIGH=25]="HIGH",l[l.NORMAL=0]="NORMAL",l[l.LOW=-25]="LOW",l[l.UTILITY=-50]="UTILITY",l))(no||{});class Fc{constructor(t,n=null,s=0,r=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=t,this._context=n,this.priority=s,this._once=r}match(t,n=null){return this._fn===t&&this._context===n}emit(t){this._fn&&(this._context?this._fn.call(this._context,t):this._fn(t));const n=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),n}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(t=!1){this._destroyed=!0,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const n=this.next;return this.next=t?null:n,this.previous=null,n}}const Iy=class Xe{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 Fc(null,null,1/0),this.deltaMS=1/Xe.targetFPMS,this.elapsedMS=1/Xe.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),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(t,n,s=no.NORMAL){return this._addListener(new Fc(t,n,s))}addOnce(t,n,s=no.NORMAL){return this._addListener(new Fc(t,n,s,!0))}_addListener(t){let n=this._head.next,s=this._head;if(!n)t.connect(s);else{for(;n;){if(t.priority>n.priority){t.connect(s);break}s=n,n=n.next}t.previous||t.connect(s)}return this._startIfPossible(),this}remove(t,n){let s=this._head.next;for(;s;)s.match(t,n)?s=s.destroy():s=s.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,n=this._head;for(;n=n.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let n;if(t>this.lastTime){if(n=this.elapsedMS=t-this.lastTime,n>this._maxElapsedMS&&(n=this._maxElapsedMS),n*=this.speed,this._minElapsedMS){const u=t-this._lastFrame|0;if(u<this._minElapsedMS)return;this._lastFrame=t-u%this._minElapsedMS}this.deltaMS=n,this.deltaTime=this.deltaMS*Xe.targetFPMS;const s=this._head;let r=s.next;for(;r;)r=r.emit(this);s.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(t){const n=Math.min(Math.max(0,t)/1e3,Xe.targetFPMS);this._maxElapsedMS=1/n,this._minElapsedMS&&t>this.maxFPS&&(this.maxFPS=t)}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(t){t===0?this._minElapsedMS=0:(t<this.minFPS&&(this.minFPS=t),this._minElapsedMS=1/(t/1e3))}static get shared(){if(!Xe._shared){const t=Xe._shared=new Xe;t.autoStart=!0,t._protected=!0}return Xe._shared}static get system(){if(!Xe._system){const t=Xe._system=new Xe;t.autoStart=!0,t._protected=!0}return Xe._system}};Iy.targetFPMS=.06;let Ps=Iy,Wc;async function Yb(){return Wc??(Wc=(async()=>{var c;const t=Pe.get().createCanvas(1,1).getContext("webgl");if(!t)return"premultiply-alpha-on-upload";const n=await new Promise(h=>{const m=document.createElement("video");m.onloadeddata=()=>h(m),m.onerror=()=>h(null),m.autoplay=!1,m.crossOrigin="anonymous",m.preload="auto",m.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",m.load()});if(!n)return"premultiply-alpha-on-upload";const s=t.createTexture();t.bindTexture(t.TEXTURE_2D,s);const r=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,r),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,s,0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n);const u=new Uint8Array(4);return t.readPixels(0,0,1,1,t.RGBA,t.UNSIGNED_BYTE,u),t.deleteFramebuffer(r),t.deleteTexture(s),(c=t.getExtension("WEBGL_lose_context"))==null||c.loseContext(),u[0]<=u[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),Wc}const uo=class Ky extends oi{constructor(t){super(t),this.isReady=!1,this.uploadMethodId="video",t={...Ky.defaultOptions,...t},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=t.autoPlay!==!1,this.alphaMode=t.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),t.autoLoad!==!1&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){const t=Ps.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t)}(!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 t=this.resource,n=this.options;return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart),t.addEventListener("pause",this._onPlayStop),t.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(n.preload||t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlayThrough),t.addEventListener("error",this._onError,!0)),this.alphaMode=await Yb(),this._load=new Promise((s,r)=>{this.isValid?s(this):(this._resolve=s,this._reject=r,n.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${n.preloadTimeoutMs}ms`))})),t.load())}),this._load}_onError(t){this.resource.removeEventListener("error",this._onError,!0),this.emit("error",t),this._reject&&(this._reject(t),this._reject=null,this._resolve=null)}_isSourcePlaying(){const t=this.resource;return!t.paused&&!t.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 t=this.resource;this.isValid&&(this.isReady=!0,this.resize(t.videoWidth,t.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 t=this.resource;t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlayThrough),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(Ps.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||(Ps.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Ps.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement}};uo.extension=yt.TextureSource;uo.defaultOptions={...oi.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1};uo.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let qb=uo;const Ys=(l,t,n=!1)=>(Array.isArray(l)||(l=[l]),t?l.map(s=>typeof s=="string"||n?t(s):s):l);class Xb{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(t){return this._cache.has(t)}get(t){const n=this._cache.get(t);return n||Se(`[Assets] Asset id ${t} was not found in the Cache`),n}set(t,n){const s=Ys(t);let r;for(let m=0;m<this.parsers.length;m++){const g=this.parsers[m];if(g.test(n)){r=g.getCacheableAssets(s,n);break}}const u=new Map(Object.entries(r||{}));r||s.forEach(m=>{u.set(m,n)});const c=[...u.keys()],h={cacheKeys:c,keys:s};s.forEach(m=>{this._cacheMap.set(m,h)}),c.forEach(m=>{const g=r?r[m]:n;this._cache.has(m)&&this._cache.get(m)!==g&&Se("[Cache] already has key:",m),this._cache.set(m,u.get(m))})}remove(t){if(!this._cacheMap.has(t)){Se(`[Assets] Asset id ${t} was not found in the Cache`);return}const n=this._cacheMap.get(t);n.cacheKeys.forEach(r=>{this._cache.delete(r)}),n.keys.forEach(r=>{this._cacheMap.delete(r)})}get parsers(){return this._parsers}}const qs=new Xb,ph=[];Jt.handleByList(yt.TextureSource,ph);function $y(l={}){const t=l&&l.resource,n=t?l.resource:l,s=t?l:{resource:l};for(let r=0;r<ph.length;r++){const u=ph[r];if(u.test(n))return new u(s)}throw new Error(`Could not find a source type for resource: ${s.resource}`)}function Vb(l={},t=!1){const n=l&&l.resource,s=n?l.resource:l,r=n?l:{resource:l};if(!t&&qs.has(s))return qs.get(s);const u=new Gt({source:$y(r)});return u.on("destroy",()=>{qs.has(s)&&qs.remove(s)}),t||qs.set(s,u),u}function Pb(l,t=!1){return typeof l=="string"?qs.get(l):l instanceof oi?new Gt({source:l}):Vb(l,t)}Gt.from=Pb;oi.from=$y;Jt.add(Fy,Wy,Qy,qb,io,Zy,Bh);var Jy=(l=>(l[l.Low=0]="Low",l[l.Normal=1]="Normal",l[l.High=2]="High",l))(Jy||{});function mi(l){if(typeof l!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(l)}`)}function Fa(l){return l.split("?")[0].split("#")[0]}function Fb(l){return l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Wb(l,t,n){return l.replace(new RegExp(Fb(t),"g"),n)}function Qb(l,t){let n="",s=0,r=-1,u=0,c=-1;for(let h=0;h<=l.length;++h){if(h<l.length)c=l.charCodeAt(h);else{if(c===47)break;c=47}if(c===47){if(!(r===h-1||u===1))if(r!==h-1&&u===2){if(n.length<2||s!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){const m=n.lastIndexOf("/");if(m!==n.length-1){m===-1?(n="",s=0):(n=n.slice(0,m),s=n.length-1-n.lastIndexOf("/")),r=h,u=0;continue}}else if(n.length===2||n.length===1){n="",s=0,r=h,u=0;continue}}}else n.length>0?n+=`/${l.slice(r+1,h)}`:n=l.slice(r+1,h),s=h-r-1;r=h,u=0}else c===46&&u!==-1?++u:u=-1}return n}const cl={toPosix(l){return Wb(l,"\\","/")},isUrl(l){return/^https?:/.test(this.toPosix(l))},isDataUrl(l){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(l)},isBlobUrl(l){return l.startsWith("blob:")},hasProtocol(l){return/^[^/:]+:/.test(this.toPosix(l))},getProtocol(l){mi(l),l=this.toPosix(l);const t=/^file:\/\/\//.exec(l);if(t)return t[0];const n=/^[^/:]+:\/{0,2}/.exec(l);return n?n[0]:""},toAbsolute(l,t,n){if(mi(l),this.isDataUrl(l)||this.isBlobUrl(l))return l;const s=Fa(this.toPosix(t??Pe.get().getBaseUrl())),r=Fa(this.toPosix(n??this.rootname(s)));return l=this.toPosix(l),l.startsWith("/")?cl.join(r,l.slice(1)):this.isAbsolute(l)?l:this.join(s,l)},normalize(l){if(mi(l),l.length===0)return".";if(this.isDataUrl(l)||this.isBlobUrl(l))return l;l=this.toPosix(l);let t="";const n=l.startsWith("/");this.hasProtocol(l)&&(t=this.rootname(l),l=l.slice(t.length));const s=l.endsWith("/");return l=Qb(l),l.length>0&&s&&(l+="/"),n?`/${l}`:t+l},isAbsolute(l){return mi(l),l=this.toPosix(l),this.hasProtocol(l)?!0:l.startsWith("/")},join(...l){if(l.length===0)return".";let t;for(let n=0;n<l.length;++n){const s=l[n];if(mi(s),s.length>0)if(t===void 0)t=s;else{const r=l[n-1]??"";this.joinExtensions.includes(this.extname(r).toLowerCase())?t+=`/../${s}`:t+=`/${s}`}}return t===void 0?".":this.normalize(t)},dirname(l){if(mi(l),l.length===0)return".";l=this.toPosix(l);let t=l.charCodeAt(0);const n=t===47;let s=-1,r=!0;const u=this.getProtocol(l),c=l;l=l.slice(u.length);for(let h=l.length-1;h>=1;--h)if(t=l.charCodeAt(h),t===47){if(!r){s=h;break}}else r=!1;return s===-1?n?"/":this.isUrl(c)?u+l:u:n&&s===1?"//":u+l.slice(0,s)},rootname(l){mi(l),l=this.toPosix(l);let t="";if(l.startsWith("/")?t="/":t=this.getProtocol(l),this.isUrl(l)){const n=l.indexOf("/",t.length);n!==-1?t=l.slice(0,n):t=l,t.endsWith("/")||(t+="/")}return t},basename(l,t){mi(l),t&&mi(t),l=Fa(this.toPosix(l));let n=0,s=-1,r=!0,u;if(t!==void 0&&t.length>0&&t.length<=l.length){if(t.length===l.length&&t===l)return"";let c=t.length-1,h=-1;for(u=l.length-1;u>=0;--u){const m=l.charCodeAt(u);if(m===47){if(!r){n=u+1;break}}else h===-1&&(r=!1,h=u+1),c>=0&&(m===t.charCodeAt(c)?--c===-1&&(s=u):(c=-1,s=h))}return n===s?s=h:s===-1&&(s=l.length),l.slice(n,s)}for(u=l.length-1;u>=0;--u)if(l.charCodeAt(u)===47){if(!r){n=u+1;break}}else s===-1&&(r=!1,s=u+1);return s===-1?"":l.slice(n,s)},extname(l){mi(l),l=Fa(this.toPosix(l));let t=-1,n=0,s=-1,r=!0,u=0;for(let c=l.length-1;c>=0;--c){const h=l.charCodeAt(c);if(h===47){if(!r){n=c+1;break}continue}s===-1&&(r=!1,s=c+1),h===46?t===-1?t=c:u!==1&&(u=1):t!==-1&&(u=-1)}return t===-1||s===-1||u===0||u===1&&t===s-1&&t===n+1?"":l.slice(t,s)},parse(l){mi(l);const t={root:"",dir:"",base:"",ext:"",name:""};if(l.length===0)return t;l=Fa(this.toPosix(l));let n=l.charCodeAt(0);const s=this.isAbsolute(l);let r;t.root=this.rootname(l),s||this.hasProtocol(l)?r=1:r=0;let u=-1,c=0,h=-1,m=!0,g=l.length-1,p=0;for(;g>=r;--g){if(n=l.charCodeAt(g),n===47){if(!m){c=g+1;break}continue}h===-1&&(m=!1,h=g+1),n===46?u===-1?u=g:p!==1&&(p=1):u!==-1&&(p=-1)}return u===-1||h===-1||p===0||p===1&&u===h-1&&u===c+1?h!==-1&&(c===0&&s?t.base=t.name=l.slice(1,h):t.base=t.name=l.slice(c,h)):(c===0&&s?(t.name=l.slice(1,u),t.base=l.slice(1,h)):(t.name=l.slice(c,u),t.base=l.slice(c,h)),t.ext=l.slice(u,h)),t.dir=this.dirname(l),t},sep:"/",delimiter:":",joinExtensions:[".html"]};function t0(l,t,n,s,r){const u=t[n];for(let c=0;c<u.length;c++){const h=u[c];n<t.length-1?t0(l.replace(s[n],h),t,n+1,s,r):r.push(l.replace(s[n],h))}}function Zb(l){const t=/\{(.*?)\}/g,n=l.match(t),s=[];if(n){const r=[];n.forEach(u=>{const c=u.substring(1,u.length-1).split(",");r.push(c)}),t0(l,r,0,n,s)}else s.push(l);return s}const Ep=l=>!Array.isArray(l);class e0{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,n)=>`${t}${this._bundleIdConnector}${n}`,extractAssetIdFromBundle:(t,n)=>n.replace(`${t}${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(t){if(this._bundleIdConnector=t.connector??this._bundleIdConnector,this._createBundleAssetId=t.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=t.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach(n=>{this._preferredOrder.push(n),n.priority||(n.priority=Object.keys(n.params))}),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}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(t){if(typeof t=="string")this._defaultSearchParams=t;else{const n=t;this._defaultSearchParams=Object.keys(n).map(s=>`${encodeURIComponent(s)}=${encodeURIComponent(n[s])}`).join("&")}}getAlias(t){const{alias:n,src:s}=t;return Ys(n||s,u=>typeof u=="string"?u:Array.isArray(u)?u.map(c=>(c==null?void 0:c.src)??c):u!=null&&u.src?u.src:u,!0)}removeAlias(t,n){this._assetMap[t]&&(n&&n!==this._resolverHash[t]||(delete this._resolverHash[t],delete this._assetMap[t]))}addManifest(t){this._manifest&&Se("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach(n=>{this.addBundle(n.name,n.assets)})}addBundle(t,n){const s=[];let r=n;Array.isArray(n)||(r=Object.entries(n).map(([u,c])=>typeof c=="string"||Array.isArray(c)?{alias:u,src:c}:{alias:u,...c})),r.forEach(u=>{const c=u.src,h=u.alias;let m;if(typeof h=="string"){const g=this._createBundleAssetId(t,h);s.push(g),m=[h,g]}else{const g=h.map(p=>this._createBundleAssetId(t,p));s.push(...g),m=[...h,...g]}this.add({...u,alias:m,src:c})}),this._bundles[t]=s}add(t){const n=[];Array.isArray(t)?n.push(...t):n.push(t);let s;s=u=>{this.hasKey(u)&&Se(`[Resolver] already has key: ${u} overwriting`)},Ys(n).forEach(u=>{const{src:c}=u;let{data:h,format:m,loadParser:g,parser:p}=u;const x=Ys(c).map(w=>typeof w=="string"?Zb(w):Array.isArray(w)?w:[w]),b=this.getAlias(u);Array.isArray(b)?b.forEach(s):s(b);const _=[],T=w=>{const S=this._parsers.find(A=>A.test(w));return{src:w,...S==null?void 0:S.parse(w)}};x.forEach(w=>{w.forEach(S=>{let A={};if(typeof S!="object"?A=T(S):(h=S.data??h,m=S.format??m,(S.loadParser||S.parser)&&(g=S.loadParser??g,p=S.parser??p),A={...T(S.src),...S}),!b)throw new Error(`[Resolver] alias is undefined for this asset: ${A.src}`);A=this._buildResolvedAsset(A,{aliases:b,data:h,format:m,loadParser:g,parser:p,progressSize:u.progressSize}),_.push(A)})}),b.forEach(w=>{this._assetMap[w]=_})})}resolveBundle(t){const n=Ep(t);t=Ys(t);const s={};return t.forEach(r=>{const u=this._bundles[r];if(u){const c=this.resolve(u),h={};for(const m in c){const g=c[m];h[this._extractAssetIdFromBundle(r,m)]=g}s[r]=h}}),n?s[t[0]]:s}resolveUrl(t){const n=this.resolve(t);if(typeof t!="string"){const s={};for(const r in n)s[r]=n[r].src;return s}return n.src}resolve(t){const n=Ep(t);t=Ys(t);const s={};return t.forEach(r=>{if(!this._resolverHash[r])if(this._assetMap[r]){let u=this._assetMap[r];const c=this._getPreferredOrder(u);c==null||c.priority.forEach(h=>{c.params[h].forEach(m=>{const g=u.filter(p=>p[h]?p[h]===m:!1);g.length&&(u=g)})}),this._resolverHash[r]=u[0]}else this._resolverHash[r]=this._buildResolvedAsset({alias:[r],src:r},{});s[r]=this._resolverHash[r]}),n?s[t[0]]:s}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let n=0;n<t.length;n++){const s=t[n],r=this._preferredOrder.find(u=>u.params.format.includes(s.format));if(r)return r}return this._preferredOrder[0]}_appendDefaultSearchParams(t){if(!this._defaultSearchParams)return t;const n=/\?/.test(t)?"&":"?";return`${t}${n}${this._defaultSearchParams}`}_buildResolvedAsset(t,n){const{aliases:s,data:r,loadParser:u,parser:c,format:h,progressSize:m}=n;return(this._basePath||this._rootPath)&&(t.src=cl.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=s??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...r||{},...t.data},t.loadParser=u??t.loadParser,t.parser=c??t.parser,t.format=h??t.format??Ib(t.src),m!==void 0&&(t.progressSize=m),t}}e0.RETINA_PREFIX=/@([0-9\.]+)x/;function Ib(l){return l.split(".").pop().split("?").shift().split("#").shift()}const Rp=(l,t)=>{const n=t.split("?")[1];return n&&(l+=`?${n}`),l},i0=class el{constructor(t,n){this.linkedSheets=[];let s=t;(t==null?void 0:t.source)instanceof oi&&(s={texture:t,data:n});const{texture:r,data:u,cachePrefix:c=""}=s;this.cachePrefix=c,this._texture=r instanceof Gt?r:null,this.textureSource=r.source,this.textures={},this.animations={},this.data=u;const h=parseFloat(u.meta.scale);h?(this.resolution=h,r.source.resolution=this.resolution):this.resolution=r.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise(t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=el.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}parseSync(){return this._processFrames(0,!0),this._processAnimations(),this.textures}_processFrames(t,n=!1){let s=t;const r=n?1/0:el.BATCH_SIZE;for(;s-t<r&&s<this._frameKeys.length;){const u=this._frameKeys[s],c=this._frames[u],h=c.frame;if(h){let m=null,g=null;const p=c.trimmed!==!1&&c.sourceSize?c.sourceSize:c.frame,x=new $t(0,0,Math.floor(p.w)/this.resolution,Math.floor(p.h)/this.resolution);c.rotated?m=new $t(Math.floor(h.x)/this.resolution,Math.floor(h.y)/this.resolution,Math.floor(h.h)/this.resolution,Math.floor(h.w)/this.resolution):m=new $t(Math.floor(h.x)/this.resolution,Math.floor(h.y)/this.resolution,Math.floor(h.w)/this.resolution,Math.floor(h.h)/this.resolution),c.trimmed!==!1&&c.spriteSourceSize&&(g=new $t(Math.floor(c.spriteSourceSize.x)/this.resolution,Math.floor(c.spriteSourceSize.y)/this.resolution,Math.floor(h.w)/this.resolution,Math.floor(h.h)/this.resolution)),this.textures[u]=new Gt({source:this.textureSource,frame:m,orig:x,trim:g,rotate:c.rotated?2:0,defaultAnchor:c.anchor,defaultBorders:c.borders,label:u.toString()})}s++}}_processAnimations(){const t=this.data.animations||{};for(const n in t){this.animations[n]=[];for(let s=0;s<t[n].length;s++){const r=t[n][s];this.animations[n].push(this.textures[r])}}}_parseComplete(){const t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*el.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*el.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(t=!1){var n;for(const s in this.textures)this.textures[s].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&((n=this._texture)==null||n.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};i0.BATCH_SIZE=1e3;let zp=i0;const Kb=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];function n0(l,t,n){const s={};if(l.forEach(r=>{s[r]=t}),Object.keys(t.textures).forEach(r=>{s[`${t.cachePrefix}${r}`]=t.textures[r]}),!n){const r=cl.dirname(l[0]);t.linkedSheets.forEach((u,c)=>{const h=n0([`${r}/${t.data.meta.related_multi_packs[c]}`],u,!0);Object.assign(s,h)})}return s}const $b={extension:yt.Asset,cache:{test:l=>l instanceof zp,getCacheableAssets:(l,t)=>n0(l,t,!1)},resolver:{extension:{type:yt.ResolveParser,name:"resolveSpritesheet"},test:l=>{const n=l.split("?")[0].split("."),s=n.pop(),r=n.pop();return s==="json"&&Kb.includes(r)},parse:l=>{var n;const t=l.split(".");return{resolution:parseFloat(((n=e0.RETINA_PREFIX.exec(l))==null?void 0:n[1])??"1"),format:t[t.length-2],src:l}}},loader:{name:"spritesheetLoader",id:"spritesheet",extension:{type:yt.LoadParser,priority:Jy.Normal,name:"spritesheetLoader"},async testParse(l,t){return cl.extname(t.src).toLowerCase()===".json"&&!!l.frames},async parse(l,t,n){var x,b;const{texture:s,imageFilename:r,textureOptions:u,cachePrefix:c}=(t==null?void 0:t.data)??{};let h=cl.dirname(t.src);h&&h.lastIndexOf("/")!==h.length-1&&(h+="/");let m;if(s instanceof Gt)m=s;else{const _=Rp(h+(r??l.meta.image),t.src);m=(await n.load([{src:_,data:u}]))[_]}const g=new zp({texture:m.source,data:l,cachePrefix:c});await g.parse();const p=(x=l==null?void 0:l.meta)==null?void 0:x.related_multi_packs;if(Array.isArray(p)){const _=[];for(const w of p){if(typeof w!="string")continue;let S=h+w;(b=t.data)!=null&&b.ignoreMultiPack||(S=Rp(S,t.src),_.push(n.load({src:S,data:{textureOptions:u,ignoreMultiPack:!0}})))}const T=await Promise.all(_);g.linkedSheets=T,T.forEach(w=>{w.linkedSheets=[g].concat(g.linkedSheets.filter(S=>S!==w))})}return g},async unload(l,t,n){await n.unload(l.textureSource._sourceOrigin),l.destroy(!1)}}};Jt.add($b);const Qc=Object.create(null),Dp=Object.create(null);function Uh(l,t){let n=Dp[l];return n===void 0&&(Qc[t]===void 0&&(Qc[t]=1),Dp[l]=n=Qc[t]++),n}let js;function s0(){return(!js||js!=null&&js.isContextLost())&&(js=Pe.get().createCanvas().getContext("webgl",{})),js}let Pr;function Jb(){if(!Pr){Pr="mediump";const l=s0();l&&l.getShaderPrecisionFormat&&(Pr=l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.HIGH_FLOAT).precision?"highp":"mediump")}return Pr}function tv(l,t,n){return t?l:n?(l=l.replace("out vec4 finalColor;",""),`
54
+
55
+ #ifdef GL_ES // This checks if it is WebGL1
56
+ #define in varying
57
+ #define finalColor gl_FragColor
58
+ #define texture texture2D
59
+ #endif
60
+ ${l}
61
+ `):`
62
+
63
+ #ifdef GL_ES // This checks if it is WebGL1
64
+ #define in attribute
65
+ #define out varying
66
+ #endif
67
+ ${l}
68
+ `}function ev(l,t,n){const s=n?t.maxSupportedFragmentPrecision:t.maxSupportedVertexPrecision;if(l.substring(0,9)!=="precision"){let r=n?t.requestedFragmentPrecision:t.requestedVertexPrecision;return r==="highp"&&s!=="highp"&&(r="mediump"),`precision ${r} float;
69
+ ${l}`}else if(s!=="highp"&&l.substring(0,15)==="precision highp")return l.replace("precision highp","precision mediump");return l}function iv(l,t){return t?`#version 300 es
70
+ ${l}`:l}const nv={},sv={};function av(l,{name:t="pixi-program"},n=!0){t=t.replace(/\s+/g,"-"),t+=n?"-fragment":"-vertex";const s=n?nv:sv;return s[t]?(s[t]++,t+=`-${s[t]}`):s[t]=1,l.indexOf("#define SHADER_NAME")!==-1?l:`${`#define SHADER_NAME ${t}`}
71
+ ${l}`}function lv(l,t){return t?l.replace("#version 300 es",""):l}const Zc={stripVersion:lv,ensurePrecision:ev,addProgramDefines:tv,setProgramName:av,insertVersion:iv},Wa=Object.create(null),a0=class yh{constructor(t){t={...yh.defaultOptions,...t};const n=t.fragment.indexOf("#version 300 es")!==-1,s={stripVersion:n,ensurePrecision:{requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:Jb()},setProgramName:{name:t.name},addProgramDefines:n,insertVersion:n};let r=t.fragment,u=t.vertex;Object.keys(Zc).forEach(c=>{const h=s[c];r=Zc[c](r,h,!0),u=Zc[c](u,h,!1)}),this.fragment=r,this.vertex=u,this.transformFeedbackVaryings=t.transformFeedbackVaryings,this._key=Uh(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null,Wa[this._cacheKey]=null}static from(t){const n=`${t.vertex}:${t.fragment}`;return Wa[n]||(Wa[n]=new yh(t),Wa[n]._cacheKey=n),Wa[n]}};a0.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let l0=a0;const Np={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};function rv(l){return Np[l]??Np.float32}const ov={f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",vec2i:"sint32x2",vec3i:"sint32x3",vec4i:"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",vec2u:"uint32x2",vec3u:"uint32x3",vec4u:"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"},Bp=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|\)|$)/g;function Op(l,t){let n;for(;(n=Bp.exec(l))!==null;){const s=ov[n[3]]??"float32";t[n[2]]={location:parseInt(n[1],10),format:s,stride:rv(s).stride,offset:0,instance:!1,start:0}}Bp.lastIndex=0}function uv(l){return l.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"")}function cv({source:l,entryPoint:t}){const n={},s=uv(l),r=s.indexOf(`fn ${t}(`);if(r===-1)return n;const u=s.indexOf("->",r);if(u===-1)return n;const c=s.substring(r,u);if(Op(c,n),Object.keys(n).length===0){const h=c.match(/\(\s*\w+\s*:\s*(\w+)/);if(h){const m=h[1],g=new RegExp(`struct\\s+${m}\\s*\\{([^}]+)\\}`,"s"),p=s.match(g);p&&Op(p[1],n)}}return n}function Ic(l){var x,b;const t=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,n=/@group\((\d+)\)/,s=/@binding\((\d+)\)/,r=/var(<[^>]+>)? (\w+)/,u=/:\s*([\w<>]+)/,c=/struct\s+(\w+)\s*{([^}]+)}/g,h=/(\w+)\s*:\s*([\w\<\>]+)/g,m=/struct\s+(\w+)/,g=(x=l.match(t))==null?void 0:x.map(_=>({group:parseInt(_.match(n)[1],10),binding:parseInt(_.match(s)[1],10),name:_.match(r)[2],isUniform:_.match(r)[1]==="<uniform>",type:_.match(u)[1]}));if(!g)return{groups:[],structs:[]};const p=((b=l.match(c))==null?void 0:b.map(_=>{const T=_.match(m)[1],w=_.match(h).reduce((S,A)=>{const[C,E]=A.split(":");return S[C.trim()]=E.trim(),S},{});return w?{name:T,members:w}:null}).filter(({name:_})=>g.some(T=>T.type===_||T.type.includes(`<${_}>`))))??[];return{groups:g,structs:p}}var In=(l=>(l[l.VERTEX=1]="VERTEX",l[l.FRAGMENT=2]="FRAGMENT",l[l.COMPUTE=4]="COMPUTE",l))(In||{});function hv({groups:l}){const t=[];for(let n=0;n<l.length;n++){const s=l[n];t[s.group]||(t[s.group]=[]),s.isUniform?t[s.group].push({binding:s.binding,visibility:In.VERTEX|In.FRAGMENT,buffer:{type:"uniform"}}):s.type==="sampler"?t[s.group].push({binding:s.binding,visibility:In.FRAGMENT,sampler:{type:"filtering"}}):s.type==="texture_2d"||s.type.startsWith("texture_2d<")?t[s.group].push({binding:s.binding,visibility:In.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}}):s.type==="texture_2d_array"||s.type.startsWith("texture_2d_array<")?t[s.group].push({binding:s.binding,visibility:In.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d-array",multisampled:!1}}):(s.type==="texture_cube"||s.type.startsWith("texture_cube<"))&&t[s.group].push({binding:s.binding,visibility:In.FRAGMENT,texture:{sampleType:"float",viewDimension:"cube",multisampled:!1}})}for(let n=0;n<t.length;n++)t[n]||(t[n]=[]);return t}function fv({groups:l}){const t=[];for(let n=0;n<l.length;n++){const s=l[n];t[s.group]||(t[s.group]={}),t[s.group][s.name]=s.binding}return t}function dv(l,t){const n=new Set,s=new Set,r=[...l.structs,...t.structs].filter(c=>n.has(c.name)?!1:(n.add(c.name),!0)),u=[...l.groups,...t.groups].filter(c=>{const h=`${c.name}-${c.binding}`;return s.has(h)?!1:(s.add(h),!0)});return{structs:r,groups:u}}const Qa=Object.create(null);class co{constructor(t){var h,m;this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:n,vertex:s,layout:r,gpuLayout:u,name:c}=t;if(this.name=c,this.fragment=n,this.vertex=s,n.source===s.source){const g=Ic(n.source);this.structsAndGroups=g}else{const g=Ic(s.source),p=Ic(n.source);this.structsAndGroups=dv(g,p)}this.layout=r??fv(this.structsAndGroups),this.gpuLayout=u??hv(this.structsAndGroups),this.autoAssignGlobalUniforms=((h=this.layout[0])==null?void 0:h.globalUniforms)!==void 0,this.autoAssignLocalUniforms=((m=this.layout[1])==null?void 0:m.localUniforms)!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:t,fragment:n}=this,s=t.source+n.source+t.entryPoint+n.entryPoint;this._layoutKey=Uh(s,"program")}get attributeData(){return this._attributeData??(this._attributeData=cv(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,Qa[this._cacheKey]=null}static from(t){const n=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return Qa[n]||(Qa[n]=new co(t),Qa[n]._cacheKey=n),Qa[n]}}const r0=["f32","i32","vec2<f32>","vec3<f32>","vec4<f32>","mat2x2<f32>","mat3x3<f32>","mat4x4<f32>","mat3x2<f32>","mat4x2<f32>","mat2x3<f32>","mat4x3<f32>","mat2x4<f32>","mat3x4<f32>","vec2<i32>","vec3<i32>","vec4<i32>"],mv=r0.reduce((l,t)=>(l[t]=!0,l),{});function gv(l,t){switch(l){case"f32":return 0;case"vec2<f32>":return new Float32Array(2*t);case"vec3<f32>":return new Float32Array(3*t);case"vec4<f32>":return new Float32Array(4*t);case"mat2x2<f32>":return new Float32Array([1,0,0,1]);case"mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const o0=class u0{constructor(t,n){this._touched=0,this.uid=Zt("uniform"),this._resourceType="uniformGroup",this._resourceId=Zt("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,n={...u0.defaultOptions,...n},this.uniformStructures=t;const s={};for(const r in t){const u=t[r];if(u.name=r,u.size=u.size??1,!mv[u.type]){const c=u.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(c){const[,h,m]=c;throw new Error(`Uniform type ${u.type} is not supported. Use type: '${h}', size: ${m} instead.`)}throw new Error(`Uniform type ${u.type} is not supported. Supported uniform types are: ${r0.join(", ")}`)}u.value??(u.value=gv(u.type,u.size)),s[r]=u.value}this.uniforms=s,this._dirtyId=1,this.ubo=n.ubo,this.isStatic=n.isStatic,this._signature=Uh(Object.keys(s).map(r=>`${r}-${t[r].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};o0.defaultOptions={ubo:!1,isStatic:!1};let c0=o0;class eo{constructor(t){this.resources=Object.create(null),this._dirty=!0;let n=0;for(const s in t){const r=t[s];this.setResource(r,n++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const t=[];let n=0;for(const s in this.resources)t[n++]=this.resources[s]._resourceId;this._key=t.join("|")}setResource(t,n){var r,u;const s=this.resources[n];t!==s&&((r=s==null?void 0:s.off)==null||r.call(s,"change",this.onResourceChange,this),(u=t.on)==null||u.call(t,"change",this.onResourceChange,this),this.resources[n]=t,this._dirty=!0)}getResource(t){return this.resources[t]}_touch(t,n){const s=this.resources;for(const r in s)s[r]._gcLastUsed=t,s[r]._touched=n}destroy(){var n;const t=this.resources;for(const s in t){const r=t[s];(n=r==null?void 0:r.off)==null||n.call(r,"change",this.onResourceChange,this)}this.resources=null}onResourceChange(t){this._dirty=!0,t.destroyed?this.destroy():this._updateKey()}}var xh=(l=>(l[l.WEBGL=1]="WEBGL",l[l.WEBGPU=2]="WEBGPU",l[l.CANVAS=4]="CANVAS",l[l.BOTH=3]="BOTH",l))(xh||{});class jh extends Ti{constructor(t){super(),this.uid=Zt("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:n,glProgram:s,groups:r,resources:u,compatibleRenderers:c,groupMap:h}=t;this.gpuProgram=n,this.glProgram=s,c===void 0&&(c=0,n&&(c|=xh.WEBGPU),s&&(c|=xh.WEBGL)),this.compatibleRenderers=c;const m={};if(!u&&!r&&(u={}),u&&r)throw new Error("[Shader] Cannot have both resources and groups");if(!n&&r&&!h)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!n&&r&&h)for(const g in h)for(const p in h[g]){const x=h[g][p];m[x]={group:g,binding:p,name:x}}else if(n&&r&&!h){const g=n.structsAndGroups.groups;h={},g.forEach(p=>{h[p.group]=h[p.group]||{},h[p.group][p.binding]=p.name,m[p.name]=p})}else if(u){r={},h={},n&&n.structsAndGroups.groups.forEach(x=>{h[x.group]=h[x.group]||{},h[x.group][x.binding]=x.name,m[x.name]=x});let g=0;for(const p in u)m[p]||(r[99]||(r[99]=new eo,this._ownedBindGroups.push(r[99])),m[p]={group:99,binding:g,name:p},h[99]=h[99]||{},h[99][g]=p,g++);for(const p in u){const x=p;let b=u[p];!b.source&&!b._resourceType&&(b=new c0(b));const _=m[x];_&&(r[_.group]||(r[_.group]=new eo,this._ownedBindGroups.push(r[_.group])),r[_.group].setResource(b,_.binding))}}this.groups=r,this._uniformBindMap=h,this.resources=this._buildResourceAccessor(r,m)}addResource(t,n,s){var r,u;(r=this._uniformBindMap)[n]||(r[n]={}),(u=this._uniformBindMap[n])[s]||(u[s]=t),this.groups[n]||(this.groups[n]=new eo,this._ownedBindGroups.push(this.groups[n]))}_buildResourceAccessor(t,n){const s={};for(const r in n){const u=n[r];Object.defineProperty(s,u.name,{get(){return t[u.group].getResource(u.binding)},set(c){t[u.group].setResource(c,u.binding)}})}return s}destroy(t=!1){var n,s;this._destroyed||(this._destroyed=!0,this.emit("destroy",this),t&&((n=this.gpuProgram)==null||n.destroy(),(s=this.glProgram)==null||s.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(r=>{r.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null)}static from(t){const{gpu:n,gl:s,...r}=t;let u,c;return n&&(u=co.from(n)),s&&(c=l0.from(s)),new jh({gpuProgram:u,glProgram:c,...r})}}const pv={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},Kc=0,$c=1,Jc=2,th=3,eh=4,ih=5,_h=class h0{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<Kc)}set blend(t){!!(this.data&1<<Kc)!==t&&(this.data^=1<<Kc)}get offsets(){return!!(this.data&1<<$c)}set offsets(t){!!(this.data&1<<$c)!==t&&(this.data^=1<<$c)}set cullMode(t){if(t==="none"){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=t==="front"}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(this.data&1<<Jc)}set culling(t){!!(this.data&1<<Jc)!==t&&(this.data^=1<<Jc)}get depthTest(){return!!(this.data&1<<th)}set depthTest(t){!!(this.data&1<<th)!==t&&(this.data^=1<<th)}get depthMask(){return!!(this.data&1<<ih)}set depthMask(t){!!(this.data&1<<ih)!==t&&(this.data^=1<<ih)}get clockwiseFrontFace(){return!!(this.data&1<<eh)}set clockwiseFrontFace(t){!!(this.data&1<<eh)!==t&&(this.data^=1<<eh)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!=="none",this._blendMode=t,this._blendModeId=pv[t]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const t=new h0;return t.depthTest=!1,t.blend=!0,t}};_h.default2d=_h.for2d();let f0=_h;const bh=[];Jt.handleByNamedList(yt.Environment,bh);async function yv(l){if(!l)for(let t=0;t<bh.length;t++){const n=bh[t];if(n.value.test()){await n.value.load();return}}}let Za;function xv(){if(typeof Za=="boolean")return Za;try{Za=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{Za=!1}return Za}function Gp(l,t,n=2){const s=t&&t.length,r=s?t[0]*n:l.length;let u=d0(l,0,r,n,!0);const c=[];if(!u||u.next===u.prev)return c;let h,m,g;if(s&&(u=Tv(l,t,u,n)),l.length>80*n){h=l[0],m=l[1];let p=h,x=m;for(let b=n;b<r;b+=n){const _=l[b],T=l[b+1];_<h&&(h=_),T<m&&(m=T),_>p&&(p=_),T>x&&(x=T)}g=Math.max(p-h,x-m),g=g!==0?32767/g:0}return hl(u,c,n,h,m,g,0),c}function d0(l,t,n,s,r){let u;if(r===Ov(l,t,n,s)>0)for(let c=t;c<n;c+=s)u=kp(c/s|0,l[c],l[c+1],u);else for(let c=n-s;c>=t;c-=s)u=kp(c/s|0,l[c],l[c+1],u);return u&&Is(u,u.next)&&(dl(u),u=u.next),u}function Jn(l,t){if(!l)return l;t||(t=l);let n=l,s;do if(s=!1,!n.steiner&&(Is(n,n.next)||Vt(n.prev,n,n.next)===0)){if(dl(n),n=t=n.prev,n===n.next)break;s=!0}else n=n.next;while(s||n!==t);return t}function hl(l,t,n,s,r,u,c){if(!l)return;!c&&u&&Ev(l,s,r,u);let h=l;for(;l.prev!==l.next;){const m=l.prev,g=l.next;if(u?bv(l,s,r,u):_v(l)){t.push(m.i,l.i,g.i),dl(l),l=g.next,h=g.next;continue}if(l=g,l===h){c?c===1?(l=vv(Jn(l),t),hl(l,t,n,s,r,u,2)):c===2&&Sv(l,t,n,s,r,u):hl(Jn(l),t,n,s,r,u,1);break}}}function _v(l){const t=l.prev,n=l,s=l.next;if(Vt(t,n,s)>=0)return!1;const r=t.x,u=n.x,c=s.x,h=t.y,m=n.y,g=s.y,p=Math.min(r,u,c),x=Math.min(h,m,g),b=Math.max(r,u,c),_=Math.max(h,m,g);let T=s.next;for(;T!==t;){if(T.x>=p&&T.x<=b&&T.y>=x&&T.y<=_&&il(r,h,u,m,c,g,T.x,T.y)&&Vt(T.prev,T,T.next)>=0)return!1;T=T.next}return!0}function bv(l,t,n,s){const r=l.prev,u=l,c=l.next;if(Vt(r,u,c)>=0)return!1;const h=r.x,m=u.x,g=c.x,p=r.y,x=u.y,b=c.y,_=Math.min(h,m,g),T=Math.min(p,x,b),w=Math.max(h,m,g),S=Math.max(p,x,b),A=vh(_,T,t,n,s),C=vh(w,S,t,n,s);let E=l.prevZ,G=l.nextZ;for(;E&&E.z>=A&&G&&G.z<=C;){if(E.x>=_&&E.x<=w&&E.y>=T&&E.y<=S&&E!==r&&E!==c&&il(h,p,m,x,g,b,E.x,E.y)&&Vt(E.prev,E,E.next)>=0||(E=E.prevZ,G.x>=_&&G.x<=w&&G.y>=T&&G.y<=S&&G!==r&&G!==c&&il(h,p,m,x,g,b,G.x,G.y)&&Vt(G.prev,G,G.next)>=0))return!1;G=G.nextZ}for(;E&&E.z>=A;){if(E.x>=_&&E.x<=w&&E.y>=T&&E.y<=S&&E!==r&&E!==c&&il(h,p,m,x,g,b,E.x,E.y)&&Vt(E.prev,E,E.next)>=0)return!1;E=E.prevZ}for(;G&&G.z<=C;){if(G.x>=_&&G.x<=w&&G.y>=T&&G.y<=S&&G!==r&&G!==c&&il(h,p,m,x,g,b,G.x,G.y)&&Vt(G.prev,G,G.next)>=0)return!1;G=G.nextZ}return!0}function vv(l,t){let n=l;do{const s=n.prev,r=n.next.next;!Is(s,r)&&g0(s,n,n.next,r)&&fl(s,r)&&fl(r,s)&&(t.push(s.i,n.i,r.i),dl(n),dl(n.next),n=l=r),n=n.next}while(n!==l);return Jn(n)}function Sv(l,t,n,s,r,u){let c=l;do{let h=c.next.next;for(;h!==c.prev;){if(c.i!==h.i&&Dv(c,h)){let m=p0(c,h);c=Jn(c,c.next),m=Jn(m,m.next),hl(c,t,n,s,r,u,0),hl(m,t,n,s,r,u,0);return}h=h.next}c=c.next}while(c!==l)}function Tv(l,t,n,s){const r=[];for(let u=0,c=t.length;u<c;u++){const h=t[u]*s,m=u<c-1?t[u+1]*s:l.length,g=d0(l,h,m,s,!1);g===g.next&&(g.steiner=!0),r.push(zv(g))}r.sort(wv);for(let u=0;u<r.length;u++)n=Av(r[u],n);return n}function wv(l,t){let n=l.x-t.x;if(n===0&&(n=l.y-t.y,n===0)){const s=(l.next.y-l.y)/(l.next.x-l.x),r=(t.next.y-t.y)/(t.next.x-t.x);n=s-r}return n}function Av(l,t){const n=Cv(l,t);if(!n)return t;const s=p0(n,l);return Jn(s,s.next),Jn(n,n.next)}function Cv(l,t){let n=t;const s=l.x,r=l.y;let u=-1/0,c;if(Is(l,n))return n;do{if(Is(l,n.next))return n.next;if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){const x=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(x<=s&&x>u&&(u=x,c=n.x<n.next.x?n:n.next,x===s))return c}n=n.next}while(n!==t);if(!c)return null;const h=c,m=c.x,g=c.y;let p=1/0;n=c;do{if(s>=n.x&&n.x>=m&&s!==n.x&&m0(r<g?s:u,r,m,g,r<g?u:s,r,n.x,n.y)){const x=Math.abs(r-n.y)/(s-n.x);fl(n,l)&&(x<p||x===p&&(n.x>c.x||n.x===c.x&&Mv(c,n)))&&(c=n,p=x)}n=n.next}while(n!==h);return c}function Mv(l,t){return Vt(l.prev,l,t.prev)<0&&Vt(t.next,l,l.next)<0}function Ev(l,t,n,s){let r=l;do r.z===0&&(r.z=vh(r.x,r.y,t,n,s)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==l);r.prevZ.nextZ=null,r.prevZ=null,Rv(r)}function Rv(l){let t,n=1;do{let s=l,r;l=null;let u=null;for(t=0;s;){t++;let c=s,h=0;for(let g=0;g<n&&(h++,c=c.nextZ,!!c);g++);let m=n;for(;h>0||m>0&&c;)h!==0&&(m===0||!c||s.z<=c.z)?(r=s,s=s.nextZ,h--):(r=c,c=c.nextZ,m--),u?u.nextZ=r:l=r,r.prevZ=u,u=r;s=c}u.nextZ=null,n*=2}while(t>1);return l}function vh(l,t,n,s,r){return l=(l-n)*r|0,t=(t-s)*r|0,l=(l|l<<8)&16711935,l=(l|l<<4)&252645135,l=(l|l<<2)&858993459,l=(l|l<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,l|t<<1}function zv(l){let t=l,n=l;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==l);return n}function m0(l,t,n,s,r,u,c,h){return(r-c)*(t-h)>=(l-c)*(u-h)&&(l-c)*(s-h)>=(n-c)*(t-h)&&(n-c)*(u-h)>=(r-c)*(s-h)}function il(l,t,n,s,r,u,c,h){return!(l===c&&t===h)&&m0(l,t,n,s,r,u,c,h)}function Dv(l,t){return l.next.i!==t.i&&l.prev.i!==t.i&&!Nv(l,t)&&(fl(l,t)&&fl(t,l)&&Bv(l,t)&&(Vt(l.prev,l,t.prev)||Vt(l,t.prev,t))||Is(l,t)&&Vt(l.prev,l,l.next)>0&&Vt(t.prev,t,t.next)>0)}function Vt(l,t,n){return(t.y-l.y)*(n.x-t.x)-(t.x-l.x)*(n.y-t.y)}function Is(l,t){return l.x===t.x&&l.y===t.y}function g0(l,t,n,s){const r=Wr(Vt(l,t,n)),u=Wr(Vt(l,t,s)),c=Wr(Vt(n,s,l)),h=Wr(Vt(n,s,t));return!!(r!==u&&c!==h||r===0&&Fr(l,n,t)||u===0&&Fr(l,s,t)||c===0&&Fr(n,l,s)||h===0&&Fr(n,t,s))}function Fr(l,t,n){return t.x<=Math.max(l.x,n.x)&&t.x>=Math.min(l.x,n.x)&&t.y<=Math.max(l.y,n.y)&&t.y>=Math.min(l.y,n.y)}function Wr(l){return l>0?1:l<0?-1:0}function Nv(l,t){let n=l;do{if(n.i!==l.i&&n.next.i!==l.i&&n.i!==t.i&&n.next.i!==t.i&&g0(n,n.next,l,t))return!0;n=n.next}while(n!==l);return!1}function fl(l,t){return Vt(l.prev,l,l.next)<0?Vt(l,t,l.next)>=0&&Vt(l,l.prev,t)>=0:Vt(l,t,l.prev)<0||Vt(l,l.next,t)<0}function Bv(l,t){let n=l,s=!1;const r=(l.x+t.x)/2,u=(l.y+t.y)/2;do n.y>u!=n.next.y>u&&n.next.y!==n.y&&r<(n.next.x-n.x)*(u-n.y)/(n.next.y-n.y)+n.x&&(s=!s),n=n.next;while(n!==l);return s}function p0(l,t){const n=Sh(l.i,l.x,l.y),s=Sh(t.i,t.x,t.y),r=l.next,u=t.prev;return l.next=t,t.prev=l,n.next=r,r.prev=n,s.next=n,n.prev=s,u.next=s,s.prev=u,s}function kp(l,t,n,s){const r=Sh(l,t,n);return s?(r.next=s.next,r.prev=s,s.next.prev=r,s.next=r):(r.prev=r,r.next=r),r}function dl(l){l.next.prev=l.prev,l.prev.next=l.next,l.prevZ&&(l.prevZ.nextZ=l.nextZ),l.nextZ&&(l.nextZ.prevZ=l.prevZ)}function Sh(l,t,n){return{i:l,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Ov(l,t,n,s){let r=0;for(let u=t,c=n-s;u<n;u+=s)r+=(l[c]-l[u])*(l[u+1]+l[c+1]),c=u;return r}const Gv=Gp.default||Gp;var y0=(l=>(l[l.NONE=0]="NONE",l[l.COLOR=16384]="COLOR",l[l.STENCIL=1024]="STENCIL",l[l.DEPTH=256]="DEPTH",l[l.COLOR_DEPTH=16640]="COLOR_DEPTH",l[l.COLOR_STENCIL=17408]="COLOR_STENCIL",l[l.DEPTH_STENCIL=1280]="DEPTH_STENCIL",l[l.ALL=17664]="ALL",l))(y0||{});class kv{constructor(t){this.items=[],this._name=t}emit(t,n,s,r,u,c,h,m){const{name:g,items:p}=this;for(let x=0,b=p.length;x<b;x++)p[x][g](t,n,s,r,u,c,h,m);return this}add(t){return t[this._name]&&(this.remove(t),this.items.push(t)),this}remove(t){const n=this.items.indexOf(t);return n!==-1&&this.items.splice(n,1),this}contains(t){return this.items.indexOf(t)!==-1}removeAll(){return this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}}const Uv=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],x0=class _0 extends Ti{constructor(t){super(),this.tick=0,this.uid=Zt("renderer"),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=t.type,this.name=t.name,this.config=t;const n=[...Uv,...this.config.runners??[]];this._addRunners(...n),this._unsafeEvalCheck()}async init(t={}){const n=t.skipExtensionImports===!0?!0:t.manageImports===!1;await yv(n),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(const s in this._systemsHash)t={...this._systemsHash[s].constructor.defaultOptions,...t};t={..._0.defaultOptions,...t},this._roundPixels=t.roundPixels?1:0;for(let s=0;s<this.runners.init.items.length;s++)await this.runners.init.items[s].init(t);this._initOptions=t}render(t,n){this.tick++;let s=t;if(s instanceof De&&(s={container:s},n&&(At(Qt,"passing a second argument is deprecated, please use render options instead"),s.target=n.renderTexture)),s.target||(s.target=this.view.renderTarget),s.target===this.view.renderTarget&&(this._lastObjectRendered=s.container,s.clearColor??(s.clearColor=this.background.colorRgba),s.clear??(s.clear=this.background.clearBeforeRender)),s.clearColor){const r=Array.isArray(s.clearColor)&&s.clearColor.length===4;s.clearColor=r?s.clearColor:ae.shared.setValue(s.clearColor).toArray()}s.transform||(s.container.updateLocalTransform(),s.transform=s.container.localTransform),s.container.visible&&(s.container.enableRenderGroup(),this.runners.prerender.emit(s),this.runners.renderStart.emit(s),this.runners.render.emit(s),this.runners.renderEnd.emit(s),this.runners.postrender.emit(s))}resize(t,n,s){const r=this.view.resolution;this.view.resize(t,n,s),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),s!==void 0&&s!==r&&this.runners.resolutionChange.emit(s)}clear(t={}){const n=this;t.target||(t.target=n.renderTarget.renderTarget),t.clearColor||(t.clearColor=this.background.colorRgba),t.clear??(t.clear=y0.ALL);const{clear:s,clearColor:r,target:u,mipLevel:c,layer:h}=t;ae.shared.setValue(r??this.background.colorRgba),n.renderTarget.clear(u,s,ae.shared.toArray(),c??0,h??0)}get resolution(){return this.view.resolution}set resolution(t){this.view.resolution=t,this.runners.resolutionChange.emit(t)}get width(){return this.view.texture.frame.width}get height(){return this.view.texture.frame.height}get canvas(){return this.view.canvas}get lastObjectRendered(){return this._lastObjectRendered}get renderingToScreen(){return this.renderTarget.renderingToScreen}get screen(){return this.view.screen}_addRunners(...t){t.forEach(n=>{this.runners[n]=new kv(n)})}_addSystems(t){let n;for(n in t){const s=t[n];this._addSystem(s.value,s.name)}}_addSystem(t,n){const s=new t(this);if(this[n])throw new Error(`Whoops! The name "${n}" is already in use`);this[n]=s,this._systemsHash[n]=s;for(const r in this.runners)this.runners[r].add(s);return this}_addPipes(t,n){const s=n.reduce((r,u)=>(r[u.name]=u.value,r),{});t.forEach(r=>{const u=r.value,c=r.name,h=s[c];this.renderPipes[c]=new u(this,h?new h:null),this.runners.destroy.add(this.renderPipes[c])})}destroy(t=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(t),(t===!0||typeof t=="object"&&t.releaseGlobalResources)&&pl.release(),Object.values(this.runners).forEach(n=>{n.destroy()}),this._systemsHash=null,this.renderPipes=null,this.removeAllListeners()}generateTexture(t){return this.textureGenerator.generateTexture(t)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!xv())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}resetState(){this.runners.resetState.emit()}};x0.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let b0=x0,Qr;function jv(l){return Qr!==void 0||(Qr=(()=>{var n;const t={stencil:!0,failIfMajorPerformanceCaveat:l??b0.defaultOptions.failIfMajorPerformanceCaveat};try{if(!Pe.get().getWebGLRenderingContext())return!1;let r=Pe.get().createCanvas().getContext("webgl",t);const u=!!((n=r==null?void 0:r.getContextAttributes())!=null&&n.stencil);if(r){const c=r.getExtension("WEBGL_lose_context");c&&c.loseContext()}return r=null,u}catch{return!1}})()),Qr}let Zr;async function Hv(l={}){return Zr!==void 0||(Zr=await(async()=>{const t=Pe.get().getNavigator().gpu;if(!t)return!1;try{return await(await t.requestAdapter(l)).requestDevice(),!0}catch{return!1}})()),Zr}const Up=["webgl","webgpu","canvas"];async function Lv(l){let t=[];l.preference?(t.push(l.preference),Up.forEach(u=>{u!==l.preference&&t.push(u)})):t=Up.slice();let n,s={};for(let u=0;u<t.length;u++){const c=t[u];if(c==="webgpu"&&await Hv()){const{WebGPURenderer:h}=await sl(async()=>{const{WebGPURenderer:m}=await import("./WebGPURenderer-Du7e_Agz.js");return{WebGPURenderer:m}},__vite__mapDeps([3,4,5,2]));n=h,s={...l,...l.webgpu};break}else if(c==="webgl"&&jv(l.failIfMajorPerformanceCaveat??b0.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:h}=await sl(async()=>{const{WebGLRenderer:m}=await import("./WebGLRenderer-BJuclWjv.js");return{WebGLRenderer:m}},__vite__mapDeps([6,4,5,2]));n=h,s={...l,...l.webgl};break}else if(c==="canvas"){const{CanvasRenderer:h}=await sl(async()=>{const{CanvasRenderer:m}=await import("./CanvasRenderer-YM8daXJu.js");return{CanvasRenderer:m}},__vite__mapDeps([7,5,2]));n=h,s={...l,...l.canvasOptions};break}}if(delete s.webgpu,delete s.webgl,delete s.canvasOptions,!n)throw new Error("No available renderer for the current environment");const r=new n;return await r.init(s),r}const v0="8.17.1";class S0{static init(){var t;(t=globalThis.__PIXI_APP_INIT__)==null||t.call(globalThis,this,v0)}static destroy(){}}S0.extension=yt.Application;class Yv{constructor(t){this._renderer=t}init(){var t;(t=globalThis.__PIXI_RENDERER_INIT__)==null||t.call(globalThis,this._renderer,v0)}destroy(){this._renderer=null}}Yv.extension={type:[yt.WebGLSystem,yt.WebGPUSystem],name:"initHook",priority:-10};class T0{static init(t){Object.defineProperty(this,"resizeTo",{configurable:!0,set(n){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=n,n&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this._cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this._cancelResize();let n,s;if(this._resizeTo===globalThis.window)n=globalThis.innerWidth,s=globalThis.innerHeight;else{const{clientWidth:r,clientHeight:u}=this._resizeTo;n=r,s=u}this.renderer.resize(n,s),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}T0.extension=yt.Application;class w0{static init(t){t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{configurable:!0,set(n){this._ticker&&this._ticker.remove(this.render,this),this._ticker=n,n&&n.add(this.render,this,no.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?Ps.shared:new Ps,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}w0.extension=yt.Application;Jt.add(T0);Jt.add(w0);const A0=class Th{constructor(...t){this.stage=new De,t[0]!==void 0&&At(Qt,"Application constructor options are deprecated, please use Application.init() instead.")}async init(t){t={...t},this.stage||(this.stage=new De),this.renderer=await Lv(t),Th._plugins.forEach(n=>{n.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return At(Qt,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(t=!1,n=!1){const s=Th._plugins.slice(0);s.reverse(),s.forEach(r=>{r.destroy.call(this)}),this.stage.destroy(n),this.stage=null,this.renderer.destroy(t),this.renderer=null}};A0._plugins=[];let C0=A0;Jt.handleByList(yt.Application,C0._plugins);Jt.add(S0);var nh,jp;function qv(){if(jp)return nh;jp=1,nh=n;var l={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},t=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function n(u){var c=[];return u.replace(t,function(h,m,g){var p=m.toLowerCase();for(g=r(g),p=="m"&&g.length>2&&(c.push([m].concat(g.splice(0,2))),p="l",m=m=="m"?"l":"L");;){if(g.length==l[p])return g.unshift(m),c.push(g);if(g.length<l[p])throw new Error("malformed path data");c.push([m].concat(g.splice(0,l[p])))}}),c}var s=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function r(u){var c=u.match(s);return c?c.map(Number):[]}return nh}var Xv=qv();const Vv=Dh(Xv);function Pv(l,t){const n=Vv(l),s=[];let r=null,u=0,c=0;for(let h=0;h<n.length;h++){const m=n[h],g=m[0],p=m;switch(g){case"M":u=p[1],c=p[2],t.moveTo(u,c);break;case"m":u+=p[1],c+=p[2],t.moveTo(u,c);break;case"H":u=p[1],t.lineTo(u,c);break;case"h":u+=p[1],t.lineTo(u,c);break;case"V":c=p[1],t.lineTo(u,c);break;case"v":c+=p[1],t.lineTo(u,c);break;case"L":u=p[1],c=p[2],t.lineTo(u,c);break;case"l":u+=p[1],c+=p[2],t.lineTo(u,c);break;case"C":u=p[5],c=p[6],t.bezierCurveTo(p[1],p[2],p[3],p[4],u,c);break;case"c":t.bezierCurveTo(u+p[1],c+p[2],u+p[3],c+p[4],u+p[5],c+p[6]),u+=p[5],c+=p[6];break;case"S":u=p[3],c=p[4],t.bezierCurveToShort(p[1],p[2],u,c);break;case"s":t.bezierCurveToShort(u+p[1],c+p[2],u+p[3],c+p[4]),u+=p[3],c+=p[4];break;case"Q":u=p[3],c=p[4],t.quadraticCurveTo(p[1],p[2],u,c);break;case"q":t.quadraticCurveTo(u+p[1],c+p[2],u+p[3],c+p[4]),u+=p[3],c+=p[4];break;case"T":u=p[1],c=p[2],t.quadraticCurveToShort(u,c);break;case"t":u+=p[1],c+=p[2],t.quadraticCurveToShort(u,c);break;case"A":u=p[6],c=p[7],t.arcToSvg(p[1],p[2],p[3],p[4],p[5],u,c);break;case"a":u+=p[6],c+=p[7],t.arcToSvg(p[1],p[2],p[3],p[4],p[5],u,c);break;case"Z":case"z":t.closePath(),s.length>0&&(r=s.pop(),r?(u=r.startX,c=r.startY):(u=0,c=0)),r=null;break;default:Se(`Unknown SVG path command: ${g}`)}g!=="Z"&&g!=="z"&&r===null&&(r={startX:u,startY:c},s.push(r))}return t}class Hh{constructor(t=0,n=0,s=0){this.type="circle",this.x=t,this.y=n,this.radius=s}clone(){return new Hh(this.x,this.y,this.radius)}contains(t,n){if(this.radius<=0)return!1;const s=this.radius*this.radius;let r=this.x-t,u=this.y-n;return r*=r,u*=u,r+u<=s}strokeContains(t,n,s,r=.5){if(this.radius===0)return!1;const u=this.x-t,c=this.y-n,h=this.radius,m=(1-r)*s,g=Math.sqrt(u*u+c*c);return g<=h+m&&g>h-(s-m)}getBounds(t){return t||(t=new $t),t.x=this.x-this.radius,t.y=this.y-this.radius,t.width=this.radius*2,t.height=this.radius*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.radius=t.radius,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class Lh{constructor(t=0,n=0,s=0,r=0){this.type="ellipse",this.x=t,this.y=n,this.halfWidth=s,this.halfHeight=r}clone(){return new Lh(this.x,this.y,this.halfWidth,this.halfHeight)}contains(t,n){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let s=(t-this.x)/this.halfWidth,r=(n-this.y)/this.halfHeight;return s*=s,r*=r,s+r<=1}strokeContains(t,n,s,r=.5){const{halfWidth:u,halfHeight:c}=this;if(u<=0||c<=0)return!1;const h=s*(1-r),m=s-h,g=u-m,p=c-m,x=u+h,b=c+h,_=t-this.x,T=n-this.y,w=_*_/(g*g)+T*T/(p*p),S=_*_/(x*x)+T*T/(b*b);return w>1&&S<=1}getBounds(t){return t||(t=new $t),t.x=this.x-this.halfWidth,t.y=this.y-this.halfHeight,t.width=this.halfWidth*2,t.height=this.halfHeight*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.halfWidth=t.halfWidth,this.halfHeight=t.halfHeight,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function Fv(l,t,n,s,r,u){const c=l-n,h=t-s,m=r-n,g=u-s,p=c*m+h*g,x=m*m+g*g;let b=-1;x!==0&&(b=p/x);let _,T;b<0?(_=n,T=s):b>1?(_=r,T=u):(_=n+b*m,T=s+b*g);const w=l-_,S=t-T;return w*w+S*S}let Wv,Qv;class ll{constructor(...t){this.type="polygon";let n=Array.isArray(t[0])?t[0]:t;if(typeof n[0]!="number"){const s=[];for(let r=0,u=n.length;r<u;r++)s.push(n[r].x,n[r].y);n=s}this.points=n,this.closePath=!0}isClockwise(){let t=0;const n=this.points,s=n.length;for(let r=0;r<s;r+=2){const u=n[r],c=n[r+1],h=n[(r+2)%s],m=n[(r+3)%s];t+=(h-u)*(m+c)}return t<0}containsPolygon(t){const n=this.getBounds(Wv),s=t.getBounds(Qv);if(!n.containsRect(s))return!1;const r=t.points;for(let u=0;u<r.length;u+=2){const c=r[u],h=r[u+1];if(!this.contains(c,h))return!1}return!0}clone(){const t=this.points.slice(),n=new ll(t);return n.closePath=this.closePath,n}contains(t,n){let s=!1;const r=this.points.length/2;for(let u=0,c=r-1;u<r;c=u++){const h=this.points[u*2],m=this.points[u*2+1],g=this.points[c*2],p=this.points[c*2+1];m>n!=p>n&&t<(g-h)*((n-m)/(p-m))+h&&(s=!s)}return s}strokeContains(t,n,s,r=.5){const u=s*s,c=u*(1-r),h=u-c,{points:m}=this,g=m.length-(this.closePath?0:2);for(let p=0;p<g;p+=2){const x=m[p],b=m[p+1],_=m[(p+2)%m.length],T=m[(p+3)%m.length],w=Fv(t,n,x,b,_,T),S=Math.sign((_-x)*(n-b)-(T-b)*(t-x));if(w<=(S<0?h:c))return!0}return!1}getBounds(t){t||(t=new $t);const n=this.points;let s=1/0,r=-1/0,u=1/0,c=-1/0;for(let h=0,m=n.length;h<m;h+=2){const g=n[h],p=n[h+1];s=g<s?g:s,r=g>r?g:r,u=p<u?p:u,c=p>c?p:c}return t.x=s,t.width=r-s,t.y=u,t.height=c-u,t}copyFrom(t){return this.points=t.points.slice(),this.closePath=t.closePath,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((t,n)=>`${t}, ${n}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return At("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return At("8.11.0","Polygon.y is deprecated, please use Polygon.lastY instead."),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}}const Ir=(l,t,n,s,r,u,c)=>{const h=l-n,m=t-s,g=Math.sqrt(h*h+m*m);return g>=r-u&&g<=r+c};class Yh{constructor(t=0,n=0,s=0,r=0,u=20){this.type="roundedRectangle",this.x=t,this.y=n,this.width=s,this.height=r,this.radius=u}getBounds(t){return t||(t=new $t),t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}clone(){return new Yh(this.x,this.y,this.width,this.height,this.radius)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,n){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&n>=this.y&&n<=this.y+this.height){const s=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(n>=this.y+s&&n<=this.y+this.height-s||t>=this.x+s&&t<=this.x+this.width-s)return!0;let r=t-(this.x+s),u=n-(this.y+s);const c=s*s;if(r*r+u*u<=c||(r=t-(this.x+this.width-s),r*r+u*u<=c)||(u=n-(this.y+this.height-s),r*r+u*u<=c)||(r=t-(this.x+s),r*r+u*u<=c))return!0}return!1}strokeContains(t,n,s,r=.5){const{x:u,y:c,width:h,height:m,radius:g}=this,p=s*(1-r),x=s-p,b=u+g,_=c+g,T=h-g*2,w=m-g*2,S=u+h,A=c+m;return(t>=u-p&&t<=u+x||t>=S-x&&t<=S+p)&&n>=_&&n<=_+w||(n>=c-p&&n<=c+x||n>=A-x&&n<=A+p)&&t>=b&&t<=b+T?!0:t<b&&n<_&&Ir(t,n,b,_,g,x,p)||t>S-g&&n<_&&Ir(t,n,S-g,_,g,x,p)||t>S-g&&n>A-g&&Ir(t,n,S-g,A-g,g,x,p)||t<b&&n>A-g&&Ir(t,n,b,A-g,g,x,p)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}const M0={};function Zv(l,t,n){let s=2166136261;for(let r=0;r<t;r++)s^=l[r].uid,s=Math.imul(s,16777619),s>>>=0;return M0[s]||Iv(l,t,s,n)}function Iv(l,t,n,s){const r={};let u=0;for(let h=0;h<s;h++){const m=h<t?l[h]:Gt.EMPTY.source;r[u++]=m.source,r[u++]=m.style}const c=new eo(r);return M0[n]=c,c}class Hp{constructor(t){typeof t=="number"?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData),this.size=this.rawBinaryData.byteLength}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}get float64View(){return this._float64Array||(this._float64Array=new Float64Array(this.rawBinaryData)),this._float64Array}get bigUint64View(){return this._bigUint64Array||(this._bigUint64Array=new BigUint64Array(this.rawBinaryData)),this._bigUint64Array}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this.uint32View=null,this.float32View=null,this.uint16View=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._int32View=null,this._float64Array=null,this._bigUint64Array=null}static sizeOf(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${t} isn't a valid view type`)}}}function Lp(l,t,n,s){if(n??(n=0),s??(s=Math.min(l.byteLength-n,t.byteLength)),!(n&7)&&!(s&7)){const r=s/8;new Float64Array(t,0,r).set(new Float64Array(l,n,r))}else if(!(n&3)&&!(s&3)){const r=s/4;new Float32Array(t,0,r).set(new Float32Array(l,n,r))}else new Uint8Array(t).set(new Uint8Array(l,n,s))}const Kv={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};var $v=(l=>(l[l.DISABLED=0]="DISABLED",l[l.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",l[l.MASK_ACTIVE=2]="MASK_ACTIVE",l[l.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",l[l.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",l[l.NONE=5]="NONE",l))($v||{});function Yp(l,t){return t.alphaMode==="no-premultiply-alpha"&&Kv[l]||l}const Jv=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
72
+ `);function tS(l){let t="";for(let n=0;n<l;++n)n>0&&(t+=`
73
+ else `),n<l-1&&(t+=`if(test == ${n}.0){}`);return t}function eS(l,t){if(l===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const n=t.createShader(t.FRAGMENT_SHADER);try{for(;;){const s=Jv.replace(/%forloop%/gi,tS(l));if(t.shaderSource(n,s),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))l=l/2|0;else break}}finally{t.deleteShader(n)}return l}let Hs=null;function iS(){var t;if(Hs)return Hs;const l=s0();return Hs=l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS),Hs=eS(Hs,l),(t=l.getExtension("WEBGL_lose_context"))==null||t.loseContext(),Hs}class nS{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let t=0;t<this.count;t++){const n=this.textures[t];this.textures[t]=null,this.ids[n.uid]=null}this.count=0}}class sS{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new nS,this.blendMode="normal",this.topology="triangle-strip",this.canBundle=!0}destroy(){this.textures=null,this.gpuBindGroup=null,this.bindGroup=null,this.batcher=null,this.elements=null}}const rl=[];let so=0;pl.register({clear:()=>{if(rl.length>0)for(const l of rl)l&&l.destroy();rl.length=0,so=0}});function qp(){return so>0?rl[--so]:new sS}function Xp(l){l.elements=null,rl[so++]=l}let Ia=0;const E0=class R0{constructor(t){this.uid=Zt("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],t={...R0.defaultOptions,...t},t.maxTextures||(At("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),t.maxTextures=iS());const{maxTextures:n,attributesInitialSize:s,indicesInitialSize:r}=t;this.attributeBuffer=new Hp(s*4),this.indexBuffer=new Uint16Array(r),this.maxTextures=n}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let t=0;t<this.batchIndex;t++)Xp(this.batches[t]);this.batchIndex=0,this._batchIndexStart=0,this._batchIndexSize=0,this.dirty=!0}add(t){this._elements[this.elementSize++]=t,t._indexStart=this.indexSize,t._attributeStart=this.attributeSize,t._batcher=this,this.indexSize+=t.indexSize,this.attributeSize+=t.attributeSize*this.vertexSize}checkAndUpdateTexture(t,n){const s=t._batch.textures.ids[n._source.uid];return!s&&s!==0?!1:(t._textureId=s,t.texture=n,!0)}updateElement(t){this.dirty=!0;const n=this.attributeBuffer;t.packAsQuad?this.packQuadAttributes(t,n.float32View,n.uint32View,t._attributeStart,t._textureId):this.packAttributes(t,n.float32View,n.uint32View,t._attributeStart,t._textureId)}break(t){const n=this._elements;if(!n[this.elementStart])return;let s=qp(),r=s.textures;r.clear();const u=n[this.elementStart];let c=Yp(u.blendMode,u.texture._source),h=u.topology;this.attributeSize*4>this.attributeBuffer.size&&this._resizeAttributeBuffer(this.attributeSize*4),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);const m=this.attributeBuffer.float32View,g=this.attributeBuffer.uint32View,p=this.indexBuffer;let x=this._batchIndexSize,b=this._batchIndexStart,_="startBatch",T=[];const w=this.maxTextures;for(let S=this.elementStart;S<this.elementSize;++S){const A=n[S];n[S]=null;const E=A.texture._source,G=Yp(A.blendMode,E),P=c!==G||h!==A.topology;if(E._batchTick===Ia&&!P){A._textureId=E._textureBindLocation,x+=A.indexSize,A.packAsQuad?(this.packQuadAttributes(A,m,g,A._attributeStart,A._textureId),this.packQuadIndex(p,A._indexStart,A._attributeStart/this.vertexSize)):(this.packAttributes(A,m,g,A._attributeStart,A._textureId),this.packIndex(A,p,A._indexStart,A._attributeStart/this.vertexSize)),A._batch=s,T.push(A);continue}E._batchTick=Ia,(r.count>=w||P)&&(this._finishBatch(s,b,x-b,r,c,h,t,_,T),_="renderBatch",b=x,c=G,h=A.topology,s=qp(),r=s.textures,r.clear(),T=[],++Ia),A._textureId=E._textureBindLocation=r.count,r.ids[E.uid]=r.count,r.textures[r.count++]=E,A._batch=s,T.push(A),x+=A.indexSize,A.packAsQuad?(this.packQuadAttributes(A,m,g,A._attributeStart,A._textureId),this.packQuadIndex(p,A._indexStart,A._attributeStart/this.vertexSize)):(this.packAttributes(A,m,g,A._attributeStart,A._textureId),this.packIndex(A,p,A._indexStart,A._attributeStart/this.vertexSize))}r.count>0&&(this._finishBatch(s,b,x-b,r,c,h,t,_,T),b=x,++Ia),this.elementStart=this.elementSize,this._batchIndexStart=b,this._batchIndexSize=x}_finishBatch(t,n,s,r,u,c,h,m,g){t.gpuBindGroup=null,t.bindGroup=null,t.action=m,t.batcher=this,t.textures=r,t.blendMode=u,t.topology=c,t.start=n,t.size=s,t.elements=g,++Ia,this.batches[this.batchIndex++]=t,h.add(t)}finish(t){this.break(t)}ensureAttributeBuffer(t){t*4<=this.attributeBuffer.size||this._resizeAttributeBuffer(t*4)}ensureIndexBuffer(t){t<=this.indexBuffer.length||this._resizeIndexBuffer(t)}_resizeAttributeBuffer(t){const n=Math.max(t,this.attributeBuffer.size*2),s=new Hp(n);Lp(this.attributeBuffer.rawBinaryData,s.rawBinaryData),this.attributeBuffer=s}_resizeIndexBuffer(t){const n=this.indexBuffer;let s=Math.max(t,n.length*1.5);s+=s%2;const r=s>65535?new Uint32Array(s):new Uint16Array(s);if(r.BYTES_PER_ELEMENT!==n.BYTES_PER_ELEMENT)for(let u=0;u<n.length;u++)r[u]=n[u];else Lp(n.buffer,r.buffer);this.indexBuffer=r}packQuadIndex(t,n,s){t[n]=s+0,t[n+1]=s+1,t[n+2]=s+2,t[n+3]=s+0,t[n+4]=s+2,t[n+5]=s+3}packIndex(t,n,s,r){const u=t.indices,c=t.indexSize,h=t.indexOffset,m=t.attributeOffset;for(let g=0;g<c;g++)n[s++]=r+u[g+h]-m}destroy(t={}){var n;if(this.batches!==null){for(let s=0;s<this.batchIndex;s++)Xp(this.batches[s]);this.batches=null,this.geometry.destroy(!0),this.geometry=null,t.shader&&((n=this.shader)==null||n.destroy(),this.shader=null);for(let s=0;s<this._elements.length;s++)this._elements[s]&&(this._elements[s]._batch=null);this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null}}};E0.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};let aS=E0;var ze=(l=>(l[l.MAP_READ=1]="MAP_READ",l[l.MAP_WRITE=2]="MAP_WRITE",l[l.COPY_SRC=4]="COPY_SRC",l[l.COPY_DST=8]="COPY_DST",l[l.INDEX=16]="INDEX",l[l.VERTEX=32]="VERTEX",l[l.UNIFORM=64]="UNIFORM",l[l.STORAGE=128]="STORAGE",l[l.INDIRECT=256]="INDIRECT",l[l.QUERY_RESOLVE=512]="QUERY_RESOLVE",l[l.STATIC=1024]="STATIC",l))(ze||{});class ml extends Ti{constructor(t){let{data:n,size:s}=t;const{usage:r,label:u,shrinkToFit:c}=t;super(),this._gpuData=Object.create(null),this._gcLastUsed=-1,this.autoGarbageCollect=!0,this.uid=Zt("buffer"),this._resourceType="buffer",this._resourceId=Zt("resource"),this._touched=0,this._updateID=1,this._dataInt32=null,this.shrinkToFit=!0,this.destroyed=!1,n instanceof Array&&(n=new Float32Array(n)),this._data=n,s??(s=n==null?void 0:n.byteLength);const h=!!n;this.descriptor={size:s,usage:r,mappedAtCreation:h,label:u},this.shrinkToFit=c??!0}get data(){return this._data}set data(t){this.setDataWithSize(t,t.length,!0)}get dataInt32(){return this._dataInt32||(this._dataInt32=new Int32Array(this.data.buffer)),this._dataInt32}get static(){return!!(this.descriptor.usage&ze.STATIC)}set static(t){t?this.descriptor.usage|=ze.STATIC:this.descriptor.usage&=~ze.STATIC}setDataWithSize(t,n,s){if(this._updateID++,this._updateSize=n*t.BYTES_PER_ELEMENT,this._data===t){s&&this.emit("update",this);return}const r=this._data;if(this._data=t,this._dataInt32=null,!r||r.length!==t.length){!this.shrinkToFit&&r&&t.byteLength<r.byteLength?s&&this.emit("update",this):(this.descriptor.size=t.byteLength,this._resourceId=Zt("resource"),this.emit("change",this));return}s&&this.emit("update",this)}update(t){this._updateSize=t??this._updateSize,this._updateID++,this.emit("update",this)}unload(){var t;this.emit("unload",this);for(const n in this._gpuData)(t=this._gpuData[n])==null||t.destroy();this._gpuData=Object.create(null)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this.emit("change",this),this._data=null,this.descriptor=null,this.removeAllListeners()}}function z0(l,t){if(!(l instanceof ml)){let n=t?ze.INDEX:ze.VERTEX;l instanceof Array&&(t?(l=new Uint32Array(l),n=ze.INDEX|ze.COPY_DST):(l=new Float32Array(l),n=ze.VERTEX|ze.COPY_DST)),l=new ml({data:l,label:t?"index-mesh-buffer":"vertex-mesh-buffer",usage:n})}return l}function lS(l,t,n){const s=l.getAttribute(t);if(!s)return n.minX=0,n.minY=0,n.maxX=0,n.maxY=0,n;const r=s.buffer.data;let u=1/0,c=1/0,h=-1/0,m=-1/0;const g=r.BYTES_PER_ELEMENT,p=(s.offset||0)/g,x=(s.stride||8)/g;for(let b=p;b<r.length;b+=x){const _=r[b],T=r[b+1];_>h&&(h=_),T>m&&(m=T),_<u&&(u=_),T<c&&(c=T)}return n.minX=u,n.minY=c,n.maxX=h,n.maxY=m,n}function rS(l){return(l instanceof ml||Array.isArray(l)||l.BYTES_PER_ELEMENT)&&(l={buffer:l}),l.buffer=z0(l.buffer,!1),l}class oS extends Ti{constructor(t={}){super(),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=Zt("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new ri,this._boundsDirty=!0;const{attributes:n,indexBuffer:s,topology:r}=t;if(this.buffers=[],this.attributes={},n)for(const u in n)this.addAttribute(u,n[u]);this.instanceCount=t.instanceCount??1,s&&this.addIndex(s),this.topology=r||"triangle-list"}onBufferUpdate(){this._boundsDirty=!0,this.emit("update",this)}getAttribute(t){return this.attributes[t]}getIndex(){return this.indexBuffer}getBuffer(t){return this.getAttribute(t).buffer}getSize(){for(const t in this.attributes){const n=this.attributes[t];return n.buffer.data.length/(n.stride/4||n.size)}return 0}addAttribute(t,n){const s=rS(n);this.buffers.indexOf(s.buffer)===-1&&(this.buffers.push(s.buffer),s.buffer.on("update",this.onBufferUpdate,this),s.buffer.on("change",this.onBufferUpdate,this)),this.attributes[t]=s}addIndex(t){this.indexBuffer=z0(t,!0),this.buffers.push(this.indexBuffer)}get bounds(){return this._boundsDirty?(this._boundsDirty=!1,lS(this,"aPosition",this._bounds)):this._bounds}unload(){var t;this.emit("unload",this);for(const n in this._gpuData)(t=this._gpuData[n])==null||t.destroy();this._gpuData=Object.create(null)}destroy(t=!1){var n;this.emit("destroy",this),this.removeAllListeners(),t&&this.buffers.forEach(s=>s.destroy()),this.unload(),(n=this.indexBuffer)==null||n.destroy(),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}}const uS=new Float32Array(1),cS=new Uint32Array(1);class hS extends oS{constructor(){const n=new ml({data:uS,label:"attribute-batch-buffer",usage:ze.VERTEX|ze.COPY_DST,shrinkToFit:!1}),s=new ml({data:cS,label:"index-batch-buffer",usage:ze.INDEX|ze.COPY_DST,shrinkToFit:!1}),r=24;super({attributes:{aPosition:{buffer:n,format:"float32x2",stride:r,offset:0},aUV:{buffer:n,format:"float32x2",stride:r,offset:8},aColor:{buffer:n,format:"unorm8x4",stride:r,offset:16},aTextureIdAndRound:{buffer:n,format:"uint16x2",stride:r,offset:20}},indexBuffer:s})}}function Vp(l,t,n){if(l)for(const s in l){const r=s.toLocaleLowerCase(),u=t[r];if(u){let c=l[s];s==="header"&&(c=c.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),n&&u.push(`//----${n}----//`),u.push(c)}else Se(`${s} placement hook does not exist in shader`)}}const fS=/\{\{(.*?)\}\}/g;function Pp(l){var s;const t={};return(((s=l.match(fS))==null?void 0:s.map(r=>r.replace(/[{()}]/g,"")))??[]).forEach(r=>{t[r]=[]}),t}function Fp(l,t){let n;const s=/@in\s+([^;]+);/g;for(;(n=s.exec(l))!==null;)t.push(n[1])}function Wp(l,t,n=!1){const s=[];Fp(t,s),l.forEach(h=>{h.header&&Fp(h.header,s)});const r=s;n&&r.sort();const u=r.map((h,m)=>` @location(${m}) ${h},`).join(`
74
+ `);let c=t.replace(/@in\s+[^;]+;\s*/g,"");return c=c.replace("{{in}}",`
75
+ ${u}
76
+ `),c}function Qp(l,t){let n;const s=/@out\s+([^;]+);/g;for(;(n=s.exec(l))!==null;)t.push(n[1])}function dS(l){const n=/\b(\w+)\s*:/g.exec(l);return n?n[1]:""}function mS(l){const t=/@.*?\s+/g;return l.replace(t,"")}function gS(l,t){const n=[];Qp(t,n),l.forEach(m=>{m.header&&Qp(m.header,n)});let s=0;const r=n.sort().map(m=>m.indexOf("builtin")>-1?m:`@location(${s++}) ${m}`).join(`,
77
+ `),u=n.sort().map(m=>` var ${mS(m)};`).join(`
78
+ `),c=`return VSOutput(
79
+ ${n.sort().map(m=>` ${dS(m)}`).join(`,
80
+ `)});`;let h=t.replace(/@out\s+[^;]+;\s*/g,"");return h=h.replace("{{struct}}",`
81
+ ${r}
82
+ `),h=h.replace("{{start}}",`
83
+ ${u}
84
+ `),h=h.replace("{{return}}",`
85
+ ${c}
86
+ `),h}function Zp(l,t){let n=l;for(const s in t){const r=t[s];r.join(`
87
+ `).length?n=n.replace(`{{${s}}}`,`//-----${s} START-----//
88
+ ${r.join(`
89
+ `)}
90
+ //----${s} FINISH----//`):n=n.replace(`{{${s}}}`,"")}return n}const wn=Object.create(null),sh=new Map;let pS=0;function yS({template:l,bits:t}){const n=D0(l,t);if(wn[n])return wn[n];const{vertex:s,fragment:r}=_S(l,t);return wn[n]=N0(s,r,t),wn[n]}function xS({template:l,bits:t}){const n=D0(l,t);return wn[n]||(wn[n]=N0(l.vertex,l.fragment,t)),wn[n]}function _S(l,t){const n=t.map(c=>c.vertex).filter(c=>!!c),s=t.map(c=>c.fragment).filter(c=>!!c);let r=Wp(n,l.vertex,!0);r=gS(n,r);const u=Wp(s,l.fragment,!0);return{vertex:r,fragment:u}}function D0(l,t){return t.map(n=>(sh.has(n)||sh.set(n,pS++),sh.get(n))).sort((n,s)=>n-s).join("-")+l.vertex+l.fragment}function N0(l,t,n){const s=Pp(l),r=Pp(t);return n.forEach(u=>{Vp(u.vertex,s,u.name),Vp(u.fragment,r,u.name)}),{vertex:Zp(l,s),fragment:Zp(t,r)}}const bS=`
91
+ @in aPosition: vec2<f32>;
92
+ @in aUV: vec2<f32>;
93
+
94
+ @out @builtin(position) vPosition: vec4<f32>;
95
+ @out vUV : vec2<f32>;
96
+ @out vColor : vec4<f32>;
97
+
98
+ {{header}}
99
+
100
+ struct VSOutput {
101
+ {{struct}}
102
+ };
103
+
104
+ @vertex
105
+ fn main( {{in}} ) -> VSOutput {
106
+
107
+ var worldTransformMatrix = globalUniforms.uWorldTransformMatrix;
108
+ var modelMatrix = mat3x3<f32>(
109
+ 1.0, 0.0, 0.0,
110
+ 0.0, 1.0, 0.0,
111
+ 0.0, 0.0, 1.0
112
+ );
113
+ var position = aPosition;
114
+ var uv = aUV;
115
+
116
+ {{start}}
117
+
118
+ vColor = vec4<f32>(1., 1., 1., 1.);
119
+
120
+ {{main}}
121
+
122
+ vUV = uv;
123
+
124
+ var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix;
125
+
126
+ vPosition = vec4<f32>((modelViewProjectionMatrix * vec3<f32>(position, 1.0)).xy, 0.0, 1.0);
127
+
128
+ vColor *= globalUniforms.uWorldColorAlpha;
129
+
130
+ {{end}}
131
+
132
+ {{return}}
133
+ };
134
+ `,vS=`
135
+ @in vUV : vec2<f32>;
136
+ @in vColor : vec4<f32>;
137
+
138
+ {{header}}
139
+
140
+ @fragment
141
+ fn main(
142
+ {{in}}
143
+ ) -> @location(0) vec4<f32> {
144
+
145
+ {{start}}
146
+
147
+ var outColor:vec4<f32>;
148
+
149
+ {{main}}
150
+
151
+ var finalColor:vec4<f32> = outColor * vColor;
152
+
153
+ {{end}}
154
+
155
+ return finalColor;
156
+ };
157
+ `,SS=`
158
+ in vec2 aPosition;
159
+ in vec2 aUV;
160
+
161
+ out vec4 vColor;
162
+ out vec2 vUV;
163
+
164
+ {{header}}
165
+
166
+ void main(void){
167
+
168
+ mat3 worldTransformMatrix = uWorldTransformMatrix;
169
+ mat3 modelMatrix = mat3(
170
+ 1.0, 0.0, 0.0,
171
+ 0.0, 1.0, 0.0,
172
+ 0.0, 0.0, 1.0
173
+ );
174
+ vec2 position = aPosition;
175
+ vec2 uv = aUV;
176
+
177
+ {{start}}
178
+
179
+ vColor = vec4(1.);
180
+
181
+ {{main}}
182
+
183
+ vUV = uv;
184
+
185
+ mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix;
186
+
187
+ gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
188
+
189
+ vColor *= uWorldColorAlpha;
190
+
191
+ {{end}}
192
+ }
193
+ `,TS=`
194
+
195
+ in vec4 vColor;
196
+ in vec2 vUV;
197
+
198
+ out vec4 finalColor;
199
+
200
+ {{header}}
201
+
202
+ void main(void) {
203
+
204
+ {{start}}
205
+
206
+ vec4 outColor;
207
+
208
+ {{main}}
209
+
210
+ finalColor = outColor * vColor;
211
+
212
+ {{end}}
213
+ }
214
+ `,wS={name:"global-uniforms-bit",vertex:{header:`
215
+ struct GlobalUniforms {
216
+ uProjectionMatrix:mat3x3<f32>,
217
+ uWorldTransformMatrix:mat3x3<f32>,
218
+ uWorldColorAlpha: vec4<f32>,
219
+ uResolution: vec2<f32>,
220
+ }
221
+
222
+ @group(0) @binding(0) var<uniform> globalUniforms : GlobalUniforms;
223
+ `}},AS={name:"global-uniforms-bit",vertex:{header:`
224
+ uniform mat3 uProjectionMatrix;
225
+ uniform mat3 uWorldTransformMatrix;
226
+ uniform vec4 uWorldColorAlpha;
227
+ uniform vec2 uResolution;
228
+ `}};function CS({bits:l,name:t}){const n=yS({template:{fragment:vS,vertex:bS},bits:[wS,...l]});return co.from({name:t,vertex:{source:n.vertex,entryPoint:"main"},fragment:{source:n.fragment,entryPoint:"main"}})}function MS({bits:l,name:t}){return new l0({name:t,...xS({template:{vertex:SS,fragment:TS},bits:[AS,...l]})})}const ES={name:"color-bit",vertex:{header:`
229
+ @in aColor: vec4<f32>;
230
+ `,main:`
231
+ vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);
232
+ `}},RS={name:"color-bit",vertex:{header:`
233
+ in vec4 aColor;
234
+ `,main:`
235
+ vColor *= vec4(aColor.rgb * aColor.a, aColor.a);
236
+ `}},ah={};function zS(l){const t=[];if(l===1)t.push("@group(1) @binding(0) var textureSource1: texture_2d<f32>;"),t.push("@group(1) @binding(1) var textureSampler1: sampler;");else{let n=0;for(let s=0;s<l;s++)t.push(`@group(1) @binding(${n++}) var textureSource${s+1}: texture_2d<f32>;`),t.push(`@group(1) @binding(${n++}) var textureSampler${s+1}: sampler;`)}return t.join(`
237
+ `)}function DS(l){const t=[];if(l===1)t.push("outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);");else{t.push("switch vTextureId {");for(let n=0;n<l;n++)n===l-1?t.push(" default:{"):t.push(` case ${n}:{`),t.push(` outColor = textureSampleGrad(textureSource${n+1}, textureSampler${n+1}, vUV, uvDx, uvDy);`),t.push(" break;}");t.push("}")}return t.join(`
238
+ `)}function NS(l){return ah[l]||(ah[l]={name:"texture-batch-bit",vertex:{header:`
239
+ @in aTextureIdAndRound: vec2<u32>;
240
+ @out @interpolate(flat) vTextureId : u32;
241
+ `,main:`
242
+ vTextureId = aTextureIdAndRound.y;
243
+ `,end:`
244
+ if(aTextureIdAndRound.x == 1)
245
+ {
246
+ vPosition = vec4<f32>(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
247
+ }
248
+ `},fragment:{header:`
249
+ @in @interpolate(flat) vTextureId: u32;
250
+
251
+ ${zS(l)}
252
+ `,main:`
253
+ var uvDx = dpdx(vUV);
254
+ var uvDy = dpdy(vUV);
255
+
256
+ ${DS(l)}
257
+ `}}),ah[l]}const lh={};function BS(l){const t=[];for(let n=0;n<l;n++)n>0&&t.push("else"),n<l-1&&t.push(`if(vTextureId < ${n}.5)`),t.push("{"),t.push(` outColor = texture(uTextures[${n}], vUV);`),t.push("}");return t.join(`
258
+ `)}function OS(l){return lh[l]||(lh[l]={name:"texture-batch-bit",vertex:{header:`
259
+ in vec2 aTextureIdAndRound;
260
+ out float vTextureId;
261
+
262
+ `,main:`
263
+ vTextureId = aTextureIdAndRound.y;
264
+ `,end:`
265
+ if(aTextureIdAndRound.x == 1.)
266
+ {
267
+ gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
268
+ }
269
+ `},fragment:{header:`
270
+ in float vTextureId;
271
+
272
+ uniform sampler2D uTextures[${l}];
273
+
274
+ `,main:`
275
+
276
+ ${BS(l)}
277
+ `}}),lh[l]}const GS={name:"round-pixels-bit",vertex:{header:`
278
+ fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>
279
+ {
280
+ return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
281
+ }
282
+ `}},kS={name:"round-pixels-bit",vertex:{header:`
283
+ vec2 roundPixels(vec2 position, vec2 targetSize)
284
+ {
285
+ return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
286
+ }
287
+ `}},Ip={};function US(l){let t=Ip[l];if(t)return t;const n=new Int32Array(l);for(let s=0;s<l;s++)n[s]=s;return t=Ip[l]=new c0({uTextures:{value:n,type:"i32",size:l}},{isStatic:!0}),t}class Kp extends jh{constructor(t){const n=MS({name:"batch",bits:[RS,OS(t),kS]}),s=CS({name:"batch",bits:[ES,NS(t),GS]});super({glProgram:n,gpuProgram:s,resources:{batchSamplers:US(t)}}),this.maxTextures=t}}let Ka=null;const B0=class O0 extends aS{constructor(t){super(t),this.geometry=new hS,this.name=O0.extension.name,this.vertexSize=6,Ka??(Ka=new Kp(t.maxTextures)),this.shader=Ka}packAttributes(t,n,s,r,u){const c=u<<16|t.roundPixels&65535,h=t.transform,m=h.a,g=h.b,p=h.c,x=h.d,b=h.tx,_=h.ty,{positions:T,uvs:w}=t,S=t.color,A=t.attributeOffset,C=A+t.attributeSize;for(let E=A;E<C;E++){const G=E*2,P=T[G],k=T[G+1];n[r++]=m*P+p*k+b,n[r++]=x*k+g*P+_,n[r++]=w[G],n[r++]=w[G+1],s[r++]=S,s[r++]=c}}packQuadAttributes(t,n,s,r,u){const c=t.texture,h=t.transform,m=h.a,g=h.b,p=h.c,x=h.d,b=h.tx,_=h.ty,T=t.bounds,w=T.maxX,S=T.minX,A=T.maxY,C=T.minY,E=c.uvs,G=t.color,P=u<<16|t.roundPixels&65535;n[r+0]=m*S+p*C+b,n[r+1]=x*C+g*S+_,n[r+2]=E.x0,n[r+3]=E.y0,s[r+4]=G,s[r+5]=P,n[r+6]=m*w+p*C+b,n[r+7]=x*C+g*w+_,n[r+8]=E.x1,n[r+9]=E.y1,s[r+10]=G,s[r+11]=P,n[r+12]=m*w+p*A+b,n[r+13]=x*A+g*w+_,n[r+14]=E.x2,n[r+15]=E.y2,s[r+16]=G,s[r+17]=P,n[r+18]=m*S+p*A+b,n[r+19]=x*A+g*S+_,n[r+20]=E.x3,n[r+21]=E.y3,s[r+22]=G,s[r+23]=P}_updateMaxTextures(t){this.shader.maxTextures!==t&&(Ka=new Kp(t),this.shader=Ka)}destroy(){this.shader=null,super.destroy()}};B0.extension={type:[yt.Batcher],name:"default"};let jS=B0;class yl{constructor(t){this.items=Object.create(null);const{renderer:n,type:s,onUnload:r,priority:u,name:c}=t;this._renderer=n,n.gc.addResourceHash(this,"items",s,u??0),this._onUnload=r,this.name=c}add(t){return this.items[t.uid]?!1:(this.items[t.uid]=t,t.once("unload",this.remove,this),t._gcLastUsed=this._renderer.gc.now,!0)}remove(t,...n){var r;if(!this.items[t.uid])return;const s=t._gpuData[this._renderer.uid];s&&((r=this._onUnload)==null||r.call(this,t,...n),s.destroy(),t._gpuData[this._renderer.uid]=null,this.items[t.uid]=null)}removeAll(...t){Object.values(this.items).forEach(n=>n&&this.remove(n,...t))}destroy(...t){this.removeAll(...t),this.items=Object.create(null),this._renderer=null,this._onUnload=null}}function HS(l,t,n,s,r,u,c,h=null){let m=0;n*=t,r*=u;const g=h.a,p=h.b,x=h.c,b=h.d,_=h.tx,T=h.ty;for(;m<c;){const w=l[n],S=l[n+1];s[r]=g*w+x*S+_,s[r+1]=p*w+b*S+T,r+=u,n+=t,m++}}function LS(l,t,n,s){let r=0;for(t*=n;r<s;)l[t]=0,l[t+1]=0,t+=n,r++}function G0(l,t,n,s,r){const u=t.a,c=t.b,h=t.c,m=t.d,g=t.tx,p=t.ty;n||(n=0),s||(s=2),r||(r=l.length/s-n);let x=n*s;for(let b=0;b<r;b++){const _=l[x],T=l[x+1];l[x]=u*_+h*T+g,l[x+1]=c*_+m*T+p,x+=s}}const YS=new St;class qh{constructor(){this.packAsQuad=!1,this.batcherName="default",this.topology="triangle-list",this.applyTransform=!0,this.roundPixels=0,this._batcher=null,this._batch=null}get uvs(){return this.geometryData.uvs}get positions(){return this.geometryData.vertices}get indices(){return this.geometryData.indices}get blendMode(){return this.renderable&&this.applyTransform?this.renderable.groupBlendMode:"normal"}get color(){const t=this.baseColor,n=t>>16|t&65280|(t&255)<<16,s=this.renderable;return s?Hy(n,s.groupColor)+(this.alpha*s.groupAlpha*255<<24):n+(this.alpha*255<<24)}get transform(){var t;return((t=this.renderable)==null?void 0:t.groupTransform)||YS}copyTo(t){t.indexOffset=this.indexOffset,t.indexSize=this.indexSize,t.attributeOffset=this.attributeOffset,t.attributeSize=this.attributeSize,t.baseColor=this.baseColor,t.alpha=this.alpha,t.texture=this.texture,t.geometryData=this.geometryData,t.topology=this.topology}reset(){this.applyTransform=!0,this.renderable=null,this.topology="triangle-list"}destroy(){this.renderable=null,this.texture=null,this.geometryData=null,this._batcher=null,this._batch=null}}const gl={extension:{type:yt.ShapeBuilder,name:"circle"},build(l,t){let n,s,r,u,c,h;if(l.type==="circle"){const G=l;if(c=h=G.radius,c<=0)return!1;n=G.x,s=G.y,r=u=0}else if(l.type==="ellipse"){const G=l;if(c=G.halfWidth,h=G.halfHeight,c<=0||h<=0)return!1;n=G.x,s=G.y,r=u=0}else{const G=l,P=G.width/2,k=G.height/2;n=G.x+P,s=G.y+k,c=h=Math.max(0,Math.min(G.radius,Math.min(P,k))),r=P-c,u=k-h}if(r<0||u<0)return!1;const m=Math.ceil(2.3*Math.sqrt(c+h)),g=m*8+(r?4:0)+(u?4:0);if(g===0)return!1;if(m===0)return t[0]=t[6]=n+r,t[1]=t[3]=s+u,t[2]=t[4]=n-r,t[5]=t[7]=s-u,!0;let p=0,x=m*4+(r?2:0)+2,b=x,_=g,T=r+c,w=u,S=n+T,A=n-T,C=s+w;if(t[p++]=S,t[p++]=C,t[--x]=C,t[--x]=A,u){const G=s-w;t[b++]=A,t[b++]=G,t[--_]=G,t[--_]=S}for(let G=1;G<m;G++){const P=Math.PI/2*(G/m),k=r+Math.cos(P)*c,B=u+Math.sin(P)*h,K=n+k,Q=n-k,Z=s+B,I=s-B;t[p++]=K,t[p++]=Z,t[--x]=Z,t[--x]=Q,t[b++]=Q,t[b++]=I,t[--_]=I,t[--_]=K}T=r,w=u+h,S=n+T,A=n-T,C=s+w;const E=s-w;return t[p++]=S,t[p++]=C,t[--_]=E,t[--_]=S,r&&(t[p++]=A,t[p++]=C,t[--_]=E,t[--_]=A),!0},triangulate(l,t,n,s,r,u){if(l.length===0)return;let c=0,h=0;for(let p=0;p<l.length;p+=2)c+=l[p],h+=l[p+1];c/=l.length/2,h/=l.length/2;let m=s;t[m*n]=c,t[m*n+1]=h;const g=m++;for(let p=0;p<l.length;p+=2)t[m*n]=l[p],t[m*n+1]=l[p+1],p>0&&(r[u++]=m,r[u++]=g,r[u++]=m-1),m++;r[u++]=g+1,r[u++]=g,r[u++]=m-1}},qS={...gl,extension:{...gl.extension,name:"ellipse"}},XS={...gl,extension:{...gl.extension,name:"roundedRectangle"}},k0=1e-4,$p=1e-4;function VS(l){const t=l.length;if(t<6)return 1;let n=0;for(let s=0,r=l[t-2],u=l[t-1];s<t;s+=2){const c=l[s],h=l[s+1];n+=(c-r)*(h+u),r=c,u=h}return n<0?-1:1}function Jp(l,t,n,s,r,u,c,h){const m=l-n*r,g=t-s*r,p=l+n*u,x=t+s*u;let b,_;c?(b=s,_=-n):(b=-s,_=n);const T=m+b,w=g+_,S=p+b,A=x+_;return h.push(T,w),h.push(S,A),2}function Vn(l,t,n,s,r,u,c,h){const m=n-l,g=s-t;let p=Math.atan2(m,g),x=Math.atan2(r-l,u-t);h&&p<x?p+=Math.PI*2:!h&&p>x&&(x+=Math.PI*2);let b=p;const _=x-p,T=Math.abs(_),w=Math.sqrt(m*m+g*g),S=(15*T*Math.sqrt(w)/Math.PI>>0)+1,A=_/S;if(b+=A,h){c.push(l,t),c.push(n,s);for(let C=1,E=b;C<S;C++,E+=A)c.push(l,t),c.push(l+Math.sin(E)*w,t+Math.cos(E)*w);c.push(l,t),c.push(r,u)}else{c.push(n,s),c.push(l,t);for(let C=1,E=b;C<S;C++,E+=A)c.push(l+Math.sin(E)*w,t+Math.cos(E)*w),c.push(l,t);c.push(r,u),c.push(l,t)}return S*2}function PS(l,t,n,s,r,u){const c=k0;if(l.length===0)return;const h=t;let m=h.alignment;if(t.alignment!==.5){let $=VS(l);m=(m-.5)*$+.5}const g=new xe(l[0],l[1]),p=new xe(l[l.length-2],l[l.length-1]),x=s,b=Math.abs(g.x-p.x)<c&&Math.abs(g.y-p.y)<c;if(x){l=l.slice(),b&&(l.pop(),l.pop(),p.set(l[l.length-2],l[l.length-1]));const $=(g.x+p.x)*.5,at=(p.y+g.y)*.5;l.unshift($,at),l.push($,at)}const _=r,T=l.length/2;let w=l.length;const S=_.length/2,A=h.width/2,C=A*A,E=h.miterLimit*h.miterLimit;let G=l[0],P=l[1],k=l[2],B=l[3],K=0,Q=0,Z=-(P-B),I=G-k,tt=0,it=0,nt=Math.sqrt(Z*Z+I*I);Z/=nt,I/=nt,Z*=A,I*=A;const wt=m,D=(1-wt)*2,L=wt*2;x||(h.cap==="round"?w+=Vn(G-Z*(D-L)*.5,P-I*(D-L)*.5,G-Z*D,P-I*D,G+Z*L,P+I*L,_,!0)+2:h.cap==="square"&&(w+=Jp(G,P,Z,I,D,L,!0,_))),_.push(G-Z*D,P-I*D),_.push(G+Z*L,P+I*L);for(let $=1;$<T-1;++$){G=l[($-1)*2],P=l[($-1)*2+1],k=l[$*2],B=l[$*2+1],K=l[($+1)*2],Q=l[($+1)*2+1],Z=-(P-B),I=G-k,nt=Math.sqrt(Z*Z+I*I),Z/=nt,I/=nt,Z*=A,I*=A,tt=-(B-Q),it=k-K,nt=Math.sqrt(tt*tt+it*it),tt/=nt,it/=nt,tt*=A,it*=A;const at=k-G,R=P-B,q=k-K,W=Q-B,J=at*q+R*W,rt=R*q-W*at,ct=rt<0;if(Math.abs(rt)<.001*Math.abs(J)){_.push(k-Z*D,B-I*D),_.push(k+Z*L,B+I*L),J>=0&&(h.join==="round"?w+=Vn(k,B,k-Z*D,B-I*D,k-tt*D,B-it*D,_,!1)+4:w+=2,_.push(k-tt*L,B-it*L),_.push(k+tt*D,B+it*D));continue}const dt=(-Z+G)*(-I+B)-(-Z+k)*(-I+P),jt=(-tt+K)*(-it+B)-(-tt+k)*(-it+Q),Et=(at*jt-q*dt)/rt,Fe=(W*dt-R*jt)/rt,Zi=(Et-k)*(Et-k)+(Fe-B)*(Fe-B),ui=k+(Et-k)*D,pi=B+(Fe-B)*D,_e=k-(Et-k)*L,ci=B-(Fe-B)*L,Ks=Math.min(at*at+R*R,q*q+W*W),xl=ct?D:L,_l=Ks+xl*xl*C;Zi<=_l?h.join==="bevel"||Zi/C>E?(ct?(_.push(ui,pi),_.push(k+Z*L,B+I*L),_.push(ui,pi),_.push(k+tt*L,B+it*L)):(_.push(k-Z*D,B-I*D),_.push(_e,ci),_.push(k-tt*D,B-it*D),_.push(_e,ci)),w+=2):h.join==="round"?ct?(_.push(ui,pi),_.push(k+Z*L,B+I*L),w+=Vn(k,B,k+Z*L,B+I*L,k+tt*L,B+it*L,_,!0)+4,_.push(ui,pi),_.push(k+tt*L,B+it*L)):(_.push(k-Z*D,B-I*D),_.push(_e,ci),w+=Vn(k,B,k-Z*D,B-I*D,k-tt*D,B-it*D,_,!1)+4,_.push(k-tt*D,B-it*D),_.push(_e,ci)):(_.push(ui,pi),_.push(_e,ci)):(_.push(k-Z*D,B-I*D),_.push(k+Z*L,B+I*L),h.join==="round"?ct?w+=Vn(k,B,k+Z*L,B+I*L,k+tt*L,B+it*L,_,!0)+2:w+=Vn(k,B,k-Z*D,B-I*D,k-tt*D,B-it*D,_,!1)+2:h.join==="miter"&&Zi/C<=E&&(ct?(_.push(_e,ci),_.push(_e,ci)):(_.push(ui,pi),_.push(ui,pi)),w+=2),_.push(k-tt*D,B-it*D),_.push(k+tt*L,B+it*L),w+=2)}G=l[(T-2)*2],P=l[(T-2)*2+1],k=l[(T-1)*2],B=l[(T-1)*2+1],Z=-(P-B),I=G-k,nt=Math.sqrt(Z*Z+I*I),Z/=nt,I/=nt,Z*=A,I*=A,_.push(k-Z*D,B-I*D),_.push(k+Z*L,B+I*L),x||(h.cap==="round"?w+=Vn(k-Z*(D-L)*.5,B-I*(D-L)*.5,k-Z*D,B-I*D,k+Z*L,B+I*L,_,!1)+2:h.cap==="square"&&(w+=Jp(k,B,Z,I,D,L,!1,_)));const et=$p*$p;for(let $=S;$<w+S-2;++$)G=_[$*2],P=_[$*2+1],k=_[($+1)*2],B=_[($+1)*2+1],K=_[($+2)*2],Q=_[($+2)*2+1],!(Math.abs(G*(B-Q)+k*(Q-P)+K*(P-B))<et)&&u.push($,$+1,$+2)}function FS(l,t,n,s){const r=k0;if(l.length===0)return;const u=l[0],c=l[1],h=l[l.length-2],m=l[l.length-1],g=t||Math.abs(u-h)<r&&Math.abs(c-m)<r,p=n,x=l.length/2,b=p.length/2;for(let _=0;_<x;_++)p.push(l[_*2]),p.push(l[_*2+1]);for(let _=0;_<x-1;_++)s.push(b+_,b+_+1);g&&s.push(b+x-1,b)}function U0(l,t,n,s,r,u,c){const h=Gv(l,t,2);if(!h)return;for(let g=0;g<h.length;g+=3)u[c++]=h[g]+r,u[c++]=h[g+1]+r,u[c++]=h[g+2]+r;let m=r*s;for(let g=0;g<l.length;g+=2)n[m]=l[g],n[m+1]=l[g+1],m+=s}const WS=[],QS={extension:{type:yt.ShapeBuilder,name:"polygon"},build(l,t){for(let n=0;n<l.points.length;n++)t[n]=l.points[n];return!0},triangulate(l,t,n,s,r,u){U0(l,WS,t,n,s,r,u)}},ZS={extension:{type:yt.ShapeBuilder,name:"rectangle"},build(l,t){const n=l,s=n.x,r=n.y,u=n.width,c=n.height;return u>0&&c>0?(t[0]=s,t[1]=r,t[2]=s+u,t[3]=r,t[4]=s+u,t[5]=r+c,t[6]=s,t[7]=r+c,!0):!1},triangulate(l,t,n,s,r,u){let c=0;s*=n,t[s+c]=l[0],t[s+c+1]=l[1],c+=n,t[s+c]=l[2],t[s+c+1]=l[3],c+=n,t[s+c]=l[6],t[s+c+1]=l[7],c+=n,t[s+c]=l[4],t[s+c+1]=l[5],c+=n;const h=s/n;r[u++]=h,r[u++]=h+1,r[u++]=h+2,r[u++]=h+1,r[u++]=h+3,r[u++]=h+2}},IS={extension:{type:yt.ShapeBuilder,name:"triangle"},build(l,t){return t[0]=l.x,t[1]=l.y,t[2]=l.x2,t[3]=l.y2,t[4]=l.x3,t[5]=l.y3,!0},triangulate(l,t,n,s,r,u){let c=0;s*=n,t[s+c]=l[0],t[s+c+1]=l[1],c+=n,t[s+c]=l[2],t[s+c+1]=l[3],c+=n,t[s+c]=l[4],t[s+c+1]=l[5];const h=s/n;r[u++]=h,r[u++]=h+1,r[u++]=h+2}},ty=[{offset:0,color:"white"},{offset:1,color:"black"}],Xh=class wh{constructor(...t){this.uid=Zt("fillGradient"),this._tick=0,this.type="linear",this.colorStops=[];let n=KS(t);n={...n.type==="radial"?wh.defaultRadialOptions:wh.defaultLinearOptions,...Ey(n)},this._textureSize=n.textureSize,this._wrapMode=n.wrapMode,n.type==="radial"?(this.center=n.center,this.outerCenter=n.outerCenter??this.center,this.innerRadius=n.innerRadius,this.outerRadius=n.outerRadius,this.scale=n.scale,this.rotation=n.rotation):(this.start=n.start,this.end=n.end),this.textureSpace=n.textureSpace,this.type=n.type,n.colorStops.forEach(r=>{this.addColorStop(r.offset,r.color)})}addColorStop(t,n){return this.colorStops.push({offset:t,color:ae.shared.setValue(n).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:t,y:n}=this.start,{x:s,y:r}=this.end,u=s-t,c=r-n;const h=u<0||c<0;if(this._wrapMode==="clamp-to-edge"){if(u<0){const S=t;t=s,s=S,u*=-1}if(c<0){const S=n;n=r,r=S,c*=-1}}const m=this.colorStops.length?this.colorStops:ty,g=this._textureSize,{canvas:p,context:x}=iy(g,1),b=h?x.createLinearGradient(this._textureSize,0,0,0):x.createLinearGradient(0,0,this._textureSize,0);ey(b,m),x.fillStyle=b,x.fillRect(0,0,g,1),this.texture=new Gt({source:new io({resource:p,addressMode:this._wrapMode})});const _=Math.sqrt(u*u+c*c),T=Math.atan2(c,u),w=new St;w.scale(_/g,1),w.rotate(T),w.translate(t,n),this.textureSpace==="local"&&w.scale(g,g),this.transform=w}buildGradient(){this.texture||this._tick++,this.type==="linear"?this.buildLinearGradient():this.buildRadialGradient()}buildRadialGradient(){if(this.texture)return;const t=this.colorStops.length?this.colorStops:ty,n=this._textureSize,{canvas:s,context:r}=iy(n,n),{x:u,y:c}=this.center,{x:h,y:m}=this.outerCenter,g=this.innerRadius,p=this.outerRadius,x=h-p,b=m-p,_=n/(p*2),T=(u-x)*_,w=(c-b)*_,S=r.createRadialGradient(T,w,g*_,(h-x)*_,(m-b)*_,p*_);ey(S,t),r.fillStyle=t[t.length-1].color,r.fillRect(0,0,n,n),r.fillStyle=S,r.translate(T,w),r.rotate(this.rotation),r.scale(1,this.scale),r.translate(-T,-w),r.fillRect(0,0,n,n),this.texture=new Gt({source:new io({resource:s,addressMode:this._wrapMode})});const A=new St;A.scale(1/_,1/_),A.translate(x,b),this.textureSpace==="local"&&A.scale(n,n),this.transform=A}destroy(){var t;(t=this.texture)==null||t.destroy(!0),this.texture=null,this.transform=null,this.colorStops=[],this.start=null,this.end=null,this.center=null,this.outerCenter=null}get styleKey(){return`fill-gradient-${this.uid}-${this._tick}`}};Xh.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"};Xh.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};let Wi=Xh;function ey(l,t){for(let n=0;n<t.length;n++){const s=t[n];l.addColorStop(s.offset,s.color)}}function iy(l,t){const n=Pe.get().createCanvas(l,t),s=n.getContext("2d");return{canvas:n,context:s}}function KS(l){let t=l[0]??{};return(typeof t=="number"||l[1])&&(At("8.5.2","use options object instead"),t={type:"linear",start:{x:l[0],y:l[1]},end:{x:l[2],y:l[3]},textureSpace:l[4],textureSize:l[5]??Wi.defaultLinearOptions.textureSize}),t}const $S=new St,JS=new $t;function t2(l,t,n,s){const r=t.matrix?l.copyFrom(t.matrix).invert():l.identity();if(t.textureSpace==="local"){const c=n.getBounds(JS);t.width&&c.pad(t.width);const{x:h,y:m}=c,g=1/c.width,p=1/c.height,x=-h*g,b=-m*p,_=r.a,T=r.b,w=r.c,S=r.d;r.a*=g,r.b*=g,r.c*=p,r.d*=p,r.tx=x*_+b*w+r.tx,r.ty=x*T+b*S+r.ty}else r.translate(t.texture.frame.x,t.texture.frame.y),r.scale(1/t.texture.source.width,1/t.texture.source.height);const u=t.texture.source.style;return!(t.fill instanceof Wi)&&u.addressMode==="clamp-to-edge"&&(u.addressMode="repeat",u.update()),s&&r.append($S.copyFrom(s).invert()),r}const ho={};Jt.handleByMap(yt.ShapeBuilder,ho);Jt.add(ZS,QS,IS,gl,qS,XS);const e2=new $t,i2=new St;function n2(l,t){const{geometryData:n,batches:s}=t;s.length=0,n.indices.length=0,n.vertices.length=0,n.uvs.length=0;for(let r=0;r<l.instructions.length;r++){const u=l.instructions[r];if(u.action==="texture")s2(u.data,s,n);else if(u.action==="fill"||u.action==="stroke"){const c=u.action==="stroke",h=u.data.path.shapePath,m=u.data.style,g=u.data.hole;c&&g&&ny(g.shapePath,m,!0,s,n),g&&(h.shapePrimitives[h.shapePrimitives.length-1].holes=g.shapePath.shapePrimitives),ny(h,m,c,s,n)}}}function s2(l,t,n){const s=[],r=ho.rectangle,u=e2;u.x=l.dx,u.y=l.dy,u.width=l.dw,u.height=l.dh;const c=l.transform;if(!r.build(u,s))return;const{vertices:h,uvs:m,indices:g}=n,p=g.length,x=h.length/2;c&&G0(s,c),r.triangulate(s,h,2,x,g,p);const b=l.image,_=b.uvs;m.push(_.x0,_.y0,_.x1,_.y1,_.x3,_.y3,_.x2,_.y2);const T=Ne.get(qh);T.indexOffset=p,T.indexSize=g.length-p,T.attributeOffset=x,T.attributeSize=h.length/2-x,T.baseColor=l.style,T.alpha=l.alpha,T.texture=b,T.geometryData=n,t.push(T)}function ny(l,t,n,s,r){const{vertices:u,uvs:c,indices:h}=r;l.shapePrimitives.forEach(({shape:m,transform:g,holes:p})=>{const x=[],b=ho[m.type];if(!b.build(m,x))return;const _=h.length,T=u.length/2;let w="triangle-list";if(g&&G0(x,g),n){const E=m.closePath??!0,G=t;G.pixelLine?(FS(x,E,u,h),w="line-list"):PS(x,G,!1,E,u,h)}else if(p){const E=[],G=x.slice();a2(p).forEach(k=>{E.push(G.length/2),G.push(...k)}),U0(G,E,u,2,T,h,_)}else b.triangulate(x,u,2,T,h,_);const S=c.length/2,A=t.texture;if(A!==Gt.WHITE){const E=t2(i2,t,m,g);HS(u,2,T,c,S,2,u.length/2-T,E)}else LS(c,S,2,u.length/2-T);const C=Ne.get(qh);C.indexOffset=_,C.indexSize=h.length-_,C.attributeOffset=T,C.attributeSize=u.length/2-T,C.baseColor=t.color,C.alpha=t.alpha,C.texture=A,C.geometryData=r,C.topology=w,s.push(C)})}function a2(l){const t=[];for(let n=0;n<l.length;n++){const s=l[n].shape,r=[];ho[s.type].build(s,r)&&t.push(r)}return t}class l2{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]}}reset(){this.batches&&this.batches.forEach(t=>{Ne.return(t)}),this.graphicsData&&Ne.return(this.graphicsData),this.isBatchable=!1,this.context=null,this.batches.length=0,this.geometryData.indices.length=0,this.geometryData.vertices.length=0,this.geometryData.uvs.length=0,this.graphicsData=null}destroy(){this.reset(),this.batches=null,this.geometryData=null}}class r2{constructor(){this.instructions=new Gh}init(t){const n=t.maxTextures;this.batcher?this.batcher._updateMaxTextures(n):this.batcher=new jS({maxTextures:n}),this.instructions.reset()}get geometry(){return At(nb,"GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead."),this.batcher.geometry}destroy(){this.batcher.destroy(),this.instructions.destroy(),this.batcher=null,this.instructions=null}}const Vh=class Ah{constructor(t){this._renderer=t,this._managedContexts=new yl({renderer:t,type:"resource",name:"graphicsContext"})}init(t){Ah.defaultOptions.bezierSmoothness=(t==null?void 0:t.bezierSmoothness)??Ah.defaultOptions.bezierSmoothness}getContextRenderData(t){return t._gpuData[this._renderer.uid].graphicsData||this._initContextRenderData(t)}updateGpuContext(t){const n=!!t._gpuData[this._renderer.uid],s=t._gpuData[this._renderer.uid]||this._initContext(t);if(t.dirty||!n){n&&s.reset(),n2(t,s);const r=t.batchMode;t.customShader||r==="no-batch"?s.isBatchable=!1:r==="auto"?s.isBatchable=s.geometryData.vertices.length<400:s.isBatchable=!0,t.dirty=!1}return s}getGpuContext(t){return t._gpuData[this._renderer.uid]||this._initContext(t)}_initContextRenderData(t){const n=Ne.get(r2,{maxTextures:this._renderer.limits.maxBatchableTextures}),s=t._gpuData[this._renderer.uid],{batches:r,geometryData:u}=s;s.graphicsData=n;const c=u.vertices.length,h=u.indices.length;for(let x=0;x<r.length;x++)r[x].applyTransform=!1;const m=n.batcher;m.ensureAttributeBuffer(c),m.ensureIndexBuffer(h),m.begin();for(let x=0;x<r.length;x++){const b=r[x];m.add(b)}m.finish(n.instructions);const g=m.geometry;g.indexBuffer.setDataWithSize(m.indexBuffer,m.indexSize,!0),g.buffers[0].setDataWithSize(m.attributeBuffer.float32View,m.attributeSize,!0);const p=m.batches;for(let x=0;x<p.length;x++){const b=p[x];b.bindGroup=Zv(b.textures.textures,b.textures.count,this._renderer.limits.maxBatchableTextures)}return n}_initContext(t){const n=new l2;return n.context=t,t._gpuData[this._renderer.uid]=n,this._managedContexts.add(t),n}destroy(){this._managedContexts.destroy(),this._renderer=null}};Vh.extension={type:[yt.WebGLSystem,yt.WebGPUSystem],name:"graphicsContext"};Vh.defaultOptions={bezierSmoothness:.5};let Ph=Vh;const o2=8,Kr=11920929e-14,u2=1;function j0(l,t,n,s,r,u,c,h,m,g){const x=Math.min(.99,Math.max(0,g??Ph.defaultOptions.bezierSmoothness));let b=(u2-x)/1;return b*=b,c2(t,n,s,r,u,c,h,m,l,b),l}function c2(l,t,n,s,r,u,c,h,m,g){Ch(l,t,n,s,r,u,c,h,m,g,0),m.push(c,h)}function Ch(l,t,n,s,r,u,c,h,m,g,p){if(p>o2)return;const x=(l+n)/2,b=(t+s)/2,_=(n+r)/2,T=(s+u)/2,w=(r+c)/2,S=(u+h)/2,A=(x+_)/2,C=(b+T)/2,E=(_+w)/2,G=(T+S)/2,P=(A+E)/2,k=(C+G)/2;if(p>0){let B=c-l,K=h-t;const Q=Math.abs((n-c)*K-(s-h)*B),Z=Math.abs((r-c)*K-(u-h)*B);if(Q>Kr&&Z>Kr){if((Q+Z)*(Q+Z)<=g*(B*B+K*K)){m.push(P,k);return}}else if(Q>Kr){if(Q*Q<=g*(B*B+K*K)){m.push(P,k);return}}else if(Z>Kr){if(Z*Z<=g*(B*B+K*K)){m.push(P,k);return}}else if(B=P-(l+c)/2,K=k-(t+h)/2,B*B+K*K<=g){m.push(P,k);return}}Ch(l,t,x,b,A,C,P,k,m,g,p+1),Ch(P,k,E,G,w,S,c,h,m,g,p+1)}const h2=8,f2=11920929e-14,d2=1;function m2(l,t,n,s,r,u,c,h){const g=Math.min(.99,Math.max(0,h??Ph.defaultOptions.bezierSmoothness));let p=(d2-g)/1;return p*=p,g2(t,n,s,r,u,c,l,p),l}function g2(l,t,n,s,r,u,c,h){Mh(c,l,t,n,s,r,u,h,0),c.push(r,u)}function Mh(l,t,n,s,r,u,c,h,m){if(m>h2)return;const g=(t+s)/2,p=(n+r)/2,x=(s+u)/2,b=(r+c)/2,_=(g+x)/2,T=(p+b)/2;let w=u-t,S=c-n;const A=Math.abs((s-u)*S-(r-c)*w);if(A>f2){if(A*A<=h*(w*w+S*S)){l.push(_,T);return}}else if(w=_-(t+u)/2,S=T-(n+c)/2,w*w+S*S<=h){l.push(_,T);return}Mh(l,t,n,g,p,_,T,h,m+1),Mh(l,_,T,x,b,u,c,h,m+1)}function H0(l,t,n,s,r,u,c,h){let m=Math.abs(r-u);(!c&&r>u||c&&u>r)&&(m=2*Math.PI-m),h||(h=Math.max(6,Math.floor(6*Math.pow(s,1/3)*(m/Math.PI)))),h=Math.max(h,3);let g=m/h,p=r;g*=c?-1:1;for(let x=0;x<h+1;x++){const b=Math.cos(p),_=Math.sin(p),T=t+b*s,w=n+_*s;l.push(T,w),p+=g}}function p2(l,t,n,s,r,u){const c=l[l.length-2],m=l[l.length-1]-n,g=c-t,p=r-n,x=s-t,b=Math.abs(m*x-g*p);if(b<1e-8||u===0){(l[l.length-2]!==t||l[l.length-1]!==n)&&l.push(t,n);return}const _=m*m+g*g,T=p*p+x*x,w=m*p+g*x,S=u*Math.sqrt(_)/b,A=u*Math.sqrt(T)/b,C=S*w/_,E=A*w/T,G=S*x+A*g,P=S*p+A*m,k=g*(A+C),B=m*(A+C),K=x*(S+E),Q=p*(S+E),Z=Math.atan2(B-P,k-G),I=Math.atan2(Q-P,K-G);H0(l,G+t,P+n,u,Z,I,g*p>x*m)}const ol=Math.PI*2,rh={centerX:0,centerY:0,ang1:0,ang2:0},oh=({x:l,y:t},n,s,r,u,c,h,m)=>{l*=n,t*=s;const g=r*l-u*t,p=u*l+r*t;return m.x=g+c,m.y=p+h,m};function y2(l,t){const n=t===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(t/4),s=t===1.5707963267948966?.551915024494:n,r=Math.cos(l),u=Math.sin(l),c=Math.cos(l+t),h=Math.sin(l+t);return[{x:r-u*s,y:u+r*s},{x:c+h*s,y:h-c*s},{x:c,y:h}]}const sy=(l,t,n,s)=>{const r=l*s-t*n<0?-1:1;let u=l*n+t*s;return u>1&&(u=1),u<-1&&(u=-1),r*Math.acos(u)},x2=(l,t,n,s,r,u,c,h,m,g,p,x,b)=>{const _=Math.pow(r,2),T=Math.pow(u,2),w=Math.pow(p,2),S=Math.pow(x,2);let A=_*T-_*S-T*w;A<0&&(A=0),A/=_*S+T*w,A=Math.sqrt(A)*(c===h?-1:1);const C=A*r/u*x,E=A*-u/r*p,G=g*C-m*E+(l+n)/2,P=m*C+g*E+(t+s)/2,k=(p-C)/r,B=(x-E)/u,K=(-p-C)/r,Q=(-x-E)/u,Z=sy(1,0,k,B);let I=sy(k,B,K,Q);h===0&&I>0&&(I-=ol),h===1&&I<0&&(I+=ol),b.centerX=G,b.centerY=P,b.ang1=Z,b.ang2=I};function _2(l,t,n,s,r,u,c,h=0,m=0,g=0){if(u===0||c===0)return;const p=Math.sin(h*ol/360),x=Math.cos(h*ol/360),b=x*(t-s)/2+p*(n-r)/2,_=-p*(t-s)/2+x*(n-r)/2;if(b===0&&_===0)return;u=Math.abs(u),c=Math.abs(c);const T=Math.pow(b,2)/Math.pow(u,2)+Math.pow(_,2)/Math.pow(c,2);T>1&&(u*=Math.sqrt(T),c*=Math.sqrt(T)),x2(t,n,s,r,u,c,m,g,p,x,b,_,rh);let{ang1:w,ang2:S}=rh;const{centerX:A,centerY:C}=rh;let E=Math.abs(S)/(ol/4);Math.abs(1-E)<1e-7&&(E=1);const G=Math.max(Math.ceil(E),1);S/=G;let P=l[l.length-2],k=l[l.length-1];const B={x:0,y:0};for(let K=0;K<G;K++){const Q=y2(w,S),{x:Z,y:I}=oh(Q[0],u,c,x,p,A,C,B),{x:tt,y:it}=oh(Q[1],u,c,x,p,A,C,B),{x:nt,y:wt}=oh(Q[2],u,c,x,p,A,C,B);j0(l,P,k,Z,I,tt,it,nt,wt),P=nt,k=wt,w+=S}}function b2(l,t,n){const s=(c,h)=>{const m=h.x-c.x,g=h.y-c.y,p=Math.sqrt(m*m+g*g),x=m/p,b=g/p;return{len:p,nx:x,ny:b}},r=(c,h)=>{c===0?l.moveTo(h.x,h.y):l.lineTo(h.x,h.y)};let u=t[t.length-1];for(let c=0;c<t.length;c++){const h=t[c%t.length],m=h.radius??n;if(m<=0){r(c,h),u=h;continue}const g=t[(c+1)%t.length],p=s(h,u),x=s(h,g);if(p.len<1e-4||x.len<1e-4){r(c,h),u=h;continue}let b=Math.asin(p.nx*x.ny-p.ny*x.nx),_=1,T=!1;p.nx*x.nx-p.ny*-x.ny<0?b<0?b=Math.PI+b:(b=Math.PI-b,_=-1,T=!0):b>0&&(_=-1,T=!0);const w=b/2;let S,A=Math.abs(Math.cos(w)*m/Math.sin(w));A>Math.min(p.len/2,x.len/2)?(A=Math.min(p.len/2,x.len/2),S=Math.abs(A*Math.sin(w)/Math.cos(w))):S=m;const C=h.x+x.nx*A+-x.ny*S*_,E=h.y+x.ny*A+x.nx*S*_,G=Math.atan2(p.ny,p.nx)+Math.PI/2*_,P=Math.atan2(x.ny,x.nx)-Math.PI/2*_;c===0&&l.moveTo(C+Math.cos(G)*S,E+Math.sin(G)*S),l.arc(C,E,S,G,P,T),u=h}}function v2(l,t,n,s){const r=(h,m)=>Math.sqrt((h.x-m.x)**2+(h.y-m.y)**2),u=(h,m,g)=>({x:h.x+(m.x-h.x)*g,y:h.y+(m.y-h.y)*g}),c=t.length;for(let h=0;h<c;h++){const m=t[(h+1)%c],g=m.radius??n;if(g<=0){h===0?l.moveTo(m.x,m.y):l.lineTo(m.x,m.y);continue}const p=t[h],x=t[(h+2)%c],b=r(p,m);let _;if(b<1e-4)_=m;else{const S=Math.min(b/2,g);_=u(m,p,S/b)}const T=r(x,m);let w;if(T<1e-4)w=m;else{const S=Math.min(T/2,g);w=u(m,x,S/T)}h===0?l.moveTo(_.x,_.y):l.lineTo(_.x,_.y),l.quadraticCurveTo(m.x,m.y,w.x,w.y,s)}}const S2=new $t;class T2{constructor(t){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new ri,this._graphicsPath2D=t,this.signed=t.checkForHoles}moveTo(t,n){return this.startPoly(t,n),this}lineTo(t,n){this._ensurePoly();const s=this._currentPoly.points,r=s[s.length-2],u=s[s.length-1];return(r!==t||u!==n)&&s.push(t,n),this}arc(t,n,s,r,u,c){this._ensurePoly(!1);const h=this._currentPoly.points;return H0(h,t,n,s,r,u,c),this}arcTo(t,n,s,r,u){this._ensurePoly();const c=this._currentPoly.points;return p2(c,t,n,s,r,u),this}arcToSvg(t,n,s,r,u,c,h){const m=this._currentPoly.points;return _2(m,this._currentPoly.lastX,this._currentPoly.lastY,c,h,t,n,s,r,u),this}bezierCurveTo(t,n,s,r,u,c,h){this._ensurePoly();const m=this._currentPoly;return j0(this._currentPoly.points,m.lastX,m.lastY,t,n,s,r,u,c,h),this}quadraticCurveTo(t,n,s,r,u){this._ensurePoly();const c=this._currentPoly;return m2(this._currentPoly.points,c.lastX,c.lastY,t,n,s,r,u),this}closePath(){return this.endPoly(!0),this}addPath(t,n){this.endPoly(),n&&!n.isIdentity()&&(t=t.clone(!0),t.transform(n));const s=this.shapePrimitives,r=s.length;for(let u=0;u<t.instructions.length;u++){const c=t.instructions[u];this[c.action](...c.data)}if(t.checkForHoles&&s.length-r>1){let u=null;for(let c=r;c<s.length;c++){const h=s[c];if(h.shape.type==="polygon"){const m=h.shape,g=u==null?void 0:u.shape;g&&g.containsPolygon(m)?(u.holes||(u.holes=[]),u.holes.push(h),s.copyWithin(c,c+1),s.length--,c--):u=h}}}return this}finish(t=!1){this.endPoly(t)}rect(t,n,s,r,u){return this.drawShape(new $t(t,n,s,r),u),this}circle(t,n,s,r){return this.drawShape(new Hh(t,n,s),r),this}poly(t,n,s){const r=new ll(t);return r.closePath=n,this.drawShape(r,s),this}regularPoly(t,n,s,r,u=0,c){r=Math.max(r|0,3);const h=-1*Math.PI/2+u,m=Math.PI*2/r,g=[];for(let p=0;p<r;p++){const x=h-p*m;g.push(t+s*Math.cos(x),n+s*Math.sin(x))}return this.poly(g,!0,c),this}roundPoly(t,n,s,r,u,c=0,h){if(r=Math.max(r|0,3),u<=0)return this.regularPoly(t,n,s,r,c);const m=s*Math.sin(Math.PI/r)-.001;u=Math.min(u,m);const g=-1*Math.PI/2+c,p=Math.PI*2/r,x=(r-2)*Math.PI/r/2;for(let b=0;b<r;b++){const _=b*p+g,T=t+s*Math.cos(_),w=n+s*Math.sin(_),S=_+Math.PI+x,A=_-Math.PI-x,C=T+u*Math.cos(S),E=w+u*Math.sin(S),G=T+u*Math.cos(A),P=w+u*Math.sin(A);b===0?this.moveTo(C,E):this.lineTo(C,E),this.quadraticCurveTo(T,w,G,P,h)}return this.closePath()}roundShape(t,n,s=!1,r){return t.length<3?this:(s?v2(this,t,n,r):b2(this,t,n),this.closePath())}filletRect(t,n,s,r,u){if(u===0)return this.rect(t,n,s,r);const c=Math.min(s,r)/2,h=Math.min(c,Math.max(-c,u)),m=t+s,g=n+r,p=h<0?-h:0,x=Math.abs(h);return this.moveTo(t,n+x).arcTo(t+p,n+p,t+x,n,x).lineTo(m-x,n).arcTo(m-p,n+p,m,n+x,x).lineTo(m,g-x).arcTo(m-p,g-p,t+s-x,g,x).lineTo(t+x,g).arcTo(t+p,g-p,t,g-x,x).closePath()}chamferRect(t,n,s,r,u,c){if(u<=0)return this.rect(t,n,s,r);const h=Math.min(u,Math.min(s,r)/2),m=t+s,g=n+r,p=[t+h,n,m-h,n,m,n+h,m,g-h,m-h,g,t+h,g,t,g-h,t,n+h];for(let x=p.length-1;x>=2;x-=2)p[x]===p[x-2]&&p[x-1]===p[x-3]&&p.splice(x-1,2);return this.poly(p,!0,c)}ellipse(t,n,s,r,u){return this.drawShape(new Lh(t,n,s,r),u),this}roundRect(t,n,s,r,u,c){return this.drawShape(new Yh(t,n,s,r,u),c),this}drawShape(t,n){return this.endPoly(),this.shapePrimitives.push({shape:t,transform:n}),this}startPoly(t,n){let s=this._currentPoly;return s&&this.endPoly(),s=new ll,s.points.push(t,n),this._currentPoly=s,this}endPoly(t=!1){const n=this._currentPoly;return n&&n.points.length>2&&(n.closePath=t,this.shapePrimitives.push({shape:n})),this._currentPoly=null,this}_ensurePoly(t=!0){if(!this._currentPoly&&(this._currentPoly=new ll,t)){const n=this.shapePrimitives[this.shapePrimitives.length-1];if(n){let s=n.shape.x,r=n.shape.y;if(n.transform&&!n.transform.isIdentity()){const u=n.transform,c=s;s=u.a*s+u.c*r+u.tx,r=u.b*c+u.d*r+u.ty}this._currentPoly.points.push(s,r)}else this._currentPoly.points.push(0,0)}}buildPath(){const t=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let n=0;n<t.instructions.length;n++){const s=t.instructions[n];this[s.action](...s.data)}this.finish()}get bounds(){const t=this._bounds;t.clear();const n=this.shapePrimitives;for(let s=0;s<n.length;s++){const r=n[s],u=r.shape.getBounds(S2);r.transform?t.addRect(u,r.transform):t.addRect(u)}return t}}class Fi{constructor(t,n=!1){this.instructions=[],this.uid=Zt("graphicsPath"),this._dirty=!0,this.checkForHoles=n,typeof t=="string"?Pv(t,this):this.instructions=(t==null?void 0:t.slice())??[]}get shapePath(){return this._shapePath||(this._shapePath=new T2(this)),this._dirty&&(this._dirty=!1,this._shapePath.buildPath()),this._shapePath}addPath(t,n){return t=t.clone(),this.instructions.push({action:"addPath",data:[t,n]}),this._dirty=!0,this}arc(...t){return this.instructions.push({action:"arc",data:t}),this._dirty=!0,this}arcTo(...t){return this.instructions.push({action:"arcTo",data:t}),this._dirty=!0,this}arcToSvg(...t){return this.instructions.push({action:"arcToSvg",data:t}),this._dirty=!0,this}bezierCurveTo(...t){return this.instructions.push({action:"bezierCurveTo",data:t}),this._dirty=!0,this}bezierCurveToShort(t,n,s,r,u){const c=this.instructions[this.instructions.length-1],h=this.getLastPoint(xe.shared);let m=0,g=0;if(!c||c.action!=="bezierCurveTo")m=h.x,g=h.y;else{m=c.data[2],g=c.data[3];const p=h.x,x=h.y;m=p+(p-m),g=x+(x-g)}return this.instructions.push({action:"bezierCurveTo",data:[m,g,t,n,s,r,u]}),this._dirty=!0,this}closePath(){return this.instructions.push({action:"closePath",data:[]}),this._dirty=!0,this}ellipse(...t){return this.instructions.push({action:"ellipse",data:t}),this._dirty=!0,this}lineTo(...t){return this.instructions.push({action:"lineTo",data:t}),this._dirty=!0,this}moveTo(...t){return this.instructions.push({action:"moveTo",data:t}),this}quadraticCurveTo(...t){return this.instructions.push({action:"quadraticCurveTo",data:t}),this._dirty=!0,this}quadraticCurveToShort(t,n,s){const r=this.instructions[this.instructions.length-1],u=this.getLastPoint(xe.shared);let c=0,h=0;if(!r||r.action!=="quadraticCurveTo")c=u.x,h=u.y;else{c=r.data[0],h=r.data[1];const m=u.x,g=u.y;c=m+(m-c),h=g+(g-h)}return this.instructions.push({action:"quadraticCurveTo",data:[c,h,t,n,s]}),this._dirty=!0,this}rect(t,n,s,r,u){return this.instructions.push({action:"rect",data:[t,n,s,r,u]}),this._dirty=!0,this}circle(t,n,s,r){return this.instructions.push({action:"circle",data:[t,n,s,r]}),this._dirty=!0,this}roundRect(...t){return this.instructions.push({action:"roundRect",data:t}),this._dirty=!0,this}poly(...t){return this.instructions.push({action:"poly",data:t}),this._dirty=!0,this}regularPoly(...t){return this.instructions.push({action:"regularPoly",data:t}),this._dirty=!0,this}roundPoly(...t){return this.instructions.push({action:"roundPoly",data:t}),this._dirty=!0,this}roundShape(...t){return this.instructions.push({action:"roundShape",data:t}),this._dirty=!0,this}filletRect(...t){return this.instructions.push({action:"filletRect",data:t}),this._dirty=!0,this}chamferRect(...t){return this.instructions.push({action:"chamferRect",data:t}),this._dirty=!0,this}star(t,n,s,r,u,c,h){u||(u=r/2);const m=-1*Math.PI/2+c,g=s*2,p=Math.PI*2/g,x=[];for(let b=0;b<g;b++){const _=b%2?u:r,T=b*p+m;x.push(t+_*Math.cos(T),n+_*Math.sin(T))}return this.poly(x,!0,h),this}clone(t=!1){const n=new Fi;if(n.checkForHoles=this.checkForHoles,!t)n.instructions=this.instructions.slice();else for(let s=0;s<this.instructions.length;s++){const r=this.instructions[s];n.instructions.push({action:r.action,data:r.data.slice()})}return n}clear(){return this.instructions.length=0,this._dirty=!0,this}transform(t){if(t.isIdentity())return this;const n=t.a,s=t.b,r=t.c,u=t.d,c=t.tx,h=t.ty;let m=0,g=0,p=0,x=0,b=0,_=0,T=0,w=0;for(let S=0;S<this.instructions.length;S++){const A=this.instructions[S],C=A.data;switch(A.action){case"moveTo":case"lineTo":m=C[0],g=C[1],C[0]=n*m+r*g+c,C[1]=s*m+u*g+h;break;case"bezierCurveTo":p=C[0],x=C[1],b=C[2],_=C[3],m=C[4],g=C[5],C[0]=n*p+r*x+c,C[1]=s*p+u*x+h,C[2]=n*b+r*_+c,C[3]=s*b+u*_+h,C[4]=n*m+r*g+c,C[5]=s*m+u*g+h;break;case"quadraticCurveTo":p=C[0],x=C[1],m=C[2],g=C[3],C[0]=n*p+r*x+c,C[1]=s*p+u*x+h,C[2]=n*m+r*g+c,C[3]=s*m+u*g+h;break;case"arcToSvg":m=C[5],g=C[6],T=C[0],w=C[1],C[0]=n*T+r*w,C[1]=s*T+u*w,C[5]=n*m+r*g+c,C[6]=s*m+u*g+h;break;case"circle":C[4]=$a(C[3],t);break;case"rect":C[4]=$a(C[4],t);break;case"ellipse":C[8]=$a(C[8],t);break;case"roundRect":C[5]=$a(C[5],t);break;case"addPath":C[0].transform(t);break;case"poly":C[2]=$a(C[2],t);break;default:Se("unknown transform action",A.action);break}}return this._dirty=!0,this}get bounds(){return this.shapePath.bounds}getLastPoint(t){let n=this.instructions.length-1,s=this.instructions[n];if(!s)return t.x=0,t.y=0,t;for(;s.action==="closePath";){if(n--,n<0)return t.x=0,t.y=0,t;s=this.instructions[n]}switch(s.action){case"moveTo":case"lineTo":t.x=s.data[0],t.y=s.data[1];break;case"quadraticCurveTo":t.x=s.data[2],t.y=s.data[3];break;case"bezierCurveTo":t.x=s.data[4],t.y=s.data[5];break;case"arc":case"arcToSvg":t.x=s.data[5],t.y=s.data[6];break;case"addPath":s.data[0].getLastPoint(t);break}return t}}function $a(l,t){return l?l.prepend(t):t.clone()}function Wt(l,t,n){const s=l.getAttribute(t);return s?Number(s):n}function w2(l,t){const n=l.querySelectorAll("defs");for(let s=0;s<n.length;s++){const r=n[s];for(let u=0;u<r.children.length;u++){const c=r.children[u];switch(c.nodeName.toLowerCase()){case"lineargradient":t.defs[c.id]=A2(c);break;case"radialgradient":t.defs[c.id]=C2();break}}}}function A2(l){const t=Wt(l,"x1",0),n=Wt(l,"y1",0),s=Wt(l,"x2",1),r=Wt(l,"y2",0),u=l.getAttribute("gradientUnits")||"objectBoundingBox",c=new Wi(t,n,s,r,u==="objectBoundingBox"?"local":"global");for(let h=0;h<l.children.length;h++){const m=l.children[h],g=Wt(m,"offset",0),p=ae.shared.setValue(m.getAttribute("stop-color")).toNumber();c.addColorStop(g,p)}return c}function C2(l){return Se("[SVG Parser] Radial gradients are not yet supported"),new Wi(0,0,1,0)}function ay(l){const t=l.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return t?t[1]:""}const ly={fill:{type:"paint",default:0},"fill-opacity":{type:"number",default:1},stroke:{type:"paint",default:0},"stroke-width":{type:"number",default:1},"stroke-opacity":{type:"number",default:1},"stroke-linecap":{type:"string",default:"butt"},"stroke-linejoin":{type:"string",default:"miter"},"stroke-miterlimit":{type:"number",default:10},"stroke-dasharray":{type:"string",default:"none"},"stroke-dashoffset":{type:"number",default:0},opacity:{type:"number",default:1}};function L0(l,t){const n=l.getAttribute("style"),s={},r={},u={strokeStyle:s,fillStyle:r,useFill:!1,useStroke:!1};for(const c in ly){const h=l.getAttribute(c);h&&ry(t,u,c,h.trim())}if(n){const c=n.split(";");for(let h=0;h<c.length;h++){const m=c[h].trim(),[g,p]=m.split(":");ly[g]&&ry(t,u,g,p.trim())}}return{strokeStyle:u.useStroke?s:null,fillStyle:u.useFill?r:null,useFill:u.useFill,useStroke:u.useStroke}}function ry(l,t,n,s){switch(n){case"stroke":if(s!=="none"){if(s.startsWith("url(")){const r=ay(s);t.strokeStyle.fill=l.defs[r]}else t.strokeStyle.color=ae.shared.setValue(s).toNumber();t.useStroke=!0}break;case"stroke-width":t.strokeStyle.width=Number(s);break;case"fill":if(s!=="none"){if(s.startsWith("url(")){const r=ay(s);t.fillStyle.fill=l.defs[r]}else t.fillStyle.color=ae.shared.setValue(s).toNumber();t.useFill=!0}break;case"fill-opacity":t.fillStyle.alpha=Number(s);break;case"stroke-opacity":t.strokeStyle.alpha=Number(s);break;case"opacity":t.fillStyle.alpha=Number(s),t.strokeStyle.alpha=Number(s);break}}function M2(l){if(l.length<=2)return!0;const t=l.map(h=>h.area).sort((h,m)=>m-h),[n,s]=t,r=t[t.length-1],u=n/s,c=s/r;return!(u>3&&c<2)}function E2(l){return l.split(/(?=[Mm])/).filter(s=>s.trim().length>0)}function R2(l){const t=l.match(/[-+]?[0-9]*\.?[0-9]+/g);if(!t||t.length<4)return 0;const n=t.map(Number),s=[],r=[];for(let p=0;p<n.length;p+=2)p+1<n.length&&(s.push(n[p]),r.push(n[p+1]));if(s.length===0||r.length===0)return 0;const u=Math.min(...s),c=Math.max(...s),h=Math.min(...r),m=Math.max(...r);return(c-u)*(m-h)}function oy(l,t){const n=new Fi(l,!1);for(const s of n.instructions)t.instructions.push(s)}function z2(l,t){if(typeof l=="string"){const c=document.createElement("div");c.innerHTML=l.trim(),l=c.querySelector("svg")}const n={context:t,defs:{},path:new Fi};w2(l,n);const s=l.children,{fillStyle:r,strokeStyle:u}=L0(l,n);for(let c=0;c<s.length;c++){const h=s[c];h.nodeName.toLowerCase()!=="defs"&&Y0(h,n,r,u)}return t}function Y0(l,t,n,s){const r=l.children,{fillStyle:u,strokeStyle:c}=L0(l,t);u&&n?n={...n,...u}:u&&(n=u),c&&s?s={...s,...c}:c&&(s=c);const h=!n&&!s;h&&(n={color:0});let m,g,p,x,b,_,T,w,S,A,C,E,G,P,k,B,K;switch(l.nodeName.toLowerCase()){case"path":{P=l.getAttribute("d");const Q=l.getAttribute("fill-rule"),Z=E2(P),I=Q==="evenodd",tt=Z.length>1;if(I&&tt){const nt=Z.map(D=>({path:D,area:R2(D)}));if(nt.sort((D,L)=>L.area-D.area),Z.length>3||!M2(nt))for(let D=0;D<nt.length;D++){const L=nt[D],et=D===0;t.context.beginPath();const $=new Fi(void 0,!0);oy(L.path,$),t.context.path($),et?(n&&t.context.fill(n),s&&t.context.stroke(s)):t.context.cut()}else for(let D=0;D<nt.length;D++){const L=nt[D],et=D%2===1;t.context.beginPath();const $=new Fi(void 0,!0);oy(L.path,$),t.context.path($),et?t.context.cut():(n&&t.context.fill(n),s&&t.context.stroke(s))}}else{const nt=Q?Q==="evenodd":!0;k=new Fi(P,nt),t.context.path(k),n&&t.context.fill(n),s&&t.context.stroke(s)}break}case"circle":T=Wt(l,"cx",0),w=Wt(l,"cy",0),S=Wt(l,"r",0),t.context.ellipse(T,w,S,S),n&&t.context.fill(n),s&&t.context.stroke(s);break;case"rect":m=Wt(l,"x",0),g=Wt(l,"y",0),B=Wt(l,"width",0),K=Wt(l,"height",0),A=Wt(l,"rx",0),C=Wt(l,"ry",0),A||C?t.context.roundRect(m,g,B,K,A||C):t.context.rect(m,g,B,K),n&&t.context.fill(n),s&&t.context.stroke(s);break;case"ellipse":T=Wt(l,"cx",0),w=Wt(l,"cy",0),A=Wt(l,"rx",0),C=Wt(l,"ry",0),t.context.beginPath(),t.context.ellipse(T,w,A,C),n&&t.context.fill(n),s&&t.context.stroke(s);break;case"line":p=Wt(l,"x1",0),x=Wt(l,"y1",0),b=Wt(l,"x2",0),_=Wt(l,"y2",0),t.context.beginPath(),t.context.moveTo(p,x),t.context.lineTo(b,_),s&&t.context.stroke(s);break;case"polygon":G=l.getAttribute("points"),E=G.match(/-?\d+/g).map(Q=>parseInt(Q,10)),t.context.poly(E,!0),n&&t.context.fill(n),s&&t.context.stroke(s);break;case"polyline":G=l.getAttribute("points"),E=G.match(/-?\d+/g).map(Q=>parseInt(Q,10)),t.context.poly(E,!1),s&&t.context.stroke(s);break;case"g":case"svg":break;default:{Se(`[SVG parser] <${l.nodeName}> elements unsupported`);break}}h&&(n=null);for(let Q=0;Q<r.length;Q++)Y0(r[Q],t,n,s)}const uy={repeat:{addressModeU:"repeat",addressModeV:"repeat"},"repeat-x":{addressModeU:"repeat",addressModeV:"clamp-to-edge"},"repeat-y":{addressModeU:"clamp-to-edge",addressModeV:"repeat"},"no-repeat":{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}};class fo{constructor(t,n){this.uid=Zt("fillPattern"),this._tick=0,this.transform=new St,this.texture=t,this.transform.scale(1/t.frame.width,1/t.frame.height),n&&(t.source.style.addressModeU=uy[n].addressModeU,t.source.style.addressModeV=uy[n].addressModeV)}setTransform(t){const n=this.texture;this.transform.copyFrom(t),this.transform.invert(),this.transform.scale(1/n.frame.width,1/n.frame.height),this._tick++}get texture(){return this._texture}set texture(t){this._texture!==t&&(this._texture=t,this._tick++)}get styleKey(){return`fill-pattern-${this.uid}-${this._tick}`}destroy(){this.texture.destroy(!0),this.texture=null}}function D2(l){return ae.isColorLike(l)}function cy(l){return l instanceof fo}function hy(l){return l instanceof Wi}function N2(l){return l instanceof Gt}function B2(l,t,n){const s=ae.shared.setValue(t??0);return l.color=s.toNumber(),l.alpha=s.alpha===1?n.alpha:s.alpha,l.texture=Gt.WHITE,{...n,...l}}function O2(l,t,n){return l.texture=t,{...n,...l}}function fy(l,t,n){return l.fill=t,l.color=16777215,l.texture=t.texture,l.matrix=t.transform,{...n,...l}}function dy(l,t,n){return t.buildGradient(),l.fill=t,l.color=16777215,l.texture=t.texture,l.matrix=t.transform,l.textureSpace=t.textureSpace,{...n,...l}}function G2(l,t){const n={...t,...l},s=ae.shared.setValue(n.color);return n.alpha*=s.alpha,n.color=s.toNumber(),n}function $n(l,t){if(l==null)return null;const n={},s=l;return D2(l)?B2(n,l,t):N2(l)?O2(n,l,t):cy(l)?fy(n,l,t):hy(l)?dy(n,l,t):s.fill&&cy(s.fill)?fy(s,s.fill,t):s.fill&&hy(s.fill)?dy(s,s.fill,t):G2(s,t)}function ao(l,t){const{width:n,alignment:s,miterLimit:r,cap:u,join:c,pixelLine:h,...m}=t,g=$n(l,m);return g?{width:n,alignment:s,miterLimit:r,cap:u,join:c,pixelLine:h,...g}:null}function k2(l,t){let n=1;const s=l.shapePath.shapePrimitives;for(let r=0;r<s.length;r++){const u=s[r].shape;if(u.type!=="polygon")continue;const c=u.points,h=c.length;if(h<6)continue;const m=u.closePath;for(let g=0;g<h;g+=2){if(!m&&(g===0||g===h-2))continue;const p=(g-2+h)%h,x=(g+2)%h,b=c[p],_=c[p+1],T=c[g],w=c[g+1],S=c[x],A=c[x+1],C=b-T,E=_-w,G=S-T,P=A-w,k=C*C+E*E,B=G*G+P*P;if(k<1e-12||B<1e-12)continue;let Z=(C*G+E*P)/Math.sqrt(k*B);Z<-1?Z=-1:Z>1&&(Z=1);const I=Math.sqrt((1-Z)*.5);if(I<1e-6)continue;const tt=Math.min(1/I,t);tt>n&&(n=tt)}}return n}const U2=new xe,my=new St,Fh=class Si extends Ti{constructor(){super(...arguments),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=Zt("graphicsContext"),this.dirty=!0,this.batchMode="auto",this.instructions=[],this.destroyed=!1,this._activePath=new Fi,this._transform=new St,this._fillStyle={...Si.defaultFillStyle},this._strokeStyle={...Si.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new ri,this._boundsDirty=!0}clone(){const t=new Si;return t.batchMode=this.batchMode,t.instructions=this.instructions.slice(),t._activePath=this._activePath.clone(),t._transform=this._transform.clone(),t._fillStyle={...this._fillStyle},t._strokeStyle={...this._strokeStyle},t._stateStack=this._stateStack.slice(),t._bounds=this._bounds.clone(),t._boundsDirty=!0,t}get fillStyle(){return this._fillStyle}set fillStyle(t){this._fillStyle=$n(t,Si.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(t){this._strokeStyle=ao(t,Si.defaultStrokeStyle)}setFillStyle(t){return this._fillStyle=$n(t,Si.defaultFillStyle),this}setStrokeStyle(t){return this._strokeStyle=$n(t,Si.defaultStrokeStyle),this}texture(t,n,s,r,u,c){return this.instructions.push({action:"texture",data:{image:t,dx:s||0,dy:r||0,dw:u||t.frame.width,dh:c||t.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:n||n===0?ae.shared.setValue(n).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new Fi,this}fill(t,n){let s;const r=this.instructions[this.instructions.length-1];return this._tick===0&&(r==null?void 0:r.action)==="stroke"?s=r.data.path:s=this._activePath.clone(),s?(t!=null&&(n!==void 0&&typeof t=="number"&&(At(Qt,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),t={color:t,alpha:n}),this._fillStyle=$n(t,Si.defaultFillStyle)),this.instructions.push({action:"fill",data:{style:this.fillStyle,path:s}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){const{x:t,y:n}=this._activePath.getLastPoint(xe.shared);this._activePath.clear(),this._activePath.moveTo(t,n)}stroke(t){let n;const s=this.instructions[this.instructions.length-1];return this._tick===0&&(s==null?void 0:s.action)==="fill"?n=s.data.path:n=this._activePath.clone(),n?(t!=null&&(this._strokeStyle=ao(t,Si.defaultStrokeStyle)),this.instructions.push({action:"stroke",data:{style:this.strokeStyle,path:n}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let t=0;t<2;t++){const n=this.instructions[this.instructions.length-1-t],s=this._activePath.clone();if(n&&(n.action==="stroke"||n.action==="fill"))if(n.data.hole)n.data.hole.addPath(s);else{n.data.hole=s;break}}return this._initNextPathLocation(),this}arc(t,n,s,r,u,c){this._tick++;const h=this._transform;return this._activePath.arc(h.a*t+h.c*n+h.tx,h.b*t+h.d*n+h.ty,s,r,u,c),this}arcTo(t,n,s,r,u){this._tick++;const c=this._transform;return this._activePath.arcTo(c.a*t+c.c*n+c.tx,c.b*t+c.d*n+c.ty,c.a*s+c.c*r+c.tx,c.b*s+c.d*r+c.ty,u),this}arcToSvg(t,n,s,r,u,c,h){this._tick++;const m=this._transform;return this._activePath.arcToSvg(t,n,s,r,u,m.a*c+m.c*h+m.tx,m.b*c+m.d*h+m.ty),this}bezierCurveTo(t,n,s,r,u,c,h){this._tick++;const m=this._transform;return this._activePath.bezierCurveTo(m.a*t+m.c*n+m.tx,m.b*t+m.d*n+m.ty,m.a*s+m.c*r+m.tx,m.b*s+m.d*r+m.ty,m.a*u+m.c*c+m.tx,m.b*u+m.d*c+m.ty,h),this}closePath(){var t;return this._tick++,(t=this._activePath)==null||t.closePath(),this}ellipse(t,n,s,r){return this._tick++,this._activePath.ellipse(t,n,s,r,this._transform.clone()),this}circle(t,n,s){return this._tick++,this._activePath.circle(t,n,s,this._transform.clone()),this}path(t){return this._tick++,this._activePath.addPath(t,this._transform.clone()),this}lineTo(t,n){this._tick++;const s=this._transform;return this._activePath.lineTo(s.a*t+s.c*n+s.tx,s.b*t+s.d*n+s.ty),this}moveTo(t,n){this._tick++;const s=this._transform,r=this._activePath.instructions,u=s.a*t+s.c*n+s.tx,c=s.b*t+s.d*n+s.ty;return r.length===1&&r[0].action==="moveTo"?(r[0].data[0]=u,r[0].data[1]=c,this):(this._activePath.moveTo(u,c),this)}quadraticCurveTo(t,n,s,r,u){this._tick++;const c=this._transform;return this._activePath.quadraticCurveTo(c.a*t+c.c*n+c.tx,c.b*t+c.d*n+c.ty,c.a*s+c.c*r+c.tx,c.b*s+c.d*r+c.ty,u),this}rect(t,n,s,r){return this._tick++,this._activePath.rect(t,n,s,r,this._transform.clone()),this}roundRect(t,n,s,r,u){return this._tick++,this._activePath.roundRect(t,n,s,r,u,this._transform.clone()),this}poly(t,n){return this._tick++,this._activePath.poly(t,n,this._transform.clone()),this}regularPoly(t,n,s,r,u=0,c){return this._tick++,this._activePath.regularPoly(t,n,s,r,u,c),this}roundPoly(t,n,s,r,u,c){return this._tick++,this._activePath.roundPoly(t,n,s,r,u,c),this}roundShape(t,n,s,r){return this._tick++,this._activePath.roundShape(t,n,s,r),this}filletRect(t,n,s,r,u){return this._tick++,this._activePath.filletRect(t,n,s,r,u),this}chamferRect(t,n,s,r,u,c){return this._tick++,this._activePath.chamferRect(t,n,s,r,u,c),this}star(t,n,s,r,u=0,c=0){return this._tick++,this._activePath.star(t,n,s,r,u,c,this._transform.clone()),this}svg(t){return this._tick++,z2(t,this),this}restore(){const t=this._stateStack.pop();return t&&(this._transform=t.transform,this._fillStyle=t.fillStyle,this._strokeStyle=t.strokeStyle),this}save(){return this._stateStack.push({transform:this._transform.clone(),fillStyle:{...this._fillStyle},strokeStyle:{...this._strokeStyle}}),this}getTransform(){return this._transform}resetTransform(){return this._transform.identity(),this}rotate(t){return this._transform.rotate(t),this}scale(t,n=t){return this._transform.scale(t,n),this}setTransform(t,n,s,r,u,c){return t instanceof St?(this._transform.set(t.a,t.b,t.c,t.d,t.tx,t.ty),this):(this._transform.set(t,n,s,r,u,c),this)}transform(t,n,s,r,u,c){return t instanceof St?(this._transform.append(t),this):(my.set(t,n,s,r,u,c),this._transform.append(my),this)}translate(t,n=t){return this._transform.translate(t,n),this}clear(){return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){this._boundsDirty=!0,this.dirty=!0,this.emit("update",this,16)}get bounds(){if(!this._boundsDirty)return this._bounds;this._boundsDirty=!1;const t=this._bounds;t.clear();for(let n=0;n<this.instructions.length;n++){const s=this.instructions[n],r=s.action;if(r==="fill"){const u=s.data;t.addBounds(u.path.bounds)}else if(r==="texture"){const u=s.data;t.addFrame(u.dx,u.dy,u.dx+u.dw,u.dy+u.dh,u.transform)}if(r==="stroke"){const u=s.data,c=u.style.alignment;let h=u.style.width*(1-c);u.style.join==="miter"&&(h*=k2(u.path,u.style.miterLimit));const m=u.path.bounds;t.addFrame(m.minX-h,m.minY-h,m.maxX+h,m.maxY+h)}}return t.isValid||t.set(0,0,0,0),t}containsPoint(t){var r;if(!this.bounds.containsPoint(t.x,t.y))return!1;const n=this.instructions;let s=!1;for(let u=0;u<n.length;u++){const c=n[u],h=c.data,m=h.path;if(!c.action||!m)continue;const g=h.style,p=m.shapePath.shapePrimitives;for(let x=0;x<p.length;x++){const b=p[x].shape;if(!g||!b)continue;const _=p[x].transform,T=_?_.applyInverse(t,U2):t;if(c.action==="fill")s=b.contains(T.x,T.y);else{const S=g;s=b.strokeContains(T.x,T.y,S.width,S.alignment)}const w=h.hole;if(w){const S=(r=w.shapePath)==null?void 0:r.shapePrimitives;if(S)for(let A=0;A<S.length;A++)S[A].shape.contains(T.x,T.y)&&(s=!1)}if(s)return!0}}return s}unload(){var t;this.emit("unload",this);for(const n in this._gpuData)(t=this._gpuData[n])==null||t.destroy();this._gpuData=Object.create(null)}destroy(t=!1){if(this.destroyed)return;if(this.destroyed=!0,this._stateStack.length=0,this._transform=null,this.unload(),this.emit("destroy",this),this.removeAllListeners(),typeof t=="boolean"?t:t==null?void 0:t.texture){const s=typeof t=="boolean"?t:t==null?void 0:t.textureSource;this._fillStyle.texture&&(this._fillStyle.fill&&"uid"in this._fillStyle.fill?this._fillStyle.fill.destroy():this._fillStyle.texture.destroy(s)),this._strokeStyle.texture&&(this._strokeStyle.fill&&"uid"in this._strokeStyle.fill?this._strokeStyle.fill.destroy():this._strokeStyle.texture.destroy(s))}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null}};Fh.defaultFillStyle={color:16777215,alpha:1,texture:Gt.WHITE,matrix:null,fill:null,textureSpace:"local"};Fh.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:Gt.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:!1};let gi=Fh;class j2{constructor(){this.isBatchable=!1}reset(){this.isBatchable=!1,this.context=null,this.graphicsData&&(this.graphicsData.destroy(),this.graphicsData=null)}destroy(){this.reset()}}class H2{constructor(){this.instructions=new Gh}init(){this.instructions.reset()}destroy(){this.instructions.destroy(),this.instructions=null}}const Wh=class Eh{constructor(t){this._renderer=t,this._managedContexts=new yl({renderer:t,type:"resource",name:"graphicsContext"})}init(t){Eh.defaultOptions.bezierSmoothness=(t==null?void 0:t.bezierSmoothness)??Eh.defaultOptions.bezierSmoothness}getContextRenderData(t){return this.getGpuContext(t).graphicsData||this._initContextRenderData(t)}updateGpuContext(t){const n=t._gpuData,s=!!n[this._renderer.uid],r=n[this._renderer.uid]||this._initContext(t);return(t.dirty||!s)&&(s&&r.reset(),r.isBatchable=!1,t.dirty=!1),r}getGpuContext(t){return t._gpuData[this._renderer.uid]||this._initContext(t)}_initContextRenderData(t){const n=new H2,s=this.getGpuContext(t);return s.graphicsData=n,n.init(),n}_initContext(t){const n=new j2;return n.context=t,t._gpuData[this._renderer.uid]=n,this._managedContexts.add(t),n}destroy(){this._managedContexts.destroy(),this._renderer=null}};Wh.extension={type:[yt.CanvasSystem],name:"graphicsContext"};Wh.defaultOptions={bezierSmoothness:.5};let L2=Wh;class q0{constructor(t,n){this.state=f0.for2d(),this.renderer=t,this._adaptor=n,this.renderer.runners.contextChange.add(this),this._managedGraphics=new yl({renderer:t,type:"renderable",priority:-1,name:"graphics"})}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(t){return!1}addRenderable(t,n){this._managedGraphics.add(t),this.renderer.renderPipes.batch.break(n),n.add(t)}updateRenderable(t){}execute(t){t.isRenderable&&this._adaptor.execute(this,t)}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null}}q0.extension={type:[yt.CanvasPipes],name:"graphics"};function Y2(l,t,n){const s=(l>>24&255)/255;t[n++]=(l&255)/255*s,t[n++]=(l>>8&255)/255*s,t[n++]=(l>>16&255)/255*s,t[n++]=s}class q2{constructor(){this.batches=[],this.batched=!1}destroy(){this.batches.forEach(t=>{Ne.return(t)}),this.batches.length=0}}class X0{constructor(t,n){this.state=f0.for2d(),this.renderer=t,this._adaptor=n,this.renderer.runners.contextChange.add(this),this._managedGraphics=new yl({renderer:t,type:"renderable",priority:-1,name:"graphics"})}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(t){const n=t.context,s=!!t._gpuData,u=this.renderer.graphicsContext.updateGpuContext(n);return!!(u.isBatchable||s!==u.isBatchable)}addRenderable(t,n){const r=this.renderer.graphicsContext.updateGpuContext(t.context);t.didViewUpdate&&this._rebuild(t),r.isBatchable?this._addToBatcher(t,n):(this.renderer.renderPipes.batch.break(n),n.add(t))}updateRenderable(t){const s=this._getGpuDataForRenderable(t).batches;for(let r=0;r<s.length;r++){const u=s[r];u._batcher.updateElement(u)}}execute(t){if(!t.isRenderable)return;const n=this.renderer,s=t.context;if(!n.graphicsContext.getGpuContext(s).batches.length)return;const u=s.customShader||this._adaptor.shader;this.state.blendMode=t.groupBlendMode;const c=u.resources.localUniforms.uniforms;c.uTransformMatrix=t.groupTransform,c.uRound=n._roundPixels|t._roundPixels,Y2(t.groupColorAlpha,c.uColor,0),this._adaptor.execute(this,t)}_rebuild(t){const n=this._getGpuDataForRenderable(t),r=this.renderer.graphicsContext.updateGpuContext(t.context);n.destroy(),r.isBatchable&&this._updateBatchesForRenderable(t,n)}_addToBatcher(t,n){const s=this.renderer.renderPipes.batch,r=this._getGpuDataForRenderable(t).batches;for(let u=0;u<r.length;u++){const c=r[u];s.addToBatch(c,n)}}_getGpuDataForRenderable(t){return t._gpuData[this.renderer.uid]||this._initGpuDataForRenderable(t)}_initGpuDataForRenderable(t){const n=new q2;return t._gpuData[this.renderer.uid]=n,this._managedGraphics.add(t),n}_updateBatchesForRenderable(t,n){const s=t.context,u=this.renderer.graphicsContext.getGpuContext(s),c=this.renderer._roundPixels|t._roundPixels;n.batches=u.batches.map(h=>{const m=Ne.get(qh);return h.copyTo(m),m.renderable=t,m.roundPixels=c,m})}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null}}X0.extension={type:[yt.WebGLPipes,yt.WebGPUPipes],name:"graphics"};Jt.add(q0);Jt.add(X0);Jt.add(L2);Jt.add(Ph);class ye extends kh{constructor(t){t instanceof gi&&(t={context:t});const{context:n,roundPixels:s,...r}=t||{};super({label:"Graphics",...r}),this.renderPipeId="graphics",n?this.context=n:(this.context=this._ownedContext=new gi,this.context.autoGarbageCollect=this.autoGarbageCollect),this.didViewUpdate=!0,this.allowChildren=!1,this.roundPixels=s??!1}set context(t){t!==this._context&&(this._context&&(this._context.off("update",this.onViewUpdate,this),this._context.off("unload",this.unload,this)),this._context=t,this._context.on("update",this.onViewUpdate,this),this._context.on("unload",this.unload,this),this.onViewUpdate())}get context(){return this._context}get bounds(){return this._context.bounds}updateBounds(){}containsPoint(t){return this._context.containsPoint(t)}destroy(t){this._ownedContext&&!t?this._ownedContext.destroy(t):(t===!0||(t==null?void 0:t.context)===!0)&&this._context.destroy(t),this._ownedContext=null,this._context=null,super.destroy(t)}_onTouch(t){this._gcLastUsed=t,this._context._gcLastUsed=t}_callContextMethod(t,n){return this.context[t](...n),this}setFillStyle(...t){return this._callContextMethod("setFillStyle",t)}setStrokeStyle(...t){return this._callContextMethod("setStrokeStyle",t)}fill(...t){return this._callContextMethod("fill",t)}stroke(...t){return this._callContextMethod("stroke",t)}texture(...t){return this._callContextMethod("texture",t)}beginPath(){return this._callContextMethod("beginPath",[])}cut(){return this._callContextMethod("cut",[])}arc(...t){return this._callContextMethod("arc",t)}arcTo(...t){return this._callContextMethod("arcTo",t)}arcToSvg(...t){return this._callContextMethod("arcToSvg",t)}bezierCurveTo(...t){return this._callContextMethod("bezierCurveTo",t)}closePath(){return this._callContextMethod("closePath",[])}ellipse(...t){return this._callContextMethod("ellipse",t)}circle(...t){return this._callContextMethod("circle",t)}path(...t){return this._callContextMethod("path",t)}lineTo(...t){return this._callContextMethod("lineTo",t)}moveTo(...t){return this._callContextMethod("moveTo",t)}quadraticCurveTo(...t){return this._callContextMethod("quadraticCurveTo",t)}rect(...t){return this._callContextMethod("rect",t)}roundRect(...t){return this._callContextMethod("roundRect",t)}poly(...t){return this._callContextMethod("poly",t)}regularPoly(...t){return this._callContextMethod("regularPoly",t)}roundPoly(...t){return this._callContextMethod("roundPoly",t)}roundShape(...t){return this._callContextMethod("roundShape",t)}filletRect(...t){return this._callContextMethod("filletRect",t)}chamferRect(...t){return this._callContextMethod("chamferRect",t)}star(...t){return this._callContextMethod("star",t)}svg(...t){return this._callContextMethod("svg",t)}restore(...t){return this._callContextMethod("restore",t)}save(){return this._callContextMethod("save",[])}getTransform(){return this.context.getTransform()}resetTransform(){return this._callContextMethod("resetTransform",[])}rotateTransform(...t){return this._callContextMethod("rotate",t)}scaleTransform(...t){return this._callContextMethod("scale",t)}setTransform(...t){return this._callContextMethod("setTransform",t)}transform(...t){return this._callContextMethod("transform",t)}translateTransform(...t){return this._callContextMethod("translate",t)}clear(){return this._callContextMethod("clear",[])}get fillStyle(){return this._context.fillStyle}set fillStyle(t){this._context.fillStyle=t}get strokeStyle(){return this._context.strokeStyle}set strokeStyle(t){this._context.strokeStyle=t}clone(t=!1){return t?new ye(this._context.clone()):(this._ownedContext=null,new ye(this._context))}lineStyle(t,n,s){At(Qt,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");const r={};return t&&(r.width=t),n&&(r.color=n),s&&(r.alpha=s),this.context.strokeStyle=r,this}beginFill(t,n){At(Qt,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");const s={};return t!==void 0&&(s.color=t),n!==void 0&&(s.alpha=n),this.context.fillStyle=s,this}endFill(){At(Qt,"Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."),this.context.fill();const t=this.context.strokeStyle;return(t.width!==gi.defaultStrokeStyle.width||t.color!==gi.defaultStrokeStyle.color||t.alpha!==gi.defaultStrokeStyle.alpha)&&this.context.stroke(),this}drawCircle(...t){return At(Qt,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",t)}drawEllipse(...t){return At(Qt,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",t)}drawPolygon(...t){return At(Qt,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",t)}drawRect(...t){return At(Qt,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",t)}drawRoundedRect(...t){return At(Qt,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",t)}drawStar(...t){return At(Qt,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",t)}}class X2 extends kh{constructor(t,n){const{text:s,resolution:r,style:u,anchor:c,width:h,height:m,roundPixels:g,...p}=t;super({...p}),this.batched=!0,this._resolution=null,this._autoResolution=!0,this._didTextUpdate=!0,this._styleClass=n,this.text=s??"",this.style=u,this.resolution=r??null,this.allowChildren=!1,this._anchor=new ge({_onUpdate:()=>{this.onViewUpdate()}}),c&&(this.anchor=c),this.roundPixels=g??!1,h!==void 0&&(this.width=h),m!==void 0&&(this.height=m)}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}set text(t){t=t.toString(),this._text!==t&&(this._text=t,this.onViewUpdate())}get text(){return this._text}set resolution(t){this._autoResolution=t===null,this._resolution=t,this.onViewUpdate()}get resolution(){return this._resolution}get style(){return this._style}set style(t){var n;t||(t={}),(n=this._style)==null||n.off("update",this.onViewUpdate,this),t instanceof this._styleClass?this._style=t:this._style=new this._styleClass(t),this._style.on("update",this.onViewUpdate,this),this.onViewUpdate()}get width(){return Math.abs(this.scale.x)*this.bounds.width}set width(t){this._setWidth(t,this.bounds.width)}get height(){return Math.abs(this.scale.y)*this.bounds.height}set height(t){this._setHeight(t,this.bounds.height)}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this.bounds.width,t.height=Math.abs(this.scale.y)*this.bounds.height,t}setSize(t,n){typeof t=="object"?(n=t.height??t.width,t=t.width):n??(n=t),t!==void 0&&this._setWidth(t,this.bounds.width),n!==void 0&&this._setHeight(n,this.bounds.height)}containsPoint(t){const n=this.bounds.width,s=this.bounds.height,r=-n*this.anchor.x;let u=0;return t.x>=r&&t.x<=r+n&&(u=-s*this.anchor.y,t.y>=u&&t.y<=u+s)}onViewUpdate(){this.didViewUpdate||(this._didTextUpdate=!0),super.onViewUpdate()}destroy(t=!1){super.destroy(t),this.owner=null,this._bounds=null,this._anchor=null,(typeof t=="boolean"?t:t!=null&&t.style)&&this._style.destroy(t),this._style=null,this._text=null}get styleKey(){return`${this._text}:${this._style.styleKey}:${this._resolution}`}}function V2(l,t){let n=l[0]??{};return(typeof n=="string"||l[1])&&(At(Qt,`use new ${t}({ text: "hi!", style }) instead`),n={text:n,style:l[1]}),n}class P2{constructor(t){this._canvasPool=Object.create(null),this.canvasOptions=t||{},this.enableFullScreen=!1}_createCanvasAndContext(t,n){const s=Pe.get().createCanvas();s.width=t,s.height=n;const r=s.getContext("2d");return{canvas:s,context:r}}getOptimalCanvasAndContext(t,n,s=1){t=Math.ceil(t*s-1e-6),n=Math.ceil(n*s-1e-6),t=Ws(t),n=Ws(n);const r=(t<<17)+(n<<1);this._canvasPool[r]||(this._canvasPool[r]=[]);let u=this._canvasPool[r].pop();return u||(u=this._createCanvasAndContext(t,n)),u}returnCanvasAndContext(t){const n=t.canvas,{width:s,height:r}=n,u=(s<<17)+(r<<1);t.context.resetTransform(),t.context.clearRect(0,0,s,r),this._canvasPool[u].push(t)}clear(){this._canvasPool={}}}const Rh=new P2;pl.register(Rh);let Pn=null,Vi=null;function F2(l,t){Pn||(Pn=Pe.get().createCanvas(256,128),Vi=Pn.getContext("2d",{willReadFrequently:!0}),Vi.globalCompositeOperation="copy",Vi.globalAlpha=1),(Pn.width<l||Pn.height<t)&&(Pn.width=Ws(l),Pn.height=Ws(t))}function gy(l,t,n){for(let s=0,r=4*n*t;s<t;++s,r+=4)if(l[r+3]!==0)return!1;return!0}function py(l,t,n,s,r){const u=4*t;for(let c=s,h=s*u+4*n;c<=r;++c,h+=u)if(l[h+3]!==0)return!1;return!0}function W2(...l){let t=l[0];t.canvas||(t={canvas:l[0],resolution:l[1]});const{canvas:n}=t,s=Math.min(t.resolution??1,1),r=t.width??n.width,u=t.height??n.height;let c=t.output;if(F2(r,u),!Vi)throw new TypeError("Failed to get canvas 2D context");Vi.drawImage(n,0,0,r,u,0,0,r*s,u*s);const m=Vi.getImageData(0,0,r,u).data;let g=0,p=0,x=r-1,b=u-1;for(;p<u&&gy(m,r,p);)++p;if(p===u)return $t.EMPTY;for(;gy(m,r,b);)--b;for(;py(m,r,g,p,b);)++g;for(;py(m,r,x,p,b);)--x;return++x,++b,Vi.globalCompositeOperation="source-over",Vi.strokeRect(g,p,x-g,b-p),Vi.globalCompositeOperation="copy",c??(c=new $t),c.set(g/s,p/s,(x-g)/s,(b-p)/s),c}/**
288
+ * tiny-lru
289
+ *
290
+ * @copyright 2026 Jason Mulligan <jason.mulligan@avoidwork.com>
291
+ * @license BSD-3-Clause
292
+ * @version 11.4.7
293
+ */class Q2{constructor(t=0,n=0,s=!1){this.first=null,this.items=Object.create(null),this.last=null,this.max=t,this.resetTtl=s,this.size=0,this.ttl=n}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(t){if(this.has(t)){const n=this.items[t];delete this.items[t],this.size--,n.prev!==null&&(n.prev.next=n.next),n.next!==null&&(n.next.prev=n.prev),this.first===n&&(this.first=n.next),this.last===n&&(this.last=n.prev)}return this}entries(t=this.keys()){const n=new Array(t.length);for(let s=0;s<t.length;s++){const r=t[s];n[s]=[r,this.get(r)]}return n}evict(t=!1){if(t||this.size>0){const n=this.first;delete this.items[n.key],--this.size===0?(this.first=null,this.last=null):(this.first=n.next,this.first.prev=null)}return this}expiresAt(t){let n;return this.has(t)&&(n=this.items[t].expiry),n}get(t){const n=this.items[t];if(n!==void 0){if(this.ttl>0&&n.expiry<=Date.now()){this.delete(t);return}return this.moveToEnd(n),n.value}}has(t){return t in this.items}moveToEnd(t){this.last!==t&&(t.prev!==null&&(t.prev.next=t.next),t.next!==null&&(t.next.prev=t.prev),this.first===t&&(this.first=t.next),t.prev=this.last,t.next=null,this.last!==null&&(this.last.next=t),this.last=t,this.first===null&&(this.first=t))}keys(){const t=new Array(this.size);let n=this.first,s=0;for(;n!==null;)t[s++]=n.key,n=n.next;return t}setWithEvicted(t,n,s=this.resetTtl){let r=null;if(this.has(t))this.set(t,n,!0,s);else{this.max>0&&this.size===this.max&&(r={...this.first},this.evict(!0));let u=this.items[t]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:n};++this.size===1?this.first=u:this.last.next=u,this.last=u}return r}set(t,n,s=!1,r=this.resetTtl){let u=this.items[t];return s||u!==void 0?(u.value=n,s===!1&&r&&(u.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl),this.moveToEnd(u)):(this.max>0&&this.size===this.max&&this.evict(!0),u=this.items[t]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:n},++this.size===1?this.first=u:this.last.next=u,this.last=u),this}values(t=this.keys()){const n=new Array(t.length);for(let s=0;s<t.length;s++)n[s]=this.get(t[s]);return n}}function Z2(l=1e3,t=0,n=!1){if(isNaN(l)||l<0)throw new TypeError("Invalid max value");if(isNaN(t)||t<0)throw new TypeError("Invalid ttl value");if(typeof n!="boolean")throw new TypeError("Invalid resetTtl value");return new Q2(l,t,n)}function V0(l){return!!l.tagStyles&&Object.keys(l.tagStyles).length>0}function P0(l){return l.includes("<")}function I2(l,t){return l.clone().assign(t)}function K2(l,t){const n=[],s=t.tagStyles;if(!V0(t)||!P0(l))return n.push({text:l,style:t}),n;const r=[t],u=[];let c="",h=0;for(;h<l.length;){const m=l[h];if(m==="<"){const g=l.indexOf(">",h);if(g===-1){c+=m,h++;continue}const p=l.slice(h+1,g);if(p.startsWith("/")){const x=p.slice(1).trim();if(u.length>0&&u[u.length-1]===x){c.length>0&&(n.push({text:c,style:r[r.length-1]}),c=""),r.pop(),u.pop(),h=g+1;continue}else{c+=l.slice(h,g+1),h=g+1;continue}}else{const x=p.trim();if(s[x]){c.length>0&&(n.push({text:c,style:r[r.length-1]}),c="");const b=r[r.length-1],_=I2(b,s[x]);r.push(_),u.push(x),h=g+1;continue}else{c+=l.slice(h,g+1),h=g+1;continue}}}else c+=m,h++}return c.length>0&&n.push({text:c,style:r[r.length-1]}),n}const $2=[10,13],J2=new Set($2),tT=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288],eT=new Set(tT),iT=[9,32];new Set(iT);const nT=[45,8208,8211,8212,173],sT=new Set(nT),aT=/(\r\n|\r|\n)/,lT=/(?:\r\n|\r|\n)/;function lo(l){return typeof l!="string"?!1:J2.has(l.charCodeAt(0))}function li(l,t){return typeof l!="string"?!1:eT.has(l.charCodeAt(0))}function rT(l){return typeof l!="string"?!1:sT.has(l.charCodeAt(0))}function F0(l){return l==="normal"||l==="pre-line"}function W0(l){return l==="normal"}function Xi(l){if(typeof l!="string")return"";let t=l.length-1;for(;t>=0&&li(l[t]);)t--;return t<l.length-1?l.slice(0,t+1):l}function Q0(l){const t=[],n=[];if(typeof l!="string")return t;for(let s=0;s<l.length;s++){const r=l[s],u=l[s+1];if(li(r)||lo(r)){n.length>0&&(t.push(n.join("")),n.length=0),r==="\r"&&u===`
294
+ `?(t.push(`\r
295
+ `),s++):t.push(r);continue}n.push(r),rT(r)&&u&&!li(u)&&!lo(u)&&(t.push(n.join("")),n.length=0)}return n.length>0&&t.push(n.join("")),t}function Z0(l,t,n,s){const r=n(l),u=[];for(let c=0;c<r.length;c++){let h=r[c],m=h,g=1;for(;r[c+g];){const p=r[c+g];if(!s(m,p,l,c,t))h+=p,m=p,g++;else break}c+=g-1,u.push(h)}return u}const oT=/\r\n|\r|\n/g;function uT(l,t,n,s,r,u,c,h){var wt,D;const m=K2(l,t);if(W0(t.whiteSpace))for(let L=0;L<m.length;L++){const et=m[L];m[L]={text:et.text.replace(oT," "),style:et.style}}const p=[];let x=[];for(const L of m){const et=L.text.split(aT);for(let $=0;$<et.length;$++){const at=et[$];at===`\r
296
+ `||at==="\r"||at===`
297
+ `?(p.push(x),x=[]):at.length>0&&x.push({text:at,style:L.style})}}(x.length>0||p.length===0)&&p.push(x);const b=n?cT(p,t,s,r,c,h):p,_=[],T=[],w=[],S=[],A=[];let C=0;const E=t._fontString,G=u(E);G.fontSize===0&&(G.fontSize=t.fontSize,G.ascent=t.fontSize);let P="",k=!!t.dropShadow,B=((wt=t._stroke)==null?void 0:wt.width)||0;for(const L of b){let et=0,$=G.ascent,at=G.descent,R="";for(const W of L){const J=W.style._fontString,rt=u(J);J!==P&&(s.font=J,P=J);const ct=r(W.text,W.style.letterSpacing,s);et+=ct,$=Math.max($,rt.ascent),at=Math.max(at,rt.descent),R+=W.text;const dt=((D=W.style._stroke)==null?void 0:D.width)||0;dt>B&&(B=dt),!k&&W.style.dropShadow&&(k=!0)}L.length===0&&($=G.ascent,at=G.descent),_.push(et),T.push($),w.push(at),A.push(R);const q=t.lineHeight||$+at;S.push(q+t.leading),C=Math.max(C,et)}const K=B,I=(n&&t.align!=="left"?Math.max(C,t.wordWrapWidth):C)+K+(t.dropShadow?t.dropShadow.distance:0);let tt=0;for(let L=0;L<S.length;L++)tt+=S[L];tt=Math.max(tt,S[0]+K);const it=tt+(t.dropShadow?t.dropShadow.distance:0),nt=t.lineHeight||G.fontSize;return{width:I,height:it,lines:A,lineWidths:_,lineHeight:nt+t.leading,maxLineWidth:C,fontProperties:G,runsByLine:b,lineAscents:T,lineDescents:w,lineHeights:S,hasDropShadow:k}}function cT(l,t,n,s,r,u){var S;const{letterSpacing:c,whiteSpace:h,wordWrapWidth:m,breakWords:g}=t,p=F0(h),x=m+c,b={};let _="";const T=(A,C)=>{const E=`${A}|${C.styleKey}`;let G=b[E];if(G===void 0){const P=C._fontString;P!==_&&(n.font=P,_=P),G=s(A,C.letterSpacing,n)+C.letterSpacing,b[E]=G}return G},w=[];for(const A of l){const C=hT(A),E=w.length,G=tt=>{let it=0,nt=tt;do{const{token:wt,style:D}=C[nt];it+=T(wt,D),nt++}while(nt<C.length&&C[nt].continuesFromPrevious);return it},P=tt=>{const it=[];let nt=tt;do it.push({token:C[nt].token,style:C[nt].style}),nt++;while(nt<C.length&&C[nt].continuesFromPrevious);return it};let k=[],B=0,K=!p,Q=null;const Z=()=>{Q&&Q.text.length>0&&k.push(Q),Q=null},I=()=>{if(Z(),k.length>0){const tt=k[k.length-1];tt.text=Xi(tt.text),tt.text.length===0&&k.pop()}w.push(k),k=[],B=0,K=!1};for(let tt=0;tt<C.length;tt++){const{token:it,style:nt,continuesFromPrevious:wt}=C[tt],D=T(it,nt);if(p){const $=li(it),at=(Q==null?void 0:Q.text[Q.text.length-1])??((S=k[k.length-1])==null?void 0:S.text.slice(-1))??"",R=at?li(at):!1;if($&&R)continue}const L=!wt,et=L?G(tt):D;if(et>x&&L)if(B>0&&I(),g){const $=P(tt);for(let at=0;at<$.length;at++){const R=$[at].token,q=$[at].style,W=Z0(R,g,u,r);for(const J of W){const rt=T(J,q);rt+B>x&&I(),!Q||Q.style!==q?(Z(),Q={text:J,style:q}):Q.text+=J,B+=rt}}tt+=$.length-1}else{const $=P(tt);Z(),w.push($.map(at=>({text:at.token,style:at.style}))),K=!1,tt+=$.length-1}else if(et+B>x&&L){if(li(it)){K=!1;continue}I(),Q={text:it,style:nt},B=D}else if(wt&&!g)!Q||Q.style!==nt?(Z(),Q={text:it,style:nt}):Q.text+=it,B+=D;else{const $=li(it);if(B===0&&$&&!K)continue;!Q||Q.style!==nt?(Z(),Q={text:it,style:nt}):Q.text+=it,B+=D}}if(Z(),k.length>0){const tt=k[k.length-1];tt.text=Xi(tt.text),tt.text.length===0&&k.pop()}(k.length>0||w.length===E)&&w.push(k)}return w}function hT(l){const t=[];let n=!1;for(const s of l){const r=Q0(s.text);let u=!0;for(const c of r){const h=li(c)||lo(c),m=u&&n&&!h;t.push({token:c,style:s.style,continuesFromPrevious:m}),n=!h,u=!1}}return t}const fT={willReadFrequently:!0};function yy(l,t,n,s,r){let u=n[l];return typeof u!="number"&&(u=r(l,t,s)+t,n[l]=u),u}function dT(l,t,n,s,r,u,c){const h=n.getContext("2d",fT);h.font=t._fontString;let m=0,g="";const p=[],x=Object.create(null),{letterSpacing:b,whiteSpace:_}=t,T=F0(_),w=W0(_);let S=!T;const A=t.wordWrapWidth+b,C=Q0(l);for(let G=0;G<C.length;G++){let P=C[G];if(lo(P)){if(!w){p.push(Xi(g)),S=!T,g="",m=0;continue}P=" "}if(T){const B=li(P),K=li(g[g.length-1]);if(B&&K)continue}const k=yy(P,b,x,h,s);if(k>A)if(g!==""&&(p.push(Xi(g)),g="",m=0),r(P,t.breakWords)){const B=Z0(P,t.breakWords,c,u);for(const K of B){const Q=yy(K,b,x,h,s);Q+m>A&&(p.push(Xi(g)),S=!1,g="",m=0),g+=K,m+=Q}}else g.length>0&&(p.push(Xi(g)),g="",m=0),p.push(Xi(P)),S=!1,g="",m=0;else k+m>A&&(S=!1,p.push(Xi(g)),g="",m=0),(g.length>0||!li(P)||S)&&(g+=P,m+=k)}const E=Xi(g);return E.length>0&&p.push(E),p.join(`
298
+ `)}const xy={willReadFrequently:!0},Qi=class ft{static get experimentalLetterSpacingSupported(){let t=ft._experimentalLetterSpacingSupported;if(t===void 0){const n=Pe.get().getCanvasRenderingContext2D().prototype;t=ft._experimentalLetterSpacingSupported="letterSpacing"in n||"textLetterSpacing"in n}return t}constructor(t,n,s,r,u,c,h,m,g,p){this.text=t,this.style=n,this.width=s,this.height=r,this.lines=u,this.lineWidths=c,this.lineHeight=h,this.maxLineWidth=m,this.fontProperties=g,p&&(this.runsByLine=p.runsByLine,this.lineAscents=p.lineAscents,this.lineDescents=p.lineDescents,this.lineHeights=p.lineHeights,this.hasDropShadow=p.hasDropShadow)}static measureText(t=" ",n,s=ft._canvas,r=n.wordWrap){var P;const u=`${t}-${n.styleKey}-wordWrap-${r}`;if(ft._measurementCache.has(u))return ft._measurementCache.get(u);if(V0(n)&&P0(t)){const k=uT(t,n,r,ft._context,ft._measureText,ft.measureFont,ft.canBreakChars,ft.wordWrapSplit),B=new ft(t,n,k.width,k.height,k.lines,k.lineWidths,k.lineHeight,k.maxLineWidth,k.fontProperties,{runsByLine:k.runsByLine,lineAscents:k.lineAscents,lineDescents:k.lineDescents,lineHeights:k.lineHeights,hasDropShadow:k.hasDropShadow});return ft._measurementCache.set(u,B),B}const h=n._fontString,m=ft.measureFont(h);m.fontSize===0&&(m.fontSize=n.fontSize,m.ascent=n.fontSize,m.descent=0);const g=ft._context;g.font=h;const x=(r?ft._wordWrap(t,n,s):t).split(lT),b=new Array(x.length);let _=0;for(let k=0;k<x.length;k++){const B=ft._measureText(x[k],n.letterSpacing,g);b[k]=B,_=Math.max(_,B)}const T=((P=n._stroke)==null?void 0:P.width)??0,w=n.lineHeight||m.fontSize,S=ft._getAlignWidth(_,n,r),A=ft._adjustWidthForStyle(S,n),C=Math.max(w,m.fontSize+T)+(x.length-1)*(w+n.leading),E=ft._adjustHeightForStyle(C,n),G=new ft(t,n,A,E,x,b,w+n.leading,_,m);return ft._measurementCache.set(u,G),G}static _adjustWidthForStyle(t,n){var u;const s=((u=n._stroke)==null?void 0:u.width)||0;let r=t+s;return n.dropShadow&&(r+=n.dropShadow.distance),r}static _adjustHeightForStyle(t,n){let s=t;return n.dropShadow&&(s+=n.dropShadow.distance),s}static _getAlignWidth(t,n,s){return s&&n.align!=="left"?Math.max(t,n.wordWrapWidth):t}static _measureText(t,n,s){let r=!1;ft.experimentalLetterSpacingSupported&&(ft.experimentalLetterSpacing?(s.letterSpacing=`${n}px`,s.textLetterSpacing=`${n}px`,r=!0):(s.letterSpacing="0px",s.textLetterSpacing="0px"));const u=s.measureText(t);let c=u.width;const h=-(u.actualBoundingBoxLeft??0);let g=(u.actualBoundingBoxRight??0)-h;if(c>0)if(r)c-=n,g-=n;else{const p=(ft.graphemeSegmenter(t).length-1)*n;c+=p,g+=p}return Math.max(c,g)}static _wordWrap(t,n,s=ft._canvas){return dT(t,n,s,ft._measureText,ft.canBreakWords,ft.canBreakChars,ft.wordWrapSplit)}static isBreakingSpace(t,n){return li(t)}static canBreakWords(t,n){return n}static canBreakChars(t,n,s,r,u){return!0}static wordWrapSplit(t){return ft.graphemeSegmenter(t)}static measureFont(t){if(ft._fonts[t])return ft._fonts[t];const n=ft._context;n.font=t;const s=n.measureText(ft.METRICS_STRING+ft.BASELINE_SYMBOL),r=s.actualBoundingBoxAscent??0,u=s.actualBoundingBoxDescent??0,c={ascent:r,descent:u,fontSize:r+u};return ft._fonts[t]=c,c}static clearMetrics(t=""){t?delete ft._fonts[t]:ft._fonts={}}static get _canvas(){if(!ft.__canvas){let t;try{const n=new OffscreenCanvas(0,0),s=n.getContext("2d",xy);if(s!=null&&s.measureText)return ft.__canvas=n,n;t=Pe.get().createCanvas()}catch{t=Pe.get().createCanvas()}t.width=t.height=10,ft.__canvas=t}return ft.__canvas}static get _context(){return ft.__context||(ft.__context=ft._canvas.getContext("2d",xy)),ft.__context}};Qi.METRICS_STRING="|ÉqÅ";Qi.BASELINE_SYMBOL="M";Qi.BASELINE_MULTIPLIER=1.4;Qi.HEIGHT_MULTIPLIER=2;Qi.graphemeSegmenter=(()=>{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const l=new Intl.Segmenter;return t=>{const n=l.segment(t),s=[];let r=0;for(const u of n)s[r++]=u.segment;return s}}return l=>[...l]})();Qi.experimentalLetterSpacing=!1;Qi._fonts={};Qi._measurementCache=Z2(1e3);let Sn=Qi;const mT=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function zh(l){const t=typeof l.fontSize=="number"?`${l.fontSize}px`:l.fontSize;let n=l.fontFamily;Array.isArray(l.fontFamily)||(n=l.fontFamily.split(","));for(let s=n.length-1;s>=0;s--){let r=n[s].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&!mT.includes(r)&&(r=`"${r}"`),n[s]=r}return`${l.fontStyle} ${l.fontVariant} ${l.fontWeight} ${t} ${n.join(",")}`}const _y=1e5;function $r(l,t,n,s=0,r=0,u=0){if(l.texture===Gt.WHITE&&!l.fill)return ae.shared.setValue(l.color).setAlpha(l.alpha??1).toHexa();if(l.fill){if(l.fill instanceof fo){const c=l.fill,h=t.createPattern(c.texture.source.resource,"repeat"),m=c.transform.copyTo(St.shared);return m.scale(c.texture.source.pixelWidth,c.texture.source.pixelHeight),h.setTransform(m),h}else if(l.fill instanceof Wi){const c=l.fill,h=c.type==="linear",m=c.textureSpace==="local";let g=1,p=1;m&&n&&(g=n.width+s,p=n.height+s);let x,b=!1;if(h){const{start:_,end:T}=c;x=t.createLinearGradient(_.x*g+r,_.y*p+u,T.x*g+r,T.y*p+u),b=Math.abs(T.x-_.x)<Math.abs((T.y-_.y)*.1)}else{const{center:_,innerRadius:T,outerCenter:w,outerRadius:S}=c;x=t.createRadialGradient(_.x*g+r,_.y*p+u,T*g,w.x*g+r,w.y*p+u,S*g)}if(b&&m&&n){const _=n.lineHeight/p;for(let T=0;T<n.lines.length;T++){const w=(T*n.lineHeight+s/2)/p;c.colorStops.forEach(S=>{let A=w+S.offset*_;A=Math.max(0,Math.min(1,A)),x.addColorStop(Math.floor(A*_y)/_y,ae.shared.setValue(S.color).toHex())})}}else c.colorStops.forEach(_=>{x.addColorStop(_.offset,ae.shared.setValue(_.color).toHex())});return x}}else{const c=t.createPattern(l.texture.source.resource,"repeat"),h=l.matrix.copyTo(St.shared);return h.scale(l.texture.source.pixelWidth,l.texture.source.pixelHeight),c.setTransform(h),c}return Se("FillStyle not recognised",l),"red"}const by=new $t;function Ls(l){let t=0;for(let n=0;n<l.length;n++)l.charCodeAt(n)===32&&t++;return t}class gT{getCanvasAndContext(t){const{text:n,style:s,resolution:r=1}=t,u=s._getFinalPadding(),c=Sn.measureText(n||" ",s),h=Math.ceil(Math.ceil(Math.max(1,c.width)+u*2)*r),m=Math.ceil(Math.ceil(Math.max(1,c.height)+u*2)*r),g=Rh.getOptimalCanvasAndContext(h,m);this._renderTextToCanvas(s,u,r,g,c);const p=s.trim?W2({canvas:g.canvas,width:h,height:m,resolution:1,output:by}):by.set(0,0,h,m);return{canvasAndContext:g,frame:p}}returnCanvasAndContext(t){Rh.returnCanvasAndContext(t)}_renderTextToCanvas(t,n,s,r,u){var k,B,K;if(u.runsByLine&&u.runsByLine.length>0){this._renderTaggedTextToCanvas(u,t,n,s,r);return}const{canvas:c,context:h}=r,m=zh(t),g=u.lines,p=u.lineHeight,x=u.lineWidths,b=u.maxLineWidth,_=u.fontProperties,T=c.height;if(h.resetTransform(),h.scale(s,s),h.textBaseline=t.textBaseline,(k=t._stroke)!=null&&k.width){const Q=t._stroke;h.lineWidth=Q.width,h.miterLimit=Q.miterLimit,h.lineJoin=Q.join,h.lineCap=Q.cap}h.font=m;let w,S;const A=t.dropShadow?2:1,C=t.wordWrap?Math.max(t.wordWrapWidth,b):b,G=(((B=t._stroke)==null?void 0:B.width)??0)/2;let P=(p-_.fontSize)/2;p-_.fontSize<0&&(P=0);for(let Q=0;Q<A;++Q){const Z=t.dropShadow&&Q===0,I=Z?Math.ceil(Math.max(1,T)+n*2):0,tt=I*s;if(Z)this._setupDropShadow(h,t,s,tt);else{const it=t._gradientBounds,nt=t._gradientOffset;if(it){const wt={width:it.width,height:it.height,lineHeight:it.height,lines:u.lines};this._setFillAndStrokeStyles(h,t,wt,n,G,(nt==null?void 0:nt.x)??0,(nt==null?void 0:nt.y)??0)}else nt?this._setFillAndStrokeStyles(h,t,u,n,G,nt.x,nt.y):this._setFillAndStrokeStyles(h,t,u,n,G);h.shadowColor="rgba(0,0,0,0)"}for(let it=0;it<g.length;it++){w=G,S=G+it*p+_.ascent+P,w+=this._getAlignmentOffset(x[it],C,t.align);let nt=0;if(t.align==="justify"&&t.wordWrap&&it<g.length-1){const wt=Ls(g[it]);wt>0&&(nt=(C-x[it])/wt)}(K=t._stroke)!=null&&K.width&&this._drawLetterSpacing(g[it],t,r,w+n,S+n-I,!0,nt),t._fill!==void 0&&this._drawLetterSpacing(g[it],t,r,w+n,S+n-I,!1,nt)}}}_renderTaggedTextToCanvas(t,n,s,r,u){var G,P,k;const{canvas:c,context:h}=u,{runsByLine:m,lineWidths:g,maxLineWidth:p,lineAscents:x,lineHeights:b,hasDropShadow:_}=t,T=c.height;h.resetTransform(),h.scale(r,r),h.textBaseline=n.textBaseline;const w=_?2:1,S=n.wordWrap?Math.max(n.wordWrapWidth,p):p;let A=((G=n._stroke)==null?void 0:G.width)??0;for(const B of m)for(const K of B){const Q=((P=K.style._stroke)==null?void 0:P.width)??0;Q>A&&(A=Q)}const C=A/2,E=[];for(let B=0;B<m.length;B++){const K=m[B],Q=[];for(const Z of K){const I=zh(Z.style);h.font=I,Q.push({width:Sn._measureText(Z.text,Z.style.letterSpacing,h),font:I})}E.push(Q)}for(let B=0;B<w;++B){const K=_&&B===0,Q=K?Math.ceil(Math.max(1,T)+s*2):0,Z=Q*r;K||(h.shadowColor="rgba(0,0,0,0)");let I=C;for(let tt=0;tt<m.length;tt++){const it=m[tt],nt=g[tt],wt=x[tt],D=b[tt],L=E[tt];let et=C;et+=this._getAlignmentOffset(nt,S,n.align);let $=0;if(n.align==="justify"&&n.wordWrap&&tt<m.length-1){let q=0;for(const W of it)q+=Ls(W.text);q>0&&($=(S-nt)/q)}const at=I+wt;let R=et+s;for(let q=0;q<it.length;q++){const W=it[q],{width:J,font:rt}=L[q];if(h.font=rt,h.textBaseline=W.style.textBaseline,(k=W.style._stroke)!=null&&k.width){const dt=W.style._stroke;if(h.lineWidth=dt.width,h.miterLimit=dt.miterLimit,h.lineJoin=dt.join,h.lineCap=dt.cap,K)if(W.style.dropShadow)this._setupDropShadow(h,W.style,r,Z);else{const jt=Ls(W.text);R+=J+jt*$;continue}else{const jt=Sn.measureFont(rt),Et=W.style.lineHeight||jt.fontSize,Fe={width:J,height:Et,lineHeight:Et,lines:[W.text]};h.strokeStyle=$r(dt,h,Fe,s*2,R-s,I)}this._drawLetterSpacing(W.text,W.style,u,R,at+s-Q,!0,$)}const ct=Ls(W.text);R+=J+ct*$}R=et+s;for(let q=0;q<it.length;q++){const W=it[q],{width:J,font:rt}=L[q];if(h.font=rt,h.textBaseline=W.style.textBaseline,W.style._fill!==void 0){if(K)if(W.style.dropShadow)this._setupDropShadow(h,W.style,r,Z);else{const dt=Ls(W.text);R+=J+dt*$;continue}else{const dt=Sn.measureFont(rt),jt=W.style.lineHeight||dt.fontSize,Et={width:J,height:jt,lineHeight:jt,lines:[W.text]};h.fillStyle=$r(W.style._fill,h,Et,s*2,R-s,I)}this._drawLetterSpacing(W.text,W.style,u,R,at+s-Q,!1,$)}const ct=Ls(W.text);R+=J+ct*$}I+=D}}}_setFillAndStrokeStyles(t,n,s,r,u,c=0,h=0){var m;if(t.fillStyle=n._fill?$r(n._fill,t,s,r*2,c,h):null,(m=n._stroke)!=null&&m.width){const g=u+r*2;t.strokeStyle=$r(n._stroke,t,s,g,c,h)}}_setupDropShadow(t,n,s,r){t.fillStyle="black",t.strokeStyle="black";const u=n.dropShadow,c=u.color,h=u.alpha;t.shadowColor=ae.shared.setValue(c).setAlpha(h).toRgbaString();const m=u.blur*s,g=u.distance*s;t.shadowBlur=m,t.shadowOffsetX=Math.cos(u.angle)*g,t.shadowOffsetY=Math.sin(u.angle)*g+r}_getAlignmentOffset(t,n,s){return s==="right"?n-t:s==="center"?(n-t)/2:0}_drawLetterSpacing(t,n,s,r,u,c=!1,h=0){const{context:m}=s,g=n.letterSpacing;let p=!1;if(Sn.experimentalLetterSpacingSupported&&(Sn.experimentalLetterSpacing?(m.letterSpacing=`${g}px`,m.textLetterSpacing=`${g}px`,p=!0):(m.letterSpacing="0px",m.textLetterSpacing="0px")),(g===0||p)&&h===0){c?m.strokeText(t,r,u):m.fillText(t,r,u);return}if(h!==0&&(g===0||p)){const w=t.split(" ");let S=r;const A=m.measureText(" ").width;for(let C=0;C<w.length;C++)c?m.strokeText(w[C],S,u):m.fillText(w[C],S,u),S+=m.measureText(w[C]).width+A+h;return}let x=r;const b=Sn.graphemeSegmenter(t);let _=m.measureText(t).width,T=0;for(let w=0;w<b.length;++w){const S=b[w];c?m.strokeText(S,x,u):m.fillText(S,x,u);let A="";for(let C=w+1;C<b.length;++C)A+=b[C];T=m.measureText(A).width,x+=_-T+g,S===" "&&(x+=h),_=T}}}const Fs=new gT,Qh=class Kn extends Ti{constructor(t={}){super(),this.uid=Zt("textStyle"),this._tick=0,this._cachedFontString=null,pT(t),t instanceof Kn&&(t=t._toObject());const r={...Kn.defaultTextStyle,...t};for(const u in r){const c=u;this[c]=r[u]}this._tagStyles=t.tagStyles??void 0,this.update(),this._tick=0}get align(){return this._align}set align(t){this._align!==t&&(this._align=t,this.update())}get breakWords(){return this._breakWords}set breakWords(t){this._breakWords!==t&&(this._breakWords=t,this.update())}get dropShadow(){return this._dropShadow}set dropShadow(t){this._dropShadow!==t&&(t!==null&&typeof t=="object"?this._dropShadow=this._createProxy({...Kn.defaultDropShadow,...t}):this._dropShadow=t?this._createProxy({...Kn.defaultDropShadow}):null,this.update())}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily!==t&&(this._fontFamily=t,this.update())}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize!==t&&(typeof t=="string"?this._fontSize=parseInt(t,10):this._fontSize=t,this.update())}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle!==t&&(this._fontStyle=t.toLowerCase(),this.update())}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant!==t&&(this._fontVariant=t,this.update())}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.update())}get leading(){return this._leading}set leading(t){this._leading!==t&&(this._leading=t,this.update())}get letterSpacing(){return this._letterSpacing}set letterSpacing(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.update())}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight!==t&&(this._lineHeight=t,this.update())}get padding(){return this._padding}set padding(t){this._padding!==t&&(this._padding=t,this.update())}get filters(){return this._filters}set filters(t){this._filters!==t&&(this._filters=Object.freeze(t),this.update())}get trim(){return this._trim}set trim(t){this._trim!==t&&(this._trim=t,this.update())}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline!==t&&(this._textBaseline=t,this.update())}get whiteSpace(){return this._whiteSpace}set whiteSpace(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.update())}get wordWrap(){return this._wordWrap}set wordWrap(t){this._wordWrap!==t&&(this._wordWrap=t,this.update())}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.update())}get fill(){return this._originalFill}set fill(t){t!==this._originalFill&&(this._originalFill=t,this._isFillStyle(t)&&(this._originalFill=this._createProxy({...gi.defaultFillStyle,...t},()=>{this._fill=$n({...this._originalFill},gi.defaultFillStyle)})),this._fill=$n(t===0?"black":t,gi.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(t){t!==this._originalStroke&&(this._originalStroke=t,this._isFillStyle(t)&&(this._originalStroke=this._createProxy({...gi.defaultStrokeStyle,...t},()=>{this._stroke=ao({...this._originalStroke},gi.defaultStrokeStyle)})),this._stroke=ao(t,gi.defaultStrokeStyle),this.update())}get tagStyles(){return this._tagStyles}set tagStyles(t){this._tagStyles!==t&&(this._tagStyles=t??void 0,this.update())}update(){this._tick++,this._cachedFontString=null,this.emit("update",this)}reset(){const t=Kn.defaultTextStyle;for(const n in t)this[n]=t[n]}assign(t){for(const n in t){const s=n;this[s]=t[n]}return this}get styleKey(){return`${this.uid}-${this._tick}`}get _fontString(){return this._cachedFontString===null&&(this._cachedFontString=zh(this)),this._cachedFontString}_toObject(){return{align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill?{...this._fill}:void 0,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,leading:this.leading,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke?{...this._stroke}:void 0,textBaseline:this.textBaseline,trim:this.trim,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,filters:this._filters?[...this._filters]:void 0,tagStyles:this._tagStyles?{...this._tagStyles}:void 0}}clone(){return new Kn(this._toObject())}_getFinalPadding(){let t=0;if(this._filters)for(let n=0;n<this._filters.length;n++)t+=this._filters[n].padding;return Math.max(this._padding,t)}destroy(t=!1){var s,r,u,c;if(this.removeAllListeners(),typeof t=="boolean"?t:t==null?void 0:t.texture){const h=typeof t=="boolean"?t:t==null?void 0:t.textureSource;(s=this._fill)!=null&&s.texture&&this._fill.texture.destroy(h),(r=this._originalFill)!=null&&r.texture&&this._originalFill.texture.destroy(h),(u=this._stroke)!=null&&u.texture&&this._stroke.texture.destroy(h),(c=this._originalStroke)!=null&&c.texture&&this._originalStroke.texture.destroy(h)}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null}_createProxy(t,n){return new Proxy(t,{set:(s,r,u)=>(s[r]===u||(s[r]=u,n==null||n(r,u),this.update()),!0)})}_isFillStyle(t){return(t??null)!==null&&!(ae.isColorLike(t)||t instanceof Wi||t instanceof fo)}};Qh.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};Qh.defaultTextStyle={align:"left",breakWords:!1,dropShadow:null,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let An=Qh;function pT(l){const t=l;if(typeof t.dropShadow=="boolean"&&t.dropShadow){const n=An.defaultDropShadow;l.dropShadow={alpha:t.dropShadowAlpha??n.alpha,angle:t.dropShadowAngle??n.angle,blur:t.dropShadowBlur??n.blur,color:t.dropShadowColor??n.color,distance:t.dropShadowDistance??n.distance}}if(t.strokeThickness!==void 0){At(Qt,"strokeThickness is now a part of stroke");const n=t.stroke;let s={};if(ae.isColorLike(n))s.color=n;else if(n instanceof Wi||n instanceof fo)s.fill=n;else if(Object.hasOwnProperty.call(n,"color")||Object.hasOwnProperty.call(n,"fill"))s=n;else throw new Error("Invalid stroke value.");l.stroke={...s,width:t.strokeThickness}}if(Array.isArray(t.fillGradientStops)){if(At(Qt,"gradient fill is now a fill pattern: `new FillGradient(...)`"),!Array.isArray(t.fill)||t.fill.length===0)throw new Error("Invalid fill value. Expected an array of colors for gradient fill.");t.fill.length!==t.fillGradientStops.length&&Se("The number of fill colors must match the number of fill gradient stops.");const n=new Wi({start:{x:0,y:0},end:{x:0,y:1},textureSpace:"local"}),s=t.fillGradientStops.slice(),r=t.fill.map(u=>ae.shared.setValue(u).toNumber());s.forEach((u,c)=>{n.addColorStop(u,r[c])}),l.fill={fill:n}}}function yT(l,t){const{texture:n,bounds:s}=l,r=t._style._getFinalPadding();By(s,t._anchor,n);const u=t._anchor._x*r*2,c=t._anchor._y*r*2;s.minX-=r-u,s.minY-=r-c,s.maxX-=r-u,s.maxY-=r-c}class xT{constructor(){this.batcherName="default",this.topology="triangle-list",this.attributeSize=4,this.indexSize=6,this.packAsQuad=!0,this.roundPixels=0,this._attributeStart=0,this._batcher=null,this._batch=null}get blendMode(){return this.renderable.groupBlendMode}get color(){return this.renderable.groupColorAlpha}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.bounds=null}destroy(){this.reset()}}class _T extends xT{}class I0{constructor(t){this._renderer=t,t.runners.resolutionChange.add(this),this._managedTexts=new yl({renderer:t,type:"renderable",onUnload:this.onTextUnload.bind(this),name:"canvasText"})}resolutionChange(){for(const t in this._managedTexts.items){const n=this._managedTexts.items[t];n!=null&&n._autoResolution&&n.onViewUpdate()}}validateRenderable(t){const n=this._getGpuText(t),s=t.styleKey;return n.currentKey!==s?!0:t._didTextUpdate}addRenderable(t,n){const s=this._getGpuText(t);if(t._didTextUpdate){const r=t._autoResolution?this._renderer.resolution:t.resolution;(s.currentKey!==t.styleKey||t._resolution!==r)&&this._updateGpuText(t),t._didTextUpdate=!1,yT(s,t)}this._renderer.renderPipes.batch.addToBatch(s,n)}updateRenderable(t){const n=this._getGpuText(t);n._batcher.updateElement(n)}_updateGpuText(t){const n=this._getGpuText(t);n.texture&&this._renderer.canvasText.decreaseReferenceCount(n.currentKey),t._resolution=t._autoResolution?this._renderer.resolution:t.resolution,n.texture=this._renderer.canvasText.getManagedTexture(t),n.currentKey=t.styleKey}_getGpuText(t){return t._gpuData[this._renderer.uid]||this.initGpuText(t)}initGpuText(t){const n=new _T;return n.currentKey="--",n.renderable=t,n.transform=t.groupTransform,n.bounds={minX:0,maxX:1,minY:0,maxY:0},n.roundPixels=this._renderer._roundPixels|t._roundPixels,t._gpuData[this._renderer.uid]=n,this._managedTexts.add(t),n}onTextUnload(t){const n=t._gpuData[this._renderer.uid];if(!n)return;const{canvasText:s}=this._renderer;s.getReferenceCount(n.currentKey)>0?s.decreaseReferenceCount(n.currentKey):n.texture&&s.returnTexture(n.texture)}destroy(){this._managedTexts.destroy(),this._renderer=null}}I0.extension={type:[yt.WebGLPipes,yt.WebGPUPipes,yt.CanvasPipes],name:"text"};const bT=new ri;function vT(l,t,n,s,r=!1){const u=bT;u.minX=0,u.minY=0,u.maxX=l.width/s|0,u.maxY=l.height/s|0;const c=oo.getOptimalTexture(u.width,u.height,s,!1,r);return c.source.uploadMethodId="image",c.source.resource=l,c.source.alphaMode="premultiply-alpha-on-upload",c.frame.width=t/s,c.frame.height=n/s,c.source.emit("update",c.source),c.updateUvs(),c}class K0{constructor(t,n){this._activeTextures={},this._renderer=t,this._retainCanvasContext=n}getTexture(t,n,s,r){typeof t=="string"&&(At("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),t={text:t,style:s,resolution:n}),t.style instanceof An||(t.style=new An(t.style)),t.textureStyle instanceof Qs||(t.textureStyle=new Qs(t.textureStyle)),typeof t.text!="string"&&(t.text=t.text.toString());const{text:u,style:c,textureStyle:h,autoGenerateMipmaps:m}=t,g=t.resolution??this._renderer.resolution,{frame:p,canvasAndContext:x}=Fs.getCanvasAndContext({text:u,style:c,resolution:g}),b=vT(x.canvas,p.width,p.height,g,m);if(h&&(b.source.style=h),c.trim&&(p.pad(c.padding),b.frame.copyFrom(p),b.frame.scale(1/g),b.updateUvs()),c.filters){const _=this._applyFilters(b,c.filters);return this.returnTexture(b),Fs.returnCanvasAndContext(x),_}return this._renderer.texture.initSource(b._source),this._retainCanvasContext||Fs.returnCanvasAndContext(x),b}returnTexture(t){const n=t.source,s=n.resource;if(this._retainCanvasContext&&(s!=null&&s.getContext)){const r=s.getContext("2d");r&&Fs.returnCanvasAndContext({canvas:s,context:r})}n.resource=null,n.uploadMethodId="unknown",n.alphaMode="no-premultiply-alpha",oo.returnTexture(t,!0)}renderTextToCanvas(){At("8.10.0","CanvasTextSystem.renderTextToCanvas: no longer supported, use CanvasTextSystem.getTexture instead")}getManagedTexture(t){t._resolution=t._autoResolution?this._renderer.resolution:t.resolution;const n=t.styleKey;if(this._activeTextures[n])return this._increaseReferenceCount(n),this._activeTextures[n].texture;const s=this.getTexture({text:t.text,style:t.style,resolution:t._resolution,textureStyle:t.textureStyle,autoGenerateMipmaps:t.autoGenerateMipmaps});return this._activeTextures[n]={texture:s,usageCount:1},s}decreaseReferenceCount(t){const n=this._activeTextures[t];n&&(n.usageCount--,n.usageCount===0&&(this.returnTexture(n.texture),this._activeTextures[t]=null))}getReferenceCount(t){var n;return((n=this._activeTextures[t])==null?void 0:n.usageCount)??0}_increaseReferenceCount(t){this._activeTextures[t].usageCount++}_applyFilters(t,n){const s=this._renderer.renderTarget.renderTarget,r=this._renderer.filter.generateFilteredTexture({texture:t,filters:n});return this._renderer.renderTarget.bind(s,!1),r}destroy(){this._renderer=null;for(const t in this._activeTextures)this._activeTextures[t]&&this.returnTexture(this._activeTextures[t].texture);this._activeTextures=null}}class $0 extends K0{constructor(t){super(t,!0)}}$0.extension={type:[yt.CanvasSystem],name:"canvasText"};class J0 extends K0{constructor(t){super(t,!1)}}J0.extension={type:[yt.WebGLSystem,yt.WebGPUSystem],name:"canvasText"};Jt.add($0);Jt.add(J0);Jt.add(I0);class ro extends X2{constructor(...t){const n=V2(t,"Text");super(n,An),this.renderPipeId="text",n.textureStyle&&(this.textureStyle=n.textureStyle instanceof Qs?n.textureStyle:new Qs(n.textureStyle)),this.autoGenerateMipmaps=n.autoGenerateMipmaps??oi.defaultOptions.autoGenerateMipmaps}updateBounds(){const t=this._bounds,n=this._anchor;let s=0,r=0;if(this._style.trim){const{frame:u,canvasAndContext:c}=Fs.getCanvasAndContext({text:this.text,style:this._style,resolution:1});Fs.returnCanvasAndContext(c),s=u.width,r=u.height}else{const u=Sn.measureText(this._text,this._style);s=u.width,r=u.height}t.minX=-n._x*s,t.maxX=t.minX+s,t.minY=-n._y*r,t.maxY=t.minY+r}}Jt.add(W1,Q1);const Xs=80,Tn=40;function qt(l,t){return{x:(l-t)*(Xs/2),y:(l+t)*(Tn/2)}}const vy={sage:16766720,nova:49151,aria:11894492,dex:5294200,flux:4286945,quinn:16747520,gage:2142890,morgan:16738740,uma:9055202,river:52945,atlas:7372944},ST={sage:16111288,nova:13016173,aria:16111299,dex:9262372,flux:16111288,quinn:15254686,gage:9262372,morgan:16111299,uma:13016173,river:16111288,atlas:15254686},TT={sage:2763306,nova:1710650,aria:9062954,dex:657930,flux:4864538,quinn:4860442,gage:657930,morgan:9054746,uma:2759226,river:5921370,atlas:6974058},wT={sage:0,nova:0,aria:2,dex:3,flux:0,quinn:1,gage:0,morgan:2,uma:4,river:1,atlas:0},AT={coding:65416,reviewing:49151,testing:10181046,planning:16766720,blocked:16729156,deploying:16739125,thinking:13421772};class CT{constructor(t){Xt(this,"container");Xt(this,"body");Xt(this,"glow");Xt(this,"statusBubble");Xt(this,"label");Xt(this,"statusLabel");Xt(this,"shadow");Xt(this,"statusDot");Xt(this,"pulseOffset",Math.random()*Math.PI*2);Xt(this,"targetX",0);Xt(this,"targetY",0);Xt(this,"currentX",0);Xt(this,"currentY",0);Xt(this,"lastStatus","");Xt(this,"lastRoom","");Xt(this,"lastSeat",-1);this.container=new De,this.container.sortableChildren=!0,vy[t.id],this.shadow=new ye,this.shadow.zIndex=0,this.container.addChild(this.shadow),this.glow=new ye,this.glow.zIndex=1,this.glow.visible=!1,this.container.addChild(this.glow),this.body=new ye,this.drawPixelPerson(this.body,t.id),this.body.zIndex=2,this.container.addChild(this.body),this.statusBubble=new ye,this.statusBubble.zIndex=4,this.statusBubble.visible=!1,this.container.addChild(this.statusBubble),this.statusDot=new ye,this.statusDot.zIndex=5,this.statusDot.visible=!1,this.container.addChild(this.statusDot),this.label=new ro({text:t.name,style:new An({fontSize:10,fill:"#ffffff",fontFamily:"'Courier New', 'Consolas', monospace",fontWeight:"700",letterSpacing:.5,dropShadow:{color:"#000000",blur:3,distance:1,alpha:.9},stroke:{color:"#000000",width:2.5}})}),this.label.anchor.set(.5,0),this.label.y=18,this.label.zIndex=5,this.container.addChild(this.label),this.statusLabel=new ro({text:"",style:new An({fontSize:8,fill:13421772,fontFamily:"'Courier New', 'Consolas', monospace",fontWeight:"400",dropShadow:{color:"#000000",blur:3,distance:1,alpha:.9},stroke:{color:"#000000",width:1.5}})}),this.statusLabel.anchor.set(.5,0),this.statusLabel.y=30,this.statusLabel.zIndex=5,this.statusLabel.visible=!1,this.container.addChild(this.statusLabel),this.setPositionFromRoom(t.position_room,t.position_seat),this.currentX=this.targetX,this.currentY=this.targetY,this.container.x=this.currentX,this.container.y=this.currentY,this.lastRoom=t.position_room,this.lastSeat=t.position_seat}drawPixelPerson(t,n){const s=vy[n]||13421772,r=ST[n]||16111288,u=TT[n]||2763306,c=wT[n]||0,h=3;switch(c){case 0:t.rect(-3*h,-12*h,6*h,3*h),t.fill({color:u});break;case 1:t.rect(-3*h,-12*h,6*h,4*h),t.fill({color:u}),t.rect(-4*h,-11*h,1*h,4*h),t.fill({color:u}),t.rect(3*h,-11*h,1*h,4*h),t.fill({color:u});break;case 2:t.rect(-3*h,-12*h,6*h,3*h),t.fill({color:u}),t.rect(-4*h,-11*h,1*h,7*h),t.fill({color:u}),t.rect(3*h,-11*h,1*h,7*h),t.fill({color:u});break;case 3:t.rect(-1*h,-14*h,2*h,2*h),t.fill({color:u}),t.rect(-2*h,-12*h,4*h,2*h),t.fill({color:u});break;case 4:t.rect(-3*h,-12*h,6*h,3*h),t.fill({color:u}),t.rect(-1*h,-14*h,2*h,2*h),t.fill({color:u});break}t.rect(-3*h,-10*h,6*h,5*h),t.fill({color:r}),t.rect(-2*h,-8*h,1*h,1*h),t.fill({color:1118481}),t.rect(1*h,-8*h,1*h,1*h),t.fill({color:1118481}),t.rect(-1*h,-6*h,2*h,1*h),t.fill({color:Jr(r,.2)}),t.rect(-4*h,-5*h,8*h,6*h),t.fill({color:s}),t.rect(-2*h,-5*h,4*h,1*h),t.fill({color:Jr(s,.15)}),t.rect(-5*h,-4*h,1*h,5*h),t.fill({color:Jr(s,.1)}),t.rect(-5*h,1*h,1*h,1*h),t.fill({color:r}),t.rect(4*h,-4*h,1*h,5*h),t.fill({color:Jr(s,.1)}),t.rect(4*h,1*h,1*h,1*h),t.fill({color:r}),t.rect(-3*h,1*h,3*h,4*h),t.fill({color:2236979}),t.rect(0,1*h,3*h,4*h),t.fill({color:2763322}),t.rect(-4*h,5*h,3*h,1*h),t.fill({color:1710618}),t.rect(1*h,5*h,3*h,1*h),t.fill({color:1710618})}drawStatusBubble(t,n,s){t.clear(),t.roundRect(-14,-42,28,16,4),t.fill({color:2236979,alpha:.9}),t.stroke({color:5592422,width:1}),t.circle(0,-26,2.5),t.fill({color:2236979,alpha:.85}),t.circle(2,-22,1.5),t.fill({color:2236979,alpha:.7})}setPositionFromRoom(t,n){const s=Ay(t,n);if(s){const r=qt(s.col,s.row);this.targetX=r.x,this.targetY=r.y}}update(t){(t.position_room!==this.lastRoom||t.position_seat!==this.lastSeat)&&(this.setPositionFromRoom(t.position_room,t.position_seat),this.lastRoom=t.position_room,this.lastSeat=t.position_seat);const n=this.targetX-this.currentX,s=this.targetY-this.currentY,r=Math.sqrt(n*n+s*s),u=r>1.5;if(u){const g=r>80?3:r>30?2:Math.max(r*.08,.6);this.currentX+=n/r*g,this.currentY+=s/r*g}else this.currentX=this.targetX,this.currentY=this.targetY;this.pulseOffset+=.03;const c=t.status!=="idle";let h=0;u&&(h=Math.round(Math.abs(Math.sin(this.pulseOffset*6))*2)),this.container.x=this.currentX,this.container.y=this.currentY-h,this.container.zIndex=this.currentY+100,this.shadow.clear(),this.shadow.ellipse(0,10,9,4),this.shadow.fill({color:0,alpha:.25});const m=AT[t.status];if(m&&c){this.glow.visible=!0,this.glow.clear();const g=.15+Math.sin(this.pulseOffset*2)*.08;this.glow.ellipse(0,10,12,5),this.glow.stroke({color:m,width:1.5,alpha:g}),this.statusBubble.visible=!0,this.drawStatusBubble(this.statusBubble,t.status,m),this.statusDot.visible=!0,this.statusDot.clear();const p=this.label.width/2+5;this.statusDot.circle(p,23,3),this.statusDot.fill({color:m})}else this.glow.visible=!1,this.statusBubble.visible=!1,this.statusDot.visible=!1;c&&t.status!==this.lastStatus?(this.statusLabel.text=t.status,this.statusLabel.style.fill=m||13421772,this.statusLabel.visible=!0):c||(this.statusLabel.visible=!1),this.lastStatus=t.status}}function Jr(l,t){const n=Math.max(0,(l>>16&255)*(1-t)),s=Math.max(0,(l>>8&255)*(1-t)),r=Math.max(0,(l&255)*(1-t));return Math.round(n)<<16|Math.round(s)<<8|Math.round(r)}const oe=52,ni=4;class MT{constructor(){Xt(this,"app");Xt(this,"world");Xt(this,"agentSprites",new Map);Xt(this,"initialized",!1);this.app=new C0,this.world=new De}async init(t){this.initialized||(this.initialized=!0,await this.app.init({canvas:t,resizeTo:t.parentElement,background:1710632,antialias:!1,autoDensity:!0,resolution:window.devicePixelRatio||1}),this.app.stage.addChild(this.world),this.world.sortableChildren=!0,this.centerCamera(),this.drawBuilding(),window.addEventListener("resize",()=>this.centerCamera()))}centerCamera(){const t=this.app.screen.width,n=this.app.screen.height,s=qt(Oc.w/2,Oc.h/2);this.world.x=t/2-s.x,this.world.y=n/2.5-s.y}drawBuilding(){this.drawBuildingShell();for(const t of si)this.drawRoomFloor(t);this.drawInternalWalls();for(const t of si){const n=parseInt(t.color.slice(1),16);for(const s of L1.filter(r=>r.room===t.id))this.drawFurniture(s,n,t)}this.drawRoomLabels()}drawBuildingShell(){const t=new De;t.sortableChildren=!0;const{col:n,row:s,w:r,h:u}=Oc,c=qt(n,s),h=qt(n+r,s),m=qt(n,s+u),g=new ye;g.poly([{x:c.x,y:c.y},{x:c.x,y:c.y-oe},{x:h.x,y:h.y-oe},{x:h.x,y:h.y}]),g.fill({color:5921390});for(let w=1;w<=5;w++){const S=w/6;g.moveTo(c.x,c.y-oe*(1-S)),g.lineTo(h.x,h.y-oe*(1-S)),g.stroke({color:5263460,width:1,alpha:.4})}g.zIndex=-10,t.addChild(g);const p=new ye;p.poly([{x:c.x,y:c.y-oe},{x:c.x+ni,y:c.y-oe-ni/2},{x:h.x+ni,y:h.y-oe-ni/2},{x:h.x,y:h.y-oe}]),p.fill({color:7500426}),p.zIndex=-9,t.addChild(p);const x=new ye;x.poly([{x:c.x,y:c.y},{x:c.x,y:c.y-oe},{x:m.x,y:m.y-oe},{x:m.x,y:m.y}]),x.fill({color:5131874});for(let w=1;w<=5;w++){const S=w/6;x.moveTo(c.x,c.y-oe*(1-S)),x.lineTo(m.x,m.y-oe*(1-S)),x.stroke({color:4473944,width:1,alpha:.4})}x.zIndex=-10,t.addChild(x);const b=new ye;b.poly([{x:c.x,y:c.y-oe},{x:c.x+ni,y:c.y-oe-ni/2},{x:m.x+ni,y:m.y-oe-ni/2},{x:m.x,y:m.y-oe}]),b.fill({color:6842496}),b.zIndex=-9,t.addChild(b);const _=qt(n+r/2,s),T=new ro({text:"SAGE TEAM HQ",style:new An({fontSize:12,fill:"#ffffff",fontFamily:"'Courier New', 'Consolas', monospace",fontWeight:"700",letterSpacing:2,dropShadow:{color:"#000000",blur:4,distance:1,alpha:.8},stroke:{color:"#000000",width:2}})});T.anchor.set(.5,.5),T.x=_.x,T.y=_.y-oe-8,T.zIndex=-8,t.addChild(T),this.world.addChild(t)}drawRoomFloor(t){const n=new De;n.sortableChildren=!0;const s=qt(t.col+t.w,t.row+t.h);n.zIndex=s.y-1e3;const r=parseInt(t.floorColor.slice(1),16);for(let u=0;u<t.w;u++)for(let c=0;c<t.h;c++){const h=qt(t.col+u,t.row+c),m=new ye,g=(u+c)%2===0;m.poly([{x:0,y:0},{x:Xs/2,y:Tn/2},{x:0,y:Tn},{x:-Xs/2,y:Tn/2}]),m.fill({color:g?r:Sy(r,.05)}),m.poly([{x:0,y:0},{x:Xs/2,y:Tn/2},{x:0,y:Tn},{x:-Xs/2,y:Tn/2}]),m.stroke({color:0,width:.5,alpha:.08}),m.x=h.x,m.y=h.y,n.addChild(m)}this.world.addChild(n)}drawRoomLabels(){for(const t of si){const n=qt(t.col+t.w/2,t.row+.4),s=new ro({text:`${t.icon} ${t.label}`,style:new An({fontSize:9,fill:"#ffffff",fontFamily:"'Courier New', 'Consolas', monospace",fontWeight:"700",letterSpacing:.5,dropShadow:{color:"#000000",blur:3,distance:1,alpha:.9},stroke:{color:"#000000",width:2.5}})});s.anchor.set(.5,.5),s.x=n.x,s.y=n.y,s.zIndex=n.y+501,this.world.addChild(s)}}drawInternalWalls(){const t=new De;t.sortableChildren=!0;const n=[];for(let s=0;s<si.length;s++)for(let r=s+1;r<si.length;r++){const u=si[s],c=si[r];if(u.row+u.h===c.row){const h=Math.max(u.col,c.col),m=Math.min(u.col+u.w,c.col+c.w);h<m&&n.push({from:qt(h,u.row+u.h),to:qt(m,u.row+u.h),side:"h"})}if(c.row+c.h===u.row){const h=Math.max(u.col,c.col),m=Math.min(u.col+u.w,c.col+c.w);h<m&&n.push({from:qt(h,c.row+c.h),to:qt(m,c.row+c.h),side:"h"})}if(u.col+u.w===c.col){const h=Math.max(u.row,c.row),m=Math.min(u.row+u.h,c.row+c.h);h<m&&n.push({from:qt(u.col+u.w,h),to:qt(u.col+u.w,m),side:"v"})}if(c.col+c.w===u.col){const h=Math.max(u.row,c.row),m=Math.min(u.row+u.h,c.row+c.h);h<m&&n.push({from:qt(c.col+c.w,h),to:qt(c.col+c.w,m),side:"v"})}}for(const s of n){const r=oe*.7,u=new ye,c=s.side==="h"?5789800:5263456;u.poly([s.from,{x:s.from.x,y:s.from.y-r},{x:s.to.x,y:s.to.y-r},s.to]),u.fill({color:c});for(let b=1;b<=3;b++){const _=b/4;u.moveTo(s.from.x,s.from.y-r*(1-_)),u.lineTo(s.to.x,s.to.y-r*(1-_)),u.stroke({color:Sy(c,.08),width:1,alpha:.5})}const h=s.side==="h"?7237248:6710904;u.poly([{x:s.from.x,y:s.from.y-r},{x:s.from.x+ni*.8,y:s.from.y-r-ni*.4},{x:s.to.x+ni*.8,y:s.to.y-r-ni*.4},{x:s.to.x,y:s.to.y-r}]),u.fill({color:h});const m=(s.from.x+s.to.x)/2,g=(s.from.y+s.to.y)/2,p=s.side==="h"?8:5,x=r*.78;u.rect(m-p,g-x,p*2,x),u.fill({color:1184286}),u.rect(m-p-1,g-x-1,p*2+2,2),u.fill({color:8026766}),u.zIndex=Math.max(s.from.y,s.to.y)-500,t.addChild(u)}this.world.addChild(t)}drawFurniture(t,n,s){const r=qt(t.col,t.row),u=new ye;switch(u.zIndex=r.y,t.type){case"desk":{u.poly([{x:r.x,y:r.y-5},{x:r.x+24,y:r.y+7},{x:r.x,y:r.y+19},{x:r.x-24,y:r.y+7}]),u.fill({color:9137994}),u.poly([{x:r.x,y:r.y-4},{x:r.x+20,y:r.y+6},{x:r.x,y:r.y+16},{x:r.x-20,y:r.y+6}]),u.fill({color:10518616}),u.poly([{x:r.x+24,y:r.y+7},{x:r.x,y:r.y+19},{x:r.x,y:r.y+22},{x:r.x+24,y:r.y+10}]),u.fill({color:7032880}),u.poly([{x:r.x,y:r.y+19},{x:r.x-24,y:r.y+7},{x:r.x-24,y:r.y+10},{x:r.x,y:r.y+22}]),u.fill({color:5914664});break}case"monitor":{u.rect(r.x-16/2,r.y-12-6,16,12),u.fill({color:2763306}),u.rect(r.x-16/2+1,r.y-12-5,14,10),u.fill({color:1716304});const m=[6732799,8969642,16755302,6732799,14540253];for(let g=0;g<5;g++){const p=3+(g*7+3)%9;u.rect(r.x-16/2+3,r.y-12-3+g*2.2,p,1),u.fill({color:m[g],alpha:.7})}u.rect(r.x-16/2+1,r.y-12-5,14,10),u.fill({color:4491468,alpha:.08}),u.rect(r.x-1,r.y-6,3,3),u.fill({color:3355443}),u.rect(r.x-4,r.y-3,9,2),u.fill({color:3355443});break}case"plant":{u.poly([{x:r.x-4,y:r.y+2},{x:r.x+4,y:r.y+2},{x:r.x+3,y:r.y+9},{x:r.x-3,y:r.y+9}]),u.fill({color:9132602}),u.rect(r.x-5,r.y+1,10,2),u.fill({color:10185290}),u.circle(r.x,r.y-3,7),u.fill({color:2984526,alpha:.85}),u.circle(r.x-3,r.y-1,5),u.fill({color:2263842,alpha:.8}),u.circle(r.x+3,r.y-1,5),u.fill({color:3978097,alpha:.8}),u.circle(r.x,r.y-7,5),u.fill({color:4569192,alpha:.75});break}case"server":{u.rect(r.x-6,r.y-16,12,22),u.fill({color:1710632}),u.stroke({color:2763322,width:1});for(let c=0;c<5;c++){const h=r.y-14+c*4;u.rect(r.x-5,h,10,3),u.fill({color:2236979})}for(let c=0;c<5;c++){const h=r.y-13+c*4;u.rect(r.x-4,h,2,2),u.fill({color:c<3?65416:49151}),u.rect(r.x+2,h,2,2),u.fill({color:16747520,alpha:.4+c*.12})}break}case"shelf":{u.rect(r.x-12,r.y-12,24,20),u.fill({color:5914656}),u.stroke({color:7032880,width:1}),u.rect(r.x-11,r.y-4,22,2),u.fill({color:7032880}),u.rect(r.x-11,r.y+3,22,2),u.fill({color:7032880});const c=[4878245,12865106,9419919,13935988,8087790];for(let h=0;h<5;h++){const m=r.x-10+h*4.5,g=4+h*13%4;u.rect(m,r.y-10+(7-g),3,g),u.fill({color:c[h]})}for(let h=0;h<4;h++){const m=r.x-9+h*5.5,g=3+h*7%3;u.rect(m,r.y-3+(5-g),3,g),u.fill({color:c[(h+2)%5]})}break}case"whiteboard":{u.rect(r.x-14,r.y-12,28,20),u.fill({color:5592416}),u.rect(r.x-12,r.y-10,24,16),u.fill({color:14540256,alpha:.3}),u.rect(r.x-9,r.y-8,12,1),u.fill({color:4482730,alpha:.5}),u.rect(r.x-7,r.y-5,16,1),u.fill({color:4500070,alpha:.4}),u.rect(r.x-5,r.y-2,10,1),u.fill({color:11158596,alpha:.35}),u.rect(r.x-9,r.y+6,18,2),u.fill({color:5592416}),u.rect(r.x-3,r.y+6,2,2),u.fill({color:16729156}),u.rect(r.x,r.y+6,2,2),u.fill({color:4504388}),u.rect(r.x+3,r.y+6,2,2),u.fill({color:4491519});break}case"table":{u.poly([{x:r.x,y:r.y-5},{x:r.x+30,y:r.y+10},{x:r.x,y:r.y+25},{x:r.x-30,y:r.y+10}]),u.fill({color:7035450}),u.poly([{x:r.x,y:r.y-3},{x:r.x+26,y:r.y+10},{x:r.x,y:r.y+23},{x:r.x-26,y:r.y+10}]),u.fill({color:9138256}),u.poly([{x:r.x+30,y:r.y+10},{x:r.x,y:r.y+25},{x:r.x,y:r.y+28},{x:r.x+30,y:r.y+13}]),u.fill({color:4864544});break}case"couch":{u.roundRect(r.x-14,r.y-5,28,6,2),u.fill({color:9127187}),u.rect(r.x-13,r.y+1,12,7),u.fill({color:10506797}),u.rect(r.x+1,r.y+1,12,7),u.fill({color:10506797}),u.rect(r.x-15,r.y-3,3,10),u.fill({color:9127187}),u.rect(r.x+12,r.y-3,3,10),u.fill({color:9127187}),u.rect(r.x-9,r.y-2,6,4),u.fill({color:n,alpha:.35});break}case"coffee":{u.poly([{x:r.x,y:r.y-1},{x:r.x+12,y:r.y+5},{x:r.x,y:r.y+11},{x:r.x-12,y:r.y+5}]),u.fill({color:7032880}),u.poly([{x:r.x+12,y:r.y+5},{x:r.x,y:r.y+11},{x:r.x,y:r.y+13},{x:r.x+12,y:r.y+7}]),u.fill({color:4864032}),u.rect(r.x,r.y+1,4,4),u.fill({color:15790320,alpha:.6}),u.rect(r.x+1,r.y+2,2,2),u.fill({color:5910544,alpha:.7});break}case"chair":{u.ellipse(r.x,r.y+1,6,3),u.fill({color:3355464}),u.rect(r.x-4,r.y-4,8,4),u.fill({color:2763328});break}case"rug":{const c=Xs*1.2,h=Tn*1.2;u.poly([{x:r.x,y:r.y},{x:r.x+c/2,y:r.y+h/2},{x:r.x,y:r.y+h},{x:r.x-c/2,y:r.y+h/2}]),u.fill({color:n,alpha:.08}),u.zIndex=r.y-1e3;break}}this.world.addChild(u)}updateAgents(t){for(const n of t){let s=this.agentSprites.get(n.id);s||(s=new CT(n),this.agentSprites.set(n.id,s),this.world.addChild(s.container)),s.update(n)}}destroy(){window.removeEventListener("resize",()=>this.centerCamera()),this.app.destroy(!0)}}function Sy(l,t){const n=Math.max(0,(l>>16&255)*(1-t)),s=Math.max(0,(l>>8&255)*(1-t)),r=Math.max(0,(l&255)*(1-t));return Math.round(n)<<16|Math.round(s)<<8|Math.round(r)}class ET{constructor(){Xt(this,"container");Xt(this,"particles",[]);this.container=new De}confetti(t,n){const s=[16766720,65416,49151,16738740,16739125];for(let r=0;r<30;r++){const u=Math.random()*Math.PI*2,c=1+Math.random()*3;this.addParticle(t,n,Math.cos(u)*c,Math.sin(u)*c-2,60+Math.random()*40,s[Math.floor(Math.random()*s.length)],2+Math.random()*3)}}redPulse(t,n){for(let s=0;s<12;s++){const r=s/12*Math.PI*2;this.addParticle(t,n,Math.cos(r)*1.5,Math.sin(r)*1.5,50,16729156,4)}}greenFlash(t,n){for(let s=0;s<8;s++){const r=s/8*Math.PI*2;this.addParticle(t,n,Math.cos(r)*2,Math.sin(r)*2-1,40,65416,3)}}addParticle(t,n,s,r,u,c,h){const m=new ye;m.rect(-h/2,-h/2,h,h),m.fill({color:c}),m.x=t,m.y=n,this.container.addChild(m),this.particles.push({x:t,y:n,vx:s,vy:r,life:u,maxLife:u,color:c,size:h,gfx:m})}tick(){for(let t=this.particles.length-1;t>=0;t--){const n=this.particles[t];n.x+=n.vx,n.y+=n.vy,n.vy+=.05,n.life--,n.gfx.x=n.x,n.gfx.y=n.y,n.gfx.alpha=n.life/n.maxLife,n.life<=0&&(this.container.removeChild(n.gfx),n.gfx.destroy(),this.particles.splice(t,1))}}}function RT(l){const t=Ve.useRef(null),n=Ve.useRef(null);return Ve.useEffect(()=>{const s=document.getElementById(l);if(!s)return;const r=new MT,u=new ET;return t.current=r,n.current=u,r.init(s).then(()=>{r.world.addChild(u.container),r.app.ticker.add(()=>{const c=ht.getState();r.updateAgents(c.agents.map(m=>({id:m.id,name:m.name,status:m.status,position_room:m.position_room,position_seat:m.position_seat})));let h=c.popWow();for(;h;)zT(h,u),h=c.popWow();u.tick()})}),()=>{r.destroy()}},[l]),{officeRef:t,effectsRef:n}}function zT(l,t){if(!l)return;const{updateAgent:n}=ht.getState();switch(l.type){case"pr:merged":{const s=si.find(r=>r.id==="dev-bullpen");if(s){const r=qt(s.col+s.w/2,s.row+s.h/2);t.confetti(r.x,r.y)}break}case"crisis:start":{const s=si.find(r=>r.id==="crisis-room");if(s){const r=qt(s.col+s.w/2,s.row+s.h/2);t.redPulse(r.x,r.y)}break}case"crisis:resolved":{const s=si.find(r=>r.id==="crisis-room");if(s){const r=qt(s.col+s.w/2,s.row+s.h/2);t.greenFlash(r.x,r.y)}break}case"deploy:success":{const s=Ay("qa-lab",1);if(s){const r=qt(s.col,s.row);t.confetti(r.x,r.y),t.greenFlash(r.x,r.y)}break}case"sprint:complete":{const s=ht.getState().agents;for(const u of s)n(u.id,{position_room:"lounge",position_seat:0});const r=si.find(u=>u.id==="lounge");if(r){const u=qt(r.col+r.w/2,r.row+r.h/2);t.confetti(u.x,u.y),t.confetti(u.x+30,u.y-10),t.confetti(u.x-30,u.y+10)}setTimeout(()=>{const u=ht.getState().agents;for(const c of u){const h=nl[c.id];h&&n(c.id,{position_room:h.room,position_seat:h.seat})}},8e3);break}case"meeting:start":{const s=l.agents||Object.keys(rp);for(const u of s){const c=rp[u];c!==void 0&&n(u,{position_room:"meeting-room",position_seat:c})}const r=si.find(u=>u.id==="meeting-room");if(r){const u=qt(r.col+r.w/2,r.row+r.h/2);t.greenFlash(u.x,u.y)}break}case"meeting:end":{const s=ht.getState().agents;for(const r of s){const u=nl[r.id];u&&n(r.id,{position_room:u.room,position_seat:u.seat})}break}case"pair:start":{if(l.agents&&l.agents.length>=2)for(const s of l.agents)n(s,{position_room:"dev-bullpen",position_seat:l.agents.indexOf(s)});break}case"pair:end":{const s=ht.getState().agents;for(const r of s){const u=nl[r.id];u&&r.position_room==="dev-bullpen"&&n(r.id,{position_room:u.room,position_seat:u.seat})}break}}}const DT={sage:"👑",nova:"🔬",aria:"🏛️",dex:"⚡",flux:"🌊",quinn:"🔍",gage:"⚙️",morgan:"📋",uma:"🎨",river:"🌀",atlas:"📊"},Ty={sage:"#FFD700",nova:"#00BFFF",aria:"#b57edc",dex:"#50c878",flux:"#4169e1",quinn:"#ff8c00",gage:"#20b2aa",morgan:"#ff69b4",uma:"#8a2be2",river:"#00ced1",atlas:"#708090"},NT={idle:"#555",coding:"#00ff88",reviewing:"#00bfff",testing:"#9b59b6",planning:"#ffd700",meeting:"#ff69b4",blocked:"#ff4444",deploying:"#ff6b35"};function BT(){const l=ht(s=>s.agents),t=ht(s=>s.selectedAgent),n=ht(s=>s.setSelectedAgent);return O.jsxs("div",{className:"agent-bar",children:[O.jsx("div",{className:"agent-bar-logo",children:"SAGE TEAM"}),O.jsx("div",{className:"agent-bar-list",children:l.map(s=>O.jsxs("div",{className:`agent-bar-item ${t===s.id?"selected":""} ${s.status!=="idle"?"active":""}`,style:t===s.id?{borderColor:Ty[s.id]||"#444"}:void 0,title:`${s.name} — ${s.role} (${s.status})`,onClick:()=>n(t===s.id?null:s.id),children:[O.jsx("span",{className:"agent-emoji",children:DT[s.id]||"🤖"}),O.jsx("span",{className:"agent-name",style:{color:Ty[s.id]||"#aaa"},children:s.name}),O.jsx("span",{className:"status-dot",style:{background:NT[s.status]||"#555"}})]},s.id))})]})}const wy={success:"#00ff88",warning:"#ff6b35",info:"#00bfff",agent:"#b0b0c0",task:"#ffd700",system:"#666"},uh={sage:"#FFD700",nova:"#00BFFF",aria:"#b57edc",dex:"#50c878",flux:"#4169e1",quinn:"#ff8c00",gage:"#20b2aa",morgan:"#ff69b4",uma:"#8a2be2",river:"#00ced1",atlas:"#708090"};function OT(){const l=ht(h=>h.activity),t=ht(h=>h.agents),n=ht(h=>h.tasks),s=Ve.useRef(null);Ve.useEffect(()=>{var h;(h=s.current)==null||h.scrollIntoView({behavior:"smooth"})},[l.length]);const r=t.filter(h=>h.status!=="idle"),u=n.filter(h=>h.status==="done"||h.status==="completed").length,c=n.length;return O.jsxs("div",{className:"chat-panel",children:[O.jsxs("div",{className:"chat-header",children:[O.jsx("span",{className:"chat-header-title",children:"Live Activity"}),c>0&&O.jsxs("span",{className:"chat-header-stats",children:[u,"/",c," tasks"]})]}),r.length>0&&O.jsx("div",{className:"active-agents-strip",children:r.map(h=>O.jsxs("div",{className:"active-agent-chip",style:{borderColor:uh[h.id]||"#444"},children:[O.jsx("span",{className:"agent-dot",style:{background:uh[h.id]||"#888"}}),O.jsx("span",{className:"agent-chip-name",children:h.id}),O.jsx("span",{className:"agent-chip-status",children:h.status})]},h.id))}),O.jsxs("div",{className:"chat-messages",children:[l.length===0&&O.jsxs("div",{className:"chat-empty",children:[O.jsx("div",{className:"empty-icon",children:"🏢"}),O.jsx("div",{children:"Waiting for activity..."}),O.jsx("div",{className:"empty-hint",children:"Start a session to see agents at work"})]}),l.map(h=>O.jsxs("div",{className:`activity-entry activity-${h.type}`,children:[O.jsx("span",{className:"activity-time",children:h.time}),O.jsx("span",{className:"activity-icon",children:h.icon}),O.jsx("span",{className:"activity-text",style:{color:h.agentId&&uh[h.agentId]||wy[h.type]},children:h.text})]},h.id)),O.jsx("div",{ref:s})]})]})}function GT(){const l=ht(m=>m.agents),t=ht(m=>m.tasks),n=ht(m=>m.sprint),s=l.filter(m=>m.status!=="idle"),r=t.filter(m=>m.status==="done").length,u=t.length,c=u>0?r/u:0,h=l.reduce((m,g)=>{const p=g.position_room;return m[p]||(m[p]=[]),m[p].push(g),m},{});return{agents:l,activeAgents:s,agentsByRoom:h,completedTasks:r,totalTasks:u,progress:c,sprint:n}}const Ja={sage:"👑",nova:"🔬",aria:"🏛️",dex:"⚡",flux:"🌊",quinn:"🔍",gage:"🚀",morgan:"📋",uma:"🎨",river:"🌀",atlas:"📊"},ch={sage:"#ffd700",nova:"#00bfff",aria:"#b57edc",dex:"#50c878",flux:"#4169e1",quinn:"#ff8c00",gage:"#20b2aa",morgan:"#ff69b4",uma:"#8a2be2",river:"#00ced1",atlas:"#708090"},kT={coding:"Coding",reviewing:"Reviewing",testing:"Testing",planning:"Planning",blocked:"Blocked",deploying:"Deploying",thinking:"Thinking",idle:"Idle"};function UT(){const l=ht(_=>_.tasks),t=ht(_=>_.agents),{sprint:n,progress:s}=GT(),[r,u]=Ve.useState(!1),c=l.filter(_=>_.status==="pending"),h=l.filter(_=>_.status==="in_progress"||_.status==="review"),m=l.filter(_=>_.status==="done"),g=l.filter(_=>_.status==="blocked"||_.status==="failed"),p=t.filter(_=>_.status!=="idle"),x=t.filter(_=>_.status==="idle"),b=l.length>0;return r?O.jsx("div",{className:"task-board collapsed",onClick:()=>u(!1),children:O.jsx("span",{className:"collapse-icon",children:"▶"})}):O.jsxs("div",{className:"task-board",children:[O.jsxs("div",{className:"task-board-header",onClick:()=>u(!0),children:[O.jsx("span",{className:"collapse-icon",children:"◀"}),O.jsx("span",{className:"task-board-title",children:"Scrum Board"}),b&&O.jsxs("span",{className:"task-count-badge",children:[m.length,"/",l.length]})]}),n&&O.jsxs("div",{className:"sprint-info",children:[O.jsx("div",{className:"sprint-name",children:n.name}),O.jsx("div",{className:"sprint-goal",children:n.goal}),O.jsx("div",{className:"sprint-progress-bar",children:O.jsx("div",{className:"sprint-progress-fill",style:{width:`${s*100}%`}})}),O.jsxs("div",{className:"sprint-progress-text",children:[Math.round(s*100),"% — ",m.length," done, ",h.length," active, ",c.length," queued"]})]}),O.jsxs("div",{className:"scrum-columns",children:[O.jsxs("div",{className:"scrum-column",children:[O.jsxs("div",{className:"scrum-column-header doing",children:[O.jsx("span",{className:"scrum-dot doing"}),"In Progress",O.jsx("span",{className:"scrum-count",children:h.length+p.length})]}),O.jsxs("div",{className:"scrum-column-body",children:[p.map(_=>{const T=h.find(w=>w.assigned_to===_.id);return O.jsxs("div",{className:"scrum-card doing",children:[O.jsxs("div",{className:"scrum-card-top",children:[O.jsx("span",{className:"scrum-card-emoji",children:Ja[_.id]||"🤖"}),O.jsx("span",{className:"scrum-card-agent",style:{color:ch[_.id]||"#ccc"},children:_.name}),O.jsx("span",{className:"scrum-card-status",children:kT[_.status]||_.status})]}),T&&O.jsx("div",{className:"scrum-card-title",children:T.title}),!T&&_.current_task_id&&O.jsx("div",{className:"scrum-card-title",children:"Working..."}),O.jsx("div",{className:"scrum-card-bar",style:{background:ch[_.id]||"#555"}})]},_.id)}),h.filter(_=>!p.some(T=>T.id===_.assigned_to)).map(_=>O.jsxs("div",{className:"scrum-card doing",children:[O.jsxs("div",{className:"scrum-card-top",children:[O.jsx("span",{className:"scrum-card-emoji",children:"🔨"}),O.jsx("span",{className:"scrum-card-title-inline",children:_.title})]}),_.assigned_to&&O.jsxs("div",{className:"scrum-card-assignee",children:[Ja[_.assigned_to]||""," ",_.assigned_to]}),O.jsx("div",{className:"scrum-card-bar",style:{background:"#50c878"}})]},_.id)),p.length===0&&h.length===0&&O.jsx("div",{className:"scrum-empty",children:"No active work"})]})]}),O.jsxs("div",{className:"scrum-column",children:[O.jsxs("div",{className:"scrum-column-header todo",children:[O.jsx("span",{className:"scrum-dot todo"}),"To Do",O.jsx("span",{className:"scrum-count",children:c.length})]}),O.jsxs("div",{className:"scrum-column-body",children:[c.map(_=>O.jsxs("div",{className:"scrum-card todo",children:[O.jsxs("div",{className:"scrum-card-top",children:[O.jsx("span",{className:"scrum-card-emoji",children:"⏳"}),O.jsx("span",{className:"scrum-card-title-inline",children:_.title})]}),_.assigned_to&&O.jsxs("div",{className:"scrum-card-assignee",children:[Ja[_.assigned_to]||""," ",_.assigned_to]}),O.jsx("div",{className:"scrum-card-bar",style:{background:"#555"}})]},_.id)),c.length===0&&O.jsx("div",{className:"scrum-empty",children:"Backlog empty"})]})]}),g.length>0&&O.jsxs("div",{className:"scrum-column",children:[O.jsxs("div",{className:"scrum-column-header blocked",children:[O.jsx("span",{className:"scrum-dot blocked"}),"Blocked",O.jsx("span",{className:"scrum-count",children:g.length})]}),O.jsx("div",{className:"scrum-column-body",children:g.map(_=>O.jsxs("div",{className:"scrum-card blocked",children:[O.jsxs("div",{className:"scrum-card-top",children:[O.jsx("span",{className:"scrum-card-emoji",children:"🚫"}),O.jsx("span",{className:"scrum-card-title-inline",children:_.title})]}),O.jsx("div",{className:"scrum-card-bar",style:{background:"#dc143c"}})]},_.id))})]}),O.jsxs("div",{className:"scrum-column",children:[O.jsxs("div",{className:"scrum-column-header done",children:[O.jsx("span",{className:"scrum-dot done"}),"Done",O.jsx("span",{className:"scrum-count",children:m.length})]}),O.jsxs("div",{className:"scrum-column-body",children:[m.map(_=>O.jsxs("div",{className:"scrum-card done",children:[O.jsxs("div",{className:"scrum-card-top",children:[O.jsx("span",{className:"scrum-card-emoji",children:"✅"}),O.jsx("span",{className:"scrum-card-title-inline",children:_.title})]}),_.assigned_to&&O.jsxs("div",{className:"scrum-card-assignee",children:[Ja[_.assigned_to]||""," ",_.assigned_to]}),O.jsx("div",{className:"scrum-card-bar",style:{background:"#00ff88"}})]},_.id)),m.length===0&&O.jsx("div",{className:"scrum-empty",children:"Nothing done yet"})]})]})]}),O.jsxs("div",{className:"scrum-team-footer",children:[O.jsx("div",{className:"scrum-team-label",children:"Team"}),O.jsx("div",{className:"scrum-team-avatars",children:t.map(_=>O.jsx("span",{className:`scrum-avatar ${_.status!=="idle"?"active":"idle"}`,style:{borderColor:ch[_.id]||"#555",opacity:_.status!=="idle"?1:.4},title:`${_.name}: ${_.status}`,children:Ja[_.id]||"🤖"},_.id))}),O.jsxs("div",{className:"scrum-team-summary",children:[p.length," working · ",x.length," idle"]})]})]})}function jT(){const l=ht(u=>u.prs),t=ht(u=>u.selectedPR),n=ht(u=>u.setSelectedPR),s=l.find(u=>u.id===t);if(!s)return null;async function r(u){try{await fetch(`/api/pr/${s.id}/${u}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({feedback:""})}),n(null)}catch{}}return O.jsx("div",{className:"pr-overlay",onClick:()=>n(null),children:O.jsxs("div",{className:"pr-modal",onClick:u=>u.stopPropagation(),children:[O.jsxs("div",{className:"pr-modal-header",children:[O.jsx("h3",{children:"Pull Request Review"}),O.jsx("button",{className:"pr-close",onClick:()=>n(null),children:"×"})]}),O.jsxs("div",{className:"pr-modal-body",children:[O.jsxs("div",{className:"pr-field",children:[O.jsx("span",{className:"pr-label",children:"Title:"})," ",s.title]}),O.jsxs("div",{className:"pr-field",children:[O.jsx("span",{className:"pr-label",children:"Branch:"})," ",O.jsx("code",{children:s.branch})]}),O.jsxs("div",{className:"pr-field",children:[O.jsx("span",{className:"pr-label",children:"Author:"})," ",s.author_agent]}),O.jsxs("div",{className:"pr-field",children:[O.jsx("span",{className:"pr-label",children:"Status:"})," ",s.status]}),s.review_notes&&O.jsxs("div",{className:"pr-review-notes",children:[O.jsx("div",{className:"pr-label",children:"Review Notes:"}),O.jsx("pre",{children:s.review_notes})]})]}),O.jsxs("div",{className:"pr-modal-actions",children:[O.jsx("button",{className:"pr-btn approve",onClick:()=>r("approve"),children:"Approve & Merge"}),O.jsx("button",{className:"pr-btn reject",onClick:()=>r("reject"),children:"Request Changes"})]})]})})}function HT(){const[l,t]=Ve.useState(""),[n,s]=Ve.useState(!1),r=ht(g=>g.connected),u=ht(g=>g.prs),c=ht(g=>g.setSelectedPR),h=u.filter(g=>g.status==="pending_review"||g.status==="agent_reviewed");async function m(g){if(g.preventDefault(),!(!l.trim()||n)){s(!0);try{await fetch("/api/goal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({goal:l.trim()})}),t("")}catch{}finally{s(!1)}}}return O.jsxs("div",{className:"goal-bar",children:[h.length>0&&O.jsx("div",{className:"pr-badges",children:h.map(g=>O.jsxs("button",{className:"pr-badge",onClick:()=>c(g.id),children:["PR: ",g.title]},g.id))}),O.jsxs("form",{className:"goal-form",onSubmit:m,children:[O.jsx("input",{className:"goal-input",type:"text",placeholder:r?"Enter a goal for your team...":"Connecting...",value:l,onChange:g=>t(g.target.value),disabled:!r||n}),O.jsx("button",{className:"goal-submit",type:"submit",disabled:!r||n||!l.trim(),children:n?"...":"Go"})]})]})}const LT={sage:"👑",nova:"🔬",aria:"🏛️",dex:"⚡",flux:"🌊",quinn:"🔍",gage:"🚀",morgan:"📋",uma:"🎨",river:"🌀",atlas:"📊"},YT={sage:"#FFD700",nova:"#00BFFF",aria:"#b57edc",dex:"#50c878",flux:"#4169e1",quinn:"#ff8c00",gage:"#20b2aa",morgan:"#ff69b4",uma:"#8a2be2",river:"#00ced1",atlas:"#708090"},qT={idle:"#555",coding:"#00ff88",reviewing:"#00bfff",testing:"#9b59b6",planning:"#ffd700",blocked:"#ff4444",deploying:"#ff6b35",thinking:"#cccccc"},XT={idle:"Waiting for tasks...",coding:"Writing code — editing files, creating features",reviewing:"Reviewing files — reading code, analyzing structure",testing:"Running tests — executing commands, validating",planning:"Planning — decomposing goals into tasks",blocked:"Blocked — waiting for dependency or help",deploying:"Deploying — pushing changes, configuring infra",thinking:"Thinking — processing, reasoning about the problem"};function VT(){const l=ht(b=>b.selectedAgent),t=ht(b=>b.agents),n=ht(b=>b.tasks),s=ht(b=>b.activity),r=ht(b=>b.setSelectedAgent);if(!l)return null;const u=t.find(b=>b.id===l);if(!u)return null;const c=YT[u.id]||"#888",h=LT[u.id]||"🤖",m=qT[u.status]||"#555",g=n.filter(b=>b.assigned_to===u.id),p=g.find(b=>b.status==="in_progress"),x=s.filter(b=>b.agentId===u.id).slice(-30);return O.jsx("div",{className:"agent-detail-overlay",onClick:()=>r(null),children:O.jsxs("div",{className:"agent-detail-panel",onClick:b=>b.stopPropagation(),children:[O.jsxs("div",{className:"agent-detail-header",style:{borderBottomColor:c+"40"},children:[O.jsx("button",{className:"agent-detail-close",onClick:()=>r(null),children:"×"}),O.jsxs("div",{className:"agent-detail-avatar",children:[O.jsx("span",{className:"agent-detail-emoji",children:h}),O.jsx("span",{className:"agent-detail-status-ring",style:{borderColor:m}})]}),O.jsxs("div",{className:"agent-detail-info",children:[O.jsx("h2",{className:"agent-detail-name",style:{color:c},children:u.name}),O.jsx("div",{className:"agent-detail-role",children:u.role}),O.jsxs("div",{className:"agent-detail-status",style:{color:m},children:[O.jsx("span",{className:"agent-status-dot",style:{background:m}}),u.status]})]})]}),O.jsx("div",{className:"agent-detail-desc",children:XT[u.status]||`Status: ${u.status}`}),p&&O.jsxs("div",{className:"agent-detail-section",children:[O.jsx("div",{className:"section-label",children:"Current Task"}),O.jsxs("div",{className:"agent-current-task",style:{borderLeftColor:c},children:[O.jsx("div",{className:"current-task-title",children:p.title}),O.jsx("div",{className:"current-task-status",children:O.jsx("span",{className:"task-status-badge",style:{background:m+"30",color:m},children:p.status})})]})]}),g.length>0&&O.jsxs("div",{className:"agent-detail-section",children:[O.jsxs("div",{className:"section-label",children:["Tasks (",g.filter(b=>b.status==="done"||b.status==="completed").length,"/",g.length," done)"]}),O.jsx("div",{className:"agent-tasks-list",children:g.map(b=>O.jsxs("div",{className:`agent-task-row ${b.status==="done"||b.status==="completed"?"done":""}`,children:[O.jsx("span",{className:"agent-task-icon",children:b.status==="done"||b.status==="completed"?"✅":b.status==="in_progress"?"🔨":"⏳"}),O.jsx("span",{className:"agent-task-title",children:b.title})]},b.id))})]}),O.jsxs("div",{className:"agent-detail-section agent-activity-section",children:[O.jsx("div",{className:"section-label",children:"Activity Log"}),O.jsxs("div",{className:"agent-activity-log",children:[x.length===0&&O.jsx("div",{className:"agent-activity-empty",children:"No activity yet"}),x.map(b=>O.jsxs("div",{className:"agent-activity-row",children:[O.jsx("span",{className:"agent-activity-time",children:b.time}),O.jsx("span",{className:"agent-activity-icon",children:b.icon}),O.jsx("span",{className:"agent-activity-text",children:b.text})]},b.id))]})]}),O.jsx("div",{className:"agent-detail-footer",children:O.jsxs("span",{className:"agent-location",children:["📍"," ",u.position_room||"Unknown"]})})]})})}function PT(){const l=ht(t=>t.connected);return V1(),RT("office-canvas"),O.jsxs("div",{className:"app",children:[O.jsx(BT,{}),O.jsxs("div",{className:"main-area",children:[O.jsx(UT,{}),O.jsxs("div",{className:"canvas-container",children:[O.jsx("canvas",{id:"office-canvas"}),!l&&O.jsx("div",{className:"connection-overlay",children:O.jsx("span",{children:"Connecting to Sage Team..."})})]}),O.jsx(OT,{})]}),O.jsx(HT,{}),O.jsx(jT,{}),O.jsx(VT,{})]})}B1.createRoot(document.getElementById("root")).render(O.jsx(Ve.StrictMode,{children:O.jsx(PT,{})}));export{oo as $,b0 as A,ml as B,ae as C,Pe as D,Ti as E,Wi as F,co as G,Uh as H,y0 as I,oi as J,c0 as K,Rh as L,St as M,CS as N,ES as O,xe as P,GS as Q,xh as R,jh as S,Gt as T,no as U,NS as V,ab as W,jS as X,Ne as Y,Uy as Z,ri as _,f0 as a,Tp as a0,ul as a1,xT as a2,kb as a3,Ap as a4,Pc as a5,Cp as a6,jb as a7,Qs as a8,$t as a9,Ly as aa,Y2 as ab,v0 as ac,At as ad,pl as ae,Qt as af,Yv as ag,kv as ah,oS as ai,eS as aj,MS as ak,RS as al,kS as am,OS as an,US as ao,l0 as b,$v as c,ze as d,Zt as e,Ut as f,rv as g,to as h,yt as i,ye as j,t2 as k,PS as l,Hy as m,fo as n,Zy as o,Jt as p,Ps as q,_b as r,ho as s,De as t,xv as u,Zv as v,Se as w,yl as x,Lp as y,eo as z};