expxagents 0.13.0 → 0.14.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.
- package/assets/core/solution-architect.agent.md +3 -0
- package/dist/core/squad-loader.js +2 -8
- package/dist/dashboard/assets/{BufferResource-D9aUIz5c.js → BufferResource-IVUoAbNS.js} +1 -1
- package/dist/dashboard/assets/{CanvasRenderer-DfAInYD0.js → CanvasRenderer-ZlhtzexK.js} +1 -1
- package/dist/dashboard/assets/{JarvisView-D78mY8i-.js → JarvisView-Bkn01kRk.js} +1 -1
- package/dist/dashboard/assets/{RenderTargetSystem-DZo6ujA0.js → RenderTargetSystem-ukD3tT30.js} +1 -1
- package/dist/dashboard/assets/{WebGLRenderer-BKreDG7Z.js → WebGLRenderer-B0gX63D6.js} +1 -1
- package/dist/dashboard/assets/{WebGPURenderer-DeKuexG2.js → WebGPURenderer-CU_7qyko.js} +1 -1
- package/dist/dashboard/assets/{browserAll-3U5O7dnB.js → browserAll-CHvE8-zd.js} +1 -1
- package/dist/dashboard/assets/index-CV6VSNbn.js +400 -0
- package/dist/dashboard/assets/{index-DHu3wE8e.css → index-ClyttaJh.css} +1 -1
- package/dist/dashboard/assets/{webworkerAll-CBlDUJVW.js → webworkerAll-D1p-kqY5.js} +1 -1
- package/dist/dashboard/index.html +2 -2
- package/dist/data/opensquad.db-shm +0 -0
- package/dist/data/opensquad.db-wal +0 -0
- package/dist/server/api/__tests__/files-routes.test.d.ts +2 -0
- package/dist/server/api/__tests__/files-routes.test.d.ts.map +1 -0
- package/dist/server/api/__tests__/files-routes.test.js +85 -0
- package/dist/server/api/__tests__/files-routes.test.js.map +1 -0
- package/dist/server/api/__tests__/graph-routes.test.d.ts +2 -0
- package/dist/server/api/__tests__/graph-routes.test.d.ts.map +1 -0
- package/dist/server/api/__tests__/graph-routes.test.js +105 -0
- package/dist/server/api/__tests__/graph-routes.test.js.map +1 -0
- package/dist/server/api/__tests__/kanban-routes.test.d.ts +2 -0
- package/dist/server/api/__tests__/kanban-routes.test.d.ts.map +1 -0
- package/dist/server/api/__tests__/kanban-routes.test.js +227 -0
- package/dist/server/api/__tests__/kanban-routes.test.js.map +1 -0
- package/dist/server/api/files-routes.d.ts +5 -0
- package/dist/server/api/files-routes.d.ts.map +1 -0
- package/dist/server/api/files-routes.js +92 -0
- package/dist/server/api/files-routes.js.map +1 -0
- package/dist/server/api/graph-routes.d.ts +24 -0
- package/dist/server/api/graph-routes.d.ts.map +1 -0
- package/dist/server/api/graph-routes.js +189 -0
- package/dist/server/api/graph-routes.js.map +1 -0
- package/dist/server/api/kanban-routes.d.ts +8 -0
- package/dist/server/api/kanban-routes.d.ts.map +1 -0
- package/dist/server/api/kanban-routes.js +104 -0
- package/dist/server/api/kanban-routes.js.map +1 -0
- package/dist/server/app.d.ts.map +1 -1
- package/dist/server/app.js +6 -0
- package/dist/server/app.js.map +1 -1
- package/dist/server/db/migrations.d.ts.map +1 -1
- package/dist/server/db/migrations.js +10 -0
- package/dist/server/db/migrations.js.map +1 -1
- package/dist/server/db/schema.d.ts +1 -1
- package/dist/server/db/schema.d.ts.map +1 -1
- package/dist/server/db/schema.js +17 -0
- package/dist/server/db/schema.js.map +1 -1
- package/dist/server/scheduler/__tests__/scheduler-routes.test.js +65 -0
- package/dist/server/scheduler/__tests__/scheduler-routes.test.js.map +1 -1
- package/dist/server/scheduler/__tests__/scheduler-service.test.js +33 -0
- package/dist/server/scheduler/__tests__/scheduler-service.test.js.map +1 -1
- package/dist/server/scheduler/scheduler-routes.d.ts.map +1 -1
- package/dist/server/scheduler/scheduler-routes.js +44 -0
- package/dist/server/scheduler/scheduler-routes.js.map +1 -1
- package/dist/server/scheduler/scheduler-service.d.ts +8 -0
- package/dist/server/scheduler/scheduler-service.d.ts.map +1 -1
- package/dist/server/scheduler/scheduler-service.js +49 -0
- package/dist/server/scheduler/scheduler-service.js.map +1 -1
- package/package.json +1 -1
- package/dist/dashboard/assets/index-CahtAeF7.js +0 -400
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/browserAll-CHvE8-zd.js","assets/webworkerAll-D1p-kqY5.js","assets/WebGPURenderer-CU_7qyko.js","assets/BufferResource-IVUoAbNS.js","assets/RenderTargetSystem-ukD3tT30.js","assets/WebGLRenderer-B0gX63D6.js","assets/CanvasRenderer-ZlhtzexK.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();const AO="modulepreload",MO=function(t){return"/"+t},LS={},Zd=function(e,n,i){let r=Promise.resolve();if(n&&n.length>0){let l=function(p){return Promise.all(p.map(m=>Promise.resolve(m).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),d=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));r=l(n.map(p=>{if(p=MO(p),p in LS)return;LS[p]=!0;const m=p.endsWith(".css"),g=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${g}`))return;const b=document.createElement("link");if(b.rel=m?"stylesheet":AO,m||(b.as="script"),b.crossOrigin="",b.href=p,d&&b.setAttribute("nonce",d),document.head.appendChild(b),m)return new Promise((v,_)=>{b.addEventListener("load",v),b.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${p}`)))})}))}function s(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return r.then(l=>{for(const c of l||[])c.status==="rejected"&&s(c.reason);return e().catch(s)})};function uu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ix={exports:{}},qp={};/**
|
|
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 US;function RO(){if(US)return qp;US=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(i,r,s){var l=null;if(s!==void 0&&(l=""+s),r.key!==void 0&&(l=""+r.key),"key"in r){s={};for(var c in r)c!=="key"&&(s[c]=r[c])}else s=r;return r=s.ref,{$$typeof:t,type:i,key:l,ref:r!==void 0?r:null,props:s}}return qp.Fragment=e,qp.jsx=n,qp.jsxs=n,qp}var IS;function NO(){return IS||(IS=1,ix.exports=RO()),ix.exports}var A=NO(),rx={exports:{}},vt={};/**
|
|
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 jS;function kO(){if(jS)return vt;jS=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),b=Symbol.iterator;function v(Y){return Y===null||typeof Y!="object"?null:(Y=b&&Y[b]||Y["@@iterator"],typeof Y=="function"?Y:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,T={};function w(Y,ee,V){this.props=Y,this.context=ee,this.refs=T,this.updater=V||_}w.prototype.isReactComponent={},w.prototype.setState=function(Y,ee){if(typeof Y!="object"&&typeof Y!="function"&&Y!=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,Y,ee,"setState")},w.prototype.forceUpdate=function(Y){this.updater.enqueueForceUpdate(this,Y,"forceUpdate")};function k(){}k.prototype=w.prototype;function R(Y,ee,V){this.props=Y,this.context=ee,this.refs=T,this.updater=V||_}var O=R.prototype=new k;O.constructor=R,C(O,w.prototype),O.isPureReactComponent=!0;var j=Array.isArray;function D(){}var F={H:null,A:null,T:null,S:null},$=Object.prototype.hasOwnProperty;function P(Y,ee,V){var oe=V.ref;return{$$typeof:t,type:Y,key:ee,ref:oe!==void 0?oe:null,props:V}}function I(Y,ee){return P(Y.type,ee,Y.props)}function K(Y){return typeof Y=="object"&&Y!==null&&Y.$$typeof===t}function G(Y){var ee={"=":"=0",":":"=2"};return"$"+Y.replace(/[=:]/g,function(V){return ee[V]})}var te=/\/+/g;function H(Y,ee){return typeof Y=="object"&&Y!==null&&Y.key!=null?G(""+Y.key):ee.toString(36)}function W(Y){switch(Y.status){case"fulfilled":return Y.value;case"rejected":throw Y.reason;default:switch(typeof Y.status=="string"?Y.then(D,D):(Y.status="pending",Y.then(function(ee){Y.status==="pending"&&(Y.status="fulfilled",Y.value=ee)},function(ee){Y.status==="pending"&&(Y.status="rejected",Y.reason=ee)})),Y.status){case"fulfilled":return Y.value;case"rejected":throw Y.reason}}throw Y}function B(Y,ee,V,oe,be){var ve=typeof Y;(ve==="undefined"||ve==="boolean")&&(Y=null);var se=!1;if(Y===null)se=!0;else switch(ve){case"bigint":case"string":case"number":se=!0;break;case"object":switch(Y.$$typeof){case t:case e:se=!0;break;case m:return se=Y._init,B(se(Y._payload),ee,V,oe,be)}}if(se)return be=be(Y),se=oe===""?"."+H(Y,0):oe,j(be)?(V="",se!=null&&(V=se.replace(te,"$&/")+"/"),B(be,ee,V,"",function(Re){return Re})):be!=null&&(K(be)&&(be=I(be,V+(be.key==null||Y&&Y.key===be.key?"":(""+be.key).replace(te,"$&/")+"/")+se)),ee.push(be)),1;se=0;var ge=oe===""?".":oe+":";if(j(Y))for(var le=0;le<Y.length;le++)oe=Y[le],ve=ge+H(oe,le),se+=B(oe,ee,V,ve,be);else if(le=v(Y),typeof le=="function")for(Y=le.call(Y),le=0;!(oe=Y.next()).done;)oe=oe.value,ve=ge+H(oe,le++),se+=B(oe,ee,V,ve,be);else if(ve==="object"){if(typeof Y.then=="function")return B(W(Y),ee,V,oe,be);throw ee=String(Y),Error("Objects are not valid as a React child (found: "+(ee==="[object Object]"?"object with keys {"+Object.keys(Y).join(", ")+"}":ee)+"). If you meant to render a collection of children, use an array instead.")}return se}function X(Y,ee,V){if(Y==null)return Y;var oe=[],be=0;return B(Y,oe,"","",function(ve){return ee.call(V,ve,be++)}),oe}function Z(Y){if(Y._status===-1){var ee=Y._result;ee=ee(),ee.then(function(V){(Y._status===0||Y._status===-1)&&(Y._status=1,Y._result=V)},function(V){(Y._status===0||Y._status===-1)&&(Y._status=2,Y._result=V)}),Y._status===-1&&(Y._status=0,Y._result=ee)}if(Y._status===1)return Y._result.default;throw Y._result}var Q=typeof reportError=="function"?reportError:function(Y){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ee=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof Y=="object"&&Y!==null&&typeof Y.message=="string"?String(Y.message):String(Y),error:Y});if(!window.dispatchEvent(ee))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",Y);return}console.error(Y)},q={map:X,forEach:function(Y,ee,V){X(Y,function(){ee.apply(this,arguments)},V)},count:function(Y){var ee=0;return X(Y,function(){ee++}),ee},toArray:function(Y){return X(Y,function(ee){return ee})||[]},only:function(Y){if(!K(Y))throw Error("React.Children.only expected to receive a single React element child.");return Y}};return vt.Activity=g,vt.Children=q,vt.Component=w,vt.Fragment=n,vt.Profiler=r,vt.PureComponent=R,vt.StrictMode=i,vt.Suspense=d,vt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,vt.__COMPILER_RUNTIME={__proto__:null,c:function(Y){return F.H.useMemoCache(Y)}},vt.cache=function(Y){return function(){return Y.apply(null,arguments)}},vt.cacheSignal=function(){return null},vt.cloneElement=function(Y,ee,V){if(Y==null)throw Error("The argument must be a React element, but you passed "+Y+".");var oe=C({},Y.props),be=Y.key;if(ee!=null)for(ve in ee.key!==void 0&&(be=""+ee.key),ee)!$.call(ee,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&ee.ref===void 0||(oe[ve]=ee[ve]);var ve=arguments.length-2;if(ve===1)oe.children=V;else if(1<ve){for(var se=Array(ve),ge=0;ge<ve;ge++)se[ge]=arguments[ge+2];oe.children=se}return P(Y.type,be,oe)},vt.createContext=function(Y){return Y={$$typeof:l,_currentValue:Y,_currentValue2:Y,_threadCount:0,Provider:null,Consumer:null},Y.Provider=Y,Y.Consumer={$$typeof:s,_context:Y},Y},vt.createElement=function(Y,ee,V){var oe,be={},ve=null;if(ee!=null)for(oe in ee.key!==void 0&&(ve=""+ee.key),ee)$.call(ee,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(be[oe]=ee[oe]);var se=arguments.length-2;if(se===1)be.children=V;else if(1<se){for(var ge=Array(se),le=0;le<se;le++)ge[le]=arguments[le+2];be.children=ge}if(Y&&Y.defaultProps)for(oe in se=Y.defaultProps,se)be[oe]===void 0&&(be[oe]=se[oe]);return P(Y,ve,be)},vt.createRef=function(){return{current:null}},vt.forwardRef=function(Y){return{$$typeof:c,render:Y}},vt.isValidElement=K,vt.lazy=function(Y){return{$$typeof:m,_payload:{_status:-1,_result:Y},_init:Z}},vt.memo=function(Y,ee){return{$$typeof:p,type:Y,compare:ee===void 0?null:ee}},vt.startTransition=function(Y){var ee=F.T,V={};F.T=V;try{var oe=Y(),be=F.S;be!==null&&be(V,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(D,Q)}catch(ve){Q(ve)}finally{ee!==null&&V.types!==null&&(ee.types=V.types),F.T=ee}},vt.unstable_useCacheRefresh=function(){return F.H.useCacheRefresh()},vt.use=function(Y){return F.H.use(Y)},vt.useActionState=function(Y,ee,V){return F.H.useActionState(Y,ee,V)},vt.useCallback=function(Y,ee){return F.H.useCallback(Y,ee)},vt.useContext=function(Y){return F.H.useContext(Y)},vt.useDebugValue=function(){},vt.useDeferredValue=function(Y,ee){return F.H.useDeferredValue(Y,ee)},vt.useEffect=function(Y,ee){return F.H.useEffect(Y,ee)},vt.useEffectEvent=function(Y){return F.H.useEffectEvent(Y)},vt.useId=function(){return F.H.useId()},vt.useImperativeHandle=function(Y,ee,V){return F.H.useImperativeHandle(Y,ee,V)},vt.useInsertionEffect=function(Y,ee){return F.H.useInsertionEffect(Y,ee)},vt.useLayoutEffect=function(Y,ee){return F.H.useLayoutEffect(Y,ee)},vt.useMemo=function(Y,ee){return F.H.useMemo(Y,ee)},vt.useOptimistic=function(Y,ee){return F.H.useOptimistic(Y,ee)},vt.useReducer=function(Y,ee,V){return F.H.useReducer(Y,ee,V)},vt.useRef=function(Y){return F.H.useRef(Y)},vt.useState=function(Y){return F.H.useState(Y)},vt.useSyncExternalStore=function(Y,ee,V){return F.H.useSyncExternalStore(Y,ee,V)},vt.useTransition=function(){return F.H.useTransition()},vt.version="19.2.4",vt}var HS;function yh(){return HS||(HS=1,rx.exports=kO()),rx.exports}var U=yh();const cm=uu(U);var ax={exports:{}},Yp={},sx={exports:{}},lx={};/**
|
|
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 PS;function OO(){return PS||(PS=1,(function(t){function e(B,X){var Z=B.length;B.push(X);e:for(;0<Z;){var Q=Z-1>>>1,q=B[Q];if(0<r(q,X))B[Q]=X,B[Z]=q,Z=Q;else break e}}function n(B){return B.length===0?null:B[0]}function i(B){if(B.length===0)return null;var X=B[0],Z=B.pop();if(Z!==X){B[0]=Z;e:for(var Q=0,q=B.length,Y=q>>>1;Q<Y;){var ee=2*(Q+1)-1,V=B[ee],oe=ee+1,be=B[oe];if(0>r(V,Z))oe<q&&0>r(be,V)?(B[Q]=be,B[oe]=Z,Q=oe):(B[Q]=V,B[ee]=Z,Q=ee);else if(oe<q&&0>r(be,Z))B[Q]=be,B[oe]=Z,Q=oe;else break e}}return X}function r(B,X){var Z=B.sortIndex-X.sortIndex;return Z!==0?Z:B.id-X.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var l=Date,c=l.now();t.unstable_now=function(){return l.now()-c}}var d=[],p=[],m=1,g=null,b=3,v=!1,_=!1,C=!1,T=!1,w=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function O(B){for(var X=n(p);X!==null;){if(X.callback===null)i(p);else if(X.startTime<=B)i(p),X.sortIndex=X.expirationTime,e(d,X);else break;X=n(p)}}function j(B){if(C=!1,O(B),!_)if(n(d)!==null)_=!0,D||(D=!0,G());else{var X=n(p);X!==null&&W(j,X.startTime-B)}}var D=!1,F=-1,$=5,P=-1;function I(){return T?!0:!(t.unstable_now()-P<$)}function K(){if(T=!1,D){var B=t.unstable_now();P=B;var X=!0;try{e:{_=!1,C&&(C=!1,k(F),F=-1),v=!0;var Z=b;try{t:{for(O(B),g=n(d);g!==null&&!(g.expirationTime>B&&I());){var Q=g.callback;if(typeof Q=="function"){g.callback=null,b=g.priorityLevel;var q=Q(g.expirationTime<=B);if(B=t.unstable_now(),typeof q=="function"){g.callback=q,O(B),X=!0;break t}g===n(d)&&i(d),O(B)}else i(d);g=n(d)}if(g!==null)X=!0;else{var Y=n(p);Y!==null&&W(j,Y.startTime-B),X=!1}}break e}finally{g=null,b=Z,v=!1}X=void 0}}finally{X?G():D=!1}}}var G;if(typeof R=="function")G=function(){R(K)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,H=te.port2;te.port1.onmessage=K,G=function(){H.postMessage(null)}}else G=function(){w(K,0)};function W(B,X){F=w(function(){B(t.unstable_now())},X)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(B){B.callback=null},t.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<B?Math.floor(1e3/B):5},t.unstable_getCurrentPriorityLevel=function(){return b},t.unstable_next=function(B){switch(b){case 1:case 2:case 3:var X=3;break;default:X=b}var Z=b;b=X;try{return B()}finally{b=Z}},t.unstable_requestPaint=function(){T=!0},t.unstable_runWithPriority=function(B,X){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var Z=b;b=B;try{return X()}finally{b=Z}},t.unstable_scheduleCallback=function(B,X,Z){var Q=t.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?Q+Z:Q):Z=Q,B){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=Z+q,B={id:m++,callback:X,priorityLevel:B,startTime:Z,expirationTime:q,sortIndex:-1},Z>Q?(B.sortIndex=Z,e(p,B),n(d)===null&&B===n(p)&&(C?(k(F),F=-1):C=!0,W(j,Z-Q))):(B.sortIndex=q,e(d,B),_||v||(_=!0,D||(D=!0,G()))),B},t.unstable_shouldYield=I,t.unstable_wrapCallback=function(B){var X=b;return function(){var Z=b;b=X;try{return B.apply(this,arguments)}finally{b=Z}}}})(lx)),lx}var GS;function DO(){return GS||(GS=1,sx.exports=OO()),sx.exports}var ox={exports:{}},kr={};/**
|
|
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 FS;function zO(){if(FS)return kr;FS=1;var t=yh();function e(d){var p="https://react.dev/errors/"+d;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)p+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+d+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(e(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 s(d,p,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:g==null?null:""+g,children:d,containerInfo:p,implementation:m}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(d,p){if(d==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return kr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,kr.createPortal=function(d,p){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(e(299));return s(d,p,null,m)},kr.flushSync=function(d){var p=l.T,m=i.p;try{if(l.T=null,i.p=2,d)return d()}finally{l.T=p,i.p=m,i.d.f()}},kr.preconnect=function(d,p){typeof d=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,i.d.C(d,p))},kr.prefetchDNS=function(d){typeof d=="string"&&i.d.D(d)},kr.preinit=function(d,p){if(typeof d=="string"&&p&&typeof p.as=="string"){var m=p.as,g=c(m,p.crossOrigin),b=typeof p.integrity=="string"?p.integrity:void 0,v=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;m==="style"?i.d.S(d,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:b,fetchPriority:v}):m==="script"&&i.d.X(d,{crossOrigin:g,integrity:b,fetchPriority:v,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},kr.preinitModule=function(d,p){if(typeof d=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var m=c(p.as,p.crossOrigin);i.d.M(d,{crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&i.d.M(d)},kr.preload=function(d,p){if(typeof d=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var m=p.as,g=c(m,p.crossOrigin);i.d.L(d,m,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},kr.preloadModule=function(d,p){if(typeof d=="string")if(p){var m=c(p.as,p.crossOrigin);i.d.m(d,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else i.d.m(d)},kr.requestFormReset=function(d){i.d.r(d)},kr.unstable_batchedUpdates=function(d,p){return d(p)},kr.useFormState=function(d,p,m){return l.H.useFormState(d,p,m)},kr.useFormStatus=function(){return l.H.useHostTransitionStatus()},kr.version="19.2.4",kr}var qS;function fC(){if(qS)return ox.exports;qS=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),ox.exports=zO(),ox.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 YS;function BO(){if(YS)return Yp;YS=1;var t=DO(),e=yh(),n=fC();function i(a){var o="https://react.dev/errors/"+a;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)o+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+a+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function s(a){var o=a,h=a;if(a.alternate)for(;o.return;)o=o.return;else{a=o;do o=a,(o.flags&4098)!==0&&(h=o.return),a=o.return;while(a)}return o.tag===3?h:null}function l(a){if(a.tag===13){var o=a.memoizedState;if(o===null&&(a=a.alternate,a!==null&&(o=a.memoizedState)),o!==null)return o.dehydrated}return null}function c(a){if(a.tag===31){var o=a.memoizedState;if(o===null&&(a=a.alternate,a!==null&&(o=a.memoizedState)),o!==null)return o.dehydrated}return null}function d(a){if(s(a)!==a)throw Error(i(188))}function p(a){var o=a.alternate;if(!o){if(o=s(a),o===null)throw Error(i(188));return o!==a?null:a}for(var h=a,y=o;;){var S=h.return;if(S===null)break;var M=S.alternate;if(M===null){if(y=S.return,y!==null){h=y;continue}break}if(S.child===M.child){for(M=S.child;M;){if(M===h)return d(S),a;if(M===y)return d(S),o;M=M.sibling}throw Error(i(188))}if(h.return!==y.return)h=S,y=M;else{for(var L=!1,J=S.child;J;){if(J===h){L=!0,h=S,y=M;break}if(J===y){L=!0,y=S,h=M;break}J=J.sibling}if(!L){for(J=M.child;J;){if(J===h){L=!0,h=M,y=S;break}if(J===y){L=!0,y=M,h=S;break}J=J.sibling}if(!L)throw Error(i(189))}}if(h.alternate!==y)throw Error(i(190))}if(h.tag!==3)throw Error(i(188));return h.stateNode.current===h?a:o}function m(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a;for(a=a.child;a!==null;){if(o=m(a),o!==null)return o;a=a.sibling}return null}var g=Object.assign,b=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),R=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function G(a){return a===null||typeof a!="object"?null:(a=K&&a[K]||a["@@iterator"],typeof a=="function"?a:null)}var te=Symbol.for("react.client.reference");function H(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===te?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case C:return"Fragment";case w:return"Profiler";case T:return"StrictMode";case j:return"Suspense";case D:return"SuspenseList";case P:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case _:return"Portal";case R:return a.displayName||"Context";case k:return(a._context.displayName||"Context")+".Consumer";case O:var o=a.render;return a=a.displayName,a||(a=o.displayName||o.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case F:return o=a.displayName||null,o!==null?o:H(a.type)||"Memo";case $:o=a._payload,a=a._init;try{return H(a(o))}catch{}}return null}var W=Array.isArray,B=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},Q=[],q=-1;function Y(a){return{current:a}}function ee(a){0>q||(a.current=Q[q],Q[q]=null,q--)}function V(a,o){q++,Q[q]=a.current,a.current=o}var oe=Y(null),be=Y(null),ve=Y(null),se=Y(null);function ge(a,o){switch(V(ve,o),V(be,a),V(oe,null),o.nodeType){case 9:case 11:a=(a=o.documentElement)&&(a=a.namespaceURI)?aS(a):0;break;default:if(a=o.tagName,o=o.namespaceURI)o=aS(o),a=sS(o,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}ee(oe),V(oe,a)}function le(){ee(oe),ee(be),ee(ve)}function Re(a){a.memoizedState!==null&&V(se,a);var o=oe.current,h=sS(o,a.type);o!==h&&(V(be,a),V(oe,h))}function Ie(a){be.current===a&&(ee(oe),ee(be)),se.current===a&&(ee(se),Hp._currentValue=Z)}var Ue,Le;function Ve(a){if(Ue===void 0)try{throw Error()}catch(h){var o=h.stack.trim().match(/\n( *(at )?)/);Ue=o&&o[1]||"",Le=-1<h.stack.indexOf(`
|
|
43
|
+
at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
+
`+Ue+a+Le}var ut=!1;function He(a,o){if(!a||ut)return"";ut=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var y={DetermineComponentFrameRoot:function(){try{if(o){var Ae=function(){throw Error()};if(Object.defineProperty(Ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ae,[])}catch(_e){var ye=_e}Reflect.construct(a,[],Ae)}else{try{Ae.call()}catch(_e){ye=_e}a.call(Ae.prototype)}}else{try{throw Error()}catch(_e){ye=_e}(Ae=a())&&typeof Ae.catch=="function"&&Ae.catch(function(){})}}catch(_e){if(_e&&ye&&typeof _e.stack=="string")return[_e.stack,ye.stack]}return[null,null]}};y.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var S=Object.getOwnPropertyDescriptor(y.DetermineComponentFrameRoot,"name");S&&S.configurable&&Object.defineProperty(y.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var M=y.DetermineComponentFrameRoot(),L=M[0],J=M[1];if(L&&J){var re=L.split(`
|
|
45
|
+
`),pe=J.split(`
|
|
46
|
+
`);for(S=y=0;y<re.length&&!re[y].includes("DetermineComponentFrameRoot");)y++;for(;S<pe.length&&!pe[S].includes("DetermineComponentFrameRoot");)S++;if(y===re.length||S===pe.length)for(y=re.length-1,S=pe.length-1;1<=y&&0<=S&&re[y]!==pe[S];)S--;for(;1<=y&&0<=S;y--,S--)if(re[y]!==pe[S]){if(y!==1||S!==1)do if(y--,S--,0>S||re[y]!==pe[S]){var Ee=`
|
|
47
|
+
`+re[y].replace(" at new "," at ");return a.displayName&&Ee.includes("<anonymous>")&&(Ee=Ee.replace("<anonymous>",a.displayName)),Ee}while(1<=y&&0<=S);break}}}finally{ut=!1,Error.prepareStackTrace=h}return(h=a?a.displayName||a.name:"")?Ve(h):""}function At(a,o){switch(a.tag){case 26:case 27:case 5:return Ve(a.type);case 16:return Ve("Lazy");case 13:return a.child!==o&&o!==null?Ve("Suspense Fallback"):Ve("Suspense");case 19:return Ve("SuspenseList");case 0:case 15:return He(a.type,!1);case 11:return He(a.type.render,!1);case 1:return He(a.type,!0);case 31:return Ve("Activity");default:return""}}function zn(a){try{var o="",h=null;do o+=At(a,h),h=a,a=a.return;while(a);return o}catch(y){return`
|
|
48
|
+
Error generating stack: `+y.message+`
|
|
49
|
+
`+y.stack}}var Bn=Object.prototype.hasOwnProperty,bn=t.unstable_scheduleCallback,wi=t.unstable_cancelCallback,ka=t.unstable_shouldYield,Lr=t.unstable_requestPaint,hn=t.unstable_now,ua=t.unstable_getCurrentPriorityLevel,Se=t.unstable_ImmediatePriority,ke=t.unstable_UserBlockingPriority,Je=t.unstable_NormalPriority,bt=t.unstable_LowPriority,kt=t.unstable_IdlePriority,yi=t.log,rr=t.unstable_setDisableYieldValue,xn=null,$t=null;function Gn(a){if(typeof yi=="function"&&rr(a),$t&&typeof $t.setStrictMode=="function")try{$t.setStrictMode(xn,a)}catch{}}var Pt=Math.clz32?Math.clz32:bo,Fi=Math.log,Qn=Math.LN2;function bo(a){return a>>>=0,a===0?32:31-(Fi(a)/Qn|0)|0}var as=256,Oa=262144,ss=4194304;function bi(a){var o=a&42;if(o!==0)return o;switch(a&-a){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 a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function ae(a,o,h){var y=a.pendingLanes;if(y===0)return 0;var S=0,M=a.suspendedLanes,L=a.pingedLanes;a=a.warmLanes;var J=y&134217727;return J!==0?(y=J&~M,y!==0?S=bi(y):(L&=J,L!==0?S=bi(L):h||(h=J&~a,h!==0&&(S=bi(h))))):(J=y&~M,J!==0?S=bi(J):L!==0?S=bi(L):h||(h=y&~a,h!==0&&(S=bi(h)))),S===0?0:o!==0&&o!==S&&(o&M)===0&&(M=S&-S,h=o&-o,M>=h||M===32&&(h&4194048)!==0)?o:S}function we(a,o){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&o)===0}function Be(a,o){switch(a){case 1:case 2:case 4:case 8:case 64:return o+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 o+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 et(){var a=ss;return ss<<=1,(ss&62914560)===0&&(ss=4194304),a}function Jt(a){for(var o=[],h=0;31>h;h++)o.push(a);return o}function en(a,o){a.pendingLanes|=o,o!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Fe(a,o,h,y,S,M){var L=a.pendingLanes;a.pendingLanes=h,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=h,a.entangledLanes&=h,a.errorRecoveryDisabledLanes&=h,a.shellSuspendCounter=0;var J=a.entanglements,re=a.expirationTimes,pe=a.hiddenUpdates;for(h=L&~h;0<h;){var Ee=31-Pt(h),Ae=1<<Ee;J[Ee]=0,re[Ee]=-1;var ye=pe[Ee];if(ye!==null)for(pe[Ee]=null,Ee=0;Ee<ye.length;Ee++){var _e=ye[Ee];_e!==null&&(_e.lane&=-536870913)}h&=~Ae}y!==0&&Pe(a,y,0),M!==0&&S===0&&a.tag!==0&&(a.suspendedLanes|=M&~(L&~o))}function Pe(a,o,h){a.pendingLanes|=o,a.suspendedLanes&=~o;var y=31-Pt(o);a.entangledLanes|=o,a.entanglements[y]=a.entanglements[y]|1073741824|h&261930}function tt(a,o){var h=a.entangledLanes|=o;for(a=a.entanglements;h;){var y=31-Pt(h),S=1<<y;S&o|a[y]&o&&(a[y]|=o),h&=~S}}function Cn(a,o){var h=o&-o;return h=(h&42)!==0?1:Gt(h),(h&(a.suspendedLanes|o))!==0?0:h}function Gt(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=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:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function fa(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function ar(){var a=X.p;return a!==0?a:(a=window.event,a===void 0?32:RS(a.type))}function qi(a,o){var h=X.p;try{return X.p=a,o()}finally{X.p=h}}var sr=Math.random().toString(36).slice(2),yt="__reactFiber$"+sr,li="__reactProps$"+sr,Ur="__reactContainer$"+sr,Us="__reactEvents$"+sr,El="__reactListeners$"+sr,wl="__reactHandles$"+sr,Tl="__reactResources$"+sr,Da="__reactMarker$"+sr;function Is(a){delete a[yt],delete a[li],delete a[Us],delete a[El],delete a[wl]}function tn(a){var o=a[yt];if(o)return o;for(var h=a.parentNode;h;){if(o=h[Ur]||h[yt]){if(h=o.alternate,o.child!==null||h!==null&&h.child!==null)for(a=hS(a);a!==null;){if(h=a[yt])return h;a=hS(a)}return o}a=h,h=a.parentNode}return null}function nn(a){if(a=a[yt]||a[Ur]){var o=a.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return a}return null}function lr(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a.stateNode;throw Error(i(33))}function Ir(a){var o=a[Tl];return o||(o=a[Tl]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function Ln(a){a[Da]=!0}var xr=new Set,da={};function jr(a,o){Me(a,o),Me(a+"Capture",o)}function Me(a,o){for(da[a]=o,a=0;a<o.length;a++)xr.add(o[a])}var Xe=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]*$"),xt={},Xt={};function Un(a){return Bn.call(Xt,a)?!0:Bn.call(xt,a)?!1:Xe.test(a)?Xt[a]=!0:(xt[a]=!0,!1)}function xi(a,o,h){if(Un(o))if(h===null)a.removeAttribute(o);else{switch(typeof h){case"undefined":case"function":case"symbol":a.removeAttribute(o);return;case"boolean":var y=o.toLowerCase().slice(0,5);if(y!=="data-"&&y!=="aria-"){a.removeAttribute(o);return}}a.setAttribute(o,""+h)}}function Yi(a,o,h){if(h===null)a.removeAttribute(o);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(o);return}a.setAttribute(o,""+h)}}function Ti(a,o,h,y){if(y===null)a.removeAttribute(h);else{switch(typeof y){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(h);return}a.setAttributeNS(o,h,""+y)}}function un(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function or(a){var o=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function xo(a,o,h){var y=Object.getOwnPropertyDescriptor(a.constructor.prototype,o);if(!a.hasOwnProperty(o)&&typeof y<"u"&&typeof y.get=="function"&&typeof y.set=="function"){var S=y.get,M=y.set;return Object.defineProperty(a,o,{configurable:!0,get:function(){return S.call(this)},set:function(L){h=""+L,M.call(this,L)}}),Object.defineProperty(a,o,{enumerable:y.enumerable}),{getValue:function(){return h},setValue:function(L){h=""+L},stopTracking:function(){a._valueTracker=null,delete a[o]}}}}function ha(a){if(!a._valueTracker){var o=or(a)?"checked":"value";a._valueTracker=xo(a,o,""+a[o])}}function Cl(a){if(!a)return!1;var o=a._valueTracker;if(!o)return!0;var h=o.getValue(),y="";return a&&(y=or(a)?a.checked?"true":"false":a.value),a=y,a!==h?(o.setValue(a),!0):!1}function za(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var uc=/[\n"\\]/g;function Di(a){return a.replace(uc,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function ls(a,o,h,y,S,M,L,J){a.name="",L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?a.type=L:a.removeAttribute("type"),o!=null?L==="number"?(o===0&&a.value===""||a.value!=o)&&(a.value=""+un(o)):a.value!==""+un(o)&&(a.value=""+un(o)):L!=="submit"&&L!=="reset"||a.removeAttribute("value"),o!=null?js(a,L,un(o)):h!=null?js(a,L,un(h)):y!=null&&a.removeAttribute("value"),S==null&&M!=null&&(a.defaultChecked=!!M),S!=null&&(a.checked=S&&typeof S!="function"&&typeof S!="symbol"),J!=null&&typeof J!="function"&&typeof J!="symbol"&&typeof J!="boolean"?a.name=""+un(J):a.removeAttribute("name")}function os(a,o,h,y,S,M,L,J){if(M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(a.type=M),o!=null||h!=null){if(!(M!=="submit"&&M!=="reset"||o!=null)){ha(a);return}h=h!=null?""+un(h):"",o=o!=null?""+un(o):h,J||o===a.value||(a.value=o),a.defaultValue=o}y=y??S,y=typeof y!="function"&&typeof y!="symbol"&&!!y,a.checked=J?a.checked:!!y,a.defaultChecked=!!y,L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"&&(a.name=L),ha(a)}function js(a,o,h){o==="number"&&za(a.ownerDocument)===a||a.defaultValue===""+h||(a.defaultValue=""+h)}function oi(a,o,h,y){if(a=a.options,o){o={};for(var S=0;S<h.length;S++)o["$"+h[S]]=!0;for(h=0;h<a.length;h++)S=o.hasOwnProperty("$"+a[h].value),a[h].selected!==S&&(a[h].selected=S),S&&y&&(a[h].defaultSelected=!0)}else{for(h=""+un(h),o=null,S=0;S<a.length;S++){if(a[S].value===h){a[S].selected=!0,y&&(a[S].defaultSelected=!0);return}o!==null||a[S].disabled||(o=a[S])}o!==null&&(o.selected=!0)}}function du(a,o,h){if(o!=null&&(o=""+un(o),o!==a.value&&(a.value=o),h==null)){a.defaultValue!==o&&(a.defaultValue=o);return}a.defaultValue=h!=null?""+un(h):""}function Ba(a,o,h,y){if(o==null){if(y!=null){if(h!=null)throw Error(i(92));if(W(y)){if(1<y.length)throw Error(i(93));y=y[0]}h=y}h==null&&(h=""),o=h}h=un(o),a.defaultValue=h,y=a.textContent,y===h&&y!==""&&y!==null&&(a.value=y),ha(a)}function it(a,o){if(o){var h=a.firstChild;if(h&&h===a.lastChild&&h.nodeType===3){h.nodeValue=o;return}}a.textContent=o}var vo=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 jn(a,o,h){var y=o.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?y?a.setProperty(o,""):o==="float"?a.cssFloat="":a[o]="":y?a.setProperty(o,h):typeof h!="number"||h===0||vo.has(o)?o==="float"?a.cssFloat=h:a[o]=(""+h).trim():a[o]=h+"px"}function rn(a,o,h){if(o!=null&&typeof o!="object")throw Error(i(62));if(a=a.style,h!=null){for(var y in h)!h.hasOwnProperty(y)||o!=null&&o.hasOwnProperty(y)||(y.indexOf("--")===0?a.setProperty(y,""):y==="float"?a.cssFloat="":a[y]="");for(var S in o)y=o[S],o.hasOwnProperty(S)&&h[S]!==y&&jn(a,S,y)}else for(var M in o)o.hasOwnProperty(M)&&jn(a,M,o[M])}function cs(a){if(a.indexOf("-")===-1)return!1;switch(a){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 us=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"]]),fc=/^[\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 Hs(a){return fc.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function ze(){}var qe=null;function mt(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Nt=null,An=null;function Hr(a){var o=nn(a);if(o&&(a=o.stateNode)){var h=a[li]||null;e:switch(a=o.stateNode,o.type){case"input":if(ls(a,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),o=h.name,h.type==="radio"&&o!=null){for(h=a;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+Di(""+o)+'"][type="radio"]'),o=0;o<h.length;o++){var y=h[o];if(y!==a&&y.form===a.form){var S=y[li]||null;if(!S)throw Error(i(90));ls(y,S.value,S.defaultValue,S.defaultValue,S.checked,S.defaultChecked,S.type,S.name)}}for(o=0;o<h.length;o++)y=h[o],y.form===a.form&&Cl(y)}break e;case"textarea":du(a,h.value,h.defaultValue);break e;case"select":o=h.value,o!=null&&oi(a,!!h.multiple,o,!1)}}}var dc=!1;function hu(a,o,h){if(dc)return a(o,h);dc=!0;try{var y=a(o);return y}finally{if(dc=!1,(Nt!==null||An!==null)&&(ne(),Nt&&(o=Nt,a=An,An=Nt=null,Hr(o),a)))for(o=0;o<a.length;o++)Hr(a[o])}}function _o(a,o){var h=a.stateNode;if(h===null)return null;var y=h[li]||null;if(y===null)return null;h=y[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(a=a.type,y=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!y;break e;default:a=!1}if(a)return null;if(h&&typeof h!="function")throw Error(i(231,o,typeof h));return h}var fs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rf=!1;if(fs)try{var pu={};Object.defineProperty(pu,"passive",{get:function(){Rf=!0}}),window.addEventListener("test",pu,pu),window.removeEventListener("test",pu,pu)}catch{Rf=!1}var Al=null,Nf=null,Ml=null;function kf(){if(Ml)return Ml;var a,o=Nf,h=o.length,y,S="value"in Al?Al.value:Al.textContent,M=S.length;for(a=0;a<h&&o[a]===S[a];a++);var L=h-a;for(y=1;y<=L&&o[h-y]===S[M-y];y++);return Ml=S.slice(a,1<y?1-y:void 0)}function So(a){var o=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&o===13&&(a=13)):a=o,a===10&&(a=13),32<=a||a===13?a:0}function mu(){return!0}function Eh(){return!1}function Vi(a){function o(h,y,S,M,L){this._reactName=h,this._targetInst=S,this.type=y,this.nativeEvent=M,this.target=L,this.currentTarget=null;for(var J in a)a.hasOwnProperty(J)&&(h=a[J],this[J]=h?h(M):M[J]);return this.isDefaultPrevented=(M.defaultPrevented!=null?M.defaultPrevented:M.returnValue===!1)?mu:Eh,this.isPropagationStopped=Eh,this}return g(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=mu)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=mu)},persist:function(){},isPersistent:mu}),o}var Rl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gu=Vi(Rl),La=g({},Rl,{view:0,detail:0}),Of=Vi(La),Df,yu,hc,bu=g({},La,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vu,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==hc&&(hc&&a.type==="mousemove"?(Df=a.screenX-hc.screenX,yu=a.screenY-hc.screenY):yu=Df=0,hc=a),Df)},movementY:function(a){return"movementY"in a?a.movementY:yu}}),sg=Vi(bu),zi=g({},bu,{dataTransfer:0}),lg=Vi(zi),og=g({},La,{relatedTarget:0}),zf=Vi(og),cg=g({},Rl,{animationName:0,elapsedTime:0,pseudoElement:0}),ug=Vi(cg),xu=g({},Rl,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),wh=Vi(xu),fg=g({},Rl,{data:0}),Th=Vi(fg),dg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ch={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"},Ah={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hg(a){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(a):(a=Ah[a])?!!o[a]:!1}function vu(){return hg}var Mh=g({},La,{key:function(a){if(a.key){var o=dg[a.key]||a.key;if(o!=="Unidentified")return o}return a.type==="keypress"?(a=So(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?Ch[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vu,charCode:function(a){return a.type==="keypress"?So(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?So(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),Rh=Vi(Mh),pg=g({},bu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Bf=Vi(pg),mg=g({},La,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vu}),Ps=Vi(mg),Nh=g({},Rl,{propertyName:0,elapsedTime:0,pseudoElement:0}),Sb=Vi(Nh),gg=g({},bu,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),Nl=Vi(gg),Gs=g({},Rl,{newState:0,oldState:0}),kh=Vi(Gs),Oh=[9,13,27,32],Eo=fs&&"CompositionEvent"in window,kl=null;fs&&"documentMode"in document&&(kl=document.documentMode);var wo=fs&&"TextEvent"in window&&!kl,Bi=fs&&(!Eo||kl&&8<kl&&11>=kl),_u=" ",Dh=!1;function Lf(a,o){switch(a){case"keyup":return Oh.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pc(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Ol=!1;function Uf(a,o){switch(a){case"compositionend":return pc(o);case"keypress":return o.which!==32?null:(Dh=!0,_u);case"textInput":return a=o.data,a===_u&&Dh?null:a;default:return null}}function yg(a,o){if(Ol)return a==="compositionend"||!Eo&&Lf(a,o)?(a=kf(),Ml=Nf=Al=null,Ol=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return Bi&&o.locale!=="ko"?null:o.data;default:return null}}var Pr={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 zh(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o==="input"?!!Pr[a.type]:o==="textarea"}function If(a,o,h,y){Nt?An?An.push(y):An=[y]:Nt=y,o=oy(o,"onChange"),0<o.length&&(h=new gu("onChange","change",null,h,y),a.push({event:h,listeners:o}))}var mc=null,gc=null;function Bh(a){J1(a,0)}function yc(a){var o=lr(a);if(Cl(o))return a}function Lh(a,o){if(a==="change")return o}var Su=!1;if(fs){var To;if(fs){var Mn="oninput"in document;if(!Mn){var bg=document.createElement("div");bg.setAttribute("oninput","return;"),Mn=typeof bg.oninput=="function"}To=Mn}else To=!1;Su=To&&(!document.documentMode||9<document.documentMode)}function xg(){mc&&(mc.detachEvent("onpropertychange",Uh),gc=mc=null)}function Uh(a){if(a.propertyName==="value"&&yc(gc)){var o=[];If(o,gc,a,mt(a)),hu(Bh,o)}}function Eu(a,o,h){a==="focusin"?(xg(),mc=o,gc=h,mc.attachEvent("onpropertychange",Uh)):a==="focusout"&&xg()}function Dl(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return yc(gc)}function vg(a,o){if(a==="click")return yc(o)}function _g(a,o){if(a==="input"||a==="change")return yc(o)}function Co(a,o){return a===o&&(a!==0||1/a===1/o)||a!==a&&o!==o}var Rn=typeof Object.is=="function"?Object.is:Co;function bc(a,o){if(Rn(a,o))return!0;if(typeof a!="object"||a===null||typeof o!="object"||o===null)return!1;var h=Object.keys(a),y=Object.keys(o);if(h.length!==y.length)return!1;for(y=0;y<h.length;y++){var S=h[y];if(!Bn.call(o,S)||!Rn(a[S],o[S]))return!1}return!0}function Ih(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function jh(a,o){var h=Ih(a);a=0;for(var y;h;){if(h.nodeType===3){if(y=a+h.textContent.length,a<=o&&y>=o)return{node:h,offset:o-a};a=y}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=Ih(h)}}function jf(a,o){return a&&o?a===o?!0:a&&a.nodeType===3?!1:o&&o.nodeType===3?jf(a,o.parentNode):"contains"in a?a.contains(o):a.compareDocumentPosition?!!(a.compareDocumentPosition(o)&16):!1:!1}function Hf(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var o=za(a.document);o instanceof a.HTMLIFrameElement;){try{var h=typeof o.contentWindow.location.href=="string"}catch{h=!1}if(h)a=o.contentWindow;else break;o=za(a.document)}return o}function xc(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o&&(o==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||o==="textarea"||a.contentEditable==="true")}var Sg=fs&&"documentMode"in document&&11>=document.documentMode,vc=null,Pf=null,_c=null,Gr=!1;function Gf(a,o,h){var y=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Gr||vc==null||vc!==za(y)||(y=vc,"selectionStart"in y&&xc(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),_c&&bc(_c,y)||(_c=y,y=oy(Pf,"onSelect"),0<y.length&&(o=new gu("onSelect","select",null,o,h),a.push({event:o,listeners:y}),o.target=vc)))}function zl(a,o){var h={};return h[a.toLowerCase()]=o.toLowerCase(),h["Webkit"+a]="webkit"+o,h["Moz"+a]="moz"+o,h}var Sc={animationend:zl("Animation","AnimationEnd"),animationiteration:zl("Animation","AnimationIteration"),animationstart:zl("Animation","AnimationStart"),transitionrun:zl("Transition","TransitionRun"),transitionstart:zl("Transition","TransitionStart"),transitioncancel:zl("Transition","TransitionCancel"),transitionend:zl("Transition","TransitionEnd")},wu={},cr={};fs&&(cr=document.createElement("div").style,"AnimationEvent"in window||(delete Sc.animationend.animation,delete Sc.animationiteration.animation,delete Sc.animationstart.animation),"TransitionEvent"in window||delete Sc.transitionend.transition);function Bl(a){if(wu[a])return wu[a];if(!Sc[a])return a;var o=Sc[a],h;for(h in o)if(o.hasOwnProperty(h)&&h in cr)return wu[a]=o[h];return a}var vr=Bl("animationend"),Hh=Bl("animationiteration"),ds=Bl("animationstart"),Ec=Bl("transitionrun"),Ll=Bl("transitionstart"),Ph=Bl("transitioncancel"),Ff=Bl("transitionend"),Fs=new Map,qf="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(" ");qf.push("scrollEnd");function Xi(a,o){Fs.set(a,o),jr(o,[a])}var Ul=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},Ci=[],Ao=0,Yf=0;function Il(){for(var a=Ao,o=Yf=Ao=0;o<a;){var h=Ci[o];Ci[o++]=null;var y=Ci[o];Ci[o++]=null;var S=Ci[o];Ci[o++]=null;var M=Ci[o];if(Ci[o++]=null,y!==null&&S!==null){var L=y.pending;L===null?S.next=S:(S.next=L.next,L.next=S),y.pending=S}M!==0&&Vf(h,S,M)}}function Tu(a,o,h,y){Ci[Ao++]=a,Ci[Ao++]=o,Ci[Ao++]=h,Ci[Ao++]=y,Yf|=y,a.lanes|=y,a=a.alternate,a!==null&&(a.lanes|=y)}function wc(a,o,h,y){return Tu(a,o,h,y),Tc(a)}function jl(a,o){return Tu(a,null,null,o),Tc(a)}function Vf(a,o,h){a.lanes|=h;var y=a.alternate;y!==null&&(y.lanes|=h);for(var S=!1,M=a.return;M!==null;)M.childLanes|=h,y=M.alternate,y!==null&&(y.childLanes|=h),M.tag===22&&(a=M.stateNode,a===null||a._visibility&1||(S=!0)),a=M,M=M.return;return a.tag===3?(M=a.stateNode,S&&o!==null&&(S=31-Pt(h),a=M.hiddenUpdates,y=a[S],y===null?a[S]=[o]:y.push(o),o.lane=h|536870912),M):null}function Tc(a){if(50<qo)throw qo=0,Yo=null,Error(i(185));for(var o=a.return;o!==null;)a=o,o=a.return;return a.tag===3?a.stateNode:null}var Hl={};function Eg(a,o,h,y){this.tag=a,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ur(a,o,h,y){return new Eg(a,o,h,y)}function fr(a){return a=a.prototype,!(!a||!a.isReactComponent)}function hs(a,o){var h=a.alternate;return h===null?(h=ur(a.tag,o,a.key,a.mode),h.elementType=a.elementType,h.type=a.type,h.stateNode=a.stateNode,h.alternate=a,a.alternate=h):(h.pendingProps=o,h.type=a.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=a.flags&65011712,h.childLanes=a.childLanes,h.lanes=a.lanes,h.child=a.child,h.memoizedProps=a.memoizedProps,h.memoizedState=a.memoizedState,h.updateQueue=a.updateQueue,o=a.dependencies,h.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},h.sibling=a.sibling,h.index=a.index,h.ref=a.ref,h.refCleanup=a.refCleanup,h}function Ki(a,o){a.flags&=65011714;var h=a.alternate;return h===null?(a.childLanes=0,a.lanes=o,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=h.childLanes,a.lanes=h.lanes,a.child=h.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=h.memoizedProps,a.memoizedState=h.memoizedState,a.updateQueue=h.updateQueue,a.type=h.type,o=h.dependencies,a.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),a}function Cu(a,o,h,y,S,M){var L=0;if(y=a,typeof a=="function")fr(a)&&(L=1);else if(typeof a=="string")L=mO(a,h,oe.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case P:return a=ur(31,h,o,S),a.elementType=P,a.lanes=M,a;case C:return qs(h.children,S,M,o);case T:L=8,S|=24;break;case w:return a=ur(12,h,o,S|2),a.elementType=w,a.lanes=M,a;case j:return a=ur(13,h,o,S),a.elementType=j,a.lanes=M,a;case D:return a=ur(19,h,o,S),a.elementType=D,a.lanes=M,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case R:L=10;break e;case k:L=9;break e;case O:L=11;break e;case F:L=14;break e;case $:L=16,y=null;break e}L=29,h=Error(i(130,a===null?"null":typeof a,"")),y=null}return o=ur(L,h,o,S),o.elementType=a,o.type=y,o.lanes=M,o}function qs(a,o,h,y){return a=ur(7,a,y,o),a.lanes=h,a}function Xf(a,o,h){return a=ur(6,a,null,o),a.lanes=h,a}function wg(a){var o=ur(18,null,null,0);return o.stateNode=a,o}function Ua(a,o,h){return o=ur(4,a.children!==null?a.children:[],a.key,o),o.lanes=h,o.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},o}var Gh=new WeakMap;function _r(a,o){if(typeof a=="object"&&a!==null){var h=Gh.get(a);return h!==void 0?h:(o={value:a,source:o,stack:zn(o)},Gh.set(a,o),o)}return{value:a,source:o,stack:zn(o)}}var Ia=[],Mo=0,Au=null,Cc=0,Fr=[],Sr=0,ps=null,ms=1,gs="";function Ys(a,o){Ia[Mo++]=Cc,Ia[Mo++]=Au,Au=a,Cc=o}function Fh(a,o,h){Fr[Sr++]=ms,Fr[Sr++]=gs,Fr[Sr++]=ps,ps=a;var y=ms;a=gs;var S=32-Pt(y)-1;y&=~(1<<S),h+=1;var M=32-Pt(o)+S;if(30<M){var L=S-S%5;M=(y&(1<<L)-1).toString(32),y>>=L,S-=L,ms=1<<32-Pt(o)+S|h<<S|y,gs=M+a}else ms=1<<M|h<<S|y,gs=a}function Kf(a){a.return!==null&&(Ys(a,1),Fh(a,1,0))}function Pl(a){for(;a===Au;)Au=Ia[--Mo],Ia[Mo]=null,Cc=Ia[--Mo],Ia[Mo]=null;for(;a===ps;)ps=Fr[--Sr],Fr[Sr]=null,gs=Fr[--Sr],Fr[Sr]=null,ms=Fr[--Sr],Fr[Sr]=null}function Mu(a,o){Fr[Sr++]=ms,Fr[Sr++]=gs,Fr[Sr++]=ps,ms=o.id,gs=o.overflow,ps=a}var Ai=null,vn=null,zt=!1,Vs=null,Mi=!1,Wf=Error(i(519));function Ot(a){var o=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ru(_r(o,a)),Wf}function $f(a){var o=a.stateNode,h=a.type,y=a.memoizedProps;switch(o[yt]=a,o[li]=y,h){case"dialog":Bt("cancel",o),Bt("close",o);break;case"iframe":case"object":case"embed":Bt("load",o);break;case"video":case"audio":for(h=0;h<Bp.length;h++)Bt(Bp[h],o);break;case"source":Bt("error",o);break;case"img":case"image":case"link":Bt("error",o),Bt("load",o);break;case"details":Bt("toggle",o);break;case"input":Bt("invalid",o),os(o,y.value,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name,!0);break;case"select":Bt("invalid",o);break;case"textarea":Bt("invalid",o),Ba(o,y.value,y.defaultValue,y.children)}h=y.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||o.textContent===""+h||y.suppressHydrationWarning===!0||iS(o.textContent,h)?(y.popover!=null&&(Bt("beforetoggle",o),Bt("toggle",o)),y.onScroll!=null&&Bt("scroll",o),y.onScrollEnd!=null&&Bt("scrollend",o),y.onClick!=null&&(o.onclick=ze),o=!0):o=!1,o||Ot(a,!0)}function Tg(a){for(Ai=a.return;Ai;)switch(Ai.tag){case 5:case 31:case 13:Mi=!1;return;case 27:case 3:Mi=!0;return;default:Ai=Ai.return}}function Ro(a){if(a!==Ai)return!1;if(!zt)return Tg(a),zt=!0,!1;var o=a.tag,h;if((h=o!==3&&o!==27)&&((h=o===5)&&(h=a.type,h=!(h!=="form"&&h!=="button")||Gb(a.type,a.memoizedProps)),h=!h),h&&vn&&Ot(a),Tg(a),o===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));vn=dS(a)}else if(o===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));vn=dS(a)}else o===27?(o=vn,Yc(a.type)?(a=Xb,Xb=null,vn=a):vn=o):vn=Ai?As(a.stateNode.nextSibling):null;return!0}function No(){vn=Ai=null,zt=!1}function qh(){var a=Vs;return a!==null&&(er===null?er=a:er.push.apply(er,a),Vs=null),a}function Ru(a){Vs===null?Vs=[a]:Vs.push(a)}var Yh=Y(null),Xs=null,Wi=null;function Ks(a,o,h){V(Yh,o._currentValue),o._currentValue=h}function pa(a){a._currentValue=Yh.current,ee(Yh)}function Ws(a,o,h){for(;a!==null;){var y=a.alternate;if((a.childLanes&o)!==o?(a.childLanes|=o,y!==null&&(y.childLanes|=o)):y!==null&&(y.childLanes&o)!==o&&(y.childLanes|=o),a===h)break;a=a.return}}function Zf(a,o,h,y){var S=a.child;for(S!==null&&(S.return=a);S!==null;){var M=S.dependencies;if(M!==null){var L=S.child;M=M.firstContext;e:for(;M!==null;){var J=M;M=S;for(var re=0;re<o.length;re++)if(J.context===o[re]){M.lanes|=h,J=M.alternate,J!==null&&(J.lanes|=h),Ws(M.return,h,a),y||(L=null);break e}M=J.next}}else if(S.tag===18){if(L=S.return,L===null)throw Error(i(341));L.lanes|=h,M=L.alternate,M!==null&&(M.lanes|=h),Ws(L,h,a),L=null}else L=S.child;if(L!==null)L.return=S;else for(L=S;L!==null;){if(L===a){L=null;break}if(S=L.sibling,S!==null){S.return=L.return,L=S;break}L=L.return}S=L}}function Gl(a,o,h,y){a=null;for(var S=o,M=!1;S!==null;){if(!M){if((S.flags&524288)!==0)M=!0;else if((S.flags&262144)!==0)break}if(S.tag===10){var L=S.alternate;if(L===null)throw Error(i(387));if(L=L.memoizedProps,L!==null){var J=S.type;Rn(S.pendingProps.value,L.value)||(a!==null?a.push(J):a=[J])}}else if(S===se.current){if(L=S.alternate,L===null)throw Error(i(387));L.memoizedState.memoizedState!==S.memoizedState.memoizedState&&(a!==null?a.push(Hp):a=[Hp])}S=S.return}a!==null&&Zf(o,a,h,y),o.flags|=262144}function Ac(a){for(a=a.firstContext;a!==null;){if(!Rn(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function ko(a){Xs=a,Wi=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function Ri(a){return Vh(Xs,a)}function Nu(a,o){return Xs===null&&ko(a),Vh(a,o)}function Vh(a,o){var h=o._currentValue;if(o={context:o,memoizedValue:h,next:null},Wi===null){if(a===null)throw Error(i(308));Wi=o,a.dependencies={lanes:0,firstContext:o},a.flags|=524288}else Wi=Wi.next=o;return h}var Cg=typeof AbortController<"u"?AbortController:function(){var a=[],o=this.signal={aborted:!1,addEventListener:function(h,y){a.push(y)}};this.abort=function(){o.aborted=!0,a.forEach(function(h){return h()})}},Ag=t.unstable_scheduleCallback,Xh=t.unstable_NormalPriority,$e={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Kh(){return{controller:new Cg,data:new Map,refCount:0}}function Li(a){a.refCount--,a.refCount===0&&Ag(Xh,function(){a.controller.abort()})}var Oo=null,Wh=0,$s=0,ja=null;function Mc(a,o){if(Oo===null){var h=Oo=[];Wh=0,$s=Db(),ja={status:"pending",value:void 0,then:function(y){h.push(y)}}}return Wh++,o.then($h,$h),o}function $h(){if(--Wh===0&&Oo!==null){ja!==null&&(ja.status="fulfilled");var a=Oo;Oo=null,$s=0,ja=null;for(var o=0;o<a.length;o++)(0,a[o])()}}function Zh(a,o){var h=[],y={status:"pending",value:null,reason:null,then:function(S){h.push(S)}};return a.then(function(){y.status="fulfilled",y.value=o;for(var S=0;S<h.length;S++)(0,h[S])(o)},function(S){for(y.status="rejected",y.reason=S,S=0;S<h.length;S++)(0,h[S])(void 0)}),y}var Mg=B.S;B.S=function(a,o){Gc=hn(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&Mc(a,o),Mg!==null&&Mg(a,o)};var Fl=Y(null);function ys(){var a=Fl.current;return a!==null?a:sn.pooledCache}function Rc(a,o){o===null?V(Fl,Fl.current):V(Fl,o.pool)}function Qf(){var a=ys();return a===null?null:{parent:$e._currentValue,pool:a}}var ql=Error(i(460)),ku=Error(i(474)),Ha=Error(i(542)),Ou={then:function(){}};function Rg(a){return a=a.status,a==="fulfilled"||a==="rejected"}function Qh(a,o,h){switch(h=a[h],h===void 0?a.push(o):h!==o&&(o.then(ze,ze),o=h),o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,Jh(a),a;default:if(typeof o.status=="string")o.then(ze,ze);else{if(a=sn,a!==null&&100<a.shellSuspendCounter)throw Error(i(482));a=o,a.status="pending",a.then(function(y){if(o.status==="pending"){var S=o;S.status="fulfilled",S.value=y}},function(y){if(o.status==="pending"){var S=o;S.status="rejected",S.reason=y}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,Jh(a),a}throw rt=o,ql}}function Do(a){try{var o=a._init;return o(a._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(rt=h,ql):h}}var rt=null;function Jf(){if(rt===null)throw Error(i(459));var a=rt;return rt=null,a}function Jh(a){if(a===ql||a===Ha)throw Error(i(483))}var Yl=null,Vl=0;function ed(a){var o=Vl;return Vl+=1,Yl===null&&(Yl=[]),Qh(Yl,a,o)}function Du(a,o){o=o.props.ref,a.ref=o!==void 0?o:null}function zu(a,o){throw o.$$typeof===b?Error(i(525)):(a=Object.prototype.toString.call(o),Error(i(31,a==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":a)))}function Nc(a){function o(fe,ce){if(a){var he=fe.deletions;he===null?(fe.deletions=[ce],fe.flags|=16):he.push(ce)}}function h(fe,ce){if(!a)return null;for(;ce!==null;)o(fe,ce),ce=ce.sibling;return null}function y(fe){for(var ce=new Map;fe!==null;)fe.key!==null?ce.set(fe.key,fe):ce.set(fe.index,fe),fe=fe.sibling;return ce}function S(fe,ce){return fe=hs(fe,ce),fe.index=0,fe.sibling=null,fe}function M(fe,ce,he){return fe.index=he,a?(he=fe.alternate,he!==null?(he=he.index,he<ce?(fe.flags|=67108866,ce):he):(fe.flags|=67108866,ce)):(fe.flags|=1048576,ce)}function L(fe){return a&&fe.alternate===null&&(fe.flags|=67108866),fe}function J(fe,ce,he,Ce){return ce===null||ce.tag!==6?(ce=Xf(he,fe.mode,Ce),ce.return=fe,ce):(ce=S(ce,he),ce.return=fe,ce)}function re(fe,ce,he,Ce){var nt=he.type;return nt===C?Ee(fe,ce,he.props.children,Ce,he.key):ce!==null&&(ce.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===$&&Do(nt)===ce.type)?(ce=S(ce,he.props),Du(ce,he),ce.return=fe,ce):(ce=Cu(he.type,he.key,he.props,null,fe.mode,Ce),Du(ce,he),ce.return=fe,ce)}function pe(fe,ce,he,Ce){return ce===null||ce.tag!==4||ce.stateNode.containerInfo!==he.containerInfo||ce.stateNode.implementation!==he.implementation?(ce=Ua(he,fe.mode,Ce),ce.return=fe,ce):(ce=S(ce,he.children||[]),ce.return=fe,ce)}function Ee(fe,ce,he,Ce,nt){return ce===null||ce.tag!==7?(ce=qs(he,fe.mode,Ce,nt),ce.return=fe,ce):(ce=S(ce,he),ce.return=fe,ce)}function Ae(fe,ce,he){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return ce=Xf(""+ce,fe.mode,he),ce.return=fe,ce;if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case v:return he=Cu(ce.type,ce.key,ce.props,null,fe.mode,he),Du(he,ce),he.return=fe,he;case _:return ce=Ua(ce,fe.mode,he),ce.return=fe,ce;case $:return ce=Do(ce),Ae(fe,ce,he)}if(W(ce)||G(ce))return ce=qs(ce,fe.mode,he,null),ce.return=fe,ce;if(typeof ce.then=="function")return Ae(fe,ed(ce),he);if(ce.$$typeof===R)return Ae(fe,Nu(fe,ce),he);zu(fe,ce)}return null}function ye(fe,ce,he,Ce){var nt=ce!==null?ce.key:null;if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return nt!==null?null:J(fe,ce,""+he,Ce);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case v:return he.key===nt?re(fe,ce,he,Ce):null;case _:return he.key===nt?pe(fe,ce,he,Ce):null;case $:return he=Do(he),ye(fe,ce,he,Ce)}if(W(he)||G(he))return nt!==null?null:Ee(fe,ce,he,Ce,null);if(typeof he.then=="function")return ye(fe,ce,ed(he),Ce);if(he.$$typeof===R)return ye(fe,ce,Nu(fe,he),Ce);zu(fe,he)}return null}function _e(fe,ce,he,Ce,nt){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number"||typeof Ce=="bigint")return fe=fe.get(he)||null,J(ce,fe,""+Ce,nt);if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case v:return fe=fe.get(Ce.key===null?he:Ce.key)||null,re(ce,fe,Ce,nt);case _:return fe=fe.get(Ce.key===null?he:Ce.key)||null,pe(ce,fe,Ce,nt);case $:return Ce=Do(Ce),_e(fe,ce,he,Ce,nt)}if(W(Ce)||G(Ce))return fe=fe.get(he)||null,Ee(ce,fe,Ce,nt,null);if(typeof Ce.then=="function")return _e(fe,ce,he,ed(Ce),nt);if(Ce.$$typeof===R)return _e(fe,ce,he,Nu(ce,Ce),nt);zu(ce,Ce)}return null}function Ye(fe,ce,he,Ce){for(var nt=null,on=null,Ke=ce,wt=ce=0,jt=null;Ke!==null&&wt<he.length;wt++){Ke.index>wt?(jt=Ke,Ke=null):jt=Ke.sibling;var cn=ye(fe,Ke,he[wt],Ce);if(cn===null){Ke===null&&(Ke=jt);break}a&&Ke&&cn.alternate===null&&o(fe,Ke),ce=M(cn,ce,wt),on===null?nt=cn:on.sibling=cn,on=cn,Ke=jt}if(wt===he.length)return h(fe,Ke),zt&&Ys(fe,wt),nt;if(Ke===null){for(;wt<he.length;wt++)Ke=Ae(fe,he[wt],Ce),Ke!==null&&(ce=M(Ke,ce,wt),on===null?nt=Ke:on.sibling=Ke,on=Ke);return zt&&Ys(fe,wt),nt}for(Ke=y(Ke);wt<he.length;wt++)jt=_e(Ke,fe,wt,he[wt],Ce),jt!==null&&(a&&jt.alternate!==null&&Ke.delete(jt.key===null?wt:jt.key),ce=M(jt,ce,wt),on===null?nt=jt:on.sibling=jt,on=jt);return a&&Ke.forEach(function($c){return o(fe,$c)}),zt&&Ys(fe,wt),nt}function lt(fe,ce,he,Ce){if(he==null)throw Error(i(151));for(var nt=null,on=null,Ke=ce,wt=ce=0,jt=null,cn=he.next();Ke!==null&&!cn.done;wt++,cn=he.next()){Ke.index>wt?(jt=Ke,Ke=null):jt=Ke.sibling;var $c=ye(fe,Ke,cn.value,Ce);if($c===null){Ke===null&&(Ke=jt);break}a&&Ke&&$c.alternate===null&&o(fe,Ke),ce=M($c,ce,wt),on===null?nt=$c:on.sibling=$c,on=$c,Ke=jt}if(cn.done)return h(fe,Ke),zt&&Ys(fe,wt),nt;if(Ke===null){for(;!cn.done;wt++,cn=he.next())cn=Ae(fe,cn.value,Ce),cn!==null&&(ce=M(cn,ce,wt),on===null?nt=cn:on.sibling=cn,on=cn);return zt&&Ys(fe,wt),nt}for(Ke=y(Ke);!cn.done;wt++,cn=he.next())cn=_e(Ke,fe,wt,cn.value,Ce),cn!==null&&(a&&cn.alternate!==null&&Ke.delete(cn.key===null?wt:cn.key),ce=M(cn,ce,wt),on===null?nt=cn:on.sibling=cn,on=cn);return a&&Ke.forEach(function(CO){return o(fe,CO)}),zt&&Ys(fe,wt),nt}function En(fe,ce,he,Ce){if(typeof he=="object"&&he!==null&&he.type===C&&he.key===null&&(he=he.props.children),typeof he=="object"&&he!==null){switch(he.$$typeof){case v:e:{for(var nt=he.key;ce!==null;){if(ce.key===nt){if(nt=he.type,nt===C){if(ce.tag===7){h(fe,ce.sibling),Ce=S(ce,he.props.children),Ce.return=fe,fe=Ce;break e}}else if(ce.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===$&&Do(nt)===ce.type){h(fe,ce.sibling),Ce=S(ce,he.props),Du(Ce,he),Ce.return=fe,fe=Ce;break e}h(fe,ce);break}else o(fe,ce);ce=ce.sibling}he.type===C?(Ce=qs(he.props.children,fe.mode,Ce,he.key),Ce.return=fe,fe=Ce):(Ce=Cu(he.type,he.key,he.props,null,fe.mode,Ce),Du(Ce,he),Ce.return=fe,fe=Ce)}return L(fe);case _:e:{for(nt=he.key;ce!==null;){if(ce.key===nt)if(ce.tag===4&&ce.stateNode.containerInfo===he.containerInfo&&ce.stateNode.implementation===he.implementation){h(fe,ce.sibling),Ce=S(ce,he.children||[]),Ce.return=fe,fe=Ce;break e}else{h(fe,ce);break}else o(fe,ce);ce=ce.sibling}Ce=Ua(he,fe.mode,Ce),Ce.return=fe,fe=Ce}return L(fe);case $:return he=Do(he),En(fe,ce,he,Ce)}if(W(he))return Ye(fe,ce,he,Ce);if(G(he)){if(nt=G(he),typeof nt!="function")throw Error(i(150));return he=nt.call(he),lt(fe,ce,he,Ce)}if(typeof he.then=="function")return En(fe,ce,ed(he),Ce);if(he.$$typeof===R)return En(fe,ce,Nu(fe,he),Ce);zu(fe,he)}return typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint"?(he=""+he,ce!==null&&ce.tag===6?(h(fe,ce.sibling),Ce=S(ce,he),Ce.return=fe,fe=Ce):(h(fe,ce),Ce=Xf(he,fe.mode,Ce),Ce.return=fe,fe=Ce),L(fe)):h(fe,ce)}return function(fe,ce,he,Ce){try{Vl=0;var nt=En(fe,ce,he,Ce);return Yl=null,nt}catch(Ke){if(Ke===ql||Ke===Ha)throw Ke;var on=ur(29,Ke,null,fe.mode);return on.lanes=Ce,on.return=fe,on}finally{}}}var zo=Nc(!0),Ng=Nc(!1),Xl=!1;function ep(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function tp(a,o){a=a.updateQueue,o.updateQueue===a&&(o.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function bs(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Zs(a,o,h){var y=a.updateQueue;if(y===null)return null;if(y=y.shared,(Ut&2)!==0){var S=y.pending;return S===null?o.next=o:(o.next=S.next,S.next=o),y.pending=o,o=Tc(a),Vf(a,null,h),o}return Tu(a,y,o,h),Tc(a)}function Kl(a,o,h){if(o=o.updateQueue,o!==null&&(o=o.shared,(h&4194048)!==0)){var y=o.lanes;y&=a.pendingLanes,h|=y,o.lanes=h,tt(a,h)}}function td(a,o){var h=a.updateQueue,y=a.alternate;if(y!==null&&(y=y.updateQueue,h===y)){var S=null,M=null;if(h=h.firstBaseUpdate,h!==null){do{var L={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};M===null?S=M=L:M=M.next=L,h=h.next}while(h!==null);M===null?S=M=o:M=M.next=o}else S=M=o;h={baseState:y.baseState,firstBaseUpdate:S,lastBaseUpdate:M,shared:y.shared,callbacks:y.callbacks},a.updateQueue=h;return}a=h.lastBaseUpdate,a===null?h.firstBaseUpdate=o:a.next=o,h.lastBaseUpdate=o}var np=!1;function Bu(){if(np){var a=ja;if(a!==null)throw a}}function Bo(a,o,h,y){np=!1;var S=a.updateQueue;Xl=!1;var M=S.firstBaseUpdate,L=S.lastBaseUpdate,J=S.shared.pending;if(J!==null){S.shared.pending=null;var re=J,pe=re.next;re.next=null,L===null?M=pe:L.next=pe,L=re;var Ee=a.alternate;Ee!==null&&(Ee=Ee.updateQueue,J=Ee.lastBaseUpdate,J!==L&&(J===null?Ee.firstBaseUpdate=pe:J.next=pe,Ee.lastBaseUpdate=re))}if(M!==null){var Ae=S.baseState;L=0,Ee=pe=re=null,J=M;do{var ye=J.lane&-536870913,_e=ye!==J.lane;if(_e?(Dt&ye)===ye:(y&ye)===ye){ye!==0&&ye===$s&&(np=!0),Ee!==null&&(Ee=Ee.next={lane:0,tag:J.tag,payload:J.payload,callback:null,next:null});e:{var Ye=a,lt=J;ye=o;var En=h;switch(lt.tag){case 1:if(Ye=lt.payload,typeof Ye=="function"){Ae=Ye.call(En,Ae,ye);break e}Ae=Ye;break e;case 3:Ye.flags=Ye.flags&-65537|128;case 0:if(Ye=lt.payload,ye=typeof Ye=="function"?Ye.call(En,Ae,ye):Ye,ye==null)break e;Ae=g({},Ae,ye);break e;case 2:Xl=!0}}ye=J.callback,ye!==null&&(a.flags|=64,_e&&(a.flags|=8192),_e=S.callbacks,_e===null?S.callbacks=[ye]:_e.push(ye))}else _e={lane:ye,tag:J.tag,payload:J.payload,callback:J.callback,next:null},Ee===null?(pe=Ee=_e,re=Ae):Ee=Ee.next=_e,L|=ye;if(J=J.next,J===null){if(J=S.shared.pending,J===null)break;_e=J,J=_e.next,_e.next=null,S.lastBaseUpdate=_e,S.shared.pending=null}}while(!0);Ee===null&&(re=Ae),S.baseState=re,S.firstBaseUpdate=pe,S.lastBaseUpdate=Ee,M===null&&(S.shared.lanes=0),ea|=L,a.lanes=L,a.memoizedState=Ae}}function xs(a,o){if(typeof a!="function")throw Error(i(191,a));a.call(o)}function Ui(a,o){var h=a.callbacks;if(h!==null)for(a.callbacks=null,a=0;a<h.length;a++)xs(h[a],o)}var qr=Y(null),dr=Y(0);function ip(a,o){a=ii,V(dr,a),V(qr,o),ii=a|o.baseLanes}function rp(){V(dr,ii),V(qr,qr.current)}function $i(){ii=dr.current,ee(qr),ee(dr)}var vi=Y(null),ma=null;function Wl(a){var o=a.alternate;V(Fn,Fn.current&1),V(vi,a),ma===null&&(o===null||qr.current!==null||o.memoizedState!==null)&&(ma=a)}function ap(a){V(Fn,Fn.current),V(vi,a),ma===null&&(ma=a)}function kg(a){a.tag===22?(V(Fn,Fn.current),V(vi,a),ma===null&&(ma=a)):Qs()}function Qs(){V(Fn,Fn.current),V(vi,vi.current)}function Yr(a){ee(vi),ma===a&&(ma=null),ee(Fn)}var Fn=Y(0);function nd(a){for(var o=a;o!==null;){if(o.tag===13){var h=o.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||Yb(h)||Vb(h)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break;for(;o.sibling===null;){if(o.return===null||o.return===a)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Er=0,ot=null,pn=null,ci=null,id=!1,vs=!1,Lo=!1,rd=0,Lu=0,_s=null,Eb=0;function qn(){throw Error(i(321))}function sp(a,o){if(o===null)return!1;for(var h=0;h<o.length&&h<a.length;h++)if(!Rn(a[h],o[h]))return!1;return!0}function lp(a,o,h,y,S,M){return Er=M,ot=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,B.H=a===null||a.memoizedState===null?Zg:Dc,Lo=!1,M=h(y,S),Lo=!1,vs&&(M=Dg(o,h,y,S)),Og(a),M}function Og(a){B.H=Pu;var o=pn!==null&&pn.next!==null;if(Er=0,ci=pn=ot=null,id=!1,Lu=0,_s=null,o)throw Error(i(300));a===null||Nn||(a=a.dependencies,a!==null&&Ac(a)&&(Nn=!0))}function Dg(a,o,h,y){ot=a;var S=0;do{if(vs&&(_s=null),Lu=0,vs=!1,25<=S)throw Error(i(301));if(S+=1,ci=pn=null,a.updateQueue!=null){var M=a.updateQueue;M.lastEffect=null,M.events=null,M.stores=null,M.memoCache!=null&&(M.memoCache.index=0)}B.H=Gu,M=o(h,y)}while(vs);return M}function wb(){var a=B.H,o=a.useState()[0];return o=typeof o.then=="function"?Iu(o):o,a=a.useState()[0],(pn!==null?pn.memoizedState:null)!==a&&(ot.flags|=1024),o}function op(){var a=rd!==0;return rd=0,a}function cp(a,o,h){o.updateQueue=a.updateQueue,o.flags&=-2053,a.lanes&=~h}function up(a){if(id){for(a=a.memoizedState;a!==null;){var o=a.queue;o!==null&&(o.pending=null),a=a.next}id=!1}Er=0,ci=pn=ot=null,vs=!1,Lu=rd=0,_s=null}function hr(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ci===null?ot.memoizedState=ci=a:ci=ci.next=a,ci}function Jn(){if(pn===null){var a=ot.alternate;a=a!==null?a.memoizedState:null}else a=pn.next;var o=ci===null?ot.memoizedState:ci.next;if(o!==null)ci=o,pn=a;else{if(a===null)throw ot.alternate===null?Error(i(467)):Error(i(310));pn=a,a={memoizedState:pn.memoizedState,baseState:pn.baseState,baseQueue:pn.baseQueue,queue:pn.queue,next:null},ci===null?ot.memoizedState=ci=a:ci=ci.next=a}return ci}function Uu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Iu(a){var o=Lu;return Lu+=1,_s===null&&(_s=[]),a=Qh(_s,a,o),o=ot,(ci===null?o.memoizedState:ci.next)===null&&(o=o.alternate,B.H=o===null||o.memoizedState===null?Zg:Dc),a}function ad(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Iu(a);if(a.$$typeof===R)return Ri(a)}throw Error(i(438,String(a)))}function fp(a){var o=null,h=ot.updateQueue;if(h!==null&&(o=h.memoCache),o==null){var y=ot.alternate;y!==null&&(y=y.updateQueue,y!==null&&(y=y.memoCache,y!=null&&(o={data:y.data.map(function(S){return S.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),h===null&&(h=Uu(),ot.updateQueue=h),h.memoCache=o,h=o.data[o.index],h===void 0)for(h=o.data[o.index]=Array(a),y=0;y<a;y++)h[y]=I;return o.index++,h}function Js(a,o){return typeof o=="function"?o(a):o}function sd(a){var o=Jn();return dp(o,pn,a)}function dp(a,o,h){var y=a.queue;if(y===null)throw Error(i(311));y.lastRenderedReducer=h;var S=a.baseQueue,M=y.pending;if(M!==null){if(S!==null){var L=S.next;S.next=M.next,M.next=L}o.baseQueue=S=M,y.pending=null}if(M=a.baseState,S===null)a.memoizedState=M;else{o=S.next;var J=L=null,re=null,pe=o,Ee=!1;do{var Ae=pe.lane&-536870913;if(Ae!==pe.lane?(Dt&Ae)===Ae:(Er&Ae)===Ae){var ye=pe.revertLane;if(ye===0)re!==null&&(re=re.next={lane:0,revertLane:0,gesture:null,action:pe.action,hasEagerState:pe.hasEagerState,eagerState:pe.eagerState,next:null}),Ae===$s&&(Ee=!0);else if((Er&ye)===ye){pe=pe.next,ye===$s&&(Ee=!0);continue}else Ae={lane:0,revertLane:pe.revertLane,gesture:null,action:pe.action,hasEagerState:pe.hasEagerState,eagerState:pe.eagerState,next:null},re===null?(J=re=Ae,L=M):re=re.next=Ae,ot.lanes|=ye,ea|=ye;Ae=pe.action,Lo&&h(M,Ae),M=pe.hasEagerState?pe.eagerState:h(M,Ae)}else ye={lane:Ae,revertLane:pe.revertLane,gesture:pe.gesture,action:pe.action,hasEagerState:pe.hasEagerState,eagerState:pe.eagerState,next:null},re===null?(J=re=ye,L=M):re=re.next=ye,ot.lanes|=Ae,ea|=Ae;pe=pe.next}while(pe!==null&&pe!==o);if(re===null?L=M:re.next=J,!Rn(M,a.memoizedState)&&(Nn=!0,Ee&&(h=ja,h!==null)))throw h;a.memoizedState=M,a.baseState=L,a.baseQueue=re,y.lastRenderedState=M}return S===null&&(y.lanes=0),[a.memoizedState,y.dispatch]}function ld(a){var o=Jn(),h=o.queue;if(h===null)throw Error(i(311));h.lastRenderedReducer=a;var y=h.dispatch,S=h.pending,M=o.memoizedState;if(S!==null){h.pending=null;var L=S=S.next;do M=a(M,L.action),L=L.next;while(L!==S);Rn(M,o.memoizedState)||(Nn=!0),o.memoizedState=M,o.baseQueue===null&&(o.baseState=M),h.lastRenderedState=M}return[M,y]}function hp(a,o,h){var y=ot,S=Jn(),M=zt;if(M){if(h===void 0)throw Error(i(407));h=h()}else h=o();var L=!Rn((pn||S).memoizedState,h);if(L&&(S.memoizedState=h,Nn=!0),S=S.queue,bp(mp.bind(null,y,S,a),[a]),S.getSnapshot!==o||L||ci!==null&&ci.memoizedState.tag&1){if(y.flags|=2048,kc(9,{destroy:void 0},pp.bind(null,y,S,h,o),null),sn===null)throw Error(i(349));M||(Er&127)!==0||zg(y,o,h)}return h}function zg(a,o,h){a.flags|=16384,a={getSnapshot:o,value:h},o=ot.updateQueue,o===null?(o=Uu(),ot.updateQueue=o,o.stores=[a]):(h=o.stores,h===null?o.stores=[a]:h.push(a))}function pp(a,o,h,y){o.value=h,o.getSnapshot=y,gp(o)&&od(a)}function mp(a,o,h){return h(function(){gp(o)&&od(a)})}function gp(a){var o=a.getSnapshot;a=a.value;try{var h=o();return!Rn(a,h)}catch{return!0}}function od(a){var o=jl(a,2);o!==null&&f(o,a,2)}function ju(a){var o=hr();if(typeof a=="function"){var h=a;if(a=h(),Lo){Gn(!0);try{h()}finally{Gn(!1)}}}return o.memoizedState=o.baseState=a,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Js,lastRenderedState:a},o}function Bg(a,o,h,y){return a.baseState=h,dp(a,pn,typeof y=="function"?y:Js)}function Tb(a,o,h,y,S){if(el(a))throw Error(i(485));if(a=o.action,a!==null){var M={payload:S,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(L){M.listeners.push(L)}};B.T!==null?h(!0):M.isTransition=!1,y(M),h=o.pending,h===null?(M.next=o.pending=M,Lg(o,M)):(M.next=h.next,o.pending=h.next=M)}}function Lg(a,o){var h=o.action,y=o.payload,S=a.state;if(o.isTransition){var M=B.T,L={};B.T=L;try{var J=h(S,y),re=B.S;re!==null&&re(L,J),Ug(a,o,J)}catch(pe){cd(a,o,pe)}finally{M!==null&&L.types!==null&&(M.types=L.types),B.T=M}}else try{M=h(S,y),Ug(a,o,M)}catch(pe){cd(a,o,pe)}}function Ug(a,o,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(y){yp(a,o,y)},function(y){return cd(a,o,y)}):yp(a,o,h)}function yp(a,o,h){o.status="fulfilled",o.value=h,Ig(o),a.state=h,o=a.pending,o!==null&&(h=o.next,h===o?a.pending=null:(h=h.next,o.next=h,Lg(a,h)))}function cd(a,o,h){var y=a.pending;if(a.pending=null,y!==null){y=y.next;do o.status="rejected",o.reason=h,Ig(o),o=o.next;while(o!==y)}a.action=null}function Ig(a){a=a.listeners;for(var o=0;o<a.length;o++)(0,a[o])()}function jg(a,o){return o}function Hg(a,o){if(zt){var h=sn.formState;if(h!==null){e:{var y=ot;if(zt){if(vn){t:{for(var S=vn,M=Mi;S.nodeType!==8;){if(!M){S=null;break t}if(S=As(S.nextSibling),S===null){S=null;break t}}M=S.data,S=M==="F!"||M==="F"?S:null}if(S){vn=As(S.nextSibling),y=S.data==="F!";break e}}Ot(y)}y=!1}y&&(o=h[0])}}return h=hr(),h.memoizedState=h.baseState=o,y={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jg,lastRenderedState:o},h.queue=y,h=$g.bind(null,ot,y),y.dispatch=h,y=ju(!1),M=Hu.bind(null,ot,!1,y.queue),y=hr(),S={state:o,dispatch:null,action:a,pending:null},y.queue=S,h=Tb.bind(null,ot,S,M,h),S.dispatch=h,y.memoizedState=a,[o,h,!1]}function Pg(a){var o=Jn();return Gg(o,pn,a)}function Gg(a,o,h){if(o=dp(a,o,jg)[0],a=sd(Js)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var y=Iu(o)}catch(L){throw L===ql?Ha:L}else y=o;o=Jn();var S=o.queue,M=S.dispatch;return h!==o.memoizedState&&(ot.flags|=2048,kc(9,{destroy:void 0},Cb.bind(null,S,h),null)),[y,M,a]}function Cb(a,o){a.action=o}function Fg(a){var o=Jn(),h=pn;if(h!==null)return Gg(o,h,a);Jn(),o=o.memoizedState,h=Jn();var y=h.queue.dispatch;return h.memoizedState=a,[o,y,!1]}function kc(a,o,h,y){return a={tag:a,create:h,deps:y,inst:o,next:null},o=ot.updateQueue,o===null&&(o=Uu(),ot.updateQueue=o),h=o.lastEffect,h===null?o.lastEffect=a.next=a:(y=h.next,h.next=a,a.next=y,o.lastEffect=a),a}function qg(){return Jn().memoizedState}function ud(a,o,h,y){var S=hr();ot.flags|=a,S.memoizedState=kc(1|o,{destroy:void 0},h,y===void 0?null:y)}function fd(a,o,h,y){var S=Jn();y=y===void 0?null:y;var M=S.memoizedState.inst;pn!==null&&y!==null&&sp(y,pn.memoizedState.deps)?S.memoizedState=kc(o,M,h,y):(ot.flags|=a,S.memoizedState=kc(1|o,M,h,y))}function Yg(a,o){ud(8390656,8,a,o)}function bp(a,o){fd(2048,8,a,o)}function Vg(a){ot.flags|=4;var o=ot.updateQueue;if(o===null)o=Uu(),ot.updateQueue=o,o.events=[a];else{var h=o.events;h===null?o.events=[a]:h.push(a)}}function Xg(a){var o=Jn().memoizedState;return Vg({ref:o,nextImpl:a}),function(){if((Ut&2)!==0)throw Error(i(440));return o.impl.apply(void 0,arguments)}}function Kg(a,o){return fd(4,2,a,o)}function Vr(a,o){return fd(4,4,a,o)}function xp(a,o){if(typeof o=="function"){a=a();var h=o(a);return function(){typeof h=="function"?h():o(null)}}if(o!=null)return a=a(),o.current=a,function(){o.current=null}}function dd(a,o,h){h=h!=null?h.concat([a]):null,fd(4,4,xp.bind(null,o,a),h)}function hd(){}function vp(a,o){var h=Jn();o=o===void 0?null:o;var y=h.memoizedState;return o!==null&&sp(o,y[1])?y[0]:(h.memoizedState=[a,o],a)}function _p(a,o){var h=Jn();o=o===void 0?null:o;var y=h.memoizedState;if(o!==null&&sp(o,y[1]))return y[0];if(y=a(),Lo){Gn(!0);try{a()}finally{Gn(!1)}}return h.memoizedState=[y,o],y}function Sp(a,o,h){return h===void 0||(Er&1073741824)!==0&&(Dt&261930)===0?a.memoizedState=o:(a.memoizedState=h,a=u(),ot.lanes|=a,ea|=a,h)}function Ep(a,o,h,y){return Rn(h,o)?h:qr.current!==null?(a=Sp(a,h,y),Rn(a,o)||(Nn=!0),a):(Er&42)===0||(Er&1073741824)!==0&&(Dt&261930)===0?(Nn=!0,a.memoizedState=h):(a=u(),ot.lanes|=a,ea|=a,o)}function wp(a,o,h,y,S){var M=X.p;X.p=M!==0&&8>M?M:8;var L=B.T,J={};B.T=J,Hu(a,!1,o,h);try{var re=S(),pe=B.S;if(pe!==null&&pe(J,re),re!==null&&typeof re=="object"&&typeof re.then=="function"){var Ee=Zh(re,y);Oc(a,o,Ee,mr(a))}else Oc(a,o,y,mr(a))}catch(Ae){Oc(a,o,{then:function(){},status:"rejected",reason:Ae},mr())}finally{X.p=M,L!==null&&J.types!==null&&(L.types=J.types),B.T=L}}function Ab(){}function Tp(a,o,h,y){if(a.tag!==5)throw Error(i(476));var S=Wg(a).queue;wp(a,S,o,Z,h===null?Ab:function(){return Cp(a),h(y)})}function Wg(a){var o=a.memoizedState;if(o!==null)return o;o={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Js,lastRenderedState:Z},next:null};var h={};return o.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Js,lastRenderedState:h},next:null},a.memoizedState=o,a=a.alternate,a!==null&&(a.memoizedState=o),o}function Cp(a){var o=Wg(a);o.next===null&&(o=a.alternate.memoizedState),Oc(a,o.next.queue,{},mr())}function Ap(){return Ri(Hp)}function Ii(){return Jn().memoizedState}function Mp(){return Jn().memoizedState}function Mb(a){for(var o=a.return;o!==null;){switch(o.tag){case 24:case 3:var h=mr();a=bs(h);var y=Zs(o,a,h);y!==null&&(f(y,o,h),Kl(y,o,h)),o={cache:Kh()},a.payload=o;return}o=o.return}}function Rb(a,o,h){var y=mr();h={lane:y,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},el(a)?Uo(o,h):(h=wc(a,o,h,y),h!==null&&(f(h,a,y),wr(h,o,y)))}function $g(a,o,h){var y=mr();Oc(a,o,h,y)}function Oc(a,o,h,y){var S={lane:y,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(el(a))Uo(o,S);else{var M=a.alternate;if(a.lanes===0&&(M===null||M.lanes===0)&&(M=o.lastRenderedReducer,M!==null))try{var L=o.lastRenderedState,J=M(L,h);if(S.hasEagerState=!0,S.eagerState=J,Rn(J,L))return Tu(a,o,S,0),sn===null&&Il(),!1}catch{}finally{}if(h=wc(a,o,S,y),h!==null)return f(h,a,y),wr(h,o,y),!0}return!1}function Hu(a,o,h,y){if(y={lane:2,revertLane:Db(),gesture:null,action:y,hasEagerState:!1,eagerState:null,next:null},el(a)){if(o)throw Error(i(479))}else o=wc(a,h,y,2),o!==null&&f(o,a,2)}function el(a){var o=a.alternate;return a===ot||o!==null&&o===ot}function Uo(a,o){vs=id=!0;var h=a.pending;h===null?o.next=o:(o.next=h.next,h.next=o),a.pending=o}function wr(a,o,h){if((h&4194048)!==0){var y=o.lanes;y&=a.pendingLanes,h|=y,o.lanes=h,tt(a,h)}}var Pu={readContext:Ri,use:ad,useCallback:qn,useContext:qn,useEffect:qn,useImperativeHandle:qn,useLayoutEffect:qn,useInsertionEffect:qn,useMemo:qn,useReducer:qn,useRef:qn,useState:qn,useDebugValue:qn,useDeferredValue:qn,useTransition:qn,useSyncExternalStore:qn,useId:qn,useHostTransitionStatus:qn,useFormState:qn,useActionState:qn,useOptimistic:qn,useMemoCache:qn,useCacheRefresh:qn};Pu.useEffectEvent=qn;var Zg={readContext:Ri,use:ad,useCallback:function(a,o){return hr().memoizedState=[a,o===void 0?null:o],a},useContext:Ri,useEffect:Yg,useImperativeHandle:function(a,o,h){h=h!=null?h.concat([a]):null,ud(4194308,4,xp.bind(null,o,a),h)},useLayoutEffect:function(a,o){return ud(4194308,4,a,o)},useInsertionEffect:function(a,o){ud(4,2,a,o)},useMemo:function(a,o){var h=hr();o=o===void 0?null:o;var y=a();if(Lo){Gn(!0);try{a()}finally{Gn(!1)}}return h.memoizedState=[y,o],y},useReducer:function(a,o,h){var y=hr();if(h!==void 0){var S=h(o);if(Lo){Gn(!0);try{h(o)}finally{Gn(!1)}}}else S=o;return y.memoizedState=y.baseState=S,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:S},y.queue=a,a=a.dispatch=Rb.bind(null,ot,a),[y.memoizedState,a]},useRef:function(a){var o=hr();return a={current:a},o.memoizedState=a},useState:function(a){a=ju(a);var o=a.queue,h=$g.bind(null,ot,o);return o.dispatch=h,[a.memoizedState,h]},useDebugValue:hd,useDeferredValue:function(a,o){var h=hr();return Sp(h,a,o)},useTransition:function(){var a=ju(!1);return a=wp.bind(null,ot,a.queue,!0,!1),hr().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,o,h){var y=ot,S=hr();if(zt){if(h===void 0)throw Error(i(407));h=h()}else{if(h=o(),sn===null)throw Error(i(349));(Dt&127)!==0||zg(y,o,h)}S.memoizedState=h;var M={value:h,getSnapshot:o};return S.queue=M,Yg(mp.bind(null,y,M,a),[a]),y.flags|=2048,kc(9,{destroy:void 0},pp.bind(null,y,M,h,o),null),h},useId:function(){var a=hr(),o=sn.identifierPrefix;if(zt){var h=gs,y=ms;h=(y&~(1<<32-Pt(y)-1)).toString(32)+h,o="_"+o+"R_"+h,h=rd++,0<h&&(o+="H"+h.toString(32)),o+="_"}else h=Eb++,o="_"+o+"r_"+h.toString(32)+"_";return a.memoizedState=o},useHostTransitionStatus:Ap,useFormState:Hg,useActionState:Hg,useOptimistic:function(a){var o=hr();o.memoizedState=o.baseState=a;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=h,o=Hu.bind(null,ot,!0,h),h.dispatch=o,[a,o]},useMemoCache:fp,useCacheRefresh:function(){return hr().memoizedState=Mb.bind(null,ot)},useEffectEvent:function(a){var o=hr(),h={impl:a};return o.memoizedState=h,function(){if((Ut&2)!==0)throw Error(i(440));return h.impl.apply(void 0,arguments)}}},Dc={readContext:Ri,use:ad,useCallback:vp,useContext:Ri,useEffect:bp,useImperativeHandle:dd,useInsertionEffect:Kg,useLayoutEffect:Vr,useMemo:_p,useReducer:sd,useRef:qg,useState:function(){return sd(Js)},useDebugValue:hd,useDeferredValue:function(a,o){var h=Jn();return Ep(h,pn.memoizedState,a,o)},useTransition:function(){var a=sd(Js)[0],o=Jn().memoizedState;return[typeof a=="boolean"?a:Iu(a),o]},useSyncExternalStore:hp,useId:Ii,useHostTransitionStatus:Ap,useFormState:Pg,useActionState:Pg,useOptimistic:function(a,o){var h=Jn();return Bg(h,pn,a,o)},useMemoCache:fp,useCacheRefresh:Mp};Dc.useEffectEvent=Xg;var Gu={readContext:Ri,use:ad,useCallback:vp,useContext:Ri,useEffect:bp,useImperativeHandle:dd,useInsertionEffect:Kg,useLayoutEffect:Vr,useMemo:_p,useReducer:ld,useRef:qg,useState:function(){return ld(Js)},useDebugValue:hd,useDeferredValue:function(a,o){var h=Jn();return pn===null?Sp(h,a,o):Ep(h,pn.memoizedState,a,o)},useTransition:function(){var a=ld(Js)[0],o=Jn().memoizedState;return[typeof a=="boolean"?a:Iu(a),o]},useSyncExternalStore:hp,useId:Ii,useHostTransitionStatus:Ap,useFormState:Fg,useActionState:Fg,useOptimistic:function(a,o){var h=Jn();return pn!==null?Bg(h,pn,a,o):(h.baseState=a,[a,h.queue.dispatch])},useMemoCache:fp,useCacheRefresh:Mp};Gu.useEffectEvent=Xg;function zc(a,o,h,y){o=a.memoizedState,h=h(y,o),h=h==null?o:g({},o,h),a.memoizedState=h,a.lanes===0&&(a.updateQueue.baseState=h)}var Fu={enqueueSetState:function(a,o,h){a=a._reactInternals;var y=mr(),S=bs(y);S.payload=o,h!=null&&(S.callback=h),o=Zs(a,S,y),o!==null&&(f(o,a,y),Kl(o,a,y))},enqueueReplaceState:function(a,o,h){a=a._reactInternals;var y=mr(),S=bs(y);S.tag=1,S.payload=o,h!=null&&(S.callback=h),o=Zs(a,S,y),o!==null&&(f(o,a,y),Kl(o,a,y))},enqueueForceUpdate:function(a,o){a=a._reactInternals;var h=mr(),y=bs(h);y.tag=2,o!=null&&(y.callback=o),o=Zs(a,y,h),o!==null&&(f(o,a,h),Kl(o,a,h))}};function Qg(a,o,h,y,S,M,L){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(y,M,L):o.prototype&&o.prototype.isPureReactComponent?!bc(h,y)||!bc(S,M):!0}function Jg(a,o,h,y){a=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(h,y),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(h,y),o.state!==a&&Fu.enqueueReplaceState(o,o.state,null)}function ji(a,o){var h=o;if("ref"in o){h={};for(var y in o)y!=="ref"&&(h[y]=o[y])}if(a=a.defaultProps){h===o&&(h=g({},h));for(var S in a)h[S]===void 0&&(h[S]=a[S])}return h}function Rp(a){Ul(a)}function ey(a){console.error(a)}function pd(a){Ul(a)}function md(a,o){try{var h=a.onUncaughtError;h(o.value,{componentStack:o.stack})}catch(y){setTimeout(function(){throw y})}}function ty(a,o,h){try{var y=a.onCaughtError;y(h.value,{componentStack:h.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(S){setTimeout(function(){throw S})}}function Np(a,o,h){return h=bs(h),h.tag=3,h.payload={element:null},h.callback=function(){md(a,o)},h}function Bc(a){return a=bs(a),a.tag=3,a}function Tr(a,o,h,y){var S=h.type.getDerivedStateFromError;if(typeof S=="function"){var M=y.value;a.payload=function(){return S(M)},a.callback=function(){ty(o,h,y)}}var L=h.stateNode;L!==null&&typeof L.componentDidCatch=="function"&&(a.callback=function(){ty(o,h,y),typeof S!="function"&&(Cs===null?Cs=new Set([this]):Cs.add(this));var J=y.stack;this.componentDidCatch(y.value,{componentStack:J!==null?J:""})})}function Xr(a,o,h,y,S){if(h.flags|=32768,y!==null&&typeof y=="object"&&typeof y.then=="function"){if(o=h.alternate,o!==null&&Gl(o,h,S,!0),h=vi.current,h!==null){switch(h.tag){case 31:case 13:return ma===null?ht():h.alternate===null&&ln===0&&(ln=3),h.flags&=-257,h.flags|=65536,h.lanes=S,y===Ou?h.flags|=16384:(o=h.updateQueue,o===null?h.updateQueue=new Set([y]):o.add(y),Nb(a,y,S)),!1;case 22:return h.flags|=65536,y===Ou?h.flags|=16384:(o=h.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([y])},h.updateQueue=o):(h=o.retryQueue,h===null?o.retryQueue=new Set([y]):h.add(y)),Nb(a,y,S)),!1}throw Error(i(435,h.tag))}return Nb(a,y,S),ht(),!1}if(zt)return o=vi.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=S,y!==Wf&&(a=Error(i(422),{cause:y}),Ru(_r(a,h)))):(y!==Wf&&(o=Error(i(423),{cause:y}),Ru(_r(o,h))),a=a.current.alternate,a.flags|=65536,S&=-S,a.lanes|=S,y=_r(y,h),S=Np(a.stateNode,y,S),td(a,S),ln!==4&&(ln=2)),!1;var M=Error(i(520),{cause:y});if(M=_r(M,h),Ya===null?Ya=[M]:Ya.push(M),ln!==4&&(ln=2),o===null)return!0;y=_r(y,h),h=o;do{switch(h.tag){case 3:return h.flags|=65536,a=S&-S,h.lanes|=a,a=Np(h.stateNode,y,a),td(h,a),!1;case 1:if(o=h.type,M=h.stateNode,(h.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||M!==null&&typeof M.componentDidCatch=="function"&&(Cs===null||!Cs.has(M))))return h.flags|=65536,S&=-S,h.lanes|=S,S=Bc(S),Tr(S,a,h,y),td(h,S),!1}h=h.return}while(h!==null);return!1}var gd=Error(i(461)),Nn=!1;function Yn(a,o,h,y){o.child=a===null?Ng(o,null,h,y):zo(o,a.child,h,y)}function qu(a,o,h,y,S){h=h.render;var M=o.ref;if("ref"in y){var L={};for(var J in y)J!=="ref"&&(L[J]=y[J])}else L=y;return ko(o),y=lp(a,o,h,L,M,S),J=op(),a!==null&&!Nn?(cp(a,o,S),Fa(a,o,S)):(zt&&J&&Kf(o),o.flags|=1,Yn(a,o,y,S),o.child)}function Yu(a,o,h,y,S){if(a===null){var M=h.type;return typeof M=="function"&&!fr(M)&&M.defaultProps===void 0&&h.compare===null?(o.tag=15,o.type=M,Kr(a,o,M,y,S)):(a=Cu(h.type,null,y,o,o.mode,S),a.ref=o.ref,a.return=o,o.child=a)}if(M=a.child,!Zl(a,S)){var L=M.memoizedProps;if(h=h.compare,h=h!==null?h:bc,h(L,y)&&a.ref===o.ref)return Fa(a,o,S)}return o.flags|=1,a=hs(M,y),a.ref=o.ref,a.return=o,o.child=a}function Kr(a,o,h,y,S){if(a!==null){var M=a.memoizedProps;if(bc(M,y)&&a.ref===o.ref)if(Nn=!1,o.pendingProps=y=M,Zl(a,S))(a.flags&131072)!==0&&(Nn=!0);else return o.lanes=a.lanes,Fa(a,o,S)}return Lc(a,o,h,y,S)}function Wr(a,o,h,y){var S=y.children,M=a!==null?a.memoizedState:null;if(a===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),y.mode==="hidden"){if((o.flags&128)!==0){if(M=M!==null?M.baseLanes|h:h,a!==null){for(y=o.child=a.child,S=0;y!==null;)S=S|y.lanes|y.childLanes,y=y.sibling;y=S&~M}else y=0,o.child=null;return Ss(a,o,M,h,y)}if((h&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},a!==null&&Rc(o,M!==null?M.cachePool:null),M!==null?ip(o,M):rp(),kg(o);else return y=o.lanes=536870912,Ss(a,o,M!==null?M.baseLanes|h:h,h,y)}else M!==null?(Rc(o,M.cachePool),ip(o,M),Qs(),o.memoizedState=null):(a!==null&&Rc(o,null),rp(),Qs());return Yn(a,o,S,h),o.child}function Pa(a,o){return a!==null&&a.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function Ss(a,o,h,y,S){var M=ys();return M=M===null?null:{parent:$e._currentValue,pool:M},o.memoizedState={baseLanes:h,cachePool:M},a!==null&&Rc(o,null),rp(),kg(o),a!==null&&Gl(a,o,y,!0),o.childLanes=S,null}function ga(a,o){return o=Uc({mode:o.mode,children:o.children},a.mode),o.ref=a.ref,a.child=o,o.return=a,o}function Ni(a,o,h){return zo(o,a.child,null,h),a=ga(o,o.pendingProps),a.flags|=2,Yr(o),o.memoizedState=null,a}function Vu(a,o,h){var y=o.pendingProps,S=(o.flags&128)!==0;if(o.flags&=-129,a===null){if(zt){if(y.mode==="hidden")return a=ga(o,y),o.lanes=536870912,Pa(null,a);if(ap(o),(a=vn)?(a=fS(a,Mi),a=a!==null&&a.data==="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:ps!==null?{id:ms,overflow:gs}:null,retryLane:536870912,hydrationErrors:null},h=wg(a),h.return=o,o.child=h,Ai=o,vn=null)):a=null,a===null)throw Ot(o);return o.lanes=536870912,null}return ga(o,y)}var M=a.memoizedState;if(M!==null){var L=M.dehydrated;if(ap(o),S)if(o.flags&256)o.flags&=-257,o=Ni(a,o,h);else if(o.memoizedState!==null)o.child=a.child,o.flags|=128,o=null;else throw Error(i(558));else if(Nn||Gl(a,o,h,!1),S=(h&a.childLanes)!==0,Nn||S){if(y=sn,y!==null&&(L=Cn(y,h),L!==0&&L!==M.retryLane))throw M.retryLane=L,jl(a,L),f(y,a,L),gd;ht(),o=Ni(a,o,h)}else a=M.treeContext,vn=As(L.nextSibling),Ai=o,zt=!0,Vs=null,Mi=!1,a!==null&&Mu(o,a),o=ga(o,y),o.flags|=4096;return o}return a=hs(a.child,{mode:y.mode,children:y.children}),a.ref=o.ref,o.child=a,a.return=o,a}function Ga(a,o){var h=o.ref;if(h===null)a!==null&&a.ref!==null&&(o.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(i(284));(a===null||a.ref!==h)&&(o.flags|=4194816)}}function Lc(a,o,h,y,S){return ko(o),h=lp(a,o,h,y,void 0,S),y=op(),a!==null&&!Nn?(cp(a,o,S),Fa(a,o,S)):(zt&&y&&Kf(o),o.flags|=1,Yn(a,o,h,S),o.child)}function Zi(a,o,h,y,S,M){return ko(o),o.updateQueue=null,h=Dg(o,y,h,S),Og(a),y=op(),a!==null&&!Nn?(cp(a,o,M),Fa(a,o,M)):(zt&&y&&Kf(o),o.flags|=1,Yn(a,o,h,M),o.child)}function Hi(a,o,h,y,S){if(ko(o),o.stateNode===null){var M=Hl,L=h.contextType;typeof L=="object"&&L!==null&&(M=Ri(L)),M=new h(y,M),o.memoizedState=M.state!==null&&M.state!==void 0?M.state:null,M.updater=Fu,o.stateNode=M,M._reactInternals=o,M=o.stateNode,M.props=y,M.state=o.memoizedState,M.refs={},ep(o),L=h.contextType,M.context=typeof L=="object"&&L!==null?Ri(L):Hl,M.state=o.memoizedState,L=h.getDerivedStateFromProps,typeof L=="function"&&(zc(o,h,L,y),M.state=o.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof M.getSnapshotBeforeUpdate=="function"||typeof M.UNSAFE_componentWillMount!="function"&&typeof M.componentWillMount!="function"||(L=M.state,typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount(),L!==M.state&&Fu.enqueueReplaceState(M,M.state,null),Bo(o,y,M,S),Bu(),M.state=o.memoizedState),typeof M.componentDidMount=="function"&&(o.flags|=4194308),y=!0}else if(a===null){M=o.stateNode;var J=o.memoizedProps,re=ji(h,J);M.props=re;var pe=M.context,Ee=h.contextType;L=Hl,typeof Ee=="object"&&Ee!==null&&(L=Ri(Ee));var Ae=h.getDerivedStateFromProps;Ee=typeof Ae=="function"||typeof M.getSnapshotBeforeUpdate=="function",J=o.pendingProps!==J,Ee||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(J||pe!==L)&&Jg(o,M,y,L),Xl=!1;var ye=o.memoizedState;M.state=ye,Bo(o,y,M,S),Bu(),pe=o.memoizedState,J||ye!==pe||Xl?(typeof Ae=="function"&&(zc(o,h,Ae,y),pe=o.memoizedState),(re=Xl||Qg(o,h,re,y,ye,pe,L))?(Ee||typeof M.UNSAFE_componentWillMount!="function"&&typeof M.componentWillMount!="function"||(typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount()),typeof M.componentDidMount=="function"&&(o.flags|=4194308)):(typeof M.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=y,o.memoizedState=pe),M.props=y,M.state=pe,M.context=L,y=re):(typeof M.componentDidMount=="function"&&(o.flags|=4194308),y=!1)}else{M=o.stateNode,tp(a,o),L=o.memoizedProps,Ee=ji(h,L),M.props=Ee,Ae=o.pendingProps,ye=M.context,pe=h.contextType,re=Hl,typeof pe=="object"&&pe!==null&&(re=Ri(pe)),J=h.getDerivedStateFromProps,(pe=typeof J=="function"||typeof M.getSnapshotBeforeUpdate=="function")||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(L!==Ae||ye!==re)&&Jg(o,M,y,re),Xl=!1,ye=o.memoizedState,M.state=ye,Bo(o,y,M,S),Bu();var _e=o.memoizedState;L!==Ae||ye!==_e||Xl||a!==null&&a.dependencies!==null&&Ac(a.dependencies)?(typeof J=="function"&&(zc(o,h,J,y),_e=o.memoizedState),(Ee=Xl||Qg(o,h,Ee,y,ye,_e,re)||a!==null&&a.dependencies!==null&&Ac(a.dependencies))?(pe||typeof M.UNSAFE_componentWillUpdate!="function"&&typeof M.componentWillUpdate!="function"||(typeof M.componentWillUpdate=="function"&&M.componentWillUpdate(y,_e,re),typeof M.UNSAFE_componentWillUpdate=="function"&&M.UNSAFE_componentWillUpdate(y,_e,re)),typeof M.componentDidUpdate=="function"&&(o.flags|=4),typeof M.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof M.componentDidUpdate!="function"||L===a.memoizedProps&&ye===a.memoizedState||(o.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||L===a.memoizedProps&&ye===a.memoizedState||(o.flags|=1024),o.memoizedProps=y,o.memoizedState=_e),M.props=y,M.state=_e,M.context=re,y=Ee):(typeof M.componentDidUpdate!="function"||L===a.memoizedProps&&ye===a.memoizedState||(o.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||L===a.memoizedProps&&ye===a.memoizedState||(o.flags|=1024),y=!1)}return M=y,Ga(a,o),y=(o.flags&128)!==0,M||y?(M=o.stateNode,h=y&&typeof h.getDerivedStateFromError!="function"?null:M.render(),o.flags|=1,a!==null&&y?(o.child=zo(o,a.child,null,S),o.child=zo(o,null,h,S)):Yn(a,o,h,S),o.memoizedState=M.state,a=o.child):a=Fa(a,o,S),a}function Ft(a,o,h,y){return No(),o.flags|=256,Yn(a,o,h,y),o.child}var $r={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ya(a){return{baseLanes:a,cachePool:Qf()}}function Xu(a,o,h){return a=a!==null?a.childLanes&~h:0,o&&(a|=It),a}function Zr(a,o,h){var y=o.pendingProps,S=!1,M=(o.flags&128)!==0,L;if((L=M)||(L=a!==null&&a.memoizedState===null?!1:(Fn.current&2)!==0),L&&(S=!0,o.flags&=-129),L=(o.flags&32)!==0,o.flags&=-33,a===null){if(zt){if(S?Wl(o):Qs(),(a=vn)?(a=fS(a,Mi),a=a!==null&&a.data!=="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:ps!==null?{id:ms,overflow:gs}:null,retryLane:536870912,hydrationErrors:null},h=wg(a),h.return=o,o.child=h,Ai=o,vn=null)):a=null,a===null)throw Ot(o);return Vb(a)?o.lanes=32:o.lanes=536870912,null}var J=y.children;return y=y.fallback,S?(Qs(),S=o.mode,J=Uc({mode:"hidden",children:J},S),y=qs(y,S,h,null),J.return=o,y.return=o,J.sibling=y,o.child=J,y=o.child,y.memoizedState=ya(h),y.childLanes=Xu(a,L,h),o.memoizedState=$r,Pa(null,y)):(Wl(o),$l(o,J))}var re=a.memoizedState;if(re!==null&&(J=re.dehydrated,J!==null)){if(M)o.flags&256?(Wl(o),o.flags&=-257,o=Ic(a,o,h)):o.memoizedState!==null?(Qs(),o.child=a.child,o.flags|=128,o=null):(Qs(),J=y.fallback,S=o.mode,y=Uc({mode:"visible",children:y.children},S),J=qs(J,S,h,null),J.flags|=2,y.return=o,J.return=o,y.sibling=J,o.child=y,zo(o,a.child,null,h),y=o.child,y.memoizedState=ya(h),y.childLanes=Xu(a,L,h),o.memoizedState=$r,o=Pa(null,y));else if(Wl(o),Vb(J)){if(L=J.nextSibling&&J.nextSibling.dataset,L)var pe=L.dgst;L=pe,y=Error(i(419)),y.stack="",y.digest=L,Ru({value:y,source:null,stack:null}),o=Ic(a,o,h)}else if(Nn||Gl(a,o,h,!1),L=(h&a.childLanes)!==0,Nn||L){if(L=sn,L!==null&&(y=Cn(L,h),y!==0&&y!==re.retryLane))throw re.retryLane=y,jl(a,y),f(L,a,y),gd;Yb(J)||ht(),o=Ic(a,o,h)}else Yb(J)?(o.flags|=192,o.child=a.child,o=null):(a=re.treeContext,vn=As(J.nextSibling),Ai=o,zt=!0,Vs=null,Mi=!1,a!==null&&Mu(o,a),o=$l(o,y.children),o.flags|=4096);return o}return S?(Qs(),J=y.fallback,S=o.mode,re=a.child,pe=re.sibling,y=hs(re,{mode:"hidden",children:y.children}),y.subtreeFlags=re.subtreeFlags&65011712,pe!==null?J=hs(pe,J):(J=qs(J,S,h,null),J.flags|=2),J.return=o,y.return=o,y.sibling=J,o.child=y,Pa(null,y),y=o.child,J=a.child.memoizedState,J===null?J=ya(h):(S=J.cachePool,S!==null?(re=$e._currentValue,S=S.parent!==re?{parent:re,pool:re}:S):S=Qf(),J={baseLanes:J.baseLanes|h,cachePool:S}),y.memoizedState=J,y.childLanes=Xu(a,L,h),o.memoizedState=$r,Pa(a.child,y)):(Wl(o),h=a.child,a=h.sibling,h=hs(h,{mode:"visible",children:y.children}),h.return=o,h.sibling=null,a!==null&&(L=o.deletions,L===null?(o.deletions=[a],o.flags|=16):L.push(a)),o.child=h,o.memoizedState=null,h)}function $l(a,o){return o=Uc({mode:"visible",children:o},a.mode),o.return=a,a.child=o}function Uc(a,o){return a=ur(22,a,null,o),a.lanes=0,a}function Ic(a,o,h){return zo(o,a.child,null,h),a=$l(o,o.pendingProps.children),a.flags|=2,o.memoizedState=null,a}function Io(a,o,h){a.lanes|=o;var y=a.alternate;y!==null&&(y.lanes|=o),Ws(a.return,o,h)}function Ku(a,o,h,y,S,M){var L=a.memoizedState;L===null?a.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:y,tail:h,tailMode:S,treeForkCount:M}:(L.isBackwards=o,L.rendering=null,L.renderingStartTime=0,L.last=y,L.tail=h,L.tailMode=S,L.treeForkCount=M)}function Wu(a,o,h){var y=o.pendingProps,S=y.revealOrder,M=y.tail;y=y.children;var L=Fn.current,J=(L&2)!==0;if(J?(L=L&1|2,o.flags|=128):L&=1,V(Fn,L),Yn(a,o,y,h),y=zt?Cc:0,!J&&a!==null&&(a.flags&128)!==0)e:for(a=o.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&Io(a,h,o);else if(a.tag===19)Io(a,h,o);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===o)break e;for(;a.sibling===null;){if(a.return===null||a.return===o)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(S){case"forwards":for(h=o.child,S=null;h!==null;)a=h.alternate,a!==null&&nd(a)===null&&(S=h),h=h.sibling;h=S,h===null?(S=o.child,o.child=null):(S=h.sibling,h.sibling=null),Ku(o,!1,S,h,M,y);break;case"backwards":case"unstable_legacy-backwards":for(h=null,S=o.child,o.child=null;S!==null;){if(a=S.alternate,a!==null&&nd(a)===null){o.child=S;break}a=S.sibling,S.sibling=h,h=S,S=a}Ku(o,!0,h,null,M,y);break;case"together":Ku(o,!1,null,null,void 0,y);break;default:o.memoizedState=null}return o.child}function Fa(a,o,h){if(a!==null&&(o.dependencies=a.dependencies),ea|=o.lanes,(h&o.childLanes)===0)if(a!==null){if(Gl(a,o,h,!1),(h&o.childLanes)===0)return null}else return null;if(a!==null&&o.child!==a.child)throw Error(i(153));if(o.child!==null){for(a=o.child,h=hs(a,a.pendingProps),o.child=h,h.return=o;a.sibling!==null;)a=a.sibling,h=h.sibling=hs(a,a.pendingProps),h.return=o;h.sibling=null}return o.child}function Zl(a,o){return(a.lanes&o)!==0?!0:(a=a.dependencies,!!(a!==null&&Ac(a)))}function $u(a,o,h){switch(o.tag){case 3:ge(o,o.stateNode.containerInfo),Ks(o,$e,a.memoizedState.cache),No();break;case 27:case 5:Re(o);break;case 4:ge(o,o.stateNode.containerInfo);break;case 10:Ks(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,ap(o),null;break;case 13:var y=o.memoizedState;if(y!==null)return y.dehydrated!==null?(Wl(o),o.flags|=128,null):(h&o.child.childLanes)!==0?Zr(a,o,h):(Wl(o),a=Fa(a,o,h),a!==null?a.sibling:null);Wl(o);break;case 19:var S=(a.flags&128)!==0;if(y=(h&o.childLanes)!==0,y||(Gl(a,o,h,!1),y=(h&o.childLanes)!==0),S){if(y)return Wu(a,o,h);o.flags|=128}if(S=o.memoizedState,S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),V(Fn,Fn.current),y)break;return null;case 22:return o.lanes=0,Wr(a,o,h,o.pendingProps);case 24:Ks(o,$e,a.memoizedState.cache)}return Fa(a,o,h)}function yd(a,o,h){if(a!==null)if(a.memoizedProps!==o.pendingProps)Nn=!0;else{if(!Zl(a,h)&&(o.flags&128)===0)return Nn=!1,$u(a,o,h);Nn=(a.flags&131072)!==0}else Nn=!1,zt&&(o.flags&1048576)!==0&&Fh(o,Cc,o.index);switch(o.lanes=0,o.tag){case 16:e:{var y=o.pendingProps;if(a=Do(o.elementType),o.type=a,typeof a=="function")fr(a)?(y=ji(a,y),o.tag=1,o=Hi(null,o,a,y,h)):(o.tag=0,o=Lc(null,o,a,y,h));else{if(a!=null){var S=a.$$typeof;if(S===O){o.tag=11,o=qu(null,o,a,y,h);break e}else if(S===F){o.tag=14,o=Yu(null,o,a,y,h);break e}}throw o=H(a)||a,Error(i(306,o,""))}}return o;case 0:return Lc(a,o,o.type,o.pendingProps,h);case 1:return y=o.type,S=ji(y,o.pendingProps),Hi(a,o,y,S,h);case 3:e:{if(ge(o,o.stateNode.containerInfo),a===null)throw Error(i(387));y=o.pendingProps;var M=o.memoizedState;S=M.element,tp(a,o),Bo(o,y,null,h);var L=o.memoizedState;if(y=L.cache,Ks(o,$e,y),y!==M.cache&&Zf(o,[$e],h,!0),Bu(),y=L.element,M.isDehydrated)if(M={element:y,isDehydrated:!1,cache:L.cache},o.updateQueue.baseState=M,o.memoizedState=M,o.flags&256){o=Ft(a,o,y,h);break e}else if(y!==S){S=_r(Error(i(424)),o),Ru(S),o=Ft(a,o,y,h);break e}else{switch(a=o.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(vn=As(a.firstChild),Ai=o,zt=!0,Vs=null,Mi=!0,h=Ng(o,null,y,h),o.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling}else{if(No(),y===S){o=Fa(a,o,h);break e}Yn(a,o,y,h)}o=o.child}return o;case 26:return Ga(a,o),a===null?(h=yS(o.type,null,o.pendingProps,null))?o.memoizedState=h:zt||(h=o.type,a=o.pendingProps,y=cy(ve.current).createElement(h),y[yt]=o,y[li]=a,gr(y,h,a),Ln(y),o.stateNode=y):o.memoizedState=yS(o.type,a.memoizedProps,o.pendingProps,a.memoizedState),null;case 27:return Re(o),a===null&&zt&&(y=o.stateNode=pS(o.type,o.pendingProps,ve.current),Ai=o,Mi=!0,S=vn,Yc(o.type)?(Xb=S,vn=As(y.firstChild)):vn=S),Yn(a,o,o.pendingProps.children,h),Ga(a,o),a===null&&(o.flags|=4194304),o.child;case 5:return a===null&&zt&&((S=y=vn)&&(y=nO(y,o.type,o.pendingProps,Mi),y!==null?(o.stateNode=y,Ai=o,vn=As(y.firstChild),Mi=!1,S=!0):S=!1),S||Ot(o)),Re(o),S=o.type,M=o.pendingProps,L=a!==null?a.memoizedProps:null,y=M.children,Gb(S,M)?y=null:L!==null&&Gb(S,L)&&(o.flags|=32),o.memoizedState!==null&&(S=lp(a,o,wb,null,null,h),Hp._currentValue=S),Ga(a,o),Yn(a,o,y,h),o.child;case 6:return a===null&&zt&&((a=h=vn)&&(h=iO(h,o.pendingProps,Mi),h!==null?(o.stateNode=h,Ai=o,vn=null,a=!0):a=!1),a||Ot(o)),null;case 13:return Zr(a,o,h);case 4:return ge(o,o.stateNode.containerInfo),y=o.pendingProps,a===null?o.child=zo(o,null,y,h):Yn(a,o,y,h),o.child;case 11:return qu(a,o,o.type,o.pendingProps,h);case 7:return Yn(a,o,o.pendingProps,h),o.child;case 8:return Yn(a,o,o.pendingProps.children,h),o.child;case 12:return Yn(a,o,o.pendingProps.children,h),o.child;case 10:return y=o.pendingProps,Ks(o,o.type,y.value),Yn(a,o,y.children,h),o.child;case 9:return S=o.type._context,y=o.pendingProps.children,ko(o),S=Ri(S),y=y(S),o.flags|=1,Yn(a,o,y,h),o.child;case 14:return Yu(a,o,o.type,o.pendingProps,h);case 15:return Kr(a,o,o.type,o.pendingProps,h);case 19:return Wu(a,o,h);case 31:return Vu(a,o,h);case 22:return Wr(a,o,h,o.pendingProps);case 24:return ko(o),y=Ri($e),a===null?(S=ys(),S===null&&(S=sn,M=Kh(),S.pooledCache=M,M.refCount++,M!==null&&(S.pooledCacheLanes|=h),S=M),o.memoizedState={parent:y,cache:S},ep(o),Ks(o,$e,S)):((a.lanes&h)!==0&&(tp(a,o),Bo(o,null,null,h),Bu()),S=a.memoizedState,M=o.memoizedState,S.parent!==y?(S={parent:y,cache:y},o.memoizedState=S,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=S),Ks(o,$e,y)):(y=M.cache,Ks(o,$e,y),y!==S.cache&&Zf(o,[$e],h,!0))),Yn(a,o,o.pendingProps.children,h),o.child;case 29:throw o.pendingProps}throw Error(i(156,o.tag))}function Cr(a){a.flags|=4}function Ql(a,o,h,y,S){if((o=(a.mode&32)!==0)&&(o=!1),o){if(a.flags|=16777216,(S&335544128)===S)if(a.stateNode.complete)a.flags|=8192;else if(Oe())a.flags|=8192;else throw rt=Ou,ku}else a.flags&=-16777217}function tl(a,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!SS(o))if(Oe())a.flags|=8192;else throw rt=Ou,ku}function jc(a,o){o!==null&&(a.flags|=4),a.flags&16384&&(o=a.tag!==22?et():536870912,a.lanes|=o,ta|=o)}function Zu(a,o){if(!zt)switch(a.tailMode){case"hidden":o=a.tail;for(var h=null;o!==null;)o.alternate!==null&&(h=o),o=o.sibling;h===null?a.tail=null:h.sibling=null;break;case"collapsed":h=a.tail;for(var y=null;h!==null;)h.alternate!==null&&(y=h),h=h.sibling;y===null?o||a.tail===null?a.tail=null:a.tail.sibling=null:y.sibling=null}}function fn(a){var o=a.alternate!==null&&a.alternate.child===a.child,h=0,y=0;if(o)for(var S=a.child;S!==null;)h|=S.lanes|S.childLanes,y|=S.subtreeFlags&65011712,y|=S.flags&65011712,S.return=a,S=S.sibling;else for(S=a.child;S!==null;)h|=S.lanes|S.childLanes,y|=S.subtreeFlags,y|=S.flags,S.return=a,S=S.sibling;return a.subtreeFlags|=y,a.childLanes=h,o}function kp(a,o,h){var y=o.pendingProps;switch(Pl(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fn(o),null;case 1:return fn(o),null;case 3:return h=o.stateNode,y=null,a!==null&&(y=a.memoizedState.cache),o.memoizedState.cache!==y&&(o.flags|=2048),pa($e),le(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(a===null||a.child===null)&&(Ro(o)?Cr(o):a===null||a.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,qh())),fn(o),null;case 26:var S=o.type,M=o.memoizedState;return a===null?(Cr(o),M!==null?(fn(o),tl(o,M)):(fn(o),Ql(o,S,null,y,h))):M?M!==a.memoizedState?(Cr(o),fn(o),tl(o,M)):(fn(o),o.flags&=-16777217):(a=a.memoizedProps,a!==y&&Cr(o),fn(o),Ql(o,S,a,y,h)),null;case 27:if(Ie(o),h=ve.current,S=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==y&&Cr(o);else{if(!y){if(o.stateNode===null)throw Error(i(166));return fn(o),null}a=oe.current,Ro(o)?$f(o):(a=pS(S,y,h),o.stateNode=a,Cr(o))}return fn(o),null;case 5:if(Ie(o),S=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==y&&Cr(o);else{if(!y){if(o.stateNode===null)throw Error(i(166));return fn(o),null}if(M=oe.current,Ro(o))$f(o);else{var L=cy(ve.current);switch(M){case 1:M=L.createElementNS("http://www.w3.org/2000/svg",S);break;case 2:M=L.createElementNS("http://www.w3.org/1998/Math/MathML",S);break;default:switch(S){case"svg":M=L.createElementNS("http://www.w3.org/2000/svg",S);break;case"math":M=L.createElementNS("http://www.w3.org/1998/Math/MathML",S);break;case"script":M=L.createElement("div"),M.innerHTML="<script><\/script>",M=M.removeChild(M.firstChild);break;case"select":M=typeof y.is=="string"?L.createElement("select",{is:y.is}):L.createElement("select"),y.multiple?M.multiple=!0:y.size&&(M.size=y.size);break;default:M=typeof y.is=="string"?L.createElement(S,{is:y.is}):L.createElement(S)}}M[yt]=o,M[li]=y;e:for(L=o.child;L!==null;){if(L.tag===5||L.tag===6)M.appendChild(L.stateNode);else if(L.tag!==4&&L.tag!==27&&L.child!==null){L.child.return=L,L=L.child;continue}if(L===o)break e;for(;L.sibling===null;){if(L.return===null||L.return===o)break e;L=L.return}L.sibling.return=L.return,L=L.sibling}o.stateNode=M;e:switch(gr(M,S,y),S){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}y&&Cr(o)}}return fn(o),Ql(o,o.type,a===null?null:a.memoizedProps,o.pendingProps,h),null;case 6:if(a&&o.stateNode!=null)a.memoizedProps!==y&&Cr(o);else{if(typeof y!="string"&&o.stateNode===null)throw Error(i(166));if(a=ve.current,Ro(o)){if(a=o.stateNode,h=o.memoizedProps,y=null,S=Ai,S!==null)switch(S.tag){case 27:case 5:y=S.memoizedProps}a[yt]=o,a=!!(a.nodeValue===h||y!==null&&y.suppressHydrationWarning===!0||iS(a.nodeValue,h)),a||Ot(o,!0)}else a=cy(a).createTextNode(y),a[yt]=o,o.stateNode=a}return fn(o),null;case 31:if(h=o.memoizedState,a===null||a.memoizedState!==null){if(y=Ro(o),h!==null){if(a===null){if(!y)throw Error(i(318));if(a=o.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(557));a[yt]=o}else No(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;fn(o),a=!1}else h=qh(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=h),a=!0;if(!a)return o.flags&256?(Yr(o),o):(Yr(o),null);if((o.flags&128)!==0)throw Error(i(558))}return fn(o),null;case 13:if(y=o.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(S=Ro(o),y!==null&&y.dehydrated!==null){if(a===null){if(!S)throw Error(i(318));if(S=o.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(i(317));S[yt]=o}else No(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;fn(o),S=!1}else S=qh(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=S),S=!0;if(!S)return o.flags&256?(Yr(o),o):(Yr(o),null)}return Yr(o),(o.flags&128)!==0?(o.lanes=h,o):(h=y!==null,a=a!==null&&a.memoizedState!==null,h&&(y=o.child,S=null,y.alternate!==null&&y.alternate.memoizedState!==null&&y.alternate.memoizedState.cachePool!==null&&(S=y.alternate.memoizedState.cachePool.pool),M=null,y.memoizedState!==null&&y.memoizedState.cachePool!==null&&(M=y.memoizedState.cachePool.pool),M!==S&&(y.flags|=2048)),h!==a&&h&&(o.child.flags|=8192),jc(o,o.updateQueue),fn(o),null);case 4:return le(),a===null&&Ub(o.stateNode.containerInfo),fn(o),null;case 10:return pa(o.type),fn(o),null;case 19:if(ee(Fn),y=o.memoizedState,y===null)return fn(o),null;if(S=(o.flags&128)!==0,M=y.rendering,M===null)if(S)Zu(y,!1);else{if(ln!==0||a!==null&&(a.flags&128)!==0)for(a=o.child;a!==null;){if(M=nd(a),M!==null){for(o.flags|=128,Zu(y,!1),a=M.updateQueue,o.updateQueue=a,jc(o,a),o.subtreeFlags=0,a=h,h=o.child;h!==null;)Ki(h,a),h=h.sibling;return V(Fn,Fn.current&1|2),zt&&Ys(o,y.treeForkCount),o.child}a=a.sibling}y.tail!==null&&hn()>na&&(o.flags|=128,S=!0,Zu(y,!1),o.lanes=4194304)}else{if(!S)if(a=nd(M),a!==null){if(o.flags|=128,S=!0,a=a.updateQueue,o.updateQueue=a,jc(o,a),Zu(y,!0),y.tail===null&&y.tailMode==="hidden"&&!M.alternate&&!zt)return fn(o),null}else 2*hn()-y.renderingStartTime>na&&h!==536870912&&(o.flags|=128,S=!0,Zu(y,!1),o.lanes=4194304);y.isBackwards?(M.sibling=o.child,o.child=M):(a=y.last,a!==null?a.sibling=M:o.child=M,y.last=M)}return y.tail!==null?(a=y.tail,y.rendering=a,y.tail=a.sibling,y.renderingStartTime=hn(),a.sibling=null,h=Fn.current,V(Fn,S?h&1|2:h&1),zt&&Ys(o,y.treeForkCount),a):(fn(o),null);case 22:case 23:return Yr(o),$i(),y=o.memoizedState!==null,a!==null?a.memoizedState!==null!==y&&(o.flags|=8192):y&&(o.flags|=8192),y?(h&536870912)!==0&&(o.flags&128)===0&&(fn(o),o.subtreeFlags&6&&(o.flags|=8192)):fn(o),h=o.updateQueue,h!==null&&jc(o,h.retryQueue),h=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(h=a.memoizedState.cachePool.pool),y=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(y=o.memoizedState.cachePool.pool),y!==h&&(o.flags|=2048),a!==null&&ee(Fl),null;case 24:return h=null,a!==null&&(h=a.memoizedState.cache),o.memoizedState.cache!==h&&(o.flags|=2048),pa($e),fn(o),null;case 25:return null;case 30:return null}throw Error(i(156,o.tag))}function bd(a,o){switch(Pl(o),o.tag){case 1:return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 3:return pa($e),le(),a=o.flags,(a&65536)!==0&&(a&128)===0?(o.flags=a&-65537|128,o):null;case 26:case 27:case 5:return Ie(o),null;case 31:if(o.memoizedState!==null){if(Yr(o),o.alternate===null)throw Error(i(340));No()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 13:if(Yr(o),a=o.memoizedState,a!==null&&a.dehydrated!==null){if(o.alternate===null)throw Error(i(340));No()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 19:return ee(Fn),null;case 4:return le(),null;case 10:return pa(o.type),null;case 22:case 23:return Yr(o),$i(),a!==null&&ee(Fl),a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 24:return pa($e),null;case 25:return null;default:return null}}function jo(a,o){switch(Pl(o),o.tag){case 3:pa($e),le();break;case 26:case 27:case 5:Ie(o);break;case 4:le();break;case 31:o.memoizedState!==null&&Yr(o);break;case 13:Yr(o);break;case 19:ee(Fn);break;case 10:pa(o.type);break;case 22:case 23:Yr(o),$i(),a!==null&&ee(Fl);break;case 24:pa($e)}}function Es(a,o){try{var h=o.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var S=y.next;h=S;do{if((h.tag&a)===a){y=void 0;var M=h.create,L=h.inst;y=M(),L.destroy=y}h=h.next}while(h!==S)}}catch(J){yn(o,o.return,J)}}function ba(a,o,h){try{var y=o.updateQueue,S=y!==null?y.lastEffect:null;if(S!==null){var M=S.next;y=M;do{if((y.tag&a)===a){var L=y.inst,J=L.destroy;if(J!==void 0){L.destroy=void 0,S=o;var re=h,pe=J;try{pe()}catch(Ee){yn(S,re,Ee)}}}y=y.next}while(y!==M)}}catch(Ee){yn(o,o.return,Ee)}}function Jl(a){var o=a.updateQueue;if(o!==null){var h=a.stateNode;try{Ui(o,h)}catch(y){yn(a,a.return,y)}}}function Op(a,o,h){h.props=ji(a.type,a.memoizedProps),h.state=a.memoizedState;try{h.componentWillUnmount()}catch(y){yn(a,o,y)}}function ws(a,o){try{var h=a.ref;if(h!==null){switch(a.tag){case 26:case 27:case 5:var y=a.stateNode;break;case 30:y=a.stateNode;break;default:y=a.stateNode}typeof h=="function"?a.refCleanup=h(y):h.current=y}}catch(S){yn(a,o,S)}}function Qr(a,o){var h=a.ref,y=a.refCleanup;if(h!==null)if(typeof y=="function")try{y()}catch(S){yn(a,o,S)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(S){yn(a,o,S)}else h.current=null}function Jr(a){var o=a.type,h=a.memoizedProps,y=a.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":h.autoFocus&&y.focus();break e;case"img":h.src?y.src=h.src:h.srcSet&&(y.srcset=h.srcSet)}}catch(S){yn(a,a.return,S)}}function xa(a,o,h){try{var y=a.stateNode;$k(y,a.type,h,o),y[li]=o}catch(S){yn(a,a.return,S)}}function ui(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Yc(a.type)||a.tag===4}function Ts(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||ui(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Yc(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function _t(a,o,h){var y=a.tag;if(y===5||y===6)a=a.stateNode,o?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(a,o):(o=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,o.appendChild(a),h=h._reactRootContainer,h!=null||o.onclick!==null||(o.onclick=ze));else if(y!==4&&(y===27&&Yc(a.type)&&(h=a.stateNode,o=null),a=a.child,a!==null))for(_t(a,o,h),a=a.sibling;a!==null;)_t(a,o,h),a=a.sibling}function Zt(a,o,h){var y=a.tag;if(y===5||y===6)a=a.stateNode,o?h.insertBefore(a,o):h.appendChild(a);else if(y!==4&&(y===27&&Yc(a.type)&&(h=a.stateNode),a=a.child,a!==null))for(Zt(a,o,h),a=a.sibling;a!==null;)Zt(a,o,h),a=a.sibling}function ei(a){var o=a.stateNode,h=a.memoizedProps;try{for(var y=a.type,S=o.attributes;S.length;)o.removeAttributeNode(S[0]);gr(o,y,h),o[yt]=a,o[li]=h}catch(M){yn(a,a.return,M)}}var va=!1,kn=!1,nl=!1,Qu=typeof WeakSet=="function"?WeakSet:Set,Vn=null;function Hc(a,o){if(a=a.containerInfo,Hb=gy,a=Hf(a),xc(a)){if("selectionStart"in a)var h={start:a.selectionStart,end:a.selectionEnd};else e:{h=(h=a.ownerDocument)&&h.defaultView||window;var y=h.getSelection&&h.getSelection();if(y&&y.rangeCount!==0){h=y.anchorNode;var S=y.anchorOffset,M=y.focusNode;y=y.focusOffset;try{h.nodeType,M.nodeType}catch{h=null;break e}var L=0,J=-1,re=-1,pe=0,Ee=0,Ae=a,ye=null;t:for(;;){for(var _e;Ae!==h||S!==0&&Ae.nodeType!==3||(J=L+S),Ae!==M||y!==0&&Ae.nodeType!==3||(re=L+y),Ae.nodeType===3&&(L+=Ae.nodeValue.length),(_e=Ae.firstChild)!==null;)ye=Ae,Ae=_e;for(;;){if(Ae===a)break t;if(ye===h&&++pe===S&&(J=L),ye===M&&++Ee===y&&(re=L),(_e=Ae.nextSibling)!==null)break;Ae=ye,ye=Ae.parentNode}Ae=_e}h=J===-1||re===-1?null:{start:J,end:re}}else h=null}h=h||{start:0,end:0}}else h=null;for(Pb={focusedElem:a,selectionRange:h},gy=!1,Vn=o;Vn!==null;)if(o=Vn,a=o.child,(o.subtreeFlags&1028)!==0&&a!==null)a.return=o,Vn=a;else for(;Vn!==null;){switch(o=Vn,M=o.alternate,a=o.flags,o.tag){case 0:if((a&4)!==0&&(a=o.updateQueue,a=a!==null?a.events:null,a!==null))for(h=0;h<a.length;h++)S=a[h],S.ref.impl=S.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&M!==null){a=void 0,h=o,S=M.memoizedProps,M=M.memoizedState,y=h.stateNode;try{var Ye=ji(h.type,S);a=y.getSnapshotBeforeUpdate(Ye,M),y.__reactInternalSnapshotBeforeUpdate=a}catch(lt){yn(h,h.return,lt)}}break;case 3:if((a&1024)!==0){if(a=o.stateNode.containerInfo,h=a.nodeType,h===9)qb(a);else if(h===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":qb(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(i(163))}if(a=o.sibling,a!==null){a.return=o.return,Vn=a;break}Vn=o.return}}function ny(a,o,h){var y=h.flags;switch(h.tag){case 0:case 11:case 15:il(a,h),y&4&&Es(5,h);break;case 1:if(il(a,h),y&4)if(a=h.stateNode,o===null)try{a.componentDidMount()}catch(L){yn(h,h.return,L)}else{var S=ji(h.type,o.memoizedProps);o=o.memoizedState;try{a.componentDidUpdate(S,o,a.__reactInternalSnapshotBeforeUpdate)}catch(L){yn(h,h.return,L)}}y&64&&Jl(h),y&512&&ws(h,h.return);break;case 3:if(il(a,h),y&64&&(a=h.updateQueue,a!==null)){if(o=null,h.child!==null)switch(h.child.tag){case 27:case 5:o=h.child.stateNode;break;case 1:o=h.child.stateNode}try{Ui(a,o)}catch(L){yn(h,h.return,L)}}break;case 27:o===null&&y&4&&ei(h);case 26:case 5:il(a,h),o===null&&y&4&&Jr(h),y&512&&ws(h,h.return);break;case 12:il(a,h);break;case 31:il(a,h),y&4&&vd(a,h);break;case 13:il(a,h),y&4&&Dp(a,h),y&64&&(a=h.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(h=Ik.bind(null,h),rO(a,h))));break;case 22:if(y=h.memoizedState!==null||va,!y){o=o!==null&&o.memoizedState!==null||kn,S=va;var M=kn;va=y,(kn=o)&&!M?an(a,h,(h.subtreeFlags&8772)!==0):il(a,h),va=S,kn=M}break;case 30:break;default:il(a,h)}}function xd(a){var o=a.alternate;o!==null&&(a.alternate=null,xd(o)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(o=a.stateNode,o!==null&&Is(o)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var qt=null,fi=!1;function Qi(a,o,h){for(h=h.child;h!==null;)eo(a,o,h),h=h.sibling}function eo(a,o,h){if($t&&typeof $t.onCommitFiberUnmount=="function")try{$t.onCommitFiberUnmount(xn,h)}catch{}switch(h.tag){case 26:kn||Qr(h,o),Qi(a,o,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:kn||Qr(h,o);var y=qt,S=fi;Yc(h.type)&&(qt=h.stateNode,fi=!1),Qi(a,o,h),Up(h.stateNode),qt=y,fi=S;break;case 5:kn||Qr(h,o);case 6:if(y=qt,S=fi,qt=null,Qi(a,o,h),qt=y,fi=S,qt!==null)if(fi)try{(qt.nodeType===9?qt.body:qt.nodeName==="HTML"?qt.ownerDocument.body:qt).removeChild(h.stateNode)}catch(M){yn(h,o,M)}else try{qt.removeChild(h.stateNode)}catch(M){yn(h,o,M)}break;case 18:qt!==null&&(fi?(a=qt,cS(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,h.stateNode),kd(a)):cS(qt,h.stateNode));break;case 4:y=qt,S=fi,qt=h.stateNode.containerInfo,fi=!0,Qi(a,o,h),qt=y,fi=S;break;case 0:case 11:case 14:case 15:ba(2,h,o),kn||ba(4,h,o),Qi(a,o,h);break;case 1:kn||(Qr(h,o),y=h.stateNode,typeof y.componentWillUnmount=="function"&&Op(h,o,y)),Qi(a,o,h);break;case 21:Qi(a,o,h);break;case 22:kn=(y=kn)||h.memoizedState!==null,Qi(a,o,h),kn=y;break;default:Qi(a,o,h)}}function vd(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{kd(a)}catch(h){yn(o,o.return,h)}}}function Dp(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{kd(a)}catch(h){yn(o,o.return,h)}}function iy(a){switch(a.tag){case 31:case 13:case 19:var o=a.stateNode;return o===null&&(o=a.stateNode=new Qu),o;case 22:return a=a.stateNode,o=a._retryCache,o===null&&(o=a._retryCache=new Qu),o;default:throw Error(i(435,a.tag))}}function ti(a,o){var h=iy(a);o.forEach(function(y){if(!h.has(y)){h.add(y);var S=jk.bind(null,a,y);y.then(S,S)}})}function Ji(a,o){var h=o.deletions;if(h!==null)for(var y=0;y<h.length;y++){var S=h[y],M=a,L=o,J=L;e:for(;J!==null;){switch(J.tag){case 27:if(Yc(J.type)){qt=J.stateNode,fi=!1;break e}break;case 5:qt=J.stateNode,fi=!1;break e;case 3:case 4:qt=J.stateNode.containerInfo,fi=!0;break e}J=J.return}if(qt===null)throw Error(i(160));eo(M,L,S),qt=null,fi=!1,M=S.alternate,M!==null&&(M.return=null),S.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)to(o,a),o=o.sibling}var Ar=null;function to(a,o){var h=a.alternate,y=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Ji(o,a),Xn(a),y&4&&(ba(3,a,a.return),Es(3,a),ba(5,a,a.return));break;case 1:Ji(o,a),Xn(a),y&512&&(kn||h===null||Qr(h,h.return)),y&64&&va&&(a=a.updateQueue,a!==null&&(y=a.callbacks,y!==null&&(h=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=h===null?y:h.concat(y))));break;case 26:var S=Ar;if(Ji(o,a),Xn(a),y&512&&(kn||h===null||Qr(h,h.return)),y&4){var M=h!==null?h.memoizedState:null;if(y=a.memoizedState,h===null)if(y===null)if(a.stateNode===null){e:{y=a.type,h=a.memoizedProps,S=S.ownerDocument||S;t:switch(y){case"title":M=S.getElementsByTagName("title")[0],(!M||M[Da]||M[yt]||M.namespaceURI==="http://www.w3.org/2000/svg"||M.hasAttribute("itemprop"))&&(M=S.createElement(y),S.head.insertBefore(M,S.querySelector("head > title"))),gr(M,y,h),M[yt]=a,Ln(M),y=M;break e;case"link":var L=vS("link","href",S).get(y+(h.href||""));if(L){for(var J=0;J<L.length;J++)if(M=L[J],M.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&M.getAttribute("rel")===(h.rel==null?null:h.rel)&&M.getAttribute("title")===(h.title==null?null:h.title)&&M.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){L.splice(J,1);break t}}M=S.createElement(y),gr(M,y,h),S.head.appendChild(M);break;case"meta":if(L=vS("meta","content",S).get(y+(h.content||""))){for(J=0;J<L.length;J++)if(M=L[J],M.getAttribute("content")===(h.content==null?null:""+h.content)&&M.getAttribute("name")===(h.name==null?null:h.name)&&M.getAttribute("property")===(h.property==null?null:h.property)&&M.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&M.getAttribute("charset")===(h.charSet==null?null:h.charSet)){L.splice(J,1);break t}}M=S.createElement(y),gr(M,y,h),S.head.appendChild(M);break;default:throw Error(i(468,y))}M[yt]=a,Ln(M),y=M}a.stateNode=y}else _S(S,a.type,a.stateNode);else a.stateNode=xS(S,y,a.memoizedProps);else M!==y?(M===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):M.count--,y===null?_S(S,a.type,a.stateNode):xS(S,y,a.memoizedProps)):y===null&&a.stateNode!==null&&xa(a,a.memoizedProps,h.memoizedProps)}break;case 27:Ji(o,a),Xn(a),y&512&&(kn||h===null||Qr(h,h.return)),h!==null&&y&4&&xa(a,a.memoizedProps,h.memoizedProps);break;case 5:if(Ji(o,a),Xn(a),y&512&&(kn||h===null||Qr(h,h.return)),a.flags&32){S=a.stateNode;try{it(S,"")}catch(Ye){yn(a,a.return,Ye)}}y&4&&a.stateNode!=null&&(S=a.memoizedProps,xa(a,S,h!==null?h.memoizedProps:S)),y&1024&&(nl=!0);break;case 6:if(Ji(o,a),Xn(a),y&4){if(a.stateNode===null)throw Error(i(162));y=a.memoizedProps,h=a.stateNode;try{h.nodeValue=y}catch(Ye){yn(a,a.return,Ye)}}break;case 3:if(dy=null,S=Ar,Ar=uy(o.containerInfo),Ji(o,a),Ar=S,Xn(a),y&4&&h!==null&&h.memoizedState.isDehydrated)try{kd(o.containerInfo)}catch(Ye){yn(a,a.return,Ye)}nl&&(nl=!1,ry(a));break;case 4:y=Ar,Ar=uy(a.stateNode.containerInfo),Ji(o,a),Xn(a),Ar=y;break;case 12:Ji(o,a),Xn(a);break;case 31:Ji(o,a),Xn(a),y&4&&(y=a.updateQueue,y!==null&&(a.updateQueue=null,ti(a,y)));break;case 13:Ji(o,a),Xn(a),a.child.flags&8192&&a.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(sl=hn()),y&4&&(y=a.updateQueue,y!==null&&(a.updateQueue=null,ti(a,y)));break;case 22:S=a.memoizedState!==null;var re=h!==null&&h.memoizedState!==null,pe=va,Ee=kn;if(va=pe||S,kn=Ee||re,Ji(o,a),kn=Ee,va=pe,Xn(a),y&8192)e:for(o=a.stateNode,o._visibility=S?o._visibility&-2:o._visibility|1,S&&(h===null||re||va||kn||Ho(a)),h=null,o=a;;){if(o.tag===5||o.tag===26){if(h===null){re=h=o;try{if(M=re.stateNode,S)L=M.style,typeof L.setProperty=="function"?L.setProperty("display","none","important"):L.display="none";else{J=re.stateNode;var Ae=re.memoizedProps.style,ye=Ae!=null&&Ae.hasOwnProperty("display")?Ae.display:null;J.style.display=ye==null||typeof ye=="boolean"?"":(""+ye).trim()}}catch(Ye){yn(re,re.return,Ye)}}}else if(o.tag===6){if(h===null){re=o;try{re.stateNode.nodeValue=S?"":re.memoizedProps}catch(Ye){yn(re,re.return,Ye)}}}else if(o.tag===18){if(h===null){re=o;try{var _e=re.stateNode;S?uS(_e,!0):uS(re.stateNode,!1)}catch(Ye){yn(re,re.return,Ye)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===a)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break e;for(;o.sibling===null;){if(o.return===null||o.return===a)break e;h===o&&(h=null),o=o.return}h===o&&(h=null),o.sibling.return=o.return,o=o.sibling}y&4&&(y=a.updateQueue,y!==null&&(h=y.retryQueue,h!==null&&(y.retryQueue=null,ti(a,h))));break;case 19:Ji(o,a),Xn(a),y&4&&(y=a.updateQueue,y!==null&&(a.updateQueue=null,ti(a,y)));break;case 30:break;case 21:break;default:Ji(o,a),Xn(a)}}function Xn(a){var o=a.flags;if(o&2){try{for(var h,y=a.return;y!==null;){if(ui(y)){h=y;break}y=y.return}if(h==null)throw Error(i(160));switch(h.tag){case 27:var S=h.stateNode,M=Ts(a);Zt(a,M,S);break;case 5:var L=h.stateNode;h.flags&32&&(it(L,""),h.flags&=-33);var J=Ts(a);Zt(a,J,L);break;case 3:case 4:var re=h.stateNode.containerInfo,pe=Ts(a);_t(a,pe,re);break;default:throw Error(i(161))}}catch(Ee){yn(a,a.return,Ee)}a.flags&=-3}o&4096&&(a.flags&=-4097)}function ry(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var o=a;ry(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),a=a.sibling}}function il(a,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)ny(a,o.alternate,o),o=o.sibling}function Ho(a){for(a=a.child;a!==null;){var o=a;switch(o.tag){case 0:case 11:case 14:case 15:ba(4,o,o.return),Ho(o);break;case 1:Qr(o,o.return);var h=o.stateNode;typeof h.componentWillUnmount=="function"&&Op(o,o.return,h),Ho(o);break;case 27:Up(o.stateNode);case 26:case 5:Qr(o,o.return),Ho(o);break;case 22:o.memoizedState===null&&Ho(o);break;case 30:Ho(o);break;default:Ho(o)}a=a.sibling}}function an(a,o,h){for(h=h&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var y=o.alternate,S=a,M=o,L=M.flags;switch(M.tag){case 0:case 11:case 15:an(S,M,h),Es(4,M);break;case 1:if(an(S,M,h),y=M,S=y.stateNode,typeof S.componentDidMount=="function")try{S.componentDidMount()}catch(pe){yn(y,y.return,pe)}if(y=M,S=y.updateQueue,S!==null){var J=y.stateNode;try{var re=S.shared.hiddenCallbacks;if(re!==null)for(S.shared.hiddenCallbacks=null,S=0;S<re.length;S++)xs(re[S],J)}catch(pe){yn(y,y.return,pe)}}h&&L&64&&Jl(M),ws(M,M.return);break;case 27:ei(M);case 26:case 5:an(S,M,h),h&&y===null&&L&4&&Jr(M),ws(M,M.return);break;case 12:an(S,M,h);break;case 31:an(S,M,h),h&&L&4&&vd(S,M);break;case 13:an(S,M,h),h&&L&4&&Dp(S,M);break;case 22:M.memoizedState===null&&an(S,M,h),ws(M,M.return);break;case 30:break;default:an(S,M,h)}o=o.sibling}}function _d(a,o){var h=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(h=a.memoizedState.cachePool.pool),a=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(a=o.memoizedState.cachePool.pool),a!==h&&(a!=null&&a.refCount++,h!=null&&Li(h))}function rl(a,o){a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&Li(a))}function _i(a,o,h,y){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)Hn(a,o,h,y),o=o.sibling}function Hn(a,o,h,y){var S=o.flags;switch(o.tag){case 0:case 11:case 15:_i(a,o,h,y),S&2048&&Es(9,o);break;case 1:_i(a,o,h,y);break;case 3:_i(a,o,h,y),S&2048&&(a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&Li(a)));break;case 12:if(S&2048){_i(a,o,h,y),a=o.stateNode;try{var M=o.memoizedProps,L=M.id,J=M.onPostCommit;typeof J=="function"&&J(L,o.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(re){yn(o,o.return,re)}}else _i(a,o,h,y);break;case 31:_i(a,o,h,y);break;case 13:_i(a,o,h,y);break;case 23:break;case 22:M=o.stateNode,L=o.alternate,o.memoizedState!==null?M._visibility&2?_i(a,o,h,y):Pc(a,o):M._visibility&2?_i(a,o,h,y):(M._visibility|=2,no(a,o,h,y,(o.subtreeFlags&10256)!==0||!1)),S&2048&&_d(L,o);break;case 24:_i(a,o,h,y),S&2048&&rl(o.alternate,o);break;default:_i(a,o,h,y)}}function no(a,o,h,y,S){for(S=S&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var M=a,L=o,J=h,re=y,pe=L.flags;switch(L.tag){case 0:case 11:case 15:no(M,L,J,re,S),Es(8,L);break;case 23:break;case 22:var Ee=L.stateNode;L.memoizedState!==null?Ee._visibility&2?no(M,L,J,re,S):Pc(M,L):(Ee._visibility|=2,no(M,L,J,re,S)),S&&pe&2048&&_d(L.alternate,L);break;case 24:no(M,L,J,re,S),S&&pe&2048&&rl(L.alternate,L);break;default:no(M,L,J,re,S)}o=o.sibling}}function Pc(a,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var h=a,y=o,S=y.flags;switch(y.tag){case 22:Pc(h,y),S&2048&&_d(y.alternate,y);break;case 24:Pc(h,y),S&2048&&rl(y.alternate,y);break;default:Pc(h,y)}o=o.sibling}}var Kn=8192;function Po(a,o,h){if(a.subtreeFlags&Kn)for(a=a.child;a!==null;)ni(a,o,h),a=a.sibling}function ni(a,o,h){switch(a.tag){case 26:Po(a,o,h),a.flags&Kn&&a.memoizedState!==null&&gO(h,Ar,a.memoizedState,a.memoizedProps);break;case 5:Po(a,o,h);break;case 3:case 4:var y=Ar;Ar=uy(a.stateNode.containerInfo),Po(a,o,h),Ar=y;break;case 22:a.memoizedState===null&&(y=a.alternate,y!==null&&y.memoizedState!==null?(y=Kn,Kn=16777216,Po(a,o,h),Kn=y):Po(a,o,h));break;default:Po(a,o,h)}}function Mr(a){var o=a.alternate;if(o!==null&&(a=o.child,a!==null)){o.child=null;do o=a.sibling,a.sibling=null,a=o;while(a!==null)}}function pr(a){var o=a.deletions;if((a.flags&16)!==0){if(o!==null)for(var h=0;h<o.length;h++){var y=o[h];Vn=y,Ju(y,a)}Mr(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Go(a),a=a.sibling}function Go(a){switch(a.tag){case 0:case 11:case 15:pr(a),a.flags&2048&&ba(9,a,a.return);break;case 3:pr(a);break;case 12:pr(a);break;case 22:var o=a.stateNode;a.memoizedState!==null&&o._visibility&2&&(a.return===null||a.return.tag!==13)?(o._visibility&=-3,Sd(a)):pr(a);break;default:pr(a)}}function Sd(a){var o=a.deletions;if((a.flags&16)!==0){if(o!==null)for(var h=0;h<o.length;h++){var y=o[h];Vn=y,Ju(y,a)}Mr(a)}for(a=a.child;a!==null;){switch(o=a,o.tag){case 0:case 11:case 15:ba(8,o,o.return),Sd(o);break;case 22:h=o.stateNode,h._visibility&2&&(h._visibility&=-3,Sd(o));break;default:Sd(o)}a=a.sibling}}function Ju(a,o){for(;Vn!==null;){var h=Vn;switch(h.tag){case 0:case 11:case 15:ba(8,h,o);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var y=h.memoizedState.cachePool.pool;y!=null&&y.refCount++}break;case 24:Li(h.memoizedState.cache)}if(y=h.child,y!==null)y.return=h,Vn=y;else e:for(h=a;Vn!==null;){y=Vn;var S=y.sibling,M=y.return;if(xd(y),y===h){Vn=null;break e}if(S!==null){S.return=M,Vn=S;break e}Vn=M}}}var Ed={getCacheForType:function(a){var o=Ri($e),h=o.data.get(a);return h===void 0&&(h=a(),o.data.set(a,h)),h},cacheSignal:function(){return Ri($e).controller.signal}},wd=typeof WeakMap=="function"?WeakMap:Map,Ut=0,sn=null,St=null,Dt=0,Ze=0,Mt=null,gt=!1,Et=!1,mn=!1,ii=0,ln=0,ea=0,al=0,qa=0,It=0,ta=0,Ya=null,er=null,Rr=!1,sl=0,Gc=0,na=1/0,Fc=null,Cs=null,Pn=0,Va=null,ia=null,_a=0,ll=0,Fo=null,Td=null,qo=0,Yo=null;function mr(){return(Ut&2)!==0&&Dt!==0?Dt&-Dt:B.T!==null?Db():ar()}function u(){if(It===0)if((Dt&536870912)===0||zt){var a=Oa;Oa<<=1,(Oa&3932160)===0&&(Oa=262144),It=a}else It=536870912;return a=vi.current,a!==null&&(a.flags|=32),It}function f(a,o,h){(a===sn&&(Ze===2||Ze===9)||a.cancelPendingCommit!==null)&&(de(a,0),z(a,Dt,It,!1)),en(a,h),((Ut&2)===0||a!==sn)&&(a===sn&&((Ut&2)===0&&(al|=h),ln===4&&z(a,Dt,It,!1)),io(a))}function x(a,o,h){if((Ut&6)!==0)throw Error(i(327));var y=!h&&(o&127)===0&&(o&a.expiredLanes)===0||we(a,o),S=y?Vo(a,o):Nr(a,o,!0),M=y;do{if(S===0){Et&&!y&&z(a,o,0,!1);break}else{if(h=a.current.alternate,M&&!N(h)){S=Nr(a,o,!1),M=!1;continue}if(S===2){if(M=o,a.errorRecoveryDisabledLanes&M)var L=0;else L=a.pendingLanes&-536870913,L=L!==0?L:L&536870912?536870912:0;if(L!==0){o=L;e:{var J=a;S=Ya;var re=J.current.memoizedState.isDehydrated;if(re&&(de(J,L).flags|=256),L=Nr(J,L,!1),L!==2){if(mn&&!re){J.errorRecoveryDisabledLanes|=M,al|=M,S=4;break e}M=er,er=S,M!==null&&(er===null?er=M:er.push.apply(er,M))}S=L}if(M=!1,S!==2)continue}}if(S===1){de(a,0),z(a,o,0,!0);break}e:{switch(y=a,M=S,M){case 0:case 1:throw Error(i(345));case 4:if((o&4194048)!==o)break;case 6:z(y,o,It,!gt);break e;case 2:er=null;break;case 3:case 5:break;default:throw Error(i(329))}if((o&62914560)===o&&(S=sl+300-hn(),10<S)){if(z(y,o,It,!gt),ae(y,0,!0)!==0)break e;_a=o,y.timeoutHandle=lS(E.bind(null,y,h,er,Fc,Rr,o,It,al,ta,gt,M,"Throttled",-0,0),S);break e}E(y,h,er,Fc,Rr,o,It,al,ta,gt,M,null,-0,0)}}break}while(!0);io(a)}function E(a,o,h,y,S,M,L,J,re,pe,Ee,Ae,ye,_e){if(a.timeoutHandle=-1,Ae=o.subtreeFlags,Ae&8192||(Ae&16785408)===16785408){Ae={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ze},ni(o,M,Ae);var Ye=(M&62914560)===M?sl-hn():(M&4194048)===M?Gc-hn():0;if(Ye=yO(Ae,Ye),Ye!==null){_a=M,a.cancelPendingCommit=Ye(ct.bind(null,a,o,M,h,y,S,L,J,re,Ee,Ae,null,ye,_e)),z(a,M,L,!pe);return}}ct(a,o,M,h,y,S,L,J,re)}function N(a){for(var o=a;;){var h=o.tag;if((h===0||h===11||h===15)&&o.flags&16384&&(h=o.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var y=0;y<h.length;y++){var S=h[y],M=S.getSnapshot;S=S.value;try{if(!Rn(M(),S))return!1}catch{return!1}}if(h=o.child,o.subtreeFlags&16384&&h!==null)h.return=o,o=h;else{if(o===a)break;for(;o.sibling===null;){if(o.return===null||o.return===a)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function z(a,o,h,y){o&=~qa,o&=~al,a.suspendedLanes|=o,a.pingedLanes&=~o,y&&(a.warmLanes|=o),y=a.expirationTimes;for(var S=o;0<S;){var M=31-Pt(S),L=1<<M;y[M]=-1,S&=~L}h!==0&&Pe(a,h,o)}function ne(){return(Ut&6)===0?(zp(0),!1):!0}function ie(){if(St!==null){if(Ze===0)var a=St.return;else a=St,Wi=Xs=null,up(a),Yl=null,Vl=0,a=St;for(;a!==null;)jo(a.alternate,a),a=a.return;St=null}}function de(a,o){var h=a.timeoutHandle;h!==-1&&(a.timeoutHandle=-1,Jk(h)),h=a.cancelPendingCommit,h!==null&&(a.cancelPendingCommit=null,h()),_a=0,ie(),sn=a,St=h=hs(a.current,null),Dt=o,Ze=0,Mt=null,gt=!1,Et=we(a,o),mn=!1,ta=It=qa=al=ea=ln=0,er=Ya=null,Rr=!1,(o&8)!==0&&(o|=o&32);var y=a.entangledLanes;if(y!==0)for(a=a.entanglements,y&=o;0<y;){var S=31-Pt(y),M=1<<S;o|=a[S],y&=~M}return ii=o,Il(),h}function Te(a,o){ot=null,B.H=Pu,o===ql||o===Ha?(o=Jf(),Ze=3):o===ku?(o=Jf(),Ze=4):Ze=o===gd?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,Mt=o,St===null&&(ln=1,md(a,_r(o,a.current)))}function Oe(){var a=vi.current;return a===null?!0:(Dt&4194048)===Dt?ma===null:(Dt&62914560)===Dt||(Dt&536870912)!==0?a===ma:!1}function je(){var a=B.H;return B.H=Pu,a===null?Pu:a}function Ge(){var a=B.A;return B.A=Ed,a}function ht(){ln=4,gt||(Dt&4194048)!==Dt&&vi.current!==null||(Et=!0),(ea&134217727)===0&&(al&134217727)===0||sn===null||z(sn,Dt,It,!1)}function Nr(a,o,h){var y=Ut;Ut|=2;var S=je(),M=Ge();(sn!==a||Dt!==o)&&(Fc=null,de(a,o)),o=!1;var L=ln;e:do try{if(Ze!==0&&St!==null){var J=St,re=Mt;switch(Ze){case 8:ie(),L=6;break e;case 3:case 2:case 9:case 6:vi.current===null&&(o=!0);var pe=Ze;if(Ze=0,Mt=null,Ne(a,J,re,pe),h&&Et){L=0;break e}break;default:pe=Ze,Ze=0,Mt=null,Ne(a,J,re,pe)}}ef(),L=ln;break}catch(Ee){Te(a,Ee)}while(!0);return o&&a.shellSuspendCounter++,Wi=Xs=null,Ut=y,B.H=S,B.A=M,St===null&&(sn=null,Dt=0,Il()),L}function ef(){for(;St!==null;)ue(St)}function Vo(a,o){var h=Ut;Ut|=2;var y=je(),S=Ge();sn!==a||Dt!==o?(Fc=null,na=hn()+500,de(a,o)):Et=we(a,o);e:do try{if(Ze!==0&&St!==null){o=St;var M=Mt;t:switch(Ze){case 1:Ze=0,Mt=null,Ne(a,o,M,1);break;case 2:case 9:if(Rg(M)){Ze=0,Mt=null,xe(o);break}o=function(){Ze!==2&&Ze!==9||sn!==a||(Ze=7),io(a)},M.then(o,o);break e;case 3:Ze=7;break e;case 4:Ze=5;break e;case 7:Rg(M)?(Ze=0,Mt=null,xe(o)):(Ze=0,Mt=null,Ne(a,o,M,7));break;case 5:var L=null;switch(St.tag){case 26:L=St.memoizedState;case 5:case 27:var J=St;if(L?SS(L):J.stateNode.complete){Ze=0,Mt=null;var re=J.sibling;if(re!==null)St=re;else{var pe=J.return;pe!==null?(St=pe,We(pe)):St=null}break t}}Ze=0,Mt=null,Ne(a,o,M,5);break;case 6:Ze=0,Mt=null,Ne(a,o,M,6);break;case 8:ie(),ln=6;break e;default:throw Error(i(462))}}me();break}catch(Ee){Te(a,Ee)}while(!0);return Wi=Xs=null,B.H=y,B.A=S,Ut=h,St!==null?0:(sn=null,Dt=0,Il(),ln)}function me(){for(;St!==null&&!ka();)ue(St)}function ue(a){var o=yd(a.alternate,a,ii);a.memoizedProps=a.pendingProps,o===null?We(a):St=o}function xe(a){var o=a,h=o.alternate;switch(o.tag){case 15:case 0:o=Zi(h,o,o.pendingProps,o.type,void 0,Dt);break;case 11:o=Zi(h,o,o.pendingProps,o.type.render,o.ref,Dt);break;case 5:up(o);default:jo(h,o),o=St=Ki(o,ii),o=yd(h,o,ii)}a.memoizedProps=a.pendingProps,o===null?We(a):St=o}function Ne(a,o,h,y){Wi=Xs=null,up(o),Yl=null,Vl=0;var S=o.return;try{if(Xr(a,S,o,h,Dt)){ln=1,md(a,_r(h,a.current)),St=null;return}}catch(M){if(S!==null)throw St=S,M;ln=1,md(a,_r(h,a.current)),St=null;return}o.flags&32768?(zt||y===1?a=!0:Et||(Dt&536870912)!==0?a=!1:(gt=a=!0,(y===2||y===9||y===3||y===6)&&(y=vi.current,y!==null&&y.tag===13&&(y.flags|=16384))),_n(o,a)):We(o)}function We(a){var o=a;do{if((o.flags&32768)!==0){_n(o,gt);return}a=o.return;var h=kp(o.alternate,o,ii);if(h!==null){St=h;return}if(o=o.sibling,o!==null){St=o;return}St=o=a}while(o!==null);ln===0&&(ln=5)}function _n(a,o){do{var h=bd(a.alternate,a);if(h!==null){h.flags&=32767,St=h;return}if(h=a.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!o&&(a=a.sibling,a!==null)){St=a;return}St=a=h}while(a!==null);ln=6,St=null}function ct(a,o,h,y,S,M,L,J,re){a.cancelPendingCommit=null;do Cd();while(Pn!==0);if((Ut&6)!==0)throw Error(i(327));if(o!==null){if(o===a.current)throw Error(i(177));if(M=o.lanes|o.childLanes,M|=Yf,Fe(a,h,M,L,J,re),a===sn&&(St=sn=null,Dt=0),ia=o,Va=a,_a=h,ll=M,Fo=S,Td=y,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,Hk(Je,function(){return q1(),null})):(a.callbackNode=null,a.callbackPriority=0),y=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||y){y=B.T,B.T=null,S=X.p,X.p=2,L=Ut,Ut|=4;try{Hc(a,o,h)}finally{Ut=L,X.p=S,B.T=y}}Pn=1,Yt(),Si(),Vt()}}function Yt(){if(Pn===1){Pn=0;var a=Va,o=ia,h=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||h){h=B.T,B.T=null;var y=X.p;X.p=2;var S=Ut;Ut|=4;try{to(o,a);var M=Pb,L=Hf(a.containerInfo),J=M.focusedElem,re=M.selectionRange;if(L!==J&&J&&J.ownerDocument&&jf(J.ownerDocument.documentElement,J)){if(re!==null&&xc(J)){var pe=re.start,Ee=re.end;if(Ee===void 0&&(Ee=pe),"selectionStart"in J)J.selectionStart=pe,J.selectionEnd=Math.min(Ee,J.value.length);else{var Ae=J.ownerDocument||document,ye=Ae&&Ae.defaultView||window;if(ye.getSelection){var _e=ye.getSelection(),Ye=J.textContent.length,lt=Math.min(re.start,Ye),En=re.end===void 0?lt:Math.min(re.end,Ye);!_e.extend&<>En&&(L=En,En=lt,lt=L);var fe=jh(J,lt),ce=jh(J,En);if(fe&&ce&&(_e.rangeCount!==1||_e.anchorNode!==fe.node||_e.anchorOffset!==fe.offset||_e.focusNode!==ce.node||_e.focusOffset!==ce.offset)){var he=Ae.createRange();he.setStart(fe.node,fe.offset),_e.removeAllRanges(),lt>En?(_e.addRange(he),_e.extend(ce.node,ce.offset)):(he.setEnd(ce.node,ce.offset),_e.addRange(he))}}}}for(Ae=[],_e=J;_e=_e.parentNode;)_e.nodeType===1&&Ae.push({element:_e,left:_e.scrollLeft,top:_e.scrollTop});for(typeof J.focus=="function"&&J.focus(),J=0;J<Ae.length;J++){var Ce=Ae[J];Ce.element.scrollLeft=Ce.left,Ce.element.scrollTop=Ce.top}}gy=!!Hb,Pb=Hb=null}finally{Ut=S,X.p=y,B.T=h}}a.current=o,Pn=2}}function Si(){if(Pn===2){Pn=0;var a=Va,o=ia,h=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||h){h=B.T,B.T=null;var y=X.p;X.p=2;var S=Ut;Ut|=4;try{ny(a,o.alternate,o)}finally{Ut=S,X.p=y,B.T=h}}Pn=3}}function Vt(){if(Pn===4||Pn===3){Pn=0,Lr();var a=Va,o=ia,h=_a,y=Td;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?Pn=5:(Pn=0,ia=Va=null,ol(a,a.pendingLanes));var S=a.pendingLanes;if(S===0&&(Cs=null),fa(h),o=o.stateNode,$t&&typeof $t.onCommitFiberRoot=="function")try{$t.onCommitFiberRoot(xn,o,void 0,(o.current.flags&128)===128)}catch{}if(y!==null){o=B.T,S=X.p,X.p=2,B.T=null;try{for(var M=a.onRecoverableError,L=0;L<y.length;L++){var J=y[L];M(J.value,{componentStack:J.stack})}}finally{B.T=o,X.p=S}}(_a&3)!==0&&Cd(),io(a),S=a.pendingLanes,(h&261930)!==0&&(S&42)!==0?a===Yo?qo++:(qo=0,Yo=a):qo=0,zp(0)}}function ol(a,o){(a.pooledCacheLanes&=o)===0&&(o=a.pooledCache,o!=null&&(a.pooledCache=null,Li(o)))}function Cd(){return Yt(),Si(),Vt(),q1()}function q1(){if(Pn!==5)return!1;var a=Va,o=ll;ll=0;var h=fa(_a),y=B.T,S=X.p;try{X.p=32>h?32:h,B.T=null,h=Fo,Fo=null;var M=Va,L=_a;if(Pn=0,ia=Va=null,_a=0,(Ut&6)!==0)throw Error(i(331));var J=Ut;if(Ut|=4,Go(M.current),Hn(M,M.current,L,h),Ut=J,zp(0,!1),$t&&typeof $t.onPostCommitFiberRoot=="function")try{$t.onPostCommitFiberRoot(xn,M)}catch{}return!0}finally{X.p=S,B.T=y,ol(a,o)}}function Y1(a,o,h){o=_r(h,o),o=Np(a.stateNode,o,2),a=Zs(a,o,2),a!==null&&(en(a,2),io(a))}function yn(a,o,h){if(a.tag===3)Y1(a,a,h);else for(;o!==null;){if(o.tag===3){Y1(o,a,h);break}else if(o.tag===1){var y=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Cs===null||!Cs.has(y))){a=_r(h,a),h=Bc(2),y=Zs(o,h,2),y!==null&&(Tr(h,y,o,a),en(y,2),io(y));break}}o=o.return}}function Nb(a,o,h){var y=a.pingCache;if(y===null){y=a.pingCache=new wd;var S=new Set;y.set(o,S)}else S=y.get(o),S===void 0&&(S=new Set,y.set(o,S));S.has(h)||(mn=!0,S.add(h),a=Uk.bind(null,a,o,h),o.then(a,a))}function Uk(a,o,h){var y=a.pingCache;y!==null&&y.delete(o),a.pingedLanes|=a.suspendedLanes&h,a.warmLanes&=~h,sn===a&&(Dt&h)===h&&(ln===4||ln===3&&(Dt&62914560)===Dt&&300>hn()-sl?(Ut&2)===0&&de(a,0):qa|=h,ta===Dt&&(ta=0)),io(a)}function V1(a,o){o===0&&(o=et()),a=jl(a,o),a!==null&&(en(a,o),io(a))}function Ik(a){var o=a.memoizedState,h=0;o!==null&&(h=o.retryLane),V1(a,h)}function jk(a,o){var h=0;switch(a.tag){case 31:case 13:var y=a.stateNode,S=a.memoizedState;S!==null&&(h=S.retryLane);break;case 19:y=a.stateNode;break;case 22:y=a.stateNode._retryCache;break;default:throw Error(i(314))}y!==null&&y.delete(o),V1(a,h)}function Hk(a,o){return bn(a,o)}var ay=null,Ad=null,kb=!1,sy=!1,Ob=!1,qc=0;function io(a){a!==Ad&&a.next===null&&(Ad===null?ay=Ad=a:Ad=Ad.next=a),sy=!0,kb||(kb=!0,Gk())}function zp(a,o){if(!Ob&&sy){Ob=!0;do for(var h=!1,y=ay;y!==null;){if(a!==0){var S=y.pendingLanes;if(S===0)var M=0;else{var L=y.suspendedLanes,J=y.pingedLanes;M=(1<<31-Pt(42|a)+1)-1,M&=S&~(L&~J),M=M&201326741?M&201326741|1:M?M|2:0}M!==0&&(h=!0,$1(y,M))}else M=Dt,M=ae(y,y===sn?M:0,y.cancelPendingCommit!==null||y.timeoutHandle!==-1),(M&3)===0||we(y,M)||(h=!0,$1(y,M));y=y.next}while(h);Ob=!1}}function Pk(){X1()}function X1(){sy=kb=!1;var a=0;qc!==0&&Qk()&&(a=qc);for(var o=hn(),h=null,y=ay;y!==null;){var S=y.next,M=K1(y,o);M===0?(y.next=null,h===null?ay=S:h.next=S,S===null&&(Ad=h)):(h=y,(a!==0||(M&3)!==0)&&(sy=!0)),y=S}Pn!==0&&Pn!==5||zp(a),qc!==0&&(qc=0)}function K1(a,o){for(var h=a.suspendedLanes,y=a.pingedLanes,S=a.expirationTimes,M=a.pendingLanes&-62914561;0<M;){var L=31-Pt(M),J=1<<L,re=S[L];re===-1?((J&h)===0||(J&y)!==0)&&(S[L]=Be(J,o)):re<=o&&(a.expiredLanes|=J),M&=~J}if(o=sn,h=Dt,h=ae(a,a===o?h:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),y=a.callbackNode,h===0||a===o&&(Ze===2||Ze===9)||a.cancelPendingCommit!==null)return y!==null&&y!==null&&wi(y),a.callbackNode=null,a.callbackPriority=0;if((h&3)===0||we(a,h)){if(o=h&-h,o===a.callbackPriority)return o;switch(y!==null&&wi(y),fa(h)){case 2:case 8:h=ke;break;case 32:h=Je;break;case 268435456:h=kt;break;default:h=Je}return y=W1.bind(null,a),h=bn(h,y),a.callbackPriority=o,a.callbackNode=h,o}return y!==null&&y!==null&&wi(y),a.callbackPriority=2,a.callbackNode=null,2}function W1(a,o){if(Pn!==0&&Pn!==5)return a.callbackNode=null,a.callbackPriority=0,null;var h=a.callbackNode;if(Cd()&&a.callbackNode!==h)return null;var y=Dt;return y=ae(a,a===sn?y:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),y===0?null:(x(a,y,o),K1(a,hn()),a.callbackNode!=null&&a.callbackNode===h?W1.bind(null,a):null)}function $1(a,o){if(Cd())return null;x(a,o,!0)}function Gk(){eO(function(){(Ut&6)!==0?bn(Se,Pk):X1()})}function Db(){if(qc===0){var a=$s;a===0&&(a=as,as<<=1,(as&261888)===0&&(as=256)),qc=a}return qc}function Z1(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Hs(""+a)}function Q1(a,o){var h=o.ownerDocument.createElement("input");return h.name=o.name,h.value=o.value,a.id&&h.setAttribute("form",a.id),o.parentNode.insertBefore(h,o),a=new FormData(a),h.parentNode.removeChild(h),a}function Fk(a,o,h,y,S){if(o==="submit"&&h&&h.stateNode===S){var M=Z1((S[li]||null).action),L=y.submitter;L&&(o=(o=L[li]||null)?Z1(o.formAction):L.getAttribute("formAction"),o!==null&&(M=o,L=null));var J=new gu("action","action",null,y,S);a.push({event:J,listeners:[{instance:null,listener:function(){if(y.defaultPrevented){if(qc!==0){var re=L?Q1(S,L):new FormData(S);Tp(h,{pending:!0,data:re,method:S.method,action:M},null,re)}}else typeof M=="function"&&(J.preventDefault(),re=L?Q1(S,L):new FormData(S),Tp(h,{pending:!0,data:re,method:S.method,action:M},M,re))},currentTarget:S}]})}}for(var zb=0;zb<qf.length;zb++){var Bb=qf[zb],qk=Bb.toLowerCase(),Yk=Bb[0].toUpperCase()+Bb.slice(1);Xi(qk,"on"+Yk)}Xi(vr,"onAnimationEnd"),Xi(Hh,"onAnimationIteration"),Xi(ds,"onAnimationStart"),Xi("dblclick","onDoubleClick"),Xi("focusin","onFocus"),Xi("focusout","onBlur"),Xi(Ec,"onTransitionRun"),Xi(Ll,"onTransitionStart"),Xi(Ph,"onTransitionCancel"),Xi(Ff,"onTransitionEnd"),Me("onMouseEnter",["mouseout","mouseover"]),Me("onMouseLeave",["mouseout","mouseover"]),Me("onPointerEnter",["pointerout","pointerover"]),Me("onPointerLeave",["pointerout","pointerover"]),jr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),jr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),jr("onBeforeInput",["compositionend","keypress","textInput","paste"]),jr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),jr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),jr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Bp="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(" "),Vk=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Bp));function J1(a,o){o=(o&4)!==0;for(var h=0;h<a.length;h++){var y=a[h],S=y.event;y=y.listeners;e:{var M=void 0;if(o)for(var L=y.length-1;0<=L;L--){var J=y[L],re=J.instance,pe=J.currentTarget;if(J=J.listener,re!==M&&S.isPropagationStopped())break e;M=J,S.currentTarget=pe;try{M(S)}catch(Ee){Ul(Ee)}S.currentTarget=null,M=re}else for(L=0;L<y.length;L++){if(J=y[L],re=J.instance,pe=J.currentTarget,J=J.listener,re!==M&&S.isPropagationStopped())break e;M=J,S.currentTarget=pe;try{M(S)}catch(Ee){Ul(Ee)}S.currentTarget=null,M=re}}}}function Bt(a,o){var h=o[Us];h===void 0&&(h=o[Us]=new Set);var y=a+"__bubble";h.has(y)||(eS(o,a,2,!1),h.add(y))}function Lb(a,o,h){var y=0;o&&(y|=4),eS(h,a,y,o)}var ly="_reactListening"+Math.random().toString(36).slice(2);function Ub(a){if(!a[ly]){a[ly]=!0,xr.forEach(function(h){h!=="selectionchange"&&(Vk.has(h)||Lb(h,!1,a),Lb(h,!0,a))});var o=a.nodeType===9?a:a.ownerDocument;o===null||o[ly]||(o[ly]=!0,Lb("selectionchange",!1,o))}}function eS(a,o,h,y){switch(RS(o)){case 2:var S=vO;break;case 8:S=_O;break;default:S=Qb}h=S.bind(null,o,h,a),S=void 0,!Rf||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(S=!0),y?S!==void 0?a.addEventListener(o,h,{capture:!0,passive:S}):a.addEventListener(o,h,!0):S!==void 0?a.addEventListener(o,h,{passive:S}):a.addEventListener(o,h,!1)}function Ib(a,o,h,y,S){var M=y;if((o&1)===0&&(o&2)===0&&y!==null)e:for(;;){if(y===null)return;var L=y.tag;if(L===3||L===4){var J=y.stateNode.containerInfo;if(J===S)break;if(L===4)for(L=y.return;L!==null;){var re=L.tag;if((re===3||re===4)&&L.stateNode.containerInfo===S)return;L=L.return}for(;J!==null;){if(L=tn(J),L===null)return;if(re=L.tag,re===5||re===6||re===26||re===27){y=M=L;continue e}J=J.parentNode}}y=y.return}hu(function(){var pe=M,Ee=mt(h),Ae=[];e:{var ye=Fs.get(a);if(ye!==void 0){var _e=gu,Ye=a;switch(a){case"keypress":if(So(h)===0)break e;case"keydown":case"keyup":_e=Rh;break;case"focusin":Ye="focus",_e=zf;break;case"focusout":Ye="blur",_e=zf;break;case"beforeblur":case"afterblur":_e=zf;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":_e=sg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":_e=lg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":_e=Ps;break;case vr:case Hh:case ds:_e=ug;break;case Ff:_e=Sb;break;case"scroll":case"scrollend":_e=Of;break;case"wheel":_e=Nl;break;case"copy":case"cut":case"paste":_e=wh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":_e=Bf;break;case"toggle":case"beforetoggle":_e=kh}var lt=(o&4)!==0,En=!lt&&(a==="scroll"||a==="scrollend"),fe=lt?ye!==null?ye+"Capture":null:ye;lt=[];for(var ce=pe,he;ce!==null;){var Ce=ce;if(he=Ce.stateNode,Ce=Ce.tag,Ce!==5&&Ce!==26&&Ce!==27||he===null||fe===null||(Ce=_o(ce,fe),Ce!=null&<.push(Lp(ce,Ce,he))),En)break;ce=ce.return}0<lt.length&&(ye=new _e(ye,Ye,null,h,Ee),Ae.push({event:ye,listeners:lt}))}}if((o&7)===0){e:{if(ye=a==="mouseover"||a==="pointerover",_e=a==="mouseout"||a==="pointerout",ye&&h!==qe&&(Ye=h.relatedTarget||h.fromElement)&&(tn(Ye)||Ye[Ur]))break e;if((_e||ye)&&(ye=Ee.window===Ee?Ee:(ye=Ee.ownerDocument)?ye.defaultView||ye.parentWindow:window,_e?(Ye=h.relatedTarget||h.toElement,_e=pe,Ye=Ye?tn(Ye):null,Ye!==null&&(En=s(Ye),lt=Ye.tag,Ye!==En||lt!==5&<!==27&<!==6)&&(Ye=null)):(_e=null,Ye=pe),_e!==Ye)){if(lt=sg,Ce="onMouseLeave",fe="onMouseEnter",ce="mouse",(a==="pointerout"||a==="pointerover")&&(lt=Bf,Ce="onPointerLeave",fe="onPointerEnter",ce="pointer"),En=_e==null?ye:lr(_e),he=Ye==null?ye:lr(Ye),ye=new lt(Ce,ce+"leave",_e,h,Ee),ye.target=En,ye.relatedTarget=he,Ce=null,tn(Ee)===pe&&(lt=new lt(fe,ce+"enter",Ye,h,Ee),lt.target=he,lt.relatedTarget=En,Ce=lt),En=Ce,_e&&Ye)t:{for(lt=Xk,fe=_e,ce=Ye,he=0,Ce=fe;Ce;Ce=lt(Ce))he++;Ce=0;for(var nt=ce;nt;nt=lt(nt))Ce++;for(;0<he-Ce;)fe=lt(fe),he--;for(;0<Ce-he;)ce=lt(ce),Ce--;for(;he--;){if(fe===ce||ce!==null&&fe===ce.alternate){lt=fe;break t}fe=lt(fe),ce=lt(ce)}lt=null}else lt=null;_e!==null&&tS(Ae,ye,_e,lt,!1),Ye!==null&&En!==null&&tS(Ae,En,Ye,lt,!0)}}e:{if(ye=pe?lr(pe):window,_e=ye.nodeName&&ye.nodeName.toLowerCase(),_e==="select"||_e==="input"&&ye.type==="file")var on=Lh;else if(zh(ye))if(Su)on=_g;else{on=Dl;var Ke=Eu}else _e=ye.nodeName,!_e||_e.toLowerCase()!=="input"||ye.type!=="checkbox"&&ye.type!=="radio"?pe&&cs(pe.elementType)&&(on=Lh):on=vg;if(on&&(on=on(a,pe))){If(Ae,on,h,Ee);break e}Ke&&Ke(a,ye,pe),a==="focusout"&&pe&&ye.type==="number"&&pe.memoizedProps.value!=null&&js(ye,"number",ye.value)}switch(Ke=pe?lr(pe):window,a){case"focusin":(zh(Ke)||Ke.contentEditable==="true")&&(vc=Ke,Pf=pe,_c=null);break;case"focusout":_c=Pf=vc=null;break;case"mousedown":Gr=!0;break;case"contextmenu":case"mouseup":case"dragend":Gr=!1,Gf(Ae,h,Ee);break;case"selectionchange":if(Sg)break;case"keydown":case"keyup":Gf(Ae,h,Ee)}var wt;if(Eo)e:{switch(a){case"compositionstart":var jt="onCompositionStart";break e;case"compositionend":jt="onCompositionEnd";break e;case"compositionupdate":jt="onCompositionUpdate";break e}jt=void 0}else Ol?Lf(a,h)&&(jt="onCompositionEnd"):a==="keydown"&&h.keyCode===229&&(jt="onCompositionStart");jt&&(Bi&&h.locale!=="ko"&&(Ol||jt!=="onCompositionStart"?jt==="onCompositionEnd"&&Ol&&(wt=kf()):(Al=Ee,Nf="value"in Al?Al.value:Al.textContent,Ol=!0)),Ke=oy(pe,jt),0<Ke.length&&(jt=new Th(jt,a,null,h,Ee),Ae.push({event:jt,listeners:Ke}),wt?jt.data=wt:(wt=pc(h),wt!==null&&(jt.data=wt)))),(wt=wo?Uf(a,h):yg(a,h))&&(jt=oy(pe,"onBeforeInput"),0<jt.length&&(Ke=new Th("onBeforeInput","beforeinput",null,h,Ee),Ae.push({event:Ke,listeners:jt}),Ke.data=wt)),Fk(Ae,a,pe,h,Ee)}J1(Ae,o)})}function Lp(a,o,h){return{instance:a,listener:o,currentTarget:h}}function oy(a,o){for(var h=o+"Capture",y=[];a!==null;){var S=a,M=S.stateNode;if(S=S.tag,S!==5&&S!==26&&S!==27||M===null||(S=_o(a,h),S!=null&&y.unshift(Lp(a,S,M)),S=_o(a,o),S!=null&&y.push(Lp(a,S,M))),a.tag===3)return y;a=a.return}return[]}function Xk(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function tS(a,o,h,y,S){for(var M=o._reactName,L=[];h!==null&&h!==y;){var J=h,re=J.alternate,pe=J.stateNode;if(J=J.tag,re!==null&&re===y)break;J!==5&&J!==26&&J!==27||pe===null||(re=pe,S?(pe=_o(h,M),pe!=null&&L.unshift(Lp(h,pe,re))):S||(pe=_o(h,M),pe!=null&&L.push(Lp(h,pe,re)))),h=h.return}L.length!==0&&a.push({event:o,listeners:L})}var Kk=/\r\n?/g,Wk=/\u0000|\uFFFD/g;function nS(a){return(typeof a=="string"?a:""+a).replace(Kk,`
|
|
50
|
+
`).replace(Wk,"")}function iS(a,o){return o=nS(o),nS(a)===o}function Sn(a,o,h,y,S,M){switch(h){case"children":typeof y=="string"?o==="body"||o==="textarea"&&y===""||it(a,y):(typeof y=="number"||typeof y=="bigint")&&o!=="body"&&it(a,""+y);break;case"className":Yi(a,"class",y);break;case"tabIndex":Yi(a,"tabindex",y);break;case"dir":case"role":case"viewBox":case"width":case"height":Yi(a,h,y);break;case"style":rn(a,y,M);break;case"data":if(o!=="object"){Yi(a,"data",y);break}case"src":case"href":if(y===""&&(o!=="a"||h!=="href")){a.removeAttribute(h);break}if(y==null||typeof y=="function"||typeof y=="symbol"||typeof y=="boolean"){a.removeAttribute(h);break}y=Hs(""+y),a.setAttribute(h,y);break;case"action":case"formAction":if(typeof y=="function"){a.setAttribute(h,"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 M=="function"&&(h==="formAction"?(o!=="input"&&Sn(a,o,"name",S.name,S,null),Sn(a,o,"formEncType",S.formEncType,S,null),Sn(a,o,"formMethod",S.formMethod,S,null),Sn(a,o,"formTarget",S.formTarget,S,null)):(Sn(a,o,"encType",S.encType,S,null),Sn(a,o,"method",S.method,S,null),Sn(a,o,"target",S.target,S,null)));if(y==null||typeof y=="symbol"||typeof y=="boolean"){a.removeAttribute(h);break}y=Hs(""+y),a.setAttribute(h,y);break;case"onClick":y!=null&&(a.onclick=ze);break;case"onScroll":y!=null&&Bt("scroll",a);break;case"onScrollEnd":y!=null&&Bt("scrollend",a);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(i(61));if(h=y.__html,h!=null){if(S.children!=null)throw Error(i(60));a.innerHTML=h}}break;case"multiple":a.multiple=y&&typeof y!="function"&&typeof y!="symbol";break;case"muted":a.muted=y&&typeof y!="function"&&typeof y!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(y==null||typeof y=="function"||typeof y=="boolean"||typeof y=="symbol"){a.removeAttribute("xlink:href");break}h=Hs(""+y),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":y!=null&&typeof y!="function"&&typeof y!="symbol"?a.setAttribute(h,""+y):a.removeAttribute(h);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":y&&typeof y!="function"&&typeof y!="symbol"?a.setAttribute(h,""):a.removeAttribute(h);break;case"capture":case"download":y===!0?a.setAttribute(h,""):y!==!1&&y!=null&&typeof y!="function"&&typeof y!="symbol"?a.setAttribute(h,y):a.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":y!=null&&typeof y!="function"&&typeof y!="symbol"&&!isNaN(y)&&1<=y?a.setAttribute(h,y):a.removeAttribute(h);break;case"rowSpan":case"start":y==null||typeof y=="function"||typeof y=="symbol"||isNaN(y)?a.removeAttribute(h):a.setAttribute(h,y);break;case"popover":Bt("beforetoggle",a),Bt("toggle",a),xi(a,"popover",y);break;case"xlinkActuate":Ti(a,"http://www.w3.org/1999/xlink","xlink:actuate",y);break;case"xlinkArcrole":Ti(a,"http://www.w3.org/1999/xlink","xlink:arcrole",y);break;case"xlinkRole":Ti(a,"http://www.w3.org/1999/xlink","xlink:role",y);break;case"xlinkShow":Ti(a,"http://www.w3.org/1999/xlink","xlink:show",y);break;case"xlinkTitle":Ti(a,"http://www.w3.org/1999/xlink","xlink:title",y);break;case"xlinkType":Ti(a,"http://www.w3.org/1999/xlink","xlink:type",y);break;case"xmlBase":Ti(a,"http://www.w3.org/XML/1998/namespace","xml:base",y);break;case"xmlLang":Ti(a,"http://www.w3.org/XML/1998/namespace","xml:lang",y);break;case"xmlSpace":Ti(a,"http://www.w3.org/XML/1998/namespace","xml:space",y);break;case"is":xi(a,"is",y);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=us.get(h)||h,xi(a,h,y))}}function jb(a,o,h,y,S,M){switch(h){case"style":rn(a,y,M);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(i(61));if(h=y.__html,h!=null){if(S.children!=null)throw Error(i(60));a.innerHTML=h}}break;case"children":typeof y=="string"?it(a,y):(typeof y=="number"||typeof y=="bigint")&&it(a,""+y);break;case"onScroll":y!=null&&Bt("scroll",a);break;case"onScrollEnd":y!=null&&Bt("scrollend",a);break;case"onClick":y!=null&&(a.onclick=ze);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!da.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(S=h.endsWith("Capture"),o=h.slice(2,S?h.length-7:void 0),M=a[li]||null,M=M!=null?M[h]:null,typeof M=="function"&&a.removeEventListener(o,M,S),typeof y=="function")){typeof M!="function"&&M!==null&&(h in a?a[h]=null:a.hasAttribute(h)&&a.removeAttribute(h)),a.addEventListener(o,y,S);break e}h in a?a[h]=y:y===!0?a.setAttribute(h,""):xi(a,h,y)}}}function gr(a,o,h){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Bt("error",a),Bt("load",a);var y=!1,S=!1,M;for(M in h)if(h.hasOwnProperty(M)){var L=h[M];if(L!=null)switch(M){case"src":y=!0;break;case"srcSet":S=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,o));default:Sn(a,o,M,L,h,null)}}S&&Sn(a,o,"srcSet",h.srcSet,h,null),y&&Sn(a,o,"src",h.src,h,null);return;case"input":Bt("invalid",a);var J=M=L=S=null,re=null,pe=null;for(y in h)if(h.hasOwnProperty(y)){var Ee=h[y];if(Ee!=null)switch(y){case"name":S=Ee;break;case"type":L=Ee;break;case"checked":re=Ee;break;case"defaultChecked":pe=Ee;break;case"value":M=Ee;break;case"defaultValue":J=Ee;break;case"children":case"dangerouslySetInnerHTML":if(Ee!=null)throw Error(i(137,o));break;default:Sn(a,o,y,Ee,h,null)}}os(a,M,J,re,pe,L,S,!1);return;case"select":Bt("invalid",a),y=L=M=null;for(S in h)if(h.hasOwnProperty(S)&&(J=h[S],J!=null))switch(S){case"value":M=J;break;case"defaultValue":L=J;break;case"multiple":y=J;default:Sn(a,o,S,J,h,null)}o=M,h=L,a.multiple=!!y,o!=null?oi(a,!!y,o,!1):h!=null&&oi(a,!!y,h,!0);return;case"textarea":Bt("invalid",a),M=S=y=null;for(L in h)if(h.hasOwnProperty(L)&&(J=h[L],J!=null))switch(L){case"value":y=J;break;case"defaultValue":S=J;break;case"children":M=J;break;case"dangerouslySetInnerHTML":if(J!=null)throw Error(i(91));break;default:Sn(a,o,L,J,h,null)}Ba(a,y,S,M);return;case"option":for(re in h)if(h.hasOwnProperty(re)&&(y=h[re],y!=null))switch(re){case"selected":a.selected=y&&typeof y!="function"&&typeof y!="symbol";break;default:Sn(a,o,re,y,h,null)}return;case"dialog":Bt("beforetoggle",a),Bt("toggle",a),Bt("cancel",a),Bt("close",a);break;case"iframe":case"object":Bt("load",a);break;case"video":case"audio":for(y=0;y<Bp.length;y++)Bt(Bp[y],a);break;case"image":Bt("error",a),Bt("load",a);break;case"details":Bt("toggle",a);break;case"embed":case"source":case"link":Bt("error",a),Bt("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(pe in h)if(h.hasOwnProperty(pe)&&(y=h[pe],y!=null))switch(pe){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,o));default:Sn(a,o,pe,y,h,null)}return;default:if(cs(o)){for(Ee in h)h.hasOwnProperty(Ee)&&(y=h[Ee],y!==void 0&&jb(a,o,Ee,y,h,void 0));return}}for(J in h)h.hasOwnProperty(J)&&(y=h[J],y!=null&&Sn(a,o,J,y,h,null))}function $k(a,o,h,y){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var S=null,M=null,L=null,J=null,re=null,pe=null,Ee=null;for(_e in h){var Ae=h[_e];if(h.hasOwnProperty(_e)&&Ae!=null)switch(_e){case"checked":break;case"value":break;case"defaultValue":re=Ae;default:y.hasOwnProperty(_e)||Sn(a,o,_e,null,y,Ae)}}for(var ye in y){var _e=y[ye];if(Ae=h[ye],y.hasOwnProperty(ye)&&(_e!=null||Ae!=null))switch(ye){case"type":M=_e;break;case"name":S=_e;break;case"checked":pe=_e;break;case"defaultChecked":Ee=_e;break;case"value":L=_e;break;case"defaultValue":J=_e;break;case"children":case"dangerouslySetInnerHTML":if(_e!=null)throw Error(i(137,o));break;default:_e!==Ae&&Sn(a,o,ye,_e,y,Ae)}}ls(a,L,J,re,pe,Ee,M,S);return;case"select":_e=L=J=ye=null;for(M in h)if(re=h[M],h.hasOwnProperty(M)&&re!=null)switch(M){case"value":break;case"multiple":_e=re;default:y.hasOwnProperty(M)||Sn(a,o,M,null,y,re)}for(S in y)if(M=y[S],re=h[S],y.hasOwnProperty(S)&&(M!=null||re!=null))switch(S){case"value":ye=M;break;case"defaultValue":J=M;break;case"multiple":L=M;default:M!==re&&Sn(a,o,S,M,y,re)}o=J,h=L,y=_e,ye!=null?oi(a,!!h,ye,!1):!!y!=!!h&&(o!=null?oi(a,!!h,o,!0):oi(a,!!h,h?[]:"",!1));return;case"textarea":_e=ye=null;for(J in h)if(S=h[J],h.hasOwnProperty(J)&&S!=null&&!y.hasOwnProperty(J))switch(J){case"value":break;case"children":break;default:Sn(a,o,J,null,y,S)}for(L in y)if(S=y[L],M=h[L],y.hasOwnProperty(L)&&(S!=null||M!=null))switch(L){case"value":ye=S;break;case"defaultValue":_e=S;break;case"children":break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(i(91));break;default:S!==M&&Sn(a,o,L,S,y,M)}du(a,ye,_e);return;case"option":for(var Ye in h)if(ye=h[Ye],h.hasOwnProperty(Ye)&&ye!=null&&!y.hasOwnProperty(Ye))switch(Ye){case"selected":a.selected=!1;break;default:Sn(a,o,Ye,null,y,ye)}for(re in y)if(ye=y[re],_e=h[re],y.hasOwnProperty(re)&&ye!==_e&&(ye!=null||_e!=null))switch(re){case"selected":a.selected=ye&&typeof ye!="function"&&typeof ye!="symbol";break;default:Sn(a,o,re,ye,y,_e)}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 lt in h)ye=h[lt],h.hasOwnProperty(lt)&&ye!=null&&!y.hasOwnProperty(lt)&&Sn(a,o,lt,null,y,ye);for(pe in y)if(ye=y[pe],_e=h[pe],y.hasOwnProperty(pe)&&ye!==_e&&(ye!=null||_e!=null))switch(pe){case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(i(137,o));break;default:Sn(a,o,pe,ye,y,_e)}return;default:if(cs(o)){for(var En in h)ye=h[En],h.hasOwnProperty(En)&&ye!==void 0&&!y.hasOwnProperty(En)&&jb(a,o,En,void 0,y,ye);for(Ee in y)ye=y[Ee],_e=h[Ee],!y.hasOwnProperty(Ee)||ye===_e||ye===void 0&&_e===void 0||jb(a,o,Ee,ye,y,_e);return}}for(var fe in h)ye=h[fe],h.hasOwnProperty(fe)&&ye!=null&&!y.hasOwnProperty(fe)&&Sn(a,o,fe,null,y,ye);for(Ae in y)ye=y[Ae],_e=h[Ae],!y.hasOwnProperty(Ae)||ye===_e||ye==null&&_e==null||Sn(a,o,Ae,ye,y,_e)}function rS(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Zk(){if(typeof performance.getEntriesByType=="function"){for(var a=0,o=0,h=performance.getEntriesByType("resource"),y=0;y<h.length;y++){var S=h[y],M=S.transferSize,L=S.initiatorType,J=S.duration;if(M&&J&&rS(L)){for(L=0,J=S.responseEnd,y+=1;y<h.length;y++){var re=h[y],pe=re.startTime;if(pe>J)break;var Ee=re.transferSize,Ae=re.initiatorType;Ee&&rS(Ae)&&(re=re.responseEnd,L+=Ee*(re<J?1:(J-pe)/(re-pe)))}if(--y,o+=8*(M+L)/(S.duration/1e3),a++,10<a)break}}if(0<a)return o/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var Hb=null,Pb=null;function cy(a){return a.nodeType===9?a:a.ownerDocument}function aS(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function sS(a,o){if(a===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&o==="foreignObject"?0:a}function Gb(a,o){return a==="textarea"||a==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var Fb=null;function Qk(){var a=window.event;return a&&a.type==="popstate"?a===Fb?!1:(Fb=a,!0):(Fb=null,!1)}var lS=typeof setTimeout=="function"?setTimeout:void 0,Jk=typeof clearTimeout=="function"?clearTimeout:void 0,oS=typeof Promise=="function"?Promise:void 0,eO=typeof queueMicrotask=="function"?queueMicrotask:typeof oS<"u"?function(a){return oS.resolve(null).then(a).catch(tO)}:lS;function tO(a){setTimeout(function(){throw a})}function Yc(a){return a==="head"}function cS(a,o){var h=o,y=0;do{var S=h.nextSibling;if(a.removeChild(h),S&&S.nodeType===8)if(h=S.data,h==="/$"||h==="/&"){if(y===0){a.removeChild(S),kd(o);return}y--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")y++;else if(h==="html")Up(a.ownerDocument.documentElement);else if(h==="head"){h=a.ownerDocument.head,Up(h);for(var M=h.firstChild;M;){var L=M.nextSibling,J=M.nodeName;M[Da]||J==="SCRIPT"||J==="STYLE"||J==="LINK"&&M.rel.toLowerCase()==="stylesheet"||h.removeChild(M),M=L}}else h==="body"&&Up(a.ownerDocument.body);h=S}while(h);kd(o)}function uS(a,o){var h=a;a=0;do{var y=h.nextSibling;if(h.nodeType===1?o?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(o?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),y&&y.nodeType===8)if(h=y.data,h==="/$"){if(a===0)break;a--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||a++;h=y}while(h)}function qb(a){var o=a.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var h=o;switch(o=o.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":qb(h),Is(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}a.removeChild(h)}}function nO(a,o,h,y){for(;a.nodeType===1;){var S=h;if(a.nodeName.toLowerCase()!==o.toLowerCase()){if(!y&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(y){if(!a[Da])switch(o){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(M=a.getAttribute("rel"),M==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(M!==S.rel||a.getAttribute("href")!==(S.href==null||S.href===""?null:S.href)||a.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin)||a.getAttribute("title")!==(S.title==null?null:S.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(M=a.getAttribute("src"),(M!==(S.src==null?null:S.src)||a.getAttribute("type")!==(S.type==null?null:S.type)||a.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin))&&M&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(o==="input"&&a.type==="hidden"){var M=S.name==null?null:""+S.name;if(S.type==="hidden"&&a.getAttribute("name")===M)return a}else return a;if(a=As(a.nextSibling),a===null)break}return null}function iO(a,o,h){if(o==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!h||(a=As(a.nextSibling),a===null))return null;return a}function fS(a,o){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!o||(a=As(a.nextSibling),a===null))return null;return a}function Yb(a){return a.data==="$?"||a.data==="$~"}function Vb(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function rO(a,o){var h=a.ownerDocument;if(a.data==="$~")a._reactRetry=o;else if(a.data!=="$?"||h.readyState!=="loading")o();else{var y=function(){o(),h.removeEventListener("DOMContentLoaded",y)};h.addEventListener("DOMContentLoaded",y),a._reactRetry=y}}function As(a){for(;a!=null;a=a.nextSibling){var o=a.nodeType;if(o===1||o===3)break;if(o===8){if(o=a.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return a}var Xb=null;function dS(a){a=a.nextSibling;for(var o=0;a;){if(a.nodeType===8){var h=a.data;if(h==="/$"||h==="/&"){if(o===0)return As(a.nextSibling);o--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||o++}a=a.nextSibling}return null}function hS(a){a=a.previousSibling;for(var o=0;a;){if(a.nodeType===8){var h=a.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(o===0)return a;o--}else h!=="/$"&&h!=="/&"||o++}a=a.previousSibling}return null}function pS(a,o,h){switch(o=cy(h),a){case"html":if(a=o.documentElement,!a)throw Error(i(452));return a;case"head":if(a=o.head,!a)throw Error(i(453));return a;case"body":if(a=o.body,!a)throw Error(i(454));return a;default:throw Error(i(451))}}function Up(a){for(var o=a.attributes;o.length;)a.removeAttributeNode(o[0]);Is(a)}var Ms=new Map,mS=new Set;function uy(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Xo=X.d;X.d={f:aO,r:sO,D:lO,C:oO,L:cO,m:uO,X:dO,S:fO,M:hO};function aO(){var a=Xo.f(),o=ne();return a||o}function sO(a){var o=nn(a);o!==null&&o.tag===5&&o.type==="form"?Cp(o):Xo.r(a)}var Md=typeof document>"u"?null:document;function gS(a,o,h){var y=Md;if(y&&typeof o=="string"&&o){var S=Di(o);S='link[rel="'+a+'"][href="'+S+'"]',typeof h=="string"&&(S+='[crossorigin="'+h+'"]'),mS.has(S)||(mS.add(S),a={rel:a,crossOrigin:h,href:o},y.querySelector(S)===null&&(o=y.createElement("link"),gr(o,"link",a),Ln(o),y.head.appendChild(o)))}}function lO(a){Xo.D(a),gS("dns-prefetch",a,null)}function oO(a,o){Xo.C(a,o),gS("preconnect",a,o)}function cO(a,o,h){Xo.L(a,o,h);var y=Md;if(y&&a&&o){var S='link[rel="preload"][as="'+Di(o)+'"]';o==="image"&&h&&h.imageSrcSet?(S+='[imagesrcset="'+Di(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(S+='[imagesizes="'+Di(h.imageSizes)+'"]')):S+='[href="'+Di(a)+'"]';var M=S;switch(o){case"style":M=Rd(a);break;case"script":M=Nd(a)}Ms.has(M)||(a=g({rel:"preload",href:o==="image"&&h&&h.imageSrcSet?void 0:a,as:o},h),Ms.set(M,a),y.querySelector(S)!==null||o==="style"&&y.querySelector(Ip(M))||o==="script"&&y.querySelector(jp(M))||(o=y.createElement("link"),gr(o,"link",a),Ln(o),y.head.appendChild(o)))}}function uO(a,o){Xo.m(a,o);var h=Md;if(h&&a){var y=o&&typeof o.as=="string"?o.as:"script",S='link[rel="modulepreload"][as="'+Di(y)+'"][href="'+Di(a)+'"]',M=S;switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":M=Nd(a)}if(!Ms.has(M)&&(a=g({rel:"modulepreload",href:a},o),Ms.set(M,a),h.querySelector(S)===null)){switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(jp(M)))return}y=h.createElement("link"),gr(y,"link",a),Ln(y),h.head.appendChild(y)}}}function fO(a,o,h){Xo.S(a,o,h);var y=Md;if(y&&a){var S=Ir(y).hoistableStyles,M=Rd(a);o=o||"default";var L=S.get(M);if(!L){var J={loading:0,preload:null};if(L=y.querySelector(Ip(M)))J.loading=5;else{a=g({rel:"stylesheet",href:a,"data-precedence":o},h),(h=Ms.get(M))&&Kb(a,h);var re=L=y.createElement("link");Ln(re),gr(re,"link",a),re._p=new Promise(function(pe,Ee){re.onload=pe,re.onerror=Ee}),re.addEventListener("load",function(){J.loading|=1}),re.addEventListener("error",function(){J.loading|=2}),J.loading|=4,fy(L,o,y)}L={type:"stylesheet",instance:L,count:1,state:J},S.set(M,L)}}}function dO(a,o){Xo.X(a,o);var h=Md;if(h&&a){var y=Ir(h).hoistableScripts,S=Nd(a),M=y.get(S);M||(M=h.querySelector(jp(S)),M||(a=g({src:a,async:!0},o),(o=Ms.get(S))&&Wb(a,o),M=h.createElement("script"),Ln(M),gr(M,"link",a),h.head.appendChild(M)),M={type:"script",instance:M,count:1,state:null},y.set(S,M))}}function hO(a,o){Xo.M(a,o);var h=Md;if(h&&a){var y=Ir(h).hoistableScripts,S=Nd(a),M=y.get(S);M||(M=h.querySelector(jp(S)),M||(a=g({src:a,async:!0,type:"module"},o),(o=Ms.get(S))&&Wb(a,o),M=h.createElement("script"),Ln(M),gr(M,"link",a),h.head.appendChild(M)),M={type:"script",instance:M,count:1,state:null},y.set(S,M))}}function yS(a,o,h,y){var S=(S=ve.current)?uy(S):null;if(!S)throw Error(i(446));switch(a){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(o=Rd(h.href),h=Ir(S).hoistableStyles,y=h.get(o),y||(y={type:"style",instance:null,count:0,state:null},h.set(o,y)),y):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){a=Rd(h.href);var M=Ir(S).hoistableStyles,L=M.get(a);if(L||(S=S.ownerDocument||S,L={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},M.set(a,L),(M=S.querySelector(Ip(a)))&&!M._p&&(L.instance=M,L.state.loading=5),Ms.has(a)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},Ms.set(a,h),M||pO(S,a,h,L.state))),o&&y===null)throw Error(i(528,""));return L}if(o&&y!==null)throw Error(i(529,""));return null;case"script":return o=h.async,h=h.src,typeof h=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=Nd(h),h=Ir(S).hoistableScripts,y=h.get(o),y||(y={type:"script",instance:null,count:0,state:null},h.set(o,y)),y):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,a))}}function Rd(a){return'href="'+Di(a)+'"'}function Ip(a){return'link[rel="stylesheet"]['+a+"]"}function bS(a){return g({},a,{"data-precedence":a.precedence,precedence:null})}function pO(a,o,h,y){a.querySelector('link[rel="preload"][as="style"]['+o+"]")?y.loading=1:(o=a.createElement("link"),y.preload=o,o.addEventListener("load",function(){return y.loading|=1}),o.addEventListener("error",function(){return y.loading|=2}),gr(o,"link",h),Ln(o),a.head.appendChild(o))}function Nd(a){return'[src="'+Di(a)+'"]'}function jp(a){return"script[async]"+a}function xS(a,o,h){if(o.count++,o.instance===null)switch(o.type){case"style":var y=a.querySelector('style[data-href~="'+Di(h.href)+'"]');if(y)return o.instance=y,Ln(y),y;var S=g({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return y=(a.ownerDocument||a).createElement("style"),Ln(y),gr(y,"style",S),fy(y,h.precedence,a),o.instance=y;case"stylesheet":S=Rd(h.href);var M=a.querySelector(Ip(S));if(M)return o.state.loading|=4,o.instance=M,Ln(M),M;y=bS(h),(S=Ms.get(S))&&Kb(y,S),M=(a.ownerDocument||a).createElement("link"),Ln(M);var L=M;return L._p=new Promise(function(J,re){L.onload=J,L.onerror=re}),gr(M,"link",y),o.state.loading|=4,fy(M,h.precedence,a),o.instance=M;case"script":return M=Nd(h.src),(S=a.querySelector(jp(M)))?(o.instance=S,Ln(S),S):(y=h,(S=Ms.get(M))&&(y=g({},h),Wb(y,S)),a=a.ownerDocument||a,S=a.createElement("script"),Ln(S),gr(S,"link",y),a.head.appendChild(S),o.instance=S);case"void":return null;default:throw Error(i(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(y=o.instance,o.state.loading|=4,fy(y,h.precedence,a));return o.instance}function fy(a,o,h){for(var y=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),S=y.length?y[y.length-1]:null,M=S,L=0;L<y.length;L++){var J=y[L];if(J.dataset.precedence===o)M=J;else if(M!==S)break}M?M.parentNode.insertBefore(a,M.nextSibling):(o=h.nodeType===9?h.head:h,o.insertBefore(a,o.firstChild))}function Kb(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.title==null&&(a.title=o.title)}function Wb(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.integrity==null&&(a.integrity=o.integrity)}var dy=null;function vS(a,o,h){if(dy===null){var y=new Map,S=dy=new Map;S.set(h,y)}else S=dy,y=S.get(h),y||(y=new Map,S.set(h,y));if(y.has(a))return y;for(y.set(a,null),h=h.getElementsByTagName(a),S=0;S<h.length;S++){var M=h[S];if(!(M[Da]||M[yt]||a==="link"&&M.getAttribute("rel")==="stylesheet")&&M.namespaceURI!=="http://www.w3.org/2000/svg"){var L=M.getAttribute(o)||"";L=a+L;var J=y.get(L);J?J.push(M):y.set(L,[M])}}return y}function _S(a,o,h){a=a.ownerDocument||a,a.head.insertBefore(h,o==="title"?a.querySelector("head > title"):null)}function mO(a,o,h){if(h===1||o.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return a=o.disabled,typeof o.precedence=="string"&&a==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function SS(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function gO(a,o,h,y){if(h.type==="stylesheet"&&(typeof y.media!="string"||matchMedia(y.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var S=Rd(y.href),M=o.querySelector(Ip(S));if(M){o=M._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(a.count++,a=hy.bind(a),o.then(a,a)),h.state.loading|=4,h.instance=M,Ln(M);return}M=o.ownerDocument||o,y=bS(y),(S=Ms.get(S))&&Kb(y,S),M=M.createElement("link"),Ln(M);var L=M;L._p=new Promise(function(J,re){L.onload=J,L.onerror=re}),gr(M,"link",y),h.instance=M}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(h,o),(o=h.state.preload)&&(h.state.loading&3)===0&&(a.count++,h=hy.bind(a),o.addEventListener("load",h),o.addEventListener("error",h))}}var $b=0;function yO(a,o){return a.stylesheets&&a.count===0&&my(a,a.stylesheets),0<a.count||0<a.imgCount?function(h){var y=setTimeout(function(){if(a.stylesheets&&my(a,a.stylesheets),a.unsuspend){var M=a.unsuspend;a.unsuspend=null,M()}},6e4+o);0<a.imgBytes&&$b===0&&($b=62500*Zk());var S=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&my(a,a.stylesheets),a.unsuspend)){var M=a.unsuspend;a.unsuspend=null,M()}},(a.imgBytes>$b?50:800)+o);return a.unsuspend=h,function(){a.unsuspend=null,clearTimeout(y),clearTimeout(S)}}:null}function hy(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)my(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var py=null;function my(a,o){a.stylesheets=null,a.unsuspend!==null&&(a.count++,py=new Map,o.forEach(bO,a),py=null,hy.call(a))}function bO(a,o){if(!(o.state.loading&4)){var h=py.get(a);if(h)var y=h.get(null);else{h=new Map,py.set(a,h);for(var S=a.querySelectorAll("link[data-precedence],style[data-precedence]"),M=0;M<S.length;M++){var L=S[M];(L.nodeName==="LINK"||L.getAttribute("media")!=="not all")&&(h.set(L.dataset.precedence,L),y=L)}y&&h.set(null,y)}S=o.instance,L=S.getAttribute("data-precedence"),M=h.get(L)||y,M===y&&h.set(null,S),h.set(L,S),this.count++,y=hy.bind(this),S.addEventListener("load",y),S.addEventListener("error",y),M?M.parentNode.insertBefore(S,M.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(S,a.firstChild)),o.state.loading|=4}}var Hp={$$typeof:R,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function xO(a,o,h,y,S,M,L,J,re){this.tag=1,this.containerInfo=a,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=Jt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jt(0),this.hiddenUpdates=Jt(null),this.identifierPrefix=y,this.onUncaughtError=S,this.onCaughtError=M,this.onRecoverableError=L,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=re,this.incompleteTransitions=new Map}function ES(a,o,h,y,S,M,L,J,re,pe,Ee,Ae){return a=new xO(a,o,h,L,re,pe,Ee,Ae,J),o=1,M===!0&&(o|=24),M=ur(3,null,null,o),a.current=M,M.stateNode=a,o=Kh(),o.refCount++,a.pooledCache=o,o.refCount++,M.memoizedState={element:y,isDehydrated:h,cache:o},ep(M),a}function wS(a){return a?(a=Hl,a):Hl}function TS(a,o,h,y,S,M){S=wS(S),y.context===null?y.context=S:y.pendingContext=S,y=bs(o),y.payload={element:h},M=M===void 0?null:M,M!==null&&(y.callback=M),h=Zs(a,y,o),h!==null&&(f(h,a,o),Kl(h,a,o))}function CS(a,o){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var h=a.retryLane;a.retryLane=h!==0&&h<o?h:o}}function Zb(a,o){CS(a,o),(a=a.alternate)&&CS(a,o)}function AS(a){if(a.tag===13||a.tag===31){var o=jl(a,67108864);o!==null&&f(o,a,67108864),Zb(a,67108864)}}function MS(a){if(a.tag===13||a.tag===31){var o=mr();o=Gt(o);var h=jl(a,o);h!==null&&f(h,a,o),Zb(a,o)}}var gy=!0;function vO(a,o,h,y){var S=B.T;B.T=null;var M=X.p;try{X.p=2,Qb(a,o,h,y)}finally{X.p=M,B.T=S}}function _O(a,o,h,y){var S=B.T;B.T=null;var M=X.p;try{X.p=8,Qb(a,o,h,y)}finally{X.p=M,B.T=S}}function Qb(a,o,h,y){if(gy){var S=Jb(y);if(S===null)Ib(a,o,y,yy,h),NS(a,y);else if(EO(S,a,o,h,y))y.stopPropagation();else if(NS(a,y),o&4&&-1<SO.indexOf(a)){for(;S!==null;){var M=nn(S);if(M!==null)switch(M.tag){case 3:if(M=M.stateNode,M.current.memoizedState.isDehydrated){var L=bi(M.pendingLanes);if(L!==0){var J=M;for(J.pendingLanes|=2,J.entangledLanes|=2;L;){var re=1<<31-Pt(L);J.entanglements[1]|=re,L&=~re}io(M),(Ut&6)===0&&(na=hn()+500,zp(0))}}break;case 31:case 13:J=jl(M,2),J!==null&&f(J,M,2),ne(),Zb(M,2)}if(M=Jb(y),M===null&&Ib(a,o,y,yy,h),M===S)break;S=M}S!==null&&y.stopPropagation()}else Ib(a,o,y,null,h)}}function Jb(a){return a=mt(a),ex(a)}var yy=null;function ex(a){if(yy=null,a=tn(a),a!==null){var o=s(a);if(o===null)a=null;else{var h=o.tag;if(h===13){if(a=l(o),a!==null)return a;a=null}else if(h===31){if(a=c(o),a!==null)return a;a=null}else if(h===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;a=null}else o!==a&&(a=null)}}return yy=a,null}function RS(a){switch(a){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(ua()){case Se:return 2;case ke:return 8;case Je:case bt:return 32;case kt:return 268435456;default:return 32}default:return 32}}var tx=!1,Vc=null,Xc=null,Kc=null,Pp=new Map,Gp=new Map,Wc=[],SO="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 NS(a,o){switch(a){case"focusin":case"focusout":Vc=null;break;case"dragenter":case"dragleave":Xc=null;break;case"mouseover":case"mouseout":Kc=null;break;case"pointerover":case"pointerout":Pp.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gp.delete(o.pointerId)}}function Fp(a,o,h,y,S,M){return a===null||a.nativeEvent!==M?(a={blockedOn:o,domEventName:h,eventSystemFlags:y,nativeEvent:M,targetContainers:[S]},o!==null&&(o=nn(o),o!==null&&AS(o)),a):(a.eventSystemFlags|=y,o=a.targetContainers,S!==null&&o.indexOf(S)===-1&&o.push(S),a)}function EO(a,o,h,y,S){switch(o){case"focusin":return Vc=Fp(Vc,a,o,h,y,S),!0;case"dragenter":return Xc=Fp(Xc,a,o,h,y,S),!0;case"mouseover":return Kc=Fp(Kc,a,o,h,y,S),!0;case"pointerover":var M=S.pointerId;return Pp.set(M,Fp(Pp.get(M)||null,a,o,h,y,S)),!0;case"gotpointercapture":return M=S.pointerId,Gp.set(M,Fp(Gp.get(M)||null,a,o,h,y,S)),!0}return!1}function kS(a){var o=tn(a.target);if(o!==null){var h=s(o);if(h!==null){if(o=h.tag,o===13){if(o=l(h),o!==null){a.blockedOn=o,qi(a.priority,function(){MS(h)});return}}else if(o===31){if(o=c(h),o!==null){a.blockedOn=o,qi(a.priority,function(){MS(h)});return}}else if(o===3&&h.stateNode.current.memoizedState.isDehydrated){a.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}a.blockedOn=null}function by(a){if(a.blockedOn!==null)return!1;for(var o=a.targetContainers;0<o.length;){var h=Jb(a.nativeEvent);if(h===null){h=a.nativeEvent;var y=new h.constructor(h.type,h);qe=y,h.target.dispatchEvent(y),qe=null}else return o=nn(h),o!==null&&AS(o),a.blockedOn=h,!1;o.shift()}return!0}function OS(a,o,h){by(a)&&h.delete(o)}function wO(){tx=!1,Vc!==null&&by(Vc)&&(Vc=null),Xc!==null&&by(Xc)&&(Xc=null),Kc!==null&&by(Kc)&&(Kc=null),Pp.forEach(OS),Gp.forEach(OS)}function xy(a,o){a.blockedOn===o&&(a.blockedOn=null,tx||(tx=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,wO)))}var vy=null;function DS(a){vy!==a&&(vy=a,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){vy===a&&(vy=null);for(var o=0;o<a.length;o+=3){var h=a[o],y=a[o+1],S=a[o+2];if(typeof y!="function"){if(ex(y||h)===null)continue;break}var M=nn(h);M!==null&&(a.splice(o,3),o-=3,Tp(M,{pending:!0,data:S,method:h.method,action:y},y,S))}}))}function kd(a){function o(re){return xy(re,a)}Vc!==null&&xy(Vc,a),Xc!==null&&xy(Xc,a),Kc!==null&&xy(Kc,a),Pp.forEach(o),Gp.forEach(o);for(var h=0;h<Wc.length;h++){var y=Wc[h];y.blockedOn===a&&(y.blockedOn=null)}for(;0<Wc.length&&(h=Wc[0],h.blockedOn===null);)kS(h),h.blockedOn===null&&Wc.shift();if(h=(a.ownerDocument||a).$$reactFormReplay,h!=null)for(y=0;y<h.length;y+=3){var S=h[y],M=h[y+1],L=S[li]||null;if(typeof M=="function")L||DS(h);else if(L){var J=null;if(M&&M.hasAttribute("formAction")){if(S=M,L=M[li]||null)J=L.formAction;else if(ex(S)!==null)continue}else J=L.action;typeof J=="function"?h[y+1]=J:(h.splice(y,3),y-=3),DS(h)}}}function zS(){function a(M){M.canIntercept&&M.info==="react-transition"&&M.intercept({handler:function(){return new Promise(function(L){return S=L})},focusReset:"manual",scroll:"manual"})}function o(){S!==null&&(S(),S=null),y||setTimeout(h,20)}function h(){if(!y&&!navigation.transition){var M=navigation.currentEntry;M&&M.url!=null&&navigation.navigate(M.url,{state:M.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var y=!1,S=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(h,100),function(){y=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),S!==null&&(S(),S=null)}}}function nx(a){this._internalRoot=a}_y.prototype.render=nx.prototype.render=function(a){var o=this._internalRoot;if(o===null)throw Error(i(409));var h=o.current,y=mr();TS(h,y,a,o,null,null)},_y.prototype.unmount=nx.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var o=a.containerInfo;TS(a.current,2,null,a,null,null),ne(),o[Ur]=null}};function _y(a){this._internalRoot=a}_y.prototype.unstable_scheduleHydration=function(a){if(a){var o=ar();a={blockedOn:null,target:a,priority:o};for(var h=0;h<Wc.length&&o!==0&&o<Wc[h].priority;h++);Wc.splice(h,0,a),h===0&&kS(a)}};var BS=e.version;if(BS!=="19.2.4")throw Error(i(527,BS,"19.2.4"));X.findDOMNode=function(a){var o=a._reactInternals;if(o===void 0)throw typeof a.render=="function"?Error(i(188)):(a=Object.keys(a).join(","),Error(i(268,a)));return a=p(o),a=a!==null?m(a):null,a=a===null?null:a.stateNode,a};var TO={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Sy=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Sy.isDisabled&&Sy.supportsFiber)try{xn=Sy.inject(TO),$t=Sy}catch{}}return Yp.createRoot=function(a,o){if(!r(a))throw Error(i(299));var h=!1,y="",S=Rp,M=ey,L=pd;return o!=null&&(o.unstable_strictMode===!0&&(h=!0),o.identifierPrefix!==void 0&&(y=o.identifierPrefix),o.onUncaughtError!==void 0&&(S=o.onUncaughtError),o.onCaughtError!==void 0&&(M=o.onCaughtError),o.onRecoverableError!==void 0&&(L=o.onRecoverableError)),o=ES(a,1,!1,null,null,h,y,null,S,M,L,zS),a[Ur]=o.current,Ub(a),new nx(o)},Yp.hydrateRoot=function(a,o,h){if(!r(a))throw Error(i(299));var y=!1,S="",M=Rp,L=ey,J=pd,re=null;return h!=null&&(h.unstable_strictMode===!0&&(y=!0),h.identifierPrefix!==void 0&&(S=h.identifierPrefix),h.onUncaughtError!==void 0&&(M=h.onUncaughtError),h.onCaughtError!==void 0&&(L=h.onCaughtError),h.onRecoverableError!==void 0&&(J=h.onRecoverableError),h.formState!==void 0&&(re=h.formState)),o=ES(a,1,!0,o,h??null,y,S,re,M,L,J,zS),o.context=wS(null),h=o.current,y=mr(),y=Gt(y),S=bs(y),S.callback=null,Zs(h,S,y),h=y,o.current.lanes=h,en(o,h),io(o),a[Ur]=o.current,Ub(a),new _y(o)},Yp.version="19.2.4",Yp}var VS;function LO(){if(VS)return ax.exports;VS=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),ax.exports=BO(),ax.exports}var UO=LO();/**
|
|
51
|
+
* react-router v7.13.1
|
|
52
|
+
*
|
|
53
|
+
* Copyright (c) Remix Software Inc.
|
|
54
|
+
*
|
|
55
|
+
* This source code is licensed under the MIT license found in the
|
|
56
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
57
|
+
*
|
|
58
|
+
* @license MIT
|
|
59
|
+
*/var XS="popstate";function KS(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function IO(t={}){function e(i,r){var p;let s=(p=r.state)==null?void 0:p.masked,{pathname:l,search:c,hash:d}=s||i.location;return Nv("",{pathname:l,search:c,hash:d},r.state&&r.state.usr||null,r.state&&r.state.key||"default",s?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function n(i,r){return typeof r=="string"?r:Am(r)}return HO(e,n,null,t)}function Wn(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function xl(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function jO(){return Math.random().toString(36).substring(2,10)}function WS(t,e){return{usr:t.state,key:t.key,idx:e,masked:t.unstable_mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function Nv(t,e,n=null,i,r){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?bh(e):e,state:n,key:e&&e.key||i||jO(),unstable_mask:r}}function Am({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function bh(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let i=t.indexOf("?");i>=0&&(e.search=t.substring(i),t=t.substring(0,i)),t&&(e.pathname=t)}return e}function HO(t,e,n,i={}){let{window:r=document.defaultView,v5Compat:s=!1}=i,l=r.history,c="POP",d=null,p=m();p==null&&(p=0,l.replaceState({...l.state,idx:p},""));function m(){return(l.state||{idx:null}).idx}function g(){c="POP";let T=m(),w=T==null?null:T-p;p=T,d&&d({action:c,location:C.location,delta:w})}function b(T,w){c="PUSH";let k=KS(T)?T:Nv(C.location,T,w);p=m()+1;let R=WS(k,p),O=C.createHref(k.unstable_mask||k);try{l.pushState(R,"",O)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;r.location.assign(O)}s&&d&&d({action:c,location:C.location,delta:1})}function v(T,w){c="REPLACE";let k=KS(T)?T:Nv(C.location,T,w);p=m();let R=WS(k,p),O=C.createHref(k.unstable_mask||k);l.replaceState(R,"",O),s&&d&&d({action:c,location:C.location,delta:0})}function _(T){return PO(T)}let C={get action(){return c},get location(){return t(r,l)},listen(T){if(d)throw new Error("A history only accepts one active listener");return r.addEventListener(XS,g),d=T,()=>{r.removeEventListener(XS,g),d=null}},createHref(T){return e(r,T)},createURL:_,encodeLocation(T){let w=_(T);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:b,replace:v,go(T){return l.go(T)}};return C}function PO(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Wn(n,"No window.location.(origin|href) available to create URL");let i=typeof t=="string"?t:Am(t);return i=i.replace(/ $/,"%20"),!e&&i.startsWith("//")&&(i=n+i),new URL(i,n)}function dC(t,e,n="/"){return GO(t,e,n,!1)}function GO(t,e,n,i){let r=typeof e=="string"?bh(e):e,s=rc(r.pathname||"/",n);if(s==null)return null;let l=hC(t);FO(l);let c=null;for(let d=0;c==null&&d<l.length;++d){let p=e3(s);c=QO(l[d],p,i)}return c}function hC(t,e=[],n=[],i="",r=!1){let s=(l,c,d=r,p)=>{let m={relativePath:p===void 0?l.path||"":p,caseSensitive:l.caseSensitive===!0,childrenIndex:c,route:l};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(i)&&d)return;Wn(m.relativePath.startsWith(i),`Absolute route path "${m.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(i.length)}let g=fo([i,m.relativePath]),b=n.concat(m);l.children&&l.children.length>0&&(Wn(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),hC(l.children,e,b,g,d)),!(l.path==null&&!l.index)&&e.push({path:g,score:$O(g,l.index),routesMeta:b})};return t.forEach((l,c)=>{var d;if(l.path===""||!((d=l.path)!=null&&d.includes("?")))s(l,c);else for(let p of pC(l.path))s(l,c,!0,p)}),e}function pC(t){let e=t.split("/");if(e.length===0)return[];let[n,...i]=e,r=n.endsWith("?"),s=n.replace(/\?$/,"");if(i.length===0)return r?[s,""]:[s];let l=pC(i.join("/")),c=[];return c.push(...l.map(d=>d===""?s:[s,d].join("/"))),r&&c.push(...l),c.map(d=>t.startsWith("/")&&d===""?"/":d)}function FO(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:ZO(e.routesMeta.map(i=>i.childrenIndex),n.routesMeta.map(i=>i.childrenIndex)))}var qO=/^:[\w-]+$/,YO=3,VO=2,XO=1,KO=10,WO=-2,$S=t=>t==="*";function $O(t,e){let n=t.split("/"),i=n.length;return n.some($S)&&(i+=WO),e&&(i+=VO),n.filter(r=>!$S(r)).reduce((r,s)=>r+(qO.test(s)?YO:s===""?XO:KO),i)}function ZO(t,e){return t.length===e.length&&t.slice(0,-1).every((i,r)=>i===e[r])?t[t.length-1]-e[e.length-1]:0}function QO(t,e,n=!1){let{routesMeta:i}=t,r={},s="/",l=[];for(let c=0;c<i.length;++c){let d=i[c],p=c===i.length-1,m=s==="/"?e:e.slice(s.length)||"/",g=_0({path:d.relativePath,caseSensitive:d.caseSensitive,end:p},m),b=d.route;if(!g&&p&&n&&!i[i.length-1].route.index&&(g=_0({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},m)),!g)return null;Object.assign(r,g.params),l.push({params:r,pathname:fo([s,g.pathname]),pathnameBase:r3(fo([s,g.pathnameBase])),route:b}),g.pathnameBase!=="/"&&(s=fo([s,g.pathnameBase]))}return l}function _0(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,i]=JO(t.path,t.caseSensitive,t.end),r=e.match(n);if(!r)return null;let s=r[0],l=s.replace(/(.)\/+$/,"$1"),c=r.slice(1);return{params:i.reduce((p,{paramName:m,isOptional:g},b)=>{if(m==="*"){let _=c[b]||"";l=s.slice(0,s.length-_.length).replace(/(.)\/+$/,"$1")}const v=c[b];return g&&!v?p[m]=void 0:p[m]=(v||"").replace(/%2F/g,"/"),p},{}),pathname:s,pathnameBase:l,pattern:t}}function JO(t,e=!1,n=!0){xl(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let i=[],r="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,c,d,p,m)=>{if(i.push({paramName:c,isOptional:d!=null}),d){let g=m.charAt(p+l.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(i.push({paramName:"*"}),r+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":t!==""&&t!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),i]}function e3(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return xl(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function rc(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,i=t.charAt(n);return i&&i!=="/"?null:t.slice(n)||"/"}var t3=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function n3(t,e="/"){let{pathname:n,search:i="",hash:r=""}=typeof t=="string"?bh(t):t,s;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?s=ZS(n.substring(1),"/"):s=ZS(n,e)):s=e,{pathname:s,search:a3(i),hash:s3(r)}}function ZS(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function cx(t,e,n,i){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function i3(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function B_(t){let e=i3(t);return e.map((n,i)=>i===e.length-1?n.pathname:n.pathnameBase)}function X0(t,e,n,i=!1){let r;typeof t=="string"?r=bh(t):(r={...t},Wn(!r.pathname||!r.pathname.includes("?"),cx("?","pathname","search",r)),Wn(!r.pathname||!r.pathname.includes("#"),cx("#","pathname","hash",r)),Wn(!r.search||!r.search.includes("#"),cx("#","search","hash",r)));let s=t===""||r.pathname==="",l=s?"/":r.pathname,c;if(l==null)c=n;else{let g=e.length-1;if(!i&&l.startsWith("..")){let b=l.split("/");for(;b[0]==="..";)b.shift(),g-=1;r.pathname=b.join("/")}c=g>=0?e[g]:"/"}let d=n3(r,c),p=l&&l!=="/"&&l.endsWith("/"),m=(s||l===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(p||m)&&(d.pathname+="/"),d}var fo=t=>t.join("/").replace(/\/\/+/g,"/"),r3=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),a3=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,s3=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,l3=class{constructor(t,e,n,i=!1){this.status=t,this.statusText=e||"",this.internal=i,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function o3(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function c3(t){return t.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var mC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function gC(t,e){let n=t;if(typeof n!="string"||!t3.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let i=n,r=!1;if(mC)try{let s=new URL(window.location.href),l=n.startsWith("//")?new URL(s.protocol+n):new URL(n),c=rc(l.pathname,e);l.origin===s.origin&&c!=null?n=c+l.search+l.hash:r=!0}catch{xl(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:r,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var yC=["POST","PUT","PATCH","DELETE"];new Set(yC);var u3=["GET",...yC];new Set(u3);var xh=U.createContext(null);xh.displayName="DataRouter";var K0=U.createContext(null);K0.displayName="DataRouterState";var f3=U.createContext(!1),bC=U.createContext({isTransitioning:!1});bC.displayName="ViewTransition";var d3=U.createContext(new Map);d3.displayName="Fetchers";var h3=U.createContext(null);h3.displayName="Await";var rs=U.createContext(null);rs.displayName="Navigation";var Ym=U.createContext(null);Ym.displayName="Location";var vl=U.createContext({outlet:null,matches:[],isDataRoute:!1});vl.displayName="Route";var L_=U.createContext(null);L_.displayName="RouteError";var xC="REACT_ROUTER_ERROR",p3="REDIRECT",m3="ROUTE_ERROR_RESPONSE";function g3(t){if(t.startsWith(`${xC}:${p3}:{`))try{let e=JSON.parse(t.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function y3(t){if(t.startsWith(`${xC}:${m3}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new l3(e.status,e.statusText,e.data)}catch{}}function b3(t,{relative:e}={}){Wn(vh(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:i}=U.useContext(rs),{hash:r,pathname:s,search:l}=Vm(t,{relative:e}),c=s;return n!=="/"&&(c=s==="/"?n:fo([n,s])),i.createHref({pathname:c,search:l,hash:r})}function vh(){return U.useContext(Ym)!=null}function _l(){return Wn(vh(),"useLocation() may be used only in the context of a <Router> component."),U.useContext(Ym).location}var vC="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function _C(t){U.useContext(rs).static||U.useLayoutEffect(t)}function W0(){let{isDataRoute:t}=U.useContext(vl);return t?D3():x3()}function x3(){Wn(vh(),"useNavigate() may be used only in the context of a <Router> component.");let t=U.useContext(xh),{basename:e,navigator:n}=U.useContext(rs),{matches:i}=U.useContext(vl),{pathname:r}=_l(),s=JSON.stringify(B_(i)),l=U.useRef(!1);return _C(()=>{l.current=!0}),U.useCallback((d,p={})=>{if(xl(l.current,vC),!l.current)return;if(typeof d=="number"){n.go(d);return}let m=X0(d,JSON.parse(s),r,p.relative==="path");t==null&&e!=="/"&&(m.pathname=m.pathname==="/"?e:fo([e,m.pathname])),(p.replace?n.replace:n.push)(m,p.state,p)},[e,n,s,r,t])}var v3=U.createContext(null);function _3(t){let e=U.useContext(vl).outlet;return U.useMemo(()=>e&&U.createElement(v3.Provider,{value:t},e),[e,t])}function Vm(t,{relative:e}={}){let{matches:n}=U.useContext(vl),{pathname:i}=_l(),r=JSON.stringify(B_(n));return U.useMemo(()=>X0(t,JSON.parse(r),i,e==="path"),[t,r,i,e])}function S3(t,e){return SC(t,e)}function SC(t,e,n){var T;Wn(vh(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=U.useContext(rs),{matches:r}=U.useContext(vl),s=r[r.length-1],l=s?s.params:{},c=s?s.pathname:"/",d=s?s.pathnameBase:"/",p=s&&s.route;{let w=p&&p.path||"";wC(c,!p||w.endsWith("*")||w.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${w}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
60
|
+
|
|
61
|
+
Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}/*`}">.`)}let m=_l(),g;if(e){let w=typeof e=="string"?bh(e):e;Wn(d==="/"||((T=w.pathname)==null?void 0:T.startsWith(d)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${w.pathname}" was given in the \`location\` prop.`),g=w}else g=m;let b=g.pathname||"/",v=b;if(d!=="/"){let w=d.replace(/^\//,"").split("/");v="/"+b.replace(/^\//,"").split("/").slice(w.length).join("/")}let _=dC(t,{pathname:v});xl(p||_!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),xl(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let C=A3(_&&_.map(w=>Object.assign({},w,{params:Object.assign({},l,w.params),pathname:fo([d,i.encodeLocation?i.encodeLocation(w.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?d:fo([d,i.encodeLocation?i.encodeLocation(w.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathnameBase])})),r,n);return e&&C?U.createElement(Ym.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},C):C}function E3(){let t=O3(),e=o3(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:i},s={padding:"2px 4px",backgroundColor:i},l=null;return console.error("Error handled by React Router default ErrorBoundary:",t),l=U.createElement(U.Fragment,null,U.createElement("p",null,"💿 Hey developer 👋"),U.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",U.createElement("code",{style:s},"ErrorBoundary")," or"," ",U.createElement("code",{style:s},"errorElement")," prop on your route.")),U.createElement(U.Fragment,null,U.createElement("h2",null,"Unexpected Application Error!"),U.createElement("h3",{style:{fontStyle:"italic"}},e),n?U.createElement("pre",{style:r},n):null,l)}var w3=U.createElement(E3,null),EC=class extends U.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const n=y3(t.digest);n&&(t=n)}let e=t!==void 0?U.createElement(vl.Provider,{value:this.props.routeContext},U.createElement(L_.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?U.createElement(T3,{error:t},e):e}};EC.contextType=f3;var ux=new WeakMap;function T3({children:t,error:e}){let{basename:n}=U.useContext(rs);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let i=g3(e.digest);if(i){let r=ux.get(e);if(r)throw r;let s=gC(i.location,n);if(mC&&!ux.get(e))if(s.isExternal||i.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:i.replace}));throw ux.set(e,l),l}return U.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return t}function C3({routeContext:t,match:e,children:n}){let i=U.useContext(xh);return i&&i.static&&i.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=e.route.id),U.createElement(vl.Provider,{value:t},n)}function A3(t,e=[],n){let i=n==null?void 0:n.state;if(t==null){if(!i)return null;if(i.errors)t=i.matches;else if(e.length===0&&!i.initialized&&i.matches.length>0)t=i.matches;else return null}let r=t,s=i==null?void 0:i.errors;if(s!=null){let m=r.findIndex(g=>g.route.id&&(s==null?void 0:s[g.route.id])!==void 0);Wn(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),r=r.slice(0,Math.min(r.length,m+1))}let l=!1,c=-1;if(n&&i){l=i.renderFallback;for(let m=0;m<r.length;m++){let g=r[m];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(c=m),g.route.id){let{loaderData:b,errors:v}=i,_=g.route.loader&&!b.hasOwnProperty(g.route.id)&&(!v||v[g.route.id]===void 0);if(g.route.lazy||_){n.isStatic&&(l=!0),c>=0?r=r.slice(0,c+1):r=[r[0]];break}}}}let d=n==null?void 0:n.onError,p=i&&d?(m,g)=>{var b,v;d(m,{location:i.location,params:((v=(b=i.matches)==null?void 0:b[0])==null?void 0:v.params)??{},unstable_pattern:c3(i.matches),errorInfo:g})}:void 0;return r.reduceRight((m,g,b)=>{let v,_=!1,C=null,T=null;i&&(v=s&&g.route.id?s[g.route.id]:void 0,C=g.route.errorElement||w3,l&&(c<0&&b===0?(wC("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),_=!0,T=null):c===b&&(_=!0,T=g.route.hydrateFallbackElement||null)));let w=e.concat(r.slice(0,b+1)),k=()=>{let R;return v?R=C:_?R=T:g.route.Component?R=U.createElement(g.route.Component,null):g.route.element?R=g.route.element:R=m,U.createElement(C3,{match:g,routeContext:{outlet:m,matches:w,isDataRoute:i!=null},children:R})};return i&&(g.route.ErrorBoundary||g.route.errorElement||b===0)?U.createElement(EC,{location:i.location,revalidation:i.revalidation,component:C,error:v,children:k(),routeContext:{outlet:null,matches:w,isDataRoute:!0},onError:p}):k()},null)}function U_(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function M3(t){let e=U.useContext(xh);return Wn(e,U_(t)),e}function R3(t){let e=U.useContext(K0);return Wn(e,U_(t)),e}function N3(t){let e=U.useContext(vl);return Wn(e,U_(t)),e}function I_(t){let e=N3(t),n=e.matches[e.matches.length-1];return Wn(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function k3(){return I_("useRouteId")}function O3(){var i;let t=U.useContext(L_),e=R3("useRouteError"),n=I_("useRouteError");return t!==void 0?t:(i=e.errors)==null?void 0:i[n]}function D3(){let{router:t}=M3("useNavigate"),e=I_("useNavigate"),n=U.useRef(!1);return _C(()=>{n.current=!0}),U.useCallback(async(r,s={})=>{xl(n.current,vC),n.current&&(typeof r=="number"?await t.navigate(r):await t.navigate(r,{fromRouteId:e,...s}))},[t,e])}var QS={};function wC(t,e,n){!e&&!QS[t]&&(QS[t]=!0,xl(!1,n))}U.memo(z3);function z3({routes:t,future:e,state:n,isStatic:i,onError:r}){return SC(t,void 0,{state:n,isStatic:i,onError:r})}function B3({to:t,replace:e,state:n,relative:i}){Wn(vh(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=U.useContext(rs);xl(!r,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=U.useContext(vl),{pathname:l}=_l(),c=W0(),d=X0(t,B_(s),l,i==="path"),p=JSON.stringify(d);return U.useEffect(()=>{c(JSON.parse(p),{replace:e,state:n,relative:i})},[c,p,i,e,n]),null}function JS(t){return _3(t.context)}function wa(t){Wn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function L3({basename:t="/",children:e=null,location:n,navigationType:i="POP",navigator:r,static:s=!1,unstable_useTransitions:l}){Wn(!vh(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=t.replace(/^\/*/,"/"),d=U.useMemo(()=>({basename:c,navigator:r,static:s,unstable_useTransitions:l,future:{}}),[c,r,s,l]);typeof n=="string"&&(n=bh(n));let{pathname:p="/",search:m="",hash:g="",state:b=null,key:v="default",unstable_mask:_}=n,C=U.useMemo(()=>{let T=rc(p,c);return T==null?null:{location:{pathname:T,search:m,hash:g,state:b,key:v,unstable_mask:_},navigationType:i}},[c,p,m,g,b,v,i,_]);return xl(C!=null,`<Router basename="${c}"> is not able to match the URL "${p}${m}${g}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:U.createElement(rs.Provider,{value:d},U.createElement(Ym.Provider,{children:e,value:C}))}function U3({children:t,location:e}){return S3(kv(t),e)}function kv(t,e=[]){let n=[];return U.Children.forEach(t,(i,r)=>{if(!U.isValidElement(i))return;let s=[...e,r];if(i.type===U.Fragment){n.push.apply(n,kv(i.props.children,s));return}Wn(i.type===wa,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Wn(!i.props.index||!i.props.children,"An index route cannot have child routes.");let l={id:i.props.id||s.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(l.children=kv(i.props.children,s)),n.push(l)}),n}var u0="get",f0="application/x-www-form-urlencoded";function $0(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function I3(t){return $0(t)&&t.tagName.toLowerCase()==="button"}function j3(t){return $0(t)&&t.tagName.toLowerCase()==="form"}function H3(t){return $0(t)&&t.tagName.toLowerCase()==="input"}function P3(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function G3(t,e){return t.button===0&&(!e||e==="_self")&&!P3(t)}var Ey=null;function F3(){if(Ey===null)try{new FormData(document.createElement("form"),0),Ey=!1}catch{Ey=!0}return Ey}var q3=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function fx(t){return t!=null&&!q3.has(t)?(xl(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${f0}"`),null):t}function Y3(t,e){let n,i,r,s,l;if(j3(t)){let c=t.getAttribute("action");i=c?rc(c,e):null,n=t.getAttribute("method")||u0,r=fx(t.getAttribute("enctype"))||f0,s=new FormData(t)}else if(I3(t)||H3(t)&&(t.type==="submit"||t.type==="image")){let c=t.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=t.getAttribute("formaction")||c.getAttribute("action");if(i=d?rc(d,e):null,n=t.getAttribute("formmethod")||c.getAttribute("method")||u0,r=fx(t.getAttribute("formenctype"))||fx(c.getAttribute("enctype"))||f0,s=new FormData(c,t),!F3()){let{name:p,type:m,value:g}=t;if(m==="image"){let b=p?`${p}.`:"";s.append(`${b}x`,"0"),s.append(`${b}y`,"0")}else p&&s.append(p,g)}}else{if($0(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=u0,i=null,r=f0,l=t}return s&&r==="text/plain"&&(l=s,s=void 0),{action:i,method:n.toLowerCase(),encType:r,formData:s,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function j_(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function V3(t,e,n,i){let r=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return n?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${i}`:r.pathname=`${r.pathname}.${i}`:r.pathname==="/"?r.pathname=`_root.${i}`:e&&rc(r.pathname,e)==="/"?r.pathname=`${e.replace(/\/$/,"")}/_root.${i}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${i}`,r}async function X3(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function K3(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function W3(t,e,n){let i=await Promise.all(t.map(async r=>{let s=e.routes[r.route.id];if(s){let l=await X3(s,n);return l.links?l.links():[]}return[]}));return J3(i.flat(1).filter(K3).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function eE(t,e,n,i,r,s){let l=(d,p)=>n[p]?d.route.id!==n[p].route.id:!0,c=(d,p)=>{var m;return n[p].pathname!==d.pathname||((m=n[p].route.path)==null?void 0:m.endsWith("*"))&&n[p].params["*"]!==d.params["*"]};return s==="assets"?e.filter((d,p)=>l(d,p)||c(d,p)):s==="data"?e.filter((d,p)=>{var g;let m=i.routes[d.route.id];if(!m||!m.hasLoader)return!1;if(l(d,p)||c(d,p))return!0;if(d.route.shouldRevalidate){let b=d.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(t,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function $3(t,e,{includeHydrateFallback:n}={}){return Z3(t.map(i=>{let r=e.routes[i.route.id];if(!r)return[];let s=[r.module];return r.clientActionModule&&(s=s.concat(r.clientActionModule)),r.clientLoaderModule&&(s=s.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(s=s.concat(r.hydrateFallbackModule)),r.imports&&(s=s.concat(r.imports)),s}).flat(1))}function Z3(t){return[...new Set(t)]}function Q3(t){let e={},n=Object.keys(t).sort();for(let i of n)e[i]=t[i];return e}function J3(t,e){let n=new Set;return new Set(e),t.reduce((i,r)=>{let s=JSON.stringify(Q3(r));return n.has(s)||(n.add(s),i.push({key:s,link:r})),i},[])}function TC(){let t=U.useContext(xh);return j_(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function eD(){let t=U.useContext(K0);return j_(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var H_=U.createContext(void 0);H_.displayName="FrameworkContext";function CC(){let t=U.useContext(H_);return j_(t,"You must render this element inside a <HydratedRouter> element"),t}function tD(t,e){let n=U.useContext(H_),[i,r]=U.useState(!1),[s,l]=U.useState(!1),{onFocus:c,onBlur:d,onMouseEnter:p,onMouseLeave:m,onTouchStart:g}=e,b=U.useRef(null);U.useEffect(()=>{if(t==="render"&&l(!0),t==="viewport"){let C=w=>{w.forEach(k=>{l(k.isIntersecting)})},T=new IntersectionObserver(C,{threshold:.5});return b.current&&T.observe(b.current),()=>{T.disconnect()}}},[t]),U.useEffect(()=>{if(i){let C=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(C)}}},[i]);let v=()=>{r(!0)},_=()=>{r(!1),l(!1)};return n?t!=="intent"?[s,b,{}]:[s,b,{onFocus:Vp(c,v),onBlur:Vp(d,_),onMouseEnter:Vp(p,v),onMouseLeave:Vp(m,_),onTouchStart:Vp(g,v)}]:[!1,b,{}]}function Vp(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function nD({page:t,...e}){let{router:n}=TC(),i=U.useMemo(()=>dC(n.routes,t,n.basename),[n.routes,t,n.basename]);return i?U.createElement(rD,{page:t,matches:i,...e}):null}function iD(t){let{manifest:e,routeModules:n}=CC(),[i,r]=U.useState([]);return U.useEffect(()=>{let s=!1;return W3(t,e,n).then(l=>{s||r(l)}),()=>{s=!0}},[t,e,n]),i}function rD({page:t,matches:e,...n}){let i=_l(),{future:r,manifest:s,routeModules:l}=CC(),{basename:c}=TC(),{loaderData:d,matches:p}=eD(),m=U.useMemo(()=>eE(t,e,p,s,i,"data"),[t,e,p,s,i]),g=U.useMemo(()=>eE(t,e,p,s,i,"assets"),[t,e,p,s,i]),b=U.useMemo(()=>{if(t===i.pathname+i.search+i.hash)return[];let C=new Set,T=!1;if(e.forEach(k=>{var O;let R=s.routes[k.route.id];!R||!R.hasLoader||(!m.some(j=>j.route.id===k.route.id)&&k.route.id in d&&((O=l[k.route.id])!=null&&O.shouldRevalidate)||R.hasClientLoader?T=!0:C.add(k.route.id))}),C.size===0)return[];let w=V3(t,c,r.unstable_trailingSlashAwareDataRequests,"data");return T&&C.size>0&&w.searchParams.set("_routes",e.filter(k=>C.has(k.route.id)).map(k=>k.route.id).join(",")),[w.pathname+w.search]},[c,r.unstable_trailingSlashAwareDataRequests,d,i,s,m,e,t,l]),v=U.useMemo(()=>$3(g,s),[g,s]),_=iD(g);return U.createElement(U.Fragment,null,b.map(C=>U.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...n})),v.map(C=>U.createElement("link",{key:C,rel:"modulepreload",href:C,...n})),_.map(({key:C,link:T})=>U.createElement("link",{key:C,nonce:n.nonce,...T,crossOrigin:T.crossOrigin??n.crossOrigin})))}function aD(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var sD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{sD&&(window.__reactRouterVersion="7.13.1")}catch{}function lD({basename:t,children:e,unstable_useTransitions:n,window:i}){let r=U.useRef();r.current==null&&(r.current=IO({window:i,v5Compat:!0}));let s=r.current,[l,c]=U.useState({action:s.action,location:s.location}),d=U.useCallback(p=>{n===!1?c(p):U.startTransition(()=>c(p))},[n]);return U.useLayoutEffect(()=>s.listen(d),[s,d]),U.createElement(L3,{basename:t,children:e,location:l.location,navigationType:l.action,navigator:s,unstable_useTransitions:n})}var AC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,MC=U.forwardRef(function({onClick:e,discover:n="render",prefetch:i="none",relative:r,reloadDocument:s,replace:l,unstable_mask:c,state:d,target:p,to:m,preventScrollReset:g,viewTransition:b,unstable_defaultShouldRevalidate:v,..._},C){let{basename:T,navigator:w,unstable_useTransitions:k}=U.useContext(rs),R=typeof m=="string"&&AC.test(m),O=gC(m,T);m=O.to;let j=b3(m,{relative:r}),D=_l(),F=null;if(c){let W=X0(c,[],D.unstable_mask?D.unstable_mask.pathname:"/",!0);T!=="/"&&(W.pathname=W.pathname==="/"?T:fo([T,W.pathname])),F=w.createHref(W)}let[$,P,I]=tD(i,_),K=uD(m,{replace:l,unstable_mask:c,state:d,target:p,preventScrollReset:g,relative:r,viewTransition:b,unstable_defaultShouldRevalidate:v,unstable_useTransitions:k});function G(W){e&&e(W),W.defaultPrevented||K(W)}let te=!(O.isExternal||s),H=U.createElement("a",{..._,...I,href:(te?F:void 0)||O.absoluteURL||j,onClick:te?G:e,ref:aD(C,P),target:p,"data-discover":!R&&n==="render"?"true":void 0});return $&&!R?U.createElement(U.Fragment,null,H,U.createElement(nD,{page:j})):H});MC.displayName="Link";var RC=U.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:i="",end:r=!1,style:s,to:l,viewTransition:c,children:d,...p},m){let g=Vm(l,{relative:p.relative}),b=_l(),v=U.useContext(K0),{navigator:_,basename:C}=U.useContext(rs),T=v!=null&&mD(g)&&c===!0,w=_.encodeLocation?_.encodeLocation(g).pathname:g.pathname,k=b.pathname,R=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(k=k.toLowerCase(),R=R?R.toLowerCase():null,w=w.toLowerCase()),R&&C&&(R=rc(R,C)||R);const O=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let j=k===w||!r&&k.startsWith(w)&&k.charAt(O)==="/",D=R!=null&&(R===w||!r&&R.startsWith(w)&&R.charAt(w.length)==="/"),F={isActive:j,isPending:D,isTransitioning:T},$=j?e:void 0,P;typeof i=="function"?P=i(F):P=[i,j?"active":null,D?"pending":null,T?"transitioning":null].filter(Boolean).join(" ");let I=typeof s=="function"?s(F):s;return U.createElement(MC,{...p,"aria-current":$,className:P,ref:m,style:I,to:l,viewTransition:c},typeof d=="function"?d(F):d)});RC.displayName="NavLink";var oD=U.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:i,replace:r,state:s,method:l=u0,action:c,onSubmit:d,relative:p,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:b,...v},_)=>{let{unstable_useTransitions:C}=U.useContext(rs),T=hD(),w=pD(c,{relative:p}),k=l.toLowerCase()==="get"?"get":"post",R=typeof c=="string"&&AC.test(c),O=j=>{if(d&&d(j),j.defaultPrevented)return;j.preventDefault();let D=j.nativeEvent.submitter,F=(D==null?void 0:D.getAttribute("formmethod"))||l,$=()=>T(D||j.currentTarget,{fetcherKey:e,method:F,navigate:n,replace:r,state:s,relative:p,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:b});C&&n!==!1?U.startTransition(()=>$()):$()};return U.createElement("form",{ref:_,method:k,action:w,onSubmit:i?d:O,...v,"data-discover":!R&&t==="render"?"true":void 0})});oD.displayName="Form";function cD(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function NC(t){let e=U.useContext(xh);return Wn(e,cD(t)),e}function uD(t,{target:e,replace:n,unstable_mask:i,state:r,preventScrollReset:s,relative:l,viewTransition:c,unstable_defaultShouldRevalidate:d,unstable_useTransitions:p}={}){let m=W0(),g=_l(),b=Vm(t,{relative:l});return U.useCallback(v=>{if(G3(v,e)){v.preventDefault();let _=n!==void 0?n:Am(g)===Am(b),C=()=>m(t,{replace:_,unstable_mask:i,state:r,preventScrollReset:s,relative:l,viewTransition:c,unstable_defaultShouldRevalidate:d});p?U.startTransition(()=>C()):C()}},[g,m,b,n,i,r,e,t,s,l,c,d,p])}var fD=0,dD=()=>`__${String(++fD)}__`;function hD(){let{router:t}=NC("useSubmit"),{basename:e}=U.useContext(rs),n=k3(),i=t.fetch,r=t.navigate;return U.useCallback(async(s,l={})=>{let{action:c,method:d,encType:p,formData:m,body:g}=Y3(s,e);if(l.navigate===!1){let b=l.fetcherKey||dD();await i(b,n,l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:g,formMethod:l.method||d,formEncType:l.encType||p,flushSync:l.flushSync})}else await r(l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:g,formMethod:l.method||d,formEncType:l.encType||p,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[i,r,e,n])}function pD(t,{relative:e}={}){let{basename:n}=U.useContext(rs),i=U.useContext(vl);Wn(i,"useFormAction must be used inside a RouteContext");let[r]=i.matches.slice(-1),s={...Vm(t||".",{relative:e})},l=_l();if(t==null){s.search=l.search;let c=new URLSearchParams(s.search),d=c.getAll("index");if(d.some(m=>m==="")){c.delete("index"),d.filter(g=>g).forEach(g=>c.append("index",g));let m=c.toString();s.search=m?`?${m}`:""}}return(!t||t===".")&&r.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:fo([n,s.pathname])),Am(s)}function mD(t,{relative:e}={}){let n=U.useContext(bC);Wn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=NC("useViewTransitionState"),r=Vm(t,{relative:e});if(!n.isTransitioning)return!1;let s=rc(n.currentLocation.pathname,i)||n.currentLocation.pathname,l=rc(n.nextLocation.pathname,i)||n.nextLocation.pathname;return _0(r.pathname,l)!=null||_0(r.pathname,s)!=null}fC();const tE=t=>{let e;const n=new Set,i=(p,m)=>{const g=typeof p=="function"?p(e):p;if(!Object.is(g,e)){const b=e;e=m??(typeof g!="object"||g===null)?g:Object.assign({},e,g),n.forEach(v=>v(e,b))}},r=()=>e,c={setState:i,getState:r,getInitialState:()=>d,subscribe:p=>(n.add(p),()=>n.delete(p))},d=e=t(i,r,c);return c},gD=(t=>t?tE(t):tE),yD=t=>t;function bD(t,e=yD){const n=cm.useSyncExternalStore(t.subscribe,cm.useCallback(()=>e(t.getState()),[t,e]),cm.useCallback(()=>e(t.getInitialState()),[t,e]));return cm.useDebugValue(n),n}const nE=t=>{const e=gD(t),n=i=>bD(e,i);return Object.assign(n,e),n},Tf=(t=>t?nE(t):nE),pl=Tf(t=>({user:null,isAuthenticated:!1,loading:!1,error:null,login:async(e,n)=>{t({loading:!0,error:null});try{const i=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:n}),credentials:"include"}),r=await i.json();if(!i.ok){t({loading:!1,error:r.error||"Login failed"});return}t({user:r.user,isAuthenticated:!0,loading:!1,error:null})}catch{t({loading:!1,error:"Network error"})}},logout:async()=>{try{await fetch("/api/auth/logout",{method:"POST",credentials:"include"})}catch{}t({user:null,isAuthenticated:!1,error:null})},checkAuth:async()=>{t({loading:!0});try{const e=await fetch("/api/auth/me",{credentials:"include"});if(e.ok){const n=await e.json();t({user:n.user,isAuthenticated:!0,loading:!1})}else t({user:null,isAuthenticated:!1,loading:!1})}catch{t({user:null,isAuthenticated:!1,loading:!1})}},reset:()=>t({user:null,isAuthenticated:!1,loading:!1,error:null})})),Ja=Tf((t,e)=>({squads:[],selectedSquad:null,activeStates:{},fetchSquads:async()=>{try{const n=await fetch("/api/squads",{credentials:"include"});if(n.ok){const i=await n.json();t({squads:i.squads})}}catch{}},selectSquad:n=>t({selectedSquad:n}),setSquadState:(n,i)=>t(r=>({activeStates:{...r.activeStates,[n]:i}})),clearSquadState:n=>t(i=>{const{[n]:r,...s}=i.activeStates;return{activeStates:s}}),reset:()=>t({squads:[],selectedSquad:null,activeStates:{}})}));let xD=0;function iE(){return`local-${Date.now()}-${++xD}`}const nr=Tf((t,e)=>({conversations:[],messages:[],conversationId:null,streaming:!1,streamingText:"",activity:null,error:null,addUserMessage:n=>{const i={id:iE(),role:"user",content:n,createdAt:new Date().toISOString()};t(r=>{const s=r.conversationId,l=s&&!r.messages.some(c=>c.role==="user")?r.conversations.map(c=>c.id===s?{...c,preview:n.slice(0,80)}:c):r.conversations;return{messages:[...r.messages,i],error:null,conversations:l}})},setConversationId:n=>{t({conversationId:n})},startStreaming:()=>{t({streaming:!0,streamingText:"",activity:null,error:null})},appendChunk:n=>{t(i=>({streamingText:i.streamingText+n,activity:null}))},setActivity:n=>{t({activity:n})},finishStreaming:n=>{const{streamingText:i}=e(),r={id:n,role:"assistant",content:i,createdAt:new Date().toISOString()};t(s=>({messages:[...s.messages,r],streaming:!1,streamingText:"",activity:null}))},addAgentDm:n=>{const i={id:iE(),role:"agent_dm",content:n.content,agentId:n.agentId,agentName:n.agentName,createdAt:new Date().toISOString()};t(r=>({messages:[...r.messages,i]}))},setError:n=>{t({error:n,streaming:!1,streamingText:"",activity:null})},loadConversations:async n=>{try{const i=await fetch(`/api/squads/${n}/conversations`,{credentials:"include"});if(!i.ok)return;const s=((await i.json()).data||[]).map(l=>({id:l.id,createdAt:l.created_at,preview:""}));for(const l of s)try{const c=await fetch(`/api/conversations/${l.id}/messages?limit=1`,{credentials:"include"});if(c.ok){const p=((await c.json()).data||[])[0];p&&(l.preview=p.content.slice(0,80))}}catch{}t({conversations:s})}catch{}},selectConversation:async n=>{t({conversationId:n,messages:[],streaming:!1,streamingText:"",activity:null,error:null});try{const i=await fetch(`/api/conversations/${n}/messages`,{credentials:"include"});if(!i.ok)return;const s=((await i.json()).data||[]).map(l=>({id:l.id,role:l.role,content:l.content,agentId:l.agent_id??void 0,agentName:l.agent_name??void 0,createdAt:l.created_at}));t({messages:s})}catch{}},deleteConversation:async(n,i)=>{try{if(!(await fetch(`/api/conversations/${n}`,{method:"DELETE",credentials:"include"})).ok)return;const{conversationId:s}=e();t(l=>({conversations:l.conversations.filter(c=>c.id!==n)})),s===n&&t({conversationId:null,messages:[]})}catch{}},loadHistory:async n=>{try{const i=await fetch(`/api/squads/${n}/conversations`,{credentials:"include"});if(!i.ok)return;const r=await i.json();if(!r.data||r.data.length===0){t({conversationId:null,messages:[],conversations:[]});return}const s=(r.data||[]).map(g=>({id:g.id,createdAt:g.created_at,preview:""})),l=r.data[0];t({conversationId:l.id,conversations:s});const c=await fetch(`/api/conversations/${l.id}/messages`,{credentials:"include"});if(!c.ok)return;const p=((await c.json()).data||[]).map(g=>({id:g.id,role:g.role,content:g.content,agentId:g.agent_id??void 0,agentName:g.agent_name??void 0,createdAt:g.created_at})),m=p.find(g=>g.role==="user");if(m){const g=s.findIndex(b=>b.id===l.id);g>=0&&(s[g].preview=m.content.slice(0,80))}t({messages:p,conversations:s});for(const g of s)if(g.id!==l.id)try{const b=await fetch(`/api/conversations/${g.id}/messages?limit=1`,{credentials:"include"});if(b.ok){const _=((await b.json()).data||[])[0];_&&(g.preview=_.content.slice(0,80))}}catch{}t({conversations:[...s]})}catch{}},reset:()=>t({conversations:[],messages:[],conversationId:null,streaming:!1,streamingText:"",error:null})}));function vD(t){const n=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`,i=new WebSocket(n),r=[];let s=!0;function l(c){i.readyState===WebSocket.OPEN?i.send(JSON.stringify(c)):i.readyState===WebSocket.CONNECTING&&r.push(c)}return i.onopen=()=>{var c,d;s||(d=(c=t.current).onReconnect)==null||d.call(c),s=!1;for(const p of r)i.send(JSON.stringify(p));r.length=0},i.onmessage=c=>{var d,p,m,g,b,v,_,C,T,w,k,R,O,j,D,F,$;try{const P=JSON.parse(c.data),I=t.current;switch(P.type){case"squad:state":(d=I.onSquadState)==null||d.call(I,P.squadName,P.state);break;case"squad:inactive":(p=I.onSquadInactive)==null||p.call(I,P.squadName,P.reason);break;case"chat:chunk":(m=I.onChatChunk)==null||m.call(I,P.squadName,P.conversationId,P.delta);break;case"chat:activity":(g=I.onChatActivity)==null||g.call(I,P.squadName,P.tool,P.summary);break;case"chat:done":(b=I.onChatDone)==null||b.call(I,P.squadName,P.conversationId,P.messageId);break;case"chat:error":(v=I.onChatError)==null||v.call(I,P.squadName,P.error);break;case"chat:agent_dm":(_=I.onChatAgentDm)==null||_.call(I,P.squadName,P.conversationId,P.agentId,P.agentName,P.message);break;case"chat:conversation_created":(C=I.onChatConversationCreated)==null||C.call(I,P.squadName,P.conversationId);break;case"agent:output_chunk":(T=I.onAgentOutputChunk)==null||T.call(I,P.squadName,P.agentId,P.agentName,P.delta);break;case"agent:step_start":(w=I.onAgentStepStart)==null||w.call(I,P.squadName,P.agentId,P.agentName,P.stepIndex,P.stepLabel);break;case"agent:step_complete":(k=I.onAgentStepComplete)==null||k.call(I,P.squadName,P.agentId,P.agentName,P.stepIndex,P.stepLabel);break;case"squad:checkpoint":(R=I.onSquadCheckpoint)==null||R.call(I,P.squadName,P.agentId,P.agentName,P.question);break;case"schedule:started":(O=I.onScheduleStarted)==null||O.call(I,P.squadName,P.jobId,P.attempt);break;case"schedule:chunk":(j=I.onScheduleChunk)==null||j.call(I,P.squadName,P.jobId,P.delta);break;case"schedule:done":(D=I.onScheduleDone)==null||D.call(I,P.squadName,P.jobId,P.summary,P.attempt);break;case"schedule:error":(F=I.onScheduleError)==null||F.call(I,P.squadName,P.jobId,P.error,P.attempt,P.willRetry);break;case"schedule:status_changed":($=I.onScheduleStatusChanged)==null||$.call(I,P.squadName,P.status);break}}catch{}},{subscribe:c=>{l({type:"squad:subscribe",squadName:c})},unsubscribe:c=>{l({type:"squad:unsubscribe",squadName:c})},sendChat:(c,d,p)=>{const m={type:"chat:send",squadName:c,message:d};p&&p.length>0&&(m.files=p),l(m)},newConversation:c=>{l({type:"chat:new_conversation",squadName:c})},sendCheckpointResponse:(c,d)=>{l({type:"squad:checkpoint_response",squadName:c,answer:d})},disconnect:()=>{i.close()}}}function _D(t={}){const e=U.useRef(null),n=U.useRef(t),i=U.useRef(new Set);n.current=t,U.useEffect(()=>{const p=vD(n);e.current=p;for(const m of i.current)p.subscribe(m);return()=>{p.disconnect()}},[]);const r=U.useCallback(p=>{var m;i.current.add(p),(m=e.current)==null||m.subscribe(p)},[]),s=U.useCallback(p=>{var m;i.current.delete(p),(m=e.current)==null||m.unsubscribe(p)},[]),l=U.useCallback((p,m,g)=>{var b;(b=e.current)==null||b.sendChat(p,m,g)},[]),c=U.useCallback(p=>{var m;(m=e.current)==null||m.newConversation(p)},[]),d=U.useCallback((p,m)=>{var g;(g=e.current)==null||g.sendCheckpointResponse(p,m)},[]);return{subscribe:r,unsubscribe:s,sendChat:l,newConversation:c,sendCheckpointResponse:d}}function SD(t){const e=Math.floor(t/3600),n=Math.floor(t%3600/60),i=t%60,r=s=>s.toString().padStart(2,"0");return e>0?`${e}h ${r(n)}m ${r(i)}s`:`${n}m ${r(i)}s`}function ED({state:t}){const[e,n]=U.useState(0);return U.useEffect(()=>{if(!(t!=null&&t.startedAt)||t.status!=="running"){n(0);return}const i=new Date(t.startedAt).getTime(),r=()=>n(Math.floor((Date.now()-i)/1e3));r();const s=setInterval(r,1e3);return()=>clearInterval(s)},[t==null?void 0:t.startedAt,t==null?void 0:t.status]),A.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",height:"var(--statusbar-height)",padding:"0 var(--sp-4)",background:"var(--surface-1)",borderTop:"1px solid var(--border-subtle)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:t?A.jsxs(A.Fragment,{children:[A.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[A.jsx("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:t.status==="running"?"var(--status-active)":t.status==="checkpoint"?"var(--status-warning)":"var(--status-idle)",boxShadow:t.status==="running"?"0 0 8px var(--status-active-glow)":"none",animation:t.status==="running"?"statusPulse 2s ease-in-out infinite":"none"}}),A.jsxs("span",{style:{color:"var(--text-secondary)"},children:["Step ",t.step.current,"/",t.step.total]}),A.jsx("span",{style:{color:"var(--border-strong)"},children:"│"}),A.jsx("span",{children:t.step.label})]}),A.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[t.handoff&&A.jsxs("span",{style:{color:"var(--accent)"},children:[t.handoff.from," → ",t.handoff.to]}),t.status==="running"&&A.jsx("span",{style:{color:"var(--text-secondary)"},children:SD(e)})]})]}):A.jsxs(A.Fragment,{children:[A.jsx("span",{children:"Ready"}),A.jsx("span",{children:"ExpxAgents Mission Control"})]})})}let Ov=null;function wD(t){Ov=t}function kC(t,e,n){Ov&&Ov(t,e,n)}let Dv=null;function TD(t){Dv=t}function CD(t){Dv&&Dv(t)}let zv=null;function AD(t){zv=t}function MD(t,e){zv&&zv(t,e)}const d0=32,ul=96,nu=64,dt={floor:13158600,floorHighlight:14211288,floorGrout:12105912,wall:15261904,wallTrim:11577496,baseboard:7035464,desk:15263976,deskTop:16119285,deskShadow:13684944,deskLeg:1710618,deskEdge:14737632,monitor:2236976,monitorScreen:1981020,monitorScreenGlow:2773120,monitorStand:3355456,keyboard:3355456,keyboardKey:4473941,chairSeat:2899536,chairBack:3426654,chairBase:4473924,chairWheel:3355443,plant:5025616,plantDark:3706428,plantLight:6732650,pot:9133628,potRim:10515018,soil:4863264,bookshelf:8020808,bookshelfEdge:9139029,bookColors:[15022389,2001125,4431943,16750592,9315498,35195,16635957],rug:6044974,rugPattern:8016448,rugBorder:4861472},Bv=[5227511,5025616,16750592,15022389,9315498,16771899],RD={idle:8947848,working:5025616,delivering:5227511,done:5025616,checkpoint:16750592},Or={counter:4073251,counterTop:6111287,machine:3622735,machineTop:4545124,machineLight:5025616,cup:14142664,cupShadow:12364452,saucer:14735052,sink:7901340,faucet:11583173,menu:5125166},Xa={table:6111287,tableTop:7162945,tableEdge:5125166,tableLeg:4073251,chair:3622735,chairSeat:4545124,chairBack:5533306,carpet:2503224,carpetPattern:3030340,whiteboard:15527921,whiteboardFrame:7901340},hf={background:1713022,backgroundGlow:2635155,statusRunning:5025616,statusIdle:8947848,statusCheckpoint:16750592,statusCompleted:5025616},ru={floor:11579568,tile:11053224,grout:10066329,stripe:12632256},ra={floor:14477552,tile:12966120,tileGrout:11453652,wall:14740208,stall:11583173,stallDoor:9479342,sink:15527921,sinkBowl:16777215,mirror:11789820,mirrorFrame:7901340,toilet:16448250,toiletSeat:15658734,pipe:9479342},Sa={floor:6111287,carpet:5125166,carpetBorder:4073251,desk:4073251,deskTop:6111287,deskEdge:2890510,chair:1713022,chairSeat:2635155,window:8508666,windowFrame:5533306,windowSill:7901340,bookshelf:7162945,globe:4367861,nameplate:16766720},nh={wall:7901340,wallHighlight:10795204,doorFrame:6111287},tr={floor:16115411,tile:15259072,tileGrout:13942952,counter:6111287,counterTop:7951688,fridge:15527921,fridgeDoor:14737632,fridgeHandle:10395294,table:9268835,tableTop:10586239,chair:7162945,coffeeMaker:3622735,coffeeMakerLight:5025616,lamp:16766287},Ea={floor:14142664,carpet:6323595,carpetBorder:4545124,sofa:5533306,sofaCushion:6323595,sofaArm:4545124,tv:2171169,tvScreen:2503224,tvStand:4342338,sideTable:7951688,magazine:15684432,magazineAlt:4367861},Qo=480,$a=360,tf=400,Pi=60,Ka=120,dx=120,rE=160,aE=120,sE=160,ND=64,kD=80,OD=ul+32,DD=nu+48,lE=2,OC=10,Ko=80;function wy(t,e,n){const i=Math.max(0,Math.min(1,n));return t+(e-t)*i}function zD(t){return t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2}const BD=["nw","ne","sw","se"],LD={nw:"right",ne:"left",sw:"top",se:"top"};function S0(t){const e=OC,n=Math.max(1,t),i={nw:0,ne:0,sw:0,se:0},r=[];for(let Q=0;Q<n;Q++){const q=BD[Q%4];r.push({quadrant:q,slot:i[q]}),i[q]++}const s=Math.max(1,i.nw),l=Math.max(1,i.ne),c=Math.max(1,i.sw),d=Math.max(1,i.se),p=Math.max(tf,Ka),m=s*($a+e),g=l*($a+e),b=Math.max(m+p,g+Ka),v=c*($a+e),_=d*($a+e),C=Math.max(rE,sE),T=Math.max(v+C+e,_+C+e),w=Math.max(Qo,Ka+e+tf),k=Math.max(Qo,Ka),R=Math.max(Qo,dx),O=Math.max(Qo,aE),j=Math.max(w,R),D=Math.max(k,O),F=e+j+e+Pi+e+D+e,$=e+b+e+Pi+e+T+e,P={x:e+j+e,y:e,width:Pi,height:$-2*e},I={x:e,y:e+b+e,width:F-2*e,height:Pi},K={x:P.x+P.width/2,y:I.y+I.height/2},G={x:P.x-e-tf,y:I.y-e-tf,width:tf,height:tf},te={x:G.x-e-Ka,y:I.y-e-Ka,width:Ka,height:Ka},H={x:P.x+Pi+e,y:I.y-e-Ka,width:Ka,height:Ka},W={x:P.x-e-dx,y:I.y+Pi+e+c*($a+e),width:dx,height:rE},B={x:P.x+Pi+e,y:I.y+Pi+e+d*($a+e),width:aE,height:sE},X=[],Z={};for(let Q=0;Q<n;Q++){const{quadrant:q,slot:Y}=r[Q],ee=LD[q];let V;q==="nw"?V={x:P.x-e-Qo,y:G.y-e-(Y+1)*$a-Y*e}:q==="ne"?V={x:P.x+Pi+e,y:H.y-e-(Y+1)*$a-Y*e}:q==="sw"?V={x:P.x-e-Qo,y:I.y+Pi+e+Y*($a+e)}:V={x:P.x+Pi+e,y:I.y+Pi+e+Y*($a+e)},X.push({origin:V,width:Qo,height:$a,quadrant:q,doorSide:ee}),ee==="right"||ee==="left"?Z[`squad-${Q}`]={x:P.x+Pi/2,y:V.y+$a/2}:Z[`squad-${Q}`]={x:V.x+Qo/2,y:I.y+Pi/2}}return Z.ceo={x:P.x+Pi/2,y:G.y+tf/2},Z["bathroom-male"]={x:te.x+Ka/2,y:I.y+Pi/2},Z["bathroom-female"]={x:H.x+Ka/2,y:I.y+Pi/2},Z.kitchen={x:P.x+Pi/2,y:W.y+W.height/2},Z["rest-area"]={x:P.x+Pi/2,y:B.y+B.height/2},{totalWidth:F,totalHeight:$,squadOrigins:X,ceoOffice:G,corridorH:I,corridorV:P,bathroomMale:te,bathroomFemale:H,kitchen:W,restArea:B,doorPoints:Z,corridorHub:K}}function Qd(t,e,n,i){const r=t%lE,s=Math.floor(t/lE);return{x:e.x+ND+r*OD,y:e.y+kD+s*DD}}function gm(t,e,n){return{x:t.x+e-80,y:t.y+n-80}}function DC(t,e,n){return{x:t.x+e-160,y:t.y+Math.floor(n/2)}}function UD(t,e){const n=e==="male"?t.bathroomMale:t.bathroomFemale;return{x:n.x+n.width/2,y:n.y+n.height/2}}function ID(t){return{x:t.kitchen.x+t.kitchen.width/2,y:t.kitchen.y+t.kitchen.height/2}}function jD(t){return{x:t.restArea.x+t.restArea.width/2,y:t.restArea.y+t.restArea.height/2}}function HD(t){const e=t.corridorV;if(e.height>0&&Math.random()<.5)return{x:e.x+10+Math.random()*Math.max(0,e.width-20),y:e.y+10+Math.random()*Math.max(0,e.height-20)};const n=t.corridorH;return{x:n.x+20+Math.random()*Math.max(0,n.width-40),y:n.y+10+Math.random()*Math.max(0,n.height-20)}}function oE(t,e){const n=e.corridorH;return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height}function cE(t,e){const n=e.corridorV;return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height}function PD(t,e){if(t==="ceo"){const i=e.ceoOffice;return{x:i.x+i.width/2,y:i.y+i.height/2}}if(t==="bathroom-male"){const i=e.bathroomMale;return{x:i.x+i.width/2,y:i.y+i.height/2}}if(t==="bathroom-female"){const i=e.bathroomFemale;return{x:i.x+i.width/2,y:i.y+i.height/2}}if(t==="kitchen"){const i=e.kitchen;return{x:i.x+i.width/2,y:i.y+i.height/2}}if(t==="rest-area"){const i=e.restArea;return{x:i.x+i.width/2,y:i.y+i.height/2}}const n=t.match(/^squad-(\d+)$/);if(n){const i=parseInt(n[1],10),r=e.squadOrigins[i];if(r)return{x:r.origin.x+r.width/2,y:r.origin.y+r.height/2}}return e.corridorHub}function ym(t,e,n,i){const r=i.doorPoints[e],s=i.doorPoints[n];if(!r||!s)return[t];const l=i.corridorHub,c=PD(n,i),d=oE(r,i)&&oE(s,i),p=cE(r,i)&&cE(s,i);return d||p?[t,r,s,c]:[t,r,l,s,c]}function Ty(t,e){const n=t.x-e.x,i=t.y-e.y;return Math.sqrt(n*n+i*i)}const uE=500,fE=50;let dE=0;function hE(t){return{idle:"idle",working:"working",delivering:"walking",done:"idle",checkpoint:"checkpoint"}[t]??"idle"}const ri=Tf(t=>({rooms:[],activeRoom:null,bubbles:{},activityLog:{},checkpoints:{},agentVisuals:{},appendBubble:(e,n,i)=>{const r=`${e}:${n}`;t(s=>{var d;let c=(((d=s.bubbles[r])==null?void 0:d.text)??"")+i;return c.length>uE&&(c=c.slice(c.length-uE)),{bubbles:{...s.bubbles,[r]:{text:c,updatedAt:Date.now()}}}})},clearBubble:(e,n)=>{const i=`${e}:${n}`;t(r=>{const{[i]:s,...l}=r.bubbles;return{bubbles:l}})},clearAllBubbles:()=>t({bubbles:{}}),addActivity:(e,n,i)=>{const s={id:++dE,agentName:n,action:i,timestamp:Date.now()};t(l=>{var m;const d=[...((m=l.activityLog[e])==null?void 0:m.entries)??[],s],p=d.length>fE?d.slice(d.length-fE):d;return{activityLog:{...l.activityLog,[e]:{entries:p}}}})},setCheckpoint:(e,n,i,r)=>t(s=>({checkpoints:{...s.checkpoints,[e]:{agentId:n,agentName:i,question:r}}})),clearCheckpoint:e=>t(n=>{const{[e]:i,...r}=n.checkpoints;return{checkpoints:r}}),setActiveRoom:e=>t({activeRoom:e}),syncRooms:e=>t(n=>{const i=e;let r;return i.length===0?r=null:n.activeRoom===null||!i.includes(n.activeRoom)?r=i[0]:r=n.activeRoom,{rooms:i,activeRoom:r}}),setAgents:(e,n)=>t(i=>{const r=i.agentVisuals[e]??[],s=new Map(r.map(v=>[v.id,v])),l={x:0,y:0},c=S0(i.rooms.length),d=i.rooms.indexOf(e),p=c.squadOrigins[d],m=(p==null?void 0:p.width)??480,g=(p==null?void 0:p.height)??360,b=n.map((v,_)=>{const C=s.get(v.id);if(C){const k=v.status?hE(v.status):C.status,R=k!==C.status;let O=C.targetPosition;return R&&(k==="working"||k==="checkpoint"?O=Qd(_,l):O=gm(l,m,g)),{...C,name:v.name,deskIndex:_,status:k,targetPosition:O}}const T=v.status?hE(v.status):"idle",w=T==="working"||T==="checkpoint"?Qd(_,l):gm(l,m,g);return{id:v.id,name:v.name,colorIndex:_%6,status:T,deskIndex:_,position:w,targetPosition:null}});return{agentVisuals:{...i.agentVisuals,[e]:b}}}),setAgentStatus:(e,n,i)=>t(r=>{const s=r.agentVisuals[e];if(!s)return r;const l={x:0,y:0},c=S0(r.rooms.length),d=r.rooms.indexOf(e),p=c.squadOrigins[d],m=(p==null?void 0:p.width)??480,g=(p==null?void 0:p.height)??360,b=s.map(v=>{if(v.id!==n)return v;let _;return i==="working"||i==="checkpoint"?_=Qd(v.deskIndex,l):_=gm(l,m,g),{...v,status:i,targetPosition:_}});return{agentVisuals:{...r.agentVisuals,[e]:b}}}),reset:()=>{dE=0,t({rooms:[],activeRoom:null,bubbles:{},activityLog:{},checkpoints:{},agentVisuals:{}})}})),A$={background:"#0a0a0f",grid:"rgba(0, 200, 255, 0.06)",orbStandby:"#1a3a5c",orbListening:"#00c8ff",orbProcessing:"#ff8c00",orbSpeaking:"#00ff88",panelBg:"rgba(0, 200, 255, 0.08)",panelBorder:"rgba(0, 200, 255, 0.25)",textPrimary:"#e0e8f0",textAccent:"#00c8ff",textJarvis:"#00ff88",particleStart:"#00c8ff"},GD={orbRadius:60,orbRingWidth:3,gridSpacing:40,particleCount:65,particleMinRadius:1,particleMaxRadius:3,waveformBars:32,waveformMaxHeight:40,panelWidth:180,panelPadding:12,transcriptLineHeight:20,standbyTimeoutMs:15e3,ttsSplitLength:300};let zC=0;function FD(){return`jarvis-${Date.now()}-${++zC}`}let ro=null;const hx=Tf((t,e)=>({mode:"STANDBY",messages:[],streamingText:"",selectedSquad:null,userName:"",setMode:n=>t({mode:n}),addMessage:(n,i)=>{const r={id:FD(),role:n,content:i,createdAt:new Date().toISOString()};t(s=>({messages:[...s.messages,r]}))},appendChunk:n=>{t(i=>({streamingText:i.streamingText+n}))},finalizeMessage:n=>{const{streamingText:i}=e(),r={id:n,role:"assistant",content:i,createdAt:new Date().toISOString()};t(s=>({messages:[...s.messages,r],streamingText:""}))},selectSquad:n=>t({selectedSquad:n}),setUserName:n=>t({userName:n}),startStandbyTimer:()=>{ro&&clearTimeout(ro),ro=setTimeout(()=>{t({mode:"STANDBY"}),ro=null},GD.standbyTimeoutMs)},resetStandbyTimer:()=>{e().startStandbyTimer()},clearStandbyTimer:()=>{ro&&(clearTimeout(ro),ro=null)},reset:()=>{ro&&(clearTimeout(ro),ro=null),zC=0,t({mode:"STANDBY",messages:[],streamingText:"",selectedSquad:null,userName:""})}})),ks=Tf((t,e)=>({jobs:[],loading:!1,fetchJobs:async()=>{t({loading:!0});try{const n=await fetch("/api/scheduler",{credentials:"include"});if(n.ok){const i=await n.json();t({jobs:i.data,loading:!1})}else t({loading:!1})}catch{t({loading:!1})}},createJob:async n=>(await fetch("/api/scheduler",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})).ok?(e().fetchJobs(),!0):!1,deleteJob:async n=>{await fetch(`/api/scheduler/${n}`,{method:"DELETE",credentials:"include"}),e().fetchJobs()},pauseJob:async n=>{await fetch(`/api/scheduler/${n}/pause`,{method:"POST",credentials:"include"}),e().fetchJobs()},resumeJob:async n=>{await fetch(`/api/scheduler/${n}/resume`,{method:"POST",credentials:"include"}),e().fetchJobs()},triggerJob:async n=>{await fetch(`/api/scheduler/${n}/trigger`,{method:"POST",credentials:"include"})},updateJobStatus:(n,i)=>{t(r=>({jobs:r.jobs.map(s=>s.squad_name===n?{...s,status:i}:s)}))}})),qD=[{to:"/office",label:"Office",icon:"⬡"},{to:"/chat",label:"Chat",icon:"◈"},{to:"/kanban",label:"Kanban",icon:"▦"},{to:"/scheduler",label:"Scheduler",icon:"⏣"},{to:"/email",label:"Email",icon:"✉"},{to:"/orgchart",label:"Org Chart",icon:"◎"},{to:"/graph",label:"Graph",icon:"◇"},{to:"/files",label:"Files",icon:"▤"},{to:"/settings",label:"Settings",icon:"⚙"}];function YD(){const t=pl(Y=>Y.user),e=pl(Y=>Y.isAuthenticated),n=pl(Y=>Y.loading),i=pl(Y=>Y.logout),r=pl(Y=>Y.checkAuth),s=W0(),l=_l();l.pathname==="/office"||l.pathname;const c=l.pathname==="/jarvis",d=Ja(Y=>Y.squads),p=Ja(Y=>Y.selectedSquad),m=Ja(Y=>p?Y.activeStates[p]:null),g=Ja(Y=>Y.fetchSquads),b=Ja(Y=>Y.setSquadState),v=Ja(Y=>Y.clearSquadState),_=U.useCallback((Y,ee)=>{b(Y,ee);const V=ri.getState();V.rooms.includes(Y)||V.syncRooms([...V.rooms,Y]),ee.status!=="checkpoint"&&V.clearCheckpoint(Y),ee.agents&&V.setAgents(Y,ee.agents.map(oe=>({id:oe.id,name:oe.name,status:oe.status})))},[b]),C=U.useCallback(Y=>{v(Y);const ee=ri.getState(),V=ee.agentVisuals[Y];if(V)for(const oe of V)ee.setAgentStatus(Y,oe.id,"idle")},[v]),T=U.useCallback((Y,ee)=>{nr.setState(V=>({conversationId:ee,messages:[],conversations:[{id:ee,createdAt:new Date().toISOString(),preview:""},...V.conversations.filter(oe=>oe.id!==ee)]}))},[]),w=U.useCallback((Y,ee,V)=>{if(Y==="_jarvis"){hx.getState().appendChunk(V);return}const oe=nr.getState();oe.streaming||oe.startStreaming(),oe.appendChunk(V)},[]),k=U.useCallback((Y,ee,V)=>{if(Y==="_jarvis"){hx.getState().finalizeMessage(V);return}nr.getState().finishStreaming(V)},[]),R=U.useCallback((Y,ee)=>{if(Y==="_jarvis"){hx.getState().setMode("LISTENING");return}nr.getState().setError(ee)},[]),O=U.useCallback((Y,ee,V)=>{Y!=="_jarvis"&&nr.getState().setActivity(`${ee}${V?" "+V:""}`)},[]),j=U.useCallback((Y,ee,V,oe,be)=>{nr.getState().addAgentDm({agentId:V,agentName:oe,content:be})},[]),D=U.useCallback((Y,ee,V,oe)=>{ri.getState().appendBubble(Y,ee,oe)},[]),F=U.useCallback((Y,ee,V,oe,be)=>{ri.getState().addActivity(Y,V,`started "${be}"`),ri.getState().setAgentStatus(Y,ee,"working")},[]),$=U.useCallback((Y,ee,V,oe,be)=>{ri.getState().addActivity(Y,V,`completed "${be}"`),ri.getState().setAgentStatus(Y,ee,"idle")},[]),P=U.useCallback((Y,ee,V,oe)=>{ri.getState().setCheckpoint(Y,ee,V,oe),ri.getState().setAgentStatus(Y,ee,"checkpoint")},[]),I=U.useCallback(()=>{ri.getState().clearAllBubbles()},[]),K=U.useCallback((Y,ee,V)=>{ks.getState().fetchJobs()},[]),G=U.useCallback((Y,ee,V,oe)=>{ks.getState().fetchJobs()},[]),te=U.useCallback((Y,ee,V,oe,be)=>{ks.getState().fetchJobs()},[]),H=U.useCallback((Y,ee)=>{ks.getState().updateJobStatus(Y,ee)},[]),{subscribe:W,unsubscribe:B,sendChat:X,newConversation:Z,sendCheckpointResponse:Q}=_D({onSquadState:_,onSquadInactive:C,onChatConversationCreated:T,onChatChunk:w,onChatActivity:O,onChatDone:k,onChatError:R,onChatAgentDm:j,onAgentOutputChunk:D,onAgentStepStart:F,onAgentStepComplete:$,onSquadCheckpoint:P,onReconnect:I,onScheduleStarted:K,onScheduleDone:G,onScheduleError:te,onScheduleStatusChanged:H});U.useEffect(()=>{wD(X)},[X]),U.useEffect(()=>{TD(Z)},[Z]),U.useEffect(()=>{AD(Q)},[Q]),U.useEffect(()=>{g().then(()=>{const{squads:Y}=Ja.getState();if(Y.length>0){const ee=ri.getState(),V=Y.map(ve=>ve.code),oe=ee.rooms,be=[...new Set([...oe,...V])];ee.syncRooms(be);for(const ve of Y)!ee.agentVisuals[ve.code]&&ve.agents&&ve.agents.length>0&&ee.setAgents(ve.code,ve.agents.map(se=>({id:se.id,name:se.name,status:"idle"})))}})},[g]);const q=ri(Y=>Y.rooms);return U.useEffect(()=>{for(const Y of q)W(Y);return()=>{for(const Y of q)B(Y)}},[q,W,B]),U.useEffect(()=>(W("_expxagents"),()=>B("_expxagents")),[W,B]),U.useEffect(()=>{if(c)return W("_jarvis"),()=>B("_jarvis")},[c,W,B]),U.useEffect(()=>{e||r()},[]),U.useEffect(()=>{!n&&!e&&s("/login",{state:{from:l.pathname}})},[n,e,s,l.pathname]),c?A.jsx(JS,{}):A.jsxs("div",{className:"noise-bg",style:{display:"flex",flexDirection:"column",height:"100vh",background:"var(--surface-0)",color:"var(--text-primary)"},children:[A.jsxs("header",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",height:"var(--header-height)",padding:"0 var(--sp-4)",background:"var(--surface-1)",borderBottom:"1px solid var(--border-subtle)",position:"relative",zIndex:10},children:[A.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[A.jsx("div",{style:{width:28,height:28,borderRadius:"var(--radius-sm)",background:"linear-gradient(135deg, var(--accent), var(--accent-dim))",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.8rem",fontWeight:700,color:"var(--text-inverse)",boxShadow:"0 0 12px var(--accent-glow-strong)"},children:"EX"}),A.jsx("span",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",letterSpacing:"-0.02em"},children:"ExpxAgents"}),A.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",background:"var(--surface-3)",padding:"2px 6px",borderRadius:"var(--radius-xs)",letterSpacing:"0.05em"},children:"MISSION CONTROL"})]}),A.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-4)"},children:[A.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)"},children:[A.jsx("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:"var(--status-active)",boxShadow:"0 0 8px var(--status-active-glow)",animation:"statusPulse 2s ease-in-out infinite"}}),A.jsx("span",{children:t==null?void 0:t.username})]}),A.jsx("button",{onClick:i,className:"btn-ghost",style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontFamily:"var(--font-display)",fontSize:"0.75rem",padding:"4px 8px",borderRadius:"var(--radius-xs)",transition:"color var(--duration-fast) var(--ease-out)"},onMouseEnter:Y=>Y.currentTarget.style.color="var(--status-error)",onMouseLeave:Y=>Y.currentTarget.style.color="var(--text-muted)",children:"Logout"})]})]}),A.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[A.jsxs("aside",{style:{width:"var(--sidebar-width)",background:"var(--surface-1)",borderRight:"1px solid var(--border-subtle)",display:"flex",flexDirection:"column",overflowY:"auto"},children:[A.jsxs("nav",{style:{padding:"var(--sp-3)",display:"flex",flexDirection:"column",gap:"var(--sp-1)",flex:1},children:[A.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.1em",padding:"0 var(--sp-2)",marginBottom:"var(--sp-1)"},children:"Navigation"}),qD.map(Y=>A.jsxs(RC,{to:Y.to,style:({isActive:ee})=>({display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"8px 10px",borderRadius:"var(--radius-sm)",textDecoration:"none",fontSize:"0.82rem",fontWeight:ee?600:400,color:ee?"var(--accent)":"var(--text-secondary)",background:ee?"var(--accent-glow)":"transparent",border:ee?"1px solid rgba(0, 200, 255, 0.12)":"1px solid transparent",transition:"all var(--duration-fast) var(--ease-out)"}),children:[A.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.85rem",width:20,textAlign:"center",opacity:.7},children:Y.icon}),Y.label]},Y.to)),A.jsx("div",{style:{height:1,margin:"var(--sp-2) var(--sp-2)",background:"var(--border-subtle)"}}),A.jsxs("a",{href:"/jarvis",target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"8px 10px",borderRadius:"var(--radius-sm)",textDecoration:"none",fontSize:"0.82rem",fontWeight:500,color:"var(--status-active)",background:"var(--status-active-glow)",border:"1px solid rgba(0, 230, 138, 0.12)",transition:"all var(--duration-fast) var(--ease-out)"},children:[A.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.85rem",width:20,textAlign:"center",opacity:.7},children:"◉"}),"Jarvis",A.jsx("span",{style:{marginLeft:"auto",fontFamily:"var(--font-mono)",fontSize:"0.55rem",opacity:.6},children:"↗"})]})]}),A.jsxs("div",{style:{padding:"var(--sp-3)",borderTop:"1px solid var(--border-subtle)",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",display:"flex",justifyContent:"space-between"},children:[A.jsxs("span",{children:[d.length," squad",d.length!==1?"s":""]}),A.jsx("span",{children:"v0.1.0"})]})]}),A.jsx("main",{className:"grid-bg",style:{flex:1,overflow:"auto",position:"relative"},children:A.jsx(JS,{})})]}),A.jsx(ED,{state:m})]})}function VD(){var b;const[t,e]=U.useState(""),[n,i]=U.useState(""),r=pl(v=>v.login),s=pl(v=>v.loading),l=pl(v=>v.error),c=pl(v=>v.isAuthenticated),d=W0(),m=((b=_l().state)==null?void 0:b.from)||"/";U.useEffect(()=>{c&&d(m,{replace:!0})},[c,d,m]);const g=v=>{v.preventDefault(),r(t,n)};return A.jsx("div",{className:"noise-bg grid-bg",style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"100vh",background:"var(--surface-0)"},children:A.jsxs("div",{style:{animation:"fadeInUp 0.6s var(--ease-out) both",width:360},children:[A.jsxs("div",{style:{textAlign:"center",marginBottom:"var(--sp-8)"},children:[A.jsx("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:48,height:48,borderRadius:"var(--radius-md)",background:"linear-gradient(135deg, var(--accent), var(--accent-dim))",fontSize:"1.1rem",fontWeight:800,color:"var(--text-inverse)",boxShadow:"var(--shadow-glow-strong)",marginBottom:"var(--sp-4)"},children:"EX"}),A.jsx("h1",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"1.4rem",color:"var(--text-primary)",letterSpacing:"-0.02em",marginBottom:"var(--sp-1)"},children:"ExpxAgents"}),A.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.15em"},children:"Mission Control"})]}),A.jsxs("form",{onSubmit:g,className:"glass",style:{padding:"var(--sp-6)",borderRadius:"var(--radius-lg)",boxShadow:"var(--shadow-lg)"},children:[l&&A.jsx("div",{style:{padding:"var(--sp-2) var(--sp-3)",marginBottom:"var(--sp-4)",borderRadius:"var(--radius-sm)",background:"var(--status-error-glow)",border:"1px solid rgba(255, 64, 112, 0.2)",color:"var(--status-error)",fontSize:"0.8rem",fontFamily:"var(--font-mono)"},children:l}),A.jsxs("div",{style:{marginBottom:"var(--sp-3)"},children:[A.jsx("label",{style:{display:"block",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:"var(--sp-1)"},children:"Username"}),A.jsx("input",{type:"text",className:"input",placeholder:"Enter username",value:t,onChange:v=>e(v.target.value),autoFocus:!0})]}),A.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[A.jsx("label",{style:{display:"block",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:"var(--sp-1)"},children:"Password"}),A.jsx("input",{type:"password",className:"input",placeholder:"Enter password",value:n,onChange:v=>i(v.target.value)})]}),A.jsx("button",{type:"submit",disabled:s,className:"btn btn-accent",style:{width:"100%",padding:"var(--sp-3)",fontSize:"0.85rem",cursor:s?"wait":"pointer",opacity:s?.7:1},children:s?"Authenticating...":"Access Mission Control"})]}),A.jsx("p",{style:{textAlign:"center",marginTop:"var(--sp-4)",fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)"},children:"AI Squad Orchestration Platform"})]})})}function BC(t,e,n){if(!t)return;if(n(t)===!0)return t;let i=t.child;for(;i;){const r=BC(i,e,n);if(r)return r;i=i.sibling}}function LC(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const P_=LC(U.createContext(null));let UC=class extends U.Component{render(){return U.createElement(P_.Provider,{value:this._reactInternals},this.props.children)}};function XD(){const t=U.useContext(P_);if(t===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=U.useId();return U.useMemo(()=>{for(const n of[t,t==null?void 0:t.alternate]){if(!n)continue;const i=BC(n,!1,r=>{let s=r.memoizedState;for(;s;){if(s.memoizedState===e)return!0;s=s.next}});if(i)return i}},[t,e])}const KD=Symbol.for("react.context"),WD=t=>t!==null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===KD;function $D(){const t=XD(),[e]=U.useState(()=>new Map);e.clear();let n=t;for(;n;){const i=n.type;WD(i)&&i!==P_&&!e.has(i)&&e.set(i,U.use(LC(i))),n=n.return}return e}function ZD(){const t=$D();return U.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>i=>U.createElement(e,null,U.createElement(n.Provider,{...i,value:t.get(n)})),e=>U.createElement(UC,{...e})),[t])}var Rt=(t=>(t.Application="application",t.WebGLPipes="webgl-pipes",t.WebGLPipesAdaptor="webgl-pipes-adaptor",t.WebGLSystem="webgl-system",t.WebGPUPipes="webgpu-pipes",t.WebGPUPipesAdaptor="webgpu-pipes-adaptor",t.WebGPUSystem="webgpu-system",t.CanvasSystem="canvas-system",t.CanvasPipesAdaptor="canvas-pipes-adaptor",t.CanvasPipes="canvas-pipes",t.Asset="asset",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser",t.MaskEffect="mask-effect",t.BlendMode="blend-mode",t.TextureSource="texture-source",t.Environment="environment",t.ShapeBuilder="shape-builder",t.Batcher="batcher",t))(Rt||{});const Lv=t=>{if(typeof t=="function"||typeof t=="object"&&t.extension){if(!t.extension)throw new Error("Extension class must have an extension object");t={...typeof t.extension!="object"?{type:t.extension}:t.extension,ref:t}}if(typeof t=="object")t={...t};else throw new Error("Invalid extension type");return typeof t.type=="string"&&(t.type=[t.type]),t},Cy=(t,e)=>Lv(t).priority??e,si={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...t){return t.map(Lv).forEach(e=>{e.type.forEach(n=>{var i,r;return(r=(i=this._removeHandlers)[n])==null?void 0:r.call(i,e)})}),this},add(...t){return t.map(Lv).forEach(e=>{e.type.forEach(n=>{var s,l;const i=this._addHandlers,r=this._queue;i[n]?(l=i[n])==null||l.call(i,e):(r[n]=r[n]||[],(s=r[n])==null||s.push(e))})}),this},handle(t,e,n){var l;const i=this._addHandlers,r=this._removeHandlers;if(i[t]||r[t])throw new Error(`Extension type ${t} already has a handler`);i[t]=e,r[t]=n;const s=this._queue;return s[t]&&((l=s[t])==null||l.forEach(c=>e(c)),delete s[t]),this},handleByMap(t,e){return this.handle(t,n=>{n.name&&(e[n.name]=n.ref)},n=>{n.name&&delete e[n.name]})},handleByNamedList(t,e,n=-1){return this.handle(t,i=>{e.findIndex(s=>s.name===i.name)>=0||(e.push({name:i.name,value:i.ref}),e.sort((s,l)=>Cy(l.value,n)-Cy(s.value,n)))},i=>{const r=e.findIndex(s=>s.name===i.name);r!==-1&&e.splice(r,1)})},handleByList(t,e,n=-1){return this.handle(t,i=>{e.includes(i.ref)||(e.push(i.ref),e.sort((r,s)=>Cy(s,n)-Cy(r,n)))},i=>{const r=e.indexOf(i.ref);r!==-1&&e.splice(r,1)})},mixin(t,...e){for(const n of e)Object.defineProperties(t.prototype,Object.getOwnPropertyDescriptors(n))}},QD={extension:{type:Rt.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await Zd(()=>import("./browserAll-CHvE8-zd.js"),__vite__mapDeps([0,1]))}},JD={extension:{type:Rt.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await Zd(()=>import("./webworkerAll-D1p-kqY5.js"),[])}};class yr{constructor(e,n,i){this._x=n||0,this._y=i||0,this._observer=e}clone(e){return new yr(e??this._observer,this._x,this._y)}set(e=0,n=e){return(this._x!==e||this._y!==n)&&(this._x=e,this._y=n,this._observer._onUpdate(this)),this}copyFrom(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this._observer._onUpdate(this)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this._observer._onUpdate(this))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this._observer._onUpdate(this))}}var px={exports:{}},pE;function e4(){return pE||(pE=1,(function(t){var e=Object.prototype.hasOwnProperty,n="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(n=!1));function r(d,p,m){this.fn=d,this.context=p,this.once=m||!1}function s(d,p,m,g,b){if(typeof m!="function")throw new TypeError("The listener must be a function");var v=new r(m,g||d,b),_=n?n+p:p;return d._events[_]?d._events[_].fn?d._events[_]=[d._events[_],v]:d._events[_].push(v):(d._events[_]=v,d._eventsCount++),d}function l(d,p){--d._eventsCount===0?d._events=new i:delete d._events[p]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var p=[],m,g;if(this._eventsCount===0)return p;for(g in m=this._events)e.call(m,g)&&p.push(n?g.slice(1):g);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(m)):p},c.prototype.listeners=function(p){var m=n?n+p:p,g=this._events[m];if(!g)return[];if(g.fn)return[g.fn];for(var b=0,v=g.length,_=new Array(v);b<v;b++)_[b]=g[b].fn;return _},c.prototype.listenerCount=function(p){var m=n?n+p:p,g=this._events[m];return g?g.fn?1:g.length:0},c.prototype.emit=function(p,m,g,b,v,_){var C=n?n+p:p;if(!this._events[C])return!1;var T=this._events[C],w=arguments.length,k,R;if(T.fn){switch(T.once&&this.removeListener(p,T.fn,void 0,!0),w){case 1:return T.fn.call(T.context),!0;case 2:return T.fn.call(T.context,m),!0;case 3:return T.fn.call(T.context,m,g),!0;case 4:return T.fn.call(T.context,m,g,b),!0;case 5:return T.fn.call(T.context,m,g,b,v),!0;case 6:return T.fn.call(T.context,m,g,b,v,_),!0}for(R=1,k=new Array(w-1);R<w;R++)k[R-1]=arguments[R];T.fn.apply(T.context,k)}else{var O=T.length,j;for(R=0;R<O;R++)switch(T[R].once&&this.removeListener(p,T[R].fn,void 0,!0),w){case 1:T[R].fn.call(T[R].context);break;case 2:T[R].fn.call(T[R].context,m);break;case 3:T[R].fn.call(T[R].context,m,g);break;case 4:T[R].fn.call(T[R].context,m,g,b);break;default:if(!k)for(j=1,k=new Array(w-1);j<w;j++)k[j-1]=arguments[j];T[R].fn.apply(T[R].context,k)}}return!0},c.prototype.on=function(p,m,g){return s(this,p,m,g,!1)},c.prototype.once=function(p,m,g){return s(this,p,m,g,!0)},c.prototype.removeListener=function(p,m,g,b){var v=n?n+p:p;if(!this._events[v])return this;if(!m)return l(this,v),this;var _=this._events[v];if(_.fn)_.fn===m&&(!b||_.once)&&(!g||_.context===g)&&l(this,v);else{for(var C=0,T=[],w=_.length;C<w;C++)(_[C].fn!==m||b&&!_[C].once||g&&_[C].context!==g)&&T.push(_[C]);T.length?this._events[v]=T.length===1?T[0]:T:l(this,v)}return this},c.prototype.removeAllListeners=function(p){var m;return p?(m=n?n+p:p,this._events[m]&&l(this,m)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,t.exports=c})(px)),px.exports}var t4=e4();const mo=uu(t4),n4=Math.PI*2,i4=180/Math.PI,r4=Math.PI/180;class Dr{constructor(e=0,n=0){this.x=0,this.y=0,this.x=e,this.y=n}clone(){return new Dr(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,n=e){return this.x=e,this.y=n,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return mx.x=0,mx.y=0,mx}}const mx=new Dr;class Ht{constructor(e=1,n=0,i=0,r=1,s=0,l=0){this.array=null,this.a=e,this.b=n,this.c=i,this.d=r,this.tx=s,this.ty=l}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,n,i,r,s,l){return this.a=e,this.b=n,this.c=i,this.d=r,this.tx=s,this.ty=l,this}toArray(e,n){this.array||(this.array=new Float32Array(9));const i=n||this.array;return e?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i}apply(e,n){n=n||new Dr;const i=e.x,r=e.y;return n.x=this.a*i+this.c*r+this.tx,n.y=this.b*i+this.d*r+this.ty,n}applyInverse(e,n){n=n||new Dr;const i=this.a,r=this.b,s=this.c,l=this.d,c=this.tx,d=this.ty,p=1/(i*l+s*-r),m=e.x,g=e.y;return n.x=l*p*m+-s*p*g+(d*s-c*l)*p,n.y=i*p*g+-r*p*m+(-d*i+c*r)*p,n}translate(e,n){return this.tx+=e,this.ty+=n,this}scale(e,n){return this.a*=e,this.d*=n,this.c*=e,this.b*=n,this.tx*=e,this.ty*=n,this}rotate(e){const n=Math.cos(e),i=Math.sin(e),r=this.a,s=this.c,l=this.tx;return this.a=r*n-this.b*i,this.b=r*i+this.b*n,this.c=s*n-this.d*i,this.d=s*i+this.d*n,this.tx=l*n-this.ty*i,this.ty=l*i+this.ty*n,this}append(e){const n=this.a,i=this.b,r=this.c,s=this.d;return this.a=e.a*n+e.b*r,this.b=e.a*i+e.b*s,this.c=e.c*n+e.d*r,this.d=e.c*i+e.d*s,this.tx=e.tx*n+e.ty*r+this.tx,this.ty=e.tx*i+e.ty*s+this.ty,this}appendFrom(e,n){const i=e.a,r=e.b,s=e.c,l=e.d,c=e.tx,d=e.ty,p=n.a,m=n.b,g=n.c,b=n.d;return this.a=i*p+r*g,this.b=i*m+r*b,this.c=s*p+l*g,this.d=s*m+l*b,this.tx=c*p+d*g+n.tx,this.ty=c*m+d*b+n.ty,this}setTransform(e,n,i,r,s,l,c,d,p){return this.a=Math.cos(c+p)*s,this.b=Math.sin(c+p)*s,this.c=-Math.sin(c-d)*l,this.d=Math.cos(c-d)*l,this.tx=e-(i*this.a+r*this.c),this.ty=n-(i*this.b+r*this.d),this}prepend(e){const n=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const i=this.a,r=this.c;this.a=i*e.a+this.b*e.c,this.b=i*e.b+this.b*e.d,this.c=r*e.a+this.d*e.c,this.d=r*e.b+this.d*e.d}return this.tx=n*e.a+this.ty*e.c+e.tx,this.ty=n*e.b+this.ty*e.d+e.ty,this}decompose(e){const n=this.a,i=this.b,r=this.c,s=this.d,l=e.pivot,c=-Math.atan2(-r,s),d=Math.atan2(i,n),p=Math.abs(c+d);return p<1e-5||Math.abs(n4-p)<1e-5?(e.rotation=d,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=c,e.skew.y=d),e.scale.x=Math.sqrt(n*n+i*i),e.scale.y=Math.sqrt(r*r+s*s),e.position.x=this.tx+(l.x*n+l.y*r),e.position.y=this.ty+(l.x*i+l.y*s),e}invert(){const e=this.a,n=this.b,i=this.c,r=this.d,s=this.tx,l=e*r-n*i;return this.a=r/l,this.b=-n/l,this.c=-i/l,this.d=e/l,this.tx=(i*this.ty-r*s)/l,this.ty=-(e*this.ty-n*s)/l,this}isIdentity(){return this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.tx===0&&this.ty===0}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const e=new Ht;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}equals(e){return e.a===this.a&&e.b===this.b&&e.c===this.c&&e.d===this.d&&e.tx===this.tx&&e.ty===this.ty}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return s4.identity()}static get shared(){return a4.identity()}}const a4=new Ht,s4=new Ht,sf=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],lf=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],of=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],cf=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Uv=[],IC=[],Ay=Math.sign;function l4(){for(let t=0;t<16;t++){const e=[];Uv.push(e);for(let n=0;n<16;n++){const i=Ay(sf[t]*sf[n]+of[t]*lf[n]),r=Ay(lf[t]*sf[n]+cf[t]*lf[n]),s=Ay(sf[t]*of[n]+of[t]*cf[n]),l=Ay(lf[t]*of[n]+cf[t]*cf[n]);for(let c=0;c<16;c++)if(sf[c]===i&&lf[c]===r&&of[c]===s&&cf[c]===l){e.push(c);break}}}for(let t=0;t<16;t++){const e=new Ht;e.set(sf[t],lf[t],of[t],cf[t],0,0),IC.push(e)}}l4();const On={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:t=>sf[t],uY:t=>lf[t],vX:t=>of[t],vY:t=>cf[t],inv:t=>t&8?t&15:-t&7,add:(t,e)=>Uv[t][e],sub:(t,e)=>Uv[t][On.inv(e)],rotate180:t=>t^4,isVertical:t=>(t&3)===2,byDirection:(t,e)=>Math.abs(t)*2<=Math.abs(e)?e>=0?On.S:On.N:Math.abs(e)*2<=Math.abs(t)?t>0?On.E:On.W:e>0?t>0?On.SE:On.SW:t>0?On.NE:On.NW,matrixAppendRotationInv:(t,e,n=0,i=0,r=0,s=0)=>{const l=IC[On.inv(e)],c=l.a,d=l.b,p=l.c,m=l.d,g=n-Math.min(0,c*r,p*s,c*r+p*s),b=i-Math.min(0,d*r,m*s,d*r+m*s),v=t.a,_=t.b,C=t.c,T=t.d;t.a=c*v+d*C,t.b=c*_+d*T,t.c=p*v+m*C,t.d=p*_+m*T,t.tx=g*v+b*C+t.tx,t.ty=g*_+b*T+t.ty},transformRectCoords:(t,e,n,i)=>{const{x:r,y:s,width:l,height:c}=t,{x:d,y:p,width:m,height:g}=e;return n===On.E?(i.set(r+d,s+p,l,c),i):n===On.S?i.set(m-s-c+d,r+p,c,l):n===On.W?i.set(m-r-l+d,g-s-c+p,l,c):n===On.N?i.set(s+d,g-r-l+p,c,l):i.set(r+d,s+p,l,c)}},My=[new Dr,new Dr,new Dr,new Dr];class Ei{constructor(e=0,n=0,i=0,r=0){this.type="rectangle",this.x=Number(e),this.y=Number(n),this.width=Number(i),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 Ei(0,0,0,0)}clone(){return new Ei(this.x,this.y,this.width,this.height)}copyFromBounds(e){return this.x=e.minX,this.y=e.minY,this.width=e.maxX-e.minX,this.height=e.maxY-e.minY,this}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,n){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&n>=this.y&&n<this.y+this.height}strokeContains(e,n,i,r=.5){const{width:s,height:l}=this;if(s<=0||l<=0)return!1;const c=this.x,d=this.y,p=i*(1-r),m=i-p,g=c-p,b=c+s+p,v=d-p,_=d+l+p,C=c+m,T=c+s-m,w=d+m,k=d+l-m;return e>=g&&e<=b&&n>=v&&n<=_&&!(e>C&&e<T&&n>w&&n<k)}intersects(e,n){if(!n){const $=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=$)return!1;const I=this.y<e.y?e.y:this.y;return(this.bottom>e.bottom?e.bottom:this.bottom)>I}const i=this.left,r=this.right,s=this.top,l=this.bottom;if(r<=i||l<=s)return!1;const c=My[0].set(e.left,e.top),d=My[1].set(e.left,e.bottom),p=My[2].set(e.right,e.top),m=My[3].set(e.right,e.bottom);if(p.x<=c.x||d.y<=c.y)return!1;const g=Math.sign(n.a*n.d-n.b*n.c);if(g===0||(n.apply(c,c),n.apply(d,d),n.apply(p,p),n.apply(m,m),Math.max(c.x,d.x,p.x,m.x)<=i||Math.min(c.x,d.x,p.x,m.x)>=r||Math.max(c.y,d.y,p.y,m.y)<=s||Math.min(c.y,d.y,p.y,m.y)>=l))return!1;const b=g*(d.y-c.y),v=g*(c.x-d.x),_=b*i+v*s,C=b*r+v*s,T=b*i+v*l,w=b*r+v*l;if(Math.max(_,C,T,w)<=b*c.x+v*c.y||Math.min(_,C,T,w)>=b*m.x+v*m.y)return!1;const k=g*(c.y-p.y),R=g*(p.x-c.x),O=k*i+R*s,j=k*r+R*s,D=k*i+R*l,F=k*r+R*l;return!(Math.max(O,j,D,F)<=k*c.x+R*c.y||Math.min(O,j,D,F)>=k*m.x+R*m.y)}pad(e=0,n=e){return this.x-=e,this.y-=n,this.width+=e*2,this.height+=n*2,this}fit(e){const n=Math.max(this.x,e.x),i=Math.min(this.x+this.width,e.x+e.width),r=Math.max(this.y,e.y),s=Math.min(this.y+this.height,e.y+e.height);return this.x=n,this.width=Math.max(i-n,0),this.y=r,this.height=Math.max(s-r,0),this}ceil(e=1,n=.001){const i=Math.ceil((this.x+this.width-n)*e)/e,r=Math.ceil((this.y+this.height-n)*e)/e;return this.x=Math.floor((this.x+n)*e)/e,this.y=Math.floor((this.y+n)*e)/e,this.width=i-this.x,this.height=r-this.y,this}scale(e,n=e){return this.x*=e,this.y*=n,this.width*=e,this.height*=n,this}enlarge(e){const n=Math.min(this.x,e.x),i=Math.max(this.x+this.width,e.x+e.width),r=Math.min(this.y,e.y),s=Math.max(this.y+this.height,e.y+e.height);return this.x=n,this.width=i-n,this.y=r,this.height=s-r,this}getBounds(e){return e||(e=new Ei),e.copyFrom(this),e}containsRect(e){if(this.width<=0||this.height<=0)return!1;const n=e.x,i=e.y,r=e.x+e.width,s=e.y+e.height;return n>=this.x&&n<this.x+this.width&&i>=this.y&&i<this.y+this.height&&r>=this.x&&r<this.x+this.width&&s>=this.y&&s<this.y+this.height}set(e,n,i,r){return this.x=e,this.y=n,this.width=i,this.height=r,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const gx={default:-1};function gi(t="default"){return gx[t]===void 0&&(gx[t]=-1),++gx[t]}const mE=new Set,mi="8.0.0",o4="8.3.4",Yd={quiet:!1,noColor:!1},Qt=((t,e,n=3)=>{if(Yd.quiet||mE.has(e))return;let i=new Error().stack;const r=`${e}
|
|
62
|
+
Deprecated since v${t}`,s=typeof console.groupCollapsed=="function"&&!Yd.noColor;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",r):(i=i.split(`
|
|
63
|
+
`).splice(n).join(`
|
|
64
|
+
`),s?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",r),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",r),console.warn(i))),mE.add(e)});Object.defineProperties(Qt,{quiet:{get:()=>Yd.quiet,set:t=>{Yd.quiet=t},enumerable:!0,configurable:!1},noColor:{get:()=>Yd.noColor,set:t=>{Yd.noColor=t},enumerable:!0,configurable:!1}});const jC=()=>{};function ih(t){return t+=t===0?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t+1}function gE(t){return!(t&t-1)&&!!t}function HC(t){const e={};for(const n in t)t[n]!==void 0&&(e[n]=t[n]);return e}const yE=Object.create(null);function c4(t){const e=yE[t];return e===void 0&&(yE[t]=gi("resource")),e}const PC=class GC extends mo{constructor(e={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,e={...GC.defaultOptions,...e},this.addressMode=e.addressMode,this.addressModeU=e.addressModeU??this.addressModeU,this.addressModeV=e.addressModeV??this.addressModeV,this.addressModeW=e.addressModeW??this.addressModeW,this.scaleMode=e.scaleMode,this.magFilter=e.magFilter??this.magFilter,this.minFilter=e.minFilter??this.minFilter,this.mipmapFilter=e.mipmapFilter??this.mipmapFilter,this.lodMinClamp=e.lodMinClamp,this.lodMaxClamp=e.lodMaxClamp,this.compare=e.compare,this.maxAnisotropy=e.maxAnisotropy??1}set addressMode(e){this.addressModeU=e,this.addressModeV=e,this.addressModeW=e}get addressMode(){return this.addressModeU}set wrapMode(e){Qt(mi,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=e}get wrapMode(){return this.addressMode}set scaleMode(e){this.magFilter=e,this.minFilter=e,this.mipmapFilter=e}get scaleMode(){return this.magFilter}set maxAnisotropy(e){this._maxAnisotropy=Math.min(e,16),this._maxAnisotropy>1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this._sharedResourceId=null,this.emit("change",this)}_generateResourceId(){const e=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=c4(e),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};PC.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let rh=PC;const FC=class qC extends mo{constructor(e={}){super(),this.options=e,this._gpuData=Object.create(null),this._gcLastUsed=-1,this.uid=gi("textureSource"),this._resourceType="textureSource",this._resourceId=gi("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=!1,this.format="rgba8unorm",this.dimension="2d",this.viewDimension="2d",this.arrayLayerCount=1,this.antialias=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,e={...qC.defaultOptions,...e},this.label=e.label??"",this.resource=e.resource,this.autoGarbageCollect=e.autoGarbageCollect,this._resolution=e.resolution,e.width?this.pixelWidth=e.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,e.height?this.pixelHeight=e.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=e.format,this.dimension=e.dimensions,this.viewDimension=e.viewDimension??e.dimensions,this.arrayLayerCount=e.arrayLayerCount,this.mipLevelCount=e.mipLevelCount,this.autoGenerateMipmaps=e.autoGenerateMipmaps,this.sampleCount=e.sampleCount,this.antialias=e.antialias,this.alphaMode=e.alphaMode,this.style=new rh(HC(e)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(e){var n,i;this.style!==e&&((n=this._style)==null||n.off("change",this._onStyleChange,this),this._style=e,(i=this._style)==null||i.on("change",this._onStyleChange,this),this._onStyleChange())}set maxAnisotropy(e){this._style.maxAnisotropy=e}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(e){this._style.addressMode=e}get repeatMode(){return this._style.addressMode}set repeatMode(e){this._style.addressMode=e}get magFilter(){return this._style.magFilter}set magFilter(e){this._style.magFilter=e}get minFilter(){return this._style.minFilter}set minFilter(e){this._style.minFilter=e}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(e){this._style.mipmapFilter=e}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(e){this._style.lodMinClamp=e}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(e){this._style.lodMaxClamp=e}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){const e=this._resolution;if(this.resize(this.resourceWidth/e,this.resourceHeight/e))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){var e,n;this._resourceId=gi("resource"),this.emit("change",this),this.emit("unload",this);for(const i in this._gpuData)(n=(e=this._gpuData[i])==null?void 0:e.destroy)==null||n.call(e);this._gpuData=Object.create(null)}get resourceWidth(){const{resource:e}=this;return e.naturalWidth||e.videoWidth||e.displayWidth||e.width}get resourceHeight(){const{resource:e}=this;return e.naturalHeight||e.videoHeight||e.displayHeight||e.height}get resolution(){return this._resolution}set resolution(e){this._resolution!==e&&(this._resolution=e,this.width=this.pixelWidth/e,this.height=this.pixelHeight/e)}resize(e,n,i){i||(i=this._resolution),e||(e=this.width),n||(n=this.height);const r=Math.round(e*i),s=Math.round(n*i);return this.width=r/i,this.height=s/i,this._resolution=i,this.pixelWidth===r&&this.pixelHeight===s?!1:(this._refreshPOT(),this.pixelWidth=r,this.pixelHeight=s,this.emit("resize",this),this._resourceId=gi("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(e){this._style.wrapMode=e}get wrapMode(){return this._style.wrapMode}set scaleMode(e){this._style.scaleMode=e}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=gE(this.pixelWidth)&&gE(this.pixelHeight)}static test(e){throw new Error("Unimplemented")}};FC.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 Ls=FC;class G_ extends Ls{constructor(e){const n=e.resource||new Float32Array(e.width*e.height*4);let i=e.format;i||(n instanceof Float32Array?i="rgba32float":n instanceof Int32Array||n instanceof Uint32Array?i="rgba32uint":n instanceof Int16Array||n instanceof Uint16Array?i="rgba16uint":(n instanceof Int8Array,i="bgra8unorm")),super({...e,resource:n,format:i}),this.uploadMethodId="buffer"}static test(e){return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}}G_.extension=Rt.TextureSource;const bE=new Ht;class u4{constructor(e,n){this.mapCoord=new Ht,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,typeof n>"u"?this.clampMargin=e.width<10?0:.5:this.clampMargin=n,this.isSimple=!1,this.texture=e}get texture(){return this._texture}set texture(e){var n;this.texture!==e&&((n=this._texture)==null||n.removeListener("update",this.update,this),this._texture=e,this._texture.addListener("update",this.update,this),this.update())}multiplyUvs(e,n){n===void 0&&(n=e);const i=this.mapCoord;for(let r=0;r<e.length;r+=2){const s=e[r],l=e[r+1];n[r]=s*i.a+l*i.c+i.tx,n[r+1]=s*i.b+l*i.d+i.ty}return n}update(){const e=this._texture;this._updateID++;const n=e.uvs;this.mapCoord.set(n.x1-n.x0,n.y1-n.y0,n.x3-n.x0,n.y3-n.y0,n.x0,n.y0);const i=e.orig,r=e.trim;r&&(bE.set(i.width/r.width,0,0,i.height/r.height,-r.x/r.width,-r.y/r.height),this.mapCoord.append(bE));const s=e.source,l=this.uClampFrame,c=this.clampMargin/s._resolution,d=this.clampOffset/s._resolution;return l[0]=(e.frame.x+c+d)/s.width,l[1]=(e.frame.y+c+d)/s.height,l[2]=(e.frame.x+e.frame.width-c+d)/s.width,l[3]=(e.frame.y+e.frame.height-c+d)/s.height,this.uClampOffset[0]=this.clampOffset/s.pixelWidth,this.uClampOffset[1]=this.clampOffset/s.pixelHeight,this.isSimple=e.frame.width===s.width&&e.frame.height===s.height&&e.rotate===0,!0}}class Tn extends mo{constructor({source:e,label:n,frame:i,orig:r,trim:s,defaultAnchor:l,defaultBorders:c,rotate:d,dynamic:p}={}){if(super(),this.uid=gi("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new Ei,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=n,this.source=(e==null?void 0:e.source)??new Ls,this.noFrame=!i,i)this.frame.copyFrom(i);else{const{width:m,height:g}=this._source;this.frame.width=m,this.frame.height=g}this.orig=r||this.frame,this.trim=s,this.rotate=d??0,this.defaultAnchor=l,this.defaultBorders=c,this.destroyed=!1,this.dynamic=p||!1,this.updateUvs()}set source(e){this._source&&this._source.off("resize",this.update,this),this._source=e,e.on("resize",this.update,this),this.emit("update",this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new u4(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){const{uvs:e,frame:n}=this,{width:i,height:r}=this._source,s=n.x/i,l=n.y/r,c=n.width/i,d=n.height/r;let p=this.rotate;if(p){const m=c/2,g=d/2,b=s+m,v=l+g;p=On.add(p,On.NW),e.x0=b+m*On.uX(p),e.y0=v+g*On.uY(p),p=On.add(p,2),e.x1=b+m*On.uX(p),e.y1=v+g*On.uY(p),p=On.add(p,2),e.x2=b+m*On.uX(p),e.y2=v+g*On.uY(p),p=On.add(p,2),e.x3=b+m*On.uX(p),e.y3=v+g*On.uY(p)}else e.x0=s,e.y0=l,e.x1=s+c,e.y1=l,e.x2=s+c,e.y2=l+d,e.x3=s,e.y3=l+d}destroy(e=!1){this._source&&(this._source.off("resize",this.update,this),e&&(this._source.destroy(),this._source=null)),this._textureMatrix=null,this.destroyed=!0,this.emit("destroy",this),this.removeAllListeners()}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit("update",this)}get baseTexture(){return Qt(mi,"Texture.baseTexture is now Texture.source"),this._source}}Tn.EMPTY=new Tn({label:"EMPTY",source:new Ls({label:"EMPTY"})});Tn.EMPTY.destroy=jC;Tn.WHITE=new Tn({source:new G_({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"});Tn.WHITE.destroy=jC;function YC(t,e,n){const{width:i,height:r}=n.orig,s=n.trim;if(s){const l=s.width,c=s.height;t.minX=s.x-e._x*i,t.maxX=t.minX+l,t.minY=s.y-e._y*r,t.maxY=t.minY+c}else t.minX=-e._x*i,t.maxX=t.minX+i,t.minY=-e._y*r,t.maxY=t.minY+r}const xE=new Ht;class Bs{constructor(e=1/0,n=1/0,i=-1/0,r=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=xE,this.minX=e,this.minY=n,this.maxX=i,this.maxY=r}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new Ei);const e=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(e.x=0,e.y=0,e.width=0,e.height=0):e.copyFromBounds(this),e}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=xE,this}set(e,n,i,r){this.minX=e,this.minY=n,this.maxX=i,this.maxY=r}addFrame(e,n,i,r,s){s||(s=this.matrix);const l=s.a,c=s.b,d=s.c,p=s.d,m=s.tx,g=s.ty;let b=this.minX,v=this.minY,_=this.maxX,C=this.maxY,T=l*e+d*n+m,w=c*e+p*n+g;T<b&&(b=T),w<v&&(v=w),T>_&&(_=T),w>C&&(C=w),T=l*i+d*n+m,w=c*i+p*n+g,T<b&&(b=T),w<v&&(v=w),T>_&&(_=T),w>C&&(C=w),T=l*e+d*r+m,w=c*e+p*r+g,T<b&&(b=T),w<v&&(v=w),T>_&&(_=T),w>C&&(C=w),T=l*i+d*r+m,w=c*i+p*r+g,T<b&&(b=T),w<v&&(v=w),T>_&&(_=T),w>C&&(C=w),this.minX=b,this.minY=v,this.maxX=_,this.maxY=C}addRect(e,n){this.addFrame(e.x,e.y,e.x+e.width,e.y+e.height,n)}addBounds(e,n){this.addFrame(e.minX,e.minY,e.maxX,e.maxY,n)}addBoundsMask(e){this.minX=this.minX>e.minX?this.minX:e.minX,this.minY=this.minY>e.minY?this.minY:e.minY,this.maxX=this.maxX<e.maxX?this.maxX:e.maxX,this.maxY=this.maxY<e.maxY?this.maxY:e.maxY}applyMatrix(e){const n=this.minX,i=this.minY,r=this.maxX,s=this.maxY,{a:l,b:c,c:d,d:p,tx:m,ty:g}=e;let b=l*n+d*i+m,v=c*n+p*i+g;this.minX=b,this.minY=v,this.maxX=b,this.maxY=v,b=l*r+d*i+m,v=c*r+p*i+g,this.minX=b<this.minX?b:this.minX,this.minY=v<this.minY?v:this.minY,this.maxX=b>this.maxX?b:this.maxX,this.maxY=v>this.maxY?v:this.maxY,b=l*n+d*s+m,v=c*n+p*s+g,this.minX=b<this.minX?b:this.minX,this.minY=v<this.minY?v:this.minY,this.maxX=b>this.maxX?b:this.maxX,this.maxY=v>this.maxY?v:this.maxY,b=l*r+d*s+m,v=c*r+p*s+g,this.minX=b<this.minX?b:this.minX,this.minY=v<this.minY?v:this.minY,this.maxX=b>this.maxX?b:this.maxX,this.maxY=v>this.maxY?v:this.maxY}fit(e){return this.minX<e.left&&(this.minX=e.left),this.maxX>e.right&&(this.maxX=e.right),this.minY<e.top&&(this.minY=e.top),this.maxY>e.bottom&&(this.maxY=e.bottom),this}fitBounds(e,n,i,r){return this.minX<e&&(this.minX=e),this.maxX>n&&(this.maxX=n),this.minY<i&&(this.minY=i),this.maxY>r&&(this.maxY=r),this}pad(e,n=e){return this.minX-=e,this.maxX+=e,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 Bs(this.minX,this.minY,this.maxX,this.maxY)}scale(e,n=e){return this.minX*=e,this.minY*=n,this.maxX*=e,this.maxY*=n,this}get x(){return this.minX}set x(e){const n=this.maxX-this.minX;this.minX=e,this.maxX=e+n}get y(){return this.minY}set y(e){const n=this.maxY-this.minY;this.minY=e,this.maxY=e+n}get width(){return this.maxX-this.minX}set width(e){this.maxX=this.minX+e}get height(){return this.maxY-this.minY}set height(e){this.maxY=this.minY+e}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(e,n,i,r){let s=this.minX,l=this.minY,c=this.maxX,d=this.maxY;r||(r=this.matrix);const p=r.a,m=r.b,g=r.c,b=r.d,v=r.tx,_=r.ty;for(let C=n;C<i;C+=2){const T=e[C],w=e[C+1],k=p*T+g*w+v,R=m*T+b*w+_;s=k<s?k:s,l=R<l?R:l,c=k>c?k:c,d=R>d?R:d}this.minX=s,this.minY=l,this.maxX=c,this.maxY=d}containsPoint(e,n){return this.minX<=e&&this.minY<=n&&this.maxX>=e&&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(e){return this.minX=e.minX,this.minY=e.minY,this.maxX=e.maxX,this.maxY=e.maxY,this}}var f4={grad:.9,turn:360,rad:360/(2*Math.PI)},Wo=function(t){return typeof t=="string"?t.length>0:typeof t=="number"},ir=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=Math.pow(10,e)),Math.round(n*t)/n+0},Ds=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=1),t>n?n:t>e?t:e},VC=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},vE=function(t){return{r:Ds(t.r,0,255),g:Ds(t.g,0,255),b:Ds(t.b,0,255),a:Ds(t.a)}},yx=function(t){return{r:ir(t.r),g:ir(t.g),b:ir(t.b),a:ir(t.a,3)}},d4=/^#([0-9a-f]{3,8})$/i,Ry=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},XC=function(t){var e=t.r,n=t.g,i=t.b,r=t.a,s=Math.max(e,n,i),l=s-Math.min(e,n,i),c=l?s===e?(n-i)/l:s===n?2+(i-e)/l:4+(e-n)/l:0;return{h:60*(c<0?c+6:c),s:s?l/s*100:0,v:s/255*100,a:r}},KC=function(t){var e=t.h,n=t.s,i=t.v,r=t.a;e=e/360*6,n/=100,i/=100;var s=Math.floor(e),l=i*(1-n),c=i*(1-(e-s)*n),d=i*(1-(1-e+s)*n),p=s%6;return{r:255*[i,c,l,l,d,i][p],g:255*[d,i,i,c,l,l][p],b:255*[l,l,d,i,i,c][p],a:r}},_E=function(t){return{h:VC(t.h),s:Ds(t.s,0,100),l:Ds(t.l,0,100),a:Ds(t.a)}},SE=function(t){return{h:ir(t.h),s:ir(t.s),l:ir(t.l),a:ir(t.a,3)}},EE=function(t){return KC((n=(e=t).s,{h:e.h,s:(n*=((i=e.l)<50?i:100-i)/100)>0?2*n/(i+n)*100:0,v:i+n,a:e.a}));var e,n,i},bm=function(t){return{h:(e=XC(t)).h,s:(r=(200-(n=e.s))*(i=e.v)/100)>0&&r<200?n*i/100/(r<=100?r:200-r)*100:0,l:r/2,a:e.a};var e,n,i,r},h4=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,p4=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,m4=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,g4=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Iv={string:[[function(t){var e=d4.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?ir(parseInt(t[3]+t[3],16)/255,2):1}:t.length===6||t.length===8?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:t.length===8?ir(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=m4.exec(t)||g4.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:vE({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=h4.exec(t)||p4.exec(t);if(!e)return null;var n,i,r=_E({h:(n=e[1],i=e[2],i===void 0&&(i="deg"),Number(n)*(f4[i]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return EE(r)},"hsl"]],object:[[function(t){var e=t.r,n=t.g,i=t.b,r=t.a,s=r===void 0?1:r;return Wo(e)&&Wo(n)&&Wo(i)?vE({r:Number(e),g:Number(n),b:Number(i),a:Number(s)}):null},"rgb"],[function(t){var e=t.h,n=t.s,i=t.l,r=t.a,s=r===void 0?1:r;if(!Wo(e)||!Wo(n)||!Wo(i))return null;var l=_E({h:Number(e),s:Number(n),l:Number(i),a:Number(s)});return EE(l)},"hsl"],[function(t){var e=t.h,n=t.s,i=t.v,r=t.a,s=r===void 0?1:r;if(!Wo(e)||!Wo(n)||!Wo(i))return null;var l=(function(c){return{h:VC(c.h),s:Ds(c.s,0,100),v:Ds(c.v,0,100),a:Ds(c.a)}})({h:Number(e),s:Number(n),v:Number(i),a:Number(s)});return KC(l)},"hsv"]]},wE=function(t,e){for(var n=0;n<e.length;n++){var i=e[n][0](t);if(i)return[i,e[n][1]]}return[null,void 0]},y4=function(t){return typeof t=="string"?wE(t.trim(),Iv.string):typeof t=="object"&&t!==null?wE(t,Iv.object):[null,void 0]},bx=function(t,e){var n=bm(t);return{h:n.h,s:Ds(n.s+100*e,0,100),l:n.l,a:n.a}},xx=function(t){return(299*t.r+587*t.g+114*t.b)/1e3/255},TE=function(t,e){var n=bm(t);return{h:n.h,s:n.s,l:Ds(n.l+100*e,0,100),a:n.a}},jv=(function(){function t(e){this.parsed=y4(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return t.prototype.isValid=function(){return this.parsed!==null},t.prototype.brightness=function(){return ir(xx(this.rgba),2)},t.prototype.isDark=function(){return xx(this.rgba)<.5},t.prototype.isLight=function(){return xx(this.rgba)>=.5},t.prototype.toHex=function(){return e=yx(this.rgba),n=e.r,i=e.g,r=e.b,l=(s=e.a)<1?Ry(ir(255*s)):"","#"+Ry(n)+Ry(i)+Ry(r)+l;var e,n,i,r,s,l},t.prototype.toRgb=function(){return yx(this.rgba)},t.prototype.toRgbString=function(){return e=yx(this.rgba),n=e.r,i=e.g,r=e.b,(s=e.a)<1?"rgba("+n+", "+i+", "+r+", "+s+")":"rgb("+n+", "+i+", "+r+")";var e,n,i,r,s},t.prototype.toHsl=function(){return SE(bm(this.rgba))},t.prototype.toHslString=function(){return e=SE(bm(this.rgba)),n=e.h,i=e.s,r=e.l,(s=e.a)<1?"hsla("+n+", "+i+"%, "+r+"%, "+s+")":"hsl("+n+", "+i+"%, "+r+"%)";var e,n,i,r,s},t.prototype.toHsv=function(){return e=XC(this.rgba),{h:ir(e.h),s:ir(e.s),v:ir(e.v),a:ir(e.a,3)};var e},t.prototype.invert=function(){return so({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},t.prototype.saturate=function(e){return e===void 0&&(e=.1),so(bx(this.rgba,e))},t.prototype.desaturate=function(e){return e===void 0&&(e=.1),so(bx(this.rgba,-e))},t.prototype.grayscale=function(){return so(bx(this.rgba,-1))},t.prototype.lighten=function(e){return e===void 0&&(e=.1),so(TE(this.rgba,e))},t.prototype.darken=function(e){return e===void 0&&(e=.1),so(TE(this.rgba,-e))},t.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},t.prototype.alpha=function(e){return typeof e=="number"?so({r:(n=this.rgba).r,g:n.g,b:n.b,a:e}):ir(this.rgba.a,3);var n},t.prototype.hue=function(e){var n=bm(this.rgba);return typeof e=="number"?so({h:e,s:n.s,l:n.l,a:n.a}):ir(n.h)},t.prototype.isEqual=function(e){return this.toHex()===so(e).toHex()},t})(),so=function(t){return t instanceof jv?t:new jv(t)},CE=[],b4=function(t){t.forEach(function(e){CE.indexOf(e)<0&&(e(jv,Iv),CE.push(e))})};function x4(t,e){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"},i={};for(var r in n)i[n[r]]=r;var s={};t.prototype.toName=function(l){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var c,d,p=i[this.toHex()];if(p)return p;if(l!=null&&l.closest){var m=this.toRgb(),g=1/0,b="black";if(!s.length)for(var v in n)s[v]=new t(n[v]).toRgb();for(var _ in n){var C=(c=m,d=s[_],Math.pow(c.r-d.r,2)+Math.pow(c.g-d.g,2)+Math.pow(c.b-d.b,2));C<g&&(g=C,b=_)}return b}},e.string.push([function(l){var c=l.toLowerCase(),d=c==="transparent"?"#0000":n[c];return d?new t(d).toRgb():null},"name"])}b4([x4]);const ah=class um{constructor(e=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=e}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(e){return this.value=e,this}set value(e){if(e instanceof um)this._value=this._cloneSource(e._value),this._int=e._int,this._components.set(e._components);else{if(e===null)throw new Error("Cannot set Color#value to null");(this._value===null||!this._isSourceEqual(this._value,e))&&(this._value=this._cloneSource(e),this._normalize(this._value))}}get value(){return this._value}_cloneSource(e){return typeof e=="string"||typeof e=="number"||e instanceof Number||e===null?e:Array.isArray(e)||ArrayBuffer.isView(e)?e.slice(0):typeof e=="object"&&e!==null?{...e}:e}_isSourceEqual(e,n){const i=typeof e;if(i!==typeof n)return!1;if(i==="number"||i==="string"||e instanceof Number)return e===n;if(Array.isArray(e)&&Array.isArray(n)||ArrayBuffer.isView(e)&&ArrayBuffer.isView(n))return e.length!==n.length?!1:e.every((s,l)=>s===n[l]);if(e!==null&&n!==null){const s=Object.keys(e),l=Object.keys(n);return s.length!==l.length?!1:s.every(c=>e[c]===n[c])}return e===n}toRgba(){const[e,n,i,r]=this._components;return{r:e,g:n,b:i,a:r}}toRgb(){const[e,n,i]=this._components;return{r:e,g:n,b:i}}toRgbaString(){const[e,n,i]=this.toUint8RgbArray();return`rgba(${e},${n},${i},${this.alpha})`}toUint8RgbArray(e){const[n,i,r]=this._components;return this._arrayRgb||(this._arrayRgb=[]),e||(e=this._arrayRgb),e[0]=Math.round(n*255),e[1]=Math.round(i*255),e[2]=Math.round(r*255),e}toArray(e){this._arrayRgba||(this._arrayRgba=[]),e||(e=this._arrayRgba);const[n,i,r,s]=this._components;return e[0]=n,e[1]=i,e[2]=r,e[3]=s,e}toRgbArray(e){this._arrayRgb||(this._arrayRgb=[]),e||(e=this._arrayRgb);const[n,i,r]=this._components;return e[0]=n,e[1]=i,e[2]=r,e}toNumber(){return this._int}toBgrNumber(){const[e,n,i]=this.toUint8RgbArray();return(i<<16)+(n<<8)+e}toLittleEndianNumber(){const e=this._int;return(e>>16)+(e&65280)+((e&255)<<16)}multiply(e){const[n,i,r,s]=um._temp.setValue(e)._components;return this._components[0]*=n,this._components[1]*=i,this._components[2]*=r,this._components[3]*=s,this._refreshInt(),this._value=null,this}premultiply(e,n=!0){return n&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this._refreshInt(),this._value=null,this}toPremultiplied(e,n=!0){if(e===1)return(255<<24)+this._int;if(e===0)return n?0:this._int;let i=this._int>>16&255,r=this._int>>8&255,s=this._int&255;return n&&(i=i*e+.5|0,r=r*e+.5|0,s=s*e+.5|0),(e*255<<24)+(i<<16)+(r<<8)+s}toHex(){const e=this._int.toString(16);return`#${"000000".substring(0,6-e.length)+e}`}toHexa(){const n=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-n.length)+n}setAlpha(e){return this._components[3]=this._clamp(e),this._value=null,this}_normalize(e){let n,i,r,s;if((typeof e=="number"||e instanceof Number)&&e>=0&&e<=16777215){const l=e;n=(l>>16&255)/255,i=(l>>8&255)/255,r=(l&255)/255,s=1}else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[n,i,r,s=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[n,i,r,s=255]=e,n/=255,i/=255,r/=255,s/=255;else if(typeof e=="string"||typeof e=="object"){if(typeof e=="string"){const c=um.HEX_PATTERN.exec(e);c&&(e=`#${c[2]}`)}const l=so(e);l.isValid()&&({r:n,g:i,b:r,a:s}=l.rgba,n/=255,i/=255,r/=255)}if(n!==void 0)this._components[0]=n,this._components[1]=i,this._components[2]=r,this._components[3]=s,this._refreshInt();else throw new Error(`Unable to convert color ${e}`)}_refreshInt(){this._clamp(this._components);const[e,n,i]=this._components;this._int=(e*255<<16)+(n*255<<8)+(i*255|0)}_clamp(e,n=0,i=1){return typeof e=="number"?Math.min(Math.max(e,n),i):(e.forEach((r,s)=>{e[s]=Math.min(Math.max(r,n),i)}),e)}static isColorLike(e){return typeof e=="number"||typeof e=="string"||e instanceof Number||e instanceof um||Array.isArray(e)||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Float32Array||e.r!==void 0&&e.g!==void 0&&e.b!==void 0||e.r!==void 0&&e.g!==void 0&&e.b!==void 0&&e.a!==void 0||e.h!==void 0&&e.s!==void 0&&e.l!==void 0||e.h!==void 0&&e.s!==void 0&&e.l!==void 0&&e.a!==void 0||e.h!==void 0&&e.s!==void 0&&e.v!==void 0||e.h!==void 0&&e.s!==void 0&&e.v!==void 0&&e.a!==void 0}};ah.shared=new ah;ah._temp=new ah;ah.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let Gi=ah;const v4={cullArea:null,cullable:!1,cullableChildren:!0};let vx=0;const AE=500;function ca(...t){vx!==AE&&(vx++,vx===AE?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...t))}const Xm={_registeredResources:new Set,register(t){this._registeredResources.add(t)},unregister(t){this._registeredResources.delete(t)},release(){this._registeredResources.forEach(t=>t.clear())},get registeredCount(){return this._registeredResources.size},isRegistered(t){return this._registeredResources.has(t)},reset(){this._registeredResources.clear()}};class _4{constructor(e,n){this._pool=[],this._count=0,this._index=0,this._classType=e,n&&this.prepopulate(n)}prepopulate(e){for(let n=0;n<e;n++)this._pool[this._index++]=new this._classType;this._count+=e}get(e){var i;let n;return this._index>0?n=this._pool[--this._index]:(n=new this._classType,this._count++),(i=n.init)==null||i.call(n,e),n}return(e){var n;(n=e.reset)==null||n.call(e),this._pool[this._index++]=e}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){if(this._pool.length>0&&this._pool[0].destroy)for(let e=0;e<this._index;e++)this._pool[e].destroy();this._pool.length=0,this._count=0,this._index=0}}class S4{constructor(){this._poolsByClass=new Map}prepopulate(e,n){this.getPool(e).prepopulate(n)}get(e,n){return this.getPool(e).get(n)}return(e){this.getPool(e.constructor).return(e)}getPool(e){return this._poolsByClass.has(e)||this._poolsByClass.set(e,new _4(e)),this._poolsByClass.get(e)}stats(){const e={};return this._poolsByClass.forEach(n=>{const i=e[n._classType.name]?n._classType.name+n._classType.ID:n._classType.name;e[i]={free:n.totalFree,used:n.totalUsed,size:n.totalSize}}),e}clear(){this._poolsByClass.forEach(e=>e.clear()),this._poolsByClass.clear()}}const Ra=new S4;Xm.register(Ra);const E4={get isCachedAsTexture(){var t;return!!((t=this.renderGroup)!=null&&t.isCachedAsTexture)},cacheAsTexture(t){typeof t=="boolean"&&t===!1?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(t===!0?{}:t))},updateCacheTexture(){var t;(t=this.renderGroup)==null||t.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(t){Qt("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(t)}};function w4(t,e,n){const i=t.length;let r;if(e>=i||n===0)return;n=e+n>i?i-e:n;const s=i-n;for(r=e;r<s;++r)t[r]=t[r+n];t.length=s}const T4={allowChildren:!0,removeChildren(t=0,e){var s;const n=e??this.children.length,i=n-t,r=[];if(i>0&&i<=n){for(let c=n-1;c>=t;c--){const d=this.children[c];d&&(r.push(d),d.parent=null)}w4(this.children,t,n);const l=this.renderGroup||this.parentRenderGroup;l&&l.removeChildren(r);for(let c=0;c<r.length;++c){const d=r[c];(s=d.parentRenderLayer)==null||s.detach(d),this.emit("childRemoved",d,this,c),r[c].emit("removed",this)}return r.length>0&&this._didViewChangeTick++,r}else if(i===0&&this.children.length===0)return r;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(t){const e=this.getChildAt(t);return this.removeChild(e)},getChildAt(t){if(t<0||t>=this.children.length)throw new Error(`getChildAt: Index (${t}) does not exist.`);return this.children[t]},setChildIndex(t,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);this.getChildIndex(t),this.addChildAt(t,e)},getChildIndex(t){const e=this.children.indexOf(t);if(e===-1)throw new Error("The supplied Container must be a child of the caller");return e},addChildAt(t,e){this.allowChildren||Qt(mi,"addChildAt: Only Containers will be allowed to add children in v8.0.0");const{children:n}=this;if(e<0||e>n.length)throw new Error(`${t}addChildAt: The index ${e} supplied is out of bounds ${n.length}`);const i=t.parent===this;if(t.parent){const s=t.parent.children.indexOf(t);if(i){if(s===e)return t;t.parent.children.splice(s,1)}else t.removeFromParent()}e===n.length?n.push(t):n.splice(e,0,t),t.parent=this,t.didChange=!0,t._updateFlags=15;const r=this.renderGroup||this.parentRenderGroup;return r&&r.addChild(t),this.sortableChildren&&(this.sortDirty=!0),i||(this.emit("childAdded",t,this,e),t.emit("added",this)),t},swapChildren(t,e){if(t===e)return;const n=this.getChildIndex(t),i=this.getChildIndex(e);this.children[n]=e,this.children[i]=t;const r=this.renderGroup||this.parentRenderGroup;r&&(r.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){var t;(t=this.parent)==null||t.removeChild(this)},reparentChild(...t){return t.length===1?this.reparentChildAt(t[0],this.children.length):(t.forEach(e=>this.reparentChildAt(e,this.children.length)),t[0])},reparentChildAt(t,e){if(t.parent===this)return this.setChildIndex(t,e),t;const n=t.worldTransform.clone();t.removeFromParent(),this.addChildAt(t,e);const i=this.worldTransform.clone();return i.invert(),n.prepend(i),t.setFromMatrix(n),t},replaceChild(t,e){t.updateLocalTransform(),this.addChildAt(e,this.getChildIndex(t)),e.setFromMatrix(t.localTransform),e.updateLocalTransform(),this.removeChild(t)}},C4={collectRenderables(t,e,n){this.parentRenderLayer&&this.parentRenderLayer!==n||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(t,e,n):this.renderGroup?e.renderPipes.renderGroup.addRenderGroup(this.renderGroup,t):this.collectRenderablesWithEffects(t,e,n))},collectRenderablesSimple(t,e,n){const i=this.children,r=i.length;for(let s=0;s<r;s++)i[s].collectRenderables(t,e,n)},collectRenderablesWithEffects(t,e,n){const{renderPipes:i}=e;for(let r=0;r<this.effects.length;r++){const s=this.effects[r];i[s.pipe].push(s,this,t)}this.collectRenderablesSimple(t,e,n);for(let r=this.effects.length-1;r>=0;r--){const s=this.effects[r];i[s.pipe].pop(s,this,t)}}};class ME{constructor(){this.pipe="filter",this.priority=1}destroy(){for(let e=0;e<this.filters.length;e++)this.filters[e].destroy();this.filters=null,this.filterArea=null}}class A4{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEach(e=>{this.add({test:e.test,maskClass:e})}))}add(e){this._tests.push(e)}getMaskEffect(e){this._initialized||this.init();for(let n=0;n<this._tests.length;n++){const i=this._tests[n];if(i.test(e))return Ra.get(i.maskClass,e)}return e}returnMaskEffect(e){Ra.return(e)}}const Hv=new A4;si.handleByList(Rt.MaskEffect,Hv._effectClasses);const M4={_maskEffect:null,_maskOptions:{inverse:!1},_filterEffect:null,effects:[],_markStructureAsChanged(){const t=this.renderGroup||this.parentRenderGroup;t&&(t.structureDidChange=!0)},addEffect(t){this.effects.indexOf(t)===-1&&(this.effects.push(t),this.effects.sort((n,i)=>n.priority-i.priority),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(t){const e=this.effects.indexOf(t);e!==-1&&(this.effects.splice(e,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(t){const e=this._maskEffect;(e==null?void 0:e.mask)!==t&&(e&&(this.removeEffect(e),Hv.returnMaskEffect(e),this._maskEffect=null),t!=null&&(this._maskEffect=Hv.getMaskEffect(t),this.addEffect(this._maskEffect)))},get mask(){var t;return(t=this._maskEffect)==null?void 0:t.mask},setMask(t){this._maskOptions={...this._maskOptions,...t},t.mask&&(this.mask=t.mask),this._markStructureAsChanged()},set filters(t){var s;!Array.isArray(t)&&t&&(t=[t]);const e=this._filterEffect||(this._filterEffect=new ME);t=t;const n=(t==null?void 0:t.length)>0,i=((s=e.filters)==null?void 0:s.length)>0,r=n!==i;t=Array.isArray(t)?t.slice(0):t,e.filters=Object.freeze(t),r&&(n?this.addEffect(e):(this.removeEffect(e),e.filters=t??null))},get filters(){var t;return(t=this._filterEffect)==null?void 0:t.filters},set filterArea(t){this._filterEffect||(this._filterEffect=new ME),this._filterEffect.filterArea=t},get filterArea(){var t;return(t=this._filterEffect)==null?void 0:t.filterArea}},R4={label:null,get name(){return Qt(mi,"Container.name property has been removed, use Container.label instead"),this.label},set name(t){Qt(mi,"Container.name property has been removed, use Container.label instead"),this.label=t},getChildByName(t,e=!1){return this.getChildByLabel(t,e)},getChildByLabel(t,e=!1){const n=this.children;for(let i=0;i<n.length;i++){const r=n[i];if(r.label===t||t instanceof RegExp&&t.test(r.label))return r}if(e)for(let i=0;i<n.length;i++){const s=n[i].getChildByLabel(t,!0);if(s)return s}return null},getChildrenByLabel(t,e=!1,n=[]){const i=this.children;for(let r=0;r<i.length;r++){const s=i[r];(s.label===t||t instanceof RegExp&&t.test(s.label))&&n.push(s)}if(e)for(let r=0;r<i.length;r++)i[r].getChildrenByLabel(t,!0,n);return n}},oa=Ra.getPool(Ht),nc=Ra.getPool(Bs),N4=new Ht,k4={getFastGlobalBounds(t,e){e||(e=new Bs),e.clear(),this._getGlobalBoundsRecursive(!!t,e,this.parentRenderLayer),e.isValid||e.set(0,0,0,0);const n=this.renderGroup||this.parentRenderGroup;return e.applyMatrix(n.worldTransform),e},_getGlobalBoundsRecursive(t,e,n){let i=e;if(t&&this.parentRenderLayer&&this.parentRenderLayer!==n||this.localDisplayStatus!==7||!this.measurable)return;const r=!!this.effects.length;if((this.renderGroup||r)&&(i=nc.get().clear()),this.boundsArea)e.addRect(this.boundsArea,this.worldTransform);else{if(this.renderPipeId){const l=this.bounds;i.addFrame(l.minX,l.minY,l.maxX,l.maxY,this.groupTransform)}const s=this.children;for(let l=0;l<s.length;l++)s[l]._getGlobalBoundsRecursive(t,i,n)}if(r){let s=!1;const l=this.renderGroup||this.parentRenderGroup;for(let c=0;c<this.effects.length;c++)this.effects[c].addBounds&&(s||(s=!0,i.applyMatrix(l.worldTransform)),this.effects[c].addBounds(i,!0));s&&i.applyMatrix(l.worldTransform.copyTo(N4).invert()),e.addBounds(i),nc.return(i)}else this.renderGroup&&(e.addBounds(i,this.relativeGroupTransform),nc.return(i))}};function WC(t,e,n){n.clear();let i,r;return t.parent?e?i=t.parent.worldTransform:(r=oa.get().identity(),i=F_(t,r)):i=Ht.IDENTITY,$C(t,n,i,e),r&&oa.return(r),n.isValid||n.set(0,0,0,0),n}function $C(t,e,n,i){var c,d;if(!t.visible||!t.measurable)return;let r;i?r=t.worldTransform:(t.updateLocalTransform(),r=oa.get(),r.appendFrom(t.localTransform,n));const s=e,l=!!t.effects.length;if(l&&(e=nc.get().clear()),t.boundsArea)e.addRect(t.boundsArea,r);else{const p=t.bounds;p&&!p.isEmpty()&&(e.matrix=r,e.addBounds(p));for(let m=0;m<t.children.length;m++)$C(t.children[m],e,r,i)}if(l){for(let p=0;p<t.effects.length;p++)(d=(c=t.effects[p]).addBounds)==null||d.call(c,e);s.addBounds(e,Ht.IDENTITY),nc.return(e)}i||oa.return(r)}function F_(t,e){const n=t.parent;return n&&(F_(n,e),n.updateLocalTransform(),e.append(n.localTransform)),e}function ZC(t,e){if(t===16777215||!e)return e;if(e===16777215||!t)return t;const n=t>>16&255,i=t>>8&255,r=t&255,s=e>>16&255,l=e>>8&255,c=e&255,d=n*s/255|0,p=i*l/255|0,m=r*c/255|0;return(d<<16)+(p<<8)+m}const RE=16777215;function NE(t,e){return t===RE?e:e===RE?t:ZC(t,e)}function h0(t){return((t&255)<<16)+(t&65280)+(t>>16&255)}const O4={getGlobalAlpha(t){if(t)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let e=this.alpha,n=this.parent;for(;n;)e*=n.alpha,n=n.parent;return e},getGlobalTransform(t=new Ht,e){if(e)return t.copyFrom(this.worldTransform);this.updateLocalTransform();const n=F_(this,oa.get().identity());return t.appendFrom(this.localTransform,n),oa.return(n),t},getGlobalTint(t){if(t)return this.renderGroup?h0(this.renderGroup.worldColor):this.parentRenderGroup?h0(NE(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let e=this.localColor,n=this.parent;for(;n;)e=NE(e,n.localColor),n=n.parent;return h0(e)}};function QC(t,e,n){return e.clear(),n||(n=Ht.IDENTITY),JC(t,e,n,t,!0),e.isValid||e.set(0,0,0,0),e}function JC(t,e,n,i,r){var d,p;let s;if(r)s=oa.get(),s=n.copyTo(s);else{if(!t.visible||!t.measurable)return;t.updateLocalTransform();const m=t.localTransform;s=oa.get(),s.appendFrom(m,n)}const l=e,c=!!t.effects.length;if(c&&(e=nc.get().clear()),t.boundsArea)e.addRect(t.boundsArea,s);else{t.renderPipeId&&(e.matrix=s,e.addBounds(t.bounds));const m=t.children;for(let g=0;g<m.length;g++)JC(m[g],e,s,i,!1)}if(c){for(let m=0;m<t.effects.length;m++)(p=(d=t.effects[m]).addLocalBounds)==null||p.call(d,e,i);l.addBounds(e,Ht.IDENTITY),nc.return(e)}oa.return(s)}function eA(t,e){const n=t.children;for(let i=0;i<n.length;i++){const r=n[i],s=r.uid,l=(r._didViewChangeTick&65535)<<16|r._didContainerChangeTick&65535,c=e.index;(e.data[c]!==s||e.data[c+1]!==l)&&(e.data[e.index]=s,e.data[e.index+1]=l,e.didChange=!0),e.index=c+2,r.children.length&&eA(r,e)}return e.didChange}const D4=new Ht,z4={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(t,e){const n=Math.sign(this.scale.x)||1;e!==0?this.scale.x=t/e*n:this.scale.x=n},_setHeight(t,e){const n=Math.sign(this.scale.y)||1;e!==0?this.scale.y=t/e*n:this.scale.y=n},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:!1,localBounds:new Bs});const t=this._localBoundsCacheData;return t.index=1,t.didChange=!1,t.data[0]!==this._didViewChangeTick&&(t.didChange=!0,t.data[0]=this._didViewChangeTick),eA(this,t),t.didChange&&QC(this,t.localBounds,D4),t.localBounds},getBounds(t,e){return WC(this,t,e||new Bs)}},B4={_onRender:null,set onRender(t){const e=this.renderGroup||this.parentRenderGroup;if(!t){this._onRender&&(e==null||e.removeOnRender(this)),this._onRender=null;return}this._onRender||e==null||e.addOnRender(this),this._onRender=t},get onRender(){return this._onRender}},L4={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(t){this._zIndex!==t&&(this._zIndex=t,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(U4))}};function U4(t,e){return t._zIndex-e._zIndex}const I4={getGlobalPosition(t=new Dr,e=!1){return this.parent?this.parent.toGlobal(this._position,t,e):(t.x=this._position.x,t.y=this._position.y),t},toGlobal(t,e,n=!1){const i=this.getGlobalTransform(oa.get(),n);return e=i.apply(t,e),oa.return(i),e},toLocal(t,e,n,i){e&&(t=e.toGlobal(t,n,i));const r=this.getGlobalTransform(oa.get(),i);return n=r.applyInverse(t,n),oa.return(r),n}};class q_{constructor(){this.uid=gi("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0}reset(){this.instructionSize=0}destroy(){this.instructions.length=0,this.renderables.length=0,this.renderPipes=null,this.gcTick=0}add(e){this.instructions[this.instructionSize++]=e}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"])}}let j4=0;class H4{constructor(e){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this.textureStyle=new rh(this.textureOptions)}createTexture(e,n,i,r){const s=new Ls({...this.textureOptions,width:e,height:n,resolution:1,antialias:i,autoGarbageCollect:!1,autoGenerateMipmaps:r});return new Tn({source:s,label:`texturePool_${j4++}`})}getOptimalTexture(e,n,i=1,r,s=!1){let l=Math.ceil(e*i-1e-6),c=Math.ceil(n*i-1e-6);l=ih(l),c=ih(c);const d=r?1:0,p=s?1:0,m=(l<<17)+(c<<2)+(p<<1)+d;this._texturePool[m]||(this._texturePool[m]=[]);let g=this._texturePool[m].pop();return g||(g=this.createTexture(l,c,r,s)),g.source._resolution=i,g.source.width=l/i,g.source.height=c/i,g.source.pixelWidth=l,g.source.pixelHeight=c,g.frame.x=0,g.frame.y=0,g.frame.width=e,g.frame.height=n,g.updateUvs(),this._poolKeyHash[g.uid]=m,g}getSameSizeTexture(e,n=!1){const i=e.source;return this.getOptimalTexture(e.width,e.height,i._resolution,n)}returnTexture(e,n=!1){const i=this._poolKeyHash[e.uid];n&&(e.source.style=this.textureStyle),this._texturePool[i].push(e)}clear(e){if(e=e!==!1,e)for(const n in this._texturePool){const i=this._texturePool[n];if(i)for(let r=0;r<i.length;r++)i[r].destroy(!0)}this._texturePool={}}}const Z0=new H4;Xm.register(Z0);class P4{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new Ht,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 q_,this._onRenderContainers=[],this.textureNeedsUpdate=!0,this.isCachedAsTexture=!1,this._matrixDirty=7}init(e){this.root=e,e._onRender&&this.addOnRender(e),e.didChange=!0;const n=e.children;for(let i=0;i<n.length;i++){const r=n[i];r._updateFlags=15,this.addChild(r)}}enableCacheAsTexture(e={}){this.textureOptions=e,this.isCachedAsTexture=!0,this.textureNeedsUpdate=!0}disableCacheAsTexture(){this.isCachedAsTexture=!1,this.texture&&(Z0.returnTexture(this.texture,!0),this.texture=null)}updateCacheTexture(){this.textureNeedsUpdate=!0;const e=this._parentCacheAsTextureRenderGroup;e&&!e.textureNeedsUpdate&&e.updateCacheTexture()}reset(){this.renderGroupChildren.length=0;for(const e in this.childrenToUpdate){const n=this.childrenToUpdate[e];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(e){e.renderGroupParent&&e.renderGroupParent._removeRenderGroupChild(e),e.renderGroupParent=this,this.renderGroupChildren.push(e)}_removeRenderGroupChild(e){const n=this.renderGroupChildren.indexOf(e);n>-1&&this.renderGroupChildren.splice(n,1),e.renderGroupParent=null}addChild(e){if(this.structureDidChange=!0,e.parentRenderGroup=this,e.updateTick=-1,e.parent===this.root?e.relativeRenderGroupDepth=1:e.relativeRenderGroupDepth=e.parent.relativeRenderGroupDepth+1,e.didChange=!0,this.onChildUpdate(e),e.renderGroup){this.addRenderGroupChild(e.renderGroup);return}e._onRender&&this.addOnRender(e);const n=e.children;for(let i=0;i<n.length;i++)this.addChild(n[i])}removeChild(e){if(this.structureDidChange=!0,e._onRender&&(e.renderGroup||this.removeOnRender(e)),e.parentRenderGroup=null,e.renderGroup){this._removeRenderGroupChild(e.renderGroup);return}const n=e.children;for(let i=0;i<n.length;i++)this.removeChild(n[i])}removeChildren(e){for(let n=0;n<e.length;n++)this.removeChild(e[n])}onChildUpdate(e){let n=this.childrenToUpdate[e.relativeRenderGroupDepth];n||(n=this.childrenToUpdate[e.relativeRenderGroupDepth]={index:0,list:[]}),n.list[n.index++]=e}updateRenderable(e){e.globalDisplayStatus<7||(this.instructionSet.renderPipes[e.renderPipeId].updateRenderable(e),e.didViewUpdate=!1)}onChildViewUpdate(e){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=e}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(e){this._onRenderContainers.push(e)}removeOnRender(e){this._onRenderContainers.splice(this._onRenderContainers.indexOf(e),1)}runOnRender(e){for(let n=0;n<this._onRenderContainers.length;n++)this._onRenderContainers[n]._onRender(e)}destroy(){this.disableCacheAsTexture(),this.renderGroupParent=null,this.root=null,this.childrenRenderablesToUpdate=null,this.childrenToUpdate=null,this.renderGroupChildren=null,this._onRenderContainers=null,this.instructionSet=null}getChildren(e=[]){const n=this.root.children;for(let i=0;i<n.length;i++)this._getChildren(n[i],e);return e}_getChildren(e,n=[]){if(n.push(e),e.renderGroup)return n;const i=e.children;for(let r=0;r<i.length;r++)this._getChildren(i[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 Ht),this._inverseWorldTransform.copyFrom(this.worldTransform).invert())}get textureOffsetInverseTransform(){return(this._matrixDirty&2)===0?this._textureOffsetInverseTransform:(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new Ht),this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x,-this._textureBounds.y))}get inverseParentTextureTransform(){if((this._matrixDirty&4)===0)return this._inverseParentTextureTransform;this._matrixDirty&=-5;const e=this._parentCacheAsTextureRenderGroup;return e?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new Ht),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(e.inverseWorldTransform).translate(-e._textureBounds.x,-e._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this.isCachedAsTexture?this.textureOffsetInverseTransform:this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}}function G4(t,e,n={}){for(const i in e)!n[i]&&e[i]!==void 0&&(t[i]=e[i])}const _x=new yr(null),Ny=new yr(null),Sx=new yr(null,1,1),ky=new yr(null),kE=1,F4=2,Ex=4;class br extends mo{constructor(e={}){var n,i;super(),this.uid=gi("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 Ht,this.relativeGroupTransform=new Ht,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new yr(this,0,0),this._scale=Sx,this._pivot=Ny,this._origin=ky,this._skew=_x,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=[],G4(this,e,{children:!0,parent:!0,effects:!0}),(n=e.children)==null||n.forEach(r=>this.addChild(r)),(i=e.parent)==null||i.addChild(this)}static mixin(e){Qt("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),si.mixin(br,e)}set _didChangeId(e){this._didViewChangeTick=e>>12&4095,this._didContainerChangeTick=e&4095}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...e){if(this.allowChildren||Qt(mi,"addChild: Only Containers will be allowed to add children in v8.0.0"),e.length>1){for(let r=0;r<e.length;r++)this.addChild(e[r]);return e[0]}const n=e[0],i=this.renderGroup||this.parentRenderGroup;return n.parent===this?(this.children.splice(this.children.indexOf(n),1),this.children.push(n),i&&(i.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,i&&i.addChild(n),this.emit("childAdded",n,this,this.children.length-1),n.emit("added",this),this._didViewChangeTick++,n._zIndex!==0&&n.depthOfChildModified(),n)}removeChild(...e){if(e.length>1){for(let r=0;r<e.length;r++)this.removeChild(e[r]);return e[0]}const n=e[0],i=this.children.indexOf(n);return i>-1&&(this._didViewChangeTick++,this.children.splice(i,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,i),n.emit("removed",this)),n}_onUpdate(e){e&&e===this._skew&&this._updateSkew(),this._didContainerChangeTick++,!this.didChange&&(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(e){!!this.renderGroup!==e&&(e?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;const e=this.parentRenderGroup;e==null||e.removeChild(this),this.renderGroup=Ra.get(P4,this),this.groupTransform=Ht.IDENTITY,e==null||e.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;const e=this.parentRenderGroup;e==null||e.removeChild(this),Ra.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,e==null||e.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0}get worldTransform(){return this._worldTransform||(this._worldTransform=new Ht),this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(e){this._position.x=e}get y(){return this._position.y}set y(e){this._position.y=e}get position(){return this._position}set position(e){this._position.copyFrom(e)}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this._onUpdate(this._skew))}get angle(){return this.rotation*i4}set angle(e){this.rotation=e*r4}get pivot(){return this._pivot===Ny&&(this._pivot=new yr(this,0,0)),this._pivot}set pivot(e){this._pivot===Ny&&(this._pivot=new yr(this,0,0),this._origin!==ky&&ca("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof e=="number"?this._pivot.set(e):this._pivot.copyFrom(e)}get skew(){return this._skew===_x&&(this._skew=new yr(this,0,0)),this._skew}set skew(e){this._skew===_x&&(this._skew=new yr(this,0,0)),this._skew.copyFrom(e)}get scale(){return this._scale===Sx&&(this._scale=new yr(this,1,1)),this._scale}set scale(e){this._scale===Sx&&(this._scale=new yr(this,0,0)),typeof e=="string"&&(e=parseFloat(e)),typeof e=="number"?this._scale.set(e):this._scale.copyFrom(e)}get origin(){return this._origin===ky&&(this._origin=new yr(this,0,0)),this._origin}set origin(e){this._origin===ky&&(this._origin=new yr(this,0,0),this._pivot!==Ny&&ca("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof e=="number"?this._origin.set(e):this._origin.copyFrom(e)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(e){const n=this.getLocalBounds().width;this._setWidth(e,n)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(e){const n=this.getLocalBounds().height;this._setHeight(e,n)}getSize(e){e||(e={});const n=this.getLocalBounds();return e.width=Math.abs(this.scale.x*n.width),e.height=Math.abs(this.scale.y*n.height),e}setSize(e,n){const i=this.getLocalBounds();typeof e=="object"?(n=e.height??e.width,e=e.width):n??(n=e),e!==void 0&&this._setWidth(e,i.width),n!==void 0&&this._setHeight(n,i.height)}_updateSkew(){const e=this._rotation,n=this._skew;this._cx=Math.cos(e+n._y),this._sx=Math.sin(e+n._y),this._cy=-Math.sin(e-n._x),this._sy=Math.cos(e-n._x)}updateTransform(e){return this.position.set(typeof e.x=="number"?e.x:this.position.x,typeof e.y=="number"?e.y:this.position.y),this.scale.set(typeof e.scaleX=="number"?e.scaleX||1:this.scale.x,typeof e.scaleY=="number"?e.scaleY||1:this.scale.y),this.rotation=typeof e.rotation=="number"?e.rotation:this.rotation,this.skew.set(typeof e.skewX=="number"?e.skewX:this.skew.x,typeof e.skewY=="number"?e.skewY:this.skew.y),this.pivot.set(typeof e.pivotX=="number"?e.pivotX:this.pivot.x,typeof e.pivotY=="number"?e.pivotY:this.pivot.y),this.origin.set(typeof e.originX=="number"?e.originX:this.origin.x,typeof e.originY=="number"?e.originY:this.origin.y),this}setFromMatrix(e){e.decompose(this)}updateLocalTransform(){const e=this._didContainerChangeTick;if(this._didLocalTransformChangeId===e)return;this._didLocalTransformChangeId=e;const n=this.localTransform,i=this._scale,r=this._pivot,s=this._origin,l=this._position,c=i._x,d=i._y,p=r._x,m=r._y,g=-s._x,b=-s._y;n.a=this._cx*c,n.b=this._sx*c,n.c=this._cy*d,n.d=this._sy*d,n.tx=l._x-(p*n.a+m*n.c)+(g*n.a+b*n.c)-g,n.ty=l._y-(p*n.b+m*n.d)+(g*n.b+b*n.d)-b}set alpha(e){e!==this.localAlpha&&(this.localAlpha=e,this._updateFlags|=kE,this._onUpdate())}get alpha(){return this.localAlpha}set tint(e){const i=Gi.shared.setValue(e??16777215).toBgrNumber();i!==this.localColor&&(this.localColor=i,this._updateFlags|=kE,this._onUpdate())}get tint(){return h0(this.localColor)}set blendMode(e){this.localBlendMode!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=F4,this.localBlendMode=e,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(this.localDisplayStatus&2)}set visible(e){const n=e?2:0;(this.localDisplayStatus&2)!==n&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Ex,this.localDisplayStatus^=2,this._onUpdate(),this.emit("visibleChanged",e))}get culled(){return!(this.localDisplayStatus&4)}set culled(e){const n=e?0:4;(this.localDisplayStatus&4)!==n&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Ex,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(this.localDisplayStatus&1)}set renderable(e){const n=e?1:0;(this.localDisplayStatus&1)!==n&&(this._updateFlags|=Ex,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(e=!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 e=="boolean"?e:e==null?void 0:e.children)&&n)for(let s=0;s<n.length;++s)n[s].destroy(e);(r=this.renderGroup)==null||r.destroy(),this.renderGroup=null}}si.mixin(br,T4,k4,I4,B4,z4,M4,R4,L4,v4,E4,O4,C4);class Y_ extends br{constructor(e){super(e),this.canBundle=!0,this.allowChildren=!1,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this._bounds=new Bs(0,1,0,0),this._boundsDirty=!0,this.autoGarbageCollect=e.autoGarbageCollect??!0}get bounds(){return this._boundsDirty?(this.updateBounds(),this._boundsDirty=!1,this._bounds):this._bounds}get roundPixels(){return!!this._roundPixels}set roundPixels(e){this._roundPixels=e?1:0}containsPoint(e){const n=this.bounds,{x:i,y:r}=e;return i>=n.minX&&i<=n.maxX&&r>=n.minY&&r<=n.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;const e=this.renderGroup||this.parentRenderGroup;e&&e.onChildViewUpdate(this)}unload(){var e;this.emit("unload",this);for(const n in this._gpuData)(e=this._gpuData[n])==null||e.destroy();this._gpuData=Object.create(null),this.onViewUpdate()}destroy(e){this.unload(),super.destroy(e),this._bounds=null}collectRenderablesSimple(e,n,i){const{renderPipes:r}=n;r.blendMode.pushBlendMode(this,this.groupBlendMode,e);const l=r[this.renderPipeId];l!=null&&l.addRenderable&&l.addRenderable(this,e),this.didViewUpdate=!1;const c=this.children,d=c.length;for(let p=0;p<d;p++)c[p].collectRenderables(e,n,i);r.blendMode.popBlendMode(e)}}class sh extends Y_{constructor(e=Tn.EMPTY){e instanceof Tn&&(e={texture:e});const{texture:n=Tn.EMPTY,anchor:i,roundPixels:r,width:s,height:l,...c}=e;super({label:"Sprite",...c}),this.renderPipeId="sprite",this.batched=!0,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new yr({_onUpdate:()=>{this.onViewUpdate()}}),i?this.anchor=i:n.defaultAnchor&&(this.anchor=n.defaultAnchor),this.texture=n,this.allowChildren=!1,this.roundPixels=r??!1,s!==void 0&&(this.width=s),l!==void 0&&(this.height=l)}static from(e,n=!1){return e instanceof Tn?new sh(e):new sh(Tn.from(e,n))}set texture(e){e||(e=Tn.EMPTY);const n=this._texture;n!==e&&(n&&n.dynamic&&n.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,this._width&&this._setWidth(this._width,this._texture.orig.width),this._height&&this._setHeight(this._height,this._texture.orig.height),this.onViewUpdate())}get texture(){return this._texture}get visualBounds(){return YC(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return Qt("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){const e=this._anchor,n=this._texture,i=this._bounds,{width:r,height:s}=n.orig;i.minX=-e._x*r,i.maxX=i.minX+r,i.minY=-e._y*s,i.maxY=i.minY+s}destroy(e=!1){if(super.destroy(e),typeof e=="boolean"?e:e==null?void 0:e.texture){const i=typeof e=="boolean"?e:e==null?void 0:e.textureSource;this._texture.destroy(i)}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(e){this._setWidth(e,this._texture.orig.width),this._width=e}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(e){this._setHeight(e,this._texture.orig.height),this._height=e}getSize(e){return e||(e={}),e.width=Math.abs(this.scale.x)*this._texture.orig.width,e.height=Math.abs(this.scale.y)*this._texture.orig.height,e}setSize(e,n){typeof e=="object"?(n=e.height??e.width,e=e.width):n??(n=e),e!==void 0&&this._setWidth(e,this._texture.orig.width),n!==void 0&&this._setHeight(n,this._texture.orig.height)}}const q4=new Bs;function tA(t,e,n){const i=q4;t.measurable=!0,WC(t,n,i),e.addBoundsMask(i),t.measurable=!1}function nA(t,e,n){const i=nc.get();t.measurable=!0;const r=oa.get().identity(),s=iA(t,n,r);QC(t,i,s),t.measurable=!1,e.addBoundsMask(i),oa.return(r),nc.return(i)}function iA(t,e,n){return t?(t!==e&&(iA(t.parent,e,n),t.updateLocalTransform(),n.append(t.localTransform)),n):(ca("Mask bounds, renderable is not inside the root container"),n)}class rA{constructor(e){this.priority=0,this.inverse=!1,this.pipe="alphaMask",e!=null&&e.mask&&this.init(e.mask)}init(e){this.mask=e,this.renderMaskToTexture=!(e instanceof sh),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask=null)}addBounds(e,n){this.inverse||tA(this.mask,e,n)}addLocalBounds(e,n){nA(this.mask,e,n)}containsPoint(e,n){const i=this.mask;return n(i,e)}destroy(){this.reset()}static test(e){return e instanceof sh}}rA.extension=Rt.MaskEffect;class aA{constructor(e){this.priority=0,this.pipe="colorMask",e!=null&&e.mask&&this.init(e.mask)}init(e){this.mask=e}destroy(){}static test(e){return typeof e=="number"}}aA.extension=Rt.MaskEffect;class sA{constructor(e){this.priority=0,this.pipe="stencilMask",e!=null&&e.mask&&this.init(e.mask)}init(e){this.mask=e,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null)}addBounds(e,n){tA(this.mask,e,n)}addLocalBounds(e,n){nA(this.mask,e,n)}containsPoint(e,n){const i=this.mask;return n(i,e)}destroy(){this.reset()}static test(e){return e instanceof br}}sA.extension=Rt.MaskEffect;const Y4={createCanvas:(t,e)=>{const n=document.createElement("canvas");return n.width=t,n.height=e,n},createImage:()=>new Image,getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(t,e)=>fetch(t,e),parseXML:t=>new DOMParser().parseFromString(t,"text/xml")};let OE=Y4;const ts={get(){return OE},set(t){OE=t}};class lA extends Ls{constructor(e){e.resource||(e.resource=ts.get().createCanvas()),e.width||(e.width=e.resource.width,e.autoDensity||(e.width/=e.resolution)),e.height||(e.height=e.resource.height,e.autoDensity||(e.height/=e.resolution)),super(e),this.uploadMethodId="image",this.autoDensity=e.autoDensity,this.resizeCanvas(),this.transparent=!!e.transparent}resizeCanvas(){this.autoDensity&&"style"in this.resource&&(this.resource.style.width=`${this.width}px`,this.resource.style.height=`${this.height}px`),(this.resource.width!==this.pixelWidth||this.resource.height!==this.pixelHeight)&&(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight)}resize(e=this.width,n=this.height,i=this._resolution){const r=super.resize(e,n,i);return r&&this.resizeCanvas(),r}static test(e){return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&e instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}}lA.extension=Rt.TextureSource;class E0 extends Ls{constructor(e){super(e),this.uploadMethodId="image",this.autoGarbageCollect=!0}static test(e){return globalThis.HTMLImageElement&&e instanceof HTMLImageElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||globalThis.VideoFrame&&e instanceof VideoFrame}}E0.extension=Rt.TextureSource;var w0=(t=>(t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY",t))(w0||{});class wx{constructor(e,n=null,i=0,r=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=e,this._context=n,this.priority=i,this._once=r}match(e,n=null){return this._fn===e&&this._context===n}emit(e){this._fn&&(this._context?this._fn.call(this._context,e):this._fn(e));const n=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),n}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this}destroy(e=!1){this._destroyed=!0,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const n=this.next;return this.next=e?null:n,this.previous=null,n}}const oA=class Za{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 wx(null,null,1/0),this.deltaMS=1/Za.targetFPMS,this.elapsedMS=1/Za.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(e,n,i=w0.NORMAL){return this._addListener(new wx(e,n,i))}addOnce(e,n,i=w0.NORMAL){return this._addListener(new wx(e,n,i,!0))}_addListener(e){let n=this._head.next,i=this._head;if(!n)e.connect(i);else{for(;n;){if(e.priority>n.priority){e.connect(i);break}i=n,n=n.next}e.previous||e.connect(i)}return this._startIfPossible(),this}remove(e,n){let i=this._head.next;for(;i;)i.match(e,n)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,n=this._head;for(;n=n.next;)e++;return e}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}}update(e=performance.now()){let n;if(e>this.lastTime){if(n=this.elapsedMS=e-this.lastTime,n>this._maxElapsedMS&&(n=this._maxElapsedMS),n*=this.speed,this._minElapsedMS){const s=e-this._lastFrame|0;if(s<this._minElapsedMS)return;this._lastFrame=e-s%this._minElapsedMS}this.deltaMS=n,this.deltaTime=this.deltaMS*Za.targetFPMS;const i=this._head;let r=i.next;for(;r;)r=r.emit(this);i.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=e}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(e){const n=Math.min(Math.max(0,e)/1e3,Za.targetFPMS);this._maxElapsedMS=1/n,this._minElapsedMS&&e>this.maxFPS&&(this.maxFPS=e)}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(e){e===0?this._minElapsedMS=0:(e<this.minFPS&&(this.minFPS=e),this._minElapsedMS=1/(e/1e3))}static get shared(){if(!Za._shared){const e=Za._shared=new Za;e.autoStart=!0,e._protected=!0}return Za._shared}static get system(){if(!Za._system){const e=Za._system=new Za;e.autoStart=!0,e._protected=!0}return Za._system}};oA.targetFPMS=.06;let Vd=oA,Tx;async function V4(){return Tx??(Tx=(async()=>{var l;const e=ts.get().createCanvas(1,1).getContext("webgl");if(!e)return"premultiply-alpha-on-upload";const n=await new Promise(c=>{const d=document.createElement("video");d.onloadeddata=()=>c(d),d.onerror=()=>c(null),d.autoplay=!1,d.crossOrigin="anonymous",d.preload="auto",d.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",d.load()});if(!n)return"premultiply-alpha-on-upload";const i=e.createTexture();e.bindTexture(e.TEXTURE_2D,i);const r=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,r),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,i,0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n);const s=new Uint8Array(4);return e.readPixels(0,0,1,1,e.RGBA,e.UNSIGNED_BYTE,s),e.deleteFramebuffer(r),e.deleteTexture(i),(l=e.getExtension("WEBGL_lose_context"))==null||l.loseContext(),s[0]<=s[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),Tx}const Q0=class cA extends Ls{constructor(e){super(e),this.isReady=!1,this.uploadMethodId="video",e={...cA.defaultOptions,...e},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=e.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=e.autoPlay!==!1,this.alphaMode=e.alphaMode??"premultiply-alpha-on-upload",this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),e.autoLoad!==!1&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){const e=Vd.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-e)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;const e=this.resource,n=this.options;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart),e.addEventListener("pause",this._onPlayStop),e.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(n.preload||e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlayThrough),e.addEventListener("error",this._onError,!0)),this.alphaMode=await V4(),this._load=new Promise((i,r)=>{this.isValid?i(this):(this._resolve=i,this._reject=r,n.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${n.preloadTimeoutMs}ms`))})),e.load())}),this._load}_onError(e){this.resource.removeEventListener("error",this._onError,!0),this.emit("error",e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null)}_isSourcePlaying(){const e=this.resource;return!e.paused&&!e.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this.isValid||this._mediaReady(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0)}_onCanPlay(){this.resource.removeEventListener("canplay",this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){this.resource.removeEventListener("canplaythrough",this._onCanPlay),this._preloadTimeout&&(clearTimeout(this._preloadTimeout),this._preloadTimeout=void 0),this._mediaReady()}_mediaReady(){const e=this.resource;this.isValid&&(this.isReady=!0,this.resize(e.videoWidth,e.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();const e=this.resource;e&&(e.removeEventListener("play",this._onPlayStart),e.removeEventListener("pause",this._onPlayStop),e.removeEventListener("seeked",this._onSeeked),e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlayThrough),e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(Vd.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||(Vd.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Vd.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement}};Q0.extension=Rt.TextureSource;Q0.defaultOptions={...Ls.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1};Q0.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let X4=Q0;const Hd=(t,e,n=!1)=>(Array.isArray(t)||(t=[t]),e?t.map(i=>typeof i=="string"||n?e(i):i):t);class K4{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(e){return this._cache.has(e)}get(e){const n=this._cache.get(e);return n||ca(`[Assets] Asset id ${e} was not found in the Cache`),n}set(e,n){const i=Hd(e);let r;for(let d=0;d<this.parsers.length;d++){const p=this.parsers[d];if(p.test(n)){r=p.getCacheableAssets(i,n);break}}const s=new Map(Object.entries(r||{}));r||i.forEach(d=>{s.set(d,n)});const l=[...s.keys()],c={cacheKeys:l,keys:i};i.forEach(d=>{this._cacheMap.set(d,c)}),l.forEach(d=>{const p=r?r[d]:n;this._cache.has(d)&&this._cache.get(d)!==p&&ca("[Cache] already has key:",d),this._cache.set(d,s.get(d))})}remove(e){if(!this._cacheMap.has(e)){ca(`[Assets] Asset id ${e} was not found in the Cache`);return}const n=this._cacheMap.get(e);n.cacheKeys.forEach(r=>{this._cache.delete(r)}),n.keys.forEach(r=>{this._cacheMap.delete(r)})}get parsers(){return this._parsers}}const Pd=new K4,Pv=[];si.handleByList(Rt.TextureSource,Pv);function uA(t={}){const e=t&&t.resource,n=e?t.resource:t,i=e?t:{resource:t};for(let r=0;r<Pv.length;r++){const s=Pv[r];if(s.test(n))return new s(i)}throw new Error(`Could not find a source type for resource: ${i.resource}`)}function W4(t={},e=!1){const n=t&&t.resource,i=n?t.resource:t,r=n?t:{resource:t};if(!e&&Pd.has(i))return Pd.get(i);const s=new Tn({source:uA(r)});return s.on("destroy",()=>{Pd.has(i)&&Pd.remove(i)}),e||Pd.set(i,s),s}function $4(t,e=!1){return typeof t=="string"?Pd.get(t):t instanceof Ls?new Tn({source:t}):W4(t,e)}Tn.from=$4;Ls.from=uA;si.add(rA,aA,sA,X4,E0,lA,G_);var fA=(t=>(t[t.Low=0]="Low",t[t.Normal=1]="Normal",t[t.High=2]="High",t))(fA||{});function cl(t){if(typeof t!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(t)}`)}function Xp(t){return t.split("?")[0].split("#")[0]}function Z4(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Q4(t,e,n){return t.replace(new RegExp(Z4(e),"g"),n)}function J4(t,e){let n="",i=0,r=-1,s=0,l=-1;for(let c=0;c<=t.length;++c){if(c<t.length)l=t.charCodeAt(c);else{if(l===47)break;l=47}if(l===47){if(!(r===c-1||s===1))if(r!==c-1&&s===2){if(n.length<2||i!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){const d=n.lastIndexOf("/");if(d!==n.length-1){d===-1?(n="",i=0):(n=n.slice(0,d),i=n.length-1-n.lastIndexOf("/")),r=c,s=0;continue}}else if(n.length===2||n.length===1){n="",i=0,r=c,s=0;continue}}}else n.length>0?n+=`/${t.slice(r+1,c)}`:n=t.slice(r+1,c),i=c-r-1;r=c,s=0}else l===46&&s!==-1?++s:s=-1}return n}const Mm={toPosix(t){return Q4(t,"\\","/")},isUrl(t){return/^https?:/.test(this.toPosix(t))},isDataUrl(t){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(t)},isBlobUrl(t){return t.startsWith("blob:")},hasProtocol(t){return/^[^/:]+:/.test(this.toPosix(t))},getProtocol(t){cl(t),t=this.toPosix(t);const e=/^file:\/\/\//.exec(t);if(e)return e[0];const n=/^[^/:]+:\/{0,2}/.exec(t);return n?n[0]:""},toAbsolute(t,e,n){if(cl(t),this.isDataUrl(t)||this.isBlobUrl(t))return t;const i=Xp(this.toPosix(e??ts.get().getBaseUrl())),r=Xp(this.toPosix(n??this.rootname(i)));return t=this.toPosix(t),t.startsWith("/")?Mm.join(r,t.slice(1)):this.isAbsolute(t)?t:this.join(i,t)},normalize(t){if(cl(t),t.length===0)return".";if(this.isDataUrl(t)||this.isBlobUrl(t))return t;t=this.toPosix(t);let e="";const n=t.startsWith("/");this.hasProtocol(t)&&(e=this.rootname(t),t=t.slice(e.length));const i=t.endsWith("/");return t=J4(t),t.length>0&&i&&(t+="/"),n?`/${t}`:e+t},isAbsolute(t){return cl(t),t=this.toPosix(t),this.hasProtocol(t)?!0:t.startsWith("/")},join(...t){if(t.length===0)return".";let e;for(let n=0;n<t.length;++n){const i=t[n];if(cl(i),i.length>0)if(e===void 0)e=i;else{const r=t[n-1]??"";this.joinExtensions.includes(this.extname(r).toLowerCase())?e+=`/../${i}`:e+=`/${i}`}}return e===void 0?".":this.normalize(e)},dirname(t){if(cl(t),t.length===0)return".";t=this.toPosix(t);let e=t.charCodeAt(0);const n=e===47;let i=-1,r=!0;const s=this.getProtocol(t),l=t;t=t.slice(s.length);for(let c=t.length-1;c>=1;--c)if(e=t.charCodeAt(c),e===47){if(!r){i=c;break}}else r=!1;return i===-1?n?"/":this.isUrl(l)?s+t:s:n&&i===1?"//":s+t.slice(0,i)},rootname(t){cl(t),t=this.toPosix(t);let e="";if(t.startsWith("/")?e="/":e=this.getProtocol(t),this.isUrl(t)){const n=t.indexOf("/",e.length);n!==-1?e=t.slice(0,n):e=t,e.endsWith("/")||(e+="/")}return e},basename(t,e){cl(t),e&&cl(e),t=Xp(this.toPosix(t));let n=0,i=-1,r=!0,s;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";let l=e.length-1,c=-1;for(s=t.length-1;s>=0;--s){const d=t.charCodeAt(s);if(d===47){if(!r){n=s+1;break}}else c===-1&&(r=!1,c=s+1),l>=0&&(d===e.charCodeAt(l)?--l===-1&&(i=s):(l=-1,i=c))}return n===i?i=c:i===-1&&(i=t.length),t.slice(n,i)}for(s=t.length-1;s>=0;--s)if(t.charCodeAt(s)===47){if(!r){n=s+1;break}}else i===-1&&(r=!1,i=s+1);return i===-1?"":t.slice(n,i)},extname(t){cl(t),t=Xp(this.toPosix(t));let e=-1,n=0,i=-1,r=!0,s=0;for(let l=t.length-1;l>=0;--l){const c=t.charCodeAt(l);if(c===47){if(!r){n=l+1;break}continue}i===-1&&(r=!1,i=l+1),c===46?e===-1?e=l:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||i===-1||s===0||s===1&&e===i-1&&e===n+1?"":t.slice(e,i)},parse(t){cl(t);const e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;t=Xp(this.toPosix(t));let n=t.charCodeAt(0);const i=this.isAbsolute(t);let r;e.root=this.rootname(t),i||this.hasProtocol(t)?r=1:r=0;let s=-1,l=0,c=-1,d=!0,p=t.length-1,m=0;for(;p>=r;--p){if(n=t.charCodeAt(p),n===47){if(!d){l=p+1;break}continue}c===-1&&(d=!1,c=p+1),n===46?s===-1?s=p:m!==1&&(m=1):s!==-1&&(m=-1)}return s===-1||c===-1||m===0||m===1&&s===c-1&&s===l+1?c!==-1&&(l===0&&i?e.base=e.name=t.slice(1,c):e.base=e.name=t.slice(l,c)):(l===0&&i?(e.name=t.slice(1,s),e.base=t.slice(1,c)):(e.name=t.slice(l,s),e.base=t.slice(l,c)),e.ext=t.slice(s,c)),e.dir=this.dirname(t),e},sep:"/",delimiter:":",joinExtensions:[".html"]};function dA(t,e,n,i,r){const s=e[n];for(let l=0;l<s.length;l++){const c=s[l];n<e.length-1?dA(t.replace(i[n],c),e,n+1,i,r):r.push(t.replace(i[n],c))}}function ez(t){const e=/\{(.*?)\}/g,n=t.match(e),i=[];if(n){const r=[];n.forEach(s=>{const l=s.substring(1,s.length-1).split(",");r.push(l)}),dA(t,r,0,n,i)}else i.push(t);return i}const DE=t=>!Array.isArray(t);class hA{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(e,n)=>`${e}${this._bundleIdConnector}${n}`,extractAssetIdFromBundle:(e,n)=>n.replace(`${e}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(e){if(this._bundleIdConnector=e.connector??this._bundleIdConnector,this._createBundleAssetId=e.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=e.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...e){e.forEach(n=>{this._preferredOrder.push(n),n.priority||(n.priority=Object.keys(n.params))}),this._resolverHash={}}set basePath(e){this._basePath=e}get basePath(){return this._basePath}set rootPath(e){this._rootPath=e}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(e){if(typeof e=="string")this._defaultSearchParams=e;else{const n=e;this._defaultSearchParams=Object.keys(n).map(i=>`${encodeURIComponent(i)}=${encodeURIComponent(n[i])}`).join("&")}}getAlias(e){const{alias:n,src:i}=e;return Hd(n||i,s=>typeof s=="string"?s:Array.isArray(s)?s.map(l=>(l==null?void 0:l.src)??l):s!=null&&s.src?s.src:s,!0)}removeAlias(e,n){this._assetMap[e]&&(n&&n!==this._resolverHash[e]||(delete this._resolverHash[e],delete this._assetMap[e]))}addManifest(e){this._manifest&&ca("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=e,e.bundles.forEach(n=>{this.addBundle(n.name,n.assets)})}addBundle(e,n){const i=[];let r=n;Array.isArray(n)||(r=Object.entries(n).map(([s,l])=>typeof l=="string"||Array.isArray(l)?{alias:s,src:l}:{alias:s,...l})),r.forEach(s=>{const l=s.src,c=s.alias;let d;if(typeof c=="string"){const p=this._createBundleAssetId(e,c);i.push(p),d=[c,p]}else{const p=c.map(m=>this._createBundleAssetId(e,m));i.push(...p),d=[...c,...p]}this.add({...s,alias:d,src:l})}),this._bundles[e]=i}add(e){const n=[];Array.isArray(e)?n.push(...e):n.push(e);let i;i=s=>{this.hasKey(s)&&ca(`[Resolver] already has key: ${s} overwriting`)},Hd(n).forEach(s=>{const{src:l}=s;let{data:c,format:d,loadParser:p,parser:m}=s;const g=Hd(l).map(C=>typeof C=="string"?ez(C):Array.isArray(C)?C:[C]),b=this.getAlias(s);Array.isArray(b)?b.forEach(i):i(b);const v=[],_=C=>{const T=this._parsers.find(w=>w.test(C));return{src:C,...T==null?void 0:T.parse(C)}};g.forEach(C=>{C.forEach(T=>{let w={};if(typeof T!="object"?w=_(T):(c=T.data??c,d=T.format??d,(T.loadParser||T.parser)&&(p=T.loadParser??p,m=T.parser??m),w={..._(T.src),...T}),!b)throw new Error(`[Resolver] alias is undefined for this asset: ${w.src}`);w=this._buildResolvedAsset(w,{aliases:b,data:c,format:d,loadParser:p,parser:m,progressSize:s.progressSize}),v.push(w)})}),b.forEach(C=>{this._assetMap[C]=v})})}resolveBundle(e){const n=DE(e);e=Hd(e);const i={};return e.forEach(r=>{const s=this._bundles[r];if(s){const l=this.resolve(s),c={};for(const d in l){const p=l[d];c[this._extractAssetIdFromBundle(r,d)]=p}i[r]=c}}),n?i[e[0]]:i}resolveUrl(e){const n=this.resolve(e);if(typeof e!="string"){const i={};for(const r in n)i[r]=n[r].src;return i}return n.src}resolve(e){const n=DE(e);e=Hd(e);const i={};return e.forEach(r=>{if(!this._resolverHash[r])if(this._assetMap[r]){let s=this._assetMap[r];const l=this._getPreferredOrder(s);l==null||l.priority.forEach(c=>{l.params[c].forEach(d=>{const p=s.filter(m=>m[c]?m[c]===d:!1);p.length&&(s=p)})}),this._resolverHash[r]=s[0]}else this._resolverHash[r]=this._buildResolvedAsset({alias:[r],src:r},{});i[r]=this._resolverHash[r]}),n?i[e[0]]:i}hasKey(e){return!!this._assetMap[e]}hasBundle(e){return!!this._bundles[e]}_getPreferredOrder(e){for(let n=0;n<e.length;n++){const i=e[n],r=this._preferredOrder.find(s=>s.params.format.includes(i.format));if(r)return r}return this._preferredOrder[0]}_appendDefaultSearchParams(e){if(!this._defaultSearchParams)return e;const n=/\?/.test(e)?"&":"?";return`${e}${n}${this._defaultSearchParams}`}_buildResolvedAsset(e,n){const{aliases:i,data:r,loadParser:s,parser:l,format:c,progressSize:d}=n;return(this._basePath||this._rootPath)&&(e.src=Mm.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=i??e.alias??[e.src],e.src=this._appendDefaultSearchParams(e.src),e.data={...r||{},...e.data},e.loadParser=s??e.loadParser,e.parser=l??e.parser,e.format=c??e.format??tz(e.src),d!==void 0&&(e.progressSize=d),e}}hA.RETINA_PREFIX=/@([0-9\.]+)x/;function tz(t){return t.split(".").pop().split("?").shift().split("#").shift()}const zE=(t,e)=>{const n=e.split("?")[1];return n&&(t+=`?${n}`),t},pA=class fm{constructor(e,n){this.linkedSheets=[];let i=e;(e==null?void 0:e.source)instanceof Ls&&(i={texture:e,data:n});const{texture:r,data:s,cachePrefix:l=""}=i;this.cachePrefix=l,this._texture=r instanceof Tn?r:null,this.textureSource=r.source,this.textures={},this.animations={},this.data=s;const c=parseFloat(s.meta.scale);c?(this.resolution=c,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(e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=fm.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}parseSync(){return this._processFrames(0,!0),this._processAnimations(),this.textures}_processFrames(e,n=!1){let i=e;const r=n?1/0:fm.BATCH_SIZE;for(;i-e<r&&i<this._frameKeys.length;){const s=this._frameKeys[i],l=this._frames[s],c=l.frame;if(c){let d=null,p=null;const m=l.trimmed!==!1&&l.sourceSize?l.sourceSize:l.frame,g=new Ei(0,0,Math.floor(m.w)/this.resolution,Math.floor(m.h)/this.resolution);l.rotated?d=new Ei(Math.floor(c.x)/this.resolution,Math.floor(c.y)/this.resolution,Math.floor(c.h)/this.resolution,Math.floor(c.w)/this.resolution):d=new Ei(Math.floor(c.x)/this.resolution,Math.floor(c.y)/this.resolution,Math.floor(c.w)/this.resolution,Math.floor(c.h)/this.resolution),l.trimmed!==!1&&l.spriteSourceSize&&(p=new Ei(Math.floor(l.spriteSourceSize.x)/this.resolution,Math.floor(l.spriteSourceSize.y)/this.resolution,Math.floor(c.w)/this.resolution,Math.floor(c.h)/this.resolution)),this.textures[s]=new Tn({source:this.textureSource,frame:d,orig:g,trim:p,rotate:l.rotated?2:0,defaultAnchor:l.anchor,defaultBorders:l.borders,label:s.toString()})}i++}}_processAnimations(){const e=this.data.animations||{};for(const n in e){this.animations[n]=[];for(let i=0;i<e[n].length;i++){const r=e[n][i];this.animations[n].push(this.textures[r])}}}_parseComplete(){const e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*fm.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*fm.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(e=!1){var n;for(const i in this.textures)this.textures[i].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,e&&((n=this._texture)==null||n.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};pA.BATCH_SIZE=1e3;let BE=pA;const nz=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];function mA(t,e,n){const i={};if(t.forEach(r=>{i[r]=e}),Object.keys(e.textures).forEach(r=>{i[`${e.cachePrefix}${r}`]=e.textures[r]}),!n){const r=Mm.dirname(t[0]);e.linkedSheets.forEach((s,l)=>{const c=mA([`${r}/${e.data.meta.related_multi_packs[l]}`],s,!0);Object.assign(i,c)})}return i}const iz={extension:Rt.Asset,cache:{test:t=>t instanceof BE,getCacheableAssets:(t,e)=>mA(t,e,!1)},resolver:{extension:{type:Rt.ResolveParser,name:"resolveSpritesheet"},test:t=>{const n=t.split("?")[0].split("."),i=n.pop(),r=n.pop();return i==="json"&&nz.includes(r)},parse:t=>{var n;const e=t.split(".");return{resolution:parseFloat(((n=hA.RETINA_PREFIX.exec(t))==null?void 0:n[1])??"1"),format:e[e.length-2],src:t}}},loader:{name:"spritesheetLoader",id:"spritesheet",extension:{type:Rt.LoadParser,priority:fA.Normal,name:"spritesheetLoader"},async testParse(t,e){return Mm.extname(e.src).toLowerCase()===".json"&&!!t.frames},async parse(t,e,n){var g,b;const{texture:i,imageFilename:r,textureOptions:s,cachePrefix:l}=(e==null?void 0:e.data)??{};let c=Mm.dirname(e.src);c&&c.lastIndexOf("/")!==c.length-1&&(c+="/");let d;if(i instanceof Tn)d=i;else{const v=zE(c+(r??t.meta.image),e.src);d=(await n.load([{src:v,data:s}]))[v]}const p=new BE({texture:d.source,data:t,cachePrefix:l});await p.parse();const m=(g=t==null?void 0:t.meta)==null?void 0:g.related_multi_packs;if(Array.isArray(m)){const v=[];for(const C of m){if(typeof C!="string")continue;let T=c+C;(b=e.data)!=null&&b.ignoreMultiPack||(T=zE(T,e.src),v.push(n.load({src:T,data:{textureOptions:s,ignoreMultiPack:!0}})))}const _=await Promise.all(v);p.linkedSheets=_,_.forEach(C=>{C.linkedSheets=[p].concat(p.linkedSheets.filter(T=>T!==C))})}return p},async unload(t,e,n){await n.unload(t.textureSource._sourceOrigin),t.destroy(!1)}}};si.add(iz);const Cx=Object.create(null),LE=Object.create(null);function V_(t,e){let n=LE[t];return n===void 0&&(Cx[e]===void 0&&(Cx[e]=1),LE[t]=n=Cx[e]++),n}let Od;function gA(){return(!Od||Od!=null&&Od.isContextLost())&&(Od=ts.get().createCanvas().getContext("webgl",{})),Od}let Oy;function rz(){if(!Oy){Oy="mediump";const t=gA();t&&t.getShaderPrecisionFormat&&(Oy=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision?"highp":"mediump")}return Oy}function az(t,e,n){return e?t:n?(t=t.replace("out vec4 finalColor;",""),`
|
|
65
|
+
|
|
66
|
+
#ifdef GL_ES // This checks if it is WebGL1
|
|
67
|
+
#define in varying
|
|
68
|
+
#define finalColor gl_FragColor
|
|
69
|
+
#define texture texture2D
|
|
70
|
+
#endif
|
|
71
|
+
${t}
|
|
72
|
+
`):`
|
|
73
|
+
|
|
74
|
+
#ifdef GL_ES // This checks if it is WebGL1
|
|
75
|
+
#define in attribute
|
|
76
|
+
#define out varying
|
|
77
|
+
#endif
|
|
78
|
+
${t}
|
|
79
|
+
`}function sz(t,e,n){const i=n?e.maxSupportedFragmentPrecision:e.maxSupportedVertexPrecision;if(t.substring(0,9)!=="precision"){let r=n?e.requestedFragmentPrecision:e.requestedVertexPrecision;return r==="highp"&&i!=="highp"&&(r="mediump"),`precision ${r} float;
|
|
80
|
+
${t}`}else if(i!=="highp"&&t.substring(0,15)==="precision highp")return t.replace("precision highp","precision mediump");return t}function lz(t,e){return e?`#version 300 es
|
|
81
|
+
${t}`:t}const oz={},cz={};function uz(t,{name:e="pixi-program"},n=!0){e=e.replace(/\s+/g,"-"),e+=n?"-fragment":"-vertex";const i=n?oz:cz;return i[e]?(i[e]++,e+=`-${i[e]}`):i[e]=1,t.indexOf("#define SHADER_NAME")!==-1?t:`${`#define SHADER_NAME ${e}`}
|
|
82
|
+
${t}`}function fz(t,e){return e?t.replace("#version 300 es",""):t}const Ax={stripVersion:fz,ensurePrecision:sz,addProgramDefines:az,setProgramName:uz,insertVersion:lz},Kp=Object.create(null),yA=class Gv{constructor(e){e={...Gv.defaultOptions,...e};const n=e.fragment.indexOf("#version 300 es")!==-1,i={stripVersion:n,ensurePrecision:{requestedFragmentPrecision:e.preferredFragmentPrecision,requestedVertexPrecision:e.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:rz()},setProgramName:{name:e.name},addProgramDefines:n,insertVersion:n};let r=e.fragment,s=e.vertex;Object.keys(Ax).forEach(l=>{const c=i[l];r=Ax[l](r,c,!0),s=Ax[l](s,c,!1)}),this.fragment=r,this.vertex=s,this.transformFeedbackVaryings=e.transformFeedbackVaryings,this._key=V_(`${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,Kp[this._cacheKey]=null}static from(e){const n=`${e.vertex}:${e.fragment}`;return Kp[n]||(Kp[n]=new Gv(e),Kp[n]._cacheKey=n),Kp[n]}};yA.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let X_=yA;const UE={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 dz(t){return UE[t]??UE.float32}const hz={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"},IE=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|\)|$)/g;function jE(t,e){let n;for(;(n=IE.exec(t))!==null;){const i=hz[n[3]]??"float32";e[n[2]]={location:parseInt(n[1],10),format:i,stride:dz(i).stride,offset:0,instance:!1,start:0}}IE.lastIndex=0}function pz(t){return t.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"")}function mz({source:t,entryPoint:e}){const n={},i=pz(t),r=i.indexOf(`fn ${e}(`);if(r===-1)return n;const s=i.indexOf("->",r);if(s===-1)return n;const l=i.substring(r,s);if(jE(l,n),Object.keys(n).length===0){const c=l.match(/\(\s*\w+\s*:\s*(\w+)/);if(c){const d=c[1],p=new RegExp(`struct\\s+${d}\\s*\\{([^}]+)\\}`,"s"),m=i.match(p);m&&jE(m[1],n)}}return n}function Mx(t){var g,b;const e=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,n=/@group\((\d+)\)/,i=/@binding\((\d+)\)/,r=/var(<[^>]+>)? (\w+)/,s=/:\s*([\w<>]+)/,l=/struct\s+(\w+)\s*{([^}]+)}/g,c=/(\w+)\s*:\s*([\w\<\>]+)/g,d=/struct\s+(\w+)/,p=(g=t.match(e))==null?void 0:g.map(v=>({group:parseInt(v.match(n)[1],10),binding:parseInt(v.match(i)[1],10),name:v.match(r)[2],isUniform:v.match(r)[1]==="<uniform>",type:v.match(s)[1]}));if(!p)return{groups:[],structs:[]};const m=((b=t.match(l))==null?void 0:b.map(v=>{const _=v.match(d)[1],C=v.match(c).reduce((T,w)=>{const[k,R]=w.split(":");return T[k.trim()]=R.trim(),T},{});return C?{name:_,members:C}:null}).filter(({name:v})=>p.some(_=>_.type===v||_.type.includes(`<${v}>`))))??[];return{groups:p,structs:m}}var uf=(t=>(t[t.VERTEX=1]="VERTEX",t[t.FRAGMENT=2]="FRAGMENT",t[t.COMPUTE=4]="COMPUTE",t))(uf||{});function gz({groups:t}){const e=[];for(let n=0;n<t.length;n++){const i=t[n];e[i.group]||(e[i.group]=[]),i.isUniform?e[i.group].push({binding:i.binding,visibility:uf.VERTEX|uf.FRAGMENT,buffer:{type:"uniform"}}):i.type==="sampler"?e[i.group].push({binding:i.binding,visibility:uf.FRAGMENT,sampler:{type:"filtering"}}):i.type==="texture_2d"||i.type.startsWith("texture_2d<")?e[i.group].push({binding:i.binding,visibility:uf.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}}):i.type==="texture_2d_array"||i.type.startsWith("texture_2d_array<")?e[i.group].push({binding:i.binding,visibility:uf.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d-array",multisampled:!1}}):(i.type==="texture_cube"||i.type.startsWith("texture_cube<"))&&e[i.group].push({binding:i.binding,visibility:uf.FRAGMENT,texture:{sampleType:"float",viewDimension:"cube",multisampled:!1}})}for(let n=0;n<e.length;n++)e[n]||(e[n]=[]);return e}function yz({groups:t}){const e=[];for(let n=0;n<t.length;n++){const i=t[n];e[i.group]||(e[i.group]={}),e[i.group][i.name]=i.binding}return e}function bz(t,e){const n=new Set,i=new Set,r=[...t.structs,...e.structs].filter(l=>n.has(l.name)?!1:(n.add(l.name),!0)),s=[...t.groups,...e.groups].filter(l=>{const c=`${l.name}-${l.binding}`;return i.has(c)?!1:(i.add(c),!0)});return{structs:r,groups:s}}const Wp=Object.create(null);class Km{constructor(e){var c,d;this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:n,vertex:i,layout:r,gpuLayout:s,name:l}=e;if(this.name=l,this.fragment=n,this.vertex=i,n.source===i.source){const p=Mx(n.source);this.structsAndGroups=p}else{const p=Mx(i.source),m=Mx(n.source);this.structsAndGroups=bz(p,m)}this.layout=r??yz(this.structsAndGroups),this.gpuLayout=s??gz(this.structsAndGroups),this.autoAssignGlobalUniforms=((c=this.layout[0])==null?void 0:c.globalUniforms)!==void 0,this.autoAssignLocalUniforms=((d=this.layout[1])==null?void 0:d.localUniforms)!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:e,fragment:n}=this,i=e.source+n.source+e.entryPoint+n.entryPoint;this._layoutKey=V_(i,"program")}get attributeData(){return this._attributeData??(this._attributeData=mz(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,Wp[this._cacheKey]=null}static from(e){const n=`${e.vertex.source}:${e.fragment.source}:${e.fragment.entryPoint}:${e.vertex.entryPoint}`;return Wp[n]||(Wp[n]=new Km(e),Wp[n]._cacheKey=n),Wp[n]}}const bA=["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>"],xz=bA.reduce((t,e)=>(t[e]=!0,t),{});function vz(t,e){switch(t){case"f32":return 0;case"vec2<f32>":return new Float32Array(2*e);case"vec3<f32>":return new Float32Array(3*e);case"vec4<f32>":return new Float32Array(4*e);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 xA=class vA{constructor(e,n){this._touched=0,this.uid=gi("uniform"),this._resourceType="uniformGroup",this._resourceId=gi("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,n={...vA.defaultOptions,...n},this.uniformStructures=e;const i={};for(const r in e){const s=e[r];if(s.name=r,s.size=s.size??1,!xz[s.type]){const l=s.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(l){const[,c,d]=l;throw new Error(`Uniform type ${s.type} is not supported. Use type: '${c}', size: ${d} instead.`)}throw new Error(`Uniform type ${s.type} is not supported. Supported uniform types are: ${bA.join(", ")}`)}s.value??(s.value=vz(s.type,s.size)),i[r]=s.value}this.uniforms=i,this._dirtyId=1,this.ubo=n.ubo,this.isStatic=n.isStatic,this._signature=V_(Object.keys(i).map(r=>`${r}-${e[r].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};xA.defaultOptions={ubo:!1,isStatic:!1};let _A=xA;class p0{constructor(e){this.resources=Object.create(null),this._dirty=!0;let n=0;for(const i in e){const r=e[i];this.setResource(r,n++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const e=[];let n=0;for(const i in this.resources)e[n++]=this.resources[i]._resourceId;this._key=e.join("|")}setResource(e,n){var r,s;const i=this.resources[n];e!==i&&((r=i==null?void 0:i.off)==null||r.call(i,"change",this.onResourceChange,this),(s=e.on)==null||s.call(e,"change",this.onResourceChange,this),this.resources[n]=e,this._dirty=!0)}getResource(e){return this.resources[e]}_touch(e,n){const i=this.resources;for(const r in i)i[r]._gcLastUsed=e,i[r]._touched=n}destroy(){var n;const e=this.resources;for(const i in e){const r=e[i];(n=r==null?void 0:r.off)==null||n.call(r,"change",this.onResourceChange,this)}this.resources=null}onResourceChange(e){this._dirty=!0,e.destroyed?this.destroy():this._updateKey()}}var Fv=(t=>(t[t.WEBGL=1]="WEBGL",t[t.WEBGPU=2]="WEBGPU",t[t.CANVAS=4]="CANVAS",t[t.BOTH=3]="BOTH",t))(Fv||{});class J0 extends mo{constructor(e){super(),this.uid=gi("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:n,glProgram:i,groups:r,resources:s,compatibleRenderers:l,groupMap:c}=e;this.gpuProgram=n,this.glProgram=i,l===void 0&&(l=0,n&&(l|=Fv.WEBGPU),i&&(l|=Fv.WEBGL)),this.compatibleRenderers=l;const d={};if(!s&&!r&&(s={}),s&&r)throw new Error("[Shader] Cannot have both resources and groups");if(!n&&r&&!c)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!n&&r&&c)for(const p in c)for(const m in c[p]){const g=c[p][m];d[g]={group:p,binding:m,name:g}}else if(n&&r&&!c){const p=n.structsAndGroups.groups;c={},p.forEach(m=>{c[m.group]=c[m.group]||{},c[m.group][m.binding]=m.name,d[m.name]=m})}else if(s){r={},c={},n&&n.structsAndGroups.groups.forEach(g=>{c[g.group]=c[g.group]||{},c[g.group][g.binding]=g.name,d[g.name]=g});let p=0;for(const m in s)d[m]||(r[99]||(r[99]=new p0,this._ownedBindGroups.push(r[99])),d[m]={group:99,binding:p,name:m},c[99]=c[99]||{},c[99][p]=m,p++);for(const m in s){const g=m;let b=s[m];!b.source&&!b._resourceType&&(b=new _A(b));const v=d[g];v&&(r[v.group]||(r[v.group]=new p0,this._ownedBindGroups.push(r[v.group])),r[v.group].setResource(b,v.binding))}}this.groups=r,this._uniformBindMap=c,this.resources=this._buildResourceAccessor(r,d)}addResource(e,n,i){var r,s;(r=this._uniformBindMap)[n]||(r[n]={}),(s=this._uniformBindMap[n])[i]||(s[i]=e),this.groups[n]||(this.groups[n]=new p0,this._ownedBindGroups.push(this.groups[n]))}_buildResourceAccessor(e,n){const i={};for(const r in n){const s=n[r];Object.defineProperty(i,s.name,{get(){return e[s.group].getResource(s.binding)},set(l){e[s.group].setResource(l,s.binding)}})}return i}destroy(e=!1){var n,i;this._destroyed||(this._destroyed=!0,this.emit("destroy",this),e&&((n=this.gpuProgram)==null||n.destroy(),(i=this.glProgram)==null||i.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(e){const{gpu:n,gl:i,...r}=e;let s,l;return n&&(s=Km.from(n)),i&&(l=X_.from(i)),new J0({gpuProgram:s,glProgram:l,...r})}}const _z={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},Rx=0,Nx=1,kx=2,Ox=3,Dx=4,zx=5,qv=class SA{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<Rx)}set blend(e){!!(this.data&1<<Rx)!==e&&(this.data^=1<<Rx)}get offsets(){return!!(this.data&1<<Nx)}set offsets(e){!!(this.data&1<<Nx)!==e&&(this.data^=1<<Nx)}set cullMode(e){if(e==="none"){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=e==="front"}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(this.data&1<<kx)}set culling(e){!!(this.data&1<<kx)!==e&&(this.data^=1<<kx)}get depthTest(){return!!(this.data&1<<Ox)}set depthTest(e){!!(this.data&1<<Ox)!==e&&(this.data^=1<<Ox)}get depthMask(){return!!(this.data&1<<zx)}set depthMask(e){!!(this.data&1<<zx)!==e&&(this.data^=1<<zx)}get clockwiseFrontFace(){return!!(this.data&1<<Dx)}set clockwiseFrontFace(e){!!(this.data&1<<Dx)!==e&&(this.data^=1<<Dx)}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!=="none",this._blendMode=e,this._blendModeId=_z[e]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const e=new SA;return e.depthTest=!1,e.blend=!0,e}};qv.default2d=qv.for2d();let K_=qv;const EA=class Yv extends J0{constructor(e){e={...Yv.defaultOptions,...e},super(e),this.enabled=!0,this._state=K_.for2d(),this.blendMode=e.blendMode,this.padding=e.padding,typeof e.antialias=="boolean"?this.antialias=e.antialias?"on":"off":this.antialias=e.antialias,this.resolution=e.resolution,this.blendRequired=e.blendRequired,this.clipToViewport=e.clipToViewport,this.addResource("uTexture",0,1),e.blendRequired&&this.addResource("uBackTexture",0,3)}apply(e,n,i,r){e.applyFilter(this,n,i,r)}get blendMode(){return this._state.blendMode}set blendMode(e){this._state.blendMode=e}static from(e){const{gpu:n,gl:i,...r}=e;let s,l;return n&&(s=Km.from(n)),i&&(l=X_.from(i)),new Yv({gpuProgram:s,glProgram:l,...r})}};EA.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1,clipToViewport:!0};let Cf=EA;const Vv=[];si.handleByNamedList(Rt.Environment,Vv);async function Sz(t){if(!t)for(let e=0;e<Vv.length;e++){const n=Vv[e];if(n.value.test()){await n.value.load();return}}}let $p;function Ez(){if(typeof $p=="boolean")return $p;try{$p=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{$p=!1}return $p}function HE(t,e,n=2){const i=e&&e.length,r=i?e[0]*n:t.length;let s=wA(t,0,r,n,!0);const l=[];if(!s||s.next===s.prev)return l;let c,d,p;if(i&&(s=Mz(t,e,s,n)),t.length>80*n){c=t[0],d=t[1];let m=c,g=d;for(let b=n;b<r;b+=n){const v=t[b],_=t[b+1];v<c&&(c=v),_<d&&(d=_),v>m&&(m=v),_>g&&(g=_)}p=Math.max(m-c,g-d),p=p!==0?32767/p:0}return Rm(s,l,n,c,d,p,0),l}function wA(t,e,n,i,r){let s;if(r===jz(t,e,n,i)>0)for(let l=e;l<n;l+=i)s=PE(l/i|0,t[l],t[l+1],s);else for(let l=n-i;l>=e;l-=i)s=PE(l/i|0,t[l],t[l+1],s);return s&&lh(s,s.next)&&(km(s),s=s.next),s}function bf(t,e){if(!t)return t;e||(e=t);let n=t,i;do if(i=!1,!n.steiner&&(lh(n,n.next)||ai(n.prev,n,n.next)===0)){if(km(n),n=e=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==e);return e}function Rm(t,e,n,i,r,s,l){if(!t)return;!l&&s&&Dz(t,i,r,s);let c=t;for(;t.prev!==t.next;){const d=t.prev,p=t.next;if(s?Tz(t,i,r,s):wz(t)){e.push(d.i,t.i,p.i),km(t),t=p.next,c=p.next;continue}if(t=p,t===c){l?l===1?(t=Cz(bf(t),e),Rm(t,e,n,i,r,s,2)):l===2&&Az(t,e,n,i,r,s):Rm(bf(t),e,n,i,r,s,1);break}}}function wz(t){const e=t.prev,n=t,i=t.next;if(ai(e,n,i)>=0)return!1;const r=e.x,s=n.x,l=i.x,c=e.y,d=n.y,p=i.y,m=Math.min(r,s,l),g=Math.min(c,d,p),b=Math.max(r,s,l),v=Math.max(c,d,p);let _=i.next;for(;_!==e;){if(_.x>=m&&_.x<=b&&_.y>=g&&_.y<=v&&dm(r,c,s,d,l,p,_.x,_.y)&&ai(_.prev,_,_.next)>=0)return!1;_=_.next}return!0}function Tz(t,e,n,i){const r=t.prev,s=t,l=t.next;if(ai(r,s,l)>=0)return!1;const c=r.x,d=s.x,p=l.x,m=r.y,g=s.y,b=l.y,v=Math.min(c,d,p),_=Math.min(m,g,b),C=Math.max(c,d,p),T=Math.max(m,g,b),w=Xv(v,_,e,n,i),k=Xv(C,T,e,n,i);let R=t.prevZ,O=t.nextZ;for(;R&&R.z>=w&&O&&O.z<=k;){if(R.x>=v&&R.x<=C&&R.y>=_&&R.y<=T&&R!==r&&R!==l&&dm(c,m,d,g,p,b,R.x,R.y)&&ai(R.prev,R,R.next)>=0||(R=R.prevZ,O.x>=v&&O.x<=C&&O.y>=_&&O.y<=T&&O!==r&&O!==l&&dm(c,m,d,g,p,b,O.x,O.y)&&ai(O.prev,O,O.next)>=0))return!1;O=O.nextZ}for(;R&&R.z>=w;){if(R.x>=v&&R.x<=C&&R.y>=_&&R.y<=T&&R!==r&&R!==l&&dm(c,m,d,g,p,b,R.x,R.y)&&ai(R.prev,R,R.next)>=0)return!1;R=R.prevZ}for(;O&&O.z<=k;){if(O.x>=v&&O.x<=C&&O.y>=_&&O.y<=T&&O!==r&&O!==l&&dm(c,m,d,g,p,b,O.x,O.y)&&ai(O.prev,O,O.next)>=0)return!1;O=O.nextZ}return!0}function Cz(t,e){let n=t;do{const i=n.prev,r=n.next.next;!lh(i,r)&&CA(i,n,n.next,r)&&Nm(i,r)&&Nm(r,i)&&(e.push(i.i,n.i,r.i),km(n),km(n.next),n=t=r),n=n.next}while(n!==t);return bf(n)}function Az(t,e,n,i,r,s){let l=t;do{let c=l.next.next;for(;c!==l.prev;){if(l.i!==c.i&&Lz(l,c)){let d=AA(l,c);l=bf(l,l.next),d=bf(d,d.next),Rm(l,e,n,i,r,s,0),Rm(d,e,n,i,r,s,0);return}c=c.next}l=l.next}while(l!==t)}function Mz(t,e,n,i){const r=[];for(let s=0,l=e.length;s<l;s++){const c=e[s]*i,d=s<l-1?e[s+1]*i:t.length,p=wA(t,c,d,i,!1);p===p.next&&(p.steiner=!0),r.push(Bz(p))}r.sort(Rz);for(let s=0;s<r.length;s++)n=Nz(r[s],n);return n}function Rz(t,e){let n=t.x-e.x;if(n===0&&(n=t.y-e.y,n===0)){const i=(t.next.y-t.y)/(t.next.x-t.x),r=(e.next.y-e.y)/(e.next.x-e.x);n=i-r}return n}function Nz(t,e){const n=kz(t,e);if(!n)return e;const i=AA(n,t);return bf(i,i.next),bf(n,n.next)}function kz(t,e){let n=e;const i=t.x,r=t.y;let s=-1/0,l;if(lh(t,n))return n;do{if(lh(t,n.next))return n.next;if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){const g=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(g<=i&&g>s&&(s=g,l=n.x<n.next.x?n:n.next,g===i))return l}n=n.next}while(n!==e);if(!l)return null;const c=l,d=l.x,p=l.y;let m=1/0;n=l;do{if(i>=n.x&&n.x>=d&&i!==n.x&&TA(r<p?i:s,r,d,p,r<p?s:i,r,n.x,n.y)){const g=Math.abs(r-n.y)/(i-n.x);Nm(n,t)&&(g<m||g===m&&(n.x>l.x||n.x===l.x&&Oz(l,n)))&&(l=n,m=g)}n=n.next}while(n!==c);return l}function Oz(t,e){return ai(t.prev,t,e.prev)<0&&ai(e.next,t,t.next)<0}function Dz(t,e,n,i){let r=t;do r.z===0&&(r.z=Xv(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,zz(r)}function zz(t){let e,n=1;do{let i=t,r;t=null;let s=null;for(e=0;i;){e++;let l=i,c=0;for(let p=0;p<n&&(c++,l=l.nextZ,!!l);p++);let d=n;for(;c>0||d>0&&l;)c!==0&&(d===0||!l||i.z<=l.z)?(r=i,i=i.nextZ,c--):(r=l,l=l.nextZ,d--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;i=l}s.nextZ=null,n*=2}while(e>1);return t}function Xv(t,e,n,i,r){return t=(t-n)*r|0,e=(e-i)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function Bz(t){let e=t,n=t;do(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next;while(e!==t);return n}function TA(t,e,n,i,r,s,l,c){return(r-l)*(e-c)>=(t-l)*(s-c)&&(t-l)*(i-c)>=(n-l)*(e-c)&&(n-l)*(s-c)>=(r-l)*(i-c)}function dm(t,e,n,i,r,s,l,c){return!(t===l&&e===c)&&TA(t,e,n,i,r,s,l,c)}function Lz(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!Uz(t,e)&&(Nm(t,e)&&Nm(e,t)&&Iz(t,e)&&(ai(t.prev,t,e.prev)||ai(t,e.prev,e))||lh(t,e)&&ai(t.prev,t,t.next)>0&&ai(e.prev,e,e.next)>0)}function ai(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function lh(t,e){return t.x===e.x&&t.y===e.y}function CA(t,e,n,i){const r=zy(ai(t,e,n)),s=zy(ai(t,e,i)),l=zy(ai(n,i,t)),c=zy(ai(n,i,e));return!!(r!==s&&l!==c||r===0&&Dy(t,n,e)||s===0&&Dy(t,i,e)||l===0&&Dy(n,t,i)||c===0&&Dy(n,e,i))}function Dy(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function zy(t){return t>0?1:t<0?-1:0}function Uz(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&CA(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function Nm(t,e){return ai(t.prev,t,t.next)<0?ai(t,e,t.next)>=0&&ai(t,t.prev,e)>=0:ai(t,e,t.prev)<0||ai(t,t.next,e)<0}function Iz(t,e){let n=t,i=!1;const r=(t.x+e.x)/2,s=(t.y+e.y)/2;do n.y>s!=n.next.y>s&&n.next.y!==n.y&&r<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==t);return i}function AA(t,e){const n=Kv(t.i,t.x,t.y),i=Kv(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,s.next=i,i.prev=s,i}function PE(t,e,n,i){const r=Kv(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function km(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Kv(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function jz(t,e,n,i){let r=0;for(let s=e,l=n-i;s<n;s+=i)r+=(t[l]-t[s])*(t[s+1]+t[l+1]),l=s;return r}const Hz=HE.default||HE;var MA=(t=>(t[t.NONE=0]="NONE",t[t.COLOR=16384]="COLOR",t[t.STENCIL=1024]="STENCIL",t[t.DEPTH=256]="DEPTH",t[t.COLOR_DEPTH=16640]="COLOR_DEPTH",t[t.COLOR_STENCIL=17408]="COLOR_STENCIL",t[t.DEPTH_STENCIL=1280]="DEPTH_STENCIL",t[t.ALL=17664]="ALL",t))(MA||{});class Pz{constructor(e){this.items=[],this._name=e}emit(e,n,i,r,s,l,c,d){const{name:p,items:m}=this;for(let g=0,b=m.length;g<b;g++)m[g][p](e,n,i,r,s,l,c,d);return this}add(e){return e[this._name]&&(this.remove(e),this.items.push(e)),this}remove(e){const n=this.items.indexOf(e);return n!==-1&&this.items.splice(n,1),this}contains(e){return this.items.indexOf(e)!==-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 Gz=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],RA=class NA extends mo{constructor(e){super(),this.tick=0,this.uid=gi("renderer"),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=e.type,this.name=e.name,this.config=e;const n=[...Gz,...this.config.runners??[]];this._addRunners(...n),this._unsafeEvalCheck()}async init(e={}){const n=e.skipExtensionImports===!0?!0:e.manageImports===!1;await Sz(n),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(const i in this._systemsHash)e={...this._systemsHash[i].constructor.defaultOptions,...e};e={...NA.defaultOptions,...e},this._roundPixels=e.roundPixels?1:0;for(let i=0;i<this.runners.init.items.length;i++)await this.runners.init.items[i].init(e);this._initOptions=e}render(e,n){this.tick++;let i=e;if(i instanceof br&&(i={container:i},n&&(Qt(mi,"passing a second argument is deprecated, please use render options instead"),i.target=n.renderTexture)),i.target||(i.target=this.view.renderTarget),i.target===this.view.renderTarget&&(this._lastObjectRendered=i.container,i.clearColor??(i.clearColor=this.background.colorRgba),i.clear??(i.clear=this.background.clearBeforeRender)),i.clearColor){const r=Array.isArray(i.clearColor)&&i.clearColor.length===4;i.clearColor=r?i.clearColor:Gi.shared.setValue(i.clearColor).toArray()}i.transform||(i.container.updateLocalTransform(),i.transform=i.container.localTransform),i.container.visible&&(i.container.enableRenderGroup(),this.runners.prerender.emit(i),this.runners.renderStart.emit(i),this.runners.render.emit(i),this.runners.renderEnd.emit(i),this.runners.postrender.emit(i))}resize(e,n,i){const r=this.view.resolution;this.view.resize(e,n,i),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),i!==void 0&&i!==r&&this.runners.resolutionChange.emit(i)}clear(e={}){const n=this;e.target||(e.target=n.renderTarget.renderTarget),e.clearColor||(e.clearColor=this.background.colorRgba),e.clear??(e.clear=MA.ALL);const{clear:i,clearColor:r,target:s,mipLevel:l,layer:c}=e;Gi.shared.setValue(r??this.background.colorRgba),n.renderTarget.clear(s,i,Gi.shared.toArray(),l??0,c??0)}get resolution(){return this.view.resolution}set resolution(e){this.view.resolution=e,this.runners.resolutionChange.emit(e)}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(...e){e.forEach(n=>{this.runners[n]=new Pz(n)})}_addSystems(e){let n;for(n in e){const i=e[n];this._addSystem(i.value,i.name)}}_addSystem(e,n){const i=new e(this);if(this[n])throw new Error(`Whoops! The name "${n}" is already in use`);this[n]=i,this._systemsHash[n]=i;for(const r in this.runners)this.runners[r].add(i);return this}_addPipes(e,n){const i=n.reduce((r,s)=>(r[s.name]=s.value,r),{});e.forEach(r=>{const s=r.value,l=r.name,c=i[l];this.renderPipes[l]=new s(this,c?new c:null),this.runners.destroy.add(this.renderPipes[l])})}destroy(e=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(e),(e===!0||typeof e=="object"&&e.releaseGlobalResources)&&Xm.release(),Object.values(this.runners).forEach(n=>{n.destroy()}),this._systemsHash=null,this.renderPipes=null,this.removeAllListeners()}generateTexture(e){return this.textureGenerator.generateTexture(e)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!Ez())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()}};RA.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let kA=RA,By;function Fz(t){return By!==void 0||(By=(()=>{var n;const e={stencil:!0,failIfMajorPerformanceCaveat:t??kA.defaultOptions.failIfMajorPerformanceCaveat};try{if(!ts.get().getWebGLRenderingContext())return!1;let r=ts.get().createCanvas().getContext("webgl",e);const s=!!((n=r==null?void 0:r.getContextAttributes())!=null&&n.stencil);if(r){const l=r.getExtension("WEBGL_lose_context");l&&l.loseContext()}return r=null,s}catch{return!1}})()),By}let Ly;async function qz(t={}){return Ly!==void 0||(Ly=await(async()=>{const e=ts.get().getNavigator().gpu;if(!e)return!1;try{return await(await e.requestAdapter(t)).requestDevice(),!0}catch{return!1}})()),Ly}const GE=["webgl","webgpu","canvas"];async function Yz(t){let e=[];t.preference?(e.push(t.preference),GE.forEach(s=>{s!==t.preference&&e.push(s)})):e=GE.slice();let n,i={};for(let s=0;s<e.length;s++){const l=e[s];if(l==="webgpu"&&await qz()){const{WebGPURenderer:c}=await Zd(async()=>{const{WebGPURenderer:d}=await import("./WebGPURenderer-CU_7qyko.js");return{WebGPURenderer:d}},__vite__mapDeps([2,3,4]));n=c,i={...t,...t.webgpu};break}else if(l==="webgl"&&Fz(t.failIfMajorPerformanceCaveat??kA.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:c}=await Zd(async()=>{const{WebGLRenderer:d}=await import("./WebGLRenderer-B0gX63D6.js");return{WebGLRenderer:d}},__vite__mapDeps([5,3,4]));n=c,i={...t,...t.webgl};break}else if(l==="canvas"){const{CanvasRenderer:c}=await Zd(async()=>{const{CanvasRenderer:d}=await import("./CanvasRenderer-ZlhtzexK.js");return{CanvasRenderer:d}},__vite__mapDeps([6,4]));n=c,i={...t,...t.canvasOptions};break}}if(delete i.webgpu,delete i.webgl,delete i.canvasOptions,!n)throw new Error("No available renderer for the current environment");const r=new n;return await r.init(i),r}const OA="8.17.0";class DA{static init(){var e;(e=globalThis.__PIXI_APP_INIT__)==null||e.call(globalThis,this,OA)}static destroy(){}}DA.extension=Rt.Application;class Vz{constructor(e){this._renderer=e}init(){var e;(e=globalThis.__PIXI_RENDERER_INIT__)==null||e.call(globalThis,this._renderer,OA)}destroy(){this._renderer=null}}Vz.extension={type:[Rt.WebGLSystem,Rt.WebGPUSystem],name:"initHook",priority:-10};class zA{static init(e){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,i;if(this._resizeTo===globalThis.window)n=globalThis.innerWidth,i=globalThis.innerHeight;else{const{clientWidth:r,clientHeight:s}=this._resizeTo;n=r,i=s}this.renderer.resize(n,i),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}zA.extension=Rt.Application;class BA{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),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,w0.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?Vd.shared:new Vd,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}BA.extension=Rt.Application;si.add(zA);si.add(BA);const LA=class Wv{constructor(...e){this.stage=new br,e[0]!==void 0&&Qt(mi,"Application constructor options are deprecated, please use Application.init() instead.")}async init(e){e={...e},this.stage||(this.stage=new br),this.renderer=await Yz(e),Wv._plugins.forEach(n=>{n.init.call(this,e)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return Qt(mi,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(e=!1,n=!1){const i=Wv._plugins.slice(0);i.reverse(),i.forEach(r=>{r.destroy.call(this)}),this.stage.destroy(n),this.stage=null,this.renderer.destroy(e),this.renderer=null}};LA._plugins=[];let W_=LA;si.handleByList(Rt.Application,W_._plugins);si.add(DA);var Bx,FE;function Xz(){if(FE)return Bx;FE=1,Bx=n;var t={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},e=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function n(s){var l=[];return s.replace(e,function(c,d,p){var m=d.toLowerCase();for(p=r(p),m=="m"&&p.length>2&&(l.push([d].concat(p.splice(0,2))),m="l",d=d=="m"?"l":"L");;){if(p.length==t[m])return p.unshift(d),l.push(p);if(p.length<t[m])throw new Error("malformed path data");l.push([d].concat(p.splice(0,t[m])))}}),l}var i=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function r(s){var l=s.match(i);return l?l.map(Number):[]}return Bx}var Kz=Xz();const Wz=uu(Kz);function $z(t,e){const n=Wz(t),i=[];let r=null,s=0,l=0;for(let c=0;c<n.length;c++){const d=n[c],p=d[0],m=d;switch(p){case"M":s=m[1],l=m[2],e.moveTo(s,l);break;case"m":s+=m[1],l+=m[2],e.moveTo(s,l);break;case"H":s=m[1],e.lineTo(s,l);break;case"h":s+=m[1],e.lineTo(s,l);break;case"V":l=m[1],e.lineTo(s,l);break;case"v":l+=m[1],e.lineTo(s,l);break;case"L":s=m[1],l=m[2],e.lineTo(s,l);break;case"l":s+=m[1],l+=m[2],e.lineTo(s,l);break;case"C":s=m[5],l=m[6],e.bezierCurveTo(m[1],m[2],m[3],m[4],s,l);break;case"c":e.bezierCurveTo(s+m[1],l+m[2],s+m[3],l+m[4],s+m[5],l+m[6]),s+=m[5],l+=m[6];break;case"S":s=m[3],l=m[4],e.bezierCurveToShort(m[1],m[2],s,l);break;case"s":e.bezierCurveToShort(s+m[1],l+m[2],s+m[3],l+m[4]),s+=m[3],l+=m[4];break;case"Q":s=m[3],l=m[4],e.quadraticCurveTo(m[1],m[2],s,l);break;case"q":e.quadraticCurveTo(s+m[1],l+m[2],s+m[3],l+m[4]),s+=m[3],l+=m[4];break;case"T":s=m[1],l=m[2],e.quadraticCurveToShort(s,l);break;case"t":s+=m[1],l+=m[2],e.quadraticCurveToShort(s,l);break;case"A":s=m[6],l=m[7],e.arcToSvg(m[1],m[2],m[3],m[4],m[5],s,l);break;case"a":s+=m[6],l+=m[7],e.arcToSvg(m[1],m[2],m[3],m[4],m[5],s,l);break;case"Z":case"z":e.closePath(),i.length>0&&(r=i.pop(),r?(s=r.startX,l=r.startY):(s=0,l=0)),r=null;break;default:ca(`Unknown SVG path command: ${p}`)}p!=="Z"&&p!=="z"&&r===null&&(r={startX:s,startY:l},i.push(r))}return e}class $_{constructor(e=0,n=0,i=0){this.type="circle",this.x=e,this.y=n,this.radius=i}clone(){return new $_(this.x,this.y,this.radius)}contains(e,n){if(this.radius<=0)return!1;const i=this.radius*this.radius;let r=this.x-e,s=this.y-n;return r*=r,s*=s,r+s<=i}strokeContains(e,n,i,r=.5){if(this.radius===0)return!1;const s=this.x-e,l=this.y-n,c=this.radius,d=(1-r)*i,p=Math.sqrt(s*s+l*l);return p<=c+d&&p>c-(i-d)}getBounds(e){return e||(e=new Ei),e.x=this.x-this.radius,e.y=this.y-this.radius,e.width=this.radius*2,e.height=this.radius*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.radius=e.radius,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class Z_{constructor(e=0,n=0,i=0,r=0){this.type="ellipse",this.x=e,this.y=n,this.halfWidth=i,this.halfHeight=r}clone(){return new Z_(this.x,this.y,this.halfWidth,this.halfHeight)}contains(e,n){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let i=(e-this.x)/this.halfWidth,r=(n-this.y)/this.halfHeight;return i*=i,r*=r,i+r<=1}strokeContains(e,n,i,r=.5){const{halfWidth:s,halfHeight:l}=this;if(s<=0||l<=0)return!1;const c=i*(1-r),d=i-c,p=s-d,m=l-d,g=s+c,b=l+c,v=e-this.x,_=n-this.y,C=v*v/(p*p)+_*_/(m*m),T=v*v/(g*g)+_*_/(b*b);return C>1&&T<=1}getBounds(e){return e||(e=new Ei),e.x=this.x-this.halfWidth,e.y=this.y-this.halfHeight,e.width=this.halfWidth*2,e.height=this.halfHeight*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.halfWidth=e.halfWidth,this.halfHeight=e.halfHeight,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function Zz(t,e,n,i,r,s){const l=t-n,c=e-i,d=r-n,p=s-i,m=l*d+c*p,g=d*d+p*p;let b=-1;g!==0&&(b=m/g);let v,_;b<0?(v=n,_=i):b>1?(v=r,_=s):(v=n+b*d,_=i+b*p);const C=t-v,T=e-_;return C*C+T*T}let Qz,Jz;class xm{constructor(...e){this.type="polygon";let n=Array.isArray(e[0])?e[0]:e;if(typeof n[0]!="number"){const i=[];for(let r=0,s=n.length;r<s;r++)i.push(n[r].x,n[r].y);n=i}this.points=n,this.closePath=!0}isClockwise(){let e=0;const n=this.points,i=n.length;for(let r=0;r<i;r+=2){const s=n[r],l=n[r+1],c=n[(r+2)%i],d=n[(r+3)%i];e+=(c-s)*(d+l)}return e<0}containsPolygon(e){const n=this.getBounds(Qz),i=e.getBounds(Jz);if(!n.containsRect(i))return!1;const r=e.points;for(let s=0;s<r.length;s+=2){const l=r[s],c=r[s+1];if(!this.contains(l,c))return!1}return!0}clone(){const e=this.points.slice(),n=new xm(e);return n.closePath=this.closePath,n}contains(e,n){let i=!1;const r=this.points.length/2;for(let s=0,l=r-1;s<r;l=s++){const c=this.points[s*2],d=this.points[s*2+1],p=this.points[l*2],m=this.points[l*2+1];d>n!=m>n&&e<(p-c)*((n-d)/(m-d))+c&&(i=!i)}return i}strokeContains(e,n,i,r=.5){const s=i*i,l=s*(1-r),c=s-l,{points:d}=this,p=d.length-(this.closePath?0:2);for(let m=0;m<p;m+=2){const g=d[m],b=d[m+1],v=d[(m+2)%d.length],_=d[(m+3)%d.length],C=Zz(e,n,g,b,v,_),T=Math.sign((v-g)*(n-b)-(_-b)*(e-g));if(C<=(T<0?c:l))return!0}return!1}getBounds(e){e||(e=new Ei);const n=this.points;let i=1/0,r=-1/0,s=1/0,l=-1/0;for(let c=0,d=n.length;c<d;c+=2){const p=n[c],m=n[c+1];i=p<i?p:i,r=p>r?p:r,s=m<s?m:s,l=m>l?m:l}return e.x=i,e.width=r-i,e.y=s,e.height=l-s,e}copyFrom(e){return this.points=e.points.slice(),this.closePath=e.closePath,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((e,n)=>`${e}, ${n}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return Qt("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return Qt("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 Uy=(t,e,n,i,r,s,l)=>{const c=t-n,d=e-i,p=Math.sqrt(c*c+d*d);return p>=r-s&&p<=r+l};class Q_{constructor(e=0,n=0,i=0,r=0,s=20){this.type="roundedRectangle",this.x=e,this.y=n,this.width=i,this.height=r,this.radius=s}getBounds(e){return e||(e=new Ei),e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}clone(){return new Q_(this.x,this.y,this.width,this.height,this.radius)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,n){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&n>=this.y&&n<=this.y+this.height){const i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(n>=this.y+i&&n<=this.y+this.height-i||e>=this.x+i&&e<=this.x+this.width-i)return!0;let r=e-(this.x+i),s=n-(this.y+i);const l=i*i;if(r*r+s*s<=l||(r=e-(this.x+this.width-i),r*r+s*s<=l)||(s=n-(this.y+this.height-i),r*r+s*s<=l)||(r=e-(this.x+i),r*r+s*s<=l))return!0}return!1}strokeContains(e,n,i,r=.5){const{x:s,y:l,width:c,height:d,radius:p}=this,m=i*(1-r),g=i-m,b=s+p,v=l+p,_=c-p*2,C=d-p*2,T=s+c,w=l+d;return(e>=s-m&&e<=s+g||e>=T-g&&e<=T+m)&&n>=v&&n<=v+C||(n>=l-m&&n<=l+g||n>=w-g&&n<=w+m)&&e>=b&&e<=b+_?!0:e<b&&n<v&&Uy(e,n,b,v,p,g,m)||e>T-p&&n<v&&Uy(e,n,T-p,v,p,g,m)||e>T-p&&n>w-p&&Uy(e,n,T-p,w-p,p,g,m)||e<b&&n>w-p&&Uy(e,n,b,w-p,p,g,m)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}const UA={};function e5(t,e,n){let i=2166136261;for(let r=0;r<e;r++)i^=t[r].uid,i=Math.imul(i,16777619),i>>>=0;return UA[i]||t5(t,e,i,n)}function t5(t,e,n,i){const r={};let s=0;for(let c=0;c<i;c++){const d=c<e?t[c]:Tn.EMPTY.source;r[s++]=d.source,r[s++]=d.style}const l=new p0(r);return UA[n]=l,l}class qE{constructor(e){typeof e=="number"?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData),this.size=this.rawBinaryData.byteLength}get int8View(){return this._int8View||(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(e){return this[`${e}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(e){switch(e){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${e} isn't a valid view type`)}}}function YE(t,e,n,i){if(n??(n=0),i??(i=Math.min(t.byteLength-n,e.byteLength)),!(n&7)&&!(i&7)){const r=i/8;new Float64Array(e,0,r).set(new Float64Array(t,n,r))}else if(!(n&3)&&!(i&3)){const r=i/4;new Float32Array(e,0,r).set(new Float32Array(t,n,r))}else new Uint8Array(e).set(new Uint8Array(t,n,i))}const n5={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};var i5=(t=>(t[t.DISABLED=0]="DISABLED",t[t.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",t[t.MASK_ACTIVE=2]="MASK_ACTIVE",t[t.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",t[t.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",t[t.NONE=5]="NONE",t))(i5||{});function VE(t,e){return e.alphaMode==="no-premultiply-alpha"&&n5[t]||t}const r5=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
|
|
83
|
+
`);function a5(t){let e="";for(let n=0;n<t;++n)n>0&&(e+=`
|
|
84
|
+
else `),n<t-1&&(e+=`if(test == ${n}.0){}`);return e}function s5(t,e){if(t===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const n=e.createShader(e.FRAGMENT_SHADER);try{for(;;){const i=r5.replace(/%forloop%/gi,a5(t));if(e.shaderSource(n,i),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))t=t/2|0;else break}}finally{e.deleteShader(n)}return t}let Dd=null;function l5(){var e;if(Dd)return Dd;const t=gA();return Dd=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),Dd=s5(Dd,t),(e=t.getExtension("WEBGL_lose_context"))==null||e.loseContext(),Dd}class o5{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let e=0;e<this.count;e++){const n=this.textures[e];this.textures[e]=null,this.ids[n.uid]=null}this.count=0}}class c5{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new o5,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 vm=[];let T0=0;Xm.register({clear:()=>{if(vm.length>0)for(const t of vm)t&&t.destroy();vm.length=0,T0=0}});function XE(){return T0>0?vm[--T0]:new c5}function KE(t){t.elements=null,vm[T0++]=t}let Zp=0;const IA=class jA{constructor(e){this.uid=gi("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],e={...jA.defaultOptions,...e},e.maxTextures||(Qt("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),e.maxTextures=l5());const{maxTextures:n,attributesInitialSize:i,indicesInitialSize:r}=e;this.attributeBuffer=new qE(i*4),this.indexBuffer=new Uint16Array(r),this.maxTextures=n}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let e=0;e<this.batchIndex;e++)KE(this.batches[e]);this.batchIndex=0,this._batchIndexStart=0,this._batchIndexSize=0,this.dirty=!0}add(e){this._elements[this.elementSize++]=e,e._indexStart=this.indexSize,e._attributeStart=this.attributeSize,e._batcher=this,this.indexSize+=e.indexSize,this.attributeSize+=e.attributeSize*this.vertexSize}checkAndUpdateTexture(e,n){const i=e._batch.textures.ids[n._source.uid];return!i&&i!==0?!1:(e._textureId=i,e.texture=n,!0)}updateElement(e){this.dirty=!0;const n=this.attributeBuffer;e.packAsQuad?this.packQuadAttributes(e,n.float32View,n.uint32View,e._attributeStart,e._textureId):this.packAttributes(e,n.float32View,n.uint32View,e._attributeStart,e._textureId)}break(e){const n=this._elements;if(!n[this.elementStart])return;let i=XE(),r=i.textures;r.clear();const s=n[this.elementStart];let l=VE(s.blendMode,s.texture._source),c=s.topology;this.attributeSize*4>this.attributeBuffer.size&&this._resizeAttributeBuffer(this.attributeSize*4),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);const d=this.attributeBuffer.float32View,p=this.attributeBuffer.uint32View,m=this.indexBuffer;let g=this._batchIndexSize,b=this._batchIndexStart,v="startBatch",_=[];const C=this.maxTextures;for(let T=this.elementStart;T<this.elementSize;++T){const w=n[T];n[T]=null;const R=w.texture._source,O=VE(w.blendMode,R),j=l!==O||c!==w.topology;if(R._batchTick===Zp&&!j){w._textureId=R._textureBindLocation,g+=w.indexSize,w.packAsQuad?(this.packQuadAttributes(w,d,p,w._attributeStart,w._textureId),this.packQuadIndex(m,w._indexStart,w._attributeStart/this.vertexSize)):(this.packAttributes(w,d,p,w._attributeStart,w._textureId),this.packIndex(w,m,w._indexStart,w._attributeStart/this.vertexSize)),w._batch=i,_.push(w);continue}R._batchTick=Zp,(r.count>=C||j)&&(this._finishBatch(i,b,g-b,r,l,c,e,v,_),v="renderBatch",b=g,l=O,c=w.topology,i=XE(),r=i.textures,r.clear(),_=[],++Zp),w._textureId=R._textureBindLocation=r.count,r.ids[R.uid]=r.count,r.textures[r.count++]=R,w._batch=i,_.push(w),g+=w.indexSize,w.packAsQuad?(this.packQuadAttributes(w,d,p,w._attributeStart,w._textureId),this.packQuadIndex(m,w._indexStart,w._attributeStart/this.vertexSize)):(this.packAttributes(w,d,p,w._attributeStart,w._textureId),this.packIndex(w,m,w._indexStart,w._attributeStart/this.vertexSize))}r.count>0&&(this._finishBatch(i,b,g-b,r,l,c,e,v,_),b=g,++Zp),this.elementStart=this.elementSize,this._batchIndexStart=b,this._batchIndexSize=g}_finishBatch(e,n,i,r,s,l,c,d,p){e.gpuBindGroup=null,e.bindGroup=null,e.action=d,e.batcher=this,e.textures=r,e.blendMode=s,e.topology=l,e.start=n,e.size=i,e.elements=p,++Zp,this.batches[this.batchIndex++]=e,c.add(e)}finish(e){this.break(e)}ensureAttributeBuffer(e){e*4<=this.attributeBuffer.size||this._resizeAttributeBuffer(e*4)}ensureIndexBuffer(e){e<=this.indexBuffer.length||this._resizeIndexBuffer(e)}_resizeAttributeBuffer(e){const n=Math.max(e,this.attributeBuffer.size*2),i=new qE(n);YE(this.attributeBuffer.rawBinaryData,i.rawBinaryData),this.attributeBuffer=i}_resizeIndexBuffer(e){const n=this.indexBuffer;let i=Math.max(e,n.length*1.5);i+=i%2;const r=i>65535?new Uint32Array(i):new Uint16Array(i);if(r.BYTES_PER_ELEMENT!==n.BYTES_PER_ELEMENT)for(let s=0;s<n.length;s++)r[s]=n[s];else YE(n.buffer,r.buffer);this.indexBuffer=r}packQuadIndex(e,n,i){e[n]=i+0,e[n+1]=i+1,e[n+2]=i+2,e[n+3]=i+0,e[n+4]=i+2,e[n+5]=i+3}packIndex(e,n,i,r){const s=e.indices,l=e.indexSize,c=e.indexOffset,d=e.attributeOffset;for(let p=0;p<l;p++)n[i++]=r+s[p+c]-d}destroy(e={}){var n;if(this.batches!==null){for(let i=0;i<this.batchIndex;i++)KE(this.batches[i]);this.batches=null,this.geometry.destroy(!0),this.geometry=null,e.shader&&((n=this.shader)==null||n.destroy(),this.shader=null);for(let i=0;i<this._elements.length;i++)this._elements[i]&&(this._elements[i]._batch=null);this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null}}};IA.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};let u5=IA;var Ca=(t=>(t[t.MAP_READ=1]="MAP_READ",t[t.MAP_WRITE=2]="MAP_WRITE",t[t.COPY_SRC=4]="COPY_SRC",t[t.COPY_DST=8]="COPY_DST",t[t.INDEX=16]="INDEX",t[t.VERTEX=32]="VERTEX",t[t.UNIFORM=64]="UNIFORM",t[t.STORAGE=128]="STORAGE",t[t.INDIRECT=256]="INDIRECT",t[t.QUERY_RESOLVE=512]="QUERY_RESOLVE",t[t.STATIC=1024]="STATIC",t))(Ca||{});class Om extends mo{constructor(e){let{data:n,size:i}=e;const{usage:r,label:s,shrinkToFit:l}=e;super(),this._gpuData=Object.create(null),this._gcLastUsed=-1,this.autoGarbageCollect=!0,this.uid=gi("buffer"),this._resourceType="buffer",this._resourceId=gi("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,i??(i=n==null?void 0:n.byteLength);const c=!!n;this.descriptor={size:i,usage:r,mappedAtCreation:c,label:s},this.shrinkToFit=l??!0}get data(){return this._data}set data(e){this.setDataWithSize(e,e.length,!0)}get dataInt32(){return this._dataInt32||(this._dataInt32=new Int32Array(this.data.buffer)),this._dataInt32}get static(){return!!(this.descriptor.usage&Ca.STATIC)}set static(e){e?this.descriptor.usage|=Ca.STATIC:this.descriptor.usage&=~Ca.STATIC}setDataWithSize(e,n,i){if(this._updateID++,this._updateSize=n*e.BYTES_PER_ELEMENT,this._data===e){i&&this.emit("update",this);return}const r=this._data;if(this._data=e,this._dataInt32=null,!r||r.length!==e.length){!this.shrinkToFit&&r&&e.byteLength<r.byteLength?i&&this.emit("update",this):(this.descriptor.size=e.byteLength,this._resourceId=gi("resource"),this.emit("change",this));return}i&&this.emit("update",this)}update(e){this._updateSize=e??this._updateSize,this._updateID++,this.emit("update",this)}unload(){var e;this.emit("unload",this);for(const n in this._gpuData)(e=this._gpuData[n])==null||e.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 HA(t,e){if(!(t instanceof Om)){let n=e?Ca.INDEX:Ca.VERTEX;t instanceof Array&&(e?(t=new Uint32Array(t),n=Ca.INDEX|Ca.COPY_DST):(t=new Float32Array(t),n=Ca.VERTEX|Ca.COPY_DST)),t=new Om({data:t,label:e?"index-mesh-buffer":"vertex-mesh-buffer",usage:n})}return t}function f5(t,e,n){const i=t.getAttribute(e);if(!i)return n.minX=0,n.minY=0,n.maxX=0,n.maxY=0,n;const r=i.buffer.data;let s=1/0,l=1/0,c=-1/0,d=-1/0;const p=r.BYTES_PER_ELEMENT,m=(i.offset||0)/p,g=(i.stride||8)/p;for(let b=m;b<r.length;b+=g){const v=r[b],_=r[b+1];v>c&&(c=v),_>d&&(d=_),v<s&&(s=v),_<l&&(l=_)}return n.minX=s,n.minY=l,n.maxX=c,n.maxY=d,n}function d5(t){return(t instanceof Om||Array.isArray(t)||t.BYTES_PER_ELEMENT)&&(t={buffer:t}),t.buffer=HA(t.buffer,!1),t}class h5 extends mo{constructor(e={}){super(),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=gi("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new Bs,this._boundsDirty=!0;const{attributes:n,indexBuffer:i,topology:r}=e;if(this.buffers=[],this.attributes={},n)for(const s in n)this.addAttribute(s,n[s]);this.instanceCount=e.instanceCount??1,i&&this.addIndex(i),this.topology=r||"triangle-list"}onBufferUpdate(){this._boundsDirty=!0,this.emit("update",this)}getAttribute(e){return this.attributes[e]}getIndex(){return this.indexBuffer}getBuffer(e){return this.getAttribute(e).buffer}getSize(){for(const e in this.attributes){const n=this.attributes[e];return n.buffer.data.length/(n.stride/4||n.size)}return 0}addAttribute(e,n){const i=d5(n);this.buffers.indexOf(i.buffer)===-1&&(this.buffers.push(i.buffer),i.buffer.on("update",this.onBufferUpdate,this),i.buffer.on("change",this.onBufferUpdate,this)),this.attributes[e]=i}addIndex(e){this.indexBuffer=HA(e,!0),this.buffers.push(this.indexBuffer)}get bounds(){return this._boundsDirty?(this._boundsDirty=!1,f5(this,"aPosition",this._bounds)):this._bounds}unload(){var e;this.emit("unload",this);for(const n in this._gpuData)(e=this._gpuData[n])==null||e.destroy();this._gpuData=Object.create(null)}destroy(e=!1){var n;this.emit("destroy",this),this.removeAllListeners(),e&&this.buffers.forEach(i=>i.destroy()),this.unload(),(n=this.indexBuffer)==null||n.destroy(),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}}const p5=new Float32Array(1),m5=new Uint32Array(1);class g5 extends h5{constructor(){const n=new Om({data:p5,label:"attribute-batch-buffer",usage:Ca.VERTEX|Ca.COPY_DST,shrinkToFit:!1}),i=new Om({data:m5,label:"index-batch-buffer",usage:Ca.INDEX|Ca.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:i})}}function WE(t,e,n){if(t)for(const i in t){const r=i.toLocaleLowerCase(),s=e[r];if(s){let l=t[i];i==="header"&&(l=l.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),n&&s.push(`//----${n}----//`),s.push(l)}else ca(`${i} placement hook does not exist in shader`)}}const y5=/\{\{(.*?)\}\}/g;function $E(t){var i;const e={};return(((i=t.match(y5))==null?void 0:i.map(r=>r.replace(/[{()}]/g,"")))??[]).forEach(r=>{e[r]=[]}),e}function ZE(t,e){let n;const i=/@in\s+([^;]+);/g;for(;(n=i.exec(t))!==null;)e.push(n[1])}function QE(t,e,n=!1){const i=[];ZE(e,i),t.forEach(c=>{c.header&&ZE(c.header,i)});const r=i;n&&r.sort();const s=r.map((c,d)=>` @location(${d}) ${c},`).join(`
|
|
85
|
+
`);let l=e.replace(/@in\s+[^;]+;\s*/g,"");return l=l.replace("{{in}}",`
|
|
86
|
+
${s}
|
|
87
|
+
`),l}function JE(t,e){let n;const i=/@out\s+([^;]+);/g;for(;(n=i.exec(t))!==null;)e.push(n[1])}function b5(t){const n=/\b(\w+)\s*:/g.exec(t);return n?n[1]:""}function x5(t){const e=/@.*?\s+/g;return t.replace(e,"")}function v5(t,e){const n=[];JE(e,n),t.forEach(d=>{d.header&&JE(d.header,n)});let i=0;const r=n.sort().map(d=>d.indexOf("builtin")>-1?d:`@location(${i++}) ${d}`).join(`,
|
|
88
|
+
`),s=n.sort().map(d=>` var ${x5(d)};`).join(`
|
|
89
|
+
`),l=`return VSOutput(
|
|
90
|
+
${n.sort().map(d=>` ${b5(d)}`).join(`,
|
|
91
|
+
`)});`;let c=e.replace(/@out\s+[^;]+;\s*/g,"");return c=c.replace("{{struct}}",`
|
|
92
|
+
${r}
|
|
93
|
+
`),c=c.replace("{{start}}",`
|
|
94
|
+
${s}
|
|
95
|
+
`),c=c.replace("{{return}}",`
|
|
96
|
+
${l}
|
|
97
|
+
`),c}function ew(t,e){let n=t;for(const i in e){const r=e[i];r.join(`
|
|
98
|
+
`).length?n=n.replace(`{{${i}}}`,`//-----${i} START-----//
|
|
99
|
+
${r.join(`
|
|
100
|
+
`)}
|
|
101
|
+
//----${i} FINISH----//`):n=n.replace(`{{${i}}}`,"")}return n}const su=Object.create(null),Lx=new Map;let _5=0;function S5({template:t,bits:e}){const n=PA(t,e);if(su[n])return su[n];const{vertex:i,fragment:r}=w5(t,e);return su[n]=GA(i,r,e),su[n]}function E5({template:t,bits:e}){const n=PA(t,e);return su[n]||(su[n]=GA(t.vertex,t.fragment,e)),su[n]}function w5(t,e){const n=e.map(l=>l.vertex).filter(l=>!!l),i=e.map(l=>l.fragment).filter(l=>!!l);let r=QE(n,t.vertex,!0);r=v5(n,r);const s=QE(i,t.fragment,!0);return{vertex:r,fragment:s}}function PA(t,e){return e.map(n=>(Lx.has(n)||Lx.set(n,_5++),Lx.get(n))).sort((n,i)=>n-i).join("-")+t.vertex+t.fragment}function GA(t,e,n){const i=$E(t),r=$E(e);return n.forEach(s=>{WE(s.vertex,i,s.name),WE(s.fragment,r,s.name)}),{vertex:ew(t,i),fragment:ew(e,r)}}const T5=`
|
|
102
|
+
@in aPosition: vec2<f32>;
|
|
103
|
+
@in aUV: vec2<f32>;
|
|
104
|
+
|
|
105
|
+
@out @builtin(position) vPosition: vec4<f32>;
|
|
106
|
+
@out vUV : vec2<f32>;
|
|
107
|
+
@out vColor : vec4<f32>;
|
|
108
|
+
|
|
109
|
+
{{header}}
|
|
110
|
+
|
|
111
|
+
struct VSOutput {
|
|
112
|
+
{{struct}}
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
@vertex
|
|
116
|
+
fn main( {{in}} ) -> VSOutput {
|
|
117
|
+
|
|
118
|
+
var worldTransformMatrix = globalUniforms.uWorldTransformMatrix;
|
|
119
|
+
var modelMatrix = mat3x3<f32>(
|
|
120
|
+
1.0, 0.0, 0.0,
|
|
121
|
+
0.0, 1.0, 0.0,
|
|
122
|
+
0.0, 0.0, 1.0
|
|
123
|
+
);
|
|
124
|
+
var position = aPosition;
|
|
125
|
+
var uv = aUV;
|
|
126
|
+
|
|
127
|
+
{{start}}
|
|
128
|
+
|
|
129
|
+
vColor = vec4<f32>(1., 1., 1., 1.);
|
|
130
|
+
|
|
131
|
+
{{main}}
|
|
132
|
+
|
|
133
|
+
vUV = uv;
|
|
134
|
+
|
|
135
|
+
var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix;
|
|
136
|
+
|
|
137
|
+
vPosition = vec4<f32>((modelViewProjectionMatrix * vec3<f32>(position, 1.0)).xy, 0.0, 1.0);
|
|
138
|
+
|
|
139
|
+
vColor *= globalUniforms.uWorldColorAlpha;
|
|
140
|
+
|
|
141
|
+
{{end}}
|
|
142
|
+
|
|
143
|
+
{{return}}
|
|
144
|
+
};
|
|
145
|
+
`,C5=`
|
|
146
|
+
@in vUV : vec2<f32>;
|
|
147
|
+
@in vColor : vec4<f32>;
|
|
148
|
+
|
|
149
|
+
{{header}}
|
|
150
|
+
|
|
151
|
+
@fragment
|
|
152
|
+
fn main(
|
|
153
|
+
{{in}}
|
|
154
|
+
) -> @location(0) vec4<f32> {
|
|
155
|
+
|
|
156
|
+
{{start}}
|
|
157
|
+
|
|
158
|
+
var outColor:vec4<f32>;
|
|
159
|
+
|
|
160
|
+
{{main}}
|
|
161
|
+
|
|
162
|
+
var finalColor:vec4<f32> = outColor * vColor;
|
|
163
|
+
|
|
164
|
+
{{end}}
|
|
165
|
+
|
|
166
|
+
return finalColor;
|
|
167
|
+
};
|
|
168
|
+
`,A5=`
|
|
169
|
+
in vec2 aPosition;
|
|
170
|
+
in vec2 aUV;
|
|
171
|
+
|
|
172
|
+
out vec4 vColor;
|
|
173
|
+
out vec2 vUV;
|
|
174
|
+
|
|
175
|
+
{{header}}
|
|
176
|
+
|
|
177
|
+
void main(void){
|
|
178
|
+
|
|
179
|
+
mat3 worldTransformMatrix = uWorldTransformMatrix;
|
|
180
|
+
mat3 modelMatrix = mat3(
|
|
181
|
+
1.0, 0.0, 0.0,
|
|
182
|
+
0.0, 1.0, 0.0,
|
|
183
|
+
0.0, 0.0, 1.0
|
|
184
|
+
);
|
|
185
|
+
vec2 position = aPosition;
|
|
186
|
+
vec2 uv = aUV;
|
|
187
|
+
|
|
188
|
+
{{start}}
|
|
189
|
+
|
|
190
|
+
vColor = vec4(1.);
|
|
191
|
+
|
|
192
|
+
{{main}}
|
|
193
|
+
|
|
194
|
+
vUV = uv;
|
|
195
|
+
|
|
196
|
+
mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix;
|
|
197
|
+
|
|
198
|
+
gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
|
|
199
|
+
|
|
200
|
+
vColor *= uWorldColorAlpha;
|
|
201
|
+
|
|
202
|
+
{{end}}
|
|
203
|
+
}
|
|
204
|
+
`,M5=`
|
|
205
|
+
|
|
206
|
+
in vec4 vColor;
|
|
207
|
+
in vec2 vUV;
|
|
208
|
+
|
|
209
|
+
out vec4 finalColor;
|
|
210
|
+
|
|
211
|
+
{{header}}
|
|
212
|
+
|
|
213
|
+
void main(void) {
|
|
214
|
+
|
|
215
|
+
{{start}}
|
|
216
|
+
|
|
217
|
+
vec4 outColor;
|
|
218
|
+
|
|
219
|
+
{{main}}
|
|
220
|
+
|
|
221
|
+
finalColor = outColor * vColor;
|
|
222
|
+
|
|
223
|
+
{{end}}
|
|
224
|
+
}
|
|
225
|
+
`,R5={name:"global-uniforms-bit",vertex:{header:`
|
|
226
|
+
struct GlobalUniforms {
|
|
227
|
+
uProjectionMatrix:mat3x3<f32>,
|
|
228
|
+
uWorldTransformMatrix:mat3x3<f32>,
|
|
229
|
+
uWorldColorAlpha: vec4<f32>,
|
|
230
|
+
uResolution: vec2<f32>,
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
@group(0) @binding(0) var<uniform> globalUniforms : GlobalUniforms;
|
|
234
|
+
`}},N5={name:"global-uniforms-bit",vertex:{header:`
|
|
235
|
+
uniform mat3 uProjectionMatrix;
|
|
236
|
+
uniform mat3 uWorldTransformMatrix;
|
|
237
|
+
uniform vec4 uWorldColorAlpha;
|
|
238
|
+
uniform vec2 uResolution;
|
|
239
|
+
`}};function k5({bits:t,name:e}){const n=S5({template:{fragment:C5,vertex:T5},bits:[R5,...t]});return Km.from({name:e,vertex:{source:n.vertex,entryPoint:"main"},fragment:{source:n.fragment,entryPoint:"main"}})}function O5({bits:t,name:e}){return new X_({name:e,...E5({template:{vertex:A5,fragment:M5},bits:[N5,...t]})})}const D5={name:"color-bit",vertex:{header:`
|
|
240
|
+
@in aColor: vec4<f32>;
|
|
241
|
+
`,main:`
|
|
242
|
+
vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);
|
|
243
|
+
`}},z5={name:"color-bit",vertex:{header:`
|
|
244
|
+
in vec4 aColor;
|
|
245
|
+
`,main:`
|
|
246
|
+
vColor *= vec4(aColor.rgb * aColor.a, aColor.a);
|
|
247
|
+
`}},Ux={};function B5(t){const e=[];if(t===1)e.push("@group(1) @binding(0) var textureSource1: texture_2d<f32>;"),e.push("@group(1) @binding(1) var textureSampler1: sampler;");else{let n=0;for(let i=0;i<t;i++)e.push(`@group(1) @binding(${n++}) var textureSource${i+1}: texture_2d<f32>;`),e.push(`@group(1) @binding(${n++}) var textureSampler${i+1}: sampler;`)}return e.join(`
|
|
248
|
+
`)}function L5(t){const e=[];if(t===1)e.push("outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);");else{e.push("switch vTextureId {");for(let n=0;n<t;n++)n===t-1?e.push(" default:{"):e.push(` case ${n}:{`),e.push(` outColor = textureSampleGrad(textureSource${n+1}, textureSampler${n+1}, vUV, uvDx, uvDy);`),e.push(" break;}");e.push("}")}return e.join(`
|
|
249
|
+
`)}function U5(t){return Ux[t]||(Ux[t]={name:"texture-batch-bit",vertex:{header:`
|
|
250
|
+
@in aTextureIdAndRound: vec2<u32>;
|
|
251
|
+
@out @interpolate(flat) vTextureId : u32;
|
|
252
|
+
`,main:`
|
|
253
|
+
vTextureId = aTextureIdAndRound.y;
|
|
254
|
+
`,end:`
|
|
255
|
+
if(aTextureIdAndRound.x == 1)
|
|
256
|
+
{
|
|
257
|
+
vPosition = vec4<f32>(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
|
|
258
|
+
}
|
|
259
|
+
`},fragment:{header:`
|
|
260
|
+
@in @interpolate(flat) vTextureId: u32;
|
|
261
|
+
|
|
262
|
+
${B5(t)}
|
|
263
|
+
`,main:`
|
|
264
|
+
var uvDx = dpdx(vUV);
|
|
265
|
+
var uvDy = dpdy(vUV);
|
|
266
|
+
|
|
267
|
+
${L5(t)}
|
|
268
|
+
`}}),Ux[t]}const Ix={};function I5(t){const e=[];for(let n=0;n<t;n++)n>0&&e.push("else"),n<t-1&&e.push(`if(vTextureId < ${n}.5)`),e.push("{"),e.push(` outColor = texture(uTextures[${n}], vUV);`),e.push("}");return e.join(`
|
|
269
|
+
`)}function j5(t){return Ix[t]||(Ix[t]={name:"texture-batch-bit",vertex:{header:`
|
|
270
|
+
in vec2 aTextureIdAndRound;
|
|
271
|
+
out float vTextureId;
|
|
272
|
+
|
|
273
|
+
`,main:`
|
|
274
|
+
vTextureId = aTextureIdAndRound.y;
|
|
275
|
+
`,end:`
|
|
276
|
+
if(aTextureIdAndRound.x == 1.)
|
|
277
|
+
{
|
|
278
|
+
gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
|
|
279
|
+
}
|
|
280
|
+
`},fragment:{header:`
|
|
281
|
+
in float vTextureId;
|
|
282
|
+
|
|
283
|
+
uniform sampler2D uTextures[${t}];
|
|
284
|
+
|
|
285
|
+
`,main:`
|
|
286
|
+
|
|
287
|
+
${I5(t)}
|
|
288
|
+
`}}),Ix[t]}const H5={name:"round-pixels-bit",vertex:{header:`
|
|
289
|
+
fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>
|
|
290
|
+
{
|
|
291
|
+
return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
|
|
292
|
+
}
|
|
293
|
+
`}},P5={name:"round-pixels-bit",vertex:{header:`
|
|
294
|
+
vec2 roundPixels(vec2 position, vec2 targetSize)
|
|
295
|
+
{
|
|
296
|
+
return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
|
|
297
|
+
}
|
|
298
|
+
`}},tw={};function G5(t){let e=tw[t];if(e)return e;const n=new Int32Array(t);for(let i=0;i<t;i++)n[i]=i;return e=tw[t]=new _A({uTextures:{value:n,type:"i32",size:t}},{isStatic:!0}),e}class nw extends J0{constructor(e){const n=O5({name:"batch",bits:[z5,j5(e),P5]}),i=k5({name:"batch",bits:[D5,U5(e),H5]});super({glProgram:n,gpuProgram:i,resources:{batchSamplers:G5(e)}}),this.maxTextures=e}}let Qp=null;const FA=class qA extends u5{constructor(e){super(e),this.geometry=new g5,this.name=qA.extension.name,this.vertexSize=6,Qp??(Qp=new nw(e.maxTextures)),this.shader=Qp}packAttributes(e,n,i,r,s){const l=s<<16|e.roundPixels&65535,c=e.transform,d=c.a,p=c.b,m=c.c,g=c.d,b=c.tx,v=c.ty,{positions:_,uvs:C}=e,T=e.color,w=e.attributeOffset,k=w+e.attributeSize;for(let R=w;R<k;R++){const O=R*2,j=_[O],D=_[O+1];n[r++]=d*j+m*D+b,n[r++]=g*D+p*j+v,n[r++]=C[O],n[r++]=C[O+1],i[r++]=T,i[r++]=l}}packQuadAttributes(e,n,i,r,s){const l=e.texture,c=e.transform,d=c.a,p=c.b,m=c.c,g=c.d,b=c.tx,v=c.ty,_=e.bounds,C=_.maxX,T=_.minX,w=_.maxY,k=_.minY,R=l.uvs,O=e.color,j=s<<16|e.roundPixels&65535;n[r+0]=d*T+m*k+b,n[r+1]=g*k+p*T+v,n[r+2]=R.x0,n[r+3]=R.y0,i[r+4]=O,i[r+5]=j,n[r+6]=d*C+m*k+b,n[r+7]=g*k+p*C+v,n[r+8]=R.x1,n[r+9]=R.y1,i[r+10]=O,i[r+11]=j,n[r+12]=d*C+m*w+b,n[r+13]=g*w+p*C+v,n[r+14]=R.x2,n[r+15]=R.y2,i[r+16]=O,i[r+17]=j,n[r+18]=d*T+m*w+b,n[r+19]=g*w+p*T+v,n[r+20]=R.x3,n[r+21]=R.y3,i[r+22]=O,i[r+23]=j}_updateMaxTextures(e){this.shader.maxTextures!==e&&(Qp=new nw(e),this.shader=Qp)}destroy(){this.shader=null,super.destroy()}};FA.extension={type:[Rt.Batcher],name:"default"};let F5=FA;class Wm{constructor(e){this.items=Object.create(null);const{renderer:n,type:i,onUnload:r,priority:s,name:l}=e;this._renderer=n,n.gc.addResourceHash(this,"items",i,s??0),this._onUnload=r,this.name=l}add(e){return this.items[e.uid]?!1:(this.items[e.uid]=e,e.once("unload",this.remove,this),e._gcLastUsed=this._renderer.gc.now,!0)}remove(e,...n){var r;if(!this.items[e.uid])return;const i=e._gpuData[this._renderer.uid];i&&((r=this._onUnload)==null||r.call(this,e,...n),i.destroy(),e._gpuData[this._renderer.uid]=null,this.items[e.uid]=null)}removeAll(...e){Object.values(this.items).forEach(n=>n&&this.remove(n,...e))}destroy(...e){this.removeAll(...e),this.items=Object.create(null),this._renderer=null,this._onUnload=null}}function q5(t,e,n,i,r,s,l,c=null){let d=0;n*=e,r*=s;const p=c.a,m=c.b,g=c.c,b=c.d,v=c.tx,_=c.ty;for(;d<l;){const C=t[n],T=t[n+1];i[r]=p*C+g*T+v,i[r+1]=m*C+b*T+_,r+=s,n+=e,d++}}function Y5(t,e,n,i){let r=0;for(e*=n;r<i;)t[e]=0,t[e+1]=0,e+=n,r++}function YA(t,e,n,i,r){const s=e.a,l=e.b,c=e.c,d=e.d,p=e.tx,m=e.ty;n||(n=0),i||(i=2),r||(r=t.length/i-n);let g=n*i;for(let b=0;b<r;b++){const v=t[g],_=t[g+1];t[g]=s*v+c*_+p,t[g+1]=l*v+d*_+m,g+=i}}const V5=new Ht;class J_{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 e=this.baseColor,n=e>>16|e&65280|(e&255)<<16,i=this.renderable;return i?ZC(n,i.groupColor)+(this.alpha*i.groupAlpha*255<<24):n+(this.alpha*255<<24)}get transform(){var e;return((e=this.renderable)==null?void 0:e.groupTransform)||V5}copyTo(e){e.indexOffset=this.indexOffset,e.indexSize=this.indexSize,e.attributeOffset=this.attributeOffset,e.attributeSize=this.attributeSize,e.baseColor=this.baseColor,e.alpha=this.alpha,e.texture=this.texture,e.geometryData=this.geometryData,e.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 Dm={extension:{type:Rt.ShapeBuilder,name:"circle"},build(t,e){let n,i,r,s,l,c;if(t.type==="circle"){const O=t;if(l=c=O.radius,l<=0)return!1;n=O.x,i=O.y,r=s=0}else if(t.type==="ellipse"){const O=t;if(l=O.halfWidth,c=O.halfHeight,l<=0||c<=0)return!1;n=O.x,i=O.y,r=s=0}else{const O=t,j=O.width/2,D=O.height/2;n=O.x+j,i=O.y+D,l=c=Math.max(0,Math.min(O.radius,Math.min(j,D))),r=j-l,s=D-c}if(r<0||s<0)return!1;const d=Math.ceil(2.3*Math.sqrt(l+c)),p=d*8+(r?4:0)+(s?4:0);if(p===0)return!1;if(d===0)return e[0]=e[6]=n+r,e[1]=e[3]=i+s,e[2]=e[4]=n-r,e[5]=e[7]=i-s,!0;let m=0,g=d*4+(r?2:0)+2,b=g,v=p,_=r+l,C=s,T=n+_,w=n-_,k=i+C;if(e[m++]=T,e[m++]=k,e[--g]=k,e[--g]=w,s){const O=i-C;e[b++]=w,e[b++]=O,e[--v]=O,e[--v]=T}for(let O=1;O<d;O++){const j=Math.PI/2*(O/d),D=r+Math.cos(j)*l,F=s+Math.sin(j)*c,$=n+D,P=n-D,I=i+F,K=i-F;e[m++]=$,e[m++]=I,e[--g]=I,e[--g]=P,e[b++]=P,e[b++]=K,e[--v]=K,e[--v]=$}_=r,C=s+c,T=n+_,w=n-_,k=i+C;const R=i-C;return e[m++]=T,e[m++]=k,e[--v]=R,e[--v]=T,r&&(e[m++]=w,e[m++]=k,e[--v]=R,e[--v]=w),!0},triangulate(t,e,n,i,r,s){if(t.length===0)return;let l=0,c=0;for(let m=0;m<t.length;m+=2)l+=t[m],c+=t[m+1];l/=t.length/2,c/=t.length/2;let d=i;e[d*n]=l,e[d*n+1]=c;const p=d++;for(let m=0;m<t.length;m+=2)e[d*n]=t[m],e[d*n+1]=t[m+1],m>0&&(r[s++]=d,r[s++]=p,r[s++]=d-1),d++;r[s++]=p+1,r[s++]=p,r[s++]=d-1}},X5={...Dm,extension:{...Dm.extension,name:"ellipse"}},K5={...Dm,extension:{...Dm.extension,name:"roundedRectangle"}},VA=1e-4,iw=1e-4;function W5(t){const e=t.length;if(e<6)return 1;let n=0;for(let i=0,r=t[e-2],s=t[e-1];i<e;i+=2){const l=t[i],c=t[i+1];n+=(l-r)*(c+s),r=l,s=c}return n<0?-1:1}function rw(t,e,n,i,r,s,l,c){const d=t-n*r,p=e-i*r,m=t+n*s,g=e+i*s;let b,v;l?(b=i,v=-n):(b=-i,v=n);const _=d+b,C=p+v,T=m+b,w=g+v;return c.push(_,C),c.push(T,w),2}function nf(t,e,n,i,r,s,l,c){const d=n-t,p=i-e;let m=Math.atan2(d,p),g=Math.atan2(r-t,s-e);c&&m<g?m+=Math.PI*2:!c&&m>g&&(g+=Math.PI*2);let b=m;const v=g-m,_=Math.abs(v),C=Math.sqrt(d*d+p*p),T=(15*_*Math.sqrt(C)/Math.PI>>0)+1,w=v/T;if(b+=w,c){l.push(t,e),l.push(n,i);for(let k=1,R=b;k<T;k++,R+=w)l.push(t,e),l.push(t+Math.sin(R)*C,e+Math.cos(R)*C);l.push(t,e),l.push(r,s)}else{l.push(n,i),l.push(t,e);for(let k=1,R=b;k<T;k++,R+=w)l.push(t+Math.sin(R)*C,e+Math.cos(R)*C),l.push(t,e);l.push(r,s),l.push(t,e)}return T*2}function $5(t,e,n,i,r,s){const l=VA;if(t.length===0)return;const c=e;let d=c.alignment;if(e.alignment!==.5){let Q=W5(t);d=(d-.5)*Q+.5}const p=new Dr(t[0],t[1]),m=new Dr(t[t.length-2],t[t.length-1]),g=i,b=Math.abs(p.x-m.x)<l&&Math.abs(p.y-m.y)<l;if(g){t=t.slice(),b&&(t.pop(),t.pop(),m.set(t[t.length-2],t[t.length-1]));const Q=(p.x+m.x)*.5,q=(m.y+p.y)*.5;t.unshift(Q,q),t.push(Q,q)}const v=r,_=t.length/2;let C=t.length;const T=v.length/2,w=c.width/2,k=w*w,R=c.miterLimit*c.miterLimit;let O=t[0],j=t[1],D=t[2],F=t[3],$=0,P=0,I=-(j-F),K=O-D,G=0,te=0,H=Math.sqrt(I*I+K*K);I/=H,K/=H,I*=w,K*=w;const W=d,B=(1-W)*2,X=W*2;g||(c.cap==="round"?C+=nf(O-I*(B-X)*.5,j-K*(B-X)*.5,O-I*B,j-K*B,O+I*X,j+K*X,v,!0)+2:c.cap==="square"&&(C+=rw(O,j,I,K,B,X,!0,v))),v.push(O-I*B,j-K*B),v.push(O+I*X,j+K*X);for(let Q=1;Q<_-1;++Q){O=t[(Q-1)*2],j=t[(Q-1)*2+1],D=t[Q*2],F=t[Q*2+1],$=t[(Q+1)*2],P=t[(Q+1)*2+1],I=-(j-F),K=O-D,H=Math.sqrt(I*I+K*K),I/=H,K/=H,I*=w,K*=w,G=-(F-P),te=D-$,H=Math.sqrt(G*G+te*te),G/=H,te/=H,G*=w,te*=w;const q=D-O,Y=j-F,ee=D-$,V=P-F,oe=q*ee+Y*V,be=Y*ee-V*q,ve=be<0;if(Math.abs(be)<.001*Math.abs(oe)){v.push(D-I*B,F-K*B),v.push(D+I*X,F+K*X),oe>=0&&(c.join==="round"?C+=nf(D,F,D-I*B,F-K*B,D-G*B,F-te*B,v,!1)+4:C+=2,v.push(D-G*X,F-te*X),v.push(D+G*B,F+te*B));continue}const se=(-I+O)*(-K+F)-(-I+D)*(-K+j),ge=(-G+$)*(-te+F)-(-G+D)*(-te+P),le=(q*ge-ee*se)/be,Re=(V*se-Y*ge)/be,Ie=(le-D)*(le-D)+(Re-F)*(Re-F),Ue=D+(le-D)*B,Le=F+(Re-F)*B,Ve=D-(le-D)*X,ut=F-(Re-F)*X,He=Math.min(q*q+Y*Y,ee*ee+V*V),At=ve?B:X,zn=He+At*At*k;Ie<=zn?c.join==="bevel"||Ie/k>R?(ve?(v.push(Ue,Le),v.push(D+I*X,F+K*X),v.push(Ue,Le),v.push(D+G*X,F+te*X)):(v.push(D-I*B,F-K*B),v.push(Ve,ut),v.push(D-G*B,F-te*B),v.push(Ve,ut)),C+=2):c.join==="round"?ve?(v.push(Ue,Le),v.push(D+I*X,F+K*X),C+=nf(D,F,D+I*X,F+K*X,D+G*X,F+te*X,v,!0)+4,v.push(Ue,Le),v.push(D+G*X,F+te*X)):(v.push(D-I*B,F-K*B),v.push(Ve,ut),C+=nf(D,F,D-I*B,F-K*B,D-G*B,F-te*B,v,!1)+4,v.push(D-G*B,F-te*B),v.push(Ve,ut)):(v.push(Ue,Le),v.push(Ve,ut)):(v.push(D-I*B,F-K*B),v.push(D+I*X,F+K*X),c.join==="round"?ve?C+=nf(D,F,D+I*X,F+K*X,D+G*X,F+te*X,v,!0)+2:C+=nf(D,F,D-I*B,F-K*B,D-G*B,F-te*B,v,!1)+2:c.join==="miter"&&Ie/k<=R&&(ve?(v.push(Ve,ut),v.push(Ve,ut)):(v.push(Ue,Le),v.push(Ue,Le)),C+=2),v.push(D-G*B,F-te*B),v.push(D+G*X,F+te*X),C+=2)}O=t[(_-2)*2],j=t[(_-2)*2+1],D=t[(_-1)*2],F=t[(_-1)*2+1],I=-(j-F),K=O-D,H=Math.sqrt(I*I+K*K),I/=H,K/=H,I*=w,K*=w,v.push(D-I*B,F-K*B),v.push(D+I*X,F+K*X),g||(c.cap==="round"?C+=nf(D-I*(B-X)*.5,F-K*(B-X)*.5,D-I*B,F-K*B,D+I*X,F+K*X,v,!1)+2:c.cap==="square"&&(C+=rw(D,F,I,K,B,X,!1,v)));const Z=iw*iw;for(let Q=T;Q<C+T-2;++Q)O=v[Q*2],j=v[Q*2+1],D=v[(Q+1)*2],F=v[(Q+1)*2+1],$=v[(Q+2)*2],P=v[(Q+2)*2+1],!(Math.abs(O*(F-P)+D*(P-j)+$*(j-F))<Z)&&s.push(Q,Q+1,Q+2)}function Z5(t,e,n,i){const r=VA;if(t.length===0)return;const s=t[0],l=t[1],c=t[t.length-2],d=t[t.length-1],p=e||Math.abs(s-c)<r&&Math.abs(l-d)<r,m=n,g=t.length/2,b=m.length/2;for(let v=0;v<g;v++)m.push(t[v*2]),m.push(t[v*2+1]);for(let v=0;v<g-1;v++)i.push(b+v,b+v+1);p&&i.push(b+g-1,b)}function XA(t,e,n,i,r,s,l){const c=Hz(t,e,2);if(!c)return;for(let p=0;p<c.length;p+=3)s[l++]=c[p]+r,s[l++]=c[p+1]+r,s[l++]=c[p+2]+r;let d=r*i;for(let p=0;p<t.length;p+=2)n[d]=t[p],n[d+1]=t[p+1],d+=i}const Q5=[],J5={extension:{type:Rt.ShapeBuilder,name:"polygon"},build(t,e){for(let n=0;n<t.points.length;n++)e[n]=t.points[n];return!0},triangulate(t,e,n,i,r,s){XA(t,Q5,e,n,i,r,s)}},e6={extension:{type:Rt.ShapeBuilder,name:"rectangle"},build(t,e){const n=t,i=n.x,r=n.y,s=n.width,l=n.height;return s>0&&l>0?(e[0]=i,e[1]=r,e[2]=i+s,e[3]=r,e[4]=i+s,e[5]=r+l,e[6]=i,e[7]=r+l,!0):!1},triangulate(t,e,n,i,r,s){let l=0;i*=n,e[i+l]=t[0],e[i+l+1]=t[1],l+=n,e[i+l]=t[2],e[i+l+1]=t[3],l+=n,e[i+l]=t[6],e[i+l+1]=t[7],l+=n,e[i+l]=t[4],e[i+l+1]=t[5],l+=n;const c=i/n;r[s++]=c,r[s++]=c+1,r[s++]=c+2,r[s++]=c+1,r[s++]=c+3,r[s++]=c+2}},t6={extension:{type:Rt.ShapeBuilder,name:"triangle"},build(t,e){return e[0]=t.x,e[1]=t.y,e[2]=t.x2,e[3]=t.y2,e[4]=t.x3,e[5]=t.y3,!0},triangulate(t,e,n,i,r,s){let l=0;i*=n,e[i+l]=t[0],e[i+l+1]=t[1],l+=n,e[i+l]=t[2],e[i+l+1]=t[3],l+=n,e[i+l]=t[4],e[i+l+1]=t[5];const c=i/n;r[s++]=c,r[s++]=c+1,r[s++]=c+2}},aw=[{offset:0,color:"white"},{offset:1,color:"black"}],e1=class $v{constructor(...e){this.uid=gi("fillGradient"),this._tick=0,this.type="linear",this.colorStops=[];let n=n6(e);n={...n.type==="radial"?$v.defaultRadialOptions:$v.defaultLinearOptions,...HC(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(e,n){return this.colorStops.push({offset:e,color:Gi.shared.setValue(n).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:e,y:n}=this.start,{x:i,y:r}=this.end,s=i-e,l=r-n;const c=s<0||l<0;if(this._wrapMode==="clamp-to-edge"){if(s<0){const T=e;e=i,i=T,s*=-1}if(l<0){const T=n;n=r,r=T,l*=-1}}const d=this.colorStops.length?this.colorStops:aw,p=this._textureSize,{canvas:m,context:g}=lw(p,1),b=c?g.createLinearGradient(this._textureSize,0,0,0):g.createLinearGradient(0,0,this._textureSize,0);sw(b,d),g.fillStyle=b,g.fillRect(0,0,p,1),this.texture=new Tn({source:new E0({resource:m,addressMode:this._wrapMode})});const v=Math.sqrt(s*s+l*l),_=Math.atan2(l,s),C=new Ht;C.scale(v/p,1),C.rotate(_),C.translate(e,n),this.textureSpace==="local"&&C.scale(p,p),this.transform=C}buildGradient(){this.texture||this._tick++,this.type==="linear"?this.buildLinearGradient():this.buildRadialGradient()}buildRadialGradient(){if(this.texture)return;const e=this.colorStops.length?this.colorStops:aw,n=this._textureSize,{canvas:i,context:r}=lw(n,n),{x:s,y:l}=this.center,{x:c,y:d}=this.outerCenter,p=this.innerRadius,m=this.outerRadius,g=c-m,b=d-m,v=n/(m*2),_=(s-g)*v,C=(l-b)*v,T=r.createRadialGradient(_,C,p*v,(c-g)*v,(d-b)*v,m*v);sw(T,e),r.fillStyle=e[e.length-1].color,r.fillRect(0,0,n,n),r.fillStyle=T,r.translate(_,C),r.rotate(this.rotation),r.scale(1,this.scale),r.translate(-_,-C),r.fillRect(0,0,n,n),this.texture=new Tn({source:new E0({resource:i,addressMode:this._wrapMode})});const w=new Ht;w.scale(1/v,1/v),w.translate(g,b),this.textureSpace==="local"&&w.scale(n,n),this.transform=w}destroy(){var e;(e=this.texture)==null||e.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}`}};e1.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"};e1.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};let ac=e1;function sw(t,e){for(let n=0;n<e.length;n++){const i=e[n];t.addColorStop(i.offset,i.color)}}function lw(t,e){const n=ts.get().createCanvas(t,e),i=n.getContext("2d");return{canvas:n,context:i}}function n6(t){let e=t[0]??{};return(typeof e=="number"||t[1])&&(Qt("8.5.2","use options object instead"),e={type:"linear",start:{x:t[0],y:t[1]},end:{x:t[2],y:t[3]},textureSpace:t[4],textureSize:t[5]??ac.defaultLinearOptions.textureSize}),e}const i6=new Ht,r6=new Ei;function a6(t,e,n,i){const r=e.matrix?t.copyFrom(e.matrix).invert():t.identity();if(e.textureSpace==="local"){const l=n.getBounds(r6);e.width&&l.pad(e.width);const{x:c,y:d}=l,p=1/l.width,m=1/l.height,g=-c*p,b=-d*m,v=r.a,_=r.b,C=r.c,T=r.d;r.a*=p,r.b*=p,r.c*=m,r.d*=m,r.tx=g*v+b*C+r.tx,r.ty=g*_+b*T+r.ty}else r.translate(e.texture.frame.x,e.texture.frame.y),r.scale(1/e.texture.source.width,1/e.texture.source.height);const s=e.texture.source.style;return!(e.fill instanceof ac)&&s.addressMode==="clamp-to-edge"&&(s.addressMode="repeat",s.update()),i&&r.append(i6.copyFrom(i).invert()),r}const eb={};si.handleByMap(Rt.ShapeBuilder,eb);si.add(e6,J5,t6,Dm,X5,K5);const s6=new Ei,l6=new Ht;function o6(t,e){const{geometryData:n,batches:i}=e;i.length=0,n.indices.length=0,n.vertices.length=0,n.uvs.length=0;for(let r=0;r<t.instructions.length;r++){const s=t.instructions[r];if(s.action==="texture")c6(s.data,i,n);else if(s.action==="fill"||s.action==="stroke"){const l=s.action==="stroke",c=s.data.path.shapePath,d=s.data.style,p=s.data.hole;l&&p&&ow(p.shapePath,d,!0,i,n),p&&(c.shapePrimitives[c.shapePrimitives.length-1].holes=p.shapePath.shapePrimitives),ow(c,d,l,i,n)}}}function c6(t,e,n){const i=[],r=eb.rectangle,s=s6;s.x=t.dx,s.y=t.dy,s.width=t.dw,s.height=t.dh;const l=t.transform;if(!r.build(s,i))return;const{vertices:c,uvs:d,indices:p}=n,m=p.length,g=c.length/2;l&&YA(i,l),r.triangulate(i,c,2,g,p,m);const b=t.image,v=b.uvs;d.push(v.x0,v.y0,v.x1,v.y1,v.x3,v.y3,v.x2,v.y2);const _=Ra.get(J_);_.indexOffset=m,_.indexSize=p.length-m,_.attributeOffset=g,_.attributeSize=c.length/2-g,_.baseColor=t.style,_.alpha=t.alpha,_.texture=b,_.geometryData=n,e.push(_)}function ow(t,e,n,i,r){const{vertices:s,uvs:l,indices:c}=r;t.shapePrimitives.forEach(({shape:d,transform:p,holes:m})=>{const g=[],b=eb[d.type];if(!b.build(d,g))return;const v=c.length,_=s.length/2;let C="triangle-list";if(p&&YA(g,p),n){const R=d.closePath??!0,O=e;O.pixelLine?(Z5(g,R,s,c),C="line-list"):$5(g,O,!1,R,s,c)}else if(m){const R=[],O=g.slice();u6(m).forEach(D=>{R.push(O.length/2),O.push(...D)}),XA(O,R,s,2,_,c,v)}else b.triangulate(g,s,2,_,c,v);const T=l.length/2,w=e.texture;if(w!==Tn.WHITE){const R=a6(l6,e,d,p);q5(s,2,_,l,T,2,s.length/2-_,R)}else Y5(l,T,2,s.length/2-_);const k=Ra.get(J_);k.indexOffset=v,k.indexSize=c.length-v,k.attributeOffset=_,k.attributeSize=s.length/2-_,k.baseColor=e.color,k.alpha=e.alpha,k.texture=w,k.geometryData=r,k.topology=C,i.push(k)})}function u6(t){const e=[];for(let n=0;n<t.length;n++){const i=t[n].shape,r=[];eb[i.type].build(i,r)&&e.push(r)}return e}class f6{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]}}reset(){this.batches&&this.batches.forEach(e=>{Ra.return(e)}),this.graphicsData&&Ra.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 d6{constructor(){this.instructions=new q_}init(e){const n=e.maxTextures;this.batcher?this.batcher._updateMaxTextures(n):this.batcher=new F5({maxTextures:n}),this.instructions.reset()}get geometry(){return Qt(o4,"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 t1=class Zv{constructor(e){this._renderer=e,this._managedContexts=new Wm({renderer:e,type:"resource",name:"graphicsContext"})}init(e){Zv.defaultOptions.bezierSmoothness=(e==null?void 0:e.bezierSmoothness)??Zv.defaultOptions.bezierSmoothness}getContextRenderData(e){return e._gpuData[this._renderer.uid].graphicsData||this._initContextRenderData(e)}updateGpuContext(e){const n=!!e._gpuData[this._renderer.uid],i=e._gpuData[this._renderer.uid]||this._initContext(e);if(e.dirty||!n){n&&i.reset(),o6(e,i);const r=e.batchMode;e.customShader||r==="no-batch"?i.isBatchable=!1:r==="auto"?i.isBatchable=i.geometryData.vertices.length<400:i.isBatchable=!0,e.dirty=!1}return i}getGpuContext(e){return e._gpuData[this._renderer.uid]||this._initContext(e)}_initContextRenderData(e){const n=Ra.get(d6,{maxTextures:this._renderer.limits.maxBatchableTextures}),i=e._gpuData[this._renderer.uid],{batches:r,geometryData:s}=i;i.graphicsData=n;const l=s.vertices.length,c=s.indices.length;for(let g=0;g<r.length;g++)r[g].applyTransform=!1;const d=n.batcher;d.ensureAttributeBuffer(l),d.ensureIndexBuffer(c),d.begin();for(let g=0;g<r.length;g++){const b=r[g];d.add(b)}d.finish(n.instructions);const p=d.geometry;p.indexBuffer.setDataWithSize(d.indexBuffer,d.indexSize,!0),p.buffers[0].setDataWithSize(d.attributeBuffer.float32View,d.attributeSize,!0);const m=d.batches;for(let g=0;g<m.length;g++){const b=m[g];b.bindGroup=e5(b.textures.textures,b.textures.count,this._renderer.limits.maxBatchableTextures)}return n}_initContext(e){const n=new f6;return n.context=e,e._gpuData[this._renderer.uid]=n,this._managedContexts.add(e),n}destroy(){this._managedContexts.destroy(),this._renderer=null}};t1.extension={type:[Rt.WebGLSystem,Rt.WebGPUSystem],name:"graphicsContext"};t1.defaultOptions={bezierSmoothness:.5};let n1=t1;const h6=8,Iy=11920929e-14,p6=1;function KA(t,e,n,i,r,s,l,c,d,p){const g=Math.min(.99,Math.max(0,p??n1.defaultOptions.bezierSmoothness));let b=(p6-g)/1;return b*=b,m6(e,n,i,r,s,l,c,d,t,b),t}function m6(t,e,n,i,r,s,l,c,d,p){Qv(t,e,n,i,r,s,l,c,d,p,0),d.push(l,c)}function Qv(t,e,n,i,r,s,l,c,d,p,m){if(m>h6)return;const g=(t+n)/2,b=(e+i)/2,v=(n+r)/2,_=(i+s)/2,C=(r+l)/2,T=(s+c)/2,w=(g+v)/2,k=(b+_)/2,R=(v+C)/2,O=(_+T)/2,j=(w+R)/2,D=(k+O)/2;if(m>0){let F=l-t,$=c-e;const P=Math.abs((n-l)*$-(i-c)*F),I=Math.abs((r-l)*$-(s-c)*F);if(P>Iy&&I>Iy){if((P+I)*(P+I)<=p*(F*F+$*$)){d.push(j,D);return}}else if(P>Iy){if(P*P<=p*(F*F+$*$)){d.push(j,D);return}}else if(I>Iy){if(I*I<=p*(F*F+$*$)){d.push(j,D);return}}else if(F=j-(t+l)/2,$=D-(e+c)/2,F*F+$*$<=p){d.push(j,D);return}}Qv(t,e,g,b,w,k,j,D,d,p,m+1),Qv(j,D,R,O,C,T,l,c,d,p,m+1)}const g6=8,y6=11920929e-14,b6=1;function x6(t,e,n,i,r,s,l,c){const p=Math.min(.99,Math.max(0,c??n1.defaultOptions.bezierSmoothness));let m=(b6-p)/1;return m*=m,v6(e,n,i,r,s,l,t,m),t}function v6(t,e,n,i,r,s,l,c){Jv(l,t,e,n,i,r,s,c,0),l.push(r,s)}function Jv(t,e,n,i,r,s,l,c,d){if(d>g6)return;const p=(e+i)/2,m=(n+r)/2,g=(i+s)/2,b=(r+l)/2,v=(p+g)/2,_=(m+b)/2;let C=s-e,T=l-n;const w=Math.abs((i-s)*T-(r-l)*C);if(w>y6){if(w*w<=c*(C*C+T*T)){t.push(v,_);return}}else if(C=v-(e+s)/2,T=_-(n+l)/2,C*C+T*T<=c){t.push(v,_);return}Jv(t,e,n,p,m,v,_,c,d+1),Jv(t,v,_,g,b,s,l,c,d+1)}function WA(t,e,n,i,r,s,l,c){let d=Math.abs(r-s);(!l&&r>s||l&&s>r)&&(d=2*Math.PI-d),c||(c=Math.max(6,Math.floor(6*Math.pow(i,1/3)*(d/Math.PI)))),c=Math.max(c,3);let p=d/c,m=r;p*=l?-1:1;for(let g=0;g<c+1;g++){const b=Math.cos(m),v=Math.sin(m),_=e+b*i,C=n+v*i;t.push(_,C),m+=p}}function _6(t,e,n,i,r,s){const l=t[t.length-2],d=t[t.length-1]-n,p=l-e,m=r-n,g=i-e,b=Math.abs(d*g-p*m);if(b<1e-8||s===0){(t[t.length-2]!==e||t[t.length-1]!==n)&&t.push(e,n);return}const v=d*d+p*p,_=m*m+g*g,C=d*m+p*g,T=s*Math.sqrt(v)/b,w=s*Math.sqrt(_)/b,k=T*C/v,R=w*C/_,O=T*g+w*p,j=T*m+w*d,D=p*(w+k),F=d*(w+k),$=g*(T+R),P=m*(T+R),I=Math.atan2(F-j,D-O),K=Math.atan2(P-j,$-O);WA(t,O+e,j+n,s,I,K,p*m>g*d)}const _m=Math.PI*2,jx={centerX:0,centerY:0,ang1:0,ang2:0},Hx=({x:t,y:e},n,i,r,s,l,c,d)=>{t*=n,e*=i;const p=r*t-s*e,m=s*t+r*e;return d.x=p+l,d.y=m+c,d};function S6(t,e){const n=e===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(e/4),i=e===1.5707963267948966?.551915024494:n,r=Math.cos(t),s=Math.sin(t),l=Math.cos(t+e),c=Math.sin(t+e);return[{x:r-s*i,y:s+r*i},{x:l+c*i,y:c-l*i},{x:l,y:c}]}const cw=(t,e,n,i)=>{const r=t*i-e*n<0?-1:1;let s=t*n+e*i;return s>1&&(s=1),s<-1&&(s=-1),r*Math.acos(s)},E6=(t,e,n,i,r,s,l,c,d,p,m,g,b)=>{const v=Math.pow(r,2),_=Math.pow(s,2),C=Math.pow(m,2),T=Math.pow(g,2);let w=v*_-v*T-_*C;w<0&&(w=0),w/=v*T+_*C,w=Math.sqrt(w)*(l===c?-1:1);const k=w*r/s*g,R=w*-s/r*m,O=p*k-d*R+(t+n)/2,j=d*k+p*R+(e+i)/2,D=(m-k)/r,F=(g-R)/s,$=(-m-k)/r,P=(-g-R)/s,I=cw(1,0,D,F);let K=cw(D,F,$,P);c===0&&K>0&&(K-=_m),c===1&&K<0&&(K+=_m),b.centerX=O,b.centerY=j,b.ang1=I,b.ang2=K};function w6(t,e,n,i,r,s,l,c=0,d=0,p=0){if(s===0||l===0)return;const m=Math.sin(c*_m/360),g=Math.cos(c*_m/360),b=g*(e-i)/2+m*(n-r)/2,v=-m*(e-i)/2+g*(n-r)/2;if(b===0&&v===0)return;s=Math.abs(s),l=Math.abs(l);const _=Math.pow(b,2)/Math.pow(s,2)+Math.pow(v,2)/Math.pow(l,2);_>1&&(s*=Math.sqrt(_),l*=Math.sqrt(_)),E6(e,n,i,r,s,l,d,p,m,g,b,v,jx);let{ang1:C,ang2:T}=jx;const{centerX:w,centerY:k}=jx;let R=Math.abs(T)/(_m/4);Math.abs(1-R)<1e-7&&(R=1);const O=Math.max(Math.ceil(R),1);T/=O;let j=t[t.length-2],D=t[t.length-1];const F={x:0,y:0};for(let $=0;$<O;$++){const P=S6(C,T),{x:I,y:K}=Hx(P[0],s,l,g,m,w,k,F),{x:G,y:te}=Hx(P[1],s,l,g,m,w,k,F),{x:H,y:W}=Hx(P[2],s,l,g,m,w,k,F);KA(t,j,D,I,K,G,te,H,W),j=H,D=W,C+=T}}function T6(t,e,n){const i=(l,c)=>{const d=c.x-l.x,p=c.y-l.y,m=Math.sqrt(d*d+p*p),g=d/m,b=p/m;return{len:m,nx:g,ny:b}},r=(l,c)=>{l===0?t.moveTo(c.x,c.y):t.lineTo(c.x,c.y)};let s=e[e.length-1];for(let l=0;l<e.length;l++){const c=e[l%e.length],d=c.radius??n;if(d<=0){r(l,c),s=c;continue}const p=e[(l+1)%e.length],m=i(c,s),g=i(c,p);if(m.len<1e-4||g.len<1e-4){r(l,c),s=c;continue}let b=Math.asin(m.nx*g.ny-m.ny*g.nx),v=1,_=!1;m.nx*g.nx-m.ny*-g.ny<0?b<0?b=Math.PI+b:(b=Math.PI-b,v=-1,_=!0):b>0&&(v=-1,_=!0);const C=b/2;let T,w=Math.abs(Math.cos(C)*d/Math.sin(C));w>Math.min(m.len/2,g.len/2)?(w=Math.min(m.len/2,g.len/2),T=Math.abs(w*Math.sin(C)/Math.cos(C))):T=d;const k=c.x+g.nx*w+-g.ny*T*v,R=c.y+g.ny*w+g.nx*T*v,O=Math.atan2(m.ny,m.nx)+Math.PI/2*v,j=Math.atan2(g.ny,g.nx)-Math.PI/2*v;l===0&&t.moveTo(k+Math.cos(O)*T,R+Math.sin(O)*T),t.arc(k,R,T,O,j,_),s=c}}function C6(t,e,n,i){const r=(c,d)=>Math.sqrt((c.x-d.x)**2+(c.y-d.y)**2),s=(c,d,p)=>({x:c.x+(d.x-c.x)*p,y:c.y+(d.y-c.y)*p}),l=e.length;for(let c=0;c<l;c++){const d=e[(c+1)%l],p=d.radius??n;if(p<=0){c===0?t.moveTo(d.x,d.y):t.lineTo(d.x,d.y);continue}const m=e[c],g=e[(c+2)%l],b=r(m,d);let v;if(b<1e-4)v=d;else{const T=Math.min(b/2,p);v=s(d,m,T/b)}const _=r(g,d);let C;if(_<1e-4)C=d;else{const T=Math.min(_/2,p);C=s(d,g,T/_)}c===0?t.moveTo(v.x,v.y):t.lineTo(v.x,v.y),t.quadraticCurveTo(d.x,d.y,C.x,C.y,i)}}const A6=new Ei;class M6{constructor(e){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new Bs,this._graphicsPath2D=e,this.signed=e.checkForHoles}moveTo(e,n){return this.startPoly(e,n),this}lineTo(e,n){this._ensurePoly();const i=this._currentPoly.points,r=i[i.length-2],s=i[i.length-1];return(r!==e||s!==n)&&i.push(e,n),this}arc(e,n,i,r,s,l){this._ensurePoly(!1);const c=this._currentPoly.points;return WA(c,e,n,i,r,s,l),this}arcTo(e,n,i,r,s){this._ensurePoly();const l=this._currentPoly.points;return _6(l,e,n,i,r,s),this}arcToSvg(e,n,i,r,s,l,c){const d=this._currentPoly.points;return w6(d,this._currentPoly.lastX,this._currentPoly.lastY,l,c,e,n,i,r,s),this}bezierCurveTo(e,n,i,r,s,l,c){this._ensurePoly();const d=this._currentPoly;return KA(this._currentPoly.points,d.lastX,d.lastY,e,n,i,r,s,l,c),this}quadraticCurveTo(e,n,i,r,s){this._ensurePoly();const l=this._currentPoly;return x6(this._currentPoly.points,l.lastX,l.lastY,e,n,i,r,s),this}closePath(){return this.endPoly(!0),this}addPath(e,n){this.endPoly(),n&&!n.isIdentity()&&(e=e.clone(!0),e.transform(n));const i=this.shapePrimitives,r=i.length;for(let s=0;s<e.instructions.length;s++){const l=e.instructions[s];this[l.action](...l.data)}if(e.checkForHoles&&i.length-r>1){let s=null;for(let l=r;l<i.length;l++){const c=i[l];if(c.shape.type==="polygon"){const d=c.shape,p=s==null?void 0:s.shape;p&&p.containsPolygon(d)?(s.holes||(s.holes=[]),s.holes.push(c),i.copyWithin(l,l+1),i.length--,l--):s=c}}}return this}finish(e=!1){this.endPoly(e)}rect(e,n,i,r,s){return this.drawShape(new Ei(e,n,i,r),s),this}circle(e,n,i,r){return this.drawShape(new $_(e,n,i),r),this}poly(e,n,i){const r=new xm(e);return r.closePath=n,this.drawShape(r,i),this}regularPoly(e,n,i,r,s=0,l){r=Math.max(r|0,3);const c=-1*Math.PI/2+s,d=Math.PI*2/r,p=[];for(let m=0;m<r;m++){const g=c-m*d;p.push(e+i*Math.cos(g),n+i*Math.sin(g))}return this.poly(p,!0,l),this}roundPoly(e,n,i,r,s,l=0,c){if(r=Math.max(r|0,3),s<=0)return this.regularPoly(e,n,i,r,l);const d=i*Math.sin(Math.PI/r)-.001;s=Math.min(s,d);const p=-1*Math.PI/2+l,m=Math.PI*2/r,g=(r-2)*Math.PI/r/2;for(let b=0;b<r;b++){const v=b*m+p,_=e+i*Math.cos(v),C=n+i*Math.sin(v),T=v+Math.PI+g,w=v-Math.PI-g,k=_+s*Math.cos(T),R=C+s*Math.sin(T),O=_+s*Math.cos(w),j=C+s*Math.sin(w);b===0?this.moveTo(k,R):this.lineTo(k,R),this.quadraticCurveTo(_,C,O,j,c)}return this.closePath()}roundShape(e,n,i=!1,r){return e.length<3?this:(i?C6(this,e,n,r):T6(this,e,n),this.closePath())}filletRect(e,n,i,r,s){if(s===0)return this.rect(e,n,i,r);const l=Math.min(i,r)/2,c=Math.min(l,Math.max(-l,s)),d=e+i,p=n+r,m=c<0?-c:0,g=Math.abs(c);return this.moveTo(e,n+g).arcTo(e+m,n+m,e+g,n,g).lineTo(d-g,n).arcTo(d-m,n+m,d,n+g,g).lineTo(d,p-g).arcTo(d-m,p-m,e+i-g,p,g).lineTo(e+g,p).arcTo(e+m,p-m,e,p-g,g).closePath()}chamferRect(e,n,i,r,s,l){if(s<=0)return this.rect(e,n,i,r);const c=Math.min(s,Math.min(i,r)/2),d=e+i,p=n+r,m=[e+c,n,d-c,n,d,n+c,d,p-c,d-c,p,e+c,p,e,p-c,e,n+c];for(let g=m.length-1;g>=2;g-=2)m[g]===m[g-2]&&m[g-1]===m[g-3]&&m.splice(g-1,2);return this.poly(m,!0,l)}ellipse(e,n,i,r,s){return this.drawShape(new Z_(e,n,i,r),s),this}roundRect(e,n,i,r,s,l){return this.drawShape(new Q_(e,n,i,r,s),l),this}drawShape(e,n){return this.endPoly(),this.shapePrimitives.push({shape:e,transform:n}),this}startPoly(e,n){let i=this._currentPoly;return i&&this.endPoly(),i=new xm,i.points.push(e,n),this._currentPoly=i,this}endPoly(e=!1){const n=this._currentPoly;return n&&n.points.length>2&&(n.closePath=e,this.shapePrimitives.push({shape:n})),this._currentPoly=null,this}_ensurePoly(e=!0){if(!this._currentPoly&&(this._currentPoly=new xm,e)){const n=this.shapePrimitives[this.shapePrimitives.length-1];if(n){let i=n.shape.x,r=n.shape.y;if(n.transform&&!n.transform.isIdentity()){const s=n.transform,l=i;i=s.a*i+s.c*r+s.tx,r=s.b*l+s.d*r+s.ty}this._currentPoly.points.push(i,r)}else this._currentPoly.points.push(0,0)}}buildPath(){const e=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let n=0;n<e.instructions.length;n++){const i=e.instructions[n];this[i.action](...i.data)}this.finish()}get bounds(){const e=this._bounds;e.clear();const n=this.shapePrimitives;for(let i=0;i<n.length;i++){const r=n[i],s=r.shape.getBounds(A6);r.transform?e.addRect(s,r.transform):e.addRect(s)}return e}}class ic{constructor(e,n=!1){this.instructions=[],this.uid=gi("graphicsPath"),this._dirty=!0,this.checkForHoles=n,typeof e=="string"?$z(e,this):this.instructions=(e==null?void 0:e.slice())??[]}get shapePath(){return this._shapePath||(this._shapePath=new M6(this)),this._dirty&&(this._dirty=!1,this._shapePath.buildPath()),this._shapePath}addPath(e,n){return e=e.clone(),this.instructions.push({action:"addPath",data:[e,n]}),this._dirty=!0,this}arc(...e){return this.instructions.push({action:"arc",data:e}),this._dirty=!0,this}arcTo(...e){return this.instructions.push({action:"arcTo",data:e}),this._dirty=!0,this}arcToSvg(...e){return this.instructions.push({action:"arcToSvg",data:e}),this._dirty=!0,this}bezierCurveTo(...e){return this.instructions.push({action:"bezierCurveTo",data:e}),this._dirty=!0,this}bezierCurveToShort(e,n,i,r,s){const l=this.instructions[this.instructions.length-1],c=this.getLastPoint(Dr.shared);let d=0,p=0;if(!l||l.action!=="bezierCurveTo")d=c.x,p=c.y;else{d=l.data[2],p=l.data[3];const m=c.x,g=c.y;d=m+(m-d),p=g+(g-p)}return this.instructions.push({action:"bezierCurveTo",data:[d,p,e,n,i,r,s]}),this._dirty=!0,this}closePath(){return this.instructions.push({action:"closePath",data:[]}),this._dirty=!0,this}ellipse(...e){return this.instructions.push({action:"ellipse",data:e}),this._dirty=!0,this}lineTo(...e){return this.instructions.push({action:"lineTo",data:e}),this._dirty=!0,this}moveTo(...e){return this.instructions.push({action:"moveTo",data:e}),this}quadraticCurveTo(...e){return this.instructions.push({action:"quadraticCurveTo",data:e}),this._dirty=!0,this}quadraticCurveToShort(e,n,i){const r=this.instructions[this.instructions.length-1],s=this.getLastPoint(Dr.shared);let l=0,c=0;if(!r||r.action!=="quadraticCurveTo")l=s.x,c=s.y;else{l=r.data[0],c=r.data[1];const d=s.x,p=s.y;l=d+(d-l),c=p+(p-c)}return this.instructions.push({action:"quadraticCurveTo",data:[l,c,e,n,i]}),this._dirty=!0,this}rect(e,n,i,r,s){return this.instructions.push({action:"rect",data:[e,n,i,r,s]}),this._dirty=!0,this}circle(e,n,i,r){return this.instructions.push({action:"circle",data:[e,n,i,r]}),this._dirty=!0,this}roundRect(...e){return this.instructions.push({action:"roundRect",data:e}),this._dirty=!0,this}poly(...e){return this.instructions.push({action:"poly",data:e}),this._dirty=!0,this}regularPoly(...e){return this.instructions.push({action:"regularPoly",data:e}),this._dirty=!0,this}roundPoly(...e){return this.instructions.push({action:"roundPoly",data:e}),this._dirty=!0,this}roundShape(...e){return this.instructions.push({action:"roundShape",data:e}),this._dirty=!0,this}filletRect(...e){return this.instructions.push({action:"filletRect",data:e}),this._dirty=!0,this}chamferRect(...e){return this.instructions.push({action:"chamferRect",data:e}),this._dirty=!0,this}star(e,n,i,r,s,l,c){s||(s=r/2);const d=-1*Math.PI/2+l,p=i*2,m=Math.PI*2/p,g=[];for(let b=0;b<p;b++){const v=b%2?s:r,_=b*m+d;g.push(e+v*Math.cos(_),n+v*Math.sin(_))}return this.poly(g,!0,c),this}clone(e=!1){const n=new ic;if(n.checkForHoles=this.checkForHoles,!e)n.instructions=this.instructions.slice();else for(let i=0;i<this.instructions.length;i++){const r=this.instructions[i];n.instructions.push({action:r.action,data:r.data.slice()})}return n}clear(){return this.instructions.length=0,this._dirty=!0,this}transform(e){if(e.isIdentity())return this;const n=e.a,i=e.b,r=e.c,s=e.d,l=e.tx,c=e.ty;let d=0,p=0,m=0,g=0,b=0,v=0,_=0,C=0;for(let T=0;T<this.instructions.length;T++){const w=this.instructions[T],k=w.data;switch(w.action){case"moveTo":case"lineTo":d=k[0],p=k[1],k[0]=n*d+r*p+l,k[1]=i*d+s*p+c;break;case"bezierCurveTo":m=k[0],g=k[1],b=k[2],v=k[3],d=k[4],p=k[5],k[0]=n*m+r*g+l,k[1]=i*m+s*g+c,k[2]=n*b+r*v+l,k[3]=i*b+s*v+c,k[4]=n*d+r*p+l,k[5]=i*d+s*p+c;break;case"quadraticCurveTo":m=k[0],g=k[1],d=k[2],p=k[3],k[0]=n*m+r*g+l,k[1]=i*m+s*g+c,k[2]=n*d+r*p+l,k[3]=i*d+s*p+c;break;case"arcToSvg":d=k[5],p=k[6],_=k[0],C=k[1],k[0]=n*_+r*C,k[1]=i*_+s*C,k[5]=n*d+r*p+l,k[6]=i*d+s*p+c;break;case"circle":k[4]=Jp(k[3],e);break;case"rect":k[4]=Jp(k[4],e);break;case"ellipse":k[8]=Jp(k[8],e);break;case"roundRect":k[5]=Jp(k[5],e);break;case"addPath":k[0].transform(e);break;case"poly":k[2]=Jp(k[2],e);break;default:ca("unknown transform action",w.action);break}}return this._dirty=!0,this}get bounds(){return this.shapePath.bounds}getLastPoint(e){let n=this.instructions.length-1,i=this.instructions[n];if(!i)return e.x=0,e.y=0,e;for(;i.action==="closePath";){if(n--,n<0)return e.x=0,e.y=0,e;i=this.instructions[n]}switch(i.action){case"moveTo":case"lineTo":e.x=i.data[0],e.y=i.data[1];break;case"quadraticCurveTo":e.x=i.data[2],e.y=i.data[3];break;case"bezierCurveTo":e.x=i.data[4],e.y=i.data[5];break;case"arc":case"arcToSvg":e.x=i.data[5],e.y=i.data[6];break;case"addPath":i.data[0].getLastPoint(e);break}return e}}function Jp(t,e){return t?t.prepend(e):e.clone()}function pi(t,e,n){const i=t.getAttribute(e);return i?Number(i):n}function R6(t,e){const n=t.querySelectorAll("defs");for(let i=0;i<n.length;i++){const r=n[i];for(let s=0;s<r.children.length;s++){const l=r.children[s];switch(l.nodeName.toLowerCase()){case"lineargradient":e.defs[l.id]=N6(l);break;case"radialgradient":e.defs[l.id]=k6();break}}}}function N6(t){const e=pi(t,"x1",0),n=pi(t,"y1",0),i=pi(t,"x2",1),r=pi(t,"y2",0),s=t.getAttribute("gradientUnits")||"objectBoundingBox",l=new ac(e,n,i,r,s==="objectBoundingBox"?"local":"global");for(let c=0;c<t.children.length;c++){const d=t.children[c],p=pi(d,"offset",0),m=Gi.shared.setValue(d.getAttribute("stop-color")).toNumber();l.addColorStop(p,m)}return l}function k6(t){return ca("[SVG Parser] Radial gradients are not yet supported"),new ac(0,0,1,0)}function uw(t){const e=t.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return e?e[1]:""}const fw={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 $A(t,e){const n=t.getAttribute("style"),i={},r={},s={strokeStyle:i,fillStyle:r,useFill:!1,useStroke:!1};for(const l in fw){const c=t.getAttribute(l);c&&dw(e,s,l,c.trim())}if(n){const l=n.split(";");for(let c=0;c<l.length;c++){const d=l[c].trim(),[p,m]=d.split(":");fw[p]&&dw(e,s,p,m.trim())}}return{strokeStyle:s.useStroke?i:null,fillStyle:s.useFill?r:null,useFill:s.useFill,useStroke:s.useStroke}}function dw(t,e,n,i){switch(n){case"stroke":if(i!=="none"){if(i.startsWith("url(")){const r=uw(i);e.strokeStyle.fill=t.defs[r]}else e.strokeStyle.color=Gi.shared.setValue(i).toNumber();e.useStroke=!0}break;case"stroke-width":e.strokeStyle.width=Number(i);break;case"fill":if(i!=="none"){if(i.startsWith("url(")){const r=uw(i);e.fillStyle.fill=t.defs[r]}else e.fillStyle.color=Gi.shared.setValue(i).toNumber();e.useFill=!0}break;case"fill-opacity":e.fillStyle.alpha=Number(i);break;case"stroke-opacity":e.strokeStyle.alpha=Number(i);break;case"opacity":e.fillStyle.alpha=Number(i),e.strokeStyle.alpha=Number(i);break}}function O6(t){if(t.length<=2)return!0;const e=t.map(c=>c.area).sort((c,d)=>d-c),[n,i]=e,r=e[e.length-1],s=n/i,l=i/r;return!(s>3&&l<2)}function D6(t){return t.split(/(?=[Mm])/).filter(i=>i.trim().length>0)}function z6(t){const e=t.match(/[-+]?[0-9]*\.?[0-9]+/g);if(!e||e.length<4)return 0;const n=e.map(Number),i=[],r=[];for(let m=0;m<n.length;m+=2)m+1<n.length&&(i.push(n[m]),r.push(n[m+1]));if(i.length===0||r.length===0)return 0;const s=Math.min(...i),l=Math.max(...i),c=Math.min(...r),d=Math.max(...r);return(l-s)*(d-c)}function hw(t,e){const n=new ic(t,!1);for(const i of n.instructions)e.instructions.push(i)}function B6(t,e){if(typeof t=="string"){const l=document.createElement("div");l.innerHTML=t.trim(),t=l.querySelector("svg")}const n={context:e,defs:{},path:new ic};R6(t,n);const i=t.children,{fillStyle:r,strokeStyle:s}=$A(t,n);for(let l=0;l<i.length;l++){const c=i[l];c.nodeName.toLowerCase()!=="defs"&&ZA(c,n,r,s)}return e}function ZA(t,e,n,i){const r=t.children,{fillStyle:s,strokeStyle:l}=$A(t,e);s&&n?n={...n,...s}:s&&(n=s),l&&i?i={...i,...l}:l&&(i=l);const c=!n&&!i;c&&(n={color:0});let d,p,m,g,b,v,_,C,T,w,k,R,O,j,D,F,$;switch(t.nodeName.toLowerCase()){case"path":{j=t.getAttribute("d");const P=t.getAttribute("fill-rule"),I=D6(j),K=P==="evenodd",G=I.length>1;if(K&&G){const H=I.map(B=>({path:B,area:z6(B)}));if(H.sort((B,X)=>X.area-B.area),I.length>3||!O6(H))for(let B=0;B<H.length;B++){const X=H[B],Z=B===0;e.context.beginPath();const Q=new ic(void 0,!0);hw(X.path,Q),e.context.path(Q),Z?(n&&e.context.fill(n),i&&e.context.stroke(i)):e.context.cut()}else for(let B=0;B<H.length;B++){const X=H[B],Z=B%2===1;e.context.beginPath();const Q=new ic(void 0,!0);hw(X.path,Q),e.context.path(Q),Z?e.context.cut():(n&&e.context.fill(n),i&&e.context.stroke(i))}}else{const H=P?P==="evenodd":!0;D=new ic(j,H),e.context.path(D),n&&e.context.fill(n),i&&e.context.stroke(i)}break}case"circle":_=pi(t,"cx",0),C=pi(t,"cy",0),T=pi(t,"r",0),e.context.ellipse(_,C,T,T),n&&e.context.fill(n),i&&e.context.stroke(i);break;case"rect":d=pi(t,"x",0),p=pi(t,"y",0),F=pi(t,"width",0),$=pi(t,"height",0),w=pi(t,"rx",0),k=pi(t,"ry",0),w||k?e.context.roundRect(d,p,F,$,w||k):e.context.rect(d,p,F,$),n&&e.context.fill(n),i&&e.context.stroke(i);break;case"ellipse":_=pi(t,"cx",0),C=pi(t,"cy",0),w=pi(t,"rx",0),k=pi(t,"ry",0),e.context.beginPath(),e.context.ellipse(_,C,w,k),n&&e.context.fill(n),i&&e.context.stroke(i);break;case"line":m=pi(t,"x1",0),g=pi(t,"y1",0),b=pi(t,"x2",0),v=pi(t,"y2",0),e.context.beginPath(),e.context.moveTo(m,g),e.context.lineTo(b,v),i&&e.context.stroke(i);break;case"polygon":O=t.getAttribute("points"),R=O.match(/-?\d+/g).map(P=>parseInt(P,10)),e.context.poly(R,!0),n&&e.context.fill(n),i&&e.context.stroke(i);break;case"polyline":O=t.getAttribute("points"),R=O.match(/-?\d+/g).map(P=>parseInt(P,10)),e.context.poly(R,!1),i&&e.context.stroke(i);break;case"g":case"svg":break;default:{ca(`[SVG parser] <${t.nodeName}> elements unsupported`);break}}c&&(n=null);for(let P=0;P<r.length;P++)ZA(r[P],e,n,i)}const pw={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 tb{constructor(e,n){this.uid=gi("fillPattern"),this._tick=0,this.transform=new Ht,this.texture=e,this.transform.scale(1/e.frame.width,1/e.frame.height),n&&(e.source.style.addressModeU=pw[n].addressModeU,e.source.style.addressModeV=pw[n].addressModeV)}setTransform(e){const n=this.texture;this.transform.copyFrom(e),this.transform.invert(),this.transform.scale(1/n.frame.width,1/n.frame.height),this._tick++}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture=e,this._tick++)}get styleKey(){return`fill-pattern-${this.uid}-${this._tick}`}destroy(){this.texture.destroy(!0),this.texture=null}}function L6(t){return Gi.isColorLike(t)}function mw(t){return t instanceof tb}function gw(t){return t instanceof ac}function U6(t){return t instanceof Tn}function I6(t,e,n){const i=Gi.shared.setValue(e??0);return t.color=i.toNumber(),t.alpha=i.alpha===1?n.alpha:i.alpha,t.texture=Tn.WHITE,{...n,...t}}function j6(t,e,n){return t.texture=e,{...n,...t}}function yw(t,e,n){return t.fill=e,t.color=16777215,t.texture=e.texture,t.matrix=e.transform,{...n,...t}}function bw(t,e,n){return e.buildGradient(),t.fill=e,t.color=16777215,t.texture=e.texture,t.matrix=e.transform,t.textureSpace=e.textureSpace,{...n,...t}}function H6(t,e){const n={...e,...t},i=Gi.shared.setValue(n.color);return n.alpha*=i.alpha,n.color=i.toNumber(),n}function pf(t,e){if(t==null)return null;const n={},i=t;return L6(t)?I6(n,t,e):U6(t)?j6(n,t,e):mw(t)?yw(n,t,e):gw(t)?bw(n,t,e):i.fill&&mw(i.fill)?yw(i,i.fill,e):i.fill&&gw(i.fill)?bw(i,i.fill,e):H6(i,e)}function C0(t,e){const{width:n,alignment:i,miterLimit:r,cap:s,join:l,pixelLine:c,...d}=e,p=pf(t,d);return p?{width:n,alignment:i,miterLimit:r,cap:s,join:l,pixelLine:c,...p}:null}function P6(t,e){let n=1;const i=t.shapePath.shapePrimitives;for(let r=0;r<i.length;r++){const s=i[r].shape;if(s.type!=="polygon")continue;const l=s.points,c=l.length;if(c<6)continue;const d=s.closePath;for(let p=0;p<c;p+=2){if(!d&&(p===0||p===c-2))continue;const m=(p-2+c)%c,g=(p+2)%c,b=l[m],v=l[m+1],_=l[p],C=l[p+1],T=l[g],w=l[g+1],k=b-_,R=v-C,O=T-_,j=w-C,D=k*k+R*R,F=O*O+j*j;if(D<1e-12||F<1e-12)continue;let I=(k*O+R*j)/Math.sqrt(D*F);I<-1?I=-1:I>1&&(I=1);const K=Math.sqrt((1-I)*.5);if(K<1e-6)continue;const G=Math.min(1/K,e);G>n&&(n=G)}}return n}const G6=new Dr,xw=new Ht,i1=class lo extends mo{constructor(){super(...arguments),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=gi("graphicsContext"),this.dirty=!0,this.batchMode="auto",this.instructions=[],this.destroyed=!1,this._activePath=new ic,this._transform=new Ht,this._fillStyle={...lo.defaultFillStyle},this._strokeStyle={...lo.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new Bs,this._boundsDirty=!0}clone(){const e=new lo;return e.batchMode=this.batchMode,e.instructions=this.instructions.slice(),e._activePath=this._activePath.clone(),e._transform=this._transform.clone(),e._fillStyle={...this._fillStyle},e._strokeStyle={...this._strokeStyle},e._stateStack=this._stateStack.slice(),e._bounds=this._bounds.clone(),e._boundsDirty=!0,e}get fillStyle(){return this._fillStyle}set fillStyle(e){this._fillStyle=pf(e,lo.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(e){this._strokeStyle=C0(e,lo.defaultStrokeStyle)}setFillStyle(e){return this._fillStyle=pf(e,lo.defaultFillStyle),this}setStrokeStyle(e){return this._strokeStyle=pf(e,lo.defaultStrokeStyle),this}texture(e,n,i,r,s,l){return this.instructions.push({action:"texture",data:{image:e,dx:i||0,dy:r||0,dw:s||e.frame.width,dh:l||e.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:n||n===0?Gi.shared.setValue(n).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new ic,this}fill(e,n){let i;const r=this.instructions[this.instructions.length-1];return this._tick===0&&(r==null?void 0:r.action)==="stroke"?i=r.data.path:i=this._activePath.clone(),i?(e!=null&&(n!==void 0&&typeof e=="number"&&(Qt(mi,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),e={color:e,alpha:n}),this._fillStyle=pf(e,lo.defaultFillStyle)),this.instructions.push({action:"fill",data:{style:this.fillStyle,path:i}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){const{x:e,y:n}=this._activePath.getLastPoint(Dr.shared);this._activePath.clear(),this._activePath.moveTo(e,n)}stroke(e){let n;const i=this.instructions[this.instructions.length-1];return this._tick===0&&(i==null?void 0:i.action)==="fill"?n=i.data.path:n=this._activePath.clone(),n?(e!=null&&(this._strokeStyle=C0(e,lo.defaultStrokeStyle)),this.instructions.push({action:"stroke",data:{style:this.strokeStyle,path:n}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let e=0;e<2;e++){const n=this.instructions[this.instructions.length-1-e],i=this._activePath.clone();if(n&&(n.action==="stroke"||n.action==="fill"))if(n.data.hole)n.data.hole.addPath(i);else{n.data.hole=i;break}}return this._initNextPathLocation(),this}arc(e,n,i,r,s,l){this._tick++;const c=this._transform;return this._activePath.arc(c.a*e+c.c*n+c.tx,c.b*e+c.d*n+c.ty,i,r,s,l),this}arcTo(e,n,i,r,s){this._tick++;const l=this._transform;return this._activePath.arcTo(l.a*e+l.c*n+l.tx,l.b*e+l.d*n+l.ty,l.a*i+l.c*r+l.tx,l.b*i+l.d*r+l.ty,s),this}arcToSvg(e,n,i,r,s,l,c){this._tick++;const d=this._transform;return this._activePath.arcToSvg(e,n,i,r,s,d.a*l+d.c*c+d.tx,d.b*l+d.d*c+d.ty),this}bezierCurveTo(e,n,i,r,s,l,c){this._tick++;const d=this._transform;return this._activePath.bezierCurveTo(d.a*e+d.c*n+d.tx,d.b*e+d.d*n+d.ty,d.a*i+d.c*r+d.tx,d.b*i+d.d*r+d.ty,d.a*s+d.c*l+d.tx,d.b*s+d.d*l+d.ty,c),this}closePath(){var e;return this._tick++,(e=this._activePath)==null||e.closePath(),this}ellipse(e,n,i,r){return this._tick++,this._activePath.ellipse(e,n,i,r,this._transform.clone()),this}circle(e,n,i){return this._tick++,this._activePath.circle(e,n,i,this._transform.clone()),this}path(e){return this._tick++,this._activePath.addPath(e,this._transform.clone()),this}lineTo(e,n){this._tick++;const i=this._transform;return this._activePath.lineTo(i.a*e+i.c*n+i.tx,i.b*e+i.d*n+i.ty),this}moveTo(e,n){this._tick++;const i=this._transform,r=this._activePath.instructions,s=i.a*e+i.c*n+i.tx,l=i.b*e+i.d*n+i.ty;return r.length===1&&r[0].action==="moveTo"?(r[0].data[0]=s,r[0].data[1]=l,this):(this._activePath.moveTo(s,l),this)}quadraticCurveTo(e,n,i,r,s){this._tick++;const l=this._transform;return this._activePath.quadraticCurveTo(l.a*e+l.c*n+l.tx,l.b*e+l.d*n+l.ty,l.a*i+l.c*r+l.tx,l.b*i+l.d*r+l.ty,s),this}rect(e,n,i,r){return this._tick++,this._activePath.rect(e,n,i,r,this._transform.clone()),this}roundRect(e,n,i,r,s){return this._tick++,this._activePath.roundRect(e,n,i,r,s,this._transform.clone()),this}poly(e,n){return this._tick++,this._activePath.poly(e,n,this._transform.clone()),this}regularPoly(e,n,i,r,s=0,l){return this._tick++,this._activePath.regularPoly(e,n,i,r,s,l),this}roundPoly(e,n,i,r,s,l){return this._tick++,this._activePath.roundPoly(e,n,i,r,s,l),this}roundShape(e,n,i,r){return this._tick++,this._activePath.roundShape(e,n,i,r),this}filletRect(e,n,i,r,s){return this._tick++,this._activePath.filletRect(e,n,i,r,s),this}chamferRect(e,n,i,r,s,l){return this._tick++,this._activePath.chamferRect(e,n,i,r,s,l),this}star(e,n,i,r,s=0,l=0){return this._tick++,this._activePath.star(e,n,i,r,s,l,this._transform.clone()),this}svg(e){return this._tick++,B6(e,this),this}restore(){const e=this._stateStack.pop();return e&&(this._transform=e.transform,this._fillStyle=e.fillStyle,this._strokeStyle=e.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(e){return this._transform.rotate(e),this}scale(e,n=e){return this._transform.scale(e,n),this}setTransform(e,n,i,r,s,l){return e instanceof Ht?(this._transform.set(e.a,e.b,e.c,e.d,e.tx,e.ty),this):(this._transform.set(e,n,i,r,s,l),this)}transform(e,n,i,r,s,l){return e instanceof Ht?(this._transform.append(e),this):(xw.set(e,n,i,r,s,l),this._transform.append(xw),this)}translate(e,n=e){return this._transform.translate(e,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 e=this._bounds;e.clear();for(let n=0;n<this.instructions.length;n++){const i=this.instructions[n],r=i.action;if(r==="fill"){const s=i.data;e.addBounds(s.path.bounds)}else if(r==="texture"){const s=i.data;e.addFrame(s.dx,s.dy,s.dx+s.dw,s.dy+s.dh,s.transform)}if(r==="stroke"){const s=i.data,l=s.style.alignment;let c=s.style.width*(1-l);s.style.join==="miter"&&(c*=P6(s.path,s.style.miterLimit));const d=s.path.bounds;e.addFrame(d.minX-c,d.minY-c,d.maxX+c,d.maxY+c)}}return e.isValid||e.set(0,0,0,0),e}containsPoint(e){var r;if(!this.bounds.containsPoint(e.x,e.y))return!1;const n=this.instructions;let i=!1;for(let s=0;s<n.length;s++){const l=n[s],c=l.data,d=c.path;if(!l.action||!d)continue;const p=c.style,m=d.shapePath.shapePrimitives;for(let g=0;g<m.length;g++){const b=m[g].shape;if(!p||!b)continue;const v=m[g].transform,_=v?v.applyInverse(e,G6):e;if(l.action==="fill")i=b.contains(_.x,_.y);else{const T=p;i=b.strokeContains(_.x,_.y,T.width,T.alignment)}const C=c.hole;if(C){const T=(r=C.shapePath)==null?void 0:r.shapePrimitives;if(T)for(let w=0;w<T.length;w++)T[w].shape.contains(_.x,_.y)&&(i=!1)}if(i)return!0}}return i}unload(){var e;this.emit("unload",this);for(const n in this._gpuData)(e=this._gpuData[n])==null||e.destroy();this._gpuData=Object.create(null)}destroy(e=!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 e=="boolean"?e:e==null?void 0:e.texture){const i=typeof e=="boolean"?e:e==null?void 0:e.textureSource;this._fillStyle.texture&&(this._fillStyle.fill&&"uid"in this._fillStyle.fill?this._fillStyle.fill.destroy():this._fillStyle.texture.destroy(i)),this._strokeStyle.texture&&(this._strokeStyle.fill&&"uid"in this._strokeStyle.fill?this._strokeStyle.fill.destroy():this._strokeStyle.texture.destroy(i))}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null}};i1.defaultFillStyle={color:16777215,alpha:1,texture:Tn.WHITE,matrix:null,fill:null,textureSpace:"local"};i1.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:Tn.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:!1};let hl=i1;class F6{constructor(){this.isBatchable=!1}reset(){this.isBatchable=!1,this.context=null,this.graphicsData&&(this.graphicsData.destroy(),this.graphicsData=null)}destroy(){this.reset()}}class q6{constructor(){this.instructions=new q_}init(){this.instructions.reset()}destroy(){this.instructions.destroy(),this.instructions=null}}const r1=class e_{constructor(e){this._renderer=e,this._managedContexts=new Wm({renderer:e,type:"resource",name:"graphicsContext"})}init(e){e_.defaultOptions.bezierSmoothness=(e==null?void 0:e.bezierSmoothness)??e_.defaultOptions.bezierSmoothness}getContextRenderData(e){return this.getGpuContext(e).graphicsData||this._initContextRenderData(e)}updateGpuContext(e){const n=e._gpuData,i=!!n[this._renderer.uid],r=n[this._renderer.uid]||this._initContext(e);return(e.dirty||!i)&&(i&&r.reset(),r.isBatchable=!1,e.dirty=!1),r}getGpuContext(e){return e._gpuData[this._renderer.uid]||this._initContext(e)}_initContextRenderData(e){const n=new q6,i=this.getGpuContext(e);return i.graphicsData=n,n.init(),n}_initContext(e){const n=new F6;return n.context=e,e._gpuData[this._renderer.uid]=n,this._managedContexts.add(e),n}destroy(){this._managedContexts.destroy(),this._renderer=null}};r1.extension={type:[Rt.CanvasSystem],name:"graphicsContext"};r1.defaultOptions={bezierSmoothness:.5};let Y6=r1;class QA{constructor(e,n){this.state=K_.for2d(),this.renderer=e,this._adaptor=n,this.renderer.runners.contextChange.add(this),this._managedGraphics=new Wm({renderer:e,type:"renderable",priority:-1,name:"graphics"})}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(e){return!1}addRenderable(e,n){this._managedGraphics.add(e),this.renderer.renderPipes.batch.break(n),n.add(e)}updateRenderable(e){}execute(e){e.isRenderable&&this._adaptor.execute(this,e)}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null}}QA.extension={type:[Rt.CanvasPipes],name:"graphics"};function V6(t,e,n){const i=(t>>24&255)/255;e[n++]=(t&255)/255*i,e[n++]=(t>>8&255)/255*i,e[n++]=(t>>16&255)/255*i,e[n++]=i}class X6{constructor(){this.batches=[],this.batched=!1}destroy(){this.batches.forEach(e=>{Ra.return(e)}),this.batches.length=0}}class JA{constructor(e,n){this.state=K_.for2d(),this.renderer=e,this._adaptor=n,this.renderer.runners.contextChange.add(this),this._managedGraphics=new Wm({renderer:e,type:"renderable",priority:-1,name:"graphics"})}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(e){const n=e.context,i=!!e._gpuData,s=this.renderer.graphicsContext.updateGpuContext(n);return!!(s.isBatchable||i!==s.isBatchable)}addRenderable(e,n){const r=this.renderer.graphicsContext.updateGpuContext(e.context);e.didViewUpdate&&this._rebuild(e),r.isBatchable?this._addToBatcher(e,n):(this.renderer.renderPipes.batch.break(n),n.add(e))}updateRenderable(e){const i=this._getGpuDataForRenderable(e).batches;for(let r=0;r<i.length;r++){const s=i[r];s._batcher.updateElement(s)}}execute(e){if(!e.isRenderable)return;const n=this.renderer,i=e.context;if(!n.graphicsContext.getGpuContext(i).batches.length)return;const s=i.customShader||this._adaptor.shader;this.state.blendMode=e.groupBlendMode;const l=s.resources.localUniforms.uniforms;l.uTransformMatrix=e.groupTransform,l.uRound=n._roundPixels|e._roundPixels,V6(e.groupColorAlpha,l.uColor,0),this._adaptor.execute(this,e)}_rebuild(e){const n=this._getGpuDataForRenderable(e),r=this.renderer.graphicsContext.updateGpuContext(e.context);n.destroy(),r.isBatchable&&this._updateBatchesForRenderable(e,n)}_addToBatcher(e,n){const i=this.renderer.renderPipes.batch,r=this._getGpuDataForRenderable(e).batches;for(let s=0;s<r.length;s++){const l=r[s];i.addToBatch(l,n)}}_getGpuDataForRenderable(e){return e._gpuData[this.renderer.uid]||this._initGpuDataForRenderable(e)}_initGpuDataForRenderable(e){const n=new X6;return e._gpuData[this.renderer.uid]=n,this._managedGraphics.add(e),n}_updateBatchesForRenderable(e,n){const i=e.context,s=this.renderer.graphicsContext.getGpuContext(i),l=this.renderer._roundPixels|e._roundPixels;n.batches=s.batches.map(c=>{const d=Ra.get(J_);return c.copyTo(d),d.renderable=e,d.roundPixels=l,d})}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null}}JA.extension={type:[Rt.WebGLPipes,Rt.WebGPUPipes],name:"graphics"};si.add(QA);si.add(JA);si.add(Y6);si.add(n1);class Aa extends Y_{constructor(e){e instanceof hl&&(e={context:e});const{context:n,roundPixels:i,...r}=e||{};super({label:"Graphics",...r}),this.renderPipeId="graphics",n?this.context=n:(this.context=this._ownedContext=new hl,this.context.autoGarbageCollect=this.autoGarbageCollect),this.didViewUpdate=!0,this.allowChildren=!1,this.roundPixels=i??!1}set context(e){e!==this._context&&(this._context&&(this._context.off("update",this.onViewUpdate,this),this._context.off("unload",this.unload,this)),this._context=e,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(e){return this._context.containsPoint(e)}destroy(e){this._ownedContext&&!e?this._ownedContext.destroy(e):(e===!0||(e==null?void 0:e.context)===!0)&&this._context.destroy(e),this._ownedContext=null,this._context=null,super.destroy(e)}_onTouch(e){this._gcLastUsed=e,this._context._gcLastUsed=e}_callContextMethod(e,n){return this.context[e](...n),this}setFillStyle(...e){return this._callContextMethod("setFillStyle",e)}setStrokeStyle(...e){return this._callContextMethod("setStrokeStyle",e)}fill(...e){return this._callContextMethod("fill",e)}stroke(...e){return this._callContextMethod("stroke",e)}texture(...e){return this._callContextMethod("texture",e)}beginPath(){return this._callContextMethod("beginPath",[])}cut(){return this._callContextMethod("cut",[])}arc(...e){return this._callContextMethod("arc",e)}arcTo(...e){return this._callContextMethod("arcTo",e)}arcToSvg(...e){return this._callContextMethod("arcToSvg",e)}bezierCurveTo(...e){return this._callContextMethod("bezierCurveTo",e)}closePath(){return this._callContextMethod("closePath",[])}ellipse(...e){return this._callContextMethod("ellipse",e)}circle(...e){return this._callContextMethod("circle",e)}path(...e){return this._callContextMethod("path",e)}lineTo(...e){return this._callContextMethod("lineTo",e)}moveTo(...e){return this._callContextMethod("moveTo",e)}quadraticCurveTo(...e){return this._callContextMethod("quadraticCurveTo",e)}rect(...e){return this._callContextMethod("rect",e)}roundRect(...e){return this._callContextMethod("roundRect",e)}poly(...e){return this._callContextMethod("poly",e)}regularPoly(...e){return this._callContextMethod("regularPoly",e)}roundPoly(...e){return this._callContextMethod("roundPoly",e)}roundShape(...e){return this._callContextMethod("roundShape",e)}filletRect(...e){return this._callContextMethod("filletRect",e)}chamferRect(...e){return this._callContextMethod("chamferRect",e)}star(...e){return this._callContextMethod("star",e)}svg(...e){return this._callContextMethod("svg",e)}restore(...e){return this._callContextMethod("restore",e)}save(){return this._callContextMethod("save",[])}getTransform(){return this.context.getTransform()}resetTransform(){return this._callContextMethod("resetTransform",[])}rotateTransform(...e){return this._callContextMethod("rotate",e)}scaleTransform(...e){return this._callContextMethod("scale",e)}setTransform(...e){return this._callContextMethod("setTransform",e)}transform(...e){return this._callContextMethod("transform",e)}translateTransform(...e){return this._callContextMethod("translate",e)}clear(){return this._callContextMethod("clear",[])}get fillStyle(){return this._context.fillStyle}set fillStyle(e){this._context.fillStyle=e}get strokeStyle(){return this._context.strokeStyle}set strokeStyle(e){this._context.strokeStyle=e}clone(e=!1){return e?new Aa(this._context.clone()):(this._ownedContext=null,new Aa(this._context))}lineStyle(e,n,i){Qt(mi,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");const r={};return e&&(r.width=e),n&&(r.color=n),i&&(r.alpha=i),this.context.strokeStyle=r,this}beginFill(e,n){Qt(mi,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");const i={};return e!==void 0&&(i.color=e),n!==void 0&&(i.alpha=n),this.context.fillStyle=i,this}endFill(){Qt(mi,"Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."),this.context.fill();const e=this.context.strokeStyle;return(e.width!==hl.defaultStrokeStyle.width||e.color!==hl.defaultStrokeStyle.color||e.alpha!==hl.defaultStrokeStyle.alpha)&&this.context.stroke(),this}drawCircle(...e){return Qt(mi,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",e)}drawEllipse(...e){return Qt(mi,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",e)}drawPolygon(...e){return Qt(mi,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",e)}drawRect(...e){return Qt(mi,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",e)}drawRoundedRect(...e){return Qt(mi,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",e)}drawStar(...e){return Qt(mi,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",e)}}class K6 extends Y_{constructor(e,n){const{text:i,resolution:r,style:s,anchor:l,width:c,height:d,roundPixels:p,...m}=e;super({...m}),this.batched=!0,this._resolution=null,this._autoResolution=!0,this._didTextUpdate=!0,this._styleClass=n,this.text=i??"",this.style=s,this.resolution=r??null,this.allowChildren=!1,this._anchor=new yr({_onUpdate:()=>{this.onViewUpdate()}}),l&&(this.anchor=l),this.roundPixels=p??!1,c!==void 0&&(this.width=c),d!==void 0&&(this.height=d)}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e)}set text(e){e=e.toString(),this._text!==e&&(this._text=e,this.onViewUpdate())}get text(){return this._text}set resolution(e){this._autoResolution=e===null,this._resolution=e,this.onViewUpdate()}get resolution(){return this._resolution}get style(){return this._style}set style(e){var n;e||(e={}),(n=this._style)==null||n.off("update",this.onViewUpdate,this),e instanceof this._styleClass?this._style=e:this._style=new this._styleClass(e),this._style.on("update",this.onViewUpdate,this),this.onViewUpdate()}get width(){return Math.abs(this.scale.x)*this.bounds.width}set width(e){this._setWidth(e,this.bounds.width)}get height(){return Math.abs(this.scale.y)*this.bounds.height}set height(e){this._setHeight(e,this.bounds.height)}getSize(e){return e||(e={}),e.width=Math.abs(this.scale.x)*this.bounds.width,e.height=Math.abs(this.scale.y)*this.bounds.height,e}setSize(e,n){typeof e=="object"?(n=e.height??e.width,e=e.width):n??(n=e),e!==void 0&&this._setWidth(e,this.bounds.width),n!==void 0&&this._setHeight(n,this.bounds.height)}containsPoint(e){const n=this.bounds.width,i=this.bounds.height,r=-n*this.anchor.x;let s=0;return e.x>=r&&e.x<=r+n&&(s=-i*this.anchor.y,e.y>=s&&e.y<=s+i)}onViewUpdate(){this.didViewUpdate||(this._didTextUpdate=!0),super.onViewUpdate()}destroy(e=!1){super.destroy(e),this.owner=null,this._bounds=null,this._anchor=null,(typeof e=="boolean"?e:e!=null&&e.style)&&this._style.destroy(e),this._style=null,this._text=null}get styleKey(){return`${this._text}:${this._style.styleKey}:${this._resolution}`}}function W6(t,e){let n=t[0]??{};return(typeof n=="string"||t[1])&&(Qt(mi,`use new ${e}({ text: "hi!", style }) instead`),n={text:n,style:t[1]}),n}class $6{constructor(e){this._canvasPool=Object.create(null),this.canvasOptions=e||{},this.enableFullScreen=!1}_createCanvasAndContext(e,n){const i=ts.get().createCanvas();i.width=e,i.height=n;const r=i.getContext("2d");return{canvas:i,context:r}}getOptimalCanvasAndContext(e,n,i=1){e=Math.ceil(e*i-1e-6),n=Math.ceil(n*i-1e-6),e=ih(e),n=ih(n);const r=(e<<17)+(n<<1);this._canvasPool[r]||(this._canvasPool[r]=[]);let s=this._canvasPool[r].pop();return s||(s=this._createCanvasAndContext(e,n)),s}returnCanvasAndContext(e){const n=e.canvas,{width:i,height:r}=n,s=(i<<17)+(r<<1);e.context.resetTransform(),e.context.clearRect(0,0,i,r),this._canvasPool[s].push(e)}clear(){this._canvasPool={}}}const t_=new $6;Xm.register(t_);let rf=null,ec=null;function Z6(t,e){rf||(rf=ts.get().createCanvas(256,128),ec=rf.getContext("2d",{willReadFrequently:!0}),ec.globalCompositeOperation="copy",ec.globalAlpha=1),(rf.width<t||rf.height<e)&&(rf.width=ih(t),rf.height=ih(e))}function vw(t,e,n){for(let i=0,r=4*n*e;i<e;++i,r+=4)if(t[r+3]!==0)return!1;return!0}function _w(t,e,n,i,r){const s=4*e;for(let l=i,c=i*s+4*n;l<=r;++l,c+=s)if(t[c+3]!==0)return!1;return!0}function Q6(...t){let e=t[0];e.canvas||(e={canvas:t[0],resolution:t[1]});const{canvas:n}=e,i=Math.min(e.resolution??1,1),r=e.width??n.width,s=e.height??n.height;let l=e.output;if(Z6(r,s),!ec)throw new TypeError("Failed to get canvas 2D context");ec.drawImage(n,0,0,r,s,0,0,r*i,s*i);const d=ec.getImageData(0,0,r,s).data;let p=0,m=0,g=r-1,b=s-1;for(;m<s&&vw(d,r,m);)++m;if(m===s)return Ei.EMPTY;for(;vw(d,r,b);)--b;for(;_w(d,r,p,m,b);)++p;for(;_w(d,r,g,m,b);)--g;return++g,++b,ec.globalCompositeOperation="source-over",ec.strokeRect(p,m,g-p,b-m),ec.globalCompositeOperation="copy",l??(l=new Ei),l.set(p/i,m/i,(g-p)/i,(b-m)/i),l}/**
|
|
299
|
+
* tiny-lru
|
|
300
|
+
*
|
|
301
|
+
* @copyright 2026 Jason Mulligan <jason.mulligan@avoidwork.com>
|
|
302
|
+
* @license BSD-3-Clause
|
|
303
|
+
* @version 11.4.7
|
|
304
|
+
*/class J6{constructor(e=0,n=0,i=!1){this.first=null,this.items=Object.create(null),this.last=null,this.max=e,this.resetTtl=i,this.size=0,this.ttl=n}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(e){if(this.has(e)){const n=this.items[e];delete this.items[e],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(e=this.keys()){const n=new Array(e.length);for(let i=0;i<e.length;i++){const r=e[i];n[i]=[r,this.get(r)]}return n}evict(e=!1){if(e||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(e){let n;return this.has(e)&&(n=this.items[e].expiry),n}get(e){const n=this.items[e];if(n!==void 0){if(this.ttl>0&&n.expiry<=Date.now()){this.delete(e);return}return this.moveToEnd(n),n.value}}has(e){return e in this.items}moveToEnd(e){this.last!==e&&(e.prev!==null&&(e.prev.next=e.next),e.next!==null&&(e.next.prev=e.prev),this.first===e&&(this.first=e.next),e.prev=this.last,e.next=null,this.last!==null&&(this.last.next=e),this.last=e,this.first===null&&(this.first=e))}keys(){const e=new Array(this.size);let n=this.first,i=0;for(;n!==null;)e[i++]=n.key,n=n.next;return e}setWithEvicted(e,n,i=this.resetTtl){let r=null;if(this.has(e))this.set(e,n,!0,i);else{this.max>0&&this.size===this.max&&(r={...this.first},this.evict(!0));let s=this.items[e]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:n};++this.size===1?this.first=s:this.last.next=s,this.last=s}return r}set(e,n,i=!1,r=this.resetTtl){let s=this.items[e];return i||s!==void 0?(s.value=n,i===!1&&r&&(s.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl),this.moveToEnd(s)):(this.max>0&&this.size===this.max&&this.evict(!0),s=this.items[e]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:n},++this.size===1?this.first=s:this.last.next=s,this.last=s),this}values(e=this.keys()){const n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=this.get(e[i]);return n}}function eB(t=1e3,e=0,n=!1){if(isNaN(t)||t<0)throw new TypeError("Invalid max value");if(isNaN(e)||e<0)throw new TypeError("Invalid ttl value");if(typeof n!="boolean")throw new TypeError("Invalid resetTtl value");return new J6(t,e,n)}function eM(t){return!!t.tagStyles&&Object.keys(t.tagStyles).length>0}function tM(t){return t.includes("<")}function tB(t,e){return t.clone().assign(e)}function nB(t,e){const n=[],i=e.tagStyles;if(!eM(e)||!tM(t))return n.push({text:t,style:e}),n;const r=[e],s=[];let l="",c=0;for(;c<t.length;){const d=t[c];if(d==="<"){const p=t.indexOf(">",c);if(p===-1){l+=d,c++;continue}const m=t.slice(c+1,p);if(m.startsWith("/")){const g=m.slice(1).trim();if(s.length>0&&s[s.length-1]===g){l.length>0&&(n.push({text:l,style:r[r.length-1]}),l=""),r.pop(),s.pop(),c=p+1;continue}else{l+=t.slice(c,p+1),c=p+1;continue}}else{const g=m.trim();if(i[g]){l.length>0&&(n.push({text:l,style:r[r.length-1]}),l="");const b=r[r.length-1],v=tB(b,i[g]);r.push(v),s.push(g),c=p+1;continue}else{l+=t.slice(c,p+1),c=p+1;continue}}}else l+=d,c++}return l.length>0&&n.push({text:l,style:r[r.length-1]}),n}const iB=[10,13],rB=new Set(iB),aB=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288],sB=new Set(aB),lB=[9,32];new Set(lB);const oB=[45,8208,8211,8212,173],cB=new Set(oB),uB=/(\r\n|\r|\n)/,fB=/(?:\r\n|\r|\n)/;function A0(t){return typeof t!="string"?!1:rB.has(t.charCodeAt(0))}function zs(t,e){return typeof t!="string"?!1:sB.has(t.charCodeAt(0))}function dB(t){return typeof t!="string"?!1:cB.has(t.charCodeAt(0))}function nM(t){return t==="normal"||t==="pre-line"}function iM(t){return t==="normal"}function Jo(t){if(typeof t!="string")return"";let e=t.length-1;for(;e>=0&&zs(t[e]);)e--;return e<t.length-1?t.slice(0,e+1):t}function rM(t){const e=[],n=[];if(typeof t!="string")return e;for(let i=0;i<t.length;i++){const r=t[i],s=t[i+1];if(zs(r)||A0(r)){n.length>0&&(e.push(n.join("")),n.length=0),r==="\r"&&s===`
|
|
305
|
+
`?(e.push(`\r
|
|
306
|
+
`),i++):e.push(r);continue}n.push(r),dB(r)&&s&&!zs(s)&&!A0(s)&&(e.push(n.join("")),n.length=0)}return n.length>0&&e.push(n.join("")),e}function aM(t,e,n,i){const r=n(t),s=[];for(let l=0;l<r.length;l++){let c=r[l],d=c,p=1;for(;r[l+p];){const m=r[l+p];if(!i(d,m,t,l,e))c+=m,d=m,p++;else break}l+=p-1,s.push(c)}return s}const hB=/\r\n|\r|\n/g;function pB(t,e,n,i,r,s,l,c){var W,B;const d=nB(t,e);if(iM(e.whiteSpace))for(let X=0;X<d.length;X++){const Z=d[X];d[X]={text:Z.text.replace(hB," "),style:Z.style}}const m=[];let g=[];for(const X of d){const Z=X.text.split(uB);for(let Q=0;Q<Z.length;Q++){const q=Z[Q];q===`\r
|
|
307
|
+
`||q==="\r"||q===`
|
|
308
|
+
`?(m.push(g),g=[]):q.length>0&&g.push({text:q,style:X.style})}}(g.length>0||m.length===0)&&m.push(g);const b=n?mB(m,e,i,r,l,c):m,v=[],_=[],C=[],T=[],w=[];let k=0;const R=e._fontString,O=s(R);O.fontSize===0&&(O.fontSize=e.fontSize,O.ascent=e.fontSize);let j="",D=!!e.dropShadow,F=((W=e._stroke)==null?void 0:W.width)||0;for(const X of b){let Z=0,Q=O.ascent,q=O.descent,Y="";for(const V of X){const oe=V.style._fontString,be=s(oe);oe!==j&&(i.font=oe,j=oe);const ve=r(V.text,V.style.letterSpacing,i);Z+=ve,Q=Math.max(Q,be.ascent),q=Math.max(q,be.descent),Y+=V.text;const se=((B=V.style._stroke)==null?void 0:B.width)||0;se>F&&(F=se),!D&&V.style.dropShadow&&(D=!0)}X.length===0&&(Q=O.ascent,q=O.descent),v.push(Z),_.push(Q),C.push(q),w.push(Y);const ee=e.lineHeight||Q+q;T.push(ee+e.leading),k=Math.max(k,Z)}const $=F,K=(n&&e.align!=="left"?Math.max(k,e.wordWrapWidth):k)+$+(e.dropShadow?e.dropShadow.distance:0);let G=0;for(let X=0;X<T.length;X++)G+=T[X];G=Math.max(G,T[0]+$);const te=G+(e.dropShadow?e.dropShadow.distance:0),H=e.lineHeight||O.fontSize;return{width:K,height:te,lines:w,lineWidths:v,lineHeight:H+e.leading,maxLineWidth:k,fontProperties:O,runsByLine:b,lineAscents:_,lineDescents:C,lineHeights:T,hasDropShadow:D}}function mB(t,e,n,i,r,s){var T;const{letterSpacing:l,whiteSpace:c,wordWrapWidth:d,breakWords:p}=e,m=nM(c),g=d+l,b={};let v="";const _=(w,k)=>{const R=`${w}|${k.styleKey}`;let O=b[R];if(O===void 0){const j=k._fontString;j!==v&&(n.font=j,v=j),O=i(w,k.letterSpacing,n)+k.letterSpacing,b[R]=O}return O},C=[];for(const w of t){const k=gB(w),R=C.length,O=G=>{let te=0,H=G;do{const{token:W,style:B}=k[H];te+=_(W,B),H++}while(H<k.length&&k[H].continuesFromPrevious);return te},j=G=>{const te=[];let H=G;do te.push({token:k[H].token,style:k[H].style}),H++;while(H<k.length&&k[H].continuesFromPrevious);return te};let D=[],F=0,$=!m,P=null;const I=()=>{P&&P.text.length>0&&D.push(P),P=null},K=()=>{if(I(),D.length>0){const G=D[D.length-1];G.text=Jo(G.text),G.text.length===0&&D.pop()}C.push(D),D=[],F=0,$=!1};for(let G=0;G<k.length;G++){const{token:te,style:H,continuesFromPrevious:W}=k[G],B=_(te,H);if(m){const Q=zs(te),q=(P==null?void 0:P.text[P.text.length-1])??((T=D[D.length-1])==null?void 0:T.text.slice(-1))??"",Y=q?zs(q):!1;if(Q&&Y)continue}const X=!W,Z=X?O(G):B;if(Z>g&&X)if(F>0&&K(),p){const Q=j(G);for(let q=0;q<Q.length;q++){const Y=Q[q].token,ee=Q[q].style,V=aM(Y,p,s,r);for(const oe of V){const be=_(oe,ee);be+F>g&&K(),!P||P.style!==ee?(I(),P={text:oe,style:ee}):P.text+=oe,F+=be}}G+=Q.length-1}else{const Q=j(G);I(),C.push(Q.map(q=>({text:q.token,style:q.style}))),$=!1,G+=Q.length-1}else if(Z+F>g&&X){if(zs(te)){$=!1;continue}K(),P={text:te,style:H},F=B}else if(W&&!p)!P||P.style!==H?(I(),P={text:te,style:H}):P.text+=te,F+=B;else{const Q=zs(te);if(F===0&&Q&&!$)continue;!P||P.style!==H?(I(),P={text:te,style:H}):P.text+=te,F+=B}}if(I(),D.length>0){const G=D[D.length-1];G.text=Jo(G.text),G.text.length===0&&D.pop()}(D.length>0||C.length===R)&&C.push(D)}return C}function gB(t){const e=[];let n=!1;for(const i of t){const r=rM(i.text);let s=!0;for(const l of r){const c=zs(l)||A0(l),d=s&&n&&!c;e.push({token:l,style:i.style,continuesFromPrevious:d}),n=!c,s=!1}}return e}const yB={willReadFrequently:!0};function Sw(t,e,n,i,r){let s=n[t];return typeof s!="number"&&(s=r(t,e,i)+e,n[t]=s),s}function bB(t,e,n,i,r,s,l){const c=n.getContext("2d",yB);c.font=e._fontString;let d=0,p="";const m=[],g=Object.create(null),{letterSpacing:b,whiteSpace:v}=e,_=nM(v),C=iM(v);let T=!_;const w=e.wordWrapWidth+b,k=rM(t);for(let O=0;O<k.length;O++){let j=k[O];if(A0(j)){if(!C){m.push(Jo(p)),T=!_,p="",d=0;continue}j=" "}if(_){const F=zs(j),$=zs(p[p.length-1]);if(F&&$)continue}const D=Sw(j,b,g,c,i);if(D>w)if(p!==""&&(m.push(Jo(p)),p="",d=0),r(j,e.breakWords)){const F=aM(j,e.breakWords,l,s);for(const $ of F){const P=Sw($,b,g,c,i);P+d>w&&(m.push(Jo(p)),T=!1,p="",d=0),p+=$,d+=P}}else p.length>0&&(m.push(Jo(p)),p="",d=0),m.push(Jo(j)),T=!1,p="",d=0;else D+d>w&&(T=!1,m.push(Jo(p)),p="",d=0),(p.length>0||!zs(j)||T)&&(p+=j,d+=D)}const R=Jo(p);return R.length>0&&m.push(R),m.join(`
|
|
309
|
+
`)}const Ew={willReadFrequently:!0},lc=class pt{static get experimentalLetterSpacingSupported(){let e=pt._experimentalLetterSpacingSupported;if(e===void 0){const n=ts.get().getCanvasRenderingContext2D().prototype;e=pt._experimentalLetterSpacingSupported="letterSpacing"in n||"textLetterSpacing"in n}return e}constructor(e,n,i,r,s,l,c,d,p,m){this.text=e,this.style=n,this.width=i,this.height=r,this.lines=s,this.lineWidths=l,this.lineHeight=c,this.maxLineWidth=d,this.fontProperties=p,m&&(this.runsByLine=m.runsByLine,this.lineAscents=m.lineAscents,this.lineDescents=m.lineDescents,this.lineHeights=m.lineHeights,this.hasDropShadow=m.hasDropShadow)}static measureText(e=" ",n,i=pt._canvas,r=n.wordWrap){var j;const s=`${e}-${n.styleKey}-wordWrap-${r}`;if(pt._measurementCache.has(s))return pt._measurementCache.get(s);if(eM(n)&&tM(e)){const D=pB(e,n,r,pt._context,pt._measureText,pt.measureFont,pt.canBreakChars,pt.wordWrapSplit),F=new pt(e,n,D.width,D.height,D.lines,D.lineWidths,D.lineHeight,D.maxLineWidth,D.fontProperties,{runsByLine:D.runsByLine,lineAscents:D.lineAscents,lineDescents:D.lineDescents,lineHeights:D.lineHeights,hasDropShadow:D.hasDropShadow});return pt._measurementCache.set(s,F),F}const c=n._fontString,d=pt.measureFont(c);d.fontSize===0&&(d.fontSize=n.fontSize,d.ascent=n.fontSize,d.descent=0);const p=pt._context;p.font=c;const g=(r?pt._wordWrap(e,n,i):e).split(fB),b=new Array(g.length);let v=0;for(let D=0;D<g.length;D++){const F=pt._measureText(g[D],n.letterSpacing,p);b[D]=F,v=Math.max(v,F)}const _=((j=n._stroke)==null?void 0:j.width)??0,C=n.lineHeight||d.fontSize,T=pt._getAlignWidth(v,n,r),w=pt._adjustWidthForStyle(T,n),k=Math.max(C,d.fontSize+_)+(g.length-1)*(C+n.leading),R=pt._adjustHeightForStyle(k,n),O=new pt(e,n,w,R,g,b,C+n.leading,v,d);return pt._measurementCache.set(s,O),O}static _adjustWidthForStyle(e,n){var s;const i=((s=n._stroke)==null?void 0:s.width)||0;let r=e+i;return n.dropShadow&&(r+=n.dropShadow.distance),r}static _adjustHeightForStyle(e,n){let i=e;return n.dropShadow&&(i+=n.dropShadow.distance),i}static _getAlignWidth(e,n,i){return i&&n.align!=="left"?Math.max(e,n.wordWrapWidth):e}static _measureText(e,n,i){let r=!1;pt.experimentalLetterSpacingSupported&&(pt.experimentalLetterSpacing?(i.letterSpacing=`${n}px`,i.textLetterSpacing=`${n}px`,r=!0):(i.letterSpacing="0px",i.textLetterSpacing="0px"));const s=i.measureText(e);let l=s.width;const c=-(s.actualBoundingBoxLeft??0);let p=(s.actualBoundingBoxRight??0)-c;if(l>0)if(r)l-=n,p-=n;else{const m=(pt.graphemeSegmenter(e).length-1)*n;l+=m,p+=m}return Math.max(l,p)}static _wordWrap(e,n,i=pt._canvas){return bB(e,n,i,pt._measureText,pt.canBreakWords,pt.canBreakChars,pt.wordWrapSplit)}static isBreakingSpace(e,n){return zs(e)}static canBreakWords(e,n){return n}static canBreakChars(e,n,i,r,s){return!0}static wordWrapSplit(e){return pt.graphemeSegmenter(e)}static measureFont(e){if(pt._fonts[e])return pt._fonts[e];const n=pt._context;n.font=e;const i=n.measureText(pt.METRICS_STRING+pt.BASELINE_SYMBOL),r=i.actualBoundingBoxAscent??0,s=i.actualBoundingBoxDescent??0,l={ascent:r,descent:s,fontSize:r+s};return pt._fonts[e]=l,l}static clearMetrics(e=""){e?delete pt._fonts[e]:pt._fonts={}}static get _canvas(){if(!pt.__canvas){let e;try{const n=new OffscreenCanvas(0,0),i=n.getContext("2d",Ew);if(i!=null&&i.measureText)return pt.__canvas=n,n;e=ts.get().createCanvas()}catch{e=ts.get().createCanvas()}e.width=e.height=10,pt.__canvas=e}return pt.__canvas}static get _context(){return pt.__context||(pt.__context=pt._canvas.getContext("2d",Ew)),pt.__context}};lc.METRICS_STRING="|ÉqÅ";lc.BASELINE_SYMBOL="M";lc.BASELINE_MULTIPLIER=1.4;lc.HEIGHT_MULTIPLIER=2;lc.graphemeSegmenter=(()=>{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const t=new Intl.Segmenter;return e=>{const n=t.segment(e),i=[];let r=0;for(const s of n)i[r++]=s.segment;return i}}return t=>[...t]})();lc.experimentalLetterSpacing=!1;lc._fonts={};lc._measurementCache=eB(1e3);let iu=lc;const xB=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function n_(t){const e=typeof t.fontSize=="number"?`${t.fontSize}px`:t.fontSize;let n=t.fontFamily;Array.isArray(t.fontFamily)||(n=t.fontFamily.split(","));for(let i=n.length-1;i>=0;i--){let r=n[i].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&!xB.includes(r)&&(r=`"${r}"`),n[i]=r}return`${t.fontStyle} ${t.fontVariant} ${t.fontWeight} ${e} ${n.join(",")}`}const ww=1e5;function jy(t,e,n,i=0,r=0,s=0){if(t.texture===Tn.WHITE&&!t.fill)return Gi.shared.setValue(t.color).setAlpha(t.alpha??1).toHexa();if(t.fill){if(t.fill instanceof tb){const l=t.fill,c=e.createPattern(l.texture.source.resource,"repeat"),d=l.transform.copyTo(Ht.shared);return d.scale(l.texture.source.pixelWidth,l.texture.source.pixelHeight),c.setTransform(d),c}else if(t.fill instanceof ac){const l=t.fill,c=l.type==="linear",d=l.textureSpace==="local";let p=1,m=1;d&&n&&(p=n.width+i,m=n.height+i);let g,b=!1;if(c){const{start:v,end:_}=l;g=e.createLinearGradient(v.x*p+r,v.y*m+s,_.x*p+r,_.y*m+s),b=Math.abs(_.x-v.x)<Math.abs((_.y-v.y)*.1)}else{const{center:v,innerRadius:_,outerCenter:C,outerRadius:T}=l;g=e.createRadialGradient(v.x*p+r,v.y*m+s,_*p,C.x*p+r,C.y*m+s,T*p)}if(b&&d&&n){const v=n.lineHeight/m;for(let _=0;_<n.lines.length;_++){const C=(_*n.lineHeight+i/2)/m;l.colorStops.forEach(T=>{let w=C+T.offset*v;w=Math.max(0,Math.min(1,w)),g.addColorStop(Math.floor(w*ww)/ww,Gi.shared.setValue(T.color).toHex())})}}else l.colorStops.forEach(v=>{g.addColorStop(v.offset,Gi.shared.setValue(v.color).toHex())});return g}}else{const l=e.createPattern(t.texture.source.resource,"repeat"),c=t.matrix.copyTo(Ht.shared);return c.scale(t.texture.source.pixelWidth,t.texture.source.pixelHeight),l.setTransform(c),l}return ca("FillStyle not recognised",t),"red"}const Tw=new Ei;function zd(t){let e=0;for(let n=0;n<t.length;n++)t.charCodeAt(n)===32&&e++;return e}class vB{getCanvasAndContext(e){const{text:n,style:i,resolution:r=1}=e,s=i._getFinalPadding(),l=iu.measureText(n||" ",i),c=Math.ceil(Math.ceil(Math.max(1,l.width)+s*2)*r),d=Math.ceil(Math.ceil(Math.max(1,l.height)+s*2)*r),p=t_.getOptimalCanvasAndContext(c,d);this._renderTextToCanvas(i,s,r,p,l);const m=i.trim?Q6({canvas:p.canvas,width:c,height:d,resolution:1,output:Tw}):Tw.set(0,0,c,d);return{canvasAndContext:p,frame:m}}returnCanvasAndContext(e){t_.returnCanvasAndContext(e)}_renderTextToCanvas(e,n,i,r,s){var D,F,$;if(s.runsByLine&&s.runsByLine.length>0){this._renderTaggedTextToCanvas(s,e,n,i,r);return}const{canvas:l,context:c}=r,d=n_(e),p=s.lines,m=s.lineHeight,g=s.lineWidths,b=s.maxLineWidth,v=s.fontProperties,_=l.height;if(c.resetTransform(),c.scale(i,i),c.textBaseline=e.textBaseline,(D=e._stroke)!=null&&D.width){const P=e._stroke;c.lineWidth=P.width,c.miterLimit=P.miterLimit,c.lineJoin=P.join,c.lineCap=P.cap}c.font=d;let C,T;const w=e.dropShadow?2:1,k=e.wordWrap?e.wordWrapWidth:b,O=(((F=e._stroke)==null?void 0:F.width)??0)/2;let j=(m-v.fontSize)/2;m-v.fontSize<0&&(j=0);for(let P=0;P<w;++P){const I=e.dropShadow&&P===0,K=I?Math.ceil(Math.max(1,_)+n*2):0,G=K*i;if(I)this._setupDropShadow(c,e,i,G);else{const te=e._gradientBounds,H=e._gradientOffset;if(te){const W={width:te.width,height:te.height,lineHeight:te.height,lines:s.lines};this._setFillAndStrokeStyles(c,e,W,n,O,(H==null?void 0:H.x)??0,(H==null?void 0:H.y)??0)}else H?this._setFillAndStrokeStyles(c,e,s,n,O,H.x,H.y):this._setFillAndStrokeStyles(c,e,s,n,O);c.shadowColor="rgba(0,0,0,0)"}for(let te=0;te<p.length;te++){C=O,T=O+te*m+v.ascent+j,C+=this._getAlignmentOffset(g[te],k,e.align);let H=0;if(e.align==="justify"&&e.wordWrap&&te<p.length-1){const W=zd(p[te]);W>0&&(H=(k-g[te])/W)}($=e._stroke)!=null&&$.width&&this._drawLetterSpacing(p[te],e,r,C+n,T+n-K,!0,H),e._fill!==void 0&&this._drawLetterSpacing(p[te],e,r,C+n,T+n-K,!1,H)}}}_renderTaggedTextToCanvas(e,n,i,r,s){var O,j,D;const{canvas:l,context:c}=s,{runsByLine:d,lineWidths:p,maxLineWidth:m,lineAscents:g,lineHeights:b,hasDropShadow:v}=e,_=l.height;c.resetTransform(),c.scale(r,r),c.textBaseline=n.textBaseline;const C=v?2:1,T=n.wordWrap?n.wordWrapWidth:m;let w=((O=n._stroke)==null?void 0:O.width)??0;for(const F of d)for(const $ of F){const P=((j=$.style._stroke)==null?void 0:j.width)??0;P>w&&(w=P)}const k=w/2,R=[];for(let F=0;F<d.length;F++){const $=d[F],P=[];for(const I of $){const K=n_(I.style);c.font=K,P.push({width:iu._measureText(I.text,I.style.letterSpacing,c),font:K})}R.push(P)}for(let F=0;F<C;++F){const $=v&&F===0,P=$?Math.ceil(Math.max(1,_)+i*2):0,I=P*r;$||(c.shadowColor="rgba(0,0,0,0)");let K=k;for(let G=0;G<d.length;G++){const te=d[G],H=p[G],W=g[G],B=b[G],X=R[G];let Z=k;Z+=this._getAlignmentOffset(H,T,n.align);let Q=0;if(n.align==="justify"&&n.wordWrap&&G<d.length-1){let ee=0;for(const V of te)ee+=zd(V.text);ee>0&&(Q=(T-H)/ee)}const q=K+W;let Y=Z+i;for(let ee=0;ee<te.length;ee++){const V=te[ee],{width:oe,font:be}=X[ee];if(c.font=be,c.textBaseline=V.style.textBaseline,(D=V.style._stroke)!=null&&D.width){const se=V.style._stroke;if(c.lineWidth=se.width,c.miterLimit=se.miterLimit,c.lineJoin=se.join,c.lineCap=se.cap,$)if(V.style.dropShadow)this._setupDropShadow(c,V.style,r,I);else{const ge=zd(V.text);Y+=oe+ge*Q;continue}else{const ge=iu.measureFont(be),le=V.style.lineHeight||ge.fontSize,Re={width:oe,height:le,lineHeight:le,lines:[V.text]};c.strokeStyle=jy(se,c,Re,i*2,Y-i,K)}this._drawLetterSpacing(V.text,V.style,s,Y,q+i-P,!0,Q)}const ve=zd(V.text);Y+=oe+ve*Q}Y=Z+i;for(let ee=0;ee<te.length;ee++){const V=te[ee],{width:oe,font:be}=X[ee];if(c.font=be,c.textBaseline=V.style.textBaseline,V.style._fill!==void 0){if($)if(V.style.dropShadow)this._setupDropShadow(c,V.style,r,I);else{const se=zd(V.text);Y+=oe+se*Q;continue}else{const se=iu.measureFont(be),ge=V.style.lineHeight||se.fontSize,le={width:oe,height:ge,lineHeight:ge,lines:[V.text]};c.fillStyle=jy(V.style._fill,c,le,i*2,Y-i,K)}this._drawLetterSpacing(V.text,V.style,s,Y,q+i-P,!1,Q)}const ve=zd(V.text);Y+=oe+ve*Q}K+=B}}}_setFillAndStrokeStyles(e,n,i,r,s,l=0,c=0){var d;if(e.fillStyle=n._fill?jy(n._fill,e,i,r*2,l,c):null,(d=n._stroke)!=null&&d.width){const p=s+r*2;e.strokeStyle=jy(n._stroke,e,i,p,l,c)}}_setupDropShadow(e,n,i,r){e.fillStyle="black",e.strokeStyle="black";const s=n.dropShadow,l=s.color,c=s.alpha;e.shadowColor=Gi.shared.setValue(l).setAlpha(c).toRgbaString();const d=s.blur*i,p=s.distance*i;e.shadowBlur=d,e.shadowOffsetX=Math.cos(s.angle)*p,e.shadowOffsetY=Math.sin(s.angle)*p+r}_getAlignmentOffset(e,n,i){return i==="right"?n-e:i==="center"?(n-e)/2:0}_drawLetterSpacing(e,n,i,r,s,l=!1,c=0){const{context:d}=i,p=n.letterSpacing;let m=!1;if(iu.experimentalLetterSpacingSupported&&(iu.experimentalLetterSpacing?(d.letterSpacing=`${p}px`,d.textLetterSpacing=`${p}px`,m=!0):(d.letterSpacing="0px",d.textLetterSpacing="0px")),(p===0||m)&&c===0){l?d.strokeText(e,r,s):d.fillText(e,r,s);return}if(c!==0&&(p===0||m)){const C=e.split(" ");let T=r;const w=d.measureText(" ").width;for(let k=0;k<C.length;k++)l?d.strokeText(C[k],T,s):d.fillText(C[k],T,s),T+=d.measureText(C[k]).width+w+c;return}let g=r;const b=iu.graphemeSegmenter(e);let v=d.measureText(e).width,_=0;for(let C=0;C<b.length;++C){const T=b[C];l?d.strokeText(T,g,s):d.fillText(T,g,s);let w="";for(let k=C+1;k<b.length;++k)w+=b[k];_=d.measureText(w).width,g+=v-_+p,T===" "&&(g+=c),v=_}}}const Xd=new vB,a1=class ff extends mo{constructor(e={}){super(),this.uid=gi("textStyle"),this._tick=0,this._cachedFontString=null,_B(e),e instanceof ff&&(e=e._toObject());const r={...ff.defaultTextStyle,...e};for(const s in r){const l=s;this[l]=r[s]}this._tagStyles=e.tagStyles??void 0,this.update(),this._tick=0}get align(){return this._align}set align(e){this._align!==e&&(this._align=e,this.update())}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords!==e&&(this._breakWords=e,this.update())}get dropShadow(){return this._dropShadow}set dropShadow(e){this._dropShadow!==e&&(e!==null&&typeof e=="object"?this._dropShadow=this._createProxy({...ff.defaultDropShadow,...e}):this._dropShadow=e?this._createProxy({...ff.defaultDropShadow}):null,this.update())}get fontFamily(){return this._fontFamily}set fontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.update())}get fontSize(){return this._fontSize}set fontSize(e){this._fontSize!==e&&(typeof e=="string"?this._fontSize=parseInt(e,10):this._fontSize=e,this.update())}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle!==e&&(this._fontStyle=e.toLowerCase(),this.update())}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant!==e&&(this._fontVariant=e,this.update())}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.update())}get leading(){return this._leading}set leading(e){this._leading!==e&&(this._leading=e,this.update())}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.update())}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight!==e&&(this._lineHeight=e,this.update())}get padding(){return this._padding}set padding(e){this._padding!==e&&(this._padding=e,this.update())}get filters(){return this._filters}set filters(e){this._filters!==e&&(this._filters=Object.freeze(e),this.update())}get trim(){return this._trim}set trim(e){this._trim!==e&&(this._trim=e,this.update())}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline!==e&&(this._textBaseline=e,this.update())}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace!==e&&(this._whiteSpace=e,this.update())}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap!==e&&(this._wordWrap=e,this.update())}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth!==e&&(this._wordWrapWidth=e,this.update())}get fill(){return this._originalFill}set fill(e){e!==this._originalFill&&(this._originalFill=e,this._isFillStyle(e)&&(this._originalFill=this._createProxy({...hl.defaultFillStyle,...e},()=>{this._fill=pf({...this._originalFill},hl.defaultFillStyle)})),this._fill=pf(e===0?"black":e,hl.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(e){e!==this._originalStroke&&(this._originalStroke=e,this._isFillStyle(e)&&(this._originalStroke=this._createProxy({...hl.defaultStrokeStyle,...e},()=>{this._stroke=C0({...this._originalStroke},hl.defaultStrokeStyle)})),this._stroke=C0(e,hl.defaultStrokeStyle),this.update())}get tagStyles(){return this._tagStyles}set tagStyles(e){this._tagStyles!==e&&(this._tagStyles=e??void 0,this.update())}update(){this._tick++,this._cachedFontString=null,this.emit("update",this)}reset(){const e=ff.defaultTextStyle;for(const n in e)this[n]=e[n]}assign(e){for(const n in e){const i=n;this[i]=e[n]}return this}get styleKey(){return`${this.uid}-${this._tick}`}get _fontString(){return this._cachedFontString===null&&(this._cachedFontString=n_(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 ff(this._toObject())}_getFinalPadding(){let e=0;if(this._filters)for(let n=0;n<this._filters.length;n++)e+=this._filters[n].padding;return Math.max(this._padding,e)}destroy(e=!1){var i,r,s,l;if(this.removeAllListeners(),typeof e=="boolean"?e:e==null?void 0:e.texture){const c=typeof e=="boolean"?e:e==null?void 0:e.textureSource;(i=this._fill)!=null&&i.texture&&this._fill.texture.destroy(c),(r=this._originalFill)!=null&&r.texture&&this._originalFill.texture.destroy(c),(s=this._stroke)!=null&&s.texture&&this._stroke.texture.destroy(c),(l=this._originalStroke)!=null&&l.texture&&this._originalStroke.texture.destroy(c)}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null}_createProxy(e,n){return new Proxy(e,{set:(i,r,s)=>(i[r]===s||(i[r]=s,n==null||n(r,s),this.update()),!0)})}_isFillStyle(e){return(e??null)!==null&&!(Gi.isColorLike(e)||e instanceof ac||e instanceof tb)}};a1.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};a1.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 xf=a1;function _B(t){const e=t;if(typeof e.dropShadow=="boolean"&&e.dropShadow){const n=xf.defaultDropShadow;t.dropShadow={alpha:e.dropShadowAlpha??n.alpha,angle:e.dropShadowAngle??n.angle,blur:e.dropShadowBlur??n.blur,color:e.dropShadowColor??n.color,distance:e.dropShadowDistance??n.distance}}if(e.strokeThickness!==void 0){Qt(mi,"strokeThickness is now a part of stroke");const n=e.stroke;let i={};if(Gi.isColorLike(n))i.color=n;else if(n instanceof ac||n instanceof tb)i.fill=n;else if(Object.hasOwnProperty.call(n,"color")||Object.hasOwnProperty.call(n,"fill"))i=n;else throw new Error("Invalid stroke value.");t.stroke={...i,width:e.strokeThickness}}if(Array.isArray(e.fillGradientStops)){if(Qt(mi,"gradient fill is now a fill pattern: `new FillGradient(...)`"),!Array.isArray(e.fill)||e.fill.length===0)throw new Error("Invalid fill value. Expected an array of colors for gradient fill.");e.fill.length!==e.fillGradientStops.length&&ca("The number of fill colors must match the number of fill gradient stops.");const n=new ac({start:{x:0,y:0},end:{x:0,y:1},textureSpace:"local"}),i=e.fillGradientStops.slice(),r=e.fill.map(s=>Gi.shared.setValue(s).toNumber());i.forEach((s,l)=>{n.addColorStop(s,r[l])}),t.fill={fill:n}}}function SB(t,e){const{texture:n,bounds:i}=t,r=e._style._getFinalPadding();YC(i,e._anchor,n);const s=e._anchor._x*r*2,l=e._anchor._y*r*2;i.minX-=r-s,i.minY-=r-l,i.maxX-=r-s,i.maxY-=r-l}class EB{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 wB extends EB{}class sM{constructor(e){this._renderer=e,e.runners.resolutionChange.add(this),this._managedTexts=new Wm({renderer:e,type:"renderable",onUnload:this.onTextUnload.bind(this),name:"canvasText"})}resolutionChange(){for(const e in this._managedTexts.items){const n=this._managedTexts.items[e];n!=null&&n._autoResolution&&n.onViewUpdate()}}validateRenderable(e){const n=this._getGpuText(e),i=e.styleKey;return n.currentKey!==i?!0:e._didTextUpdate}addRenderable(e,n){const i=this._getGpuText(e);if(e._didTextUpdate){const r=e._autoResolution?this._renderer.resolution:e.resolution;(i.currentKey!==e.styleKey||e._resolution!==r)&&this._updateGpuText(e),e._didTextUpdate=!1,SB(i,e)}this._renderer.renderPipes.batch.addToBatch(i,n)}updateRenderable(e){const n=this._getGpuText(e);n._batcher.updateElement(n)}_updateGpuText(e){const n=this._getGpuText(e);n.texture&&this._renderer.canvasText.decreaseReferenceCount(n.currentKey),e._resolution=e._autoResolution?this._renderer.resolution:e.resolution,n.texture=this._renderer.canvasText.getManagedTexture(e),n.currentKey=e.styleKey}_getGpuText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){const n=new wB;return n.currentKey="--",n.renderable=e,n.transform=e.groupTransform,n.bounds={minX:0,maxX:1,minY:0,maxY:0},n.roundPixels=this._renderer._roundPixels|e._roundPixels,e._gpuData[this._renderer.uid]=n,this._managedTexts.add(e),n}onTextUnload(e){const n=e._gpuData[this._renderer.uid];if(!n)return;const{canvasText:i}=this._renderer;i.getReferenceCount(n.currentKey)>0?i.decreaseReferenceCount(n.currentKey):n.texture&&i.returnTexture(n.texture)}destroy(){this._managedTexts.destroy(),this._renderer=null}}sM.extension={type:[Rt.WebGLPipes,Rt.WebGPUPipes,Rt.CanvasPipes],name:"text"};const TB=new Bs;function CB(t,e,n,i,r=!1){const s=TB;s.minX=0,s.minY=0,s.maxX=t.width/i|0,s.maxY=t.height/i|0;const l=Z0.getOptimalTexture(s.width,s.height,i,!1,r);return l.source.uploadMethodId="image",l.source.resource=t,l.source.alphaMode="premultiply-alpha-on-upload",l.frame.width=e/i,l.frame.height=n/i,l.source.emit("update",l.source),l.updateUvs(),l}class lM{constructor(e,n){this._activeTextures={},this._renderer=e,this._retainCanvasContext=n}getTexture(e,n,i,r){typeof e=="string"&&(Qt("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),e={text:e,style:i,resolution:n}),e.style instanceof xf||(e.style=new xf(e.style)),e.textureStyle instanceof rh||(e.textureStyle=new rh(e.textureStyle)),typeof e.text!="string"&&(e.text=e.text.toString());const{text:s,style:l,textureStyle:c,autoGenerateMipmaps:d}=e,p=e.resolution??this._renderer.resolution,{frame:m,canvasAndContext:g}=Xd.getCanvasAndContext({text:s,style:l,resolution:p}),b=CB(g.canvas,m.width,m.height,p,d);if(c&&(b.source.style=c),l.trim&&(m.pad(l.padding),b.frame.copyFrom(m),b.frame.scale(1/p),b.updateUvs()),l.filters){const v=this._applyFilters(b,l.filters);return this.returnTexture(b),Xd.returnCanvasAndContext(g),v}return this._renderer.texture.initSource(b._source),this._retainCanvasContext||Xd.returnCanvasAndContext(g),b}returnTexture(e){const n=e.source,i=n.resource;if(this._retainCanvasContext&&(i!=null&&i.getContext)){const r=i.getContext("2d");r&&Xd.returnCanvasAndContext({canvas:i,context:r})}n.resource=null,n.uploadMethodId="unknown",n.alphaMode="no-premultiply-alpha",Z0.returnTexture(e,!0)}renderTextToCanvas(){Qt("8.10.0","CanvasTextSystem.renderTextToCanvas: no longer supported, use CanvasTextSystem.getTexture instead")}getManagedTexture(e){e._resolution=e._autoResolution?this._renderer.resolution:e.resolution;const n=e.styleKey;if(this._activeTextures[n])return this._increaseReferenceCount(n),this._activeTextures[n].texture;const i=this.getTexture({text:e.text,style:e.style,resolution:e._resolution,textureStyle:e.textureStyle,autoGenerateMipmaps:e.autoGenerateMipmaps});return this._activeTextures[n]={texture:i,usageCount:1},i}decreaseReferenceCount(e){const n=this._activeTextures[e];n&&(n.usageCount--,n.usageCount===0&&(this.returnTexture(n.texture),this._activeTextures[e]=null))}getReferenceCount(e){var n;return((n=this._activeTextures[e])==null?void 0:n.usageCount)??0}_increaseReferenceCount(e){this._activeTextures[e].usageCount++}_applyFilters(e,n){const i=this._renderer.renderTarget.renderTarget,r=this._renderer.filter.generateFilteredTexture({texture:e,filters:n});return this._renderer.renderTarget.bind(i,!1),r}destroy(){this._renderer=null;for(const e in this._activeTextures)this._activeTextures[e]&&this.returnTexture(this._activeTextures[e].texture);this._activeTextures=null}}class oM extends lM{constructor(e){super(e,!0)}}oM.extension={type:[Rt.CanvasSystem],name:"canvasText"};class cM extends lM{constructor(e){super(e,!1)}}cM.extension={type:[Rt.WebGLSystem,Rt.WebGPUSystem],name:"canvasText"};si.add(oM);si.add(cM);si.add(sM);class nb extends K6{constructor(...e){const n=W6(e,"Text");super(n,xf),this.renderPipeId="text",n.textureStyle&&(this.textureStyle=n.textureStyle instanceof rh?n.textureStyle:new rh(n.textureStyle)),this.autoGenerateMipmaps=n.autoGenerateMipmaps??Ls.defaultOptions.autoGenerateMipmaps}updateBounds(){const e=this._bounds,n=this._anchor;let i=0,r=0;if(this._style.trim){const{frame:s,canvasAndContext:l}=Xd.getCanvasAndContext({text:this.text,style:this._style,resolution:1});Xd.returnCanvasAndContext(l),i=s.width,r=s.height}else{const s=iu.measureText(this._text,this._style);i=s.width,r=s.height}e.minX=-n._x*i,e.maxX=e.minX+i,e.minY=-n._y*r,e.maxY=e.minY+r}}si.add(QD,JD);var Px={exports:{}},$o={};/**
|
|
310
|
+
* @license React
|
|
311
|
+
* react-reconciler-constants.production.js
|
|
312
|
+
*
|
|
313
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
314
|
+
*
|
|
315
|
+
* This source code is licensed under the MIT license found in the
|
|
316
|
+
* LICENSE file in the root directory of this source tree.
|
|
317
|
+
*/var Cw;function AB(){return Cw||(Cw=1,$o.ConcurrentRoot=1,$o.ContinuousEventPriority=8,$o.DefaultEventPriority=32,$o.DiscreteEventPriority=2,$o.IdleEventPriority=268435456,$o.LegacyRoot=0,$o.NoEventPriority=0),$o}var Aw;function MB(){return Aw||(Aw=1,Px.exports=AB()),Px.exports}var Kd=MB();const s1=U.createContext({}),RB=s1.Provider;s1.Consumer;function uM(t,e){const n=Object.getPrototypeOf(t),i=Object.getOwnPropertyDescriptor(n,e);return!(typeof i>"u"||i.writable||i.set)}const ou={currentUpdatePriority:Kd.DefaultEventPriority,unmountQueue:new Set};function Mw(t,...e){}function fM(t,e={}){const n=t;return n.__pixireact=Object.assign({filters:[],parent:null,root:null,type:""},e),n}var NB="0.0.0-development",kB={version:NB};function OB(){}function dM(t,e,n){e instanceof Cf&&(e.__pixireact.parent=t,typeof n=="number"?t.__pixireact.filters.splice(n,0,e):t.__pixireact.filters.push(e),t.filters=t.__pixireact.filters)}function Gx(t,e){e&&(e instanceof br?t.addChild(e):e instanceof Cf&&dM(t,e))}function DB(){}function zB(){return!1}const i_=Object.freeze({onclick:"onClick",onglobalmousemove:"onGlobalMouseMove",onglobalpointermove:"onGlobalPointerMove",onglobaltouchmove:"onGlobalTouchMove",onmousedown:"onMouseDown",onmouseenter:"onMouseEnter",onmouseleave:"onMouseLeave",onmousemove:"onMouseMove",onmouseout:"onMouseOut",onmouseover:"onMouseOver",onmouseup:"onMouseUp",onmouseupoutside:"onMouseUpOutside",onpointercancel:"onPointerCancel",onpointerdown:"onPointerDown",onpointerenter:"onPointerEnter",onpointerleave:"onPointerLeave",onpointermove:"onPointerMove",onpointerout:"onPointerOut",onpointerover:"onPointerOver",onpointertap:"onPointerTap",onpointerup:"onPointerUp",onpointerupoutside:"onPointerUpOutside",onrightclick:"onRightClick",onrightdown:"onRightDown",onrightup:"onRightUp",onrightupoutside:"onRightUpOutside",ontap:"onTap",ontouchcancel:"onTouchCancel",ontouchend:"onTouchEnd",ontouchendoutside:"onTouchEndOutside",ontouchmove:"onTouchMove",ontouchstart:"onTouchStart",onwheel:"onWheel"}),M0=Object.freeze({onClick:"onclick",onGlobalMouseMove:"onglobalmousemove",onGlobalPointerMove:"onglobalpointermove",onGlobalTouchMove:"onglobaltouchmove",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseUpOutside:"onmouseupoutside",onPointerCancel:"onpointercancel",onPointerDown:"onpointerdown",onPointerEnter:"onpointerenter",onPointerLeave:"onpointerleave",onPointerMove:"onpointermove",onPointerOut:"onpointerout",onPointerOver:"onpointerover",onPointerTap:"onpointertap",onPointerUp:"onpointerup",onPointerUpOutside:"onpointerupoutside",onRightClick:"onrightclick",onRightDown:"onrightdown",onRightUp:"onrightup",onRightUpOutside:"onrightupoutside",onTap:"ontap",onTouchCancel:"ontouchcancel",onTouchEnd:"ontouchend",onTouchEndOutside:"ontouchendoutside",onTouchMove:"ontouchmove",onTouchStart:"ontouchstart",onWheel:"onwheel"});function hM(t){return Array.isArray(t)}function pM(t,e,n={arrays:"reference",objects:"reference",strict:!0}){const{arrays:i,objects:r,strict:s}=n;if(typeof t!=typeof e||!!t!=!!e)return!1;if(IB(t)||LB(t))return t===e;const l=UB(t);if(l&&r==="reference")return t===e;const c=hM(t);if(c&&i==="reference")return t===e;if((c||l)&&t===e)return!0;let d;for(d in t)if(!(d in e))return!1;let p=t;if(s&&(p=e),l&&i==="shallow"&&r==="shallow"){for(d in p)if(!pM(t[d],e[d],{strict:s,objects:"reference"}))return!1}else for(d in p)if(t[d]!==e[d])return!1;if(mM(d)){if(c&&t.length===0&&e.length===0||l&&Object.keys(t).length===0&&Object.keys(e).length===0)return!0;if(t!==e)return!1}return!0}function BB(t){return t===null}function LB(t){return typeof t=="number"}function UB(t){return!(t!==Object(t)||hM(t)||typeof t=="function")}function IB(t){return typeof t=="string"}function mM(t){return t===void 0}const jB=Object.freeze(["children","key","ref"]);function HB(t,e=[]){const n={};return Object.entries(t).reduce((i,[r,s])=>(e.includes(r)||(i[r]=s),i),n)}function r_(t,e=[]){return HB(t,jB.concat(e))}const PB="__default";function gM(t,e={},n=!1){const i=r_(t),r=r_(e),s=Object.entries(i),l=[];if(n){const c=Object.keys(r);let d=0;for(;d<c.length;){const p=c[d];!(p in i)&&s.unshift([p,`${PB}remove`]),d+=1}}return s.forEach(([c,d])=>{if(pM(d,r[c]))return;if(c in M0){l.push([c,d,!0,[]]);return}let p=[];c.includes("-")&&(p=c.split("-")),l.push([c,d,!1,p]);for(const m in i){const g=i[m];m.startsWith(`${c}-`)&&l.push([m,g,!1,m.split("-")])}}),{changes:l}}function GB(t){const e=t;return!(!e||!e.changes)}const FB="__default",Rw=new Map,Nw={};function kw(t,e){if(t){const n=t[e];if(!mM(n)&&!BB(n))return n}return t}function yM(t,e){const{__pixireact:n={},...i}=t;let r;GB(e)?r=e:r=gM(e,i);const{changes:s}=r;let l=0;for(;l<s.length;){const c=s[l];let d=!1,p=c[0],m=c[1];const g=c[2],b=c[3];let v=t,_=v[p];if(p==="draw"&&typeof m=="function"&&(t instanceof Aa?m(t):(d=!0,Mw("warn",`The \`draw\` prop was used on a \`${n.type}\` component, but it's only valid on \`graphics\` components.`))),p in i_){const C=p;d=!0,Nw[p]||(Nw[p]=!0,Mw("warn",`Event names must be pascal case; instead of \`${p}\`, you probably want \`${i_[C]}\`.`))}if(!d){if(b.length&&(_=b.reduce(kw,v),!(_&&_.set))){const[C,...T]=b.reverse();v=T.reverse().reduce(kw,v),p=C}if(m===`${FB}remove`)if(v instanceof br){let C=Rw.get(v.constructor);C||(C=v.constructor,C=new C,Rw.set(v.constructor,C)),m=C[p]}else m=0;if(g&&n){const T=M0[p];m?v[T]=m:delete v[T]}else uM(v,p)||(v[p]=m)}l+=1}return t}function qB(t,e,n,i){const{children:r,...s}=i,{children:l,...c}=n,d=gM(s,c,!0);return d.changes.length?d:null}function YB(t,e,n,i){const r=qB(t,e,n,i);r&&yM(t,r)}const VB=Object.freeze([...Object.keys(i_),"draw"]),a_={};function XB(t){const e=t.charAt(0),n=t.substring(1);return`${e.toUpperCase()}${n}`}function KB(t,e){return e.toLowerCase()}function WB(t){let e=t;return t.startsWith("pixi")&&(e=t.replace(/^pixi([A-Z])/,KB)),e}function $B(t,e,n){const i=WB(t),r=XB(i);if(!(r in a_))throw new Error(`${r} is not part of the PIXI namespace! Did you forget to extend?`);const s=a_[r],l=r_(e,VB);Object.entries(e).forEach(([d,p])=>{if(d in M0){const m=M0[d];l[m]=p}});const c=fM(new s(l),{root:n,type:i});return yM(c,e),c}var Fx={exports:{}},qx={exports:{}},Yx={exports:{}},Vx={};/**
|
|
318
|
+
* @license React
|
|
319
|
+
* scheduler.production.js
|
|
320
|
+
*
|
|
321
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
322
|
+
*
|
|
323
|
+
* This source code is licensed under the MIT license found in the
|
|
324
|
+
* LICENSE file in the root directory of this source tree.
|
|
325
|
+
*/var Ow;function ZB(){return Ow||(Ow=1,(function(t){function e(B,X){var Z=B.length;B.push(X);e:for(;0<Z;){var Q=Z-1>>>1,q=B[Q];if(0<r(q,X))B[Q]=X,B[Z]=q,Z=Q;else break e}}function n(B){return B.length===0?null:B[0]}function i(B){if(B.length===0)return null;var X=B[0],Z=B.pop();if(Z!==X){B[0]=Z;e:for(var Q=0,q=B.length,Y=q>>>1;Q<Y;){var ee=2*(Q+1)-1,V=B[ee],oe=ee+1,be=B[oe];if(0>r(V,Z))oe<q&&0>r(be,V)?(B[Q]=be,B[oe]=Z,Q=oe):(B[Q]=V,B[ee]=Z,Q=ee);else if(oe<q&&0>r(be,Z))B[Q]=be,B[oe]=Z,Q=oe;else break e}}return X}function r(B,X){var Z=B.sortIndex-X.sortIndex;return Z!==0?Z:B.id-X.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var l=Date,c=l.now();t.unstable_now=function(){return l.now()-c}}var d=[],p=[],m=1,g=null,b=3,v=!1,_=!1,C=!1,T=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function R(B){for(var X=n(p);X!==null;){if(X.callback===null)i(p);else if(X.startTime<=B)i(p),X.sortIndex=X.expirationTime,e(d,X);else break;X=n(p)}}function O(B){if(C=!1,R(B),!_)if(n(d)!==null)_=!0,H();else{var X=n(p);X!==null&&W(O,X.startTime-B)}}var j=!1,D=-1,F=5,$=-1;function P(){return!(t.unstable_now()-$<F)}function I(){if(j){var B=t.unstable_now();$=B;var X=!0;try{e:{_=!1,C&&(C=!1,w(D),D=-1),v=!0;var Z=b;try{t:{for(R(B),g=n(d);g!==null&&!(g.expirationTime>B&&P());){var Q=g.callback;if(typeof Q=="function"){g.callback=null,b=g.priorityLevel;var q=Q(g.expirationTime<=B);if(B=t.unstable_now(),typeof q=="function"){g.callback=q,R(B),X=!0;break t}g===n(d)&&i(d),R(B)}else i(d);g=n(d)}if(g!==null)X=!0;else{var Y=n(p);Y!==null&&W(O,Y.startTime-B),X=!1}}break e}finally{g=null,b=Z,v=!1}X=void 0}}finally{X?K():j=!1}}}var K;if(typeof k=="function")K=function(){k(I)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,te=G.port2;G.port1.onmessage=I,K=function(){te.postMessage(null)}}else K=function(){T(I,0)};function H(){j||(j=!0,K())}function W(B,X){D=T(function(){B(t.unstable_now())},X)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(B){B.callback=null},t.unstable_continueExecution=function(){_||v||(_=!0,H())},t.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<B?Math.floor(1e3/B):5},t.unstable_getCurrentPriorityLevel=function(){return b},t.unstable_getFirstCallbackNode=function(){return n(d)},t.unstable_next=function(B){switch(b){case 1:case 2:case 3:var X=3;break;default:X=b}var Z=b;b=X;try{return B()}finally{b=Z}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(B,X){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var Z=b;b=B;try{return X()}finally{b=Z}},t.unstable_scheduleCallback=function(B,X,Z){var Q=t.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?Q+Z:Q):Z=Q,B){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=Z+q,B={id:m++,callback:X,priorityLevel:B,startTime:Z,expirationTime:q,sortIndex:-1},Z>Q?(B.sortIndex=Z,e(p,B),n(d)===null&&B===n(p)&&(C?(w(D),D=-1):C=!0,W(O,Z-Q))):(B.sortIndex=q,e(d,B),_||v||(_=!0,H())),B},t.unstable_shouldYield=P,t.unstable_wrapCallback=function(B){var X=b;return function(){var Z=b;b=X;try{return B.apply(this,arguments)}finally{b=Z}}}})(Vx)),Vx}var Dw;function QB(){return Dw||(Dw=1,Yx.exports=ZB()),Yx.exports}/**
|
|
326
|
+
* @license React
|
|
327
|
+
* react-reconciler.production.js
|
|
328
|
+
*
|
|
329
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
330
|
+
*
|
|
331
|
+
* This source code is licensed under the MIT license found in the
|
|
332
|
+
* LICENSE file in the root directory of this source tree.
|
|
333
|
+
*/var zw;function JB(){return zw||(zw=1,(function(t){t.exports=function(e){function n(u,f,x,E){return new Yh(u,f,x,E)}function i(){}function r(u){var f="https://react.dev/errors/"+u;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)f+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+u+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(u){return u===null||typeof u!="object"?null:(u=Qh&&u[Qh]||u["@@iterator"],typeof u=="function"?u:null)}function l(u){if(u==null)return null;if(typeof u=="function")return u.$$typeof===Do?null:u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case Mc:return"Fragment";case ja:return"Portal";case Zh:return"Profiler";case $h:return"StrictMode";case Qf:return"Suspense";case ql:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case ys:return(u.displayName||"Context")+".Provider";case Fl:return(u._context.displayName||"Context")+".Consumer";case Rc:var f=u.render;return u=u.displayName,u||(u=f.displayName||f.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case ku:return f=u.displayName||null,f!==null?f:l(u.type)||"Memo";case Ha:f=u._payload,u=u._init;try{return l(u(f))}catch{}}return null}function c(u){if(Jf===void 0)try{throw Error()}catch(x){var f=x.stack.trim().match(/\n( *(at )?)/);Jf=f&&f[1]||"",Jh=-1<x.stack.indexOf(`
|
|
334
|
+
at`)?" (<anonymous>)":-1<x.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
335
|
+
`+Jf+u+Jh}function d(u,f){if(!u||Yl)return"";Yl=!0;var x=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var E={DetermineComponentFrameRoot:function(){try{if(f){var je=function(){throw Error()};if(Object.defineProperty(je.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(je,[])}catch(ht){var Ge=ht}Reflect.construct(u,[],je)}else{try{je.call()}catch(ht){Ge=ht}u.call(je.prototype)}}else{try{throw Error()}catch(ht){Ge=ht}(je=u())&&typeof je.catch=="function"&&je.catch(function(){})}}catch(ht){if(ht&&Ge&&typeof ht.stack=="string")return[ht.stack,Ge.stack]}return[null,null]}};E.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var N=Object.getOwnPropertyDescriptor(E.DetermineComponentFrameRoot,"name");N&&N.configurable&&Object.defineProperty(E.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var z=E.DetermineComponentFrameRoot(),ne=z[0],ie=z[1];if(ne&&ie){var de=ne.split(`
|
|
336
|
+
`),Te=ie.split(`
|
|
337
|
+
`);for(N=E=0;E<de.length&&!de[E].includes("DetermineComponentFrameRoot");)E++;for(;N<Te.length&&!Te[N].includes("DetermineComponentFrameRoot");)N++;if(E===de.length||N===Te.length)for(E=de.length-1,N=Te.length-1;1<=E&&0<=N&&de[E]!==Te[N];)N--;for(;1<=E&&0<=N;E--,N--)if(de[E]!==Te[N]){if(E!==1||N!==1)do if(E--,N--,0>N||de[E]!==Te[N]){var Oe=`
|
|
338
|
+
`+de[E].replace(" at new "," at ");return u.displayName&&Oe.includes("<anonymous>")&&(Oe=Oe.replace("<anonymous>",u.displayName)),Oe}while(1<=E&&0<=N);break}}}finally{Yl=!1,Error.prepareStackTrace=x}return(x=u?u.displayName||u.name:"")?c(x):""}function p(u){switch(u.tag){case 26:case 27:case 5:return c(u.type);case 16:return c("Lazy");case 13:return c("Suspense");case 19:return c("SuspenseList");case 0:case 15:return u=d(u.type,!1),u;case 11:return u=d(u.type.render,!1),u;case 1:return u=d(u.type,!0),u;default:return""}}function m(u){try{var f="";do f+=p(u),u=u.return;while(u);return f}catch(x){return`
|
|
339
|
+
Error generating stack: `+x.message+`
|
|
340
|
+
`+x.stack}}function g(u){var f=u,x=u;if(u.alternate)for(;f.return;)f=f.return;else{u=f;do f=u,(f.flags&4098)!==0&&(x=f.return),u=f.return;while(u)}return f.tag===3?x:null}function b(u){if(g(u)!==u)throw Error(r(188))}function v(u){var f=u.alternate;if(!f){if(f=g(u),f===null)throw Error(r(188));return f!==u?null:u}for(var x=u,E=f;;){var N=x.return;if(N===null)break;var z=N.alternate;if(z===null){if(E=N.return,E!==null){x=E;continue}break}if(N.child===z.child){for(z=N.child;z;){if(z===x)return b(N),u;if(z===E)return b(N),f;z=z.sibling}throw Error(r(188))}if(x.return!==E.return)x=N,E=z;else{for(var ne=!1,ie=N.child;ie;){if(ie===x){ne=!0,x=N,E=z;break}if(ie===E){ne=!0,E=N,x=z;break}ie=ie.sibling}if(!ne){for(ie=z.child;ie;){if(ie===x){ne=!0,x=z,E=N;break}if(ie===E){ne=!0,E=z,x=N;break}ie=ie.sibling}if(!ne)throw Error(r(189))}}if(x.alternate!==E)throw Error(r(190))}if(x.tag!==3)throw Error(r(188));return x.stateNode.current===x?u:f}function _(u){var f=u.tag;if(f===5||f===26||f===27||f===6)return u;for(u=u.child;u!==null;){if(f=_(u),f!==null)return f;u=u.sibling}return null}function C(u){var f=u.tag;if(f===5||f===26||f===27||f===6)return u;for(u=u.child;u!==null;){if(u.tag!==4&&(f=C(u),f!==null))return f;u=u.sibling}return null}function T(u){return{current:u}}function w(u){0>el||(u.current=Hu[el],Hu[el]=null,el--)}function k(u,f){el++,Hu[el]=u.current,u.current=f}function R(u){return u>>>=0,u===0?32:31-(Pu(u)/Zg|0)|0}function O(u){var f=u&42;if(f!==0)return f;switch(u&-u){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: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 u&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return u&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return u}}function j(u,f){var x=u.pendingLanes;if(x===0)return 0;var E=0,N=u.suspendedLanes,z=u.pingedLanes,ne=u.warmLanes;u=u.finishedLanes!==0;var ie=x&134217727;return ie!==0?(x=ie&~N,x!==0?E=O(x):(z&=ie,z!==0?E=O(z):u||(ne=ie&~ne,ne!==0&&(E=O(ne))))):(ie=x&~N,ie!==0?E=O(ie):z!==0?E=O(z):u||(ne=x&~ne,ne!==0&&(E=O(ne)))),E===0?0:f!==0&&f!==E&&(f&N)===0&&(N=E&-E,ne=f&-f,N>=ne||N===32&&(ne&4194176)!==0)?f:E}function D(u,f){return(u.pendingLanes&~(u.suspendedLanes&~u.pingedLanes)&f)===0}function F(u,f){switch(u){case 1:case 2:case 4:case 8:return f+250;case 16:case 32:case 64: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 f+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 $(){var u=Dc;return Dc<<=1,(Dc&4194176)===0&&(Dc=128),u}function P(){var u=Gu;return Gu<<=1,(Gu&62914560)===0&&(Gu=4194304),u}function I(u){for(var f=[],x=0;31>x;x++)f.push(u);return f}function K(u,f){u.pendingLanes|=f,f!==268435456&&(u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0)}function G(u,f,x,E,N,z){var ne=u.pendingLanes;u.pendingLanes=x,u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0,u.expiredLanes&=x,u.entangledLanes&=x,u.errorRecoveryDisabledLanes&=x,u.shellSuspendCounter=0;var ie=u.entanglements,de=u.expirationTimes,Te=u.hiddenUpdates;for(x=ne&~x;0<x;){var Oe=31-wr(x),je=1<<Oe;ie[Oe]=0,de[Oe]=-1;var Ge=Te[Oe];if(Ge!==null)for(Te[Oe]=null,Oe=0;Oe<Ge.length;Oe++){var ht=Ge[Oe];ht!==null&&(ht.lane&=-536870913)}x&=~je}E!==0&&te(u,E,0),z!==0&&N===0&&u.tag!==0&&(u.suspendedLanes|=z&~(ne&~f))}function te(u,f,x){u.pendingLanes|=f,u.suspendedLanes&=~f;var E=31-wr(f);u.entangledLanes|=f,u.entanglements[E]=u.entanglements[E]|1073741824|x&4194218}function H(u,f){var x=u.entangledLanes|=f;for(u=u.entanglements;x;){var E=31-wr(x),N=1<<E;N&f|u[E]&f&&(u[E]|=f),x&=~N}}function W(u){return u&=-u,2<u?8<u?(u&134217727)!==0?32:268435456:8:2}function B(u){if(Tr&&typeof Tr.onCommitFiberRoot=="function")try{Tr.onCommitFiberRoot(Bc,u,void 0,(u.current.flags&128)===128)}catch{}}function X(u){if(typeof ty=="function"&&Np(u),Tr&&typeof Tr.setStrictMode=="function")try{Tr.setStrictMode(Bc,u)}catch{}}function Z(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}function Q(u,f){if(typeof u=="object"&&u!==null){var x=gd.get(u);return x!==void 0?x:(f={value:u,source:f,stack:m(f)},gd.set(u,f),f)}return{value:u,source:f,stack:m(f)}}function q(u,f){Nn[Yn++]=Yu,Nn[Yn++]=qu,qu=u,Yu=f}function Y(u,f,x){Kr[Wr++]=Ss,Kr[Wr++]=ga,Kr[Wr++]=Pa,Pa=u;var E=Ss;u=ga;var N=32-wr(E)-1;E&=~(1<<N),x+=1;var z=32-wr(f)+N;if(30<z){var ne=N-N%5;z=(E&(1<<ne)-1).toString(32),E>>=ne,N-=ne,Ss=1<<32-wr(f)+N|x<<N|E,ga=z+u}else Ss=1<<z|x<<N|E,ga=u}function ee(u){u.return!==null&&(q(u,1),Y(u,1,0))}function V(u){for(;u===qu;)qu=Nn[--Yn],Nn[Yn]=null,Yu=Nn[--Yn],Nn[Yn]=null;for(;u===Pa;)Pa=Kr[--Wr],Kr[Wr]=null,ga=Kr[--Wr],Kr[Wr]=null,Ss=Kr[--Wr],Kr[Wr]=null}function oe(u,f){k(Ga,f),k(Vu,u),k(Ni,null),u=zo(f),w(Ni),k(Ni,u)}function be(){w(Ni),w(Vu),w(Ga)}function ve(u){u.memoizedState!==null&&k(Lc,u);var f=Ni.current,x=Ng(f,u.type);f!==x&&(k(Vu,u),k(Ni,x))}function se(u){Vu.current===u&&(w(Ni),w(Vu)),Lc.current===u&&(w(Lc),xs?ot._currentValue=Er:ot._currentValue2=Er)}function ge(u){var f=Error(r(418,""));throw Le(Q(f,u)),Xu}function le(u,f){if(!dr)throw Error(r(175));Cb(u.stateNode,u.type,u.memoizedProps,f,u)||ge(u)}function Re(u){for(Zi=u.return;Zi;)switch(Zi.tag){case 3:case 27:ya=!0;return;case 5:case 13:ya=!1;return;default:Zi=Zi.return}}function Ie(u){if(!dr||u!==Zi)return!1;if(!Ft)return Re(u),Ft=!0,!1;var f=!1;if(Ii?u.tag!==3&&u.tag!==27&&(u.tag!==5||Vg(u.type)&&!Kl(u.type,u.memoizedProps))&&(f=!0):u.tag!==3&&(u.tag!==5||Vg(u.type)&&!Kl(u.type,u.memoizedProps))&&(f=!0),f&&Hi&&ge(u),Re(u),u.tag===13){if(!dr)throw Error(r(316));if(u=u.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(317));Hi=qg(u)}else Hi=Zi?yp(u.stateNode):null;return!0}function Ue(){dr&&(Hi=Zi=null,Ft=!1)}function Le(u){$r===null?$r=[u]:$r.push(u)}function Ve(){for(var u=$l,f=Uc=$l=0;f<u;){var x=Zr[f];Zr[f++]=null;var E=Zr[f];Zr[f++]=null;var N=Zr[f];Zr[f++]=null;var z=Zr[f];if(Zr[f++]=null,E!==null&&N!==null){var ne=E.pending;ne===null?N.next=N:(N.next=ne.next,ne.next=N),E.pending=N}z!==0&&zn(x,N,z)}}function ut(u,f,x,E){Zr[$l++]=u,Zr[$l++]=f,Zr[$l++]=x,Zr[$l++]=E,Uc|=E,u.lanes|=E,u=u.alternate,u!==null&&(u.lanes|=E)}function He(u,f,x,E){return ut(u,f,x,E),Bn(u)}function At(u,f){return ut(u,null,null,f),Bn(u)}function zn(u,f,x){u.lanes|=x;var E=u.alternate;E!==null&&(E.lanes|=x);for(var N=!1,z=u.return;z!==null;)z.childLanes|=x,E=z.alternate,E!==null&&(E.childLanes|=x),z.tag===22&&(u=z.stateNode,u===null||u._visibility&1||(N=!0)),u=z,z=z.return;N&&f!==null&&u.tag===3&&(z=u.stateNode,N=31-wr(x),z=z.hiddenUpdates,u=z[N],u===null?z[N]=[f]:u.push(f),f.lane=x|536870912)}function Bn(u){if(50<Yo)throw Yo=0,mr=null,Error(r(185));for(var f=u.return;f!==null;)u=f,f=u.return;return u.tag===3?u.stateNode:null}function bn(u){u!==Io&&u.next===null&&(Io===null?Ic=Io=u:Io=Io.next=u),Wu=!0,Ku||(Ku=!0,Se(ka))}function wi(u,f){if(!Fa&&Wu){Fa=!0;do for(var x=!1,E=Ic;E!==null;){if(u!==0){var N=E.pendingLanes;if(N===0)var z=0;else{var ne=E.suspendedLanes,ie=E.pingedLanes;z=(1<<31-wr(42|u)+1)-1,z&=N&~(ne&~ie),z=z&201326677?z&201326677|1:z?z|2:0}z!==0&&(x=!0,ua(E,z))}else z=Et,z=j(E,E===Mt?z:0),(z&3)===0||D(E,z)||(x=!0,ua(E,z));E=E.next}while(x);Fa=!1}}function ka(){Wu=Ku=!1;var u=0;Zl!==0&&(Wl()&&(u=Zl),Zl=0);for(var f=ji(),x=null,E=Ic;E!==null;){var N=E.next,z=Lr(E,f);z===0?(E.next=null,x===null?Ic=N:x.next=N,N===null&&(Io=x)):(x=E,(u!==0||(z&3)!==0)&&(Wu=!0)),E=N}wi(u)}function Lr(u,f){for(var x=u.suspendedLanes,E=u.pingedLanes,N=u.expirationTimes,z=u.pendingLanes&-62914561;0<z;){var ne=31-wr(z),ie=1<<ne,de=N[ne];de===-1?((ie&x)===0||(ie&E)!==0)&&(N[ne]=F(ie,f)):de<=f&&(u.expiredLanes|=ie),z&=~ie}if(f=Mt,x=Et,x=j(u,u===f?x:0),E=u.callbackNode,x===0||u===f&&mn===2||u.cancelPendingCommit!==null)return E!==null&&E!==null&&Fu(E),u.callbackNode=null,u.callbackPriority=0;if((x&3)===0||D(u,x)){if(f=x&-x,f===u.callbackPriority)return f;switch(E!==null&&Fu(E),W(x)){case 2:case 8:x=ey;break;case 32:x=pd;break;case 268435456:x=md;break;default:x=pd}return E=hn.bind(null,u),x=zc(x,E),u.callbackPriority=f,u.callbackNode=x,f}return E!==null&&E!==null&&Fu(E),u.callbackPriority=2,u.callbackNode=null,2}function hn(u,f){var x=u.callbackNode;if(Mi()&&u.callbackNode!==x)return null;var E=Et;return E=j(u,u===Mt?E:0),E===0?null:(Cu(u,E,f),Lr(u,ji()),u.callbackNode!=null&&u.callbackNode===x?hn.bind(null,u):null)}function ua(u,f){if(Mi())return null;Cu(u,f,!0)}function Se(u){ci?id(function(){(Ze&6)!==0?zc(Rp,u):u()}):zc(Rp,u)}function ke(){return Zl===0&&(Zl=$()),Zl}function Je(u,f){if($u===null){var x=$u=[];yd=0,Cr=ke(),Ql={status:"pending",value:void 0,then:function(E){x.push(E)}}}return yd++,f.then(bt,bt),f}function bt(){if(--yd===0&&$u!==null){Ql!==null&&(Ql.status="fulfilled");var u=$u;$u=null,Cr=0,Ql=null;for(var f=0;f<u.length;f++)(0,u[f])()}}function kt(u,f){var x=[],E={status:"pending",value:null,reason:null,then:function(N){x.push(N)}};return u.then(function(){E.status="fulfilled",E.value=f;for(var N=0;N<x.length;N++)(0,x[N])(f)},function(N){for(E.status="rejected",E.reason=N,N=0;N<x.length;N++)(0,x[N])(void 0)}),E}function yi(u){u.updateQueue={baseState:u.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function rr(u,f){u=u.updateQueue,f.updateQueue===u&&(f.updateQueue={baseState:u.baseState,firstBaseUpdate:u.firstBaseUpdate,lastBaseUpdate:u.lastBaseUpdate,shared:u.shared,callbacks:null})}function xn(u){return{lane:u,tag:0,payload:null,callback:null,next:null}}function $t(u,f,x){var E=u.updateQueue;if(E===null)return null;if(E=E.shared,(Ze&2)!==0){var N=E.pending;return N===null?f.next=f:(f.next=N.next,N.next=f),E.pending=f,f=Bn(u),zn(u,null,x),f}return ut(u,E,f,x),Bn(u)}function Gn(u,f,x){if(f=f.updateQueue,f!==null&&(f=f.shared,(x&4194176)!==0)){var E=f.lanes;E&=u.pendingLanes,x|=E,f.lanes=x,H(u,x)}}function Pt(u,f){var x=u.updateQueue,E=u.alternate;if(E!==null&&(E=E.updateQueue,x===E)){var N=null,z=null;if(x=x.firstBaseUpdate,x!==null){do{var ne={lane:x.lane,tag:x.tag,payload:x.payload,callback:null,next:null};z===null?N=z=ne:z=z.next=ne,x=x.next}while(x!==null);z===null?N=z=f:z=z.next=f}else N=z=f;x={baseState:E.baseState,firstBaseUpdate:N,lastBaseUpdate:z,shared:E.shared,callbacks:E.callbacks},u.updateQueue=x;return}u=x.lastBaseUpdate,u===null?x.firstBaseUpdate=f:u.next=f,x.lastBaseUpdate=f}function Fi(){if(jc){var u=Ql;if(u!==null)throw u}}function Qn(u,f,x,E){jc=!1;var N=u.updateQueue;tl=!1;var z=N.firstBaseUpdate,ne=N.lastBaseUpdate,ie=N.shared.pending;if(ie!==null){N.shared.pending=null;var de=ie,Te=de.next;de.next=null,ne===null?z=Te:ne.next=Te,ne=de;var Oe=u.alternate;Oe!==null&&(Oe=Oe.updateQueue,ie=Oe.lastBaseUpdate,ie!==ne&&(ie===null?Oe.firstBaseUpdate=Te:ie.next=Te,Oe.lastBaseUpdate=de))}if(z!==null){var je=N.baseState;ne=0,Oe=Te=de=null,ie=z;do{var Ge=ie.lane&-536870913,ht=Ge!==ie.lane;if(ht?(Et&Ge)===Ge:(E&Ge)===Ge){Ge!==0&&Ge===Cr&&(jc=!0),Oe!==null&&(Oe=Oe.next={lane:0,tag:ie.tag,payload:ie.payload,callback:null,next:null});e:{var Nr=u,ef=ie;Ge=f;var Vo=x;switch(ef.tag){case 1:if(Nr=ef.payload,typeof Nr=="function"){je=Nr.call(Vo,je,Ge);break e}je=Nr;break e;case 3:Nr.flags=Nr.flags&-65537|128;case 0:if(Nr=ef.payload,Ge=typeof Nr=="function"?Nr.call(Vo,je,Ge):Nr,Ge==null)break e;je=Oo({},je,Ge);break e;case 2:tl=!0}}Ge=ie.callback,Ge!==null&&(u.flags|=64,ht&&(u.flags|=8192),ht=N.callbacks,ht===null?N.callbacks=[Ge]:ht.push(Ge))}else ht={lane:Ge,tag:ie.tag,payload:ie.payload,callback:ie.callback,next:null},Oe===null?(Te=Oe=ht,de=je):Oe=Oe.next=ht,ne|=Ge;if(ie=ie.next,ie===null){if(ie=N.shared.pending,ie===null)break;ht=ie,ie=ht.next,ht.next=null,N.lastBaseUpdate=ht,N.shared.pending=null}}while(!0);Oe===null&&(de=je),N.baseState=de,N.firstBaseUpdate=Te,N.lastBaseUpdate=Oe,z===null&&(N.shared.lanes=0),ta|=ne,u.lanes=ne,u.memoizedState=je}}function bo(u,f){if(typeof u!="function")throw Error(r(191,u));u.call(f)}function as(u,f){var x=u.callbacks;if(x!==null)for(u.callbacks=null,u=0;u<x.length;u++)bo(x[u],f)}function Oa(u,f){if(Xr(u,f))return!0;if(typeof u!="object"||u===null||typeof f!="object"||f===null)return!1;var x=Object.keys(u),E=Object.keys(f);if(x.length!==E.length)return!1;for(E=0;E<x.length;E++){var N=x[E];if(!Zu.call(f,N)||!Xr(u[N],f[N]))return!1}return!0}function ss(u){return u=u.status,u==="fulfilled"||u==="rejected"}function bi(){}function ae(u,f,x){switch(x=u[x],x===void 0?u.push(f):x!==f&&(f.then(bi,bi),f=x),f.status){case"fulfilled":return f.value;case"rejected":throw u=f.reason,u===fn?Error(r(483)):u;default:if(typeof f.status=="string")f.then(bi,bi);else{if(u=Mt,u!==null&&100<u.shellSuspendCounter)throw Error(r(482));u=f,u.status="pending",u.then(function(E){if(f.status==="pending"){var N=f;N.status="fulfilled",N.value=E}},function(E){if(f.status==="pending"){var N=f;N.status="rejected",N.reason=E}})}switch(f.status){case"fulfilled":return f.value;case"rejected":throw u=f.reason,u===fn?Error(r(483)):u}throw jo=f,fn}}function we(){if(jo===null)throw Error(r(459));var u=jo;return jo=null,u}function Be(u){var f=ba;return ba+=1,Es===null&&(Es=[]),ae(Es,u,f)}function et(u,f){f=f.props.ref,u.ref=f!==void 0?f:null}function Jt(u,f){throw f.$$typeof===Wh?Error(r(525)):(u=Object.prototype.toString.call(f),Error(r(31,u==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":u)))}function en(u){var f=u._init;return f(u._payload)}function Fe(u){function f(me,ue){if(u){var xe=me.deletions;xe===null?(me.deletions=[ue],me.flags|=16):xe.push(ue)}}function x(me,ue){if(!u)return null;for(;ue!==null;)f(me,ue),ue=ue.sibling;return null}function E(me){for(var ue=new Map;me!==null;)me.key!==null?ue.set(me.key,me):ue.set(me.index,me),me=me.sibling;return ue}function N(me,ue){return me=Wi(me,ue),me.index=0,me.sibling=null,me}function z(me,ue,xe){return me.index=xe,u?(xe=me.alternate,xe!==null?(xe=xe.index,xe<ue?(me.flags|=33554434,ue):xe):(me.flags|=33554434,ue)):(me.flags|=1048576,ue)}function ne(me){return u&&me.alternate===null&&(me.flags|=33554434),me}function ie(me,ue,xe,Ne){return ue===null||ue.tag!==6?(ue=Gl(xe,me.mode,Ne),ue.return=me,ue):(ue=N(ue,xe),ue.return=me,ue)}function de(me,ue,xe,Ne){var We=xe.type;return We===Mc?Oe(me,ue,xe.props.children,Ne,xe.key):ue!==null&&(ue.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===Ha&&en(We)===ue.type)?(ue=N(ue,xe.props),et(ue,xe),ue.return=me,ue):(ue=pa(xe.type,xe.key,xe.props,null,me.mode,Ne),et(ue,xe),ue.return=me,ue)}function Te(me,ue,xe,Ne){return ue===null||ue.tag!==4||ue.stateNode.containerInfo!==xe.containerInfo||ue.stateNode.implementation!==xe.implementation?(ue=Ac(xe,me.mode,Ne),ue.return=me,ue):(ue=N(ue,xe.children||[]),ue.return=me,ue)}function Oe(me,ue,xe,Ne,We){return ue===null||ue.tag!==7?(ue=Ws(xe,me.mode,Ne,We),ue.return=me,ue):(ue=N(ue,xe),ue.return=me,ue)}function je(me,ue,xe){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return ue=Gl(""+ue,me.mode,xe),ue.return=me,ue;if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case $s:return xe=pa(ue.type,ue.key,ue.props,null,me.mode,xe),et(xe,ue),xe.return=me,xe;case ja:return ue=Ac(ue,me.mode,xe),ue.return=me,ue;case Ha:var Ne=ue._init;return ue=Ne(ue._payload),je(me,ue,xe)}if(Vl(ue)||s(ue))return ue=Ws(ue,me.mode,xe,null),ue.return=me,ue;if(typeof ue.then=="function")return je(me,Be(ue),xe);if(ue.$$typeof===ys)return je(me,_u(me,ue),xe);Jt(me,ue)}return null}function Ge(me,ue,xe,Ne){var We=ue!==null?ue.key:null;if(typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint")return We!==null?null:ie(me,ue,""+xe,Ne);if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case $s:return xe.key===We?de(me,ue,xe,Ne):null;case ja:return xe.key===We?Te(me,ue,xe,Ne):null;case Ha:return We=xe._init,xe=We(xe._payload),Ge(me,ue,xe,Ne)}if(Vl(xe)||s(xe))return We!==null?null:Oe(me,ue,xe,Ne,null);if(typeof xe.then=="function")return Ge(me,ue,Be(xe),Ne);if(xe.$$typeof===ys)return Ge(me,ue,_u(me,xe),Ne);Jt(me,xe)}return null}function ht(me,ue,xe,Ne,We){if(typeof Ne=="string"&&Ne!==""||typeof Ne=="number"||typeof Ne=="bigint")return me=me.get(xe)||null,ie(ue,me,""+Ne,We);if(typeof Ne=="object"&&Ne!==null){switch(Ne.$$typeof){case $s:return me=me.get(Ne.key===null?xe:Ne.key)||null,de(ue,me,Ne,We);case ja:return me=me.get(Ne.key===null?xe:Ne.key)||null,Te(ue,me,Ne,We);case Ha:var _n=Ne._init;return Ne=_n(Ne._payload),ht(me,ue,xe,Ne,We)}if(Vl(Ne)||s(Ne))return me=me.get(xe)||null,Oe(ue,me,Ne,We,null);if(typeof Ne.then=="function")return ht(me,ue,xe,Be(Ne),We);if(Ne.$$typeof===ys)return ht(me,ue,xe,_u(ue,Ne),We);Jt(ue,Ne)}return null}function Nr(me,ue,xe,Ne){for(var We=null,_n=null,ct=ue,Yt=ue=0,Si=null;ct!==null&&Yt<xe.length;Yt++){ct.index>Yt?(Si=ct,ct=null):Si=ct.sibling;var Vt=Ge(me,ct,xe[Yt],Ne);if(Vt===null){ct===null&&(ct=Si);break}u&&ct&&Vt.alternate===null&&f(me,ct),ue=z(Vt,ue,Yt),_n===null?We=Vt:_n.sibling=Vt,_n=Vt,ct=Si}if(Yt===xe.length)return x(me,ct),Ft&&q(me,Yt),We;if(ct===null){for(;Yt<xe.length;Yt++)ct=je(me,xe[Yt],Ne),ct!==null&&(ue=z(ct,ue,Yt),_n===null?We=ct:_n.sibling=ct,_n=ct);return Ft&&q(me,Yt),We}for(ct=E(ct);Yt<xe.length;Yt++)Si=ht(ct,me,Yt,xe[Yt],Ne),Si!==null&&(u&&Si.alternate!==null&&ct.delete(Si.key===null?Yt:Si.key),ue=z(Si,ue,Yt),_n===null?We=Si:_n.sibling=Si,_n=Si);return u&&ct.forEach(function(ol){return f(me,ol)}),Ft&&q(me,Yt),We}function ef(me,ue,xe,Ne){if(xe==null)throw Error(r(151));for(var We=null,_n=null,ct=ue,Yt=ue=0,Si=null,Vt=xe.next();ct!==null&&!Vt.done;Yt++,Vt=xe.next()){ct.index>Yt?(Si=ct,ct=null):Si=ct.sibling;var ol=Ge(me,ct,Vt.value,Ne);if(ol===null){ct===null&&(ct=Si);break}u&&ct&&ol.alternate===null&&f(me,ct),ue=z(ol,ue,Yt),_n===null?We=ol:_n.sibling=ol,_n=ol,ct=Si}if(Vt.done)return x(me,ct),Ft&&q(me,Yt),We;if(ct===null){for(;!Vt.done;Yt++,Vt=xe.next())Vt=je(me,Vt.value,Ne),Vt!==null&&(ue=z(Vt,ue,Yt),_n===null?We=Vt:_n.sibling=Vt,_n=Vt);return Ft&&q(me,Yt),We}for(ct=E(ct);!Vt.done;Yt++,Vt=xe.next())Vt=ht(ct,me,Yt,Vt.value,Ne),Vt!==null&&(u&&Vt.alternate!==null&&ct.delete(Vt.key===null?Yt:Vt.key),ue=z(Vt,ue,Yt),_n===null?We=Vt:_n.sibling=Vt,_n=Vt);return u&&ct.forEach(function(Cd){return f(me,Cd)}),Ft&&q(me,Yt),We}function Vo(me,ue,xe,Ne){if(typeof xe=="object"&&xe!==null&&xe.type===Mc&&xe.key===null&&(xe=xe.props.children),typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case $s:e:{for(var We=xe.key;ue!==null;){if(ue.key===We){if(We=xe.type,We===Mc){if(ue.tag===7){x(me,ue.sibling),Ne=N(ue,xe.props.children),Ne.return=me,me=Ne;break e}}else if(ue.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===Ha&&en(We)===ue.type){x(me,ue.sibling),Ne=N(ue,xe.props),et(Ne,xe),Ne.return=me,me=Ne;break e}x(me,ue);break}else f(me,ue);ue=ue.sibling}xe.type===Mc?(Ne=Ws(xe.props.children,me.mode,Ne,xe.key),Ne.return=me,me=Ne):(Ne=pa(xe.type,xe.key,xe.props,null,me.mode,Ne),et(Ne,xe),Ne.return=me,me=Ne)}return ne(me);case ja:e:{for(We=xe.key;ue!==null;){if(ue.key===We)if(ue.tag===4&&ue.stateNode.containerInfo===xe.containerInfo&&ue.stateNode.implementation===xe.implementation){x(me,ue.sibling),Ne=N(ue,xe.children||[]),Ne.return=me,me=Ne;break e}else{x(me,ue);break}else f(me,ue);ue=ue.sibling}Ne=Ac(xe,me.mode,Ne),Ne.return=me,me=Ne}return ne(me);case Ha:return We=xe._init,xe=We(xe._payload),Vo(me,ue,xe,Ne)}if(Vl(xe))return Nr(me,ue,xe,Ne);if(s(xe)){if(We=s(xe),typeof We!="function")throw Error(r(150));return xe=We.call(xe),ef(me,ue,xe,Ne)}if(typeof xe.then=="function")return Vo(me,ue,Be(xe),Ne);if(xe.$$typeof===ys)return Vo(me,ue,_u(me,xe),Ne);Jt(me,xe)}return typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint"?(xe=""+xe,ue!==null&&ue.tag===6?(x(me,ue.sibling),Ne=N(ue,xe),Ne.return=me,me=Ne):(x(me,ue),Ne=Gl(xe,me.mode,Ne),Ne.return=me,me=Ne),ne(me)):x(me,ue)}return function(me,ue,xe,Ne){try{ba=0;var We=Vo(me,ue,xe,Ne);return Es=null,We}catch(ct){if(ct===fn)throw ct;var _n=n(29,ct,null,me.mode);return _n.lanes=Ne,_n.return=me,_n}finally{}}}function Pe(u,f){u=qa,k(Qr,u),k(ws,f),qa=u|f.baseLanes}function tt(){k(Qr,qa),k(ws,ws.current)}function Cn(){qa=Qr.current,w(ws),w(Qr)}function Gt(u){var f=u.alternate;k(ui,ui.current&1),k(Jr,u),xa===null&&(f===null||ws.current!==null||f.memoizedState!==null)&&(xa=u)}function fa(u){if(u.tag===22){if(k(ui,ui.current),k(Jr,u),xa===null){var f=u.alternate;f!==null&&f.memoizedState!==null&&(xa=u)}}else ar()}function ar(){k(ui,ui.current),k(Jr,Jr.current)}function qi(u){w(Jr),xa===u&&(xa=null),w(ui)}function sr(u){for(var f=u;f!==null;){if(f.tag===13){var x=f.memoizedState;if(x!==null&&(x=x.dehydrated,x===null||od(x)||ju(x)))return f}else if(f.tag===19&&f.memoizedProps.revealOrder!==void 0){if((f.flags&128)!==0)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===u)break;for(;f.sibling===null;){if(f.return===null||f.return===u)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}function yt(){throw Error(r(321))}function li(u,f){if(f===null)return!1;for(var x=0;x<f.length&&x<u.length;x++)if(!Xr(u[x],f[x]))return!1;return!0}function Ur(u,f,x,E,N,z){return Ts=z,_t=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,rt.H=u===null||u.memoizedState===null?fi:Qi,nl=!1,z=x(E,N),nl=!1,kn&&(z=El(f,x,E,N)),Us(u),z}function Us(u){rt.H=qt;var f=Zt!==null&&Zt.next!==null;if(Ts=0,ei=Zt=_t=null,va=!1,Vn=0,Hc=null,f)throw Error(r(300));u===null||ti||(u=u.dependencies,u!==null&&kl(u)&&(ti=!0))}function El(u,f,x,E){_t=u;var N=0;do{if(kn&&(Hc=null),Vn=0,kn=!1,25<=N)throw Error(r(301));if(N+=1,ei=Zt=null,u.updateQueue!=null){var z=u.updateQueue;z.lastEffect=null,z.events=null,z.stores=null,z.memoCache!=null&&(z.memoCache.index=0)}rt.H=eo,z=f(x,E)}while(kn);return z}function wl(){var u=rt.H,f=u.useState()[0];return f=typeof f.then=="function"?lr(f):f,u=u.useState()[0],(Zt!==null?Zt.memoizedState:null)!==u&&(_t.flags|=1024),f}function Tl(){var u=Qu!==0;return Qu=0,u}function Da(u,f,x){f.updateQueue=u.updateQueue,f.flags&=-2053,u.lanes&=~x}function Is(u){if(va){for(u=u.memoizedState;u!==null;){var f=u.queue;f!==null&&(f.pending=null),u=u.next}va=!1}Ts=0,ei=Zt=_t=null,kn=!1,Vn=Qu=0,Hc=null}function tn(){var u={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ei===null?_t.memoizedState=ei=u:ei=ei.next=u,ei}function nn(){if(Zt===null){var u=_t.alternate;u=u!==null?u.memoizedState:null}else u=Zt.next;var f=ei===null?_t.memoizedState:ei.next;if(f!==null)ei=f,Zt=u;else{if(u===null)throw _t.alternate===null?Error(r(467)):Error(r(310));Zt=u,u={memoizedState:Zt.memoizedState,baseState:Zt.baseState,baseQueue:Zt.baseQueue,queue:Zt.queue,next:null},ei===null?_t.memoizedState=ei=u:ei=ei.next=u}return ei}function lr(u){var f=Vn;return Vn+=1,Hc===null&&(Hc=[]),u=ae(Hc,u,f),f=_t,(ei===null?f.memoizedState:ei.next)===null&&(f=f.alternate,rt.H=f===null||f.memoizedState===null?fi:Qi),u}function Ir(u){if(u!==null&&typeof u=="object"){if(typeof u.then=="function")return lr(u);if(u.$$typeof===ys)return Bi(u)}throw Error(r(438,String(u)))}function Ln(u){var f=null,x=_t.updateQueue;if(x!==null&&(f=x.memoCache),f==null){var E=_t.alternate;E!==null&&(E=E.updateQueue,E!==null&&(E=E.memoCache,E!=null&&(f={data:E.data.map(function(N){return N.slice()}),index:0})))}if(f==null&&(f={data:[],index:0}),x===null&&(x=xd(),_t.updateQueue=x),x.memoCache=f,x=f.data[f.index],x===void 0)for(x=f.data[f.index]=Array(u),E=0;E<u;E++)x[E]=Rg;return f.index++,x}function xr(u,f){return typeof f=="function"?f(u):f}function da(u){var f=nn();return jr(f,Zt,u)}function jr(u,f,x){var E=u.queue;if(E===null)throw Error(r(311));E.lastRenderedReducer=x;var N=u.baseQueue,z=E.pending;if(z!==null){if(N!==null){var ne=N.next;N.next=z.next,z.next=ne}f.baseQueue=N=z,E.pending=null}if(z=u.baseState,N===null)u.memoizedState=z;else{f=N.next;var ie=ne=null,de=null,Te=f,Oe=!1;do{var je=Te.lane&-536870913;if(je!==Te.lane?(Et&je)===je:(Ts&je)===je){var Ge=Te.revertLane;if(Ge===0)de!==null&&(de=de.next={lane:0,revertLane:0,action:Te.action,hasEagerState:Te.hasEagerState,eagerState:Te.eagerState,next:null}),je===Cr&&(Oe=!0);else if((Ts&Ge)===Ge){Te=Te.next,Ge===Cr&&(Oe=!0);continue}else je={lane:0,revertLane:Te.revertLane,action:Te.action,hasEagerState:Te.hasEagerState,eagerState:Te.eagerState,next:null},de===null?(ie=de=je,ne=z):de=de.next=je,_t.lanes|=Ge,ta|=Ge;je=Te.action,nl&&x(z,je),z=Te.hasEagerState?Te.eagerState:x(z,je)}else Ge={lane:je,revertLane:Te.revertLane,action:Te.action,hasEagerState:Te.hasEagerState,eagerState:Te.eagerState,next:null},de===null?(ie=de=Ge,ne=z):de=de.next=Ge,_t.lanes|=je,ta|=je;Te=Te.next}while(Te!==null&&Te!==f);if(de===null?ne=z:de.next=ie,!Xr(z,u.memoizedState)&&(ti=!0,Oe&&(x=Ql,x!==null)))throw x;u.memoizedState=z,u.baseState=ne,u.baseQueue=de,E.lastRenderedState=z}return N===null&&(E.lanes=0),[u.memoizedState,E.dispatch]}function Me(u){var f=nn(),x=f.queue;if(x===null)throw Error(r(311));x.lastRenderedReducer=u;var E=x.dispatch,N=x.pending,z=f.memoizedState;if(N!==null){x.pending=null;var ne=N=N.next;do z=u(z,ne.action),ne=ne.next;while(ne!==N);Xr(z,f.memoizedState)||(ti=!0),f.memoizedState=z,f.baseQueue===null&&(f.baseState=z),x.lastRenderedState=z}return[z,E]}function Xe(u,f,x){var E=_t,N=nn(),z=Ft;if(z){if(x===void 0)throw Error(r(407));x=x()}else x=f();var ne=!Xr((Zt||N).memoizedState,x);if(ne&&(N.memoizedState=x,ti=!0),N=N.queue,cs(Un.bind(null,E,N,u),[u]),N.getSnapshot!==f||ne||ei!==null&&ei.memoizedState.tag&1){if(E.flags|=2048,Ba(9,Xt.bind(null,E,N,x,f),{destroy:void 0},null),Mt===null)throw Error(r(349));z||(Ts&60)!==0||xt(E,f,x)}return x}function xt(u,f,x){u.flags|=16384,u={getSnapshot:f,value:x},f=_t.updateQueue,f===null?(f=xd(),_t.updateQueue=f,f.stores=[u]):(x=f.stores,x===null?f.stores=[u]:x.push(u))}function Xt(u,f,x,E){f.value=x,f.getSnapshot=E,xi(f)&&Yi(u)}function Un(u,f,x){return x(function(){xi(f)&&Yi(u)})}function xi(u){var f=u.getSnapshot;u=u.value;try{var x=f();return!Xr(u,x)}catch{return!0}}function Yi(u){var f=At(u,2);f!==null&&Ki(f,u,2)}function Ti(u){var f=tn();if(typeof u=="function"){var x=u;if(u=x(),nl){X(!0);try{x()}finally{X(!1)}}}return f.memoizedState=f.baseState=u,f.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xr,lastRenderedState:u},f}function un(u,f,x,E){return u.baseState=x,jr(u,Zt,typeof E=="function"?E:xr)}function or(u,f,x,E,N){if(So(u))throw Error(r(485));if(u=f.action,u!==null){var z={payload:N,action:u,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(ne){z.listeners.push(ne)}};rt.T!==null?x(!0):z.isTransition=!1,E(z),x=f.pending,x===null?(z.next=f.pending=z,xo(f,z)):(z.next=x.next,f.pending=x.next=z)}}function xo(u,f){var x=f.action,E=f.payload,N=u.state;if(f.isTransition){var z=rt.T,ne={};rt.T=ne;try{var ie=x(N,E),de=rt.S;de!==null&&de(ne,ie),ha(u,f,ie)}catch(Te){za(u,f,Te)}finally{rt.T=z}}else try{z=x(N,E),ha(u,f,z)}catch(Te){za(u,f,Te)}}function ha(u,f,x){x!==null&&typeof x=="object"&&typeof x.then=="function"?x.then(function(E){Cl(u,f,E)},function(E){return za(u,f,E)}):Cl(u,f,x)}function Cl(u,f,x){f.status="fulfilled",f.value=x,uc(f),u.state=x,f=u.pending,f!==null&&(x=f.next,x===f?u.pending=null:(x=x.next,f.next=x,xo(u,x)))}function za(u,f,x){var E=u.pending;if(u.pending=null,E!==null){E=E.next;do f.status="rejected",f.reason=x,uc(f),f=f.next;while(f!==E)}u.action=null}function uc(u){u=u.listeners;for(var f=0;f<u.length;f++)(0,u[f])()}function Di(u,f){return f}function ls(u,f){if(Ft){var x=Mt.formState;if(x!==null){e:{var E=_t;if(Ft){if(Hi){var N=Lg(Hi,ya);if(N){Hi=yp(N),E=Ug(N);break e}}ge(E)}E=!1}E&&(f=x[0])}}x=tn(),x.memoizedState=x.baseState=f,E={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:f},x.queue=E,x=Nf.bind(null,_t,E),E.dispatch=x,E=Ti(!1);var z=kf.bind(null,_t,!1,E.queue);return E=tn(),N={state:f,dispatch:null,action:u,pending:null},E.queue=N,x=or.bind(null,_t,N,z,x),N.dispatch=x,E.memoizedState=u,[f,x,!1]}function os(u){var f=nn();return js(f,Zt,u)}function js(u,f,x){f=jr(u,f,Di)[0],u=da(xr)[0],f=typeof f=="object"&&f!==null&&typeof f.then=="function"?lr(f):f;var E=nn(),N=E.queue,z=N.dispatch;return x!==E.memoizedState&&(_t.flags|=2048,Ba(9,oi.bind(null,N,x),{destroy:void 0},null)),[f,z,u]}function oi(u,f){u.action=f}function du(u){var f=nn(),x=Zt;if(x!==null)return js(f,x,u);nn(),f=f.memoizedState,x=nn();var E=x.queue.dispatch;return x.memoizedState=u,[f,E,!1]}function Ba(u,f,x,E){return u={tag:u,create:f,inst:x,deps:E,next:null},f=_t.updateQueue,f===null&&(f=xd(),_t.updateQueue=f),x=f.lastEffect,x===null?f.lastEffect=u.next=u:(E=x.next,x.next=u,u.next=E,f.lastEffect=u),u}function it(){return nn().memoizedState}function vo(u,f,x,E){var N=tn();_t.flags|=u,N.memoizedState=Ba(1|f,x,{destroy:void 0},E===void 0?null:E)}function jn(u,f,x,E){var N=nn();E=E===void 0?null:E;var z=N.memoizedState.inst;Zt!==null&&E!==null&&li(E,Zt.memoizedState.deps)?N.memoizedState=Ba(f,x,z,E):(_t.flags|=u,N.memoizedState=Ba(1|f,x,z,E))}function rn(u,f){vo(8390656,8,u,f)}function cs(u,f){jn(2048,8,u,f)}function us(u,f){return jn(4,2,u,f)}function fc(u,f){return jn(4,4,u,f)}function Hs(u,f){if(typeof f=="function"){u=u();var x=f(u);return function(){typeof x=="function"?x():f(null)}}if(f!=null)return u=u(),f.current=u,function(){f.current=null}}function ze(u,f,x){x=x!=null?x.concat([u]):null,jn(4,4,Hs.bind(null,f,u),x)}function qe(){}function mt(u,f){var x=nn();f=f===void 0?null:f;var E=x.memoizedState;return f!==null&&li(f,E[1])?E[0]:(x.memoizedState=[u,f],u)}function Nt(u,f){var x=nn();f=f===void 0?null:f;var E=x.memoizedState;if(f!==null&&li(f,E[1]))return E[0];if(E=u(),nl){X(!0);try{u()}finally{X(!1)}}return x.memoizedState=[E,f],E}function An(u,f,x){return x===void 0||(Ts&1073741824)!==0?u.memoizedState=f:(u.memoizedState=x,u=hs(),_t.lanes|=u,ta|=u,x)}function Hr(u,f,x,E){return Xr(x,f)?x:ws.current!==null?(u=An(u,x,E),Xr(u,f)||(ti=!0),u):(Ts&42)===0?(ti=!0,u.memoizedState=x):(u=hs(),_t.lanes|=u,ta|=u,f)}function dc(u,f,x,E,N){var z=vi();$i(z!==0&&8>z?z:8);var ne=rt.T,ie={};rt.T=ie,kf(u,!1,f,x);try{var de=N(),Te=rt.S;if(Te!==null&&Te(ie,de),de!==null&&typeof de=="object"&&typeof de.then=="function"){var Oe=kt(de,E);Ml(u,f,Oe,fr(u))}else Ml(u,f,E,fr(u))}catch(je){Ml(u,f,{then:function(){},status:"rejected",reason:je},fr())}finally{$i(z),rt.T=ne}}function hu(u){var f=u.memoizedState;if(f!==null)return f;f={memoizedState:Er,baseState:Er,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xr,lastRenderedState:Er},next:null};var x={};return f.next={memoizedState:x,baseState:x,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xr,lastRenderedState:x},next:null},u.memoizedState=f,u=u.alternate,u!==null&&(u.memoizedState=f),f}function _o(){return Bi(ot)}function fs(){return nn().memoizedState}function Rf(){return nn().memoizedState}function pu(u){for(var f=u.return;f!==null;){switch(f.tag){case 24:case 3:var x=fr();u=xn(x);var E=$t(f,u,x);E!==null&&(Ki(E,f,x),Gn(E,f,x)),f={cache:Lf()},u.payload=f;return}f=f.return}}function Al(u,f,x){var E=fr();x={lane:E,revertLane:0,action:x,hasEagerState:!1,eagerState:null,next:null},So(u)?mu(f,x):(x=He(u,f,x,E),x!==null&&(Ki(x,u,E),Eh(x,f,E)))}function Nf(u,f,x){var E=fr();Ml(u,f,x,E)}function Ml(u,f,x,E){var N={lane:E,revertLane:0,action:x,hasEagerState:!1,eagerState:null,next:null};if(So(u))mu(f,N);else{var z=u.alternate;if(u.lanes===0&&(z===null||z.lanes===0)&&(z=f.lastRenderedReducer,z!==null))try{var ne=f.lastRenderedState,ie=z(ne,x);if(N.hasEagerState=!0,N.eagerState=ie,Xr(ie,ne))return ut(u,f,N,0),Mt===null&&Ve(),!1}catch{}finally{}if(x=He(u,f,N,E),x!==null)return Ki(x,u,E),Eh(x,f,E),!0}return!1}function kf(u,f,x,E){if(E={lane:2,revertLane:ke(),action:E,hasEagerState:!1,eagerState:null,next:null},So(u)){if(f)throw Error(r(479))}else f=He(u,x,E,2),f!==null&&Ki(f,u,2)}function So(u){var f=u.alternate;return u===_t||f!==null&&f===_t}function mu(u,f){kn=va=!0;var x=u.pending;x===null?f.next=f:(f.next=x.next,x.next=f),u.pending=f}function Eh(u,f,x){if((x&4194176)!==0){var E=f.lanes;E&=u.pendingLanes,x|=E,f.lanes=x,H(u,x)}}function Vi(u,f,x,E){f=u.memoizedState,x=x(E,f),x=x==null?f:Oo({},f,x),u.memoizedState=x,u.lanes===0&&(u.updateQueue.baseState=x)}function Rl(u,f,x,E,N,z,ne){return u=u.stateNode,typeof u.shouldComponentUpdate=="function"?u.shouldComponentUpdate(E,z,ne):f.prototype&&f.prototype.isPureReactComponent?!Oa(x,E)||!Oa(N,z):!0}function gu(u,f,x,E){u=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(x,E),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(x,E),f.state!==u&&vd.enqueueReplaceState(f,f.state,null)}function La(u,f){var x=f;if("ref"in f){x={};for(var E in f)E!=="ref"&&(x[E]=f[E])}if(u=u.defaultProps){x===f&&(x=Oo({},x));for(var N in u)x[N]===void 0&&(x[N]=u[N])}return x}function Of(u,f){try{var x=u.onUncaughtError;x(f.value,{componentStack:f.stack})}catch(E){setTimeout(function(){throw E})}}function Df(u,f,x){try{var E=u.onCaughtError;E(x.value,{componentStack:x.stack,errorBoundary:f.tag===1?f.stateNode:null})}catch(N){setTimeout(function(){throw N})}}function yu(u,f,x){return x=xn(x),x.tag=3,x.payload={element:null},x.callback=function(){Of(u,f)},x}function hc(u){return u=xn(u),u.tag=3,u}function bu(u,f,x,E){var N=x.type.getDerivedStateFromError;if(typeof N=="function"){var z=E.value;u.payload=function(){return N(z)},u.callback=function(){Df(f,x,E)}}var ne=x.stateNode;ne!==null&&typeof ne.componentDidCatch=="function"&&(u.callback=function(){Df(f,x,E),typeof N!="function"&&(ia===null?ia=new Set([this]):ia.add(this));var ie=E.stack;this.componentDidCatch(E.value,{componentStack:ie!==null?ie:""})})}function sg(u,f,x,E,N){if(x.flags|=32768,E!==null&&typeof E=="object"&&typeof E.then=="function"){if(f=x.alternate,f!==null&&Eo(f,x,N,!0),x=Jr.current,x!==null){switch(x.tag){case 13:return xa===null?Sr():x.alternate===null&&It===0&&(It=3),x.flags&=-257,x.flags|=65536,x.lanes=N,E===bd?x.flags|=16384:(f=x.updateQueue,f===null?x.updateQueue=new Set([E]):f.add(E),$f(u,E,N)),!1;case 22:return x.flags|=65536,E===bd?x.flags|=16384:(f=x.updateQueue,f===null?(f={transitions:null,markerInstances:null,retryQueue:new Set([E])},x.updateQueue=f):(x=f.retryQueue,x===null?f.retryQueue=new Set([E]):x.add(E)),$f(u,E,N)),!1}throw Error(r(435,x.tag))}return $f(u,E,N),Sr(),!1}if(Ft)return f=Jr.current,f!==null?((f.flags&65536)===0&&(f.flags|=256),f.flags|=65536,f.lanes=N,E!==Xu&&(u=Error(r(422),{cause:E}),Le(Q(u,x)))):(E!==Xu&&(f=Error(r(423),{cause:E}),Le(Q(f,x))),u=u.current.alternate,u.flags|=65536,N&=-N,u.lanes|=N,E=Q(E,x),N=yu(u.stateNode,E,N),Pt(u,N),It!==4&&(It=2)),!1;var z=Error(r(520),{cause:E});if(z=Q(z,x),Gc===null?Gc=[z]:Gc.push(z),It!==4&&(It=2),f===null)return!0;E=Q(E,x),x=f;do{switch(x.tag){case 3:return x.flags|=65536,u=N&-N,x.lanes|=u,u=yu(x.stateNode,E,u),Pt(x,u),!1;case 1:if(f=x.type,z=x.stateNode,(x.flags&128)===0&&(typeof f.getDerivedStateFromError=="function"||z!==null&&typeof z.componentDidCatch=="function"&&(ia===null||!ia.has(z))))return x.flags|=65536,N&=-N,x.lanes|=N,N=hc(N),bu(N,u,x,E),Pt(x,N),!1}x=x.return}while(x!==null);return!1}function zi(u,f,x,E){f.child=u===null?Op(f,null,x,E):Jl(f,u.child,x,E)}function lg(u,f,x,E,N){x=x.render;var z=f.ref;if("ref"in E){var ne={};for(var ie in E)ie!=="ref"&&(ne[ie]=E[ie])}else ne=E;return wo(f),E=Ur(u,f,x,ne,z,N),ie=Tl(),u!==null&&!ti?(Da(u,f,N),Ps(u,f,N)):(Ft&&ie&&ee(f),f.flags|=1,zi(u,f,E,N),f.child)}function og(u,f,x,E,N){if(u===null){var z=x.type;return typeof z=="function"&&!Xs(z)&&z.defaultProps===void 0&&x.compare===null?(f.tag=15,f.type=z,zf(u,f,z,E,N)):(u=pa(x.type,null,E,f,f.mode,N),u.ref=f.ref,u.return=f,f.child=u)}if(z=u.child,!Nh(u,N)){var ne=z.memoizedProps;if(x=x.compare,x=x!==null?x:Oa,x(ne,E)&&u.ref===f.ref)return Ps(u,f,N)}return f.flags|=1,u=Wi(z,E),u.ref=f.ref,u.return=f,f.child=u}function zf(u,f,x,E,N){if(u!==null){var z=u.memoizedProps;if(Oa(z,E)&&u.ref===f.ref)if(ti=!1,f.pendingProps=E=z,Nh(u,N))(u.flags&131072)!==0&&(ti=!0);else return f.lanes=u.lanes,Ps(u,f,N)}return wh(u,f,x,E,N)}function cg(u,f,x){var E=f.pendingProps,N=E.children,z=(f.stateNode._pendingVisibility&2)!==0,ne=u!==null?u.memoizedState:null;if(xu(u,f),E.mode==="hidden"||z){if((f.flags&128)!==0){if(E=ne!==null?ne.baseLanes|x:x,u!==null){for(N=f.child=u.child,z=0;N!==null;)z=z|N.lanes|N.childLanes,N=N.sibling;f.childLanes=z&~E}else f.childLanes=0,f.child=null;return ug(u,f,E,x)}if((x&536870912)!==0)f.memoizedState={baseLanes:0,cachePool:null},u!==null&&Uf(f,ne!==null?ne.cachePool:null),ne!==null?Pe(f,ne):tt(),fa(f);else return f.lanes=f.childLanes=536870912,ug(u,f,ne!==null?ne.baseLanes|x:x,x)}else ne!==null?(Uf(f,ne.cachePool),Pe(f,ne),ar(),f.memoizedState=null):(u!==null&&Uf(f,null),tt(),ar());return zi(u,f,N,x),f.child}function ug(u,f,x,E){var N=Ol();return N=N===null?null:{parent:xs?an._currentValue:an._currentValue2,pool:N},f.memoizedState={baseLanes:x,cachePool:N},u!==null&&Uf(f,null),tt(),fa(f),u!==null&&Eo(u,f,E,!0),null}function xu(u,f){var x=f.ref;if(x===null)u!==null&&u.ref!==null&&(f.flags|=2097664);else{if(typeof x!="function"&&typeof x!="object")throw Error(r(284));(u===null||u.ref!==x)&&(f.flags|=2097664)}}function wh(u,f,x,E,N){return wo(f),x=Ur(u,f,x,E,void 0,N),E=Tl(),u!==null&&!ti?(Da(u,f,N),Ps(u,f,N)):(Ft&&E&&ee(f),f.flags|=1,zi(u,f,x,N),f.child)}function fg(u,f,x,E,N,z){return wo(f),f.updateQueue=null,x=El(f,E,x,N),Us(u),E=Tl(),u!==null&&!ti?(Da(u,f,z),Ps(u,f,z)):(Ft&&E&&ee(f),f.flags|=1,zi(u,f,x,z),f.child)}function Th(u,f,x,E,N){if(wo(f),f.stateNode===null){var z=Uo,ne=x.contextType;typeof ne=="object"&&ne!==null&&(z=Bi(ne)),z=new x(E,z),f.memoizedState=z.state!==null&&z.state!==void 0?z.state:null,z.updater=vd,f.stateNode=z,z._reactInternals=f,z=f.stateNode,z.props=E,z.state=f.memoizedState,z.refs={},yi(f),ne=x.contextType,z.context=typeof ne=="object"&&ne!==null?Bi(ne):Uo,z.state=f.memoizedState,ne=x.getDerivedStateFromProps,typeof ne=="function"&&(Vi(f,x,ne,E),z.state=f.memoizedState),typeof x.getDerivedStateFromProps=="function"||typeof z.getSnapshotBeforeUpdate=="function"||typeof z.UNSAFE_componentWillMount!="function"&&typeof z.componentWillMount!="function"||(ne=z.state,typeof z.componentWillMount=="function"&&z.componentWillMount(),typeof z.UNSAFE_componentWillMount=="function"&&z.UNSAFE_componentWillMount(),ne!==z.state&&vd.enqueueReplaceState(z,z.state,null),Qn(f,E,z,N),Fi(),z.state=f.memoizedState),typeof z.componentDidMount=="function"&&(f.flags|=4194308),E=!0}else if(u===null){z=f.stateNode;var ie=f.memoizedProps,de=La(x,ie);z.props=de;var Te=z.context,Oe=x.contextType;ne=Uo,typeof Oe=="object"&&Oe!==null&&(ne=Bi(Oe));var je=x.getDerivedStateFromProps;Oe=typeof je=="function"||typeof z.getSnapshotBeforeUpdate=="function",ie=f.pendingProps!==ie,Oe||typeof z.UNSAFE_componentWillReceiveProps!="function"&&typeof z.componentWillReceiveProps!="function"||(ie||Te!==ne)&&gu(f,z,E,ne),tl=!1;var Ge=f.memoizedState;z.state=Ge,Qn(f,E,z,N),Fi(),Te=f.memoizedState,ie||Ge!==Te||tl?(typeof je=="function"&&(Vi(f,x,je,E),Te=f.memoizedState),(de=tl||Rl(f,x,de,E,Ge,Te,ne))?(Oe||typeof z.UNSAFE_componentWillMount!="function"&&typeof z.componentWillMount!="function"||(typeof z.componentWillMount=="function"&&z.componentWillMount(),typeof z.UNSAFE_componentWillMount=="function"&&z.UNSAFE_componentWillMount()),typeof z.componentDidMount=="function"&&(f.flags|=4194308)):(typeof z.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=E,f.memoizedState=Te),z.props=E,z.state=Te,z.context=ne,E=de):(typeof z.componentDidMount=="function"&&(f.flags|=4194308),E=!1)}else{z=f.stateNode,rr(u,f),ne=f.memoizedProps,Oe=La(x,ne),z.props=Oe,je=f.pendingProps,Ge=z.context,Te=x.contextType,de=Uo,typeof Te=="object"&&Te!==null&&(de=Bi(Te)),ie=x.getDerivedStateFromProps,(Te=typeof ie=="function"||typeof z.getSnapshotBeforeUpdate=="function")||typeof z.UNSAFE_componentWillReceiveProps!="function"&&typeof z.componentWillReceiveProps!="function"||(ne!==je||Ge!==de)&&gu(f,z,E,de),tl=!1,Ge=f.memoizedState,z.state=Ge,Qn(f,E,z,N),Fi();var ht=f.memoizedState;ne!==je||Ge!==ht||tl||u!==null&&u.dependencies!==null&&kl(u.dependencies)?(typeof ie=="function"&&(Vi(f,x,ie,E),ht=f.memoizedState),(Oe=tl||Rl(f,x,Oe,E,Ge,ht,de)||u!==null&&u.dependencies!==null&&kl(u.dependencies))?(Te||typeof z.UNSAFE_componentWillUpdate!="function"&&typeof z.componentWillUpdate!="function"||(typeof z.componentWillUpdate=="function"&&z.componentWillUpdate(E,ht,de),typeof z.UNSAFE_componentWillUpdate=="function"&&z.UNSAFE_componentWillUpdate(E,ht,de)),typeof z.componentDidUpdate=="function"&&(f.flags|=4),typeof z.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof z.componentDidUpdate!="function"||ne===u.memoizedProps&&Ge===u.memoizedState||(f.flags|=4),typeof z.getSnapshotBeforeUpdate!="function"||ne===u.memoizedProps&&Ge===u.memoizedState||(f.flags|=1024),f.memoizedProps=E,f.memoizedState=ht),z.props=E,z.state=ht,z.context=de,E=Oe):(typeof z.componentDidUpdate!="function"||ne===u.memoizedProps&&Ge===u.memoizedState||(f.flags|=4),typeof z.getSnapshotBeforeUpdate!="function"||ne===u.memoizedProps&&Ge===u.memoizedState||(f.flags|=1024),E=!1)}return z=E,xu(u,f),E=(f.flags&128)!==0,z||E?(z=f.stateNode,x=E&&typeof x.getDerivedStateFromError!="function"?null:z.render(),f.flags|=1,u!==null&&E?(f.child=Jl(f,u.child,null,N),f.child=Jl(f,null,x,N)):zi(u,f,x,N),f.memoizedState=z.state,u=f.child):u=Ps(u,f,N),u}function dg(u,f,x,E){return Ue(),f.flags|=256,zi(u,f,x,E),f.child}function Ch(u){return{baseLanes:u,cachePool:yg()}}function Ah(u,f,x){return u=u!==null?u.childLanes&~x:0,f&&(u|=Rr),u}function hg(u,f,x){var E=f.pendingProps,N=!1,z=(f.flags&128)!==0,ne;if((ne=z)||(ne=u!==null&&u.memoizedState===null?!1:(ui.current&2)!==0),ne&&(N=!0,f.flags&=-129),ne=(f.flags&32)!==0,f.flags&=-33,u===null){if(Ft){if(N?Gt(f):ar(),Ft){var ie=Hi,de;(de=ie)&&(ie=Gg(ie,ya),ie!==null?(f.memoizedState={dehydrated:ie,treeContext:Pa!==null?{id:Ss,overflow:ga}:null,retryLane:536870912},de=n(18,null,null,0),de.stateNode=ie,de.return=f,f.child=de,Zi=f,Hi=null,de=!0):de=!1),de||ge(f)}if(ie=f.memoizedState,ie!==null&&(ie=ie.dehydrated,ie!==null))return ju(ie)?f.lanes=16:f.lanes=536870912,null;qi(f)}return ie=E.children,E=E.fallback,N?(ar(),N=f.mode,ie=Mh({mode:"hidden",children:ie},N),E=Ws(E,N,x,null),ie.return=f,E.return=f,ie.sibling=E,f.child=ie,N=f.child,N.memoizedState=Ch(x),N.childLanes=Ah(u,ne,x),f.memoizedState=Ji,E):(Gt(f),vu(f,ie))}if(de=u.memoizedState,de!==null&&(ie=de.dehydrated,ie!==null)){if(z)f.flags&256?(Gt(f),f.flags&=-257,f=Rh(u,f,x)):f.memoizedState!==null?(ar(),f.child=u.child,f.flags|=128,f=null):(ar(),N=E.fallback,ie=f.mode,E=Mh({mode:"visible",children:E.children},ie),N=Ws(N,ie,x,null),N.flags|=2,E.return=f,N.return=f,E.sibling=N,f.child=E,Jl(f,u.child,null,x),E=f.child,E.memoizedState=Ch(x),E.childLanes=Ah(u,ne,x),f.memoizedState=Ji,f=N);else if(Gt(f),ju(ie))ne=Bg(ie).digest,E=Error(r(419)),E.stack="",E.digest=ne,Le({value:E,source:null,stack:null}),f=Rh(u,f,x);else if(ti||Eo(u,f,x,!1),ne=(x&u.childLanes)!==0,ti||ne){if(ne=Mt,ne!==null){if(E=x&-x,(E&42)!==0)E=1;else switch(E){case 2:E=1;break;case 8:E=4;break;case 32:E=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:E=64;break;case 268435456:E=134217728;break;default:E=0}if(E=(E&(ne.suspendedLanes|x))!==0?0:E,E!==0&&E!==de.retryLane)throw de.retryLane=E,At(u,E),Ki(ne,u,E),iy}od(ie)||Sr(),f=Rh(u,f,x)}else od(ie)?(f.flags|=128,f.child=u.child,f=No.bind(null,u),Tb(ie,f),f=null):(u=de.treeContext,dr&&(Hi=jg(ie),Zi=f,Ft=!0,$r=null,ya=!1,u!==null&&(Kr[Wr++]=Ss,Kr[Wr++]=ga,Kr[Wr++]=Pa,Ss=u.id,ga=u.overflow,Pa=f)),f=vu(f,E.children),f.flags|=4096);return f}return N?(ar(),N=E.fallback,ie=f.mode,de=u.child,z=de.sibling,E=Wi(de,{mode:"hidden",children:E.children}),E.subtreeFlags=de.subtreeFlags&31457280,z!==null?N=Wi(z,N):(N=Ws(N,ie,x,null),N.flags|=2),N.return=f,E.return=f,E.sibling=N,f.child=E,E=N,N=f.child,ie=u.child.memoizedState,ie===null?ie=Ch(x):(de=ie.cachePool,de!==null?(z=xs?an._currentValue:an._currentValue2,de=de.parent!==z?{parent:z,pool:z}:de):de=yg(),ie={baseLanes:ie.baseLanes|x,cachePool:de}),N.memoizedState=ie,N.childLanes=Ah(u,ne,x),f.memoizedState=Ji,E):(Gt(f),x=u.child,u=x.sibling,x=Wi(x,{mode:"visible",children:E.children}),x.return=f,x.sibling=null,u!==null&&(ne=f.deletions,ne===null?(f.deletions=[u],f.flags|=16):ne.push(u)),f.child=x,f.memoizedState=null,x)}function vu(u,f){return f=Mh({mode:"visible",children:f},u.mode),f.return=u,u.child=f}function Mh(u,f){return Zf(u,f,0,null)}function Rh(u,f,x){return Jl(f,u.child,null,x),u=vu(f,f.pendingProps.children),u.flags|=2,f.memoizedState=null,u}function pg(u,f,x){u.lanes|=f;var E=u.alternate;E!==null&&(E.lanes|=f),kh(u.return,f,x)}function Bf(u,f,x,E,N){var z=u.memoizedState;z===null?u.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:E,tail:x,tailMode:N}:(z.isBackwards=f,z.rendering=null,z.renderingStartTime=0,z.last=E,z.tail=x,z.tailMode=N)}function mg(u,f,x){var E=f.pendingProps,N=E.revealOrder,z=E.tail;if(zi(u,f,E.children,x),E=ui.current,(E&2)!==0)E=E&1|2,f.flags|=128;else{if(u!==null&&(u.flags&128)!==0)e:for(u=f.child;u!==null;){if(u.tag===13)u.memoizedState!==null&&pg(u,x,f);else if(u.tag===19)pg(u,x,f);else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===f)break e;for(;u.sibling===null;){if(u.return===null||u.return===f)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}E&=1}switch(k(ui,E),N){case"forwards":for(x=f.child,N=null;x!==null;)u=x.alternate,u!==null&&sr(u)===null&&(N=x),x=x.sibling;x=N,x===null?(N=f.child,f.child=null):(N=x.sibling,x.sibling=null),Bf(f,!1,N,x,z);break;case"backwards":for(x=null,N=f.child,f.child=null;N!==null;){if(u=N.alternate,u!==null&&sr(u)===null){f.child=N;break}u=N.sibling,N.sibling=x,x=N,N=u}Bf(f,!0,x,null,z);break;case"together":Bf(f,!1,null,null,void 0);break;default:f.memoizedState=null}return f.child}function Ps(u,f,x){if(u!==null&&(f.dependencies=u.dependencies),ta|=f.lanes,(x&f.childLanes)===0)if(u!==null){if(Eo(u,f,x,!1),(x&f.childLanes)===0)return null}else return null;if(u!==null&&f.child!==u.child)throw Error(r(153));if(f.child!==null){for(u=f.child,x=Wi(u,u.pendingProps),f.child=x,x.return=f;u.sibling!==null;)u=u.sibling,x=x.sibling=Wi(u,u.pendingProps),x.return=f;x.sibling=null}return f.child}function Nh(u,f){return(u.lanes&f)!==0?!0:(u=u.dependencies,!!(u!==null&&kl(u)))}function Sb(u,f,x){switch(f.tag){case 3:oe(f,f.stateNode.containerInfo),Nl(f,an,u.memoizedState.cache),Ue();break;case 27:case 5:ve(f);break;case 4:oe(f,f.stateNode.containerInfo);break;case 10:Nl(f,f.type,f.memoizedProps.value);break;case 13:var E=f.memoizedState;if(E!==null)return E.dehydrated!==null?(Gt(f),f.flags|=128,null):(x&f.child.childLanes)!==0?hg(u,f,x):(Gt(f),u=Ps(u,f,x),u!==null?u.sibling:null);Gt(f);break;case 19:var N=(u.flags&128)!==0;if(E=(x&f.childLanes)!==0,E||(Eo(u,f,x,!1),E=(x&f.childLanes)!==0),N){if(E)return mg(u,f,x);f.flags|=128}if(N=f.memoizedState,N!==null&&(N.rendering=null,N.tail=null,N.lastEffect=null),k(ui,ui.current),E)break;return null;case 22:case 23:return f.lanes=0,cg(u,f,x);case 24:Nl(f,an,u.memoizedState.cache)}return Ps(u,f,x)}function gg(u,f,x){if(u!==null)if(u.memoizedProps!==f.pendingProps)ti=!0;else{if(!Nh(u,x)&&(f.flags&128)===0)return ti=!1,Sb(u,f,x);ti=(u.flags&131072)!==0}else ti=!1,Ft&&(f.flags&1048576)!==0&&Y(f,Yu,f.index);switch(f.lanes=0,f.tag){case 16:e:{u=f.pendingProps;var E=f.elementType,N=E._init;if(E=N(E._payload),f.type=E,typeof E=="function")Xs(E)?(u=La(E,u),f.tag=1,f=Th(null,f,E,u,x)):(f.tag=0,f=wh(null,f,E,u,x));else{if(E!=null){if(N=E.$$typeof,N===Rc){f.tag=11,f=lg(null,f,E,u,x);break e}else if(N===ku){f.tag=14,f=og(null,f,E,u,x);break e}}throw f=l(E)||E,Error(r(306,f,""))}}return f;case 0:return wh(u,f,f.type,f.pendingProps,x);case 1:return E=f.type,N=La(E,f.pendingProps),Th(u,f,E,N,x);case 3:e:{if(oe(f,f.stateNode.containerInfo),u===null)throw Error(r(387));var z=f.pendingProps;N=f.memoizedState,E=N.element,rr(u,f),Qn(f,z,null,x);var ne=f.memoizedState;if(z=ne.cache,Nl(f,an,z),z!==N.cache&&Oh(f,[an],x,!0),Fi(),z=ne.element,dr&&N.isDehydrated)if(N={element:z,isDehydrated:!1,cache:ne.cache},f.updateQueue.baseState=N,f.memoizedState=N,f.flags&256){f=dg(u,f,z,x);break e}else if(z!==E){E=Q(Error(r(424)),f),Le(E),f=dg(u,f,z,x);break e}else for(dr&&(Hi=Ig(f.stateNode.containerInfo),Zi=f,Ft=!0,$r=null,ya=!0),x=Op(f,null,z,x),f.child=x;x;)x.flags=x.flags&-3|4096,x=x.sibling;else{if(Ue(),z===E){f=Ps(u,f,x);break e}zi(u,f,z,x)}f=f.child}return f;case 26:if(Vr)return xu(u,f),u===null?(x=hd(f.type,null,f.pendingProps,null))?f.memoizedState=x:Ft||(f.stateNode=Ab(f.type,f.pendingProps,Ga.current,f)):f.memoizedState=hd(f.type,u.memoizedProps,f.pendingProps,u.memoizedState),null;case 27:if(Ii)return ve(f),u===null&&Ii&&Ft&&(E=f.stateNode=Mp(f.type,f.pendingProps,Ga.current,Ni.current,!1),Zi=f,ya=!0,Hi=cd(E)),E=f.pendingProps.children,u!==null||Ft?zi(u,f,E,x):f.child=Jl(f,null,E,x),xu(u,f),f.child;case 5:return u===null&&Ft&&(Xg(f.type,f.pendingProps,Ni.current),(N=E=Hi)&&(E=Hg(E,f.type,f.pendingProps,ya),E!==null?(f.stateNode=E,Zi=f,Hi=cd(E),ya=!1,N=!0):N=!1),N||ge(f)),ve(f),N=f.type,z=f.pendingProps,ne=u!==null?u.memoizedProps:null,E=z.children,Kl(N,z)?E=null:ne!==null&&Kl(N,ne)&&(f.flags|=32),f.memoizedState!==null&&(N=Ur(u,f,wl,null,null,x),xs?ot._currentValue=N:ot._currentValue2=N),xu(u,f),zi(u,f,E,x),f.child;case 6:return u===null&&Ft&&(Kg(f.pendingProps,Ni.current),(u=x=Hi)&&(x=Pg(x,f.pendingProps,ya),x!==null?(f.stateNode=x,Zi=f,Hi=null,u=!0):u=!1),u||ge(f)),null;case 13:return hg(u,f,x);case 4:return oe(f,f.stateNode.containerInfo),E=f.pendingProps,u===null?f.child=Jl(f,null,E,x):zi(u,f,E,x),f.child;case 11:return lg(u,f,f.type,f.pendingProps,x);case 7:return zi(u,f,f.pendingProps,x),f.child;case 8:return zi(u,f,f.pendingProps.children,x),f.child;case 12:return zi(u,f,f.pendingProps.children,x),f.child;case 10:return E=f.pendingProps,Nl(f,f.type,E.value),zi(u,f,E.children,x),f.child;case 9:return N=f.type._context,E=f.pendingProps.children,wo(f),N=Bi(N),E=E(N),f.flags|=1,zi(u,f,E,x),f.child;case 14:return og(u,f,f.type,f.pendingProps,x);case 15:return zf(u,f,f.type,f.pendingProps,x);case 19:return mg(u,f,x);case 22:return cg(u,f,x);case 24:return wo(f),E=Bi(an),u===null?(N=Ol(),N===null&&(N=Mt,z=Lf(),N.pooledCache=z,z.refCount++,z!==null&&(N.pooledCacheLanes|=x),N=z),f.memoizedState={parent:E,cache:N},yi(f),Nl(f,an,N)):((u.lanes&x)!==0&&(rr(u,f),Qn(f,null,null,x),Fi()),N=u.memoizedState,z=f.memoizedState,N.parent!==E?(N={parent:E,cache:E},f.memoizedState=N,f.lanes===0&&(f.memoizedState=f.updateQueue.baseState=N),Nl(f,an,E)):(E=z.cache,Nl(f,an,E),E!==N.cache&&Oh(f,[an],x,!0))),zi(u,f,f.pendingProps.children,x),f.child;case 29:throw f.pendingProps}throw Error(r(156,f.tag))}function Nl(u,f,x){xs?(k(Ar,f._currentValue),f._currentValue=x):(k(Ar,f._currentValue2),f._currentValue2=x)}function Gs(u){var f=Ar.current;xs?u._currentValue=f:u._currentValue2=f,w(Ar)}function kh(u,f,x){for(;u!==null;){var E=u.alternate;if((u.childLanes&f)!==f?(u.childLanes|=f,E!==null&&(E.childLanes|=f)):E!==null&&(E.childLanes&f)!==f&&(E.childLanes|=f),u===x)break;u=u.return}}function Oh(u,f,x,E){var N=u.child;for(N!==null&&(N.return=u);N!==null;){var z=N.dependencies;if(z!==null){var ne=N.child;z=z.firstContext;e:for(;z!==null;){var ie=z;z=N;for(var de=0;de<f.length;de++)if(ie.context===f[de]){z.lanes|=x,ie=z.alternate,ie!==null&&(ie.lanes|=x),kh(z.return,x,u),E||(ne=null);break e}z=ie.next}}else if(N.tag===18){if(ne=N.return,ne===null)throw Error(r(341));ne.lanes|=x,z=ne.alternate,z!==null&&(z.lanes|=x),kh(ne,x,u),ne=null}else ne=N.child;if(ne!==null)ne.return=N;else for(ne=N;ne!==null;){if(ne===u){ne=null;break}if(N=ne.sibling,N!==null){N.return=ne.return,ne=N;break}ne=ne.return}N=ne}}function Eo(u,f,x,E){u=null;for(var N=f,z=!1;N!==null;){if(!z){if((N.flags&524288)!==0)z=!0;else if((N.flags&262144)!==0)break}if(N.tag===10){var ne=N.alternate;if(ne===null)throw Error(r(387));if(ne=ne.memoizedProps,ne!==null){var ie=N.type;Xr(N.pendingProps.value,ne.value)||(u!==null?u.push(ie):u=[ie])}}else if(N===Lc.current){if(ne=N.alternate,ne===null)throw Error(r(387));ne.memoizedState.memoizedState!==N.memoizedState.memoizedState&&(u!==null?u.push(ot):u=[ot])}N=N.return}u!==null&&Oh(f,u,x,E),f.flags|=262144}function kl(u){for(u=u.firstContext;u!==null;){var f=u.context;if(!Xr(xs?f._currentValue:f._currentValue2,u.memoizedValue))return!0;u=u.next}return!1}function wo(u){to=u,Xn=null,u=u.dependencies,u!==null&&(u.firstContext=null)}function Bi(u){return Dh(to,u)}function _u(u,f){return to===null&&wo(u),Dh(u,f)}function Dh(u,f){var x=xs?f._currentValue:f._currentValue2;if(f={context:f,memoizedValue:x,next:null},Xn===null){if(u===null)throw Error(r(308));Xn=f,u.dependencies={lanes:0,firstContext:f},u.flags|=524288}else Xn=Xn.next=f;return x}function Lf(){return{controller:new ry,data:new Map,refCount:0}}function pc(u){u.refCount--,u.refCount===0&&il(Ho,function(){u.controller.abort()})}function Ol(){var u=rl.current;return u!==null?u:Mt.pooledCache}function Uf(u,f){f===null?k(rl,rl.current):k(rl,f.pool)}function yg(){var u=Ol();return u===null?null:{parent:xs?an._currentValue:an._currentValue2,pool:u}}function Pr(u){u.flags|=4}function zh(u,f){if(u!==null&&u.child===f.child)return!1;if((f.flags&16)!==0)return!0;for(u=f.child;u!==null;){if((u.flags&13878)!==0||(u.subtreeFlags&13878)!==0)return!0;u=u.sibling}return!1}function If(u,f,x,E){if(Ui)for(x=f.child;x!==null;){if(x.tag===5||x.tag===6)bs(u,x.stateNode);else if(!(x.tag===4||Ii&&x.tag===27)&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===f)break;for(;x.sibling===null;){if(x.return===null||x.return===f)return;x=x.return}x.sibling.return=x.return,x=x.sibling}else if(qr)for(var N=f.child;N!==null;){if(N.tag===5){var z=N.stateNode;x&&E&&(z=mp(z,N.type,N.memoizedProps)),bs(u,z)}else if(N.tag===6)z=N.stateNode,x&&E&&(z=gp(z,N.memoizedProps)),bs(u,z);else if(N.tag!==4){if(N.tag===22&&N.memoizedState!==null)z=N.child,z!==null&&(z.return=N),If(u,N,!0,!0);else if(N.child!==null){N.child.return=N,N=N.child;continue}}if(N===f)break;for(;N.sibling===null;){if(N.return===null||N.return===f)return;N=N.return}N.sibling.return=N.return,N=N.sibling}}function mc(u,f,x,E){if(qr)for(var N=f.child;N!==null;){if(N.tag===5){var z=N.stateNode;x&&E&&(z=mp(z,N.type,N.memoizedProps)),hp(u,z)}else if(N.tag===6)z=N.stateNode,x&&E&&(z=gp(z,N.memoizedProps)),hp(u,z);else if(N.tag!==4){if(N.tag===22&&N.memoizedState!==null)z=N.child,z!==null&&(z.return=N),mc(u,N,!(N.memoizedProps!==null&&N.memoizedProps.mode==="manual"),!0);else if(N.child!==null){N.child.return=N,N=N.child;continue}}if(N===f)break;for(;N.sibling===null;){if(N.return===null||N.return===f)return;N=N.return}N.sibling.return=N.return,N=N.sibling}}function gc(u,f){if(qr&&zh(u,f)){u=f.stateNode;var x=u.containerInfo,E=ld();mc(E,f,!1,!1),u.pendingChildren=E,Pr(f),zg(x,E)}}function Bh(u,f,x,E){if(Ui)u.memoizedProps!==E&&Pr(f);else if(qr){var N=u.stateNode,z=u.memoizedProps;if((u=zh(u,f))||z!==E){var ne=Ni.current;z=dp(N,x,z,E,!u,null),z===N?f.stateNode=N:(Zs(z,x,E,ne)&&Pr(f),f.stateNode=z,u?If(z,f,!1,!1):Pr(f))}else f.stateNode=N}}function yc(u,f,x){if(kg(f,x)){if(u.flags|=16777216,!Qs(f,x))if(Au())u.flags|=8192;else throw jo=bd,kp}else u.flags&=-16777217}function Lh(u,f){if(Wg(f)){if(u.flags|=16777216,!Cp(f))if(Au())u.flags|=8192;else throw jo=bd,kp}else u.flags&=-16777217}function Su(u,f){f!==null&&(u.flags|=4),u.flags&16384&&(f=u.tag!==22?P():536870912,u.lanes|=f,sl|=f)}function To(u,f){if(!Ft)switch(u.tailMode){case"hidden":f=u.tail;for(var x=null;f!==null;)f.alternate!==null&&(x=f),f=f.sibling;x===null?u.tail=null:x.sibling=null;break;case"collapsed":x=u.tail;for(var E=null;x!==null;)x.alternate!==null&&(E=x),x=x.sibling;E===null?f||u.tail===null?u.tail=null:u.tail.sibling=null:E.sibling=null}}function Mn(u){var f=u.alternate!==null&&u.alternate.child===u.child,x=0,E=0;if(f)for(var N=u.child;N!==null;)x|=N.lanes|N.childLanes,E|=N.subtreeFlags&31457280,E|=N.flags&31457280,N.return=u,N=N.sibling;else for(N=u.child;N!==null;)x|=N.lanes|N.childLanes,E|=N.subtreeFlags,E|=N.flags,N.return=u,N=N.sibling;return u.subtreeFlags|=E,u.childLanes=x,f}function bg(u,f,x){var E=f.pendingProps;switch(V(f),f.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mn(f),null;case 1:return Mn(f),null;case 3:return x=f.stateNode,E=null,u!==null&&(E=u.memoizedState.cache),f.memoizedState.cache!==E&&(f.flags|=2048),Gs(an),be(),x.pendingContext&&(x.context=x.pendingContext,x.pendingContext=null),(u===null||u.child===null)&&(Ie(f)?Pr(f):u===null||u.memoizedState.isDehydrated&&(f.flags&256)===0||(f.flags|=1024,$r!==null&&(qs($r),$r=null))),gc(u,f),Mn(f),null;case 26:if(Vr){x=f.type;var N=f.memoizedState;return u===null?(Pr(f),N!==null?(Mn(f),Lh(f,N)):(Mn(f),yc(f,x,E))):N?N!==u.memoizedState?(Pr(f),Mn(f),Lh(f,N)):(Mn(f),f.flags&=-16777217):(Ui?u.memoizedProps!==E&&Pr(f):Bh(u,f,x,E),Mn(f),yc(f,x,E)),null}case 27:if(Ii){if(se(f),x=Ga.current,N=f.type,u!==null&&f.stateNode!=null)Ui?u.memoizedProps!==E&&Pr(f):Bh(u,f,N,E);else{if(!E){if(f.stateNode===null)throw Error(r(166));return Mn(f),null}u=Ni.current,Ie(f)?le(f,u):(u=Mp(N,E,x,u,!0),f.stateNode=u,Pr(f))}return Mn(f),null}case 5:if(se(f),x=f.type,u!==null&&f.stateNode!=null)Bh(u,f,x,E);else{if(!E){if(f.stateNode===null)throw Error(r(166));return Mn(f),null}u=Ni.current,Ie(f)?le(f,u):(N=tp(x,E,Ga.current,u,f),If(N,f,!1,!1),f.stateNode=N,Zs(N,x,E,u)&&Pr(f))}return Mn(f),yc(f,f.type,f.pendingProps),null;case 6:if(u&&f.stateNode!=null)x=u.memoizedProps,Ui?x!==E&&Pr(f):qr&&(x!==E?(f.stateNode=td(E,Ga.current,Ni.current,f),Pr(f)):f.stateNode=u.stateNode);else{if(typeof E!="string"&&f.stateNode===null)throw Error(r(166));if(u=Ga.current,x=Ni.current,Ie(f)){if(!dr)throw Error(r(176));if(u=f.stateNode,x=f.memoizedProps,E=null,N=Zi,N!==null)switch(N.tag){case 27:case 5:E=N.memoizedProps}Fg(u,x,f,E)||ge(f)}else f.stateNode=td(E,u,x,f)}return Mn(f),null;case 13:if(E=f.memoizedState,u===null||u.memoizedState!==null&&u.memoizedState.dehydrated!==null){if(N=Ie(f),E!==null&&E.dehydrated!==null){if(u===null){if(!N)throw Error(r(318));if(!dr)throw Error(r(344));if(N=f.memoizedState,N=N!==null?N.dehydrated:null,!N)throw Error(r(317));kc(N,f)}else Ue(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;Mn(f),N=!1}else $r!==null&&(qs($r),$r=null),N=!0;if(!N)return f.flags&256?(qi(f),f):(qi(f),null)}if(qi(f),(f.flags&128)!==0)return f.lanes=x,f;if(x=E!==null,u=u!==null&&u.memoizedState!==null,x){E=f.child,N=null,E.alternate!==null&&E.alternate.memoizedState!==null&&E.alternate.memoizedState.cachePool!==null&&(N=E.alternate.memoizedState.cachePool.pool);var z=null;E.memoizedState!==null&&E.memoizedState.cachePool!==null&&(z=E.memoizedState.cachePool.pool),z!==N&&(E.flags|=2048)}return x!==u&&x&&(f.child.flags|=8192),Su(f,f.updateQueue),Mn(f),null;case 4:return be(),gc(u,f),u===null&&rp(f.stateNode.containerInfo),Mn(f),null;case 10:return Gs(f.type),Mn(f),null;case 19:if(w(ui),N=f.memoizedState,N===null)return Mn(f),null;if(E=(f.flags&128)!==0,z=N.rendering,z===null)if(E)To(N,!1);else{if(It!==0||u!==null&&(u.flags&128)!==0)for(u=f.child;u!==null;){if(z=sr(u),z!==null){for(f.flags|=128,To(N,!1),u=z.updateQueue,f.updateQueue=u,Su(f,u),f.subtreeFlags=0,u=x,x=f.child;x!==null;)Ks(x,u),x=x.sibling;return k(ui,ui.current&1|2),f.child}u=u.sibling}N.tail!==null&&ji()>Pn&&(f.flags|=128,E=!0,To(N,!1),f.lanes=4194304)}else{if(!E)if(u=sr(z),u!==null){if(f.flags|=128,E=!0,u=u.updateQueue,f.updateQueue=u,Su(f,u),To(N,!0),N.tail===null&&N.tailMode==="hidden"&&!z.alternate&&!Ft)return Mn(f),null}else 2*ji()-N.renderingStartTime>Pn&&x!==536870912&&(f.flags|=128,E=!0,To(N,!1),f.lanes=4194304);N.isBackwards?(z.sibling=f.child,f.child=z):(u=N.last,u!==null?u.sibling=z:f.child=z,N.last=z)}return N.tail!==null?(f=N.tail,N.rendering=f,N.tail=f.sibling,N.renderingStartTime=ji(),f.sibling=null,u=ui.current,k(ui,E?u&1|2:u&1),f):(Mn(f),null);case 22:case 23:return qi(f),Cn(),E=f.memoizedState!==null,u!==null?u.memoizedState!==null!==E&&(f.flags|=8192):E&&(f.flags|=8192),E?(x&536870912)!==0&&(f.flags&128)===0&&(Mn(f),f.subtreeFlags&6&&(f.flags|=8192)):Mn(f),x=f.updateQueue,x!==null&&Su(f,x.retryQueue),x=null,u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(x=u.memoizedState.cachePool.pool),E=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(E=f.memoizedState.cachePool.pool),E!==x&&(f.flags|=2048),u!==null&&w(rl),null;case 24:return x=null,u!==null&&(x=u.memoizedState.cache),f.memoizedState.cache!==x&&(f.flags|=2048),Gs(an),Mn(f),null;case 25:return null}throw Error(r(156,f.tag))}function xg(u,f){switch(V(f),f.tag){case 1:return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 3:return Gs(an),be(),u=f.flags,(u&65536)!==0&&(u&128)===0?(f.flags=u&-65537|128,f):null;case 26:case 27:case 5:return se(f),null;case 13:if(qi(f),u=f.memoizedState,u!==null&&u.dehydrated!==null){if(f.alternate===null)throw Error(r(340));Ue()}return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 19:return w(ui),null;case 4:return be(),null;case 10:return Gs(f.type),null;case 22:case 23:return qi(f),Cn(),u!==null&&w(rl),u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 24:return Gs(an),null;case 25:return null;default:return null}}function Uh(u,f){switch(V(f),f.tag){case 3:Gs(an),be();break;case 26:case 27:case 5:se(f);break;case 4:be();break;case 13:qi(f);break;case 19:w(ui);break;case 10:Gs(f.type);break;case 22:case 23:qi(f),Cn(),u!==null&&w(rl);break;case 24:Gs(an)}}function Eu(u,f){try{var x=f.updateQueue,E=x!==null?x.lastEffect:null;if(E!==null){var N=E.next;x=N;do{if((x.tag&u)===u){E=void 0;var z=x.create,ne=x.inst;E=z(),ne.destroy=E}x=x.next}while(x!==N)}}catch(ie){Ot(f,f.return,ie)}}function Dl(u,f,x){try{var E=f.updateQueue,N=E!==null?E.lastEffect:null;if(N!==null){var z=N.next;E=z;do{if((E.tag&u)===u){var ne=E.inst,ie=ne.destroy;if(ie!==void 0){ne.destroy=void 0,N=f;var de=x;try{ie()}catch(Te){Ot(N,de,Te)}}}E=E.next}while(E!==z)}}catch(Te){Ot(f,f.return,Te)}}function vg(u){var f=u.updateQueue;if(f!==null){var x=u.stateNode;try{as(f,x)}catch(E){Ot(u,u.return,E)}}}function _g(u,f,x){x.props=La(u.type,u.memoizedProps),x.state=u.memoizedState;try{x.componentWillUnmount()}catch(E){Ot(u,f,E)}}function Co(u,f){try{var x=u.ref;if(x!==null){var E=u.stateNode;switch(u.tag){case 26:case 27:case 5:var N=Nc(E);break;default:N=E}typeof x=="function"?u.refCleanup=x(N):x.current=N}}catch(z){Ot(u,f,z)}}function Rn(u,f){var x=u.ref,E=u.refCleanup;if(x!==null)if(typeof E=="function")try{E()}catch(N){Ot(u,f,N)}finally{u.refCleanup=null,u=u.alternate,u!=null&&(u.refCleanup=null)}else if(typeof x=="function")try{x(null)}catch(N){Ot(u,f,N)}else x.current=null}function bc(u){var f=u.type,x=u.memoizedProps,E=u.stateNode;try{wb(E,f,x,u)}catch(N){Ot(u,u.return,N)}}function Ih(u,f,x){try{op(u.stateNode,u.type,x,f,u)}catch(E){Ot(u,u.return,E)}}function jh(u){return u.tag===5||u.tag===3||(Vr?u.tag===26:!1)||(Ii?u.tag===27:!1)||u.tag===4}function jf(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||jh(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&(!Ii||u.tag!==27)&&u.tag!==18;){if(u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function Hf(u,f,x){var E=u.tag;if(E===5||E===6)u=u.stateNode,f?up(x,u,f):Og(x,u);else if(!(E===4||Ii&&E===27)&&(u=u.child,u!==null))for(Hf(u,f,x),u=u.sibling;u!==null;)Hf(u,f,x),u=u.sibling}function xc(u,f,x){var E=u.tag;if(E===5||E===6)u=u.stateNode,f?cp(x,u,f):lp(x,u);else if(!(E===4||Ii&&E===27)&&(u=u.child,u!==null))for(xc(u,f,x),u=u.sibling;u!==null;)xc(u,f,x),u=u.sibling}function Sg(u,f,x){u=u.containerInfo;try{pp(u,x)}catch(E){Ot(f,f.return,E)}}function vc(u,f){for(Xl(u.containerInfo),Kn=f;Kn!==null;)if(u=Kn,f=u.child,(u.subtreeFlags&1028)!==0&&f!==null)f.return=u,Kn=f;else for(;Kn!==null;){u=Kn;var x=u.alternate;switch(f=u.flags,u.tag){case 0:break;case 11:case 15:break;case 1:if((f&1024)!==0&&x!==null){f=void 0;var E=u,N=x.memoizedProps;x=x.memoizedState;var z=E.stateNode;try{var ne=La(E.type,N,E.elementType===E.type);f=z.getSnapshotBeforeUpdate(ne,x),z.__reactInternalSnapshotBeforeUpdate=f}catch(ie){Ot(E,E.return,ie)}}break;case 3:(f&1024)!==0&&Ui&&sd(u.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((f&1024)!==0)throw Error(r(163))}if(f=u.sibling,f!==null){f.return=u.return,Kn=f;break}Kn=u.return}return ne=Po,Po=!1,ne}function Pf(u,f,x){var E=x.flags;switch(x.tag){case 0:case 11:case 15:ds(u,x),E&4&&Eu(5,x);break;case 1:if(ds(u,x),E&4)if(u=x.stateNode,f===null)try{u.componentDidMount()}catch(ie){Ot(x,x.return,ie)}else{var N=La(x.type,f.memoizedProps);f=f.memoizedState;try{u.componentDidUpdate(N,f,u.__reactInternalSnapshotBeforeUpdate)}catch(ie){Ot(x,x.return,ie)}}E&64&&vg(x),E&512&&Co(x,x.return);break;case 3:if(ds(u,x),E&64&&(E=x.updateQueue,E!==null)){if(u=null,x.child!==null)switch(x.child.tag){case 27:case 5:u=Nc(x.child.stateNode);break;case 1:u=x.child.stateNode}try{as(E,u)}catch(ie){Ot(x,x.return,ie)}}break;case 26:if(Vr){ds(u,x),E&512&&Co(x,x.return);break}case 27:case 5:ds(u,x),f===null&&E&4&&bc(x),E&512&&Co(x,x.return);break;case 12:ds(u,x);break;case 13:ds(u,x),E&4&&zl(u,x);break;case 22:if(N=x.memoizedState!==null||_i,!N){f=f!==null&&f.memoizedState!==null||Hn;var z=_i,ne=Hn;_i=N,(Hn=f)&&!ne?Ll(u,x,(x.subtreeFlags&8772)!==0):ds(u,x),_i=z,Hn=ne}E&512&&(x.memoizedProps.mode==="manual"?Co(x,x.return):Rn(x,x.return));break;default:ds(u,x)}}function _c(u){var f=u.alternate;f!==null&&(u.alternate=null,_c(f)),u.child=null,u.deletions=null,u.sibling=null,u.tag===5&&(f=u.stateNode,f!==null&&ap(f)),u.stateNode=null,u.return=null,u.dependencies=null,u.memoizedProps=null,u.memoizedState=null,u.pendingProps=null,u.stateNode=null,u.updateQueue=null}function Gr(u,f,x){for(x=x.child;x!==null;)Gf(u,f,x),x=x.sibling}function Gf(u,f,x){if(Tr&&typeof Tr.onCommitFiberUnmount=="function")try{Tr.onCommitFiberUnmount(Bc,x)}catch{}switch(x.tag){case 26:if(Vr){Hn||Rn(x,f),Gr(u,f,x),x.memoizedState?_p(x.memoizedState):x.stateNode&&wp(x.stateNode);break}case 27:if(Ii){Hn||Rn(x,f);var E=ni,N=Mr;ni=x.stateNode,Gr(u,f,x),$g(x.stateNode),ni=E,Mr=N;break}case 5:Hn||Rn(x,f);case 6:if(Ui){if(E=ni,N=Mr,ni=null,Gr(u,f,x),ni=E,Mr=N,ni!==null)if(Mr)try{Jn(ni,x.stateNode)}catch(z){Ot(x,f,z)}else try{hr(ni,x.stateNode)}catch(z){Ot(x,f,z)}}else Gr(u,f,x);break;case 18:Ui&&ni!==null&&(Mr?bp(ni,x.stateNode):Yg(ni,x.stateNode));break;case 4:Ui?(E=ni,N=Mr,ni=x.stateNode.containerInfo,Mr=!0,Gr(u,f,x),ni=E,Mr=N):(qr&&Sg(x.stateNode,x,ld()),Gr(u,f,x));break;case 0:case 11:case 14:case 15:Hn||Dl(2,x,f),Hn||Dl(4,x,f),Gr(u,f,x);break;case 1:Hn||(Rn(x,f),E=x.stateNode,typeof E.componentWillUnmount=="function"&&_g(x,f,E)),Gr(u,f,x);break;case 21:Gr(u,f,x);break;case 22:Hn||Rn(x,f),Hn=(E=Hn)||x.memoizedState!==null,Gr(u,f,x),Hn=E;break;default:Gr(u,f,x)}}function zl(u,f){if(dr&&f.memoizedState===null&&(u=f.alternate,u!==null&&(u=u.memoizedState,u!==null&&(u=u.dehydrated,u!==null))))try{fd(u)}catch(x){Ot(f,f.return,x)}}function Sc(u){switch(u.tag){case 13:case 19:var f=u.stateNode;return f===null&&(f=u.stateNode=new Pc),f;case 22:return u=u.stateNode,f=u._retryCache,f===null&&(f=u._retryCache=new Pc),f;default:throw Error(r(435,u.tag))}}function wu(u,f){var x=Sc(u);f.forEach(function(E){var N=qh.bind(null,u,E);x.has(E)||(x.add(E),E.then(N,N))})}function cr(u,f){var x=f.deletions;if(x!==null)for(var E=0;E<x.length;E++){var N=x[E],z=u,ne=f;if(Ui){var ie=ne;e:for(;ie!==null;){switch(ie.tag){case 27:case 5:ni=ie.stateNode,Mr=!1;break e;case 3:ni=ie.stateNode.containerInfo,Mr=!0;break e;case 4:ni=ie.stateNode.containerInfo,Mr=!0;break e}ie=ie.return}if(ni===null)throw Error(r(160));Gf(z,ne,N),ni=null,Mr=!1}else Gf(z,ne,N);z=N.alternate,z!==null&&(z.return=null),N.return=null}if(f.subtreeFlags&13878)for(f=f.child;f!==null;)Bl(f,u),f=f.sibling}function Bl(u,f){var x=u.alternate,E=u.flags;switch(u.tag){case 0:case 11:case 14:case 15:cr(f,u),vr(u),E&4&&(Dl(3,u,u.return),Eu(3,u),Dl(5,u,u.return));break;case 1:cr(f,u),vr(u),E&512&&(Hn||x===null||Rn(x,x.return)),E&64&&_i&&(u=u.updateQueue,u!==null&&(E=u.callbacks,E!==null&&(x=u.shared.hiddenCallbacks,u.shared.hiddenCallbacks=x===null?E:x.concat(E))));break;case 26:if(Vr){var N=pr;cr(f,u),vr(u),E&512&&(Hn||x===null||Rn(x,x.return)),E&4&&(E=x!==null?x.memoizedState:null,f=u.memoizedState,x===null?f===null?u.stateNode===null?u.stateNode=Sp(N,u.type,u.memoizedProps,u):Ep(N,u.type,u.stateNode):u.stateNode=vp(N,f,u.memoizedProps):E!==f?(E===null?x.stateNode!==null&&wp(x.stateNode):_p(E),f===null?Ep(N,u.type,u.stateNode):vp(N,f,u.memoizedProps)):f===null&&u.stateNode!==null&&Ih(u,u.memoizedProps,x.memoizedProps));break}case 27:if(Ii&&E&4&&u.alternate===null){N=u.stateNode;var z=u.memoizedProps;try{Mb(N),Rb(u.type,z,N,u)}catch(Oe){Ot(u,u.return,Oe)}}case 5:if(cr(f,u),vr(u),E&512&&(Hn||x===null||Rn(x,x.return)),Ui){if(u.flags&32){f=u.stateNode;try{Uu(f)}catch(Oe){Ot(u,u.return,Oe)}}E&4&&u.stateNode!=null&&(f=u.memoizedProps,Ih(u,f,x!==null?x.memoizedProps:f)),E&1024&&(no=!0)}break;case 6:if(cr(f,u),vr(u),E&4&&Ui){if(u.stateNode===null)throw Error(r(162));E=u.memoizedProps,x=x!==null?x.memoizedProps:E,f=u.stateNode;try{Dg(f,x,E)}catch(Oe){Ot(u,u.return,Oe)}}break;case 3:if(Vr?(Tp(),N=pr,pr=dd(f.containerInfo),cr(f,u),pr=N):cr(f,u),vr(u),E&4){if(Ui&&dr&&x!==null&&x.memoizedState.isDehydrated)try{ud(f.containerInfo)}catch(Oe){Ot(u,u.return,Oe)}if(qr){E=f.containerInfo,x=f.pendingChildren;try{pp(E,x)}catch(Oe){Ot(u,u.return,Oe)}}}no&&(no=!1,Hh(u));break;case 4:Vr?(x=pr,pr=dd(u.stateNode.containerInfo),cr(f,u),vr(u),pr=x):(cr(f,u),vr(u)),E&4&&qr&&Sg(u.stateNode,u,u.stateNode.pendingChildren);break;case 12:cr(f,u),vr(u);break;case 13:cr(f,u),vr(u),u.child.flags&8192&&u.memoizedState!==null!=(x!==null&&x.memoizedState!==null)&&(Cs=ji()),E&4&&(E=u.updateQueue,E!==null&&(u.updateQueue=null,wu(u,E)));break;case 22:E&512&&(Hn||x===null||Rn(x,x.return)),N=u.memoizedState!==null;var ne=x!==null&&x.memoizedState!==null,ie=_i,de=Hn;if(_i=ie||N,Hn=de||ne,cr(f,u),Hn=de,_i=ie,vr(u),f=u.stateNode,f._current=u,f._visibility&=-3,f._visibility|=f._pendingVisibility&2,E&8192&&(f._visibility=N?f._visibility&-2:f._visibility|1,N&&(f=_i||Hn,x===null||ne||f||Ec(u)),Ui&&(u.memoizedProps===null||u.memoizedProps.mode!=="manual"))){e:if(x=null,Ui)for(f=u;;){if(f.tag===5||Vr&&f.tag===26||Ii&&f.tag===27){if(x===null){ne=x=f;try{z=ne.stateNode,N?Iu(z):fp(ne.stateNode,ne.memoizedProps)}catch(Oe){Ot(ne,ne.return,Oe)}}}else if(f.tag===6){if(x===null){ne=f;try{var Te=ne.stateNode;N?ad(Te):Js(Te,ne.memoizedProps)}catch(Oe){Ot(ne,ne.return,Oe)}}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===u)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===u)break e;for(;f.sibling===null;){if(f.return===null||f.return===u)break e;x===f&&(x=null),f=f.return}x===f&&(x=null),f.sibling.return=f.return,f=f.sibling}}E&4&&(E=u.updateQueue,E!==null&&(x=E.retryQueue,x!==null&&(E.retryQueue=null,wu(u,x))));break;case 19:cr(f,u),vr(u),E&4&&(E=u.updateQueue,E!==null&&(u.updateQueue=null,wu(u,E)));break;case 21:break;default:cr(f,u),vr(u)}}function vr(u){var f=u.flags;if(f&2){try{if(Ui&&(!Ii||u.tag!==27)){e:{for(var x=u.return;x!==null;){if(jh(x)){var E=x;break e}x=x.return}throw Error(r(160))}switch(E.tag){case 27:if(Ii){var N=E.stateNode,z=jf(u);xc(u,z,N);break}case 5:var ne=E.stateNode;E.flags&32&&(Uu(ne),E.flags&=-33);var ie=jf(u);xc(u,ie,ne);break;case 3:case 4:var de=E.stateNode.containerInfo,Te=jf(u);Hf(u,Te,de);break;default:throw Error(r(161))}}}catch(Oe){Ot(u,u.return,Oe)}u.flags&=-3}f&4096&&(u.flags&=-4097)}function Hh(u){if(u.subtreeFlags&1024)for(u=u.child;u!==null;){var f=u;Hh(f),f.tag===5&&f.flags&1024&&pn(f.stateNode),u=u.sibling}}function ds(u,f){if(f.subtreeFlags&8772)for(f=f.child;f!==null;)Pf(u,f.alternate,f),f=f.sibling}function Ec(u){for(u=u.child;u!==null;){var f=u;switch(f.tag){case 0:case 11:case 14:case 15:Dl(4,f,f.return),Ec(f);break;case 1:Rn(f,f.return);var x=f.stateNode;typeof x.componentWillUnmount=="function"&&_g(f,f.return,x),Ec(f);break;case 26:case 27:case 5:Rn(f,f.return),Ec(f);break;case 22:Rn(f,f.return),f.memoizedState===null&&Ec(f);break;default:Ec(f)}u=u.sibling}}function Ll(u,f,x){for(x=x&&(f.subtreeFlags&8772)!==0,f=f.child;f!==null;){var E=f.alternate,N=u,z=f,ne=z.flags;switch(z.tag){case 0:case 11:case 15:Ll(N,z,x),Eu(4,z);break;case 1:if(Ll(N,z,x),E=z,N=E.stateNode,typeof N.componentDidMount=="function")try{N.componentDidMount()}catch(Te){Ot(E,E.return,Te)}if(E=z,N=E.updateQueue,N!==null){var ie=E.stateNode;try{var de=N.shared.hiddenCallbacks;if(de!==null)for(N.shared.hiddenCallbacks=null,N=0;N<de.length;N++)bo(de[N],ie)}catch(Te){Ot(E,E.return,Te)}}x&&ne&64&&vg(z),Co(z,z.return);break;case 26:case 27:case 5:Ll(N,z,x),x&&E===null&&ne&4&&bc(z),Co(z,z.return);break;case 12:Ll(N,z,x);break;case 13:Ll(N,z,x),x&&ne&4&&zl(N,z);break;case 22:z.memoizedState===null&&Ll(N,z,x),Co(z,z.return);break;default:Ll(N,z,x)}f=f.sibling}}function Ph(u,f){var x=null;u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(x=u.memoizedState.cachePool.pool),u=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(u=f.memoizedState.cachePool.pool),u!==x&&(u!=null&&u.refCount++,x!=null&&pc(x))}function Ff(u,f){u=null,f.alternate!==null&&(u=f.alternate.memoizedState.cache),f=f.memoizedState.cache,f!==u&&(f.refCount++,u!=null&&pc(u))}function Fs(u,f,x,E){if(f.subtreeFlags&10256)for(f=f.child;f!==null;)qf(u,f,x,E),f=f.sibling}function qf(u,f,x,E){var N=f.flags;switch(f.tag){case 0:case 11:case 15:Fs(u,f,x,E),N&2048&&Eu(9,f);break;case 3:Fs(u,f,x,E),N&2048&&(u=null,f.alternate!==null&&(u=f.alternate.memoizedState.cache),f=f.memoizedState.cache,f!==u&&(f.refCount++,u!=null&&pc(u)));break;case 12:if(N&2048){Fs(u,f,x,E),u=f.stateNode;try{var z=f.memoizedProps,ne=z.id,ie=z.onPostCommit;typeof ie=="function"&&ie(ne,f.alternate===null?"mount":"update",u.passiveEffectDuration,-0)}catch(de){Ot(f,f.return,de)}}else Fs(u,f,x,E);break;case 23:break;case 22:z=f.stateNode,f.memoizedState!==null?z._visibility&4?Fs(u,f,x,E):Ul(u,f):z._visibility&4?Fs(u,f,x,E):(z._visibility|=4,Xi(u,f,x,E,(f.subtreeFlags&10256)!==0)),N&2048&&Ph(f.alternate,f);break;case 24:Fs(u,f,x,E),N&2048&&Ff(f.alternate,f);break;default:Fs(u,f,x,E)}}function Xi(u,f,x,E,N){for(N=N&&(f.subtreeFlags&10256)!==0,f=f.child;f!==null;){var z=u,ne=f,ie=x,de=E,Te=ne.flags;switch(ne.tag){case 0:case 11:case 15:Xi(z,ne,ie,de,N),Eu(8,ne);break;case 23:break;case 22:var Oe=ne.stateNode;ne.memoizedState!==null?Oe._visibility&4?Xi(z,ne,ie,de,N):Ul(z,ne):(Oe._visibility|=4,Xi(z,ne,ie,de,N)),N&&Te&2048&&Ph(ne.alternate,ne);break;case 24:Xi(z,ne,ie,de,N),N&&Te&2048&&Ff(ne.alternate,ne);break;default:Xi(z,ne,ie,de,N)}f=f.sibling}}function Ul(u,f){if(f.subtreeFlags&10256)for(f=f.child;f!==null;){var x=u,E=f,N=E.flags;switch(E.tag){case 22:Ul(x,E),N&2048&&Ph(E.alternate,E);break;case 24:Ul(x,E),N&2048&&Ff(E.alternate,E);break;default:Ul(x,E)}f=f.sibling}}function Ci(u){if(u.subtreeFlags&Go)for(u=u.child;u!==null;)Ao(u),u=u.sibling}function Ao(u){switch(u.tag){case 26:Ci(u),u.flags&Go&&(u.memoizedState!==null?Ap(pr,u.memoizedState,u.memoizedProps):Fn(u.type,u.memoizedProps));break;case 5:Ci(u),u.flags&Go&&Fn(u.type,u.memoizedProps);break;case 3:case 4:if(Vr){var f=pr;pr=dd(u.stateNode.containerInfo),Ci(u),pr=f}else Ci(u);break;case 22:u.memoizedState===null&&(f=u.alternate,f!==null&&f.memoizedState!==null?(f=Go,Go=16777216,Ci(u),Go=f):Ci(u));break;default:Ci(u)}}function Yf(u){var f=u.alternate;if(f!==null&&(u=f.child,u!==null)){f.child=null;do f=u.sibling,u.sibling=null,u=f;while(u!==null)}}function Il(u){var f=u.deletions;if((u.flags&16)!==0){if(f!==null)for(var x=0;x<f.length;x++){var E=f[x];Kn=E,jl(E,u)}Yf(u)}if(u.subtreeFlags&10256)for(u=u.child;u!==null;)Tu(u),u=u.sibling}function Tu(u){switch(u.tag){case 0:case 11:case 15:Il(u),u.flags&2048&&Dl(9,u,u.return);break;case 3:Il(u);break;case 12:Il(u);break;case 22:var f=u.stateNode;u.memoizedState!==null&&f._visibility&4&&(u.return===null||u.return.tag!==13)?(f._visibility&=-5,wc(u)):Il(u);break;default:Il(u)}}function wc(u){var f=u.deletions;if((u.flags&16)!==0){if(f!==null)for(var x=0;x<f.length;x++){var E=f[x];Kn=E,jl(E,u)}Yf(u)}for(u=u.child;u!==null;){switch(f=u,f.tag){case 0:case 11:case 15:Dl(8,f,f.return),wc(f);break;case 22:x=f.stateNode,x._visibility&4&&(x._visibility&=-5,wc(f));break;default:wc(f)}u=u.sibling}}function jl(u,f){for(;Kn!==null;){var x=Kn;switch(x.tag){case 0:case 11:case 15:Dl(8,x,f);break;case 23:case 22:if(x.memoizedState!==null&&x.memoizedState.cachePool!==null){var E=x.memoizedState.cachePool.pool;E!=null&&E.refCount++}break;case 24:pc(x.memoizedState.cache)}if(E=x.child,E!==null)E.return=x,Kn=E;else e:for(x=u;Kn!==null;){E=Kn;var N=E.sibling,z=E.return;if(_c(E),E===x){Kn=null;break e}if(N!==null){N.return=z,Kn=N;break e}Kn=z}}}function Vf(u){var f=ip(u);if(f!=null){if(typeof f.memoizedProps["data-testname"]!="string")throw Error(r(364));return f}if(u=Lo(u),u===null)throw Error(r(362));return u.stateNode.current}function Tc(u,f){var x=u.tag;switch(f.$$typeof){case Ju:if(u.type===f.value)return!0;break;case Ed:e:{for(f=f.value,u=[u,0],x=0;x<u.length;){var E=u[x++],N=E.tag,z=u[x++],ne=f[z];if(N!==5&&N!==26&&N!==27||!_s(E)){for(;ne!=null&&Tc(E,ne);)z++,ne=f[z];if(z===f.length){f=!0;break e}else for(E=E.child;E!==null;)u.push(E,z),E=E.sibling}}f=!1}return f;case wd:if((x===5||x===26||x===27)&&Eb(u.stateNode,f.value))return!0;break;case sn:if((x===5||x===6||x===26||x===27)&&(u=Lu(u),u!==null&&0<=u.indexOf(f.value)))return!0;break;case Ut:if((x===5||x===26||x===27)&&(u=u.memoizedProps["data-testname"],typeof u=="string"&&u.toLowerCase()===f.value.toLowerCase()))return!0;break;default:throw Error(r(365))}return!1}function Hl(u){switch(u.$$typeof){case Ju:return"<"+(l(u.value)||"Unknown")+">";case Ed:return":has("+(Hl(u)||"")+")";case wd:return'[role="'+u.value+'"]';case sn:return'"'+u.value+'"';case Ut:return'[data-testname="'+u.value+'"]';default:throw Error(r(365))}}function Eg(u,f){var x=[];u=[u,0];for(var E=0;E<u.length;){var N=u[E++],z=N.tag,ne=u[E++],ie=f[ne];if(z!==5&&z!==26&&z!==27||!_s(N)){for(;ie!=null&&Tc(N,ie);)ne++,ie=f[ne];if(ne===f.length)x.push(N);else for(N=N.child;N!==null;)u.push(N,ne),N=N.sibling}}return x}function ur(u,f){if(!vs)throw Error(r(363));u=Vf(u),u=Eg(u,f),f=[],u=Array.from(u);for(var x=0;x<u.length;){var E=u[x++],N=E.tag;if(N===5||N===26||N===27)_s(E)||f.push(E.stateNode);else for(E=E.child;E!==null;)u.push(E),E=E.sibling}return f}function fr(){if((Ze&2)!==0&&Et!==0)return Et&-Et;if(rt.T!==null){var u=Cr;return u!==0?u:ke()}return ma()}function hs(){Rr===0&&(Rr=(Et&536870912)===0||Ft?$():536870912);var u=Jr.current;return u!==null&&(u.flags|=32),Rr}function Ki(u,f,x){(u===Mt&&mn===2||u.cancelPendingCommit!==null)&&(Ia(u,0),Ua(u,Et,Rr,!1)),K(u,x),((Ze&2)===0||u!==Mt)&&(u===Mt&&((Ze&2)===0&&(Ya|=x),It===4&&Ua(u,Et,Rr,!1)),bn(u))}function Cu(u,f,x){if((Ze&6)!==0)throw Error(r(327));var E=!x&&(f&60)===0&&(f&u.expiredLanes)===0||D(u,f),N=E?gs(u,f):ps(u,f,!0),z=E;do{if(N===0){ea&&!E&&Ua(u,f,0,!1);break}else if(N===6)Ua(u,f,0,!ln);else{if(x=u.current.alternate,z&&!wg(x)){N=ps(u,f,!1),z=!1;continue}if(N===2){if(z=f,u.errorRecoveryDisabledLanes&z)var ne=0;else ne=u.pendingLanes&-536870913,ne=ne!==0?ne:ne&536870912?536870912:0;if(ne!==0){f=ne;e:{var ie=u;N=Gc;var de=dr&&ie.current.memoizedState.isDehydrated;if(de&&(Ia(ie,ne).flags|=256),ne=ps(ie,ne,!1),ne!==2){if(al&&!de){ie.errorRecoveryDisabledLanes|=z,Ya|=z,N=4;break e}z=na,na=N,z!==null&&qs(z)}N=ne}if(z=!1,N!==2)continue}}if(N===1){Ia(u,0),Ua(u,f,0,!0);break}e:{switch(E=u,N){case 0:case 1:throw Error(r(345));case 4:if((f&4194176)===f){Ua(E,f,Rr,!ln);break e}break;case 2:na=null;break;case 3:case 5:break;default:throw Error(r(329))}if(E.finishedWork=x,E.finishedLanes=f,(f&62914560)===f&&(z=Cs+300-ji(),10<z)){if(Ua(E,f,Rr,!ln),j(E,0)!==0)break e;E.timeoutHandle=np(Xf.bind(null,E,x,na,Va,Fc,f,Rr,Ya,sl,ln,2,-0,0),z);break e}Xf(E,x,na,Va,Fc,f,Rr,Ya,sl,ln,0,-0,0)}}break}while(!0);bn(u)}function qs(u){na===null?na=u:na.push.apply(na,u)}function Xf(u,f,x,E,N,z,ne,ie,de,Te,Oe,je,Ge){var ht=f.subtreeFlags;if((ht&8192||(ht&16785408)===16785408)&&(Yr(),Ao(f),f=nd(),f!==null)){u.cancelPendingCommit=f(vn.bind(null,u,x,E,N,ne,ie,de,1,je,Ge)),Ua(u,z,ne,!Te);return}vn(u,x,E,N,ne,ie,de,Oe,je,Ge)}function wg(u){for(var f=u;;){var x=f.tag;if((x===0||x===11||x===15)&&f.flags&16384&&(x=f.updateQueue,x!==null&&(x=x.stores,x!==null)))for(var E=0;E<x.length;E++){var N=x[E],z=N.getSnapshot;N=N.value;try{if(!Xr(z(),N))return!1}catch{return!1}}if(x=f.child,f.subtreeFlags&16384&&x!==null)x.return=f,f=x;else{if(f===u)break;for(;f.sibling===null;){if(f.return===null||f.return===u)return!0;f=f.return}f.sibling.return=f.return,f=f.sibling}}return!0}function Ua(u,f,x,E){f&=~er,f&=~Ya,u.suspendedLanes|=f,u.pingedLanes&=~f,E&&(u.warmLanes|=f),E=u.expirationTimes;for(var N=f;0<N;){var z=31-wr(N),ne=1<<z;E[z]=-1,N&=~ne}x!==0&&te(u,x,f)}function Gh(){return(Ze&6)===0?(wi(0),!1):!0}function _r(){if(gt!==null){if(mn===0)var u=gt.return;else u=gt,Xn=to=null,Is(u),Es=null,ba=0,u=gt;for(;u!==null;)Uh(u.alternate,u),u=u.return;gt=null}}function Ia(u,f){u.finishedWork=null,u.finishedLanes=0;var x=u.timeoutHandle;x!==Bo&&(u.timeoutHandle=Bo,Bu(x)),x=u.cancelPendingCommit,x!==null&&(u.cancelPendingCommit=null,x()),_r(),Mt=u,gt=x=Wi(u.current,null),Et=f,mn=0,ii=null,ln=!1,ea=D(u,f),al=!1,sl=Rr=er=Ya=ta=It=0,na=Gc=null,Fc=!1,(f&8)!==0&&(f|=f&32);var E=u.entangledLanes;if(E!==0)for(u=u.entanglements,E&=f;0<E;){var N=31-wr(E),z=1<<N;f|=u[N],E&=~z}return qa=f,Ve(),x}function Mo(u,f){_t=null,rt.H=qt,f===fn?(f=we(),mn=3):f===kp?(f=we(),mn=4):mn=f===iy?8:f!==null&&typeof f=="object"&&typeof f.then=="function"?6:1,ii=f,gt===null&&(It=1,Of(u,Q(f,u.current)))}function Au(){var u=Jr.current;return u===null?!0:(Et&4194176)===Et?xa===null:(Et&62914560)===Et||(Et&536870912)!==0?u===xa:!1}function Cc(){var u=rt.H;return rt.H=qt,u===null?qt:u}function Fr(){var u=rt.A;return rt.A=Sd,u}function Sr(){It=4,ln||(Et&4194176)!==Et&&Jr.current!==null||(ea=!0),(ta&134217727)===0&&(Ya&134217727)===0||Mt===null||Ua(Mt,Et,Rr,!1)}function ps(u,f,x){var E=Ze;Ze|=2;var N=Cc(),z=Fr();(Mt!==u||Et!==f)&&(Va=null,Ia(u,f)),f=!1;var ne=It;e:do try{if(mn!==0&>!==null){var ie=gt,de=ii;switch(mn){case 8:_r(),ne=6;break e;case 3:case 2:case 6:Jr.current===null&&(f=!0);var Te=mn;if(mn=0,ii=null,Pl(u,ie,de,Te),x&&ea){ne=0;break e}break;default:Te=mn,mn=0,ii=null,Pl(u,ie,de,Te)}}ms(),ne=It;break}catch(Oe){Mo(u,Oe)}while(!0);return f&&u.shellSuspendCounter++,Xn=to=null,Ze=E,rt.H=N,rt.A=z,gt===null&&(Mt=null,Et=0,Ve()),ne}function ms(){for(;gt!==null;)Fh(gt)}function gs(u,f){var x=Ze;Ze|=2;var E=Cc(),N=Fr();Mt!==u||Et!==f?(Va=null,Pn=ji()+500,Ia(u,f)):ea=D(u,f);e:do try{if(mn!==0&>!==null){f=gt;var z=ii;t:switch(mn){case 1:mn=0,ii=null,Pl(u,f,z,1);break;case 2:if(ss(z)){mn=0,ii=null,Kf(f);break}f=function(){mn===2&&Mt===u&&(mn=7),bn(u)},z.then(f,f);break e;case 3:mn=7;break e;case 4:mn=5;break e;case 7:ss(z)?(mn=0,ii=null,Kf(f)):(mn=0,ii=null,Pl(u,f,z,7));break;case 5:var ne=null;switch(gt.tag){case 26:ne=gt.memoizedState;case 5:case 27:var ie=gt,de=ie.type,Te=ie.pendingProps;if(ne?Cp(ne):Qs(de,Te)){mn=0,ii=null;var Oe=ie.sibling;if(Oe!==null)gt=Oe;else{var je=ie.return;je!==null?(gt=je,Mu(je)):gt=null}break t}}mn=0,ii=null,Pl(u,f,z,5);break;case 6:mn=0,ii=null,Pl(u,f,z,6);break;case 8:_r(),It=6;break e;default:throw Error(r(462))}}Ys();break}catch(Ge){Mo(u,Ge)}while(!0);return Xn=to=null,rt.H=E,rt.A=N,Ze=x,gt!==null?0:(Mt=null,Et=0,Ve(),It)}function Ys(){for(;gt!==null&&!Qg();)Fh(gt)}function Fh(u){var f=gg(u.alternate,u,qa);u.memoizedProps=u.pendingProps,f===null?Mu(u):gt=f}function Kf(u){var f=u,x=f.alternate;switch(f.tag){case 15:case 0:f=fg(x,f,f.pendingProps,f.type,void 0,Et);break;case 11:f=fg(x,f,f.pendingProps,f.type.render,f.ref,Et);break;case 5:Is(f);default:Uh(x,f),f=gt=Ks(f,qa),f=gg(x,f,qa)}u.memoizedProps=u.pendingProps,f===null?Mu(u):gt=f}function Pl(u,f,x,E){Xn=to=null,Is(f),Es=null,ba=0;var N=f.return;try{if(sg(u,N,f,x,Et)){It=1,Of(u,Q(x,u.current)),gt=null;return}}catch(z){if(N!==null)throw gt=N,z;It=1,Of(u,Q(x,u.current)),gt=null;return}f.flags&32768?(Ft||E===1?u=!0:ea||(Et&536870912)!==0?u=!1:(ln=u=!0,(E===2||E===3||E===6)&&(E=Jr.current,E!==null&&E.tag===13&&(E.flags|=16384))),Ai(f,u)):Mu(f)}function Mu(u){var f=u;do{if((f.flags&32768)!==0){Ai(f,ln);return}u=f.return;var x=bg(f.alternate,f,qa);if(x!==null){gt=x;return}if(f=f.sibling,f!==null){gt=f;return}gt=f=u}while(f!==null);It===0&&(It=5)}function Ai(u,f){do{var x=xg(u.alternate,u);if(x!==null){x.flags&=32767,gt=x;return}if(x=u.return,x!==null&&(x.flags|=32768,x.subtreeFlags=0,x.deletions=null),!f&&(u=u.sibling,u!==null)){gt=u;return}gt=u=x}while(u!==null);It=6,gt=null}function vn(u,f,x,E,N,z,ne,ie,de,Te){var Oe=rt.T,je=vi();try{$i(2),rt.T=null,zt(u,f,x,E,je,N,z,ne,ie,de,Te)}finally{rt.T=Oe,$i(je)}}function zt(u,f,x,E,N,z,ne,ie){do Mi();while(ll!==null);if((Ze&6)!==0)throw Error(r(327));var de=u.finishedWork;if(E=u.finishedLanes,de===null)return null;if(u.finishedWork=null,u.finishedLanes=0,de===u.current)throw Error(r(177));u.callbackNode=null,u.callbackPriority=0,u.cancelPendingCommit=null;var Te=de.lanes|de.childLanes;if(Te|=Uc,G(u,E,Te,z,ne,ie),u===Mt&&(gt=Mt=null,Et=0),(de.subtreeFlags&10256)===0&&(de.flags&10256)===0||_a||(_a=!0,Td=Te,qo=x,Ru(pd,function(){return Mi(),null})),x=(de.flags&15990)!==0,(de.subtreeFlags&15990)!==0||x?(x=rt.T,rt.T=null,z=vi(),$i(2),ne=Ze,Ze|=4,vc(u,de),Bl(de,u),ep(u.containerInfo),u.current=de,Pf(u,de.alternate,de),Jg(),Ze=ne,$i(z),rt.T=x):u.current=de,_a?(_a=!1,ll=u,Fo=E):Vs(u,Te),Te=u.pendingLanes,Te===0&&(ia=null),B(de.stateNode),bn(u),f!==null)for(N=u.onRecoverableError,de=0;de<f.length;de++)Te=f[de],N(Te.value,{componentStack:Te.stack});return(Fo&3)!==0&&Mi(),Te=u.pendingLanes,(E&4194218)!==0&&(Te&42)!==0?u===mr?Yo++:(Yo=0,mr=u):Yo=0,wi(0),null}function Vs(u,f){(u.pooledCacheLanes&=f)===0&&(f=u.pooledCache,f!=null&&(u.pooledCache=null,pc(f)))}function Mi(){if(ll!==null){var u=ll,f=Td;Td=0;var x=W(Fo),E=32>x?32:x;x=rt.T;var N=vi();try{if($i(E),rt.T=null,ll===null)var z=!1;else{E=qo,qo=null;var ne=ll,ie=Fo;if(ll=null,Fo=0,(Ze&6)!==0)throw Error(r(331));var de=Ze;if(Ze|=4,Tu(ne.current),qf(ne,ne.current,ie,E),Ze=de,wi(0,!1),Tr&&typeof Tr.onPostCommitFiberRoot=="function")try{Tr.onPostCommitFiberRoot(Bc,ne)}catch{}z=!0}return z}finally{$i(N),rt.T=x,Vs(u,f)}}return!1}function Wf(u,f,x){f=Q(x,f),f=yu(u.stateNode,f,2),u=$t(u,f,2),u!==null&&(K(u,2),bn(u))}function Ot(u,f,x){if(u.tag===3)Wf(u,u,x);else for(;f!==null;){if(f.tag===3){Wf(f,u,x);break}else if(f.tag===1){var E=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof E.componentDidCatch=="function"&&(ia===null||!ia.has(E))){u=Q(x,u),x=hc(2),E=$t(f,x,2),E!==null&&(bu(x,E,f,u),K(E,2),bn(E));break}}f=f.return}}function $f(u,f,x){var E=u.pingCache;if(E===null){E=u.pingCache=new Dt;var N=new Set;E.set(f,N)}else N=E.get(f),N===void 0&&(N=new Set,E.set(f,N));N.has(x)||(al=!0,N.add(x),u=Tg.bind(null,u,f,x),f.then(u,u))}function Tg(u,f,x){var E=u.pingCache;E!==null&&E.delete(f),u.pingedLanes|=u.suspendedLanes&x,u.warmLanes&=~x,Mt===u&&(Et&x)===x&&(It===4||It===3&&(Et&62914560)===Et&&300>ji()-Cs?(Ze&2)===0&&Ia(u,0):er|=x,sl===Et&&(sl=0)),bn(u)}function Ro(u,f){f===0&&(f=P()),u=At(u,f),u!==null&&(K(u,f),bn(u))}function No(u){var f=u.memoizedState,x=0;f!==null&&(x=f.retryLane),Ro(u,x)}function qh(u,f){var x=0;switch(u.tag){case 13:var E=u.stateNode,N=u.memoizedState;N!==null&&(x=N.retryLane);break;case 19:E=u.stateNode;break;case 22:E=u.stateNode._retryCache;break;default:throw Error(r(314))}E!==null&&E.delete(f),Ro(u,x)}function Ru(u,f){return zc(u,f)}function Yh(u,f,x,E){this.tag=u,this.key=x,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=E,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xs(u){return u=u.prototype,!(!u||!u.isReactComponent)}function Wi(u,f){var x=u.alternate;return x===null?(x=n(u.tag,f,u.key,u.mode),x.elementType=u.elementType,x.type=u.type,x.stateNode=u.stateNode,x.alternate=u,u.alternate=x):(x.pendingProps=f,x.type=u.type,x.flags=0,x.subtreeFlags=0,x.deletions=null),x.flags=u.flags&31457280,x.childLanes=u.childLanes,x.lanes=u.lanes,x.child=u.child,x.memoizedProps=u.memoizedProps,x.memoizedState=u.memoizedState,x.updateQueue=u.updateQueue,f=u.dependencies,x.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},x.sibling=u.sibling,x.index=u.index,x.ref=u.ref,x.refCleanup=u.refCleanup,x}function Ks(u,f){u.flags&=31457282;var x=u.alternate;return x===null?(u.childLanes=0,u.lanes=f,u.child=null,u.subtreeFlags=0,u.memoizedProps=null,u.memoizedState=null,u.updateQueue=null,u.dependencies=null,u.stateNode=null):(u.childLanes=x.childLanes,u.lanes=x.lanes,u.child=x.child,u.subtreeFlags=0,u.deletions=null,u.memoizedProps=x.memoizedProps,u.memoizedState=x.memoizedState,u.updateQueue=x.updateQueue,u.type=x.type,f=x.dependencies,u.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext}),u}function pa(u,f,x,E,N,z){var ne=0;if(E=u,typeof u=="function")Xs(u)&&(ne=1);else if(typeof u=="string")ne=Vr&&Ii?xp(u,x,Ni.current)?26:Oc(u)?27:5:Vr?xp(u,x,Ni.current)?26:5:Ii&&Oc(u)?27:5;else e:switch(u){case Mc:return Ws(x.children,N,z,f);case $h:ne=8,N|=24;break;case Zh:return u=n(12,x,f,N|2),u.elementType=Zh,u.lanes=z,u;case Qf:return u=n(13,x,f,N),u.elementType=Qf,u.lanes=z,u;case ql:return u=n(19,x,f,N),u.elementType=ql,u.lanes=z,u;case Ou:return Zf(x,N,z,f);default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case Mg:case ys:ne=10;break e;case Fl:ne=9;break e;case Rc:ne=11;break e;case ku:ne=14;break e;case Ha:ne=16,E=null;break e}ne=29,x=Error(r(130,u===null?"null":typeof u,"")),E=null}return f=n(ne,x,f,N),f.elementType=u,f.type=E,f.lanes=z,f}function Ws(u,f,x,E){return u=n(7,u,E,f),u.lanes=x,u}function Zf(u,f,x,E){u=n(22,u,E,f),u.elementType=Ou,u.lanes=x;var N={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var z=N._current;if(z===null)throw Error(r(456));if((N._pendingVisibility&2)===0){var ne=At(z,2);ne!==null&&(N._pendingVisibility|=2,Ki(ne,z,2))}},attach:function(){var z=N._current;if(z===null)throw Error(r(456));if((N._pendingVisibility&2)!==0){var ne=At(z,2);ne!==null&&(N._pendingVisibility&=-3,Ki(ne,z,2))}}};return u.stateNode=N,u}function Gl(u,f,x){return u=n(6,u,null,f),u.lanes=x,u}function Ac(u,f,x){return f=n(4,u.children!==null?u.children:[],u.key,f),f.lanes=x,f.stateNode={containerInfo:u.containerInfo,pendingChildren:null,implementation:u.implementation},f}function ko(u,f,x,E,N,z,ne,ie){this.tag=1,this.containerInfo=u,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Bo,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=I(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=I(0),this.hiddenUpdates=I(null),this.identifierPrefix=E,this.onUncaughtError=N,this.onCaughtError=z,this.onRecoverableError=ne,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ie,this.incompleteTransitions=new Map}function Ri(u,f,x,E,N,z,ne,ie,de,Te,Oe,je){return u=new ko(u,f,x,ne,ie,de,Te,je),f=1,z===!0&&(f|=24),z=n(3,null,null,f),u.current=z,z.stateNode=u,f=Lf(),f.refCount++,u.pooledCache=f,f.refCount++,z.memoizedState={element:E,isDehydrated:x,cache:f},yi(z),u}function Nu(u){return u?(u=Uo,u):Uo}function Vh(u){var f=u._reactInternals;if(f===void 0)throw typeof u.render=="function"?Error(r(188)):(u=Object.keys(u).join(","),Error(r(268,u)));return u=v(f),u=u!==null?_(u):null,u===null?null:Nc(u.stateNode)}function Cg(u,f,x,E,N,z){N=Nu(N),E.context===null?E.context=N:E.pendingContext=N,E=xn(f),E.payload={element:x},z=z===void 0?null:z,z!==null&&(E.callback=z),x=$t(u,E,f),x!==null&&(Ki(x,u,f),Gn(x,u,f))}function Ag(u,f){if(u=u.memoizedState,u!==null&&u.dehydrated!==null){var x=u.retryLane;u.retryLane=x!==0&&x<f?x:f}}function Xh(u,f){Ag(u,f),(u=u.alternate)&&Ag(u,f)}var $e={},Kh=yh(),Li=QB(),Oo=Object.assign,Wh=Symbol.for("react.element"),$s=Symbol.for("react.transitional.element"),ja=Symbol.for("react.portal"),Mc=Symbol.for("react.fragment"),$h=Symbol.for("react.strict_mode"),Zh=Symbol.for("react.profiler"),Mg=Symbol.for("react.provider"),Fl=Symbol.for("react.consumer"),ys=Symbol.for("react.context"),Rc=Symbol.for("react.forward_ref"),Qf=Symbol.for("react.suspense"),ql=Symbol.for("react.suspense_list"),ku=Symbol.for("react.memo"),Ha=Symbol.for("react.lazy"),Ou=Symbol.for("react.offscreen"),Rg=Symbol.for("react.memo_cache_sentinel"),Qh=Symbol.iterator,Do=Symbol.for("react.client.reference"),rt=Kh.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Jf,Jh,Yl=!1,Vl=Array.isArray,ed=e.rendererVersion,Du=e.rendererPackageName,zu=e.extraDevToolsConfig,Nc=e.getPublicInstance,zo=e.getRootHostContext,Ng=e.getChildHostContext,Xl=e.prepareForCommit,ep=e.resetAfterCommit,tp=e.createInstance,bs=e.appendInitialChild,Zs=e.finalizeInitialChildren,Kl=e.shouldSetTextContent,td=e.createTextInstance,np=e.scheduleTimeout,Bu=e.cancelTimeout,Bo=e.noTimeout,xs=e.isPrimaryRenderer;e.warnsIfNotActing;var Ui=e.supportsMutation,qr=e.supportsPersistence,dr=e.supportsHydration,ip=e.getInstanceFromNode;e.beforeActiveInstanceBlur,e.afterActiveInstanceBlur;var rp=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var $i=e.setCurrentUpdatePriority,vi=e.getCurrentUpdatePriority,ma=e.resolveUpdatePriority;e.resolveEventType,e.resolveEventTimeStamp;var Wl=e.shouldAttemptEagerTransition,ap=e.detachDeletedInstance;e.requestPostPaintCallback;var kg=e.maySuspendCommit,Qs=e.preloadInstance,Yr=e.startSuspendingCommit,Fn=e.suspendInstance,nd=e.waitForCommitToBeReady,Er=e.NotPendingTransition,ot=e.HostTransitionContext,pn=e.resetFormInstance;e.bindToConsole;var ci=e.supportsMicrotasks,id=e.scheduleMicrotask,vs=e.supportsTestSelectors,Lo=e.findFiberRoot,rd=e.getBoundingRect,Lu=e.getTextContent,_s=e.isHiddenSubtree,Eb=e.matchAccessibilityRole,qn=e.setFocusIfFocusable,sp=e.setupIntersectionObserver,lp=e.appendChild,Og=e.appendChildToContainer,Dg=e.commitTextUpdate,wb=e.commitMount,op=e.commitUpdate,cp=e.insertBefore,up=e.insertInContainerBefore,hr=e.removeChild,Jn=e.removeChildFromContainer,Uu=e.resetTextContent,Iu=e.hideInstance,ad=e.hideTextInstance,fp=e.unhideInstance,Js=e.unhideTextInstance,sd=e.clearContainer,dp=e.cloneInstance,ld=e.createContainerChildSet,hp=e.appendChildToContainerChildSet,zg=e.finalizeContainerChildren,pp=e.replaceContainerChildren,mp=e.cloneHiddenInstance,gp=e.cloneHiddenTextInstance,od=e.isSuspenseInstancePending,ju=e.isSuspenseInstanceFallback,Bg=e.getSuspenseInstanceFallbackErrorDetails,Tb=e.registerSuspenseInstanceRetry,Lg=e.canHydrateFormStateMarker,Ug=e.isFormStateMarkerMatching,yp=e.getNextHydratableSibling,cd=e.getFirstHydratableChild,Ig=e.getFirstHydratableChildWithinContainer,jg=e.getFirstHydratableChildWithinSuspenseInstance,Hg=e.canHydrateInstance,Pg=e.canHydrateTextInstance,Gg=e.canHydrateSuspenseInstance,Cb=e.hydrateInstance,Fg=e.hydrateTextInstance,kc=e.hydrateSuspenseInstance,qg=e.getNextHydratableInstanceAfterSuspenseInstance,ud=e.commitHydratedContainer,fd=e.commitHydratedSuspenseInstance,Yg=e.clearSuspenseBoundary,bp=e.clearSuspenseBoundaryFromContainer,Vg=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var Xg=e.validateHydratableInstance,Kg=e.validateHydratableTextInstance,Vr=e.supportsResources,xp=e.isHostHoistableType,dd=e.getHoistableRoot,hd=e.getResource,vp=e.acquireResource,_p=e.releaseResource,Sp=e.hydrateHoistable,Ep=e.mountHoistable,wp=e.unmountHoistable,Ab=e.createHoistableInstance,Tp=e.prepareToCommitHoistables,Wg=e.mayResourceSuspendCommit,Cp=e.preloadResource,Ap=e.suspendResource,Ii=e.supportsSingletons,Mp=e.resolveSingletonInstance,Mb=e.clearSingleton,Rb=e.acquireSingletonInstance,$g=e.releaseSingletonInstance,Oc=e.isHostSingletonType,Hu=[],el=-1,Uo={},wr=Math.clz32?Math.clz32:R,Pu=Math.log,Zg=Math.LN2,Dc=128,Gu=4194304,zc=Li.unstable_scheduleCallback,Fu=Li.unstable_cancelCallback,Qg=Li.unstable_shouldYield,Jg=Li.unstable_requestPaint,ji=Li.unstable_now,Rp=Li.unstable_ImmediatePriority,ey=Li.unstable_UserBlockingPriority,pd=Li.unstable_NormalPriority,md=Li.unstable_IdlePriority,ty=Li.log,Np=Li.unstable_setDisableYieldValue,Bc=null,Tr=null,Xr=typeof Object.is=="function"?Object.is:Z,gd=new WeakMap,Nn=[],Yn=0,qu=null,Yu=0,Kr=[],Wr=0,Pa=null,Ss=1,ga="",Ni=T(null),Vu=T(null),Ga=T(null),Lc=T(null),Zi=null,Hi=null,Ft=!1,$r=null,ya=!1,Xu=Error(r(519)),Zr=[],$l=0,Uc=0,Ic=null,Io=null,Ku=!1,Wu=!1,Fa=!1,Zl=0,$u=null,yd=0,Cr=0,Ql=null,tl=!1,jc=!1,Zu=Object.prototype.hasOwnProperty,fn=Error(r(460)),kp=Error(r(474)),bd={then:function(){}},jo=null,Es=null,ba=0,Jl=Fe(!0),Op=Fe(!1),ws=T(null),Qr=T(0),Jr=T(null),xa=null,ui=T(0),Ts=0,_t=null,Zt=null,ei=null,va=!1,kn=!1,nl=!1,Qu=0,Vn=0,Hc=null,ny=0,xd=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}},qt={readContext:Bi,use:Ir,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useLayoutEffect:yt,useInsertionEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useSyncExternalStore:yt,useId:yt};qt.useCacheRefresh=yt,qt.useMemoCache=yt,qt.useHostTransitionStatus=yt,qt.useFormState=yt,qt.useActionState=yt,qt.useOptimistic=yt;var fi={readContext:Bi,use:Ir,useCallback:function(u,f){return tn().memoizedState=[u,f===void 0?null:f],u},useContext:Bi,useEffect:rn,useImperativeHandle:function(u,f,x){x=x!=null?x.concat([u]):null,vo(4194308,4,Hs.bind(null,f,u),x)},useLayoutEffect:function(u,f){return vo(4194308,4,u,f)},useInsertionEffect:function(u,f){vo(4,2,u,f)},useMemo:function(u,f){var x=tn();f=f===void 0?null:f;var E=u();if(nl){X(!0);try{u()}finally{X(!1)}}return x.memoizedState=[E,f],E},useReducer:function(u,f,x){var E=tn();if(x!==void 0){var N=x(f);if(nl){X(!0);try{x(f)}finally{X(!1)}}}else N=f;return E.memoizedState=E.baseState=N,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:N},E.queue=u,u=u.dispatch=Al.bind(null,_t,u),[E.memoizedState,u]},useRef:function(u){var f=tn();return u={current:u},f.memoizedState=u},useState:function(u){u=Ti(u);var f=u.queue,x=Nf.bind(null,_t,f);return f.dispatch=x,[u.memoizedState,x]},useDebugValue:qe,useDeferredValue:function(u,f){var x=tn();return An(x,u,f)},useTransition:function(){var u=Ti(!1);return u=dc.bind(null,_t,u.queue,!0,!1),tn().memoizedState=u,[!1,u]},useSyncExternalStore:function(u,f,x){var E=_t,N=tn();if(Ft){if(x===void 0)throw Error(r(407));x=x()}else{if(x=f(),Mt===null)throw Error(r(349));(Et&60)!==0||xt(E,f,x)}N.memoizedState=x;var z={value:x,getSnapshot:f};return N.queue=z,rn(Un.bind(null,E,z,u),[u]),E.flags|=2048,Ba(9,Xt.bind(null,E,z,x,f),{destroy:void 0},null),x},useId:function(){var u=tn(),f=Mt.identifierPrefix;if(Ft){var x=ga,E=Ss;x=(E&~(1<<32-wr(E)-1)).toString(32)+x,f=":"+f+"R"+x,x=Qu++,0<x&&(f+="H"+x.toString(32)),f+=":"}else x=ny++,f=":"+f+"r"+x.toString(32)+":";return u.memoizedState=f},useCacheRefresh:function(){return tn().memoizedState=pu.bind(null,_t)}};fi.useMemoCache=Ln,fi.useHostTransitionStatus=_o,fi.useFormState=ls,fi.useActionState=ls,fi.useOptimistic=function(u){var f=tn();f.memoizedState=f.baseState=u;var x={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return f.queue=x,f=kf.bind(null,_t,!0,x),x.dispatch=f,[u,f]};var Qi={readContext:Bi,use:Ir,useCallback:mt,useContext:Bi,useEffect:cs,useImperativeHandle:ze,useInsertionEffect:us,useLayoutEffect:fc,useMemo:Nt,useReducer:da,useRef:it,useState:function(){return da(xr)},useDebugValue:qe,useDeferredValue:function(u,f){var x=nn();return Hr(x,Zt.memoizedState,u,f)},useTransition:function(){var u=da(xr)[0],f=nn().memoizedState;return[typeof u=="boolean"?u:lr(u),f]},useSyncExternalStore:Xe,useId:fs};Qi.useCacheRefresh=Rf,Qi.useMemoCache=Ln,Qi.useHostTransitionStatus=_o,Qi.useFormState=os,Qi.useActionState=os,Qi.useOptimistic=function(u,f){var x=nn();return un(x,Zt,u,f)};var eo={readContext:Bi,use:Ir,useCallback:mt,useContext:Bi,useEffect:cs,useImperativeHandle:ze,useInsertionEffect:us,useLayoutEffect:fc,useMemo:Nt,useReducer:Me,useRef:it,useState:function(){return Me(xr)},useDebugValue:qe,useDeferredValue:function(u,f){var x=nn();return Zt===null?An(x,u,f):Hr(x,Zt.memoizedState,u,f)},useTransition:function(){var u=Me(xr)[0],f=nn().memoizedState;return[typeof u=="boolean"?u:lr(u),f]},useSyncExternalStore:Xe,useId:fs};eo.useCacheRefresh=Rf,eo.useMemoCache=Ln,eo.useHostTransitionStatus=_o,eo.useFormState=du,eo.useActionState=du,eo.useOptimistic=function(u,f){var x=nn();return Zt!==null?un(x,Zt,u,f):(x.baseState=u,[u,x.queue.dispatch])};var vd={isMounted:function(u){return(u=u._reactInternals)?g(u)===u:!1},enqueueSetState:function(u,f,x){u=u._reactInternals;var E=fr(),N=xn(E);N.payload=f,x!=null&&(N.callback=x),f=$t(u,N,E),f!==null&&(Ki(f,u,E),Gn(f,u,E))},enqueueReplaceState:function(u,f,x){u=u._reactInternals;var E=fr(),N=xn(E);N.tag=1,N.payload=f,x!=null&&(N.callback=x),f=$t(u,N,E),f!==null&&(Ki(f,u,E),Gn(f,u,E))},enqueueForceUpdate:function(u,f){u=u._reactInternals;var x=fr(),E=xn(x);E.tag=2,f!=null&&(E.callback=f),f=$t(u,E,x),f!==null&&(Ki(f,u,x),Gn(f,u,x))}},Dp=typeof reportError=="function"?reportError:function(u){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var f=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof u=="object"&&u!==null&&typeof u.message=="string"?String(u.message):String(u),error:u});if(!window.dispatchEvent(f))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",u);return}console.error(u)},iy=Error(r(461)),ti=!1,Ji={dehydrated:null,treeContext:null,retryLane:0},Ar=T(null),to=null,Xn=null,ry=typeof AbortController<"u"?AbortController:function(){var u=[],f=this.signal={aborted:!1,addEventListener:function(x,E){u.push(E)}};this.abort=function(){f.aborted=!0,u.forEach(function(x){return x()})}},il=Li.unstable_scheduleCallback,Ho=Li.unstable_NormalPriority,an={$$typeof:ys,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},_d=rt.S;rt.S=function(u,f){typeof f=="object"&&f!==null&&typeof f.then=="function"&&Je(u,f),_d!==null&&_d(u,f)};var rl=T(null),_i=!1,Hn=!1,no=!1,Pc=typeof WeakSet=="function"?WeakSet:Set,Kn=null,Po=!1,ni=null,Mr=!1,pr=null,Go=8192,Sd={getCacheForType:function(u){var f=Bi(an),x=f.data.get(u);return x===void 0&&(x=u(),f.data.set(u,x)),x}},Ju=0,Ed=1,wd=2,Ut=3,sn=4;if(typeof Symbol=="function"&&Symbol.for){var St=Symbol.for;Ju=St("selector.component"),Ed=St("selector.has_pseudo_class"),wd=St("selector.role"),Ut=St("selector.test_id"),sn=St("selector.text")}var Dt=typeof WeakMap=="function"?WeakMap:Map,Ze=0,Mt=null,gt=null,Et=0,mn=0,ii=null,ln=!1,ea=!1,al=!1,qa=0,It=0,ta=0,Ya=0,er=0,Rr=0,sl=0,Gc=null,na=null,Fc=!1,Cs=0,Pn=1/0,Va=null,ia=null,_a=!1,ll=null,Fo=0,Td=0,qo=null,Yo=0,mr=null;return $e.attemptContinuousHydration=function(u){if(u.tag===13){var f=At(u,67108864);f!==null&&Ki(f,u,67108864),Xh(u,67108864)}},$e.attemptHydrationAtCurrentPriority=function(u){if(u.tag===13){var f=fr(),x=At(u,f);x!==null&&Ki(x,u,f),Xh(u,f)}},$e.attemptSynchronousHydration=function(u){switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var f=O(u.pendingLanes);if(f!==0){for(u.pendingLanes|=2,u.entangledLanes|=2;f;){var x=1<<31-wr(f);u.entanglements[1]|=x,f&=~x}bn(u),(Ze&6)===0&&(Pn=ji()+500,wi(0))}}break;case 13:f=At(u,2),f!==null&&Ki(f,u,2),Gh(),Xh(u,2)}},$e.batchedUpdates=function(u,f){return u(f)},$e.createComponentSelector=function(u){return{$$typeof:Ju,value:u}},$e.createContainer=function(u,f,x,E,N,z,ne,ie,de,Te){return Ri(u,f,!1,null,x,E,z,ne,ie,de,Te,null)},$e.createHasPseudoClassSelector=function(u){return{$$typeof:Ed,value:u}},$e.createHydrationContainer=function(u,f,x,E,N,z,ne,ie,de,Te,Oe,je,Ge){return u=Ri(x,E,!0,u,N,z,ie,de,Te,Oe,je,Ge),u.context=Nu(null),x=u.current,E=fr(),N=xn(E),N.callback=f??null,$t(x,N,E),u.current.lanes=E,K(u,E),bn(u),u},$e.createPortal=function(u,f,x){var E=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ja,key:E==null?null:""+E,children:u,containerInfo:f,implementation:x}},$e.createRoleSelector=function(u){return{$$typeof:wd,value:u}},$e.createTestNameSelector=function(u){return{$$typeof:Ut,value:u}},$e.createTextSelector=function(u){return{$$typeof:sn,value:u}},$e.defaultOnCaughtError=function(u){console.error(u)},$e.defaultOnRecoverableError=function(u){Dp(u)},$e.defaultOnUncaughtError=function(u){Dp(u)},$e.deferredUpdates=function(u){var f=rt.T,x=vi();try{return $i(32),rt.T=null,u()}finally{$i(x),rt.T=f}},$e.discreteUpdates=function(u,f,x,E,N){var z=rt.T,ne=vi();try{return $i(2),rt.T=null,u(f,x,E,N)}finally{$i(ne),rt.T=z,Ze===0&&(Pn=ji()+500)}},$e.findAllNodes=ur,$e.findBoundingRects=function(u,f){if(!vs)throw Error(r(363));f=ur(u,f),u=[];for(var x=0;x<f.length;x++)u.push(rd(f[x]));for(f=u.length-1;0<f;f--){x=u[f];for(var E=x.x,N=E+x.width,z=x.y,ne=z+x.height,ie=f-1;0<=ie;ie--)if(f!==ie){var de=u[ie],Te=de.x,Oe=Te+de.width,je=de.y,Ge=je+de.height;if(E>=Te&&z>=je&&N<=Oe&&ne<=Ge){u.splice(f,1);break}else if(E!==Te||x.width!==de.width||Ge<z||je>ne){if(!(z!==je||x.height!==de.height||Oe<E||Te>N)){Te>E&&(de.width+=Te-E,de.x=E),Oe<N&&(de.width=N-Te),u.splice(f,1);break}}else{je>z&&(de.height+=je-z,de.y=z),Ge<ne&&(de.height=ne-je),u.splice(f,1);break}}}return u},$e.findHostInstance=Vh,$e.findHostInstanceWithNoPortals=function(u){return u=v(u),u=u!==null?C(u):null,u===null?null:Nc(u.stateNode)},$e.findHostInstanceWithWarning=function(u){return Vh(u)},$e.flushPassiveEffects=Mi,$e.flushSyncFromReconciler=function(u){var f=Ze;Ze|=1;var x=rt.T,E=vi();try{if($i(2),rt.T=null,u)return u()}finally{$i(E),rt.T=x,Ze=f,(Ze&6)===0&&wi(0)}},$e.flushSyncWork=Gh,$e.focusWithin=function(u,f){if(!vs)throw Error(r(363));for(u=Vf(u),f=Eg(u,f),f=Array.from(f),u=0;u<f.length;){var x=f[u++],E=x.tag;if(!_s(x)){if((E===5||E===26||E===27)&&qn(x.stateNode))return!0;for(x=x.child;x!==null;)f.push(x),x=x.sibling}}return!1},$e.getFindAllNodesFailureDescription=function(u,f){if(!vs)throw Error(r(363));var x=0,E=[];u=[Vf(u),0];for(var N=0;N<u.length;){var z=u[N++],ne=z.tag,ie=u[N++],de=f[ie];if((ne!==5&&ne!==26&&ne!==27||!_s(z))&&(Tc(z,de)&&(E.push(Hl(de)),ie++,ie>x&&(x=ie)),ie<f.length))for(z=z.child;z!==null;)u.push(z,ie),z=z.sibling}if(x<f.length){for(u=[];x<f.length;x++)u.push(Hl(f[x]));return`findAllNodes was able to match part of the selector:
|
|
341
|
+
`+(E.join(" > ")+`
|
|
342
|
+
|
|
343
|
+
No matching component was found for:
|
|
344
|
+
`)+u.join(" > ")}return null},$e.getPublicRootInstance=function(u){if(u=u.current,!u.child)return null;switch(u.child.tag){case 27:case 5:return Nc(u.child.stateNode);default:return u.child.stateNode}},$e.injectIntoDevTools=function(){var u={bundleType:0,version:ed,rendererPackageName:Du,currentDispatcherRef:rt,findFiberByHostInstance:ip,reconcilerVersion:"19.0.0"};if(zu!==null&&(u.rendererConfig=zu),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")u=!1;else{var f=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(f.isDisabled||!f.supportsFiber)u=!0;else{try{Bc=f.inject(u),Tr=f}catch{}u=!!f.checkDCE}}return u},$e.isAlreadyRendering=function(){return!1},$e.observeVisibleRects=function(u,f,x,E){if(!vs)throw Error(r(363));u=ur(u,f);var N=sp(u,x,E).disconnect;return{disconnect:function(){N()}}},$e.shouldError=function(){return null},$e.shouldSuspend=function(){return!1},$e.startHostTransition=function(u,f,x,E){if(u.tag!==5)throw Error(r(476));var N=hu(u).queue;dc(u,N,f,Er,x===null?i:function(){var z=hu(u).next.queue;return Ml(u,z,{},fr()),x(E)})},$e.updateContainer=function(u,f,x,E){var N=f.current,z=fr();return Cg(N,z,u,f,x,E),z},$e.updateContainerSync=function(u,f,x,E){return f.tag===0&&Mi(),Cg(f.current,2,u,f,x,E),2},$e},t.exports.default=t.exports,Object.defineProperty(t.exports,"__esModule",{value:!0})})(qx)),qx.exports}var Bw;function eL(){return Bw||(Bw=1,Fx.exports=JB()),Fx.exports}var tL=eL();const nL=uu(tL),iL=nL;function rL(t,e,n,i){throw new Error("Text instances are not yet supported. Please use a `<text>` component.")}function aL(){}function sL(){return!1}const bM={};function lL(t){return t??bM}function oL(){return ou.currentUpdatePriority}function cL(){return null}function uL(t){throw new Error("Not yet implemented.")}function fL(t){return t}function dL(){return bM}function hL(t){t instanceof br?t.visible=!1:t instanceof Cf&&(t.enabled=!1)}function pL(t){throw new Error("Text instances are not yet supported. Please use a `<text>` component.")}function xM(t){if(t instanceof Cf){const e=t.__pixireact.parent;if(e){const n=e.__pixireact.filters.indexOf(t);e.__pixireact.filters.splice(n,1),e.filters=e.__pixireact.filters}t.__pixireact.parent=null}}function vM(t,e,...n){}function Lw(t,e,n){if(vM(),e instanceof br){const i=e,r=e,s=n;i.parent===t&&t.removeChild(r);const l=t.getChildIndex(s);t.addChildAt(r,l)}else if(e instanceof Cf){const s=e.__pixireact.filters.indexOf(n);xM(e),dM(t,e,s)}}function mL(){return!1}function gL(){return!0}function yL(){return null}function bL(){}function xL(){}function Uw(t,e){e instanceof Cf&&xM(e),e.destroy()}function vL(t){}function _L(){}function SL(){}function EL(){return-1.1}function wL(){return null}function TL(){var n;if(ou.currentUpdatePriority)return ou.currentUpdatePriority;const t=typeof self<"u"&&self||typeof window<"u"&&window;if(!t)return Kd.DefaultEventPriority;switch((n=t.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Kd.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Kd.ContinuousEventPriority;default:return Kd.DefaultEventPriority}}function CL(t){ou.currentUpdatePriority=t}function AL(){return!1}function ML(){return!1}function RL(){}function NL(){}function kL(){}function OL(t){t instanceof br?t.visible=!0:t instanceof Cf&&(t.enabled=!0)}function DL(t){throw new Error("Text instances are not yet supported. Please use a `<text>` component.")}function zL(){return null}const BL={isPrimaryRenderer:!1,noTimeout:-1,NotPendingTransition:null,supportsHydration:!1,supportsMutation:!0,supportsPersistence:!1,warnsIfNotActing:!1,afterActiveInstanceBlur:OB,appendChild:Gx,appendChildToContainer:Gx,appendInitialChild:Gx,beforeActiveInstanceBlur:DB,cancelTimeout:clearTimeout,clearContainer:zB,commitUpdate:YB,createInstance:$B,createTextInstance:rL,hideTextInstance:pL,unhideTextInstance:DL,detachDeletedInstance:aL,finalizeInitialChildren:sL,getChildHostContext:lL,getCurrentUpdatePriority:oL,getInstanceFromNode:cL,getInstanceFromScope:uL,getPublicInstance:fL,getRootHostContext:dL,hideInstance:hL,insertBefore:Lw,insertInContainerBefore:Lw,maySuspendCommit:mL,preloadInstance:gL,prepareForCommit:yL,preparePortalMount:bL,prepareScopeUpdate:xL,removeChild:Uw,removeChildFromContainer:Uw,requestPostPaintCallback:vL,resetAfterCommit:_L,resetFormInstance:SL,resolveEventTimeStamp:EL,resolveEventType:wL,resolveUpdatePriority:TL,scheduleTimeout:setTimeout,shouldAttemptEagerTransition:AL,setCurrentUpdatePriority:CL,shouldSetTextContent:ML,startSuspendingCommit:RL,suspendInstance:NL,trackSchedulerEvent:kL,unhideInstance:OL,waitForCommitToBeReady:zL,rendererPackageName:"@pixi/react",rendererVersion:kB.version},R0=iL(BL);R0.injectIntoDevTools();const oh=new Map;function LL(t,e={}){let n=oh.get(t),i=(n==null?void 0:n.applicationState)??{isInitialised:!1,isInitialising:!1};const r=(n==null?void 0:n.internalState)??{};n||(i.app=new W_,r.rootContainer=fM(i.app.stage));const s=(n==null?void 0:n.fiber)??R0.createContainer(r.rootContainer,Kd.ConcurrentRoot,null,!1,null,"",console.error,console.error,console.error,null);if(!n){let l;t instanceof HTMLCanvasElement&&(l=t),l||(l=document.createElement("canvas"),t.innerHTML="",t.appendChild(l)),r.canvas=l,n={applicationState:i,fiber:s,internalState:r,render:async(d,p)=>{var m;return!i.app.renderer&&!i.isInitialised&&!i.isInitialising&&(i.isInitialising=!0,await i.app.init({...p,canvas:l}),i.isInitialising=!1,i.isInitialised=!0,i={...i},(m=e.onInit)==null||m.call(e,i.app)),Object.entries(p).forEach(([g,b])=>{const v=g;uM(p,v)||(i.app[v]=b)}),R0.updateContainer(A.jsx(RB,{value:i,children:d}),s,null,()=>{}),i.app}},oh.set(l,n)}return n}function _M(t){ou.unmountQueue.delete(t);const e=t.fiber;e&&R0.updateContainer(null,e,null,()=>{t.applicationState.app&&t.applicationState.app.destroy(),oh.delete(t.internalState.canvas)})}function UL(){for(const t of ou.unmountQueue)_M(t)}function IL(t){const e=oh.get(t);e&&(e.applicationState.isInitialised?_M(e):ou.unmountQueue.add(e))}function jL(t){const e=oh.get(t);e&&ou.unmountQueue.delete(e)}var cC,uC;const Hy=typeof window<"u"&&((cC=window.document)!=null&&cC.createElement||((uC=window.navigator)==null?void 0:uC.product)==="ReactNative")?U.useLayoutEffect:U.useEffect,HL={...xf.defaultTextStyle},PL=U.forwardRef(function(e,n){const{children:i,className:r,defaultTextStyle:s,extensions:l,onInit:c,resizeTo:d,...p}=e,m=ZD(),g=U.useRef(null),b=U.useRef(null),v=U.useRef(new Set);U.useImperativeHandle(n,()=>({getApplication(){return g.current},getCanvas(){return b.current}}));const _=U.useCallback(()=>{const T=g.current;T&&(d?"current"in d?d.current instanceof HTMLElement&&(T.resizeTo=d.current):T.resizeTo=d:T.resizeTo=void 0)},[d]),C=U.useCallback(T=>{UL(),g.current=T,_(),c==null||c(T)},[c]);return Hy(()=>{if(l){const T=[...l],w=v.current;for(const k of w.values()){const R=T.indexOf(k);R===-1&&(si.remove(k),w.delete(k)),T.splice(R,1)}for(const k of T)si.add(k),w.add(k)}},[l]),Hy(()=>{const T=b.current;if(T){let w=oh.get(T);w||(w=LL(T,{onInit:C})),w.render(A.jsx(m,{children:i}),p)}},[p,i,C,d]),Hy(()=>{_()},[d]),Hy(()=>{s?Object.assign(xf.defaultTextStyle,s):Object.assign(xf.defaultTextStyle,HL)},[s]),U.useEffect(()=>{const T=b.current;if(T)return jL(T),()=>{IL(T)}},[]),A.jsx("canvas",{ref:b,className:r})}),GL=U.forwardRef(function(e,n){return A.jsx(UC,{children:A.jsx(PL,{ref:n,...e})})});function ib(t){Object.assign(a_,t)}function FL(){const t=U.useContext(s1);return vM(t.app instanceof W_,"No Context found with `%s`. Make sure to wrap component with `%s`","Application","AppProvider"),t}function qL({agentName:t,question:e,onRespond:n}){const[i,r]=U.useState(""),s=()=>{const c=i.trim();c&&(n(c),r(""))},l=c=>{c.key==="Enter"&&s()};return A.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(7, 8, 14, 0.8)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:50,animation:"fadeIn 0.2s var(--ease-out) both"},children:A.jsxs("div",{style:{background:"var(--surface-2)",border:"1px solid var(--status-warning)",borderRadius:"var(--radius-lg)",boxShadow:"0 0 40px var(--status-warning-glow), var(--shadow-lg)",padding:"var(--sp-6)",maxWidth:440,width:"100%",margin:"0 var(--sp-4)",animation:"scaleIn 0.3s var(--ease-spring) both"},children:[A.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",marginBottom:"var(--sp-4)"},children:[A.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:"var(--radius-full)",background:"var(--status-warning-glow)",border:"1px solid var(--status-warning)",color:"var(--status-warning)",fontSize:"0.7rem",fontWeight:700},children:"◆"}),A.jsxs("h2",{style:{fontFamily:"var(--font-mono)",fontSize:"0.78rem",fontWeight:700,color:"var(--status-warning)",textTransform:"uppercase",letterSpacing:"0.08em"},children:["Checkpoint — ",t]})]}),A.jsx("p",{style:{color:"var(--text-primary)",fontSize:"0.85rem",lineHeight:1.6,marginBottom:"var(--sp-5)"},children:e}),A.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)"},children:[A.jsx("input",{type:"text",className:"input",placeholder:"Type your response...",value:i,onChange:c=>r(c.target.value),onKeyPress:l,autoFocus:!0,style:{flex:1}}),A.jsx("button",{onClick:s,className:"btn",style:{background:"var(--status-warning)",color:"var(--text-inverse)",border:"1px solid var(--status-warning)",fontWeight:600,padding:"0 var(--sp-4)"},children:"Send"})]})]})})}const Iw=[16109737,15251594,13935988,13012574,10515018,9133628],jw=[2890510,4861722,9136404,12886874,1710618,9118976],YL=d0,at=YL/2,ft=7,dn=14,di=12,hi=5,Rs=10,gn=4,Ns=9,Tt=8;function Bd(t,e,n,i,r){t.circle(e,n-1,ft+1),t.fill(r),t.circle(e,n,ft),t.fill(i),t.circle(e-3,n-1,1.5),t.fill(1710618),t.circle(e+3,n-1,1.5),t.fill(1710618),t.circle(e-2.5,n-1.5,.6),t.fill(16777215),t.circle(e+3.5,n-1.5,.6),t.fill(16777215)}function Ld(t,e,n,i,r,s){t.roundRect(e-i/2,n,i,r,3),t.fill(s),t.moveTo(e-3,n),t.lineTo(e,n+4),t.lineTo(e+3,n),t.stroke({width:1,color:VL(s,.15)})}function Hw(t,e,n,i,r){t.roundRect(e-i-1,n,i,r,2),t.fill(2899536),t.roundRect(e+1,n,i,r,2),t.fill(2899536)}function Pw(t,e,n,i){t.roundRect(e-i-2,n,i+2,3,1),t.fill(1710618),t.roundRect(e,n,i+2,3,1),t.fill(1710618)}function VL(t,e){const n=Math.max(0,(t>>16&255)*(1-e)),i=Math.max(0,(t>>8&255)*(1-e)),r=Math.max(0,(t&255)*(1-e));return Math.floor(n)<<16|Math.floor(i)<<8|Math.floor(r)}function XL(t){const e=new Map;for(let n=0;n<Bv.length;n++){const i=Bv[n],r=Iw[n%Iw.length],s=jw[n%jw.length],l=new Aa;Bd(l,at,Tt,r,s),Ld(l,at,Tt+ft,dn,di,i),l.roundRect(at-dn/2-gn,Tt+ft+1,gn,Ns,2),l.fill(i),l.roundRect(at+dn/2,Tt+ft+1,gn,Ns,2),l.fill(i),l.circle(at-dn/2-gn/2,Tt+ft+Ns+1,2),l.fill(r),l.circle(at+dn/2+gn/2,Tt+ft+Ns+1,2),l.fill(r),Hw(l,at,Tt+ft+di,hi,Rs),Pw(l,at,Tt+ft+di+Rs,hi),e.set(`agent-${n}-standing`,t.renderer.generateTexture(l));const c=new Aa,d=Tt+4;Bd(c,at,d,r,s),Ld(c,at,d+ft,dn,di-2,i),c.roundRect(at-dn/2-gn+1,d+ft+2,gn,Ns-3,2),c.fill(i),c.roundRect(at+dn/2-1,d+ft+2,gn,Ns-3,2),c.fill(i);const p=6;c.roundRect(at-hi-1,d+ft+di-2,hi+1,p,2),c.fill(2899536),c.roundRect(at,d+ft+di-2,hi+1,p,2),c.fill(2899536),e.set(`agent-${n}-seated`,t.renderer.generateTexture(c));const m=new Aa,g=Tt+4;Bd(m,at+2,g,r,s),Ld(m,at+1,g+ft,dn,di-2,i),m.roundRect(at+dn/2,g+ft+2,gn+4,4,2),m.fill(i),m.roundRect(at+dn/2-2,g+ft+2,gn+4,4,2),m.fill(i),m.circle(at+dn/2+gn+3,g+ft+4,2),m.fill(r),m.circle(at+dn/2+gn+1,g+ft+4,2),m.fill(r),c.roundRect(at-hi-1,g+ft+di-2,hi+1,p,2),c.fill(2899536),m.roundRect(at,g+ft+di-2,hi+1,p,2),m.fill(2899536),e.set(`agent-${n}-typing`,t.renderer.generateTexture(m));const b=new Aa;Bd(b,at,Tt,r,s),Ld(b,at,Tt+ft,dn,di,i),b.roundRect(at-dn/2-gn,Tt+ft-1,gn,Ns+2,2),b.fill(i),b.roundRect(at+dn/2,Tt+ft+3,gn,Ns-2,2),b.fill(i),b.roundRect(at+1,Tt+ft+di,hi,Rs+2,2),b.fill(2899536),b.roundRect(at-hi-1,Tt+ft+di-2,hi,Rs,2),b.fill(2899536),b.roundRect(at,Tt+ft+di+Rs+1,hi+2,3,1),b.fill(1710618),b.roundRect(at-hi-2,Tt+ft+di+Rs-3,hi+1,3,1),b.fill(1710618),e.set(`agent-${n}-walk-right`,t.renderer.generateTexture(b));const v=new Aa;Bd(v,at,Tt,r,s),Ld(v,at,Tt+ft,dn,di,i),v.roundRect(at+dn/2,Tt+ft-1,gn,Ns+2,2),v.fill(i),v.roundRect(at-dn/2-gn,Tt+ft+3,gn,Ns-2,2),v.fill(i),v.roundRect(at-hi-1,Tt+ft+di,hi,Rs+2,2),v.fill(2899536),v.roundRect(at+1,Tt+ft+di-2,hi,Rs,2),v.fill(2899536),v.roundRect(at-hi-2,Tt+ft+di+Rs+1,hi+2,3,1),v.fill(1710618),v.roundRect(at,Tt+ft+di+Rs-3,hi+1,3,1),v.fill(1710618),e.set(`agent-${n}-walk-left`,t.renderer.generateTexture(v));const _=new Aa;Bd(_,at,Tt,r,s),Ld(_,at,Tt+ft,dn,di,i),_.roundRect(at-dn/2-gn,Tt+ft+1,gn,Ns,2),_.fill(i),_.circle(at-dn/2-gn/2,Tt+ft+Ns+1,2),_.fill(r),_.roundRect(at+dn/2,Tt+ft,gn,6,2),_.fill(i),_.circle(at+dn/2+gn/2+1,Tt+ft,2),_.fill(r),_.roundRect(at+dn/2+gn/2-1,Tt+ft-6,6,7,1),_.fill(14142664),_.moveTo(at+dn/2+gn/2,Tt+ft-7),_.quadraticCurveTo(at+dn/2+gn/2+2,Tt+ft-11,at+dn/2+gn/2,Tt+ft-14),_.stroke({width:1,color:16777215,alpha:.4}),_.moveTo(at+dn/2+gn/2+3,Tt+ft-7),_.quadraticCurveTo(at+dn/2+gn/2+5,Tt+ft-10,at+dn/2+gn/2+3,Tt+ft-13),_.stroke({width:1,color:16777215,alpha:.3}),Hw(_,at,Tt+ft+di,hi,Rs),Pw(_,at,Tt+ft+di+Rs,hi),e.set(`agent-${n}-coffee`,t.renderer.generateTexture(_))}return e}function KL(t,e){const n=t%Bv.length;let i;switch(e){case"working":i="typing";break;case"typing":i="typing";break;case"standing":i="standing";break;case"coffee":i="coffee";break;case"walk-right":i="walk-right";break;case"walk-left":i="walk-left";break;case"delivering":i="walk-right";break;case"idle":i="standing";break;case"seated":i="seated";break;case"checkpoint":case"done":default:i="seated";break}return`agent-${n}-${i}`}function WL(t,e){const n=OC;t.roundRect(0,0,e.totalWidth,e.totalHeight,4),t.fill(nh.wall),t.rect(0,0,e.totalWidth,3),t.fill({color:nh.wallHighlight,alpha:.5}),Fw(t,e.corridorH.x,e.corridorH.y,e.corridorH.width,e.corridorH.height,"horizontal"),Fw(t,e.corridorV.x,e.corridorV.y,e.corridorV.width,e.corridorV.height,"vertical");for(const b of e.squadOrigins){const{origin:v,width:_,height:C,doorSide:T}=b;T==="right"?tm(t,v.x+_,v.y+C/2-Ko/2,n,Ko):T==="left"?tm(t,v.x-n,v.y+C/2-Ko/2,n,Ko):T==="top"?em(t,v.x+_/2-Ko/2,v.y-n,Ko,n):em(t,v.x+_/2-Ko/2,v.y+C,Ko,n)}const i=e.ceoOffice,r=Math.min(Ko,60);tm(t,i.x+i.width,i.y+i.height/2-r/2,n,r),em(t,i.x+i.width/2-r/2,i.y+i.height,r,n);const s=e.bathroomMale;em(t,s.x+s.width/2-30,s.y+s.height,60,n);const l=e.bathroomFemale;em(t,l.x+l.width/2-30,l.y+l.height,60,n);const c=e.kitchen;tm(t,c.x+c.width,c.y+c.height/2-30,n,60);const d=e.restArea;tm(t,d.x-n,d.y+d.height/2-30,n,60);const p=e.corridorV;if(p.height>100){const b=p.x+p.width/2;for(let v=p.y+60;v<p.y+p.height-40;v+=200)Gw(t,b,v)}const m=e.corridorH,g=m.y+m.height/2;for(let b=m.x+80;b<m.x+m.width-80;b+=220)Gw(t,b,g);t.roundRect(0,0,e.totalWidth,e.totalHeight,4),t.stroke({width:2,color:5533306,alpha:.6})}function em(t,e,n,i,r){t.rect(e,n,i,r),t.fill(ru.floor),t.rect(e-2,n,2,r),t.fill(nh.doorFrame),t.rect(e+i,n,2,r),t.fill(nh.doorFrame)}function tm(t,e,n,i,r){t.rect(e,n,i,r),t.fill(ru.floor),t.rect(e,n-2,i,2),t.fill(nh.doorFrame),t.rect(e,n+r,i,2),t.fill(nh.doorFrame)}function Gw(t,e,n){t.roundRect(e-8,n-12,16,12,2),t.fill(9133628),t.circle(e,n-16,8),t.fill(5025616),t.circle(e-4,n-20,5),t.fill(3706428),t.circle(e+4,n-18,6),t.fill(6732650)}function Fw(t,e,n,i,r,s){t.rect(e,n,i,r),t.fill(ru.floor);const l=40;for(let c=0;c<Math.ceil(r/l);c++){for(let d=0;d<Math.ceil(i/l);d++){const p=e+d*l,m=n+c*l;(c+d)%2===0&&(t.rect(p,m,l,l),t.fill({color:ru.tile,alpha:.5})),t.moveTo(p,n),t.lineTo(p,n+r),t.stroke({width:.5,color:ru.grout,alpha:.3})}t.moveTo(e,n+c*l),t.lineTo(e+i,n+c*l),t.stroke({width:.5,color:ru.grout,alpha:.3})}s==="horizontal"?(t.rect(e+10,n+r/2-2,i-20,4),t.fill({color:ru.stripe,alpha:.3})):(t.rect(e+i/2-2,n+10,4,r-20),t.fill({color:ru.stripe,alpha:.3}))}function qw(t,e,n,i,r,s){t.rect(e,n,i,r),t.fill(ra.floor);const l=20;for(let T=0;T<Math.ceil(r/l);T++)for(let w=0;w<Math.ceil(i/l);w++)if((T+w)%2===0){const k=e+w*l,R=n+T*l;t.rect(k,R,l,l),t.fill({color:ra.tile,alpha:.4})}for(let T=0;T<=Math.ceil(r/l);T++)t.moveTo(e,n+T*l),t.lineTo(e+i,n+T*l),t.stroke({width:.5,color:ra.tileGrout,alpha:.3});for(let T=0;T<=Math.ceil(i/l);T++)t.moveTo(e+T*l,n),t.lineTo(e+T*l,n+r),t.stroke({width:.5,color:ra.tileGrout,alpha:.3});const c=Math.min(6,Math.max(2,Math.floor((i-20)/70))),d=(i-20)/c,p=80,m=n+r-p-10;for(let T=0;T<c;T++){const w=e+10+T*d;t.rect(w,m,3,p),t.fill(ra.stall),t.rect(w+d-3,m,3,p),t.fill(ra.stall),t.roundRect(w+6,m,d-12,p-4,2),t.fill({color:ra.stallDoor,alpha:.6}),t.circle(w+d-16,m+p/2,2),t.fill({color:7901340,alpha:.8});const k=w+d/2,R=m+p-24;t.roundRect(k-8,R,16,20,4),t.fill(ra.toilet),t.roundRect(k-6,R+2,12,14,3),t.fill(ra.toiletSeat),t.roundRect(k-6,R+2,12,14,3),t.stroke({width:.5,color:12434877,alpha:.5})}const g=Math.min(4,Math.max(2,Math.floor(i/100))),b=i/(g+1),v=n+30;t.rect(e+4,n+4,i-8,60),t.fill({color:ra.wall,alpha:.3});for(let T=0;T<g;T++){const w=e+b*(T+1);t.roundRect(w-12,n+8,24,20,3),t.fill(ra.mirrorFrame),t.roundRect(w-10,n+10,20,16,2),t.fill(ra.mirror),t.roundRect(w-6,n+12,6,10,1),t.fill({color:16777215,alpha:.15}),t.roundRect(w-14,v,28,16,3),t.fill(ra.sink),t.ellipse(w,v+8,8,5),t.fill(ra.sinkBowl),t.ellipse(w,v+8,8,5),t.stroke({width:.5,color:12434877,alpha:.4}),t.roundRect(w-2,v+1,4,6,1),t.fill(ra.pipe)}const _=e+i/2,C=n+r-20;t.roundRect(_-12,C-6,24,14,3),t.fill({color:3622735,alpha:.7}),s==="male"?(t.circle(_,C-2,3),t.fill({color:16777215,alpha:.8}),t.rect(_-3,C+1,6,4),t.fill({color:4367861,alpha:.8})):(t.circle(_,C-2,3),t.fill({color:16777215,alpha:.8}),t.moveTo(_-5,C+5),t.lineTo(_+5,C+5),t.lineTo(_,C+1),t.closePath(),t.fill({color:15684432,alpha:.8})),t.rect(e,n,i,r),t.stroke({width:1,color:0,alpha:.08})}function $L(t,e,n,i,r){t.rect(e,n,i,r),t.fill(tr.floor);const s=24;for(let p=0;p<Math.ceil(r/s);p++)for(let m=0;m<Math.ceil(i/s);m++)(p+m)%2===0&&(t.rect(e+m*s,n+p*s,s,s),t.fill({color:tr.tile,alpha:.4}));for(let p=0;p<=Math.ceil(r/s);p++)t.moveTo(e,n+p*s),t.lineTo(e+i,n+p*s),t.stroke({width:.5,color:tr.tileGrout,alpha:.3});for(let p=0;p<=Math.ceil(i/s);p++)t.moveTo(e+p*s,n),t.lineTo(e+p*s,n+r),t.stroke({width:.5,color:tr.tileGrout,alpha:.3});t.roundRect(e+6,n+10,24,r-20,3),t.fill(tr.counter),t.roundRect(e+7,n+11,22,r-22,2),t.fill(tr.counterTop),t.roundRect(e+6,n+10,24,40,3),t.fill(tr.fridge),t.roundRect(e+8,n+12,20,18,2),t.fill(tr.fridgeDoor),t.roundRect(e+8,n+32,20,16,2),t.fill(tr.fridgeDoor),t.roundRect(e+26,n+20,2,8,1),t.fill(tr.fridgeHandle),t.roundRect(e+26,n+36,2,8,1),t.fill(tr.fridgeHandle),t.roundRect(e+10,n+60,16,20,2),t.fill(tr.coffeeMaker),t.circle(e+18,n+64,2),t.fill({color:tr.coffeeMakerLight,alpha:.9});const l=e+i/2-16,c=n+r/2-12;t.roundRect(l,c,32,24,4),t.fill(tr.table),t.roundRect(l+2,c+2,28,20,3),t.fill(tr.tableTop);const d=[{cx:l-6,cy:c+12},{cx:l+38,cy:c+12},{cx:l+16,cy:c+30}];for(const p of d)t.roundRect(p.cx-5,p.cy-5,10,10,3),t.fill(tr.chair);t.circle(e+i/2,n+8,4),t.fill({color:tr.lamp,alpha:.6}),t.circle(e+i/2,n+8,8),t.fill({color:tr.lamp,alpha:.1}),t.rect(e,n,i,r),t.stroke({width:1,color:0,alpha:.08})}function ZL(t,e,n,i,r){t.rect(e,n,i,r),t.fill(Ea.floor),t.roundRect(e+8,n+8,i-16,r-16,6),t.fill({color:Ea.carpet,alpha:.2}),t.roundRect(e+12,n+12,i-24,r-24,4),t.stroke({width:1,color:Ea.carpetBorder,alpha:.15});const s=e+10,l=n+10,c=i-20,d=28;t.roundRect(s,l,c,10,3),t.fill(Ea.sofaArm),t.roundRect(s,l+8,c,d-8,4),t.fill(Ea.sofa);const p=(c-12)/3;for(let _=0;_<3;_++)t.roundRect(s+4+_*(p+2),l+10,p,d-14,3),t.fill(Ea.sofaCushion);t.roundRect(s-2,l+6,6,d-4,2),t.fill(Ea.sofaArm),t.roundRect(s+c-4,l+6,6,d-4,2),t.fill(Ea.sofaArm);const m=e+i/2,g=n+r-20;t.roundRect(m-12,g+8,24,10,2),t.fill(Ea.tvStand),t.roundRect(m-20,g-12,40,22,2),t.fill(Ea.tv),t.roundRect(m-18,g-10,36,18,1),t.fill(Ea.tvScreen),t.roundRect(m-14,g-8,10,6,1),t.fill({color:16777215,alpha:.05});const b=e+i-30,v=n+r/2-8;t.roundRect(b,v,20,16,3),t.fill(Ea.sideTable),t.rect(b+3,v+2,8,11),t.fill({color:Ea.magazine,alpha:.7}),t.rect(b+8,v+4,8,10),t.fill({color:Ea.magazineAlt,alpha:.6}),t.roundRect(e+8,n+r-40,12,10,2),t.fill(9133628),t.circle(e+14,n+r-34,7),t.fill(5025616),t.circle(e+11,n+r-38,4),t.fill(3706428),t.rect(e,n,i,r),t.stroke({width:1,color:0,alpha:.08})}function QL(t,e,n){t.rect(0,0,e,n),t.fill(dt.floor);const i=20,r=80;for(let g=0;g<Math.ceil(n/i);g++){const b=g%2*(r/2),v=g*i;t.moveTo(0,v),t.lineTo(e,v),t.stroke({width:1,color:dt.floorGrout,alpha:.4});for(let _=0;_<Math.ceil(e/r)+1;_++){const C=_*r-b;C>0&&C<e&&(t.moveTo(C,v),t.lineTo(C,v+i),t.stroke({width:1,color:dt.floorGrout,alpha:.25}))}g%3===0&&(t.rect(0,v+2,e,i-4),t.fill({color:dt.floorHighlight,alpha:.08}))}const s=42;t.rect(0,s,e,4),t.fill({color:0,alpha:.1}),t.rect(0,0,e,s),t.fill({color:dt.wall,alpha:.2}),t.rect(0,0,e,3),t.fill({color:dt.wallTrim,alpha:.15}),t.rect(0,s-4,e,4),t.fill({color:dt.baseboard,alpha:.2});const l=120,c=e-l*2,d=n-200,p=l,m=100;c>100&&d>60&&(t.roundRect(p+3,m+3,c,d,6),t.fill({color:0,alpha:.08}),t.roundRect(p,m,c,d,6),t.fill({color:dt.rug,alpha:.15}),t.roundRect(p+4,m+4,c-8,d-8,4),t.stroke({width:1.5,color:dt.rugBorder,alpha:.12}),t.roundRect(p+12,m+12,c-24,d-24,3),t.stroke({width:1,color:dt.rugPattern,alpha:.1}))}function JL(t,e,n){const i=e+ul/2,r=n+nu+8;for(let C=0;C<5;C++){const T=C/5*Math.PI*2-Math.PI/2,w=i+Math.cos(T)*10,k=r+14+Math.sin(T)*5;t.circle(w,k,2),t.fill(dt.chairWheel)}t.rect(i-1.5,r+4,3,12),t.fill(dt.chairBase),t.roundRect(i-14,r,28,10,4),t.fill(dt.chairSeat),t.roundRect(i-12,r+1,24,4,3),t.fill({color:dt.chairBack,alpha:.5}),t.roundRect(i-12,r-16,24,18,5),t.fill(dt.chairBack),t.roundRect(i-10,r-14,20,8,3),t.fill({color:16777215,alpha:.05}),t.roundRect(e+3,n+3,ul,nu,4),t.fill({color:0,alpha:.12}),t.roundRect(e,n,ul,nu,4),t.fill(dt.desk),t.roundRect(e+2,n+2,ul-4,nu-4,3),t.fill(dt.deskTop);for(let C=0;C<3;C++){const T=n+10+C*16;t.moveTo(e+6,T),t.lineTo(e+ul-6,T),t.stroke({width:.5,color:dt.deskShadow,alpha:.2})}t.rect(e+2,n+nu-6,ul-4,4),t.fill(dt.deskEdge);const s=4,l=8;t.rect(e+4,n+nu,s,l),t.fill(dt.deskLeg),t.rect(e+ul-4-s,n+nu,s,l),t.fill(dt.deskLeg);const c=32,d=22,p=e+(ul-c)/2,m=n+8;t.roundRect(p+c/2-10,m+d+4,20,4,2),t.fill(dt.monitorStand),t.rect(p+c/2-2,m+d,4,6),t.fill(dt.monitorStand),t.roundRect(p,m,c,d,2),t.fill(dt.monitor),t.roundRect(p+2,m+2,c-4,d-5,1),t.fill(dt.monitorScreen),t.roundRect(p+3,m+3,c-6,6,1),t.fill({color:dt.monitorScreenGlow,alpha:.3});const g=24,b=8,v=p+(c-g)/2,_=m+d+10;t.roundRect(v,_,g,b,2),t.fill(dt.keyboard);for(let C=0;C<3;C++)for(let T=0;T<6;T++)t.rect(v+2+T*3.5,_+1.5+C*2.5,2.5,1.5),t.fill(dt.keyboardKey);t.roundRect(e+ul-18,n+14,7,8,2),t.fill(14142664),t.roundRect(e+ul-11,n+16,3,4,1),t.fill(14142664),t.rect(e+8,n+20,14,18),t.fill(16775620),t.rect(e+8,n+20,14,2),t.fill(16635957),t.rect(e+10,n+24,10,1.5),t.fill(1402304)}function e8(t,e,n){t.roundRect(e+2,n+2,44,64,3),t.fill({color:0,alpha:.1}),t.roundRect(e,n,44,64,3),t.fill(dt.bookshelf),t.roundRect(e+1,n+1,42,62,2),t.stroke({width:1,color:dt.bookshelfEdge,alpha:.3}),t.rect(e+3,n+3,38,58),t.fill({color:6048310,alpha:.5});for(let i=0;i<3;i++){const r=n+8+i*20;t.rect(e+3,r+14,38,3),t.fill(dt.bookshelfEdge),t.rect(e+3,r+17,38,1),t.fill({color:0,alpha:.1});const s=4+i%2;for(let l=0;l<s;l++){const c=e+5+l*(34/s),d=Math.max(4,34/s-2),p=10+(l*3+i*2)%5,m=(l+i*3)%dt.bookColors.length;t.rect(c,r+14-p,d,p),t.fill(dt.bookColors[m]),t.rect(c+1,r+14-p+2,.8,p-4),t.fill({color:16777215,alpha:.15})}i===1&&(t.circle(e+38,r+8,4),t.fill({color:4367861,alpha:.6}),t.circle(e+38,r+8,4),t.stroke({width:.5,color:2001125,alpha:.4}))}t.roundRect(e+14,n-4,8,6,1),t.fill(dt.pot),t.circle(e+18,n-6,5),t.fill(dt.plantLight),t.circle(e+15,n-8,3),t.fill(dt.plant)}function Yw(t,e,n){t.ellipse(e+12,n+34,12,3),t.fill({color:0,alpha:.1}),t.moveTo(e+2,n+16),t.lineTo(e+4,n+32),t.lineTo(e+20,n+32),t.lineTo(e+22,n+16),t.closePath(),t.fill(dt.pot),t.roundRect(e,n+14,24,5,2),t.fill(dt.potRim),t.roundRect(e+2,n+14,20,2,1),t.fill({color:16777215,alpha:.08}),t.ellipse(e+12,n+16,10,3),t.fill(dt.soil),t.rect(e+11,n+2,2,14),t.fill(dt.plantDark),t.ellipse(e+6,n+4,7,5),t.fill(dt.plantDark),t.ellipse(e+18,n+2,6,5),t.fill(dt.plantDark),t.ellipse(e+12,n+1,8,6),t.fill(dt.plant),t.ellipse(e+4,n+8,6,4),t.fill(dt.plant),t.ellipse(e+20,n+8,6,4),t.fill(dt.plant),t.ellipse(e+9,n+5,5,4),t.fill(dt.plantLight),t.ellipse(e+15,n+3,5,4),t.fill(dt.plantLight),t.moveTo(e+12,n-2),t.lineTo(e+12,n+6),t.stroke({width:.5,color:dt.plantDark,alpha:.3})}function t8(t,e,n){t.roundRect(e+2,n+2,80,40,4),t.fill({color:0,alpha:.1}),t.roundRect(e,n,80,40,4),t.fill(Or.counter),t.roundRect(e+1,n+1,78,8,3),t.fill(Or.counterTop),t.roundRect(e+2,n+2,76,3,2),t.fill({color:16777215,alpha:.06}),t.roundRect(e+4,n-14,28,38,3),t.fill(Or.machine),t.roundRect(e+5,n-14,26,6,2),t.fill(Or.machineTop),t.roundRect(e+8,n+16,20,4,1),t.fill({color:2503224,alpha:.8}),t.rect(e+13,n+8,3,8),t.fill(Or.machineTop),t.rect(e+20,n+8,3,8),t.fill(Or.machineTop),t.circle(e+18,n-8,2.5),t.fill({color:Or.machineLight,alpha:.9}),t.circle(e+18,n-8,5),t.fill({color:Or.machineLight,alpha:.15}),t.roundRect(e+38,n+8,8,10,2),t.fill(Or.cup),t.roundRect(e+46,n+10,3,5,1),t.fill(Or.cup),t.roundRect(e+48,n+6,8,10,2),t.fill(Or.cupShadow),t.ellipse(e+42,n+20,10,3),t.fill(Or.saucer),t.roundRect(e+60,n+6,16,14,3),t.fill(Or.sink),t.roundRect(e+62,n+8,12,10,2),t.fill({color:5533306,alpha:.8}),t.rect(e+66,n-2,3,10),t.fill(Or.faucet),t.roundRect(e+65,n-4,8,3,1),t.fill(Or.faucet),t.roundRect(e+10,n-30,30,14,2),t.fill(Or.menu),t.rect(e+14,n-27,22,2),t.fill({color:16777215,alpha:.5}),t.rect(e+14,n-23,16,1.5),t.fill({color:16777215,alpha:.3}),t.rect(e+14,n-20,18,1.5),t.fill({color:16777215,alpha:.3})}function n8(t,e,n){t.roundRect(e-16,n-24,128,96,6),t.fill({color:Xa.carpet,alpha:.25}),t.roundRect(e-12,n-20,120,88,4),t.stroke({width:1,color:Xa.carpetPattern,alpha:.2});const i=e+10,r=n-20;t.roundRect(i+2,r+2,76,16,2),t.fill({color:0,alpha:.1}),t.roundRect(i,r,76,16,2),t.fill(Xa.whiteboardFrame),t.roundRect(i+2,r+2,72,12,1),t.fill(Xa.whiteboard),t.rect(i+6,r+4,18,8),t.fill({color:16775620,alpha:.6}),t.rect(i+28,r+4,18,8),t.fill({color:12312315,alpha:.6}),t.rect(i+50,r+4,18,8),t.fill({color:13166281,alpha:.6}),t.roundRect(i+20,r+14,36,3,1),t.fill(Xa.whiteboardFrame),t.roundRect(e+3,n+3,96,48,6),t.fill({color:0,alpha:.1}),t.roundRect(e,n,96,48,6),t.fill(Xa.table),t.roundRect(e+2,n+2,92,44,5),t.fill(Xa.tableTop),t.roundRect(e+6,n+4,40,10,3),t.fill({color:16777215,alpha:.04}),t.roundRect(e+1,n+1,94,46,5),t.stroke({width:1,color:Xa.tableEdge,alpha:.4});const s=4,l=6;t.rect(e+8,n+48,s,l),t.fill(Xa.tableLeg),t.rect(e+84,n+48,s,l),t.fill(Xa.tableLeg);const c=[{cx:e+16,cy:n-10},{cx:e+48,cy:n-10},{cx:e+80,cy:n-10},{cx:e+16,cy:n+56},{cx:e+48,cy:n+56},{cx:e+80,cy:n+56}];for(const d of c){const m=d.cy<n?d.cy-6:d.cy+6;t.roundRect(d.cx-8,m-4,16,10,3),t.fill(Xa.chairBack),t.roundRect(d.cx-7,d.cy-4,14,8,3),t.fill(Xa.chairSeat),t.roundRect(d.cx-5,d.cy-3,10,3,2),t.fill({color:16777215,alpha:.06}),t.circle(d.cx,d.cy+5,2),t.fill(Xa.chair)}t.roundRect(e+10,n+8,18,12,2),t.fill(3622735),t.roundRect(e+11,n+9,16,8,1),t.fill(4545124),t.rect(e+60,n+12,12,16),t.fill({color:16777215,alpha:.7}),t.rect(e+62,n+14,8,1),t.fill({color:3355443,alpha:.3}),t.rect(e+62,n+17,6,1),t.fill({color:3355443,alpha:.3}),t.roundRect(e+40,n+10,6,14,2),t.fill({color:4367861,alpha:.6}),t.roundRect(e+41,n+7,4,4,1),t.fill({color:9489145,alpha:.5})}const i8={running:hf.statusRunning,idle:hf.statusIdle,completed:hf.statusCompleted,checkpoint:hf.statusCheckpoint};function r8(t,e,n,i){const r=n*.85,s=e+(n-r)/2,l=6,c=30;t.roundRect(s+2,l+2,r,c,8),t.fill({color:0,alpha:.15}),t.roundRect(s,l,r,c,8),t.fill({color:hf.background,alpha:.85}),t.roundRect(s+2,l+1,r-4,8,6),t.fill({color:hf.backgroundGlow,alpha:.4}),t.roundRect(s,l,r,c,8),t.stroke({width:1,color:16777215,alpha:.08});const d=i8[i]??hf.statusIdle,p=s+r-18,m=l+c/2;t.circle(p,m,7),t.fill({color:d,alpha:.2}),t.circle(p,m,4),t.fill(d),t.circle(p-1,m-1,1.5),t.fill({color:16777215,alpha:.3}),t.circle(s+14,m,2),t.fill({color:16777215,alpha:.1})}ib({Container:br,Graphics:Aa,Sprite:sh,Text:nb});function l1({agent:t,textures:e,bubbleText:n,animX:i,animY:r,animPose:s}){const l=KL(t.colorIndex,s),c=e.get(l),d=RD[t.status==="walking"?"idle":t.status]??8947848,p=t.status==="checkpoint",m=U.useCallback(b=>{b.clear(),b.circle(0,0,d0/2+6),b.fill({color:d,alpha:p?.4:.15})},[d,p]),g=U.useCallback(b=>{if(b.clear(),!n)return;const v=Math.min(n.length*5+16,160);b.roundRect(-v/2,-42,v,22,6),b.fill({color:1710638,alpha:.9}),b.moveTo(-4,-20),b.lineTo(4,-20),b.lineTo(0,-15),b.closePath(),b.fill({color:1710638,alpha:.9})},[n]);return A.jsxs("container",{x:i,y:r,children:[A.jsx("graphics",{draw:m}),c&&A.jsx("sprite",{texture:c,anchor:.5}),A.jsx("text",{text:t.name,y:d0/2+4,anchor:{x:.5,y:0},style:{fontSize:9,fill:"#cccccc",fontFamily:"sans-serif"}}),p&&A.jsx("text",{text:"⚠",y:-d0/2-12,anchor:.5,style:{fontSize:14,fill:"#ff9800",fontFamily:"sans-serif"}}),n&&A.jsxs(A.Fragment,{children:[A.jsx("graphics",{draw:g}),A.jsx("text",{text:n.length>80?n.slice(-80)+"…":n,y:-31,anchor:{x:.5,y:.5},style:{fontSize:8,fill:"#ffffff",fontFamily:"sans-serif",wordWrap:!0,wordWrapWidth:140}})]})]})}ib({Container:br,Graphics:Aa,Text:nb});function a8({squadName:t,status:e,agents:n,textures:i,bubbles:r,animStates:s,originX:l,originY:c,roomWidth:d,roomHeight:p}){const m={x:0,y:0},g=gm(m,d,p),b=DC(m,d,p),v=U.useCallback(_=>{_.clear(),QL(_,d,p),r8(_,0,d,e);for(let C=0;C<n.length;C++){const T=Qd(C,m);JL(_,T.x-48,T.y-32)}t8(_,g.x,g.y),n8(_,b.x,b.y),e8(_,d-60,44),Yw(_,10,p-50),Yw(_,d-40,50)},[n.length,e,d,p]);return A.jsxs("container",{x:l,y:c,children:[A.jsx("graphics",{draw:v}),A.jsx("text",{text:t,x:d/2,y:22,anchor:.5,style:{fontSize:14,fill:"#ffffff",fontFamily:"sans-serif",fontWeight:"bold"}}),n.map(_=>{const C=`${t}:${_.id}`,T=r[C],w=s[_.id];return w!=null&&w.isExternalTransit?null:A.jsx(l1,{agent:_,textures:i,bubbleText:(T==null?void 0:T.text)??null,animX:(w==null?void 0:w.x)??_.position.x,animY:(w==null?void 0:w.y)??_.position.y,animPose:(w==null?void 0:w.pose)??(_.status==="working"?"typing":"seated")},_.id)})]})}function s8(t,e,n,i,r){t.rect(e,n,i,r),t.fill(Sa.floor);const s=16,l=60;for(let K=0;K<Math.ceil(r/s);K++){const G=K%2*(l/2),te=n+K*s;t.moveTo(e,te),t.lineTo(e+i,te),t.stroke({width:.5,color:4861984,alpha:.3});for(let H=0;H<Math.ceil(i/l)+1;H++){const W=e+H*l-G;W>e&&W<e+i&&(t.moveTo(W,te),t.lineTo(W,te+s),t.stroke({width:.5,color:4861984,alpha:.2}))}}const c=30,d=i-c*2,p=r-c*2,m=e+c,g=n+c;t.roundRect(m+2,g+2,d,p,6),t.fill({color:0,alpha:.1}),t.roundRect(m,g,d,p,6),t.fill({color:Sa.carpet,alpha:.6}),t.roundRect(m+6,g+6,d-12,p-12,4),t.stroke({width:1.5,color:Sa.carpetBorder,alpha:.4}),t.roundRect(m+14,g+14,d-28,p-28,3),t.stroke({width:1,color:16766287,alpha:.15});const b=e+8,v=n+40,_=6,C=80;t.roundRect(b-2,v-2,_+4,C+4,2),t.fill(Sa.windowFrame),t.roundRect(b,v,_,C,1),t.fill(Sa.window),t.rect(b+1,v+4,2,C/3),t.fill({color:16777215,alpha:.2}),t.roundRect(b-4,v+C+2,_+8,3,1),t.fill(Sa.windowSill);const T=120,w=60,k=e+i/2-T/2,R=n+r/2-w/2-10;t.roundRect(k+3,R+3,T,w,4),t.fill({color:0,alpha:.12}),t.roundRect(k,R,T,w,4),t.fill(Sa.desk),t.roundRect(k+3,R+3,T-6,w-6,3),t.fill(Sa.deskTop),t.roundRect(k+1,R+1,T-2,w-2,4),t.stroke({width:1,color:Sa.deskEdge,alpha:.3}),t.roundRect(k+20,R+8,32,22,2),t.fill(2236976),t.roundRect(k+22,R+10,28,16,1),t.fill(1981020),t.roundRect(k+18,R+34,36,10,2),t.fill(3355456),t.rect(k+70,R+10,16,22),t.fill({color:16777215,alpha:.7}),t.rect(k+72,R+14,10,1),t.fill({color:3355443,alpha:.3}),t.rect(k+72,R+17,8,1),t.fill({color:3355443,alpha:.3}),t.roundRect(k+90,R+12,10,14,2),t.fill(3622735),t.circle(k+100,R+42,5),t.fill(14142664),t.circle(k+100,R+42,3),t.fill(7951688);const O=k+T/2,j=R+w+16;t.roundRect(O-14,j-4,28,16,6),t.fill(Sa.chair),t.roundRect(O-12,j-8,24,12,4),t.fill(Sa.chairSeat),t.roundRect(O-8,j-6,16,4,2),t.fill({color:16777215,alpha:.06}),t.circle(O,j+14,3),t.fill(4473924);for(const K of[-8,0,8])t.circle(O+K,j+18,1.5),t.fill(3355443);const D=e+i-54,F=n+20;t.roundRect(D,F,44,80,3),t.fill(Sa.bookshelf);const $=[15022389,2001125,4431943,16750592,9315498,35195];for(let K=0;K<3;K++){const G=F+8+K*26;t.rect(D+3,G+18,38,3),t.fill(9139029);for(let te=0;te<5;te++){const H=D+5+te*7,W=12+(te*3+K*2)%6;t.rect(H,G+18-W,5,W),t.fill($[(te+K*2)%$.length])}}const P=e+i-54,I=n+r-60;t.roundRect(P,I+10,24,16,2),t.fill(6111287),t.rect(P+10,I+4,4,8),t.fill(7901340),t.circle(P+12,I,10),t.fill(Sa.globe),t.circle(P+12,I,10),t.stroke({width:.5,color:2001125,alpha:.4}),t.circle(P+9,I-3,3),t.fill({color:16777215,alpha:.15}),t.roundRect(k+44,R+38,36,10,2),t.fill(Sa.nameplate),t.roundRect(k+44,R+38,36,10,2),t.stroke({width:.5,color:13215744,alpha:.5}),t.rect(e,n,i,r),t.stroke({width:1,color:0,alpha:.08})}ib({Container:br,Graphics:Aa,Text:nb});const Vw=["Precisamos escalar o time de vendas...","O Q4 vai ser decisivo.","Investir mais em marketing digital.","Meta trimestral no caminho certo.","Revisar budget de R&D...","Nova parceria pode mudar tudo.","Churn rate precisa cair 20%.","Hora de expandir para LATAM.","Reunião com investidores amanhã.","NPS subiu 15 pontos!","Cultura da empresa vem primeiro.","Mais dados antes de decidir.","Vamos automatizar esse processo.","Roadmap do próximo quarter...","Reter talentos é prioridade.","Revenue cresceu 30% no trimestre.","Precisamos de mais diversidade no time.","O mercado está mudando rápido.","Foco no cliente sempre.","Inovação é nosso diferencial."],Py=900,Xw=2400,l8=6e3,o8={id:"ceo",name:"CEO",colorIndex:3,status:"working",deskIndex:0,position:{x:0,y:0},targetPosition:null};function c8({x:t,y:e,width:n,height:i,textures:r,ticker:s}){const[l,c]=U.useState(null),[d,p]=U.useState("seated"),m=U.useRef(0),g=U.useRef(Py+Math.floor(Math.random()*(Xw-Py))),b=U.useRef(null),v=n/2,_=i/2+10,C=U.useCallback(T=>{T.clear(),s8(T,0,0,n,i)},[n,i]);return U.useEffect(()=>{if(!s)return;const T=()=>{m.current++;const w=m.current,k=Math.floor(w/48)%2===0?"typing":"seated";if(p(k),g.current--,g.current<=0){const R=Vw[Math.floor(Math.random()*Vw.length)];c(R),p("standing"),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{c(null)},l8),g.current=Py+Math.floor(Math.random()*(Xw-Py))}};return s.add(T),()=>{s.remove(T),b.current&&clearTimeout(b.current)}},[s]),A.jsxs("container",{x:t,y:e,children:[A.jsx("graphics",{draw:C}),A.jsx("text",{text:"CEO",x:n/2,y:12,anchor:.5,style:{fontSize:13,fill:"#ffd700",fontFamily:"sans-serif",fontWeight:"bold"}}),A.jsx(l1,{agent:o8,textures:r,bubbleText:l,animX:v,animY:_,animPose:d})]})}const Xx=150,u8=48,Kx=30,Gy=3,f8=4e3,Fy=600,Wx=1800,d8=60,Kw=900,Ww=5e3,$w=[["Cafe novo?","Sim, colombiano!"],["Viu o deploy?","Passou nos testes!"],["Reuniao as 3?","Vou confirmar."],["Bug no login?","Ja corrigi."],["Almoco onde?","Sushi hoje?"],["PR aprovado?","Mergeei agora."],["Ta ocupado?","Pode falar."],["Deadline?","Sexta-feira."],["Novo feature?","Ficou muito bom!"],["Ajuda aqui?","Claro, mostra."],["Sprint review?","Amanha cedo."],["Stand-up?","Ja comecou!"],["Refatorei aquele modulo.","Ficou mais limpo."],["Testes passando?","Todos verdes!"],["Viu o Figma?","Design top!"],["Pipeline rodou?","Em 2 min."],["Code review?","Ja olhei, aprovo."],["Qual branch?","feature/office."],["Bom dia!","Bom dia! Tudo bem?"],["Feriado proximo?","Semana que vem!"]];function h8(t,e,n,i,r,s){const l={x:0,y:0},c=Math.random();if(c<.2){const d={x:r+t.x,y:s+t.y},p=ym(d,`squad-${i}`,"kitchen",n),m=ID(n);return{x:m.x,y:m.y,destination:"kitchen",waypoints:p,isExternal:!0}}else if(c<.35){const d={x:r+t.x,y:s+t.y},p=ym(d,`squad-${i}`,"rest-area",n),m=jD(n);return{x:m.x,y:m.y,destination:"restArea",waypoints:p,isExternal:!0}}else if(c<.45){const d=Math.random()<.5?"male":"female",p={x:r+t.x,y:s+t.y},m=d==="male"?"bathroom-male":"bathroom-female",g=ym(p,`squad-${i}`,m,n),b=UD(n,d);return{x:b.x,y:b.y,destination:m,waypoints:g,isExternal:!0}}else if(c<.6){const d=DC(l,e.width,e.height);return{x:d.x+(Math.random()-.5)*40,y:d.y+(Math.random()-.5)*30,destination:"meeting"}}else if(c<.75){const d=gm(l,e.width,e.height);return{x:d.x+(Math.random()-.5)*30,y:d.y+(Math.random()-.5)*20,destination:"coffee"}}else if(c<.9){const d={x:r+t.x,y:s+t.y},p=HD(n),m=[d,n.doorPoints[`squad-${i}`],p];return{x:p.x,y:p.y,destination:"corridor",waypoints:m,isExternal:!0}}else{const d=Math.floor(Math.random()*4),p=Qd(d,l,e.width,e.height);return{x:p.x+(Math.random()-.5)*40,y:p.y+(Math.random()-.5)*20,destination:"neighbor"}}}function p8(t){const[e,n]=U.useState({}),i=U.useRef({}),r=U.useRef({}),s=U.useRef({}),l=U.useRef({}),c=U.useRef(0),d=U.useRef({}),p=U.useRef({});U.useEffect(()=>{const g=ri.subscribe((b,v)=>{var T,w;const _=b.bubbles,C=v.bubbles;for(const k of Object.keys(_))if(((T=_[k])==null?void 0:T.updatedAt)!==((w=C[k])==null?void 0:w.updatedAt)){d.current[k]&&clearTimeout(d.current[k]);const[R,O]=k.split(":");d.current[k]=setTimeout(()=>{ri.getState().clearBubble(R,O),delete d.current[k]},f8)}});return()=>{g();for(const b of Object.values(d.current))clearTimeout(b);d.current={}}},[]);const m=U.useCallback(()=>{c.current++;const g=c.current,b=ri.getState(),v={},_=S0(b.rooms.length);for(const[C,T]of Object.entries(b.agentVisuals)){i.current[C]||(i.current[C]={}),r.current[C]||(r.current[C]={}),v[C]={};const w=b.rooms.indexOf(C),k=_.squadOrigins[w],R=(k==null?void 0:k.origin)??{x:0,y:0},O=[];for(const j of T){const D=i.current[C],F=r.current[C],$=`${C}:${j.id}`;F[j.id]||(F[j.id]={x:j.position.x,y:j.position.y,baseY:j.position.y},s.current[$]=Math.floor(Math.random()*Wx));const P=F[j.id];if(j.targetPosition&&(!D[j.id]||D[j.id].progress>=1)){const K=D[j.id];if(K!=null&&K.isExternalTransit){const G=K.globalX??P.x+R.x,te=K.globalY??P.y+R.y,H={x:G,y:te},W={x:j.targetPosition.x+R.x,y:j.targetPosition.y+R.y},B=l.current[$],X=B==="kitchen"?"kitchen":B==="restArea"?"rest-area":B==="bathroom-male"?"bathroom-male":B==="bathroom-female"?"bathroom-female":`squad-${w}`,Z=ym(H,X,`squad-${w}`,_);Z[Z.length-1]=W;const Q=Z.shift(),q=Z.length>0?Z.shift():Q,Y=Ty(Q,q);D[j.id]={startX:Q.x,startY:Q.y,targetX:q.x,targetY:q.y,progress:0,duration:Math.max(30,Math.ceil(Y/Gy)),baseY:j.targetPosition.y,waypointQueue:Z,isExternalTransit:!0,globalX:G,globalY:te}}else D[j.id]={startX:P.x,startY:P.baseY,targetX:j.targetPosition.x,targetY:j.targetPosition.y,progress:0,duration:Xx,baseY:j.targetPosition.y,waypointQueue:[],isExternalTransit:!1}}if(j.status==="idle"&&(!D[j.id]||D[j.id].progress>=1)){const K=D[j.id];if(K!=null&&K.isExternalTransit&&K.waypointQueue.length===0&&K.progress>=1&&(K.globalX!==void 0&&K.globalY!==void 0&&(P.x=K.globalX-R.x,P.y=K.globalY-R.y,P.baseY=P.y),K.isExternalTransit=!1,K.globalX=void 0,K.globalY=void 0),s.current[$]===void 0&&(s.current[$]=Fy+Math.floor(Math.random()*(Wx-Fy))),s.current[$]--,s.current[$]<=0){const G=D[j.id];if(G!=null&&G.isExternalTransit){const te=G.globalX??P.x+R.x,H=G.globalY??P.y+R.y,W={x:te,y:H},B=Qd(j.deskIndex,{x:0,y:0}),X={x:B.x+R.x,y:B.y+R.y},Z=l.current[$],Q=Z==="kitchen"?"kitchen":Z==="restArea"?"rest-area":Z==="bathroom-male"?"bathroom-male":Z==="bathroom-female"?"bathroom-female":`squad-${w}`,q=ym(W,Q,`squad-${w}`,_);q[q.length-1]=X;const Y=q.shift(),ee=q.length>0?q.shift():Y,V=Ty(Y,ee);l.current[$]="neighbor",D[j.id]={startX:Y.x,startY:Y.y,targetX:ee.x,targetY:ee.y,progress:0,duration:Math.max(30,Math.ceil(V/Gy)),baseY:B.y,waypointQueue:q,isExternalTransit:!0,globalX:te,globalY:H}}else{const H=h8(R,k??{width:Qo,height:$a},_,w,P.x,P.baseY);if(l.current[$]=H.destination,H.isExternal&&H.waypoints&&H.waypoints.length>1){const W=[...H.waypoints],B=W.shift(),X=W.length>0?W.shift():B,Z=Ty(B,X);D[j.id]={startX:B.x,startY:B.y,targetX:X.x,targetY:X.y,progress:0,duration:Math.max(30,Math.ceil(Z/Gy)),baseY:H.y-R.y,waypointQueue:W,isExternalTransit:!0,globalX:B.x,globalY:B.y}}else D[j.id]={startX:P.x,startY:P.baseY,targetX:H.x,targetY:H.y,progress:0,duration:Xx+Math.floor(Math.random()*30),baseY:H.y,waypointQueue:[],isExternalTransit:!1}}s.current[$]=Fy+Math.floor(Math.random()*(Wx-Fy))}}const I=D[j.id];if(I&&I.progress<1){I.progress=Math.min(1,I.progress+1/I.duration);const K=zD(I.progress);if(I.isExternalTransit){const G=wy(I.startX,I.targetX,K),te=wy(I.startY,I.targetY,K);I.globalX=G,I.globalY=te,P.x=G-R.x,P.y=te-R.y;const H=Math.floor(g/Kx)%2===0?"walk-right":"walk-left";v[C][j.id]={x:P.x,y:P.y,pose:H,isExternalTransit:!0,globalX:G,globalY:te}}else{P.x=wy(I.startX,I.targetX,K),P.y=wy(I.startY,I.targetY,K),P.baseY=I.baseY;const G=Math.floor(g/Kx)%2===0?"walk-right":"walk-left";v[C][j.id]={x:P.x,y:P.y,pose:G}}}else if(I&&I.progress>=1&&I.waypointQueue.length>0){const K=I.waypointQueue.shift(),G={x:I.targetX,y:I.targetY},te=Ty(G,K);I.startX=I.targetX,I.startY=I.targetY,I.targetX=K.x,I.targetY=K.y,I.progress=0,I.duration=I.isExternalTransit?Math.max(30,Math.ceil(te/Gy)):Xx,I.isExternalTransit&&(I.globalX=I.startX,I.globalY=I.startY);const H=Math.floor(g/Kx)%2===0?"walk-right":"walk-left";I.isExternalTransit?v[C][j.id]={x:P.x,y:P.y,pose:H,isExternalTransit:!0,globalX:I.startX,globalY:I.startY}:v[C][j.id]={x:P.x,y:P.y,pose:H}}else if(j.status==="working"){const K=Math.floor(g/u8)%2===0?"typing":"seated";v[C][j.id]={x:P.x,y:P.baseY,pose:K}}else if(j.status==="idle"){const K=l.current[$]??"coffee",G=D[j.id];if((G==null?void 0:G.isExternalTransit)??!1)v[C][j.id]={x:P.x,y:P.y,pose:"standing",isExternalTransit:!0,globalX:(G==null?void 0:G.globalX)??P.x+R.x,globalY:(G==null?void 0:G.globalY)??P.y+R.y};else{const H=Math.sin(g*.07+j.deskIndex*1.5)*2;let W;K==="coffee"||K==="kitchen"?W="coffee":K==="meeting"||K==="neighbor"?W=Math.floor(g/90)%2===0?"standing":"coffee":K==="restArea"?W="seated":(K.startsWith("bathroom"),W="standing"),v[C][j.id]={x:P.x,y:P.baseY+H,pose:W},O.push({agentKey:$,agentId:j.id,agentName:j.name,x:P.x,y:P.baseY})}}else j.status==="checkpoint"?v[C][j.id]={x:P.x,y:P.baseY,pose:"seated"}:v[C][j.id]={x:P.x,y:P.baseY,pose:"seated"}}if(g%60===0&&O.length>=2)for(let j=0;j<O.length;j++){const D=O[j];if(!(p.current[D.agentKey]&&g-p.current[D.agentKey]<Kw)&&!b.bubbles[D.agentKey])for(let F=j+1;F<O.length;F++){const $=O[F];if(p.current[$.agentKey]&&g-p.current[$.agentKey]<Kw||b.bubbles[$.agentKey])continue;const P=D.x-$.x,I=D.y-$.y;if(Math.sqrt(P*P+I*I)<d8){const[G,te]=$w[Math.floor(Math.random()*$w.length)];b.appendBubble(C,D.agentId,G),setTimeout(()=>{ri.getState().appendBubble(C,$.agentId,te)},1500),p.current[D.agentKey]=g,p.current[$.agentKey]=g;const H=`${C}:${D.agentId}`,W=`${C}:${$.agentId}`;d.current[H]&&clearTimeout(d.current[H]),d.current[W]&&clearTimeout(d.current[W]),d.current[H]=setTimeout(()=>{ri.getState().clearBubble(C,D.agentId),delete d.current[H]},Ww),d.current[W]=setTimeout(()=>{ri.getState().clearBubble(C,$.agentId),delete d.current[W]},Ww+1500);break}}}}n(v)},[]);return U.useEffect(()=>{if(t)return t.add(m),()=>{t.remove(m)}},[t,m]),e}ib({Container:br,Graphics:Aa,Text:nb});const m8=.3,g8=2;function y8(){const{app:t}=FL(),e=U.useRef(null),[n,i]=U.useState(new Map),r=U.useRef(null),s=ri(b=>b.rooms),l=ri(b=>b.agentVisuals),c=ri(b=>b.bubbles),d=Ja(b=>b.activeStates),p=p8((t==null?void 0:t.ticker)??null),m=U.useMemo(()=>S0(s.length),[s.length]);U.useEffect(()=>{t!=null&&t.renderer&&i(XL(t))},[t]);const g=U.useCallback(b=>{b.clear(),WL(b,m),qw(b,m.bathroomMale.x,m.bathroomMale.y,m.bathroomMale.width,m.bathroomMale.height,"male"),qw(b,m.bathroomFemale.x,m.bathroomFemale.y,m.bathroomFemale.width,m.bathroomFemale.height,"female"),$L(b,m.kitchen.x,m.kitchen.y,m.kitchen.width,m.kitchen.height),ZL(b,m.restArea.x,m.restArea.y,m.restArea.width,m.restArea.height)},[m]);return U.useEffect(()=>{const b=t==null?void 0:t.canvas;if(!b)return;const v=w=>{const k=e.current;k&&(r.current={startX:w.clientX,startY:w.clientY,pivotX:k.position.x,pivotY:k.position.y},b.setPointerCapture(w.pointerId))},_=w=>{const k=e.current,R=r.current;!k||!R||(k.position.x=R.pivotX+(w.clientX-R.startX),k.position.y=R.pivotY+(w.clientY-R.startY))},C=w=>{r.current=null,b.releasePointerCapture(w.pointerId)},T=w=>{w.preventDefault();const k=e.current;if(!k)return;const R=k.scale.x,O=w.deltaY>0?.9:1.1,j=Math.max(m8,Math.min(g8,R*O)),D=b.getBoundingClientRect(),F=w.clientX-D.left,$=w.clientY-D.top,P=j/R;k.position.x=F-(F-k.position.x)*P,k.position.y=$-($-k.position.y)*P,k.scale.set(j)};return b.addEventListener("pointerdown",v),b.addEventListener("pointermove",_),b.addEventListener("pointerup",C),b.addEventListener("pointerleave",C),b.addEventListener("wheel",T,{passive:!1}),()=>{b.removeEventListener("pointerdown",v),b.removeEventListener("pointermove",_),b.removeEventListener("pointerup",C),b.removeEventListener("pointerleave",C),b.removeEventListener("wheel",T)}},[t]),A.jsxs("container",{ref:e,children:[A.jsx("graphics",{draw:g}),m.corridorV.height>0&&A.jsx("text",{text:"Corredor",x:m.corridorV.x+m.corridorV.width/2,y:m.corridorV.y+8,anchor:{x:.5,y:0},style:{fontSize:11,fill:"#666666",fontFamily:"sans-serif",fontWeight:"bold"}}),A.jsx("text",{text:"Corredor",x:m.corridorH.x+m.corridorH.width/2,y:m.corridorH.y+8,anchor:{x:.5,y:0},style:{fontSize:11,fill:"#666666",fontFamily:"sans-serif",fontWeight:"bold"}}),A.jsx("text",{text:"WC ♂",x:m.bathroomMale.x+m.bathroomMale.width/2,y:m.bathroomMale.y+m.bathroomMale.height-8,anchor:{x:.5,y:1},style:{fontSize:10,fill:"#546e7a",fontFamily:"sans-serif",fontWeight:"bold"}}),A.jsx("text",{text:"WC ♀",x:m.bathroomFemale.x+m.bathroomFemale.width/2,y:m.bathroomFemale.y+m.bathroomFemale.height-8,anchor:{x:.5,y:1},style:{fontSize:10,fill:"#546e7a",fontFamily:"sans-serif",fontWeight:"bold"}}),A.jsx("text",{text:"Cozinha",x:m.kitchen.x+m.kitchen.width/2,y:m.kitchen.y+12,anchor:{x:.5,y:0},style:{fontSize:10,fill:"#795548",fontFamily:"sans-serif",fontWeight:"bold"}}),A.jsx("text",{text:"Descanso",x:m.restArea.x+m.restArea.width/2,y:m.restArea.y+12,anchor:{x:.5,y:0},style:{fontSize:10,fill:"#546e7a",fontFamily:"sans-serif",fontWeight:"bold"}}),s.map((b,v)=>{var k;const _=m.squadOrigins[v];if(!_)return null;const C=l[b]??[],T=((k=d[b])==null?void 0:k.status)??"idle",w=p[b]??{};return A.jsx(a8,{squadName:b,status:T,agents:C,textures:n,bubbles:c,animStates:w,originX:_.origin.x,originY:_.origin.y,roomWidth:_.width,roomHeight:_.height},b)}),s.map((b,v)=>{const _=l[b]??[],C=p[b]??{};return _.filter(T=>{const w=C[T.id];return(w==null?void 0:w.isExternalTransit)&&w.globalX!==void 0&&w.globalY!==void 0}).map(T=>{const w=C[T.id],k=`${b}:${T.id}`,R=c[k];return A.jsx(l1,{agent:T,textures:n,bubbleText:(R==null?void 0:R.text)??null,animX:w.globalX,animY:w.globalY,animPose:w.pose},`transit-${T.id}`)})}),A.jsx(c8,{x:m.ceoOffice.x,y:m.ceoOffice.y,width:m.ceoOffice.width,height:m.ceoOffice.height,textures:n,ticker:(t==null?void 0:t.ticker)??null})]})}function b8(){const t=ri(i=>i.activeRoom),e=ri(i=>i.checkpoints),n=t?e[t]:void 0;return A.jsx("div",{style:{display:"flex",height:"100%"},children:A.jsxs("div",{style:{flex:1,position:"relative",overflow:"hidden"},children:[A.jsx(GL,{background:13158600,antialias:!0,resizeTo:window,style:{width:"100%",height:"100%"},children:A.jsx(y8,{})}),n&&A.jsx(qL,{agentName:n.agentName,question:n.question,onRespond:i=>MD(t,i)})]})})}function x8(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const v8=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_8=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,S8={};function Zw(t,e){return(S8.jsx?_8:v8).test(t)}const E8=/[ \t\n\f\r]/g;function w8(t){return typeof t=="object"?t.type==="text"?Qw(t.value):!1:Qw(t)}function Qw(t){return t.replace(E8,"")===""}class $m{constructor(e,n,i){this.normal=n,this.property=e,i&&(this.space=i)}}$m.prototype.normal={};$m.prototype.property={};$m.prototype.space=void 0;function SM(t,e){const n={},i={};for(const r of t)Object.assign(n,r.property),Object.assign(i,r.normal);return new $m(n,i,e)}function s_(t){return t.toLowerCase()}class Na{constructor(e,n){this.attribute=n,this.property=e}}Na.prototype.attribute="";Na.prototype.booleanish=!1;Na.prototype.boolean=!1;Na.prototype.commaOrSpaceSeparated=!1;Na.prototype.commaSeparated=!1;Na.prototype.defined=!1;Na.prototype.mustUseProperty=!1;Na.prototype.number=!1;Na.prototype.overloadedBoolean=!1;Na.prototype.property="";Na.prototype.spaceSeparated=!1;Na.prototype.space=void 0;let T8=0;const Ct=Af(),ki=Af(),l_=Af(),De=Af(),In=Af(),Jd=Af(),Qa=Af();function Af(){return 2**++T8}const o_=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ct,booleanish:ki,commaOrSpaceSeparated:Qa,commaSeparated:Jd,number:De,overloadedBoolean:l_,spaceSeparated:In},Symbol.toStringTag,{value:"Module"})),$x=Object.keys(o_);class o1 extends Na{constructor(e,n,i,r){let s=-1;if(super(e,n),Jw(this,"space",r),typeof i=="number")for(;++s<$x.length;){const l=$x[s];Jw(this,$x[s],(i&o_[l])===o_[l])}}}o1.prototype.defined=!0;function Jw(t,e,n){n&&(t[e]=n)}function _h(t){const e={},n={};for(const[i,r]of Object.entries(t.properties)){const s=new o1(i,t.transform(t.attributes||{},i),r,t.space);t.mustUseProperty&&t.mustUseProperty.includes(i)&&(s.mustUseProperty=!0),e[i]=s,n[s_(i)]=i,n[s_(s.attribute)]=i}return new $m(e,n,t.space)}const EM=_h({properties:{ariaActiveDescendant:null,ariaAtomic:ki,ariaAutoComplete:null,ariaBusy:ki,ariaChecked:ki,ariaColCount:De,ariaColIndex:De,ariaColSpan:De,ariaControls:In,ariaCurrent:null,ariaDescribedBy:In,ariaDetails:null,ariaDisabled:ki,ariaDropEffect:In,ariaErrorMessage:null,ariaExpanded:ki,ariaFlowTo:In,ariaGrabbed:ki,ariaHasPopup:null,ariaHidden:ki,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:In,ariaLevel:De,ariaLive:null,ariaModal:ki,ariaMultiLine:ki,ariaMultiSelectable:ki,ariaOrientation:null,ariaOwns:In,ariaPlaceholder:null,ariaPosInSet:De,ariaPressed:ki,ariaReadOnly:ki,ariaRelevant:null,ariaRequired:ki,ariaRoleDescription:In,ariaRowCount:De,ariaRowIndex:De,ariaRowSpan:De,ariaSelected:ki,ariaSetSize:De,ariaSort:null,ariaValueMax:De,ariaValueMin:De,ariaValueNow:De,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function wM(t,e){return e in t?t[e]:e}function TM(t,e){return wM(t,e.toLowerCase())}const C8=_h({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Jd,acceptCharset:In,accessKey:In,action:null,allow:null,allowFullScreen:Ct,allowPaymentRequest:Ct,allowUserMedia:Ct,alt:null,as:null,async:Ct,autoCapitalize:null,autoComplete:In,autoFocus:Ct,autoPlay:Ct,blocking:In,capture:null,charSet:null,checked:Ct,cite:null,className:In,cols:De,colSpan:null,content:null,contentEditable:ki,controls:Ct,controlsList:In,coords:De|Jd,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ct,defer:Ct,dir:null,dirName:null,disabled:Ct,download:l_,draggable:ki,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ct,formTarget:null,headers:In,height:De,hidden:l_,high:De,href:null,hrefLang:null,htmlFor:In,httpEquiv:In,id:null,imageSizes:null,imageSrcSet:null,inert:Ct,inputMode:null,integrity:null,is:null,isMap:Ct,itemId:null,itemProp:In,itemRef:In,itemScope:Ct,itemType:In,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ct,low:De,manifest:null,max:null,maxLength:De,media:null,method:null,min:null,minLength:De,multiple:Ct,muted:Ct,name:null,nonce:null,noModule:Ct,noValidate:Ct,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ct,optimum:De,pattern:null,ping:In,placeholder:null,playsInline:Ct,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ct,referrerPolicy:null,rel:In,required:Ct,reversed:Ct,rows:De,rowSpan:De,sandbox:In,scope:null,scoped:Ct,seamless:Ct,selected:Ct,shadowRootClonable:Ct,shadowRootDelegatesFocus:Ct,shadowRootMode:null,shape:null,size:De,sizes:null,slot:null,span:De,spellCheck:ki,src:null,srcDoc:null,srcLang:null,srcSet:null,start:De,step:null,style:null,tabIndex:De,target:null,title:null,translate:null,type:null,typeMustMatch:Ct,useMap:null,value:ki,width:De,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:In,axis:null,background:null,bgColor:null,border:De,borderColor:null,bottomMargin:De,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ct,declare:Ct,event:null,face:null,frame:null,frameBorder:null,hSpace:De,leftMargin:De,link:null,longDesc:null,lowSrc:null,marginHeight:De,marginWidth:De,noResize:Ct,noHref:Ct,noShade:Ct,noWrap:Ct,object:null,profile:null,prompt:null,rev:null,rightMargin:De,rules:null,scheme:null,scrolling:ki,standby:null,summary:null,text:null,topMargin:De,valueType:null,version:null,vAlign:null,vLink:null,vSpace:De,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ct,disableRemotePlayback:Ct,prefix:null,property:null,results:De,security:null,unselectable:null},space:"html",transform:TM}),A8=_h({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Qa,accentHeight:De,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:De,amplitude:De,arabicForm:null,ascent:De,attributeName:null,attributeType:null,azimuth:De,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:De,by:null,calcMode:null,capHeight:De,className:In,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:De,diffuseConstant:De,direction:null,display:null,dur:null,divisor:De,dominantBaseline:null,download:Ct,dx:null,dy:null,edgeMode:null,editable:null,elevation:De,enableBackground:null,end:null,event:null,exponent:De,externalResourcesRequired:null,fill:null,fillOpacity:De,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Jd,g2:Jd,glyphName:Jd,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:De,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:De,horizOriginX:De,horizOriginY:De,id:null,ideographic:De,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:De,k:De,k1:De,k2:De,k3:De,k4:De,kernelMatrix:Qa,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:De,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:De,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:De,overlineThickness:De,paintOrder:null,panose1:null,path:null,pathLength:De,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:In,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:De,pointsAtY:De,pointsAtZ:De,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Qa,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Qa,rev:Qa,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Qa,requiredFeatures:Qa,requiredFonts:Qa,requiredFormats:Qa,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:De,specularExponent:De,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:De,strikethroughThickness:De,string:null,stroke:null,strokeDashArray:Qa,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:De,strokeOpacity:De,strokeWidth:null,style:null,surfaceScale:De,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Qa,tabIndex:De,tableValues:null,target:null,targetX:De,targetY:De,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Qa,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:De,underlineThickness:De,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:De,values:null,vAlphabetic:De,vMathematical:De,vectorEffect:null,vHanging:De,vIdeographic:De,version:null,vertAdvY:De,vertOriginX:De,vertOriginY:De,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:De,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:wM}),CM=_h({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),AM=_h({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:TM}),MM=_h({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),M8={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},R8=/[A-Z]/g,e2=/-[a-z]/g,N8=/^data[-\w.:]+$/i;function k8(t,e){const n=s_(e);let i=e,r=Na;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&N8.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(e2,D8);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!e2.test(s)){let l=s.replace(R8,O8);l.charAt(0)!=="-"&&(l="-"+l),e="data"+l}}r=o1}return new r(i,e)}function O8(t){return"-"+t.toLowerCase()}function D8(t){return t.charAt(1).toUpperCase()}const z8=SM([EM,C8,CM,AM,MM],"html"),c1=SM([EM,A8,CM,AM,MM],"svg");function B8(t){return t.join(" ").trim()}var Ud={},Zx,t2;function L8(){if(t2)return Zx;t2=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,r=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
|
|
345
|
+
`,p="/",m="*",g="",b="comment",v="declaration";function _(T,w){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];w=w||{};var k=1,R=1;function O(H){var W=H.match(e);W&&(k+=W.length);var B=H.lastIndexOf(d);R=~B?H.length-B:R+H.length}function j(){var H={line:k,column:R};return function(W){return W.position=new D(H),P(),W}}function D(H){this.start=H,this.end={line:k,column:R},this.source=w.source}D.prototype.content=T;function F(H){var W=new Error(w.source+":"+k+":"+R+": "+H);if(W.reason=H,W.filename=w.source,W.line=k,W.column=R,W.source=T,!w.silent)throw W}function $(H){var W=H.exec(T);if(W){var B=W[0];return O(B),T=T.slice(B.length),W}}function P(){$(n)}function I(H){var W;for(H=H||[];W=K();)W!==!1&&H.push(W);return H}function K(){var H=j();if(!(p!=T.charAt(0)||m!=T.charAt(1))){for(var W=2;g!=T.charAt(W)&&(m!=T.charAt(W)||p!=T.charAt(W+1));)++W;if(W+=2,g===T.charAt(W-1))return F("End of comment missing");var B=T.slice(2,W-2);return R+=2,O(B),T=T.slice(W),R+=2,H({type:b,comment:B})}}function G(){var H=j(),W=$(i);if(W){if(K(),!$(r))return F("property missing ':'");var B=$(s),X=H({type:v,property:C(W[0].replace(t,g)),value:B?C(B[0].replace(t,g)):g});return $(l),X}}function te(){var H=[];I(H);for(var W;W=G();)W!==!1&&(H.push(W),I(H));return H}return P(),te()}function C(T){return T?T.replace(c,g):g}return Zx=_,Zx}var n2;function U8(){if(n2)return Ud;n2=1;var t=Ud&&Ud.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ud,"__esModule",{value:!0}),Ud.default=n;const e=t(L8());function n(i,r){let s=null;if(!i||typeof i!="string")return s;const l=(0,e.default)(i),c=typeof r=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:p,value:m}=d;c?r(p,m,d):m&&(s=s||{},s[p]=m)}),s}return Ud}var nm={},i2;function I8(){if(i2)return nm;i2=1,Object.defineProperty(nm,"__esModule",{value:!0}),nm.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,r=/^-(ms)-/,s=function(p){return!p||n.test(p)||t.test(p)},l=function(p,m){return m.toUpperCase()},c=function(p,m){return"".concat(m,"-")},d=function(p,m){return m===void 0&&(m={}),s(p)?p:(p=p.toLowerCase(),m.reactCompat?p=p.replace(r,c):p=p.replace(i,c),p.replace(e,l))};return nm.camelCase=d,nm}var im,r2;function j8(){if(r2)return im;r2=1;var t=im&&im.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},e=t(U8()),n=I8();function i(r,s){var l={};return!r||typeof r!="string"||(0,e.default)(r,function(c,d){c&&d&&(l[(0,n.camelCase)(c,s)]=d)}),l}return i.default=i,im=i,im}var H8=j8();const P8=uu(H8),RM=NM("end"),u1=NM("start");function NM(t){return e;function e(n){const i=n&&n.position&&n.position[t]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function G8(t){const e=u1(t),n=RM(t);if(e&&n)return{start:e,end:n}}function Sm(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?a2(t.position):"start"in t||"end"in t?a2(t):"line"in t||"column"in t?c_(t):""}function c_(t){return s2(t&&t.line)+":"+s2(t&&t.column)}function a2(t){return c_(t&&t.start)+"-"+c_(t&&t.end)}function s2(t){return t&&typeof t=="number"?t:1}class Br extends Error{constructor(e,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let r="",s={},l=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof e=="string"?r=e:!s.cause&&e&&(l=!0,r=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof i=="string"){const d=i.indexOf(":");d===-1?s.ruleId=i:(s.source=i.slice(0,d),s.ruleId=i.slice(d+1))}if(!s.place&&s.ancestors&&s.ancestors){const d=s.ancestors[s.ancestors.length-1];d&&(s.place=d.position)}const c=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=c?c.line:void 0,this.name=Sm(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=l&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Br.prototype.file="";Br.prototype.name="";Br.prototype.reason="";Br.prototype.message="";Br.prototype.stack="";Br.prototype.column=void 0;Br.prototype.line=void 0;Br.prototype.ancestors=void 0;Br.prototype.cause=void 0;Br.prototype.fatal=void 0;Br.prototype.place=void 0;Br.prototype.ruleId=void 0;Br.prototype.source=void 0;const f1={}.hasOwnProperty,F8=new Map,q8=/[A-Z]/g,Y8=new Set(["table","tbody","thead","tfoot","tr"]),V8=new Set(["td","th"]),kM="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function X8(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let i;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=tU(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=eU(n,e.jsx,e.jsxs)}const r={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:i,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?c1:z8,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=OM(r,t,void 0);return s&&typeof s!="string"?s:r.create(t,r.Fragment,{children:s||void 0},void 0)}function OM(t,e,n){if(e.type==="element")return K8(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return W8(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return Z8(t,e,n);if(e.type==="mdxjsEsm")return $8(t,e);if(e.type==="root")return Q8(t,e,n);if(e.type==="text")return J8(t,e)}function K8(t,e,n){const i=t.schema;let r=i;e.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=c1,t.schema=r),t.ancestors.push(e);const s=zM(t,e.tagName,!1),l=nU(t,e);let c=h1(t,e);return Y8.has(e.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!w8(d):!0})),DM(t,l,s,e),d1(l,c),t.ancestors.pop(),t.schema=i,t.create(e,s,l,n)}function W8(t,e){if(e.data&&e.data.estree&&t.evaluater){const i=e.data.estree.body[0];return i.type,t.evaluater.evaluateExpression(i.expression)}zm(t,e.position)}function $8(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);zm(t,e.position)}function Z8(t,e,n){const i=t.schema;let r=i;e.name==="svg"&&i.space==="html"&&(r=c1,t.schema=r),t.ancestors.push(e);const s=e.name===null?t.Fragment:zM(t,e.name,!0),l=iU(t,e),c=h1(t,e);return DM(t,l,s,e),d1(l,c),t.ancestors.pop(),t.schema=i,t.create(e,s,l,n)}function Q8(t,e,n){const i={};return d1(i,h1(t,e)),t.create(e,t.Fragment,i,n)}function J8(t,e){return e.value}function DM(t,e,n,i){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=i)}function d1(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function eU(t,e,n){return i;function i(r,s,l,c){const p=Array.isArray(l.children)?n:e;return c?p(s,l,c):p(s,l)}}function tU(t,e){return n;function n(i,r,s,l){const c=Array.isArray(s.children),d=u1(i);return e(r,s,l,c,{columnNumber:d?d.column-1:void 0,fileName:t,lineNumber:d?d.line:void 0},void 0)}}function nU(t,e){const n={};let i,r;for(r in e.properties)if(r!=="children"&&f1.call(e.properties,r)){const s=rU(t,r,e.properties[r]);if(s){const[l,c]=s;t.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&V8.has(e.tagName)?i=c:n[l]=c}}if(i){const s=n.style||(n.style={});s[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function iU(t,e){const n={};for(const i of e.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&t.evaluater){const s=i.data.estree.body[0];s.type;const l=s.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,t.evaluater.evaluateExpression(c.argument))}else zm(t,e.position);else{const r=i.name;let s;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&t.evaluater){const c=i.value.data.estree.body[0];c.type,s=t.evaluater.evaluateExpression(c.expression)}else zm(t,e.position);else s=i.value===null?!0:i.value;n[r]=s}return n}function h1(t,e){const n=[];let i=-1;const r=t.passKeys?new Map:F8;for(;++i<e.children.length;){const s=e.children[i];let l;if(t.passKeys){const d=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(d){const p=r.get(d)||0;l=d+"-"+p,r.set(d,p+1)}}const c=OM(t,s,l);c!==void 0&&n.push(c)}return n}function rU(t,e,n){const i=k8(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?x8(n):B8(n)),i.property==="style"){let r=typeof n=="object"?n:aU(t,String(n));return t.stylePropertyNameCase==="css"&&(r=sU(r)),["style",r]}return[t.elementAttributeNameCase==="react"&&i.space?M8[i.property]||i.property:i.attribute,n]}}function aU(t,e){try{return P8(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const i=n,r=new Br("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=t.filePath||void 0,r.url=kM+"#cannot-parse-style-attribute",r}}function zM(t,e,n){let i;if(!n)i={type:"Literal",value:e};else if(e.includes(".")){const r=e.split(".");let s=-1,l;for(;++s<r.length;){const c=Zw(r[s])?{type:"Identifier",name:r[s]}:{type:"Literal",value:r[s]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(s&&c.type==="Literal"),optional:!1}:c}i=l}else i=Zw(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(i.type==="Literal"){const r=i.value;return f1.call(t.components,r)?t.components[r]:r}if(t.evaluater)return t.evaluater.evaluateExpression(i);zm(t)}function zm(t,e){const n=new Br("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=kM+"#cannot-handle-mdx-estrees-without-createevaluater",n}function sU(t){const e={};let n;for(n in t)f1.call(t,n)&&(e[lU(n)]=t[n]);return e}function lU(t){let e=t.replace(q8,oU);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function oU(t){return"-"+t.toLowerCase()}const Qx={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},cU={};function p1(t,e){const n=cU,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,r=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return BM(t,i,r)}function BM(t,e,n){if(uU(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return l2(t.children,e,n)}return Array.isArray(t)?l2(t,e,n):""}function l2(t,e,n){const i=[];let r=-1;for(;++r<t.length;)i[r]=BM(t[r],e,n);return i.join("")}function uU(t){return!!(t&&typeof t=="object")}const o2=document.createElement("i");function m1(t){const e="&"+t+";";o2.innerHTML=e;const n=o2.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function ns(t,e,n,i){const r=t.length;let s=0,l;if(e<0?e=-e>r?0:r+e:e=e>r?r:e,n=n>0?n:0,i.length<1e4)l=Array.from(i),l.unshift(e,n),t.splice(...l);else for(n&&t.splice(e,n);s<i.length;)l=i.slice(s,s+1e4),l.unshift(e,0),t.splice(...l),s+=1e4,e+=1e4}function Os(t,e){return t.length>0?(ns(t,t.length,0,e),t):e}const c2={}.hasOwnProperty;function LM(t){const e={};let n=-1;for(;++n<t.length;)fU(e,t[n]);return e}function fU(t,e){let n;for(n in e){const r=(c2.call(t,n)?t[n]:void 0)||(t[n]={}),s=e[n];let l;if(s)for(l in s){c2.call(r,l)||(r[l]=[]);const c=s[l];dU(r[l],Array.isArray(c)?c:c?[c]:[])}}}function dU(t,e){let n=-1;const i=[];for(;++n<e.length;)(e[n].add==="after"?t:i).push(e[n]);ns(t,0,0,i)}function UM(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function bl(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const la=fu(/[A-Za-z]/),zr=fu(/[\dA-Za-z]/),hU=fu(/[#-'*+\--9=?A-Z^-~]/);function N0(t){return t!==null&&(t<32||t===127)}const u_=fu(/\d/),pU=fu(/[\dA-Fa-f]/),mU=fu(/[!-/:-@[-`{-~]/);function st(t){return t!==null&&t<-2}function Dn(t){return t!==null&&(t<0||t===32)}function Lt(t){return t===-2||t===-1||t===32}const rb=fu(new RegExp("\\p{P}|\\p{S}","u")),vf=fu(/\s/);function fu(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Sh(t){const e=[];let n=-1,i=0,r=0;for(;++n<t.length;){const s=t.charCodeAt(n);let l="";if(s===37&&zr(t.charCodeAt(n+1))&&zr(t.charCodeAt(n+2)))r=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(l=String.fromCharCode(s));else if(s>55295&&s<57344){const c=t.charCodeAt(n+1);s<56320&&c>56319&&c<57344?(l=String.fromCharCode(s,c),r=1):l="�"}else l=String.fromCharCode(s);l&&(e.push(t.slice(i,n),encodeURIComponent(l)),i=n+r+1,l=""),r&&(n+=r,r=0)}return e.join("")+t.slice(i)}function Kt(t,e,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let s=0;return l;function l(d){return Lt(d)?(t.enter(n),c(d)):e(d)}function c(d){return Lt(d)&&s++<r?(t.consume(d),c):(t.exit(n),e(d))}}const gU={tokenize:yU};function yU(t){const e=t.attempt(this.parser.constructs.contentInitial,i,r);let n;return e;function i(c){if(c===null){t.consume(c);return}return t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),Kt(t,e,"linePrefix")}function r(c){return t.enter("paragraph"),s(c)}function s(c){const d=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(c)}function l(c){if(c===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(c);return}return st(c)?(t.consume(c),t.exit("chunkText"),s):(t.consume(c),l)}}const bU={tokenize:xU},u2={tokenize:vU};function xU(t){const e=this,n=[];let i=0,r,s,l;return c;function c(R){if(i<n.length){const O=n[i];return e.containerState=O[1],t.attempt(O[0].continuation,d,p)(R)}return p(R)}function d(R){if(i++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,r&&k();const O=e.events.length;let j=O,D;for(;j--;)if(e.events[j][0]==="exit"&&e.events[j][1].type==="chunkFlow"){D=e.events[j][1].end;break}w(i);let F=O;for(;F<e.events.length;)e.events[F][1].end={...D},F++;return ns(e.events,j+1,0,e.events.slice(O)),e.events.length=F,p(R)}return c(R)}function p(R){if(i===n.length){if(!r)return b(R);if(r.currentConstruct&&r.currentConstruct.concrete)return _(R);e.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(u2,m,g)(R)}function m(R){return r&&k(),w(i),b(R)}function g(R){return e.parser.lazy[e.now().line]=i!==n.length,l=e.now().offset,_(R)}function b(R){return e.containerState={},t.attempt(u2,v,_)(R)}function v(R){return i++,n.push([e.currentConstruct,e.containerState]),b(R)}function _(R){if(R===null){r&&k(),w(0),t.consume(R);return}return r=r||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:s}),C(R)}function C(R){if(R===null){T(t.exit("chunkFlow"),!0),w(0),t.consume(R);return}return st(R)?(t.consume(R),T(t.exit("chunkFlow")),i=0,e.interrupt=void 0,c):(t.consume(R),C)}function T(R,O){const j=e.sliceStream(R);if(O&&j.push(null),R.previous=s,s&&(s.next=R),s=R,r.defineSkip(R.start),r.write(j),e.parser.lazy[R.start.line]){let D=r.events.length;for(;D--;)if(r.events[D][1].start.offset<l&&(!r.events[D][1].end||r.events[D][1].end.offset>l))return;const F=e.events.length;let $=F,P,I;for(;$--;)if(e.events[$][0]==="exit"&&e.events[$][1].type==="chunkFlow"){if(P){I=e.events[$][1].end;break}P=!0}for(w(i),D=F;D<e.events.length;)e.events[D][1].end={...I},D++;ns(e.events,$+1,0,e.events.slice(F)),e.events.length=D}}function w(R){let O=n.length;for(;O-- >R;){const j=n[O];e.containerState=j[1],j[0].exit.call(e,t)}n.length=R}function k(){r.write([null]),s=void 0,r=void 0,e.containerState._closeFlow=void 0}}function vU(t,e,n){return Kt(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ch(t){if(t===null||Dn(t)||vf(t))return 1;if(rb(t))return 2}function ab(t,e,n){const i=[];let r=-1;for(;++r<t.length;){const s=t[r].resolveAll;s&&!i.includes(s)&&(e=s(e,n),i.push(s))}return e}const f_={name:"attention",resolveAll:_U,tokenize:SU};function _U(t,e){let n=-1,i,r,s,l,c,d,p,m;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(i=n;i--;)if(t[i][0]==="exit"&&t[i][1].type==="attentionSequence"&&t[i][1]._open&&e.sliceSerialize(t[i][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[i][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[i][1].end.offset-t[i][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;d=t[i][1].end.offset-t[i][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const g={...t[i][1].end},b={...t[n][1].start};f2(g,-d),f2(b,d),l={type:d>1?"strongSequence":"emphasisSequence",start:g,end:{...t[i][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:b},s={type:d>1?"strongText":"emphasisText",start:{...t[i][1].end},end:{...t[n][1].start}},r={type:d>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},t[i][1].end={...l.start},t[n][1].start={...c.end},p=[],t[i][1].end.offset-t[i][1].start.offset&&(p=Os(p,[["enter",t[i][1],e],["exit",t[i][1],e]])),p=Os(p,[["enter",r,e],["enter",l,e],["exit",l,e],["enter",s,e]]),p=Os(p,ab(e.parser.constructs.insideSpan.null,t.slice(i+1,n),e)),p=Os(p,[["exit",s,e],["enter",c,e],["exit",c,e],["exit",r,e]]),t[n][1].end.offset-t[n][1].start.offset?(m=2,p=Os(p,[["enter",t[n][1],e],["exit",t[n][1],e]])):m=0,ns(t,i-1,n-i+3,p),n=i+p.length-m-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function SU(t,e){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,r=ch(i);let s;return l;function l(d){return s=d,t.enter("attentionSequence"),c(d)}function c(d){if(d===s)return t.consume(d),c;const p=t.exit("attentionSequence"),m=ch(d),g=!m||m===2&&r||n.includes(d),b=!r||r===2&&m||n.includes(i);return p._open=!!(s===42?g:g&&(r||!b)),p._close=!!(s===42?b:b&&(m||!g)),e(d)}}function f2(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const EU={name:"autolink",tokenize:wU};function wU(t,e,n){let i=0;return r;function r(v){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(v),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),s}function s(v){return la(v)?(t.consume(v),l):v===64?n(v):p(v)}function l(v){return v===43||v===45||v===46||zr(v)?(i=1,c(v)):p(v)}function c(v){return v===58?(t.consume(v),i=0,d):(v===43||v===45||v===46||zr(v))&&i++<32?(t.consume(v),c):(i=0,p(v))}function d(v){return v===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(v),t.exit("autolinkMarker"),t.exit("autolink"),e):v===null||v===32||v===60||N0(v)?n(v):(t.consume(v),d)}function p(v){return v===64?(t.consume(v),m):hU(v)?(t.consume(v),p):n(v)}function m(v){return zr(v)?g(v):n(v)}function g(v){return v===46?(t.consume(v),i=0,m):v===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(v),t.exit("autolinkMarker"),t.exit("autolink"),e):b(v)}function b(v){if((v===45||zr(v))&&i++<63){const _=v===45?b:g;return t.consume(v),_}return n(v)}}const Zm={partial:!0,tokenize:TU};function TU(t,e,n){return i;function i(s){return Lt(s)?Kt(t,r,"linePrefix")(s):r(s)}function r(s){return s===null||st(s)?e(s):n(s)}}const IM={continuation:{tokenize:AU},exit:MU,name:"blockQuote",tokenize:CU};function CU(t,e,n){const i=this;return r;function r(l){if(l===62){const c=i.containerState;return c.open||(t.enter("blockQuote",{_container:!0}),c.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(l),t.exit("blockQuoteMarker"),s}return n(l)}function s(l){return Lt(l)?(t.enter("blockQuotePrefixWhitespace"),t.consume(l),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(l))}}function AU(t,e,n){const i=this;return r;function r(l){return Lt(l)?Kt(t,s,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):s(l)}function s(l){return t.attempt(IM,e,n)(l)}}function MU(t){t.exit("blockQuote")}const jM={name:"characterEscape",tokenize:RU};function RU(t,e,n){return i;function i(s){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(s),t.exit("escapeMarker"),r}function r(s){return mU(s)?(t.enter("characterEscapeValue"),t.consume(s),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(s)}}const HM={name:"characterReference",tokenize:NU};function NU(t,e,n){const i=this;let r=0,s,l;return c;function c(g){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(g),t.exit("characterReferenceMarker"),d}function d(g){return g===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(g),t.exit("characterReferenceMarkerNumeric"),p):(t.enter("characterReferenceValue"),s=31,l=zr,m(g))}function p(g){return g===88||g===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(g),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),s=6,l=pU,m):(t.enter("characterReferenceValue"),s=7,l=u_,m(g))}function m(g){if(g===59&&r){const b=t.exit("characterReferenceValue");return l===zr&&!m1(i.sliceSerialize(b))?n(g):(t.enter("characterReferenceMarker"),t.consume(g),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return l(g)&&r++<s?(t.consume(g),m):n(g)}}const d2={partial:!0,tokenize:OU},h2={concrete:!0,name:"codeFenced",tokenize:kU};function kU(t,e,n){const i=this,r={partial:!0,tokenize:j};let s=0,l=0,c;return d;function d(D){return p(D)}function p(D){const F=i.events[i.events.length-1];return s=F&&F[1].type==="linePrefix"?F[2].sliceSerialize(F[1],!0).length:0,c=D,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),m(D)}function m(D){return D===c?(l++,t.consume(D),m):l<3?n(D):(t.exit("codeFencedFenceSequence"),Lt(D)?Kt(t,g,"whitespace")(D):g(D))}function g(D){return D===null||st(D)?(t.exit("codeFencedFence"),i.interrupt?e(D):t.check(d2,C,O)(D)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),b(D))}function b(D){return D===null||st(D)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),g(D)):Lt(D)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Kt(t,v,"whitespace")(D)):D===96&&D===c?n(D):(t.consume(D),b)}function v(D){return D===null||st(D)?g(D):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),_(D))}function _(D){return D===null||st(D)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),g(D)):D===96&&D===c?n(D):(t.consume(D),_)}function C(D){return t.attempt(r,O,T)(D)}function T(D){return t.enter("lineEnding"),t.consume(D),t.exit("lineEnding"),w}function w(D){return s>0&&Lt(D)?Kt(t,k,"linePrefix",s+1)(D):k(D)}function k(D){return D===null||st(D)?t.check(d2,C,O)(D):(t.enter("codeFlowValue"),R(D))}function R(D){return D===null||st(D)?(t.exit("codeFlowValue"),k(D)):(t.consume(D),R)}function O(D){return t.exit("codeFenced"),e(D)}function j(D,F,$){let P=0;return I;function I(W){return D.enter("lineEnding"),D.consume(W),D.exit("lineEnding"),K}function K(W){return D.enter("codeFencedFence"),Lt(W)?Kt(D,G,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):G(W)}function G(W){return W===c?(D.enter("codeFencedFenceSequence"),te(W)):$(W)}function te(W){return W===c?(P++,D.consume(W),te):P>=l?(D.exit("codeFencedFenceSequence"),Lt(W)?Kt(D,H,"whitespace")(W):H(W)):$(W)}function H(W){return W===null||st(W)?(D.exit("codeFencedFence"),F(W)):$(W)}}}function OU(t,e,n){const i=this;return r;function r(l){return l===null?n(l):(t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),s)}function s(l){return i.parser.lazy[i.now().line]?n(l):e(l)}}const Jx={name:"codeIndented",tokenize:zU},DU={partial:!0,tokenize:BU};function zU(t,e,n){const i=this;return r;function r(p){return t.enter("codeIndented"),Kt(t,s,"linePrefix",5)(p)}function s(p){const m=i.events[i.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(p):n(p)}function l(p){return p===null?d(p):st(p)?t.attempt(DU,l,d)(p):(t.enter("codeFlowValue"),c(p))}function c(p){return p===null||st(p)?(t.exit("codeFlowValue"),l(p)):(t.consume(p),c)}function d(p){return t.exit("codeIndented"),e(p)}}function BU(t,e,n){const i=this;return r;function r(l){return i.parser.lazy[i.now().line]?n(l):st(l)?(t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),r):Kt(t,s,"linePrefix",5)(l)}function s(l){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?e(l):st(l)?r(l):n(l)}}const LU={name:"codeText",previous:IU,resolve:UU,tokenize:jU};function UU(t){let e=t.length-4,n=3,i,r;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(i=n;++i<e;)if(t[i][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(i=n-1,e++;++i<=e;)r===void 0?i!==e&&t[i][1].type!=="lineEnding"&&(r=i):(i===e||t[i][1].type==="lineEnding")&&(t[r][1].type="codeTextData",i!==r+2&&(t[r][1].end=t[i-1][1].end,t.splice(r+2,i-r-2),e-=i-r-2,i=r+2),r=void 0);return t}function IU(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function jU(t,e,n){let i=0,r,s;return l;function l(g){return t.enter("codeText"),t.enter("codeTextSequence"),c(g)}function c(g){return g===96?(t.consume(g),i++,c):(t.exit("codeTextSequence"),d(g))}function d(g){return g===null?n(g):g===32?(t.enter("space"),t.consume(g),t.exit("space"),d):g===96?(s=t.enter("codeTextSequence"),r=0,m(g)):st(g)?(t.enter("lineEnding"),t.consume(g),t.exit("lineEnding"),d):(t.enter("codeTextData"),p(g))}function p(g){return g===null||g===32||g===96||st(g)?(t.exit("codeTextData"),d(g)):(t.consume(g),p)}function m(g){return g===96?(t.consume(g),r++,m):r===i?(t.exit("codeTextSequence"),t.exit("codeText"),e(g)):(s.type="codeTextData",p(g))}}class HU{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(e,i):e>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(e,n,i){const r=n||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&rm(this.left,i),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),rm(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),rm(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);rm(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);rm(this.left,n.reverse())}}}function rm(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function PM(t){const e={};let n=-1,i,r,s,l,c,d,p;const m=new HU(t);for(;++n<m.length;){for(;n in e;)n=e[n];if(i=m.get(n),n&&i[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(d=i[1]._tokenizer.events,s=0,s<d.length&&d[s][1].type==="lineEndingBlank"&&(s+=2),s<d.length&&d[s][1].type==="content"))for(;++s<d.length&&d[s][1].type!=="content";)d[s][1].type==="chunkText"&&(d[s][1]._isInFirstContentOfListItem=!0,s++);if(i[0]==="enter")i[1].contentType&&(Object.assign(e,PU(m,n)),n=e[n],p=!0);else if(i[1]._container){for(s=n,r=void 0;s--;)if(l=m.get(s),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(r&&(m.get(r)[1].type="lineEndingBlank"),l[1].type="lineEnding",r=s);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;r&&(i[1].end={...m.get(r)[1].start},c=m.slice(r,n),c.unshift(i),m.splice(r,n-r+1,c))}}return ns(t,0,Number.POSITIVE_INFINITY,m.slice(0)),!p}function PU(t,e){const n=t.get(e)[1],i=t.get(e)[2];let r=e-1;const s=[];let l=n._tokenizer;l||(l=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,d=[],p={};let m,g,b=-1,v=n,_=0,C=0;const T=[C];for(;v;){for(;t.get(++r)[1]!==v;);s.push(r),v._tokenizer||(m=i.sliceStream(v),v.next||m.push(null),g&&l.defineSkip(v.start),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(m),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),g=v,v=v.next}for(v=n;++b<c.length;)c[b][0]==="exit"&&c[b-1][0]==="enter"&&c[b][1].type===c[b-1][1].type&&c[b][1].start.line!==c[b][1].end.line&&(C=b+1,T.push(C),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(l.events=[],v?(v._tokenizer=void 0,v.previous=void 0):T.pop(),b=T.length;b--;){const w=c.slice(T[b],T[b+1]),k=s.pop();d.push([k,k+w.length-1]),t.splice(k,2,w)}for(d.reverse(),b=-1;++b<d.length;)p[_+d[b][0]]=_+d[b][1],_+=d[b][1]-d[b][0]-1;return p}const GU={resolve:qU,tokenize:YU},FU={partial:!0,tokenize:VU};function qU(t){return PM(t),t}function YU(t,e){let n;return i;function i(c){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),r(c)}function r(c){return c===null?s(c):st(c)?t.check(FU,l,s)(c):(t.consume(c),r)}function s(c){return t.exit("chunkContent"),t.exit("content"),e(c)}function l(c){return t.consume(c),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}function VU(t,e,n){const i=this;return r;function r(l){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),Kt(t,s,"linePrefix")}function s(l){if(l===null||st(l))return n(l);const c=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?e(l):t.interrupt(i.parser.constructs.flow,n,e)(l)}}function GM(t,e,n,i,r,s,l,c,d){const p=d||Number.POSITIVE_INFINITY;let m=0;return g;function g(w){return w===60?(t.enter(i),t.enter(r),t.enter(s),t.consume(w),t.exit(s),b):w===null||w===32||w===41||N0(w)?n(w):(t.enter(i),t.enter(l),t.enter(c),t.enter("chunkString",{contentType:"string"}),C(w))}function b(w){return w===62?(t.enter(s),t.consume(w),t.exit(s),t.exit(r),t.exit(i),e):(t.enter(c),t.enter("chunkString",{contentType:"string"}),v(w))}function v(w){return w===62?(t.exit("chunkString"),t.exit(c),b(w)):w===null||w===60||st(w)?n(w):(t.consume(w),w===92?_:v)}function _(w){return w===60||w===62||w===92?(t.consume(w),v):v(w)}function C(w){return!m&&(w===null||w===41||Dn(w))?(t.exit("chunkString"),t.exit(c),t.exit(l),t.exit(i),e(w)):m<p&&w===40?(t.consume(w),m++,C):w===41?(t.consume(w),m--,C):w===null||w===32||w===40||N0(w)?n(w):(t.consume(w),w===92?T:C)}function T(w){return w===40||w===41||w===92?(t.consume(w),C):C(w)}}function FM(t,e,n,i,r,s){const l=this;let c=0,d;return p;function p(v){return t.enter(i),t.enter(r),t.consume(v),t.exit(r),t.enter(s),m}function m(v){return c>999||v===null||v===91||v===93&&!d||v===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(v):v===93?(t.exit(s),t.enter(r),t.consume(v),t.exit(r),t.exit(i),e):st(v)?(t.enter("lineEnding"),t.consume(v),t.exit("lineEnding"),m):(t.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===null||v===91||v===93||st(v)||c++>999?(t.exit("chunkString"),m(v)):(t.consume(v),d||(d=!Lt(v)),v===92?b:g)}function b(v){return v===91||v===92||v===93?(t.consume(v),c++,g):g(v)}}function qM(t,e,n,i,r,s){let l;return c;function c(b){return b===34||b===39||b===40?(t.enter(i),t.enter(r),t.consume(b),t.exit(r),l=b===40?41:b,d):n(b)}function d(b){return b===l?(t.enter(r),t.consume(b),t.exit(r),t.exit(i),e):(t.enter(s),p(b))}function p(b){return b===l?(t.exit(s),d(l)):b===null?n(b):st(b)?(t.enter("lineEnding"),t.consume(b),t.exit("lineEnding"),Kt(t,p,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===l||b===null||st(b)?(t.exit("chunkString"),p(b)):(t.consume(b),b===92?g:m)}function g(b){return b===l||b===92?(t.consume(b),m):m(b)}}function Em(t,e){let n;return i;function i(r){return st(r)?(t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),n=!0,i):Lt(r)?Kt(t,i,n?"linePrefix":"lineSuffix")(r):e(r)}}const XU={name:"definition",tokenize:WU},KU={partial:!0,tokenize:$U};function WU(t,e,n){const i=this;let r;return s;function s(v){return t.enter("definition"),l(v)}function l(v){return FM.call(i,t,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function c(v){return r=bl(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),v===58?(t.enter("definitionMarker"),t.consume(v),t.exit("definitionMarker"),d):n(v)}function d(v){return Dn(v)?Em(t,p)(v):p(v)}function p(v){return GM(t,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function m(v){return t.attempt(KU,g,g)(v)}function g(v){return Lt(v)?Kt(t,b,"whitespace")(v):b(v)}function b(v){return v===null||st(v)?(t.exit("definition"),i.parser.defined.push(r),e(v)):n(v)}}function $U(t,e,n){return i;function i(c){return Dn(c)?Em(t,r)(c):n(c)}function r(c){return qM(t,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function s(c){return Lt(c)?Kt(t,l,"whitespace")(c):l(c)}function l(c){return c===null||st(c)?e(c):n(c)}}const ZU={name:"hardBreakEscape",tokenize:QU};function QU(t,e,n){return i;function i(s){return t.enter("hardBreakEscape"),t.consume(s),r}function r(s){return st(s)?(t.exit("hardBreakEscape"),e(s)):n(s)}}const JU={name:"headingAtx",resolve:eI,tokenize:tI};function eI(t,e){let n=t.length-2,i=3,r,s;return t[i][1].type==="whitespace"&&(i+=2),n-2>i&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&t[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(r={type:"atxHeadingText",start:t[i][1].start,end:t[n][1].end},s={type:"chunkText",start:t[i][1].start,end:t[n][1].end,contentType:"text"},ns(t,i,n-i+1,[["enter",r,e],["enter",s,e],["exit",s,e],["exit",r,e]])),t}function tI(t,e,n){let i=0;return r;function r(m){return t.enter("atxHeading"),s(m)}function s(m){return t.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&i++<6?(t.consume(m),l):m===null||Dn(m)?(t.exit("atxHeadingSequence"),c(m)):n(m)}function c(m){return m===35?(t.enter("atxHeadingSequence"),d(m)):m===null||st(m)?(t.exit("atxHeading"),e(m)):Lt(m)?Kt(t,c,"whitespace")(m):(t.enter("atxHeadingText"),p(m))}function d(m){return m===35?(t.consume(m),d):(t.exit("atxHeadingSequence"),c(m))}function p(m){return m===null||m===35||Dn(m)?(t.exit("atxHeadingText"),c(m)):(t.consume(m),p)}}const nI=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],p2=["pre","script","style","textarea"],iI={concrete:!0,name:"htmlFlow",resolveTo:sI,tokenize:lI},rI={partial:!0,tokenize:cI},aI={partial:!0,tokenize:oI};function sI(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function lI(t,e,n){const i=this;let r,s,l,c,d;return p;function p(V){return m(V)}function m(V){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(V),g}function g(V){return V===33?(t.consume(V),b):V===47?(t.consume(V),s=!0,C):V===63?(t.consume(V),r=3,i.interrupt?e:q):la(V)?(t.consume(V),l=String.fromCharCode(V),T):n(V)}function b(V){return V===45?(t.consume(V),r=2,v):V===91?(t.consume(V),r=5,c=0,_):la(V)?(t.consume(V),r=4,i.interrupt?e:q):n(V)}function v(V){return V===45?(t.consume(V),i.interrupt?e:q):n(V)}function _(V){const oe="CDATA[";return V===oe.charCodeAt(c++)?(t.consume(V),c===oe.length?i.interrupt?e:G:_):n(V)}function C(V){return la(V)?(t.consume(V),l=String.fromCharCode(V),T):n(V)}function T(V){if(V===null||V===47||V===62||Dn(V)){const oe=V===47,be=l.toLowerCase();return!oe&&!s&&p2.includes(be)?(r=1,i.interrupt?e(V):G(V)):nI.includes(l.toLowerCase())?(r=6,oe?(t.consume(V),w):i.interrupt?e(V):G(V)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(V):s?k(V):R(V))}return V===45||zr(V)?(t.consume(V),l+=String.fromCharCode(V),T):n(V)}function w(V){return V===62?(t.consume(V),i.interrupt?e:G):n(V)}function k(V){return Lt(V)?(t.consume(V),k):I(V)}function R(V){return V===47?(t.consume(V),I):V===58||V===95||la(V)?(t.consume(V),O):Lt(V)?(t.consume(V),R):I(V)}function O(V){return V===45||V===46||V===58||V===95||zr(V)?(t.consume(V),O):j(V)}function j(V){return V===61?(t.consume(V),D):Lt(V)?(t.consume(V),j):R(V)}function D(V){return V===null||V===60||V===61||V===62||V===96?n(V):V===34||V===39?(t.consume(V),d=V,F):Lt(V)?(t.consume(V),D):$(V)}function F(V){return V===d?(t.consume(V),d=null,P):V===null||st(V)?n(V):(t.consume(V),F)}function $(V){return V===null||V===34||V===39||V===47||V===60||V===61||V===62||V===96||Dn(V)?j(V):(t.consume(V),$)}function P(V){return V===47||V===62||Lt(V)?R(V):n(V)}function I(V){return V===62?(t.consume(V),K):n(V)}function K(V){return V===null||st(V)?G(V):Lt(V)?(t.consume(V),K):n(V)}function G(V){return V===45&&r===2?(t.consume(V),B):V===60&&r===1?(t.consume(V),X):V===62&&r===4?(t.consume(V),Y):V===63&&r===3?(t.consume(V),q):V===93&&r===5?(t.consume(V),Q):st(V)&&(r===6||r===7)?(t.exit("htmlFlowData"),t.check(rI,ee,te)(V)):V===null||st(V)?(t.exit("htmlFlowData"),te(V)):(t.consume(V),G)}function te(V){return t.check(aI,H,ee)(V)}function H(V){return t.enter("lineEnding"),t.consume(V),t.exit("lineEnding"),W}function W(V){return V===null||st(V)?te(V):(t.enter("htmlFlowData"),G(V))}function B(V){return V===45?(t.consume(V),q):G(V)}function X(V){return V===47?(t.consume(V),l="",Z):G(V)}function Z(V){if(V===62){const oe=l.toLowerCase();return p2.includes(oe)?(t.consume(V),Y):G(V)}return la(V)&&l.length<8?(t.consume(V),l+=String.fromCharCode(V),Z):G(V)}function Q(V){return V===93?(t.consume(V),q):G(V)}function q(V){return V===62?(t.consume(V),Y):V===45&&r===2?(t.consume(V),q):G(V)}function Y(V){return V===null||st(V)?(t.exit("htmlFlowData"),ee(V)):(t.consume(V),Y)}function ee(V){return t.exit("htmlFlow"),e(V)}}function oI(t,e,n){const i=this;return r;function r(l){return st(l)?(t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),s):n(l)}function s(l){return i.parser.lazy[i.now().line]?n(l):e(l)}}function cI(t,e,n){return i;function i(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),t.attempt(Zm,e,n)}}const uI={name:"htmlText",tokenize:fI};function fI(t,e,n){const i=this;let r,s,l;return c;function c(q){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(q),d}function d(q){return q===33?(t.consume(q),p):q===47?(t.consume(q),j):q===63?(t.consume(q),R):la(q)?(t.consume(q),$):n(q)}function p(q){return q===45?(t.consume(q),m):q===91?(t.consume(q),s=0,_):la(q)?(t.consume(q),k):n(q)}function m(q){return q===45?(t.consume(q),v):n(q)}function g(q){return q===null?n(q):q===45?(t.consume(q),b):st(q)?(l=g,X(q)):(t.consume(q),g)}function b(q){return q===45?(t.consume(q),v):g(q)}function v(q){return q===62?B(q):q===45?b(q):g(q)}function _(q){const Y="CDATA[";return q===Y.charCodeAt(s++)?(t.consume(q),s===Y.length?C:_):n(q)}function C(q){return q===null?n(q):q===93?(t.consume(q),T):st(q)?(l=C,X(q)):(t.consume(q),C)}function T(q){return q===93?(t.consume(q),w):C(q)}function w(q){return q===62?B(q):q===93?(t.consume(q),w):C(q)}function k(q){return q===null||q===62?B(q):st(q)?(l=k,X(q)):(t.consume(q),k)}function R(q){return q===null?n(q):q===63?(t.consume(q),O):st(q)?(l=R,X(q)):(t.consume(q),R)}function O(q){return q===62?B(q):R(q)}function j(q){return la(q)?(t.consume(q),D):n(q)}function D(q){return q===45||zr(q)?(t.consume(q),D):F(q)}function F(q){return st(q)?(l=F,X(q)):Lt(q)?(t.consume(q),F):B(q)}function $(q){return q===45||zr(q)?(t.consume(q),$):q===47||q===62||Dn(q)?P(q):n(q)}function P(q){return q===47?(t.consume(q),B):q===58||q===95||la(q)?(t.consume(q),I):st(q)?(l=P,X(q)):Lt(q)?(t.consume(q),P):B(q)}function I(q){return q===45||q===46||q===58||q===95||zr(q)?(t.consume(q),I):K(q)}function K(q){return q===61?(t.consume(q),G):st(q)?(l=K,X(q)):Lt(q)?(t.consume(q),K):P(q)}function G(q){return q===null||q===60||q===61||q===62||q===96?n(q):q===34||q===39?(t.consume(q),r=q,te):st(q)?(l=G,X(q)):Lt(q)?(t.consume(q),G):(t.consume(q),H)}function te(q){return q===r?(t.consume(q),r=void 0,W):q===null?n(q):st(q)?(l=te,X(q)):(t.consume(q),te)}function H(q){return q===null||q===34||q===39||q===60||q===61||q===96?n(q):q===47||q===62||Dn(q)?P(q):(t.consume(q),H)}function W(q){return q===47||q===62||Dn(q)?P(q):n(q)}function B(q){return q===62?(t.consume(q),t.exit("htmlTextData"),t.exit("htmlText"),e):n(q)}function X(q){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(q),t.exit("lineEnding"),Z}function Z(q){return Lt(q)?Kt(t,Q,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):Q(q)}function Q(q){return t.enter("htmlTextData"),l(q)}}const g1={name:"labelEnd",resolveAll:mI,resolveTo:gI,tokenize:yI},dI={tokenize:bI},hI={tokenize:xI},pI={tokenize:vI};function mI(t){let e=-1;const n=[];for(;++e<t.length;){const i=t[e][1];if(n.push(t[e]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const r=i.type==="labelImage"?4:2;i.type="data",e+=r}}return t.length!==n.length&&ns(t,0,t.length,n),t}function gI(t,e){let n=t.length,i=0,r,s,l,c;for(;n--;)if(r=t[n][1],s){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;t[n][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(l){if(t[n][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(s=n,r.type!=="labelLink")){i=2;break}}else r.type==="labelEnd"&&(l=n);const d={type:t[s][1].type==="labelLink"?"link":"image",start:{...t[s][1].start},end:{...t[t.length-1][1].end}},p={type:"label",start:{...t[s][1].start},end:{...t[l][1].end}},m={type:"labelText",start:{...t[s+i+2][1].end},end:{...t[l-2][1].start}};return c=[["enter",d,e],["enter",p,e]],c=Os(c,t.slice(s+1,s+i+3)),c=Os(c,[["enter",m,e]]),c=Os(c,ab(e.parser.constructs.insideSpan.null,t.slice(s+i+4,l-3),e)),c=Os(c,[["exit",m,e],t[l-2],t[l-1],["exit",p,e]]),c=Os(c,t.slice(l+1)),c=Os(c,[["exit",d,e]]),ns(t,s,t.length,c),t}function yI(t,e,n){const i=this;let r=i.events.length,s,l;for(;r--;)if((i.events[r][1].type==="labelImage"||i.events[r][1].type==="labelLink")&&!i.events[r][1]._balanced){s=i.events[r][1];break}return c;function c(b){return s?s._inactive?g(b):(l=i.parser.defined.includes(bl(i.sliceSerialize({start:s.end,end:i.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(b),t.exit("labelMarker"),t.exit("labelEnd"),d):n(b)}function d(b){return b===40?t.attempt(dI,m,l?m:g)(b):b===91?t.attempt(hI,m,l?p:g)(b):l?m(b):g(b)}function p(b){return t.attempt(pI,m,g)(b)}function m(b){return e(b)}function g(b){return s._balanced=!0,n(b)}}function bI(t,e,n){return i;function i(g){return t.enter("resource"),t.enter("resourceMarker"),t.consume(g),t.exit("resourceMarker"),r}function r(g){return Dn(g)?Em(t,s)(g):s(g)}function s(g){return g===41?m(g):GM(t,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function l(g){return Dn(g)?Em(t,d)(g):m(g)}function c(g){return n(g)}function d(g){return g===34||g===39||g===40?qM(t,p,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):m(g)}function p(g){return Dn(g)?Em(t,m)(g):m(g)}function m(g){return g===41?(t.enter("resourceMarker"),t.consume(g),t.exit("resourceMarker"),t.exit("resource"),e):n(g)}}function xI(t,e,n){const i=this;return r;function r(c){return FM.call(i,t,s,l,"reference","referenceMarker","referenceString")(c)}function s(c){return i.parser.defined.includes(bl(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?e(c):n(c)}function l(c){return n(c)}}function vI(t,e,n){return i;function i(s){return t.enter("reference"),t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),r}function r(s){return s===93?(t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),t.exit("reference"),e):n(s)}}const _I={name:"labelStartImage",resolveAll:g1.resolveAll,tokenize:SI};function SI(t,e,n){const i=this;return r;function r(c){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(c),t.exit("labelImageMarker"),s}function s(c){return c===91?(t.enter("labelMarker"),t.consume(c),t.exit("labelMarker"),t.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(c):e(c)}}const EI={name:"labelStartLink",resolveAll:g1.resolveAll,tokenize:wI};function wI(t,e,n){const i=this;return r;function r(l){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(l),t.exit("labelMarker"),t.exit("labelLink"),s}function s(l){return l===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(l):e(l)}}const ev={name:"lineEnding",tokenize:TI};function TI(t,e){return n;function n(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),Kt(t,e,"linePrefix")}}const m0={name:"thematicBreak",tokenize:CI};function CI(t,e,n){let i=0,r;return s;function s(p){return t.enter("thematicBreak"),l(p)}function l(p){return r=p,c(p)}function c(p){return p===r?(t.enter("thematicBreakSequence"),d(p)):i>=3&&(p===null||st(p))?(t.exit("thematicBreak"),e(p)):n(p)}function d(p){return p===r?(t.consume(p),i++,d):(t.exit("thematicBreakSequence"),Lt(p)?Kt(t,c,"whitespace")(p):c(p))}}const Ta={continuation:{tokenize:NI},exit:OI,name:"list",tokenize:RI},AI={partial:!0,tokenize:DI},MI={partial:!0,tokenize:kI};function RI(t,e,n){const i=this,r=i.events[i.events.length-1];let s=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,l=0;return c;function c(v){const _=i.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(_==="listUnordered"?!i.containerState.marker||v===i.containerState.marker:u_(v)){if(i.containerState.type||(i.containerState.type=_,t.enter(_,{_container:!0})),_==="listUnordered")return t.enter("listItemPrefix"),v===42||v===45?t.check(m0,n,p)(v):p(v);if(!i.interrupt||v===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),d(v)}return n(v)}function d(v){return u_(v)&&++l<10?(t.consume(v),d):(!i.interrupt||l<2)&&(i.containerState.marker?v===i.containerState.marker:v===41||v===46)?(t.exit("listItemValue"),p(v)):n(v)}function p(v){return t.enter("listItemMarker"),t.consume(v),t.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||v,t.check(Zm,i.interrupt?n:m,t.attempt(AI,b,g))}function m(v){return i.containerState.initialBlankLine=!0,s++,b(v)}function g(v){return Lt(v)?(t.enter("listItemPrefixWhitespace"),t.consume(v),t.exit("listItemPrefixWhitespace"),b):n(v)}function b(v){return i.containerState.size=s+i.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(v)}}function NI(t,e,n){const i=this;return i.containerState._closeFlow=void 0,t.check(Zm,r,s);function r(c){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Kt(t,e,"listItemIndent",i.containerState.size+1)(c)}function s(c){return i.containerState.furtherBlankLines||!Lt(c)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,l(c)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,t.attempt(MI,e,l)(c))}function l(c){return i.containerState._closeFlow=!0,i.interrupt=void 0,Kt(t,t.attempt(Ta,e,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function kI(t,e,n){const i=this;return Kt(t,r,"listItemIndent",i.containerState.size+1);function r(s){const l=i.events[i.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===i.containerState.size?e(s):n(s)}}function OI(t){t.exit(this.containerState.type)}function DI(t,e,n){const i=this;return Kt(t,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(s){const l=i.events[i.events.length-1];return!Lt(s)&&l&&l[1].type==="listItemPrefixWhitespace"?e(s):n(s)}}const m2={name:"setextUnderline",resolveTo:zI,tokenize:BI};function zI(t,e){let n=t.length,i,r,s;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){i=n;break}t[n][1].type==="paragraph"&&(r=n)}else t[n][1].type==="content"&&t.splice(n,1),!s&&t[n][1].type==="definition"&&(s=n);const l={type:"setextHeading",start:{...t[i][1].start},end:{...t[t.length-1][1].end}};return t[r][1].type="setextHeadingText",s?(t.splice(r,0,["enter",l,e]),t.splice(s+1,0,["exit",t[i][1],e]),t[i][1].end={...t[s][1].end}):t[i][1]=l,t.push(["exit",l,e]),t}function BI(t,e,n){const i=this;let r;return s;function s(p){let m=i.events.length,g;for(;m--;)if(i.events[m][1].type!=="lineEnding"&&i.events[m][1].type!=="linePrefix"&&i.events[m][1].type!=="content"){g=i.events[m][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||g)?(t.enter("setextHeadingLine"),r=p,l(p)):n(p)}function l(p){return t.enter("setextHeadingLineSequence"),c(p)}function c(p){return p===r?(t.consume(p),c):(t.exit("setextHeadingLineSequence"),Lt(p)?Kt(t,d,"lineSuffix")(p):d(p))}function d(p){return p===null||st(p)?(t.exit("setextHeadingLine"),e(p)):n(p)}}const LI={tokenize:UI};function UI(t){const e=this,n=t.attempt(Zm,i,t.attempt(this.parser.constructs.flowInitial,r,Kt(t,t.attempt(this.parser.constructs.flow,r,t.attempt(GU,r)),"linePrefix")));return n;function i(s){if(s===null){t.consume(s);return}return t.enter("lineEndingBlank"),t.consume(s),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function r(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const II={resolveAll:VM()},jI=YM("string"),HI=YM("text");function YM(t){return{resolveAll:VM(t==="text"?PI:void 0),tokenize:e};function e(n){const i=this,r=this.parser.constructs[t],s=n.attempt(r,l,c);return l;function l(m){return p(m)?s(m):c(m)}function c(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),d}function d(m){return p(m)?(n.exit("data"),s(m)):(n.consume(m),d)}function p(m){if(m===null)return!0;const g=r[m];let b=-1;if(g)for(;++b<g.length;){const v=g[b];if(!v.previous||v.previous.call(i,i.previous))return!0}return!1}}}function VM(t){return e;function e(n,i){let r=-1,s;for(;++r<=n.length;)s===void 0?n[r]&&n[r][1].type==="data"&&(s=r,r++):(!n[r]||n[r][1].type!=="data")&&(r!==s+2&&(n[s][1].end=n[r-1][1].end,n.splice(s+2,r-s-2),r=s+2),s=void 0);return t?t(n,i):n}}function PI(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const i=t[n-1][1],r=e.sliceStream(i);let s=r.length,l=-1,c=0,d;for(;s--;){const p=r[s];if(typeof p=="string"){for(l=p.length;p.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(p===-2)d=!0,c++;else if(p!==-1){s++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(c=0),c){const p={type:n===t.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?l:i.start._bufferIndex+l,_index:i.start._index+s,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...p.start},i.start.offset===i.end.offset?Object.assign(i,p):(t.splice(n,0,["enter",p,e],["exit",p,e]),n+=2)}n++}return t}const GI={42:Ta,43:Ta,45:Ta,48:Ta,49:Ta,50:Ta,51:Ta,52:Ta,53:Ta,54:Ta,55:Ta,56:Ta,57:Ta,62:IM},FI={91:XU},qI={[-2]:Jx,[-1]:Jx,32:Jx},YI={35:JU,42:m0,45:[m2,m0],60:iI,61:m2,95:m0,96:h2,126:h2},VI={38:HM,92:jM},XI={[-5]:ev,[-4]:ev,[-3]:ev,33:_I,38:HM,42:f_,60:[EU,uI],91:EI,92:[ZU,jM],93:g1,95:f_,96:LU},KI={null:[f_,II]},WI={null:[42,95]},$I={null:[]},ZI=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:WI,contentInitial:FI,disable:$I,document:GI,flow:YI,flowInitial:qI,insideSpan:KI,string:VI,text:XI},Symbol.toStringTag,{value:"Module"}));function QI(t,e,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const r={},s=[];let l=[],c=[];const d={attempt:F(j),check:F(D),consume:k,enter:R,exit:O,interrupt:F(D,{interrupt:!0})},p={code:null,containerState:{},defineSkip:C,events:[],now:_,parser:t,previous:null,sliceSerialize:b,sliceStream:v,write:g};let m=e.tokenize.call(p,d);return e.resolveAll&&s.push(e),p;function g(K){return l=Os(l,K),T(),l[l.length-1]!==null?[]:($(e,0),p.events=ab(s,p.events,p),p.events)}function b(K,G){return ej(v(K),G)}function v(K){return JI(l,K)}function _(){const{_bufferIndex:K,_index:G,line:te,column:H,offset:W}=i;return{_bufferIndex:K,_index:G,line:te,column:H,offset:W}}function C(K){r[K.line]=K.column,I()}function T(){let K;for(;i._index<l.length;){const G=l[i._index];if(typeof G=="string")for(K=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===K&&i._bufferIndex<G.length;)w(G.charCodeAt(i._bufferIndex));else w(G)}}function w(K){m=m(K)}function k(K){st(K)?(i.line++,i.column=1,i.offset+=K===-3?2:1,I()):K!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===l[i._index].length&&(i._bufferIndex=-1,i._index++)),p.previous=K}function R(K,G){const te=G||{};return te.type=K,te.start=_(),p.events.push(["enter",te,p]),c.push(te),te}function O(K){const G=c.pop();return G.end=_(),p.events.push(["exit",G,p]),G}function j(K,G){$(K,G.from)}function D(K,G){G.restore()}function F(K,G){return te;function te(H,W,B){let X,Z,Q,q;return Array.isArray(H)?ee(H):"tokenize"in H?ee([H]):Y(H);function Y(ve){return se;function se(ge){const le=ge!==null&&ve[ge],Re=ge!==null&&ve.null,Ie=[...Array.isArray(le)?le:le?[le]:[],...Array.isArray(Re)?Re:Re?[Re]:[]];return ee(Ie)(ge)}}function ee(ve){return X=ve,Z=0,ve.length===0?B:V(ve[Z])}function V(ve){return se;function se(ge){return q=P(),Q=ve,ve.partial||(p.currentConstruct=ve),ve.name&&p.parser.constructs.disable.null.includes(ve.name)?be():ve.tokenize.call(G?Object.assign(Object.create(p),G):p,d,oe,be)(ge)}}function oe(ve){return K(Q,q),W}function be(ve){return q.restore(),++Z<X.length?V(X[Z]):B}}}function $(K,G){K.resolveAll&&!s.includes(K)&&s.push(K),K.resolve&&ns(p.events,G,p.events.length-G,K.resolve(p.events.slice(G),p)),K.resolveTo&&(p.events=K.resolveTo(p.events,p))}function P(){const K=_(),G=p.previous,te=p.currentConstruct,H=p.events.length,W=Array.from(c);return{from:H,restore:B};function B(){i=K,p.previous=G,p.currentConstruct=te,p.events.length=H,c=W,I()}}function I(){i.line in r&&i.column<2&&(i.column=r[i.line],i.offset+=r[i.line]-1)}}function JI(t,e){const n=e.start._index,i=e.start._bufferIndex,r=e.end._index,s=e.end._bufferIndex;let l;if(n===r)l=[t[n].slice(i,s)];else{if(l=t.slice(n,r),i>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(i):l.shift()}s>0&&l.push(t[r].slice(0,s))}return l}function ej(t,e){let n=-1;const i=[];let r;for(;++n<t.length;){const s=t[n];let l;if(typeof s=="string")l=s;else switch(s){case-5:{l="\r";break}case-4:{l=`
|
|
346
|
+
`;break}case-3:{l=`\r
|
|
347
|
+
`;break}case-2:{l=e?" ":" ";break}case-1:{if(!e&&r)continue;l=" ";break}default:l=String.fromCharCode(s)}r=s===-2,i.push(l)}return i.join("")}function tj(t){const i={constructs:LM([ZI,...(t||{}).extensions||[]]),content:r(gU),defined:[],document:r(bU),flow:r(LI),lazy:{},string:r(jI),text:r(HI)};return i;function r(s){return l;function l(c){return QI(i,s,c)}}}function nj(t){for(;!PM(t););return t}const g2=/[\0\t\n\r]/g;function ij(){let t=1,e="",n=!0,i;return r;function r(s,l,c){const d=[];let p,m,g,b,v;for(s=e+(typeof s=="string"?s.toString():new TextDecoder(l||void 0).decode(s)),g=0,e="",n&&(s.charCodeAt(0)===65279&&g++,n=void 0);g<s.length;){if(g2.lastIndex=g,p=g2.exec(s),b=p&&p.index!==void 0?p.index:s.length,v=s.charCodeAt(b),!p){e=s.slice(g);break}if(v===10&&g===b&&i)d.push(-3),i=void 0;else switch(i&&(d.push(-5),i=void 0),g<b&&(d.push(s.slice(g,b)),t+=b-g),v){case 0:{d.push(65533),t++;break}case 9:{for(m=Math.ceil(t/4)*4,d.push(-2);t++<m;)d.push(-1);break}case 10:{d.push(-4),t=1;break}default:i=!0,t=1}g=b+1}return c&&(i&&d.push(-5),e&&d.push(e),d.push(null)),d}}const rj=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function aj(t){return t.replace(rj,sj)}function sj(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const r=n.charCodeAt(1),s=r===120||r===88;return UM(n.slice(s?2:1),s?16:10)}return m1(n)||t}const XM={}.hasOwnProperty;function lj(t,e,n){return e&&typeof e=="object"&&(n=e,e=void 0),oj(n)(nj(tj(n).document().write(ij()(t,e,!0))))}function oj(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Bn),autolinkProtocol:P,autolinkEmail:P,atxHeading:s(ut),blockQuote:s(Re),characterEscape:P,characterReference:P,codeFenced:s(Ie),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:s(Ie,l),codeText:s(Ue,l),codeTextData:P,data:P,codeFlowValue:P,definition:s(Le),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:s(Ve),hardBreakEscape:s(He),hardBreakTrailing:s(He),htmlFlow:s(At,l),htmlFlowData:P,htmlText:s(At,l),htmlTextData:P,image:s(zn),label:l,link:s(Bn),listItem:s(wi),listItemValue:b,listOrdered:s(bn,g),listUnordered:s(bn),paragraph:s(ka),reference:V,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:s(ut),strong:s(Lr),thematicBreak:s(ua)},exit:{atxHeading:d(),atxHeadingSequence:j,autolink:d(),autolinkEmail:le,autolinkProtocol:ge,blockQuote:d(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:be,characterReferenceMarkerNumeric:be,characterReferenceValue:ve,characterReference:se,codeFenced:d(T),codeFencedFence:C,codeFencedFenceInfo:v,codeFencedFenceMeta:_,codeFlowValue:I,codeIndented:d(w),codeText:d(W),codeTextData:I,data:I,definition:d(),definitionDestinationString:O,definitionLabelString:k,definitionTitleString:R,emphasis:d(),hardBreakEscape:d(G),hardBreakTrailing:d(G),htmlFlow:d(te),htmlFlowData:I,htmlText:d(H),htmlTextData:I,image:d(X),label:Q,labelText:Z,lineEnding:K,link:d(B),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:oe,resourceDestinationString:q,resourceTitleString:Y,resource:ee,setextHeading:d($),setextHeadingLineSequence:F,setextHeadingText:D,strong:d(),thematicBreak:d()}};KM(e,(t||{}).mdastExtensions||[]);const n={};return i;function i(Se){let ke={type:"root",children:[]};const Je={stack:[ke],tokenStack:[],config:e,enter:c,exit:p,buffer:l,resume:m,data:n},bt=[];let kt=-1;for(;++kt<Se.length;)if(Se[kt][1].type==="listOrdered"||Se[kt][1].type==="listUnordered")if(Se[kt][0]==="enter")bt.push(kt);else{const yi=bt.pop();kt=r(Se,yi,kt)}for(kt=-1;++kt<Se.length;){const yi=e[Se[kt][0]];XM.call(yi,Se[kt][1].type)&&yi[Se[kt][1].type].call(Object.assign({sliceSerialize:Se[kt][2].sliceSerialize},Je),Se[kt][1])}if(Je.tokenStack.length>0){const yi=Je.tokenStack[Je.tokenStack.length-1];(yi[1]||y2).call(Je,void 0,yi[0])}for(ke.position={start:Zc(Se.length>0?Se[0][1].start:{line:1,column:1,offset:0}),end:Zc(Se.length>0?Se[Se.length-2][1].end:{line:1,column:1,offset:0})},kt=-1;++kt<e.transforms.length;)ke=e.transforms[kt](ke)||ke;return ke}function r(Se,ke,Je){let bt=ke-1,kt=-1,yi=!1,rr,xn,$t,Gn;for(;++bt<=Je;){const Pt=Se[bt];switch(Pt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Pt[0]==="enter"?kt++:kt--,Gn=void 0;break}case"lineEndingBlank":{Pt[0]==="enter"&&(rr&&!Gn&&!kt&&!$t&&($t=bt),Gn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Gn=void 0}if(!kt&&Pt[0]==="enter"&&Pt[1].type==="listItemPrefix"||kt===-1&&Pt[0]==="exit"&&(Pt[1].type==="listUnordered"||Pt[1].type==="listOrdered")){if(rr){let Fi=bt;for(xn=void 0;Fi--;){const Qn=Se[Fi];if(Qn[1].type==="lineEnding"||Qn[1].type==="lineEndingBlank"){if(Qn[0]==="exit")continue;xn&&(Se[xn][1].type="lineEndingBlank",yi=!0),Qn[1].type="lineEnding",xn=Fi}else if(!(Qn[1].type==="linePrefix"||Qn[1].type==="blockQuotePrefix"||Qn[1].type==="blockQuotePrefixWhitespace"||Qn[1].type==="blockQuoteMarker"||Qn[1].type==="listItemIndent"))break}$t&&(!xn||$t<xn)&&(rr._spread=!0),rr.end=Object.assign({},xn?Se[xn][1].start:Pt[1].end),Se.splice(xn||bt,0,["exit",rr,Pt[2]]),bt++,Je++}if(Pt[1].type==="listItemPrefix"){const Fi={type:"listItem",_spread:!1,start:Object.assign({},Pt[1].start),end:void 0};rr=Fi,Se.splice(bt,0,["enter",Fi,Pt[2]]),bt++,Je++,$t=void 0,Gn=!0}}}return Se[ke][1]._spread=yi,Je}function s(Se,ke){return Je;function Je(bt){c.call(this,Se(bt),bt),ke&&ke.call(this,bt)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(Se,ke,Je){this.stack[this.stack.length-1].children.push(Se),this.stack.push(Se),this.tokenStack.push([ke,Je||void 0]),Se.position={start:Zc(ke.start),end:void 0}}function d(Se){return ke;function ke(Je){Se&&Se.call(this,Je),p.call(this,Je)}}function p(Se,ke){const Je=this.stack.pop(),bt=this.tokenStack.pop();if(bt)bt[0].type!==Se.type&&(ke?ke.call(this,Se,bt[0]):(bt[1]||y2).call(this,Se,bt[0]));else throw new Error("Cannot close `"+Se.type+"` ("+Sm({start:Se.start,end:Se.end})+"): it’s not open");Je.position.end=Zc(Se.end)}function m(){return p1(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function b(Se){if(this.data.expectingFirstListItemValue){const ke=this.stack[this.stack.length-2];ke.start=Number.parseInt(this.sliceSerialize(Se),10),this.data.expectingFirstListItemValue=void 0}}function v(){const Se=this.resume(),ke=this.stack[this.stack.length-1];ke.lang=Se}function _(){const Se=this.resume(),ke=this.stack[this.stack.length-1];ke.meta=Se}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){const Se=this.resume(),ke=this.stack[this.stack.length-1];ke.value=Se.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const Se=this.resume(),ke=this.stack[this.stack.length-1];ke.value=Se.replace(/(\r?\n|\r)$/g,"")}function k(Se){const ke=this.resume(),Je=this.stack[this.stack.length-1];Je.label=ke,Je.identifier=bl(this.sliceSerialize(Se)).toLowerCase()}function R(){const Se=this.resume(),ke=this.stack[this.stack.length-1];ke.title=Se}function O(){const Se=this.resume(),ke=this.stack[this.stack.length-1];ke.url=Se}function j(Se){const ke=this.stack[this.stack.length-1];if(!ke.depth){const Je=this.sliceSerialize(Se).length;ke.depth=Je}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function F(Se){const ke=this.stack[this.stack.length-1];ke.depth=this.sliceSerialize(Se).codePointAt(0)===61?1:2}function $(){this.data.setextHeadingSlurpLineEnding=void 0}function P(Se){const Je=this.stack[this.stack.length-1].children;let bt=Je[Je.length-1];(!bt||bt.type!=="text")&&(bt=hn(),bt.position={start:Zc(Se.start),end:void 0},Je.push(bt)),this.stack.push(bt)}function I(Se){const ke=this.stack.pop();ke.value+=this.sliceSerialize(Se),ke.position.end=Zc(Se.end)}function K(Se){const ke=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Je=ke.children[ke.children.length-1];Je.position.end=Zc(Se.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(ke.type)&&(P.call(this,Se),I.call(this,Se))}function G(){this.data.atHardBreak=!0}function te(){const Se=this.resume(),ke=this.stack[this.stack.length-1];ke.value=Se}function H(){const Se=this.resume(),ke=this.stack[this.stack.length-1];ke.value=Se}function W(){const Se=this.resume(),ke=this.stack[this.stack.length-1];ke.value=Se}function B(){const Se=this.stack[this.stack.length-1];if(this.data.inReference){const ke=this.data.referenceType||"shortcut";Se.type+="Reference",Se.referenceType=ke,delete Se.url,delete Se.title}else delete Se.identifier,delete Se.label;this.data.referenceType=void 0}function X(){const Se=this.stack[this.stack.length-1];if(this.data.inReference){const ke=this.data.referenceType||"shortcut";Se.type+="Reference",Se.referenceType=ke,delete Se.url,delete Se.title}else delete Se.identifier,delete Se.label;this.data.referenceType=void 0}function Z(Se){const ke=this.sliceSerialize(Se),Je=this.stack[this.stack.length-2];Je.label=aj(ke),Je.identifier=bl(ke).toLowerCase()}function Q(){const Se=this.stack[this.stack.length-1],ke=this.resume(),Je=this.stack[this.stack.length-1];if(this.data.inReference=!0,Je.type==="link"){const bt=Se.children;Je.children=bt}else Je.alt=ke}function q(){const Se=this.resume(),ke=this.stack[this.stack.length-1];ke.url=Se}function Y(){const Se=this.resume(),ke=this.stack[this.stack.length-1];ke.title=Se}function ee(){this.data.inReference=void 0}function V(){this.data.referenceType="collapsed"}function oe(Se){const ke=this.resume(),Je=this.stack[this.stack.length-1];Je.label=ke,Je.identifier=bl(this.sliceSerialize(Se)).toLowerCase(),this.data.referenceType="full"}function be(Se){this.data.characterReferenceType=Se.type}function ve(Se){const ke=this.sliceSerialize(Se),Je=this.data.characterReferenceType;let bt;Je?(bt=UM(ke,Je==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):bt=m1(ke);const kt=this.stack[this.stack.length-1];kt.value+=bt}function se(Se){const ke=this.stack.pop();ke.position.end=Zc(Se.end)}function ge(Se){I.call(this,Se);const ke=this.stack[this.stack.length-1];ke.url=this.sliceSerialize(Se)}function le(Se){I.call(this,Se);const ke=this.stack[this.stack.length-1];ke.url="mailto:"+this.sliceSerialize(Se)}function Re(){return{type:"blockquote",children:[]}}function Ie(){return{type:"code",lang:null,meta:null,value:""}}function Ue(){return{type:"inlineCode",value:""}}function Le(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ve(){return{type:"emphasis",children:[]}}function ut(){return{type:"heading",depth:0,children:[]}}function He(){return{type:"break"}}function At(){return{type:"html",value:""}}function zn(){return{type:"image",title:null,url:"",alt:null}}function Bn(){return{type:"link",title:null,url:"",children:[]}}function bn(Se){return{type:"list",ordered:Se.type==="listOrdered",start:null,spread:Se._spread,children:[]}}function wi(Se){return{type:"listItem",spread:Se._spread,checked:null,children:[]}}function ka(){return{type:"paragraph",children:[]}}function Lr(){return{type:"strong",children:[]}}function hn(){return{type:"text",value:""}}function ua(){return{type:"thematicBreak"}}}function Zc(t){return{line:t.line,column:t.column,offset:t.offset}}function KM(t,e){let n=-1;for(;++n<e.length;){const i=e[n];Array.isArray(i)?KM(t,i):cj(t,i)}}function cj(t,e){let n;for(n in e)if(XM.call(e,n))switch(n){case"canContainEols":{const i=e[n];i&&t[n].push(...i);break}case"transforms":{const i=e[n];i&&t[n].push(...i);break}case"enter":case"exit":{const i=e[n];i&&Object.assign(t[n],i);break}}}function y2(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+Sm({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+Sm({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+Sm({start:e.start,end:e.end})+") is still open")}function uj(t){const e=this;e.parser=n;function n(i){return lj(i,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function fj(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function dj(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
|
|
348
|
+
`}]}function hj(t,e){const n=e.value?e.value+`
|
|
349
|
+
`:"",i={},r=e.lang?e.lang.split(/\s+/):[];r.length>0&&(i.className=["language-"+r[0]]);let s={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return e.meta&&(s.data={meta:e.meta}),t.patch(e,s),s=t.applyData(e,s),s={type:"element",tagName:"pre",properties:{},children:[s]},t.patch(e,s),s}function pj(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function mj(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function gj(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",i=String(e.identifier).toUpperCase(),r=Sh(i.toLowerCase()),s=t.footnoteOrder.indexOf(i);let l,c=t.footnoteCounts.get(i);c===void 0?(c=0,t.footnoteOrder.push(i),l=t.footnoteOrder.length):l=s+1,c+=1,t.footnoteCounts.set(i,c);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};t.patch(e,d);const p={type:"element",tagName:"sup",properties:{},children:[d]};return t.patch(e,p),t.applyData(e,p)}function yj(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function bj(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function WM(t,e){const n=e.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+i}];const r=t.all(e),s=r[0];s&&s.type==="text"?s.value="["+s.value:r.unshift({type:"text",value:"["});const l=r[r.length-1];return l&&l.type==="text"?l.value+=i:r.push({type:"text",value:i}),r}function xj(t,e){const n=String(e.identifier).toUpperCase(),i=t.definitionById.get(n);if(!i)return WM(t,e);const r={src:Sh(i.url||""),alt:e.alt};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"img",properties:r,children:[]};return t.patch(e,s),t.applyData(e,s)}function vj(t,e){const n={src:Sh(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const i={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,i),t.applyData(e,i)}function _j(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,i),t.applyData(e,i)}function Sj(t,e){const n=String(e.identifier).toUpperCase(),i=t.definitionById.get(n);if(!i)return WM(t,e);const r={href:Sh(i.url||"")};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"a",properties:r,children:t.all(e)};return t.patch(e,s),t.applyData(e,s)}function Ej(t,e){const n={href:Sh(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const i={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function wj(t,e,n){const i=t.all(e),r=n?Tj(n):$M(e),s={},l=[];if(typeof e.checked=="boolean"){const m=i[0];let g;m&&m.type==="element"&&m.tagName==="p"?g=m:(g={type:"element",tagName:"p",properties:{},children:[]},i.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let c=-1;for(;++c<i.length;){const m=i[c];(r||c!==0||m.type!=="element"||m.tagName!=="p")&&l.push({type:"text",value:`
|
|
350
|
+
`}),m.type==="element"&&m.tagName==="p"&&!r?l.push(...m.children):l.push(m)}const d=i[i.length-1];d&&(r||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
|
|
351
|
+
`});const p={type:"element",tagName:"li",properties:s,children:l};return t.patch(e,p),t.applyData(e,p)}function Tj(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let i=-1;for(;!e&&++i<n.length;)e=$M(n[i])}return e}function $M(t){const e=t.spread;return e??t.children.length>1}function Cj(t,e){const n={},i=t.all(e);let r=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++r<i.length;){const l=i[r];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(i,!0)};return t.patch(e,s),t.applyData(e,s)}function Aj(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Mj(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function Rj(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Nj(t,e){const n=t.all(e),i=n.shift(),r=[];if(i){const l={type:"element",tagName:"thead",properties:{},children:t.wrap([i],!0)};t.patch(e.children[0],l),r.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},c=u1(e.children[1]),d=RM(e.children[e.children.length-1]);c&&d&&(l.position={start:c,end:d}),r.push(l)}const s={type:"element",tagName:"table",properties:{},children:t.wrap(r,!0)};return t.patch(e,s),t.applyData(e,s)}function kj(t,e,n){const i=n?n.children:void 0,s=(i?i.indexOf(e):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,c=l?l.length:e.children.length;let d=-1;const p=[];for(;++d<c;){const g=e.children[d],b={},v=l?l[d]:void 0;v&&(b.align=v);let _={type:"element",tagName:s,properties:b,children:[]};g&&(_.children=t.all(g),t.patch(g,_),_=t.applyData(g,_)),p.push(_)}const m={type:"element",tagName:"tr",properties:{},children:t.wrap(p,!0)};return t.patch(e,m),t.applyData(e,m)}function Oj(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const b2=9,x2=32;function Dj(t){const e=String(t),n=/\r?\n|\r/g;let i=n.exec(e),r=0;const s=[];for(;i;)s.push(v2(e.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=n.exec(e);return s.push(v2(e.slice(r),r>0,!1)),s.join("")}function v2(t,e,n){let i=0,r=t.length;if(e){let s=t.codePointAt(i);for(;s===b2||s===x2;)i++,s=t.codePointAt(i)}if(n){let s=t.codePointAt(r-1);for(;s===b2||s===x2;)r--,s=t.codePointAt(r-1)}return r>i?t.slice(i,r):""}function zj(t,e){const n={type:"text",value:Dj(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function Bj(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const Lj={blockquote:fj,break:dj,code:hj,delete:pj,emphasis:mj,footnoteReference:gj,heading:yj,html:bj,imageReference:xj,image:vj,inlineCode:_j,linkReference:Sj,link:Ej,listItem:wj,list:Cj,paragraph:Aj,root:Mj,strong:Rj,table:Nj,tableCell:Oj,tableRow:kj,text:zj,thematicBreak:Bj,toml:qy,yaml:qy,definition:qy,footnoteDefinition:qy};function qy(){}const ZM=-1,sb=0,wm=1,k0=2,y1=3,b1=4,x1=5,v1=6,QM=7,JM=8,_2=typeof self=="object"?self:globalThis,Uj=(t,e)=>{const n=(r,s)=>(t.set(s,r),r),i=r=>{if(t.has(r))return t.get(r);const[s,l]=e[r];switch(s){case sb:case ZM:return n(l,r);case wm:{const c=n([],r);for(const d of l)c.push(i(d));return c}case k0:{const c=n({},r);for(const[d,p]of l)c[i(d)]=i(p);return c}case y1:return n(new Date(l),r);case b1:{const{source:c,flags:d}=l;return n(new RegExp(c,d),r)}case x1:{const c=n(new Map,r);for(const[d,p]of l)c.set(i(d),i(p));return c}case v1:{const c=n(new Set,r);for(const d of l)c.add(i(d));return c}case QM:{const{name:c,message:d}=l;return n(new _2[c](d),r)}case JM:return n(BigInt(l),r);case"BigInt":return n(Object(BigInt(l)),r);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return n(new DataView(c),l)}}return n(new _2[s](l),r)};return i},S2=t=>Uj(new Map,t)(0),Id="",{toString:Ij}={},{keys:jj}=Object,am=t=>{const e=typeof t;if(e!=="object"||!t)return[sb,e];const n=Ij.call(t).slice(8,-1);switch(n){case"Array":return[wm,Id];case"Object":return[k0,Id];case"Date":return[y1,Id];case"RegExp":return[b1,Id];case"Map":return[x1,Id];case"Set":return[v1,Id];case"DataView":return[wm,n]}return n.includes("Array")?[wm,n]:n.includes("Error")?[QM,n]:[k0,n]},Yy=([t,e])=>t===sb&&(e==="function"||e==="symbol"),Hj=(t,e,n,i)=>{const r=(l,c)=>{const d=i.push(l)-1;return n.set(c,d),d},s=l=>{if(n.has(l))return n.get(l);let[c,d]=am(l);switch(c){case sb:{let m=l;switch(d){case"bigint":c=JM,m=l.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+d);m=null;break;case"undefined":return r([ZM],l)}return r([c,m],l)}case wm:{if(d){let b=l;return d==="DataView"?b=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(b=new Uint8Array(l)),r([d,[...b]],l)}const m=[],g=r([c,m],l);for(const b of l)m.push(s(b));return g}case k0:{if(d)switch(d){case"BigInt":return r([d,l.toString()],l);case"Boolean":case"Number":case"String":return r([d,l.valueOf()],l)}if(e&&"toJSON"in l)return s(l.toJSON());const m=[],g=r([c,m],l);for(const b of jj(l))(t||!Yy(am(l[b])))&&m.push([s(b),s(l[b])]);return g}case y1:return r([c,l.toISOString()],l);case b1:{const{source:m,flags:g}=l;return r([c,{source:m,flags:g}],l)}case x1:{const m=[],g=r([c,m],l);for(const[b,v]of l)(t||!(Yy(am(b))||Yy(am(v))))&&m.push([s(b),s(v)]);return g}case v1:{const m=[],g=r([c,m],l);for(const b of l)(t||!Yy(am(b)))&&m.push(s(b));return g}}const{message:p}=l;return r([c,{name:d,message:p}],l)};return s},E2=(t,{json:e,lossy:n}={})=>{const i=[];return Hj(!(e||n),!!e,new Map,i)(t),i},O0=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?S2(E2(t,e)):structuredClone(t):(t,e)=>S2(E2(t,e));function Pj(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function Gj(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function Fj(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||Pj,i=t.options.footnoteBackLabel||Gj,r=t.options.footnoteLabel||"Footnotes",s=t.options.footnoteLabelTagName||"h2",l=t.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let d=-1;for(;++d<t.footnoteOrder.length;){const p=t.footnoteById.get(t.footnoteOrder[d]);if(!p)continue;const m=t.all(p),g=String(p.identifier).toUpperCase(),b=Sh(g.toLowerCase());let v=0;const _=[],C=t.footnoteCounts.get(g);for(;C!==void 0&&++v<=C;){_.length>0&&_.push({type:"text",value:" "});let k=typeof n=="string"?n:n(d,v);typeof k=="string"&&(k={type:"text",value:k}),_.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+b+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(d,v),className:["data-footnote-backref"]},children:Array.isArray(k)?k:[k]})}const T=m[m.length-1];if(T&&T.type==="element"&&T.tagName==="p"){const k=T.children[T.children.length-1];k&&k.type==="text"?k.value+=" ":T.children.push({type:"text",value:" "}),T.children.push(..._)}else m.push(..._);const w={type:"element",tagName:"li",properties:{id:e+"fn-"+b},children:t.wrap(m,!0)};t.patch(p,w),c.push(w)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...O0(l),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:`
|
|
352
|
+
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(c,!0)},{type:"text",value:`
|
|
353
|
+
`}]}}const Qm=(function(t){if(t==null)return Xj;if(typeof t=="function")return lb(t);if(typeof t=="object")return Array.isArray(t)?qj(t):Yj(t);if(typeof t=="string")return Vj(t);throw new Error("Expected function, string, or object as test")});function qj(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=Qm(t[n]);return lb(i);function i(...r){let s=-1;for(;++s<e.length;)if(e[s].apply(this,r))return!0;return!1}}function Yj(t){const e=t;return lb(n);function n(i){const r=i;let s;for(s in t)if(r[s]!==e[s])return!1;return!0}}function Vj(t){return lb(e);function e(n){return n&&n.type===t}}function lb(t){return e;function e(n,i,r){return!!(Kj(n)&&t.call(this,n,typeof i=="number"?i:void 0,r||void 0))}}function Xj(){return!0}function Kj(t){return t!==null&&typeof t=="object"&&"type"in t}const eR=[],Wj=!0,d_=!1,$j="skip";function tR(t,e,n,i){let r;typeof e=="function"&&typeof n!="function"?(i=n,n=e):r=e;const s=Qm(r),l=i?-1:1;c(t,void 0,[])();function c(d,p,m){const g=d&&typeof d=="object"?d:{};if(typeof g.type=="string"){const v=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(d.type+(v?"<"+v+">":""))+")"})}return b;function b(){let v=eR,_,C,T;if((!e||s(d,p,m[m.length-1]||void 0))&&(v=Zj(n(d,m)),v[0]===d_))return v;if("children"in d&&d.children){const w=d;if(w.children&&v[0]!==$j)for(C=(i?w.children.length:-1)+l,T=m.concat(w);C>-1&&C<w.children.length;){const k=w.children[C];if(_=c(k,C,T)(),_[0]===d_)return _;C=typeof _[1]=="number"?_[1]:C+l}}return v}}}function Zj(t){return Array.isArray(t)?t:typeof t=="number"?[Wj,t]:t==null?eR:[t]}function ob(t,e,n,i){let r,s,l;typeof e=="function"&&typeof n!="function"?(s=void 0,l=e,r=n):(s=e,l=n,r=i),tR(t,s,c,r);function c(d,p){const m=p[p.length-1],g=m?m.children.indexOf(d):void 0;return l(d,g,m)}}const h_={}.hasOwnProperty,Qj={};function Jj(t,e){const n=e||Qj,i=new Map,r=new Map,s=new Map,l={...Lj,...n.handlers},c={all:p,applyData:tH,definitionById:i,footnoteById:r,footnoteCounts:s,footnoteOrder:[],handlers:l,one:d,options:n,patch:eH,wrap:iH};return ob(t,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const g=m.type==="definition"?i:r,b=String(m.identifier).toUpperCase();g.has(b)||g.set(b,m)}}),c;function d(m,g){const b=m.type,v=c.handlers[b];if(h_.call(c.handlers,b)&&v)return v(c,m,g);if(c.options.passThrough&&c.options.passThrough.includes(b)){if("children"in m){const{children:C,...T}=m,w=O0(T);return w.children=c.all(m),w}return O0(m)}return(c.options.unknownHandler||nH)(c,m,g)}function p(m){const g=[];if("children"in m){const b=m.children;let v=-1;for(;++v<b.length;){const _=c.one(b[v],m);if(_){if(v&&b[v-1].type==="break"&&(!Array.isArray(_)&&_.type==="text"&&(_.value=w2(_.value)),!Array.isArray(_)&&_.type==="element")){const C=_.children[0];C&&C.type==="text"&&(C.value=w2(C.value))}Array.isArray(_)?g.push(..._):g.push(_)}}}return g}}function eH(t,e){t.position&&(e.position=G8(t))}function tH(t,e){let n=e;if(t&&t.data){const i=t.data.hName,r=t.data.hChildren,s=t.data.hProperties;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const l="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:l}}n.type==="element"&&s&&Object.assign(n.properties,O0(s)),"children"in n&&n.children&&r!==null&&r!==void 0&&(n.children=r)}return n}function nH(t,e){const n=e.data||{},i="value"in e&&!(h_.call(n,"hProperties")||h_.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function iH(t,e){const n=[];let i=-1;for(e&&n.push({type:"text",value:`
|
|
354
|
+
`});++i<t.length;)i&&n.push({type:"text",value:`
|
|
355
|
+
`}),n.push(t[i]);return e&&t.length>0&&n.push({type:"text",value:`
|
|
356
|
+
`}),n}function w2(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function T2(t,e){const n=Jj(t,e),i=n.one(t,void 0),r=Fj(n),s=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&s.children.push({type:"text",value:`
|
|
357
|
+
`},r),s}function rH(t,e){return t&&"run"in t?async function(n,i){const r=T2(n,{file:i,...e});await t.run(r,i)}:function(n,i){return T2(n,{file:i,...t||e})}}function C2(t){if(t)throw t}var tv,A2;function aH(){if(A2)return tv;A2=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,r=function(p){return typeof Array.isArray=="function"?Array.isArray(p):e.call(p)==="[object Array]"},s=function(p){if(!p||e.call(p)!=="[object Object]")return!1;var m=t.call(p,"constructor"),g=p.constructor&&p.constructor.prototype&&t.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!m&&!g)return!1;var b;for(b in p);return typeof b>"u"||t.call(p,b)},l=function(p,m){n&&m.name==="__proto__"?n(p,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):p[m.name]=m.newValue},c=function(p,m){if(m==="__proto__")if(t.call(p,m)){if(i)return i(p,m).value}else return;return p[m]};return tv=function d(){var p,m,g,b,v,_,C=arguments[0],T=1,w=arguments.length,k=!1;for(typeof C=="boolean"&&(k=C,C=arguments[1]||{},T=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});T<w;++T)if(p=arguments[T],p!=null)for(m in p)g=c(C,m),b=c(p,m),C!==b&&(k&&b&&(s(b)||(v=r(b)))?(v?(v=!1,_=g&&r(g)?g:[]):_=g&&s(g)?g:{},l(C,{name:m,newValue:d(k,_,b)})):typeof b<"u"&&l(C,{name:m,newValue:b}));return C},tv}var sH=aH();const nv=uu(sH);function p_(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function lH(){const t=[],e={run:n,use:i};return e;function n(...r){let s=-1;const l=r.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...r);function c(d,...p){const m=t[++s];let g=-1;if(d){l(d);return}for(;++g<r.length;)(p[g]===null||p[g]===void 0)&&(p[g]=r[g]);r=p,m?oH(m,c)(...p):l(null,...p)}}function i(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return t.push(r),e}}function oH(t,e){let n;return i;function i(...l){const c=t.length>l.length;let d;c&&l.push(r);try{d=t.apply(this,l)}catch(p){const m=p;if(c&&n)throw m;return r(m)}c||(d&&d.then&&typeof d.then=="function"?d.then(s,r):d instanceof Error?r(d):s(d))}function r(l,...c){n||(n=!0,e(l,...c))}function s(l){r(null,l)}}const co={basename:cH,dirname:uH,extname:fH,join:dH,sep:"/"};function cH(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');Jm(t);let n=0,i=-1,r=t.length,s;if(e===void 0||e.length===0||e.length>t.length){for(;r--;)if(t.codePointAt(r)===47){if(s){n=r+1;break}}else i<0&&(s=!0,i=r+1);return i<0?"":t.slice(n,i)}if(e===t)return"";let l=-1,c=e.length-1;for(;r--;)if(t.codePointAt(r)===47){if(s){n=r+1;break}}else l<0&&(s=!0,l=r+1),c>-1&&(t.codePointAt(r)===e.codePointAt(c--)?c<0&&(i=r):(c=-1,i=l));return n===i?i=l:i<0&&(i=t.length),t.slice(n,i)}function uH(t){if(Jm(t),t.length===0)return".";let e=-1,n=t.length,i;for(;--n;)if(t.codePointAt(n)===47){if(i){e=n;break}}else i||(i=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function fH(t){Jm(t);let e=t.length,n=-1,i=0,r=-1,s=0,l;for(;e--;){const c=t.codePointAt(e);if(c===47){if(l){i=e+1;break}continue}n<0&&(l=!0,n=e+1),c===46?r<0?r=e:s!==1&&(s=1):r>-1&&(s=-1)}return r<0||n<0||s===0||s===1&&r===n-1&&r===i+1?"":t.slice(r,n)}function dH(...t){let e=-1,n;for(;++e<t.length;)Jm(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":hH(n)}function hH(t){Jm(t);const e=t.codePointAt(0)===47;let n=pH(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function pH(t,e){let n="",i=0,r=-1,s=0,l=-1,c,d;for(;++l<=t.length;){if(l<t.length)c=t.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(r===l-1||s===1))if(r!==l-1&&s===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",i=0):(n=n.slice(0,d),i=n.length-1-n.lastIndexOf("/")),r=l,s=0;continue}}else if(n.length>0){n="",i=0,r=l,s=0;continue}}e&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+t.slice(r+1,l):n=t.slice(r+1,l),i=l-r-1;r=l,s=0}else c===46&&s>-1?s++:s=-1}return n}function Jm(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const mH={cwd:gH};function gH(){return"/"}function m_(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function yH(t){if(typeof t=="string")t=new URL(t);else if(!m_(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return bH(t)}function bH(t){if(t.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const i=e.codePointAt(n+2);if(i===70||i===102){const r=new TypeError("File URL path must not include encoded / characters");throw r.code="ERR_INVALID_FILE_URL_PATH",r}}return decodeURIComponent(e)}const iv=["history","path","basename","stem","extname","dirname"];class nR{constructor(e){let n;e?m_(e)?n={path:e}:typeof e=="string"||xH(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":mH.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<iv.length;){const s=iv[i];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let r;for(r in n)iv.includes(r)||(this[r]=n[r])}get basename(){return typeof this.path=="string"?co.basename(this.path):void 0}set basename(e){av(e,"basename"),rv(e,"basename"),this.path=co.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?co.dirname(this.path):void 0}set dirname(e){M2(this.basename,"dirname"),this.path=co.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?co.extname(this.path):void 0}set extname(e){if(rv(e,"extname"),M2(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=co.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){m_(e)&&(e=yH(e)),av(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?co.basename(this.path,this.extname):void 0}set stem(e){av(e,"stem"),rv(e,"stem"),this.path=co.join(this.dirname||"",e+(this.extname||""))}fail(e,n,i){const r=this.message(e,n,i);throw r.fatal=!0,r}info(e,n,i){const r=this.message(e,n,i);return r.fatal=void 0,r}message(e,n,i){const r=new Br(e,n,i);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function rv(t,e){if(t&&t.includes(co.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+co.sep+"`")}function av(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function M2(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function xH(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const vH=(function(t){const i=this.constructor.prototype,r=i[t],s=function(){return r.apply(s,arguments)};return Object.setPrototypeOf(s,i),s}),_H={}.hasOwnProperty;class _1 extends vH{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=lH()}copy(){const e=new _1;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];e.use(...i)}return e.data(nv(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(ov("data",this.frozen),this.namespace[e]=n,this):_H.call(this.namespace,e)&&this.namespace[e]||void 0:e?(ov("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const r=n.call(e,...i);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=Vy(e),i=this.parser||this.Parser;return sv("parse",i),i(String(n),n)}process(e,n){const i=this;return this.freeze(),sv("process",this.parser||this.Parser),lv("process",this.compiler||this.Compiler),n?r(void 0,n):new Promise(r);function r(s,l){const c=Vy(e),d=i.parse(c);i.run(d,c,function(m,g,b){if(m||!g||!b)return p(m);const v=g,_=i.stringify(v,b);wH(_)?b.value=_:b.result=_,p(m,b)});function p(m,g){m||!g?l(m):s?s(g):n(void 0,g)}}}processSync(e){let n=!1,i;return this.freeze(),sv("processSync",this.parser||this.Parser),lv("processSync",this.compiler||this.Compiler),this.process(e,r),N2("processSync","process",n),i;function r(s,l){n=!0,C2(s),i=l}}run(e,n,i){R2(e),this.freeze();const r=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?s(void 0,i):new Promise(s);function s(l,c){const d=Vy(n);r.run(e,d,p);function p(m,g,b){const v=g||e;m?c(m):l?l(v):i(void 0,v,b)}}}runSync(e,n){let i=!1,r;return this.run(e,n,s),N2("runSync","run",i),r;function s(l,c){C2(l),r=c,i=!0}}stringify(e,n){this.freeze();const i=Vy(n),r=this.compiler||this.Compiler;return lv("stringify",r),R2(e),r(e,i)}use(e,...n){const i=this.attachers,r=this.namespace;if(ov("use",this.frozen),e!=null)if(typeof e=="function")d(e,n);else if(typeof e=="object")Array.isArray(e)?c(e):l(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function s(p){if(typeof p=="function")d(p,[]);else if(typeof p=="object")if(Array.isArray(p)){const[m,...g]=p;d(m,g)}else l(p);else throw new TypeError("Expected usable value, not `"+p+"`")}function l(p){if(!("plugins"in p)&&!("settings"in p))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(p.plugins),p.settings&&(r.settings=nv(!0,r.settings,p.settings))}function c(p){let m=-1;if(p!=null)if(Array.isArray(p))for(;++m<p.length;){const g=p[m];s(g)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function d(p,m){let g=-1,b=-1;for(;++g<i.length;)if(i[g][0]===p){b=g;break}if(b===-1)i.push([p,...m]);else if(m.length>0){let[v,..._]=m;const C=i[b][1];p_(C)&&p_(v)&&(v=nv(!0,C,v)),i[b]=[p,v,..._]}}}}const SH=new _1().freeze();function sv(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function lv(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function ov(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function R2(t){if(!p_(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function N2(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Vy(t){return EH(t)?t:new nR(t)}function EH(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function wH(t){return typeof t=="string"||TH(t)}function TH(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const CH="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",k2=[],O2={allowDangerousHtml:!0},AH=/^(https?|ircs?|mailto|xmpp)$/i,MH=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function RH(t){const e=NH(t),n=kH(t);return OH(e.runSync(e.parse(n),n),t)}function NH(t){const e=t.rehypePlugins||k2,n=t.remarkPlugins||k2,i=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...O2}:O2;return SH().use(uj).use(n).use(rH,i).use(e)}function kH(t){const e=t.children||"",n=new nR;return typeof e=="string"&&(n.value=e),n}function OH(t,e){const n=e.allowedElements,i=e.allowElement,r=e.components,s=e.disallowedElements,l=e.skipHtml,c=e.unwrapDisallowed,d=e.urlTransform||DH;for(const m of MH)Object.hasOwn(e,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+CH+m.id,void 0);return ob(t,p),X8(t,{Fragment:A.Fragment,components:r,ignoreInvalidStyle:!0,jsx:A.jsx,jsxs:A.jsxs,passKeys:!0,passNode:!0});function p(m,g,b){if(m.type==="raw"&&b&&typeof g=="number")return l?b.children.splice(g,1):b.children[g]={type:"text",value:m.value},g;if(m.type==="element"){let v;for(v in Qx)if(Object.hasOwn(Qx,v)&&Object.hasOwn(m.properties,v)){const _=m.properties[v],C=Qx[v];(C===null||C.includes(m.tagName))&&(m.properties[v]=d(String(_||""),v,m))}}if(m.type==="element"){let v=n?!n.includes(m.tagName):s?s.includes(m.tagName):!1;if(!v&&i&&typeof g=="number"&&(v=!i(m,g,b)),v&&b&&typeof g=="number")return c&&m.children?b.children.splice(g,1,...m.children):b.children.splice(g,1),g}}}function DH(t){const e=t.indexOf(":"),n=t.indexOf("?"),i=t.indexOf("#"),r=t.indexOf("/");return e===-1||r!==-1&&e>r||n!==-1&&e>n||i!==-1&&e>i||AH.test(t.slice(0,e))?t:""}function D2(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let i=0,r=n.indexOf(e);for(;r!==-1;)i++,r=n.indexOf(e,r+e.length);return i}function zH(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function BH(t,e,n){const r=Qm((n||{}).ignore||[]),s=LH(e);let l=-1;for(;++l<s.length;)tR(t,"text",c);function c(p,m){let g=-1,b;for(;++g<m.length;){const v=m[g],_=b?b.children:void 0;if(r(v,_?_.indexOf(v):void 0,b))return;b=v}if(b)return d(p,m)}function d(p,m){const g=m[m.length-1],b=s[l][0],v=s[l][1];let _=0;const T=g.children.indexOf(p);let w=!1,k=[];b.lastIndex=0;let R=b.exec(p.value);for(;R;){const O=R.index,j={index:R.index,input:R.input,stack:[...m,p]};let D=v(...R,j);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?b.lastIndex=O+1:(_!==O&&k.push({type:"text",value:p.value.slice(_,O)}),Array.isArray(D)?k.push(...D):D&&k.push(D),_=O+R[0].length,w=!0),!b.global)break;R=b.exec(p.value)}return w?(_<p.value.length&&k.push({type:"text",value:p.value.slice(_)}),g.children.splice(T,1,...k)):k=[p],T+k.length}}function LH(t){const e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!t[0]||Array.isArray(t[0])?t:[t];let i=-1;for(;++i<n.length;){const r=n[i];e.push([UH(r[0]),IH(r[1])])}return e}function UH(t){return typeof t=="string"?new RegExp(zH(t),"g"):t}function IH(t){return typeof t=="function"?t:function(){return t}}const cv="phrasing",uv=["autolink","link","image","label"];function jH(){return{transforms:[VH],enter:{literalAutolink:PH,literalAutolinkEmail:fv,literalAutolinkHttp:fv,literalAutolinkWww:fv},exit:{literalAutolink:YH,literalAutolinkEmail:qH,literalAutolinkHttp:GH,literalAutolinkWww:FH}}}function HH(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:cv,notInConstruct:uv},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:cv,notInConstruct:uv},{character:":",before:"[ps]",after:"\\/",inConstruct:cv,notInConstruct:uv}]}}function PH(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function fv(t){this.config.enter.autolinkProtocol.call(this,t)}function GH(t){this.config.exit.autolinkProtocol.call(this,t)}function FH(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function qH(t){this.config.exit.autolinkEmail.call(this,t)}function YH(t){this.exit(t)}function VH(t){BH(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,XH],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),KH]],{ignore:["link","linkReference"]})}function XH(t,e,n,i,r){let s="";if(!iR(r)||(/^w/i.test(e)&&(n=e+n,e="",s="http://"),!WH(n)))return!1;const l=$H(n+i);if(!l[0])return!1;const c={type:"link",title:null,url:s+e+l[0],children:[{type:"text",value:e+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function KH(t,e,n,i){return!iR(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function WH(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function $H(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],i=n.indexOf(")");const r=D2(t,"(");let s=D2(t,")");for(;i!==-1&&r>s;)t+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),s++;return[t,n]}function iR(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||vf(n)||rb(n))&&(!e||n!==47)}rR.peek=a7;function ZH(){this.buffer()}function QH(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function JH(){this.buffer()}function e7(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function t7(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=bl(this.sliceSerialize(t)).toLowerCase(),n.label=e}function n7(t){this.exit(t)}function i7(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=bl(this.sliceSerialize(t)).toLowerCase(),n.label=e}function r7(t){this.exit(t)}function a7(){return"["}function rR(t,e,n,i){const r=n.createTracker(i);let s=r.move("[^");const l=n.enter("footnoteReference"),c=n.enter("reference");return s+=r.move(n.safe(n.associationId(t),{after:"]",before:s})),c(),l(),s+=r.move("]"),s}function s7(){return{enter:{gfmFootnoteCallString:ZH,gfmFootnoteCall:QH,gfmFootnoteDefinitionLabelString:JH,gfmFootnoteDefinition:e7},exit:{gfmFootnoteCallString:t7,gfmFootnoteCall:n7,gfmFootnoteDefinitionLabelString:i7,gfmFootnoteDefinition:r7}}}function l7(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:rR},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,r,s,l){const c=s.createTracker(l);let d=c.move("[^");const p=s.enter("footnoteDefinition"),m=s.enter("label");return d+=c.move(s.safe(s.associationId(i),{before:d,after:"]"})),m(),d+=c.move("]:"),i.children&&i.children.length>0&&(c.shift(4),d+=c.move((e?`
|
|
358
|
+
`:" ")+s.indentLines(s.containerFlow(i,c.current()),e?aR:o7))),p(),d}}function o7(t,e,n){return e===0?t:aR(t,e,n)}function aR(t,e,n){return(n?"":" ")+t}const c7=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];sR.peek=p7;function u7(){return{canContainEols:["delete"],enter:{strikethrough:d7},exit:{strikethrough:h7}}}function f7(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:c7}],handlers:{delete:sR}}}function d7(t){this.enter({type:"delete",children:[]},t)}function h7(t){this.exit(t)}function sR(t,e,n,i){const r=n.createTracker(i),s=n.enter("strikethrough");let l=r.move("~~");return l+=n.containerPhrasing(t,{...r.current(),before:l,after:"~"}),l+=r.move("~~"),s(),l}function p7(){return"~"}function m7(t){return t.length}function g7(t,e){const n=e||{},i=(n.align||[]).concat(),r=n.stringLength||m7,s=[],l=[],c=[],d=[];let p=0,m=-1;for(;++m<t.length;){const C=[],T=[];let w=-1;for(t[m].length>p&&(p=t[m].length);++w<t[m].length;){const k=y7(t[m][w]);if(n.alignDelimiters!==!1){const R=r(k);T[w]=R,(d[w]===void 0||R>d[w])&&(d[w]=R)}C.push(k)}l[m]=C,c[m]=T}let g=-1;if(typeof i=="object"&&"length"in i)for(;++g<p;)s[g]=z2(i[g]);else{const C=z2(i);for(;++g<p;)s[g]=C}g=-1;const b=[],v=[];for(;++g<p;){const C=s[g];let T="",w="";C===99?(T=":",w=":"):C===108?T=":":C===114&&(w=":");let k=n.alignDelimiters===!1?1:Math.max(1,d[g]-T.length-w.length);const R=T+"-".repeat(k)+w;n.alignDelimiters!==!1&&(k=T.length+k+w.length,k>d[g]&&(d[g]=k),v[g]=k),b[g]=R}l.splice(1,0,b),c.splice(1,0,v),m=-1;const _=[];for(;++m<l.length;){const C=l[m],T=c[m];g=-1;const w=[];for(;++g<p;){const k=C[g]||"";let R="",O="";if(n.alignDelimiters!==!1){const j=d[g]-(T[g]||0),D=s[g];D===114?R=" ".repeat(j):D===99?j%2?(R=" ".repeat(j/2+.5),O=" ".repeat(j/2-.5)):(R=" ".repeat(j/2),O=R):O=" ".repeat(j)}n.delimiterStart!==!1&&!g&&w.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&k==="")&&(n.delimiterStart!==!1||g)&&w.push(" "),n.alignDelimiters!==!1&&w.push(R),w.push(k),n.alignDelimiters!==!1&&w.push(O),n.padding!==!1&&w.push(" "),(n.delimiterEnd!==!1||g!==p-1)&&w.push("|")}_.push(n.delimiterEnd===!1?w.join("").replace(/ +$/,""):w.join(""))}return _.join(`
|
|
359
|
+
`)}function y7(t){return t==null?"":String(t)}function z2(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function b7(t,e,n,i){const r=n.enter("blockquote"),s=n.createTracker(i);s.move("> "),s.shift(2);const l=n.indentLines(n.containerFlow(t,s.current()),x7);return r(),l}function x7(t,e,n){return">"+(n?"":" ")+t}function v7(t,e){return B2(t,e.inConstruct,!0)&&!B2(t,e.notInConstruct,!1)}function B2(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let i=-1;for(;++i<e.length;)if(t.includes(e[i]))return!0;return!1}function L2(t,e,n,i){let r=-1;for(;++r<n.unsafe.length;)if(n.unsafe[r].character===`
|
|
360
|
+
`&&v7(n.stack,n.unsafe[r]))return/[ \t]/.test(i.before)?"":" ";return`\\
|
|
361
|
+
`}function _7(t,e){const n=String(t);let i=n.indexOf(e),r=i,s=0,l=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===r?++s>l&&(l=s):s=1,r=i+e.length,i=n.indexOf(e,r);return l}function S7(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function E7(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function w7(t,e,n,i){const r=E7(n),s=t.value||"",l=r==="`"?"GraveAccent":"Tilde";if(S7(t,n)){const g=n.enter("codeIndented"),b=n.indentLines(s,T7);return g(),b}const c=n.createTracker(i),d=r.repeat(Math.max(_7(s,r)+1,3)),p=n.enter("codeFenced");let m=c.move(d);if(t.lang){const g=n.enter(`codeFencedLang${l}`);m+=c.move(n.safe(t.lang,{before:m,after:" ",encode:["`"],...c.current()})),g()}if(t.lang&&t.meta){const g=n.enter(`codeFencedMeta${l}`);m+=c.move(" "),m+=c.move(n.safe(t.meta,{before:m,after:`
|
|
362
|
+
`,encode:["`"],...c.current()})),g()}return m+=c.move(`
|
|
363
|
+
`),s&&(m+=c.move(s+`
|
|
364
|
+
`)),m+=c.move(d),p(),m}function T7(t,e,n){return(n?"":" ")+t}function S1(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function C7(t,e,n,i){const r=S1(n),s=r==='"'?"Quote":"Apostrophe",l=n.enter("definition");let c=n.enter("label");const d=n.createTracker(i);let p=d.move("[");return p+=d.move(n.safe(n.associationId(t),{before:p,after:"]",...d.current()})),p+=d.move("]: "),c(),!t.url||/[\0- \u007F]/.test(t.url)?(c=n.enter("destinationLiteral"),p+=d.move("<"),p+=d.move(n.safe(t.url,{before:p,after:">",...d.current()})),p+=d.move(">")):(c=n.enter("destinationRaw"),p+=d.move(n.safe(t.url,{before:p,after:t.title?" ":`
|
|
365
|
+
`,...d.current()}))),c(),t.title&&(c=n.enter(`title${s}`),p+=d.move(" "+r),p+=d.move(n.safe(t.title,{before:p,after:r,...d.current()})),p+=d.move(r),c()),l(),p}function A7(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function Bm(t){return"&#x"+t.toString(16).toUpperCase()+";"}function D0(t,e,n){const i=ch(t),r=ch(e);return i===void 0?r===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}lR.peek=M7;function lR(t,e,n,i){const r=A7(n),s=n.enter("emphasis"),l=n.createTracker(i),c=l.move(r);let d=l.move(n.containerPhrasing(t,{after:r,before:c,...l.current()}));const p=d.charCodeAt(0),m=D0(i.before.charCodeAt(i.before.length-1),p,r);m.inside&&(d=Bm(p)+d.slice(1));const g=d.charCodeAt(d.length-1),b=D0(i.after.charCodeAt(0),g,r);b.inside&&(d=d.slice(0,-1)+Bm(g));const v=l.move(r);return s(),n.attentionEncodeSurroundingInfo={after:b.outside,before:m.outside},c+d+v}function M7(t,e,n){return n.options.emphasis||"*"}function R7(t,e){let n=!1;return ob(t,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,d_}),!!((!t.depth||t.depth<3)&&p1(t)&&(e.options.setext||n))}function N7(t,e,n,i){const r=Math.max(Math.min(6,t.depth||1),1),s=n.createTracker(i);if(R7(t,n)){const m=n.enter("headingSetext"),g=n.enter("phrasing"),b=n.containerPhrasing(t,{...s.current(),before:`
|
|
366
|
+
`,after:`
|
|
367
|
+
`});return g(),m(),b+`
|
|
368
|
+
`+(r===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
|
|
369
|
+
`))+1))}const l="#".repeat(r),c=n.enter("headingAtx"),d=n.enter("phrasing");s.move(l+" ");let p=n.containerPhrasing(t,{before:"# ",after:`
|
|
370
|
+
`,...s.current()});return/^[\t ]/.test(p)&&(p=Bm(p.charCodeAt(0))+p.slice(1)),p=p?l+" "+p:l,n.options.closeAtx&&(p+=" "+l),d(),c(),p}oR.peek=k7;function oR(t){return t.value||""}function k7(){return"<"}cR.peek=O7;function cR(t,e,n,i){const r=S1(n),s=r==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=n.enter("label");const d=n.createTracker(i);let p=d.move("![");return p+=d.move(n.safe(t.alt,{before:p,after:"]",...d.current()})),p+=d.move("]("),c(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(c=n.enter("destinationLiteral"),p+=d.move("<"),p+=d.move(n.safe(t.url,{before:p,after:">",...d.current()})),p+=d.move(">")):(c=n.enter("destinationRaw"),p+=d.move(n.safe(t.url,{before:p,after:t.title?" ":")",...d.current()}))),c(),t.title&&(c=n.enter(`title${s}`),p+=d.move(" "+r),p+=d.move(n.safe(t.title,{before:p,after:r,...d.current()})),p+=d.move(r),c()),p+=d.move(")"),l(),p}function O7(){return"!"}uR.peek=D7;function uR(t,e,n,i){const r=t.referenceType,s=n.enter("imageReference");let l=n.enter("label");const c=n.createTracker(i);let d=c.move("![");const p=n.safe(t.alt,{before:d,after:"]",...c.current()});d+=c.move(p+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const g=n.safe(n.associationId(t),{before:d,after:"]",...c.current()});return l(),n.stack=m,s(),r==="full"||!p||p!==g?d+=c.move(g+"]"):r==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function D7(){return"!"}fR.peek=z7;function fR(t,e,n){let i=t.value||"",r="`",s=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(i);)r+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++s<n.unsafe.length;){const l=n.unsafe[s],c=n.compilePattern(l);let d;if(l.atBreak)for(;d=c.exec(i);){let p=d.index;i.charCodeAt(p)===10&&i.charCodeAt(p-1)===13&&p--,i=i.slice(0,p)+" "+i.slice(d.index+1)}}return r+i+r}function z7(){return"`"}function dR(t,e){const n=p1(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}hR.peek=B7;function hR(t,e,n,i){const r=S1(n),s=r==='"'?"Quote":"Apostrophe",l=n.createTracker(i);let c,d;if(dR(t,n)){const m=n.stack;n.stack=[],c=n.enter("autolink");let g=l.move("<");return g+=l.move(n.containerPhrasing(t,{before:g,after:">",...l.current()})),g+=l.move(">"),c(),n.stack=m,g}c=n.enter("link"),d=n.enter("label");let p=l.move("[");return p+=l.move(n.containerPhrasing(t,{before:p,after:"](",...l.current()})),p+=l.move("]("),d(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(d=n.enter("destinationLiteral"),p+=l.move("<"),p+=l.move(n.safe(t.url,{before:p,after:">",...l.current()})),p+=l.move(">")):(d=n.enter("destinationRaw"),p+=l.move(n.safe(t.url,{before:p,after:t.title?" ":")",...l.current()}))),d(),t.title&&(d=n.enter(`title${s}`),p+=l.move(" "+r),p+=l.move(n.safe(t.title,{before:p,after:r,...l.current()})),p+=l.move(r),d()),p+=l.move(")"),c(),p}function B7(t,e,n){return dR(t,n)?"<":"["}pR.peek=L7;function pR(t,e,n,i){const r=t.referenceType,s=n.enter("linkReference");let l=n.enter("label");const c=n.createTracker(i);let d=c.move("[");const p=n.containerPhrasing(t,{before:d,after:"]",...c.current()});d+=c.move(p+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const g=n.safe(n.associationId(t),{before:d,after:"]",...c.current()});return l(),n.stack=m,s(),r==="full"||!p||p!==g?d+=c.move(g+"]"):r==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function L7(){return"["}function E1(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function U7(t){const e=E1(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function I7(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function mR(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function j7(t,e,n,i){const r=n.enter("list"),s=n.bulletCurrent;let l=t.ordered?I7(n):E1(n);const c=t.ordered?l==="."?")":".":U7(n);let d=e&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!t.ordered){const m=t.children?t.children[0]:void 0;if((l==="*"||l==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(d=!0),mR(n)===l&&m){let g=-1;for(;++g<t.children.length;){const b=t.children[g];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(l=c),n.bulletCurrent=l;const p=n.containerFlow(t,i);return n.bulletLastUsed=l,n.bulletCurrent=s,r(),p}function H7(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function P7(t,e,n,i){const r=H7(n);let s=n.bulletCurrent||E1(n);e&&e.type==="list"&&e.ordered&&(s=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+s);let l=s.length+1;(r==="tab"||r==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(l=Math.ceil(l/4)*4);const c=n.createTracker(i);c.move(s+" ".repeat(l-s.length)),c.shift(l);const d=n.enter("listItem"),p=n.indentLines(n.containerFlow(t,c.current()),m);return d(),p;function m(g,b,v){return b?(v?"":" ".repeat(l))+g:(v?s:s+" ".repeat(l-s.length))+g}}function G7(t,e,n,i){const r=n.enter("paragraph"),s=n.enter("phrasing"),l=n.containerPhrasing(t,i);return s(),r(),l}const F7=Qm(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function q7(t,e,n,i){return(t.children.some(function(l){return F7(l)})?n.containerPhrasing:n.containerFlow).call(n,t,i)}function Y7(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}gR.peek=V7;function gR(t,e,n,i){const r=Y7(n),s=n.enter("strong"),l=n.createTracker(i),c=l.move(r+r);let d=l.move(n.containerPhrasing(t,{after:r,before:c,...l.current()}));const p=d.charCodeAt(0),m=D0(i.before.charCodeAt(i.before.length-1),p,r);m.inside&&(d=Bm(p)+d.slice(1));const g=d.charCodeAt(d.length-1),b=D0(i.after.charCodeAt(0),g,r);b.inside&&(d=d.slice(0,-1)+Bm(g));const v=l.move(r+r);return s(),n.attentionEncodeSurroundingInfo={after:b.outside,before:m.outside},c+d+v}function V7(t,e,n){return n.options.strong||"*"}function X7(t,e,n,i){return n.safe(t.value,i)}function K7(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function W7(t,e,n){const i=(mR(n)+(n.options.ruleSpaces?" ":"")).repeat(K7(n));return n.options.ruleSpaces?i.slice(0,-1):i}const yR={blockquote:b7,break:L2,code:w7,definition:C7,emphasis:lR,hardBreak:L2,heading:N7,html:oR,image:cR,imageReference:uR,inlineCode:fR,link:hR,linkReference:pR,list:j7,listItem:P7,paragraph:G7,root:q7,strong:gR,text:X7,thematicBreak:W7};function $7(){return{enter:{table:Z7,tableData:U2,tableHeader:U2,tableRow:J7},exit:{codeText:e9,table:Q7,tableData:dv,tableHeader:dv,tableRow:dv}}}function Z7(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function Q7(t){this.exit(t),this.data.inTable=void 0}function J7(t){this.enter({type:"tableRow",children:[]},t)}function dv(t){this.exit(t)}function U2(t){this.enter({type:"tableCell",children:[]},t)}function e9(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,t9));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function t9(t,e){return e==="|"?e:t}function n9(t){const e=t||{},n=e.tableCellPadding,i=e.tablePipeAlign,r=e.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
371
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:l,tableCell:d,tableRow:c}};function l(v,_,C,T){return p(m(v,C,T),v.align)}function c(v,_,C,T){const w=g(v,C,T),k=p([w]);return k.slice(0,k.indexOf(`
|
|
372
|
+
`))}function d(v,_,C,T){const w=C.enter("tableCell"),k=C.enter("phrasing"),R=C.containerPhrasing(v,{...T,before:s,after:s});return k(),w(),R}function p(v,_){return g7(v,{align:_,alignDelimiters:i,padding:n,stringLength:r})}function m(v,_,C){const T=v.children;let w=-1;const k=[],R=_.enter("table");for(;++w<T.length;)k[w]=g(T[w],_,C);return R(),k}function g(v,_,C){const T=v.children;let w=-1;const k=[],R=_.enter("tableRow");for(;++w<T.length;)k[w]=d(T[w],v,_,C);return R(),k}function b(v,_,C){let T=yR.inlineCode(v,_,C);return C.stack.includes("tableCell")&&(T=T.replace(/\|/g,"\\$&")),T}}function i9(){return{exit:{taskListCheckValueChecked:I2,taskListCheckValueUnchecked:I2,paragraph:a9}}}function r9(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:s9}}}function I2(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function a9(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const i=n.children[0];if(i&&i.type==="text"){const r=e.children;let s=-1,l;for(;++s<r.length;){const c=r[s];if(c.type==="paragraph"){l=c;break}}l===n&&(i.value=i.value.slice(1),i.value.length===0?n.children.shift():n.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,n.position.start=Object.assign({},i.position.start)))}}this.exit(t)}function s9(t,e,n,i){const r=t.children[0],s=typeof t.checked=="boolean"&&r&&r.type==="paragraph",l="["+(t.checked?"x":" ")+"] ",c=n.createTracker(i);s&&c.move(l);let d=yR.listItem(t,e,n,{...i,...c.current()});return s&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,p)),d;function p(m){return m+l}}function l9(){return[jH(),s7(),u7(),$7(),i9()]}function o9(t){return{extensions:[HH(),l7(t),f7(),n9(t),r9()]}}const c9={tokenize:m9,partial:!0},bR={tokenize:g9,partial:!0},xR={tokenize:y9,partial:!0},vR={tokenize:b9,partial:!0},u9={tokenize:x9,partial:!0},_R={name:"wwwAutolink",tokenize:h9,previous:ER},SR={name:"protocolAutolink",tokenize:p9,previous:wR},oc={name:"emailAutolink",tokenize:d9,previous:TR},go={};function f9(){return{text:go}}let af=48;for(;af<123;)go[af]=oc,af++,af===58?af=65:af===91&&(af=97);go[43]=oc;go[45]=oc;go[46]=oc;go[95]=oc;go[72]=[oc,SR];go[104]=[oc,SR];go[87]=[oc,_R];go[119]=[oc,_R];function d9(t,e,n){const i=this;let r,s;return l;function l(g){return!g_(g)||!TR.call(i,i.previous)||w1(i.events)?n(g):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),c(g))}function c(g){return g_(g)?(t.consume(g),c):g===64?(t.consume(g),d):n(g)}function d(g){return g===46?t.check(u9,m,p)(g):g===45||g===95||zr(g)?(s=!0,t.consume(g),d):m(g)}function p(g){return t.consume(g),r=!0,d}function m(g){return s&&r&&la(i.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(g)):n(g)}}function h9(t,e,n){const i=this;return r;function r(l){return l!==87&&l!==119||!ER.call(i,i.previous)||w1(i.events)?n(l):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(c9,t.attempt(bR,t.attempt(xR,s),n),n)(l))}function s(l){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(l)}}function p9(t,e,n){const i=this;let r="",s=!1;return l;function l(g){return(g===72||g===104)&&wR.call(i,i.previous)&&!w1(i.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),r+=String.fromCodePoint(g),t.consume(g),c):n(g)}function c(g){if(la(g)&&r.length<5)return r+=String.fromCodePoint(g),t.consume(g),c;if(g===58){const b=r.toLowerCase();if(b==="http"||b==="https")return t.consume(g),d}return n(g)}function d(g){return g===47?(t.consume(g),s?p:(s=!0,d)):n(g)}function p(g){return g===null||N0(g)||Dn(g)||vf(g)||rb(g)?n(g):t.attempt(bR,t.attempt(xR,m),n)(g)}function m(g){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(g)}}function m9(t,e,n){let i=0;return r;function r(l){return(l===87||l===119)&&i<3?(i++,t.consume(l),r):l===46&&i===3?(t.consume(l),s):n(l)}function s(l){return l===null?n(l):e(l)}}function g9(t,e,n){let i,r,s;return l;function l(p){return p===46||p===95?t.check(vR,d,c)(p):p===null||Dn(p)||vf(p)||p!==45&&rb(p)?d(p):(s=!0,t.consume(p),l)}function c(p){return p===95?i=!0:(r=i,i=void 0),t.consume(p),l}function d(p){return r||i||!s?n(p):e(p)}}function y9(t,e){let n=0,i=0;return r;function r(l){return l===40?(n++,t.consume(l),r):l===41&&i<n?s(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?t.check(vR,e,s)(l):l===null||Dn(l)||vf(l)?e(l):(t.consume(l),r)}function s(l){return l===41&&i++,t.consume(l),r}}function b9(t,e,n){return i;function i(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(t.consume(c),i):c===38?(t.consume(c),s):c===93?(t.consume(c),r):c===60||c===null||Dn(c)||vf(c)?e(c):n(c)}function r(c){return c===null||c===40||c===91||Dn(c)||vf(c)?e(c):i(c)}function s(c){return la(c)?l(c):n(c)}function l(c){return c===59?(t.consume(c),i):la(c)?(t.consume(c),l):n(c)}}function x9(t,e,n){return i;function i(s){return t.consume(s),r}function r(s){return zr(s)?n(s):e(s)}}function ER(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Dn(t)}function wR(t){return!la(t)}function TR(t){return!(t===47||g_(t))}function g_(t){return t===43||t===45||t===46||t===95||zr(t)}function w1(t){let e=t.length,n=!1;for(;e--;){const i=t[e][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const v9={tokenize:M9,partial:!0};function _9(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:T9,continuation:{tokenize:C9},exit:A9}},text:{91:{name:"gfmFootnoteCall",tokenize:w9},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:S9,resolveTo:E9}}}}function S9(t,e,n){const i=this;let r=i.events.length;const s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l;for(;r--;){const d=i.events[r][1];if(d.type==="labelImage"){l=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return c;function c(d){if(!l||!l._balanced)return n(d);const p=bl(i.sliceSerialize({start:l.end,end:i.now()}));return p.codePointAt(0)!==94||!s.includes(p.slice(1))?n(d):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),e(d))}}function E9(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},t[t.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},c=[t[n+1],t[n+2],["enter",i,e],t[n+3],t[n+4],["enter",r,e],["exit",r,e],["enter",s,e],["enter",l,e],["exit",l,e],["exit",s,e],t[t.length-2],t[t.length-1],["exit",i,e]];return t.splice(n,t.length-n+1,...c),t}function w9(t,e,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s=0,l;return c;function c(g){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(g),t.exit("gfmFootnoteCallLabelMarker"),d}function d(g){return g!==94?n(g):(t.enter("gfmFootnoteCallMarker"),t.consume(g),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",p)}function p(g){if(s>999||g===93&&!l||g===null||g===91||Dn(g))return n(g);if(g===93){t.exit("chunkString");const b=t.exit("gfmFootnoteCallString");return r.includes(bl(i.sliceSerialize(b)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(g),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(g)}return Dn(g)||(l=!0),s++,t.consume(g),g===92?m:p}function m(g){return g===91||g===92||g===93?(t.consume(g),s++,p):p(g)}}function T9(t,e,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s,l=0,c;return d;function d(_){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(_),t.exit("gfmFootnoteDefinitionLabelMarker"),p}function p(_){return _===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(_),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",m):n(_)}function m(_){if(l>999||_===93&&!c||_===null||_===91||Dn(_))return n(_);if(_===93){t.exit("chunkString");const C=t.exit("gfmFootnoteDefinitionLabelString");return s=bl(i.sliceSerialize(C)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(_),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),b}return Dn(_)||(c=!0),l++,t.consume(_),_===92?g:m}function g(_){return _===91||_===92||_===93?(t.consume(_),l++,m):m(_)}function b(_){return _===58?(t.enter("definitionMarker"),t.consume(_),t.exit("definitionMarker"),r.includes(s)||r.push(s),Kt(t,v,"gfmFootnoteDefinitionWhitespace")):n(_)}function v(_){return e(_)}}function C9(t,e,n){return t.check(Zm,e,t.attempt(v9,e,n))}function A9(t){t.exit("gfmFootnoteDefinition")}function M9(t,e,n){const i=this;return Kt(t,r,"gfmFootnoteDefinitionIndent",5);function r(s){const l=i.events[i.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?e(s):n(s)}}function R9(t){let n=(t||{}).singleTilde;const i={name:"strikethrough",tokenize:s,resolveAll:r};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function r(l,c){let d=-1;for(;++d<l.length;)if(l[d][0]==="enter"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._close){let p=d;for(;p--;)if(l[p][0]==="exit"&&l[p][1].type==="strikethroughSequenceTemporary"&&l[p][1]._open&&l[d][1].end.offset-l[d][1].start.offset===l[p][1].end.offset-l[p][1].start.offset){l[d][1].type="strikethroughSequence",l[p][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},l[p][1].start),end:Object.assign({},l[d][1].end)},g={type:"strikethroughText",start:Object.assign({},l[p][1].end),end:Object.assign({},l[d][1].start)},b=[["enter",m,c],["enter",l[p][1],c],["exit",l[p][1],c],["enter",g,c]],v=c.parser.constructs.insideSpan.null;v&&ns(b,b.length,0,ab(v,l.slice(p+1,d),c)),ns(b,b.length,0,[["exit",g,c],["enter",l[d][1],c],["exit",l[d][1],c],["exit",m,c]]),ns(l,p-1,d-p+3,b),d=p+b.length-2;break}}for(d=-1;++d<l.length;)l[d][1].type==="strikethroughSequenceTemporary"&&(l[d][1].type="data");return l}function s(l,c,d){const p=this.previous,m=this.events;let g=0;return b;function b(_){return p===126&&m[m.length-1][1].type!=="characterEscape"?d(_):(l.enter("strikethroughSequenceTemporary"),v(_))}function v(_){const C=ch(p);if(_===126)return g>1?d(_):(l.consume(_),g++,v);if(g<2&&!n)return d(_);const T=l.exit("strikethroughSequenceTemporary"),w=ch(_);return T._open=!w||w===2&&!!C,T._close=!C||C===2&&!!w,c(_)}}}class N9{constructor(){this.map=[]}add(e,n,i){k9(this,e,n,i)}consume(e){if(this.map.sort(function(s,l){return s[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];i.push(e.slice()),e.length=0;let r=i.pop();for(;r;){for(const s of r)e.push(s);r=i.pop()}this.map.length=0}}function k9(t,e,n,i){let r=0;if(!(n===0&&i.length===0)){for(;r<t.map.length;){if(t.map[r][0]===e){t.map[r][1]+=n,t.map[r][2].push(...i);return}r+=1}t.map.push([e,n,i])}}function O9(t,e){let n=!1;const i=[];for(;e<t.length;){const r=t[e];if(n){if(r[0]==="enter")r[1].type==="tableContent"&&i.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(r[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const s=i.length-1;i[s]=i[s]==="left"?"center":"right"}}else if(r[1].type==="tableDelimiterRow")break}else r[0]==="enter"&&r[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return i}function D9(){return{flow:{null:{name:"table",tokenize:z9,resolveAll:B9}}}}function z9(t,e,n){const i=this;let r=0,s=0,l;return c;function c(I){let K=i.events.length-1;for(;K>-1;){const H=i.events[K][1].type;if(H==="lineEnding"||H==="linePrefix")K--;else break}const G=K>-1?i.events[K][1].type:null,te=G==="tableHead"||G==="tableRow"?D:d;return te===D&&i.parser.lazy[i.now().line]?n(I):te(I)}function d(I){return t.enter("tableHead"),t.enter("tableRow"),p(I)}function p(I){return I===124||(l=!0,s+=1),m(I)}function m(I){return I===null?n(I):st(I)?s>1?(s=0,i.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(I),t.exit("lineEnding"),v):n(I):Lt(I)?Kt(t,m,"whitespace")(I):(s+=1,l&&(l=!1,r+=1),I===124?(t.enter("tableCellDivider"),t.consume(I),t.exit("tableCellDivider"),l=!0,m):(t.enter("data"),g(I)))}function g(I){return I===null||I===124||Dn(I)?(t.exit("data"),m(I)):(t.consume(I),I===92?b:g)}function b(I){return I===92||I===124?(t.consume(I),g):g(I)}function v(I){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(I):(t.enter("tableDelimiterRow"),l=!1,Lt(I)?Kt(t,_,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):_(I))}function _(I){return I===45||I===58?T(I):I===124?(l=!0,t.enter("tableCellDivider"),t.consume(I),t.exit("tableCellDivider"),C):j(I)}function C(I){return Lt(I)?Kt(t,T,"whitespace")(I):T(I)}function T(I){return I===58?(s+=1,l=!0,t.enter("tableDelimiterMarker"),t.consume(I),t.exit("tableDelimiterMarker"),w):I===45?(s+=1,w(I)):I===null||st(I)?O(I):j(I)}function w(I){return I===45?(t.enter("tableDelimiterFiller"),k(I)):j(I)}function k(I){return I===45?(t.consume(I),k):I===58?(l=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(I),t.exit("tableDelimiterMarker"),R):(t.exit("tableDelimiterFiller"),R(I))}function R(I){return Lt(I)?Kt(t,O,"whitespace")(I):O(I)}function O(I){return I===124?_(I):I===null||st(I)?!l||r!==s?j(I):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(I)):j(I)}function j(I){return n(I)}function D(I){return t.enter("tableRow"),F(I)}function F(I){return I===124?(t.enter("tableCellDivider"),t.consume(I),t.exit("tableCellDivider"),F):I===null||st(I)?(t.exit("tableRow"),e(I)):Lt(I)?Kt(t,F,"whitespace")(I):(t.enter("data"),$(I))}function $(I){return I===null||I===124||Dn(I)?(t.exit("data"),F(I)):(t.consume(I),I===92?P:$)}function P(I){return I===92||I===124?(t.consume(I),$):$(I)}}function B9(t,e){let n=-1,i=!0,r=0,s=[0,0,0,0],l=[0,0,0,0],c=!1,d=0,p,m,g;const b=new N9;for(;++n<t.length;){const v=t[n],_=v[1];v[0]==="enter"?_.type==="tableHead"?(c=!1,d!==0&&(j2(b,e,d,p,m),m=void 0,d=0),p={type:"table",start:Object.assign({},_.start),end:Object.assign({},_.end)},b.add(n,0,[["enter",p,e]])):_.type==="tableRow"||_.type==="tableDelimiterRow"?(i=!0,g=void 0,s=[0,0,0,0],l=[0,n+1,0,0],c&&(c=!1,m={type:"tableBody",start:Object.assign({},_.start),end:Object.assign({},_.end)},b.add(n,0,[["enter",m,e]])),r=_.type==="tableDelimiterRow"?2:m?3:1):r&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")?(i=!1,l[2]===0&&(s[1]!==0&&(l[0]=l[1],g=Xy(b,e,s,r,void 0,g),s=[0,0,0,0]),l[2]=n)):_.type==="tableCellDivider"&&(i?i=!1:(s[1]!==0&&(l[0]=l[1],g=Xy(b,e,s,r,void 0,g)),s=l,l=[s[1],n,0,0])):_.type==="tableHead"?(c=!0,d=n):_.type==="tableRow"||_.type==="tableDelimiterRow"?(d=n,s[1]!==0?(l[0]=l[1],g=Xy(b,e,s,r,n,g)):l[1]!==0&&(g=Xy(b,e,l,r,n,g)),r=0):r&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")&&(l[3]=n)}for(d!==0&&j2(b,e,d,p,m),b.consume(e.events),n=-1;++n<e.events.length;){const v=e.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=O9(e.events,n))}return t}function Xy(t,e,n,i,r,s){const l=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(s.end=Object.assign({},Gd(e.events,n[0])),t.add(n[0],0,[["exit",s,e]]));const d=Gd(e.events,n[1]);if(s={type:l,start:Object.assign({},d),end:Object.assign({},d)},t.add(n[1],0,[["enter",s,e]]),n[2]!==0){const p=Gd(e.events,n[2]),m=Gd(e.events,n[3]),g={type:c,start:Object.assign({},p),end:Object.assign({},m)};if(t.add(n[2],0,[["enter",g,e]]),i!==2){const b=e.events[n[2]],v=e.events[n[3]];if(b[1].end=Object.assign({},v[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const _=n[2]+1,C=n[3]-n[2]-1;t.add(_,C,[])}}t.add(n[3]+1,0,[["exit",g,e]])}return r!==void 0&&(s.end=Object.assign({},Gd(e.events,r)),t.add(r,0,[["exit",s,e]]),s=void 0),s}function j2(t,e,n,i,r){const s=[],l=Gd(e.events,n);r&&(r.end=Object.assign({},l),s.push(["exit",r,e])),i.end=Object.assign({},l),s.push(["exit",i,e]),t.add(n+1,0,s)}function Gd(t,e){const n=t[e],i=n[0]==="enter"?"start":"end";return n[1][i]}const L9={name:"tasklistCheck",tokenize:I9};function U9(){return{text:{91:L9}}}function I9(t,e,n){const i=this;return r;function r(d){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(d):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(d),t.exit("taskListCheckMarker"),s)}function s(d){return Dn(d)?(t.enter("taskListCheckValueUnchecked"),t.consume(d),t.exit("taskListCheckValueUnchecked"),l):d===88||d===120?(t.enter("taskListCheckValueChecked"),t.consume(d),t.exit("taskListCheckValueChecked"),l):n(d)}function l(d){return d===93?(t.enter("taskListCheckMarker"),t.consume(d),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),c):n(d)}function c(d){return st(d)?e(d):Lt(d)?t.check({tokenize:j9},e,n)(d):n(d)}}function j9(t,e,n){return Kt(t,i,"whitespace");function i(r){return r===null?n(r):e(r)}}function H9(t){return LM([f9(),_9(),R9(t),D9(),U9()])}const P9={};function G9(t){const e=this,n=t||P9,i=e.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),s=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),l=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(H9(n)),s.push(l9()),l.push(o9(n))}const H2=(function(t,e,n){const i=Qm(n);if(!t||!t.type||!t.children)throw new Error("Expected parent node");if(typeof e=="number"){if(e<0||e===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(e=t.children.indexOf(e),e<0)throw new Error("Expected child node or index");for(;++e<t.children.length;)if(i(t.children[e],e,t))return t.children[e]}),Mf=(function(t){if(t==null)return Y9;if(typeof t=="string")return q9(t);if(typeof t=="object")return F9(t);if(typeof t=="function")return T1(t);throw new Error("Expected function, string, or array as `test`")});function F9(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=Mf(t[n]);return T1(i);function i(...r){let s=-1;for(;++s<e.length;)if(e[s].apply(this,r))return!0;return!1}}function q9(t){return T1(e);function e(n){return n.tagName===t}}function T1(t){return e;function e(n,i,r){return!!(V9(n)&&t.call(this,n,typeof i=="number"?i:void 0,r||void 0))}}function Y9(t){return!!(t&&typeof t=="object"&&"type"in t&&t.type==="element"&&"tagName"in t&&typeof t.tagName=="string")}function V9(t){return t!==null&&typeof t=="object"&&"type"in t&&"tagName"in t}const P2=/\n/g,G2=/[\t ]+/g,y_=Mf("br"),F2=Mf(eP),X9=Mf("p"),q2=Mf("tr"),K9=Mf(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",J9,tP]),CR=Mf(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function W9(t,e){const n=e||{},i="children"in t?t.children:[],r=CR(t),s=RR(t,{whitespace:n.whitespace||"normal"}),l=[];(t.type==="text"||t.type==="comment")&&l.push(...MR(t,{breakBefore:!0,breakAfter:!0}));let c=-1;for(;++c<i.length;)l.push(...AR(i[c],t,{whitespace:s,breakBefore:c?void 0:r,breakAfter:c<i.length-1?y_(i[c+1]):r}));const d=[];let p;for(c=-1;++c<l.length;){const m=l[c];typeof m=="number"?p!==void 0&&m>p&&(p=m):m&&(p!==void 0&&p>-1&&d.push(`
|
|
373
|
+
`.repeat(p)||" "),p=-1,d.push(m))}return d.join("")}function AR(t,e,n){return t.type==="element"?$9(t,e,n):t.type==="text"?n.whitespace==="normal"?MR(t,n):Z9(t):[]}function $9(t,e,n){const i=RR(t,n),r=t.children||[];let s=-1,l=[];if(K9(t))return l;let c,d;for(y_(t)||q2(t)&&H2(e,t,q2)?d=`
|
|
374
|
+
`:X9(t)?(c=2,d=2):CR(t)&&(c=1,d=1);++s<r.length;)l=l.concat(AR(r[s],t,{whitespace:i,breakBefore:s?void 0:c,breakAfter:s<r.length-1?y_(r[s+1]):d}));return F2(t)&&H2(e,t,F2)&&l.push(" "),c&&l.unshift(c),d&&l.push(d),l}function MR(t,e){const n=String(t.value),i=[],r=[];let s=0;for(;s<=n.length;){P2.lastIndex=s;const d=P2.exec(n),p=d&&"index"in d?d.index:n.length;i.push(Q9(n.slice(s,p).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),s===0?e.breakBefore:!0,p===n.length?e.breakAfter:!0)),s=p+1}let l=-1,c;for(;++l<i.length;)i[l].charCodeAt(i[l].length-1)===8203||l<i.length-1&&i[l+1].charCodeAt(0)===8203?(r.push(i[l]),c=void 0):i[l]?(typeof c=="number"&&r.push(c),r.push(i[l]),c=0):(l===0||l===i.length-1)&&r.push(0);return r}function Z9(t){return[String(t.value)]}function Q9(t,e,n){const i=[];let r=0,s;for(;r<t.length;){G2.lastIndex=r;const l=G2.exec(t);s=l?l.index:t.length,!r&&!s&&l&&!e&&i.push(""),r!==s&&i.push(t.slice(r,s)),r=l?s+l[0].length:s}return r!==s&&!n&&i.push(""),i.join(" ")}function RR(t,e){if(t.type==="element"){const n=t.properties||{};switch(t.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":e.whitespace;case"textarea":return"pre-wrap"}}return e.whitespace}function J9(t){return!!(t.properties||{}).hidden}function eP(t){return t.tagName==="td"||t.tagName==="th"}function tP(t){return t.tagName==="dialog"&&!(t.properties||{}).open}function nP(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",l="(?!struct)("+i+"|"+e.optional(r)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",c={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},p={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},m={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},g={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(p,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},b={className:"title",begin:e.optional(r)+t.IDENT_RE,relevance:0},v=e.optional(r)+t.IDENT_RE+"\\s*\\(",_=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],C=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],T=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],w=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],O={type:C,keyword:_,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:T},j={className:"function.dispatch",relevance:0,keywords:{_hint:w},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},D=[j,g,c,n,t.C_BLOCK_COMMENT_MODE,m,p],F={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:D.concat([{begin:/\(/,end:/\)/,keywords:O,contains:D.concat(["self"]),relevance:0}]),relevance:0},$={className:"function",begin:"("+l+"[\\*&\\s]+)+"+v,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:O,relevance:0},{begin:v,returnBegin:!0,contains:[b],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[p,m]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,p,m,c,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,p,m,c]}]},c,n,t.C_BLOCK_COMMENT_MODE,g]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:O,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(F,$,j,D,[g,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:O,contains:["self",c]},{begin:t.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function iP(t){const e={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=nP(t),i=n.keywords;return i.type=[...i.type,...e.type],i.literal=[...i.literal,...e.literal],i.built_in=[...i.built_in,...e.built_in],i._hints=e._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function rP(t){const e=t.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},s=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),l={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},c={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,r]};r.contains.push(c);const d={match:/\\"/},p={className:"string",begin:/'/,end:/'/},m={match:/\\'/},g={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},b=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],v=t.SHEBANG({binary:`(${b.join("|")})`,relevance:10}),_={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},C=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],T=["true","false"],w={match:/(\/[a-z._-]+)+/},k=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],R=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],O=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],j=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:C,literal:T,built_in:[...k,...R,"set","shopt",...O,...j]},contains:[v,t.SHEBANG(),_,g,s,l,w,c,d,p,m,n]}}function aP(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",l="("+i+"|"+e.optional(r)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",c={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},p={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},m={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},g={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(p,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},b={className:"title",begin:e.optional(r)+t.IDENT_RE,relevance:0},v=e.optional(r)+t.IDENT_RE+"\\s*\\(",T={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},w=[g,c,n,t.C_BLOCK_COMMENT_MODE,m,p],k={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:T,contains:w.concat([{begin:/\(/,end:/\)/,keywords:T,contains:w.concat(["self"]),relevance:0}]),relevance:0},R={begin:"("+l+"[\\*&\\s]+)+"+v,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:T,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:T,relevance:0},{begin:v,returnBegin:!0,contains:[t.inherit(b,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,p,m,c,{begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,p,m,c]}]},c,n,t.C_BLOCK_COMMENT_MODE,g]};return{name:"C",aliases:["h"],keywords:T,disableAutodetect:!0,illegal:"</",contains:[].concat(k,R,w,[g,{begin:t.IDENT_RE+"::",keywords:T},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:g,strings:p,keywords:T}}}function sP(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",l="(?!struct)("+i+"|"+e.optional(r)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",c={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},p={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},m={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},g={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(p,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},b={className:"title",begin:e.optional(r)+t.IDENT_RE,relevance:0},v=e.optional(r)+t.IDENT_RE+"\\s*\\(",_=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],C=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],T=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],w=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],O={type:C,keyword:_,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:T},j={className:"function.dispatch",relevance:0,keywords:{_hint:w},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},D=[j,g,c,n,t.C_BLOCK_COMMENT_MODE,m,p],F={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:D.concat([{begin:/\(/,end:/\)/,keywords:O,contains:D.concat(["self"]),relevance:0}]),relevance:0},$={className:"function",begin:"("+l+"[\\*&\\s]+)+"+v,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:O,relevance:0},{begin:v,returnBegin:!0,contains:[b],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[p,m]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,p,m,c,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,p,m,c]}]},c,n,t.C_BLOCK_COMMENT_MODE,g]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:O,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(F,$,j,D,[g,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:O,contains:["self",c]},{begin:t.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function lP(t){const e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],i=["default","false","null","true"],r=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],s=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],l={keyword:r.concat(s),built_in:e,literal:i},c=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),d={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},p={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},m={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},g=t.inherit(m,{illegal:/\n/}),b={className:"subst",begin:/\{/,end:/\}/,keywords:l},v=t.inherit(b,{illegal:/\n/}),_={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,v]},C={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},b]},T=t.inherit(C,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},v]});b.contains=[C,_,m,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,d,t.C_BLOCK_COMMENT_MODE],v.contains=[T,_,g,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,d,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const w={variants:[p,C,_,m,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},k={begin:"<",end:">",contains:[{beginKeywords:"in out"},c]},R=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",O={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:l,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},w,d,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},c,k,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[c,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[c,k,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+R+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:l,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,k],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,relevance:0,contains:[w,d,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},O]}}const oP=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),cP=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],uP=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],fP=[...cP,...uP],dP=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),hP=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),pP=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),mP=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function gP(t){const e=t.regex,n=oP(t),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",s=/@-?\w[\w]*(-\w+)*/,l="[a-zA-Z-][a-zA-Z0-9_-]*",c=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,i,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+l,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+hP.join("|")+")"},{begin:":(:)?("+pP.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+mP.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...c,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...c,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:dP.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...c,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+fP.join("|")+")\\b"}]}}function yP(t){const e=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function bP(t){const s={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:s,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:s,illegal:/["']/}]}]}}function xP(t){const e=t.regex,n=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:e.concat(n,e.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function vP(t){const e=t.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:t.NUMBER_RE}]},i=t.COMMENT();i.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const r={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},s={className:"literal",begin:/\bon|off|true|false|yes|no\b/},l={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},c={begin:/\[/,end:/\]/,contains:[i,s,r,l,n,"self"],relevance:0},d=/[A-Za-z0-9_-]+/,p=/"(\\"|[^"])*"/,m=/'[^']*'/,g=e.either(d,p,m),b=e.concat(g,"(\\s*\\.\\s*",g,")*",e.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[i,{className:"section",begin:/\[+/,end:/\]+/},{begin:b,className:"attr",starts:{end:/$/,contains:[i,c,s,r,l,n]}}]}}var Fd="[0-9](_*[0-9])*",Ky=`\\.(${Fd})`,Wy="[0-9a-fA-F](_*[0-9a-fA-F])*",Y2={className:"number",variants:[{begin:`(\\b(${Fd})((${Ky})|\\.)?|(${Ky}))[eE][+-]?(${Fd})[fFdD]?\\b`},{begin:`\\b(${Fd})((${Ky})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Ky})[fFdD]?\\b`},{begin:`\\b(${Fd})[fFdD]\\b`},{begin:`\\b0[xX]((${Wy})\\.?|(${Wy})?\\.(${Wy}))[pP][+-]?(${Fd})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Wy})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function NR(t,e,n){return n===-1?"":t.replace(e,i=>NR(t,e,n-1))}function _P(t){const e=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+NR("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),d={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},p={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},m={className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:d,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[m,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:d,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[p,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Y2,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Y2,p]}}const V2="[A-Za-z$_][0-9A-Za-z$_]*",SP=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],EP=["true","false","null","undefined","NaN","Infinity"],kR=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],OR=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],DR=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],wP=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],TP=[].concat(DR,kR,OR);function CP(t){const e=t.regex,n=(Z,{after:Q})=>{const q="</"+Z[0].slice(1);return Z.input.indexOf(q,Q)!==-1},i=V2,r={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,l={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Z,Q)=>{const q=Z[0].length+Z.index,Y=Z.input[q];if(Y==="<"||Y===","){Q.ignoreMatch();return}Y===">"&&(n(Z,{after:q})||Q.ignoreMatch());let ee;const V=Z.input.substring(q);if(ee=V.match(/^\s*=/)){Q.ignoreMatch();return}if((ee=V.match(/^\s+extends\s+/))&&ee.index===0){Q.ignoreMatch();return}}},c={$pattern:V2,keyword:SP,literal:EP,built_in:TP,"variable.language":wP},d="[0-9](_?[0-9])*",p=`\\.(${d})`,m="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${m})((${p})|\\.)?|(${p}))[eE][+-]?(${d})\\b`},{begin:`\\b(${m})\\b((${p})\\b|\\.)?|(${p})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},b={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},v={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,b],subLanguage:"xml"}},_={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,b],subLanguage:"css"}},C={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,b],subLanguage:"graphql"}},T={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,b]},k={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},R=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,v,_,C,T,{match:/\$\d+/},g];b.contains=R.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(R)});const O=[].concat(k,b.contains),j=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(O)}]),D={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:j},F={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,e.concat(i,"(",e.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},$={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...kR,...OR]}},P={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[D],illegal:/%/},K={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function G(Z){return e.concat("(?!",Z.join("|"),")")}const te={match:e.concat(/\b/,G([...DR,"super","import"].map(Z=>`${Z}\\s*\\(`)),i,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},H={begin:e.concat(/\./,e.lookahead(e.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},W={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},D]},B="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",X={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(B)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[D]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:j,CLASS_REFERENCE:$},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),P,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,v,_,C,T,k,{match:/\$\d+/},g,$,{scope:"attr",match:i+e.lookahead(":"),relevance:0},X,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[k,t.REGEXP_MODE,{className:"function",begin:B,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:j}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:l.begin,"on:begin":l.isTrulyOpeningTag,end:l.end}],subLanguage:"xml",contains:[{begin:l.begin,end:l.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[D,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},H,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[D]},te,K,F,W,{match:/\$[(.]/}]}}function AP(t){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],r={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[e,n,t.QUOTE_STRING_MODE,r,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var qd="[0-9](_*[0-9])*",$y=`\\.(${qd})`,Zy="[0-9a-fA-F](_*[0-9a-fA-F])*",MP={className:"number",variants:[{begin:`(\\b(${qd})((${$y})|\\.)?|(${$y}))[eE][+-]?(${qd})[fFdD]?\\b`},{begin:`\\b(${qd})((${$y})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${$y})[fFdD]?\\b`},{begin:`\\b(${qd})[fFdD]\\b`},{begin:`\\b0[xX]((${Zy})\\.?|(${Zy})?\\.(${Zy}))[pP][+-]?(${qd})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Zy})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function RP(t){const e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},i={className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[t.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+t.UNDERSCORE_IDENT_RE},l={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,r]},{begin:"'",end:"'",illegal:/\n/,contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[t.BACKSLASH_ESCAPE,s,r]}]};r.contains.push(l);const c={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+t.UNDERSCORE_IDENT_RE+")?"},d={className:"meta",begin:"@"+t.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[t.inherit(l,{className:"string"}),"self"]}]},p=MP,m=t.COMMENT("/\\*","\\*/",{contains:[t.C_BLOCK_COMMENT_MODE]}),g={variants:[{className:"type",begin:t.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},b=g;return b.variants[1].contains=[g],g.variants[1].contains=[b],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.C_LINE_COMMENT_MODE,m,n,i,c,d,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[g,t.C_LINE_COMMENT_MODE,m],relevance:0},t.C_LINE_COMMENT_MODE,m,c,d,l,t.C_NUMBER_MODE]},m]},{begin:[/class|interface|trait/,/\s+/,t.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},t.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},c,d]},l,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
375
|
+
`},p]}}const NP=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),kP=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],OP=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],DP=[...kP,...OP],zP=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),zR=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),BR=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),BP=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),LP=zR.concat(BR).sort().reverse();function UP(t){const e=NP(t),n=LP,i="and or not only",r="[\\w-]+",s="("+r+"|@\\{"+r+"\\})",l=[],c=[],d=function(R){return{className:"string",begin:"~?"+R+".*?"+R}},p=function(R,O,j){return{className:R,begin:O,relevance:j}},m={$pattern:/[a-z-]+/,keyword:i,attribute:zP.join(" ")},g={begin:"\\(",end:"\\)",contains:c,keywords:m,relevance:0};c.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,d("'"),d('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,g,p("variable","@@?"+r,10),p("variable","@\\{"+r+"\\}"),p("built_in","~?`[^`]*?`"),{className:"attribute",begin:r+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);const b=c.concat({begin:/\{/,end:/\}/,contains:l}),v={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(c)},_={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+BP.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:c}}]},C={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:m,returnEnd:!0,contains:c,relevance:0}},T={className:"variable",variants:[{begin:"@"+r+"\\s*:",relevance:15},{begin:"@"+r}],starts:{end:"[;}]",returnEnd:!0,contains:b}},w={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,v,p("keyword","all\\b"),p("variable","@\\{"+r+"\\}"),{begin:"\\b("+DP.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,p("selector-tag",s,0),p("selector-id","#"+s),p("selector-class","\\."+s,0),p("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+zR.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+BR.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:b},{begin:"!important"},e.FUNCTION_DISPATCH]},k={begin:r+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[w]};return l.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,C,T,k,_,w,v,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:l}}function IP(t){const e="\\[=*\\[",n="\\]=*\\]",i={begin:e,end:n,contains:["self"]},r=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,n,{contains:[i],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:r.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:r}].concat(r)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:n,contains:[i],relevance:5}])}}function jP(t){const e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,e]},i={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[e,n]},r={begin:"^"+t.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},s={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},l={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[e]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[t.HASH_COMMENT_MODE,e,n,i,r,s,l]}}function HP(t){const e=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},r={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},l={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},c=/[A-Za-z][A-Za-z0-9+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,c,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},p={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},m={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},g=t.inherit(p,{contains:[]}),b=t.inherit(m,{contains:[]});p.contains.push(b),m.contains.push(g);let v=[n,d];return[p,m,g,b].forEach(w=>{w.contains=w.contains.concat(v)}),v=v.concat(p,m),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:v},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:v}]}]},n,s,p,m,{className:"quote",begin:"^>\\s+",contains:v,end:"$"},r,i,d,l,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function PP(t){const e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,c={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},d={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:c,illegal:"</",contains:[e,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+d.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:d,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}function GP(t){const e=t.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],i=/[dualxmsipngr]{0,12}/,r={$pattern:/[\w.]+/,keyword:n.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},l={begin:/->\{/,end:/\}/},c={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},d={scope:"variable",variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[c]},p={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},m=[t.BACKSLASH_ESCAPE,s,d],g=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],b=(C,T,w="\\1")=>{const k=w==="\\1"?w:e.concat(w,T);return e.concat(e.concat("(?:",C,")"),T,/(?:\\.|[^\\\/])*?/,k,/(?:\\.|[^\\\/])*?/,w,i)},v=(C,T,w)=>e.concat(e.concat("(?:",C,")"),T,/(?:\\.|[^\\\/])*?/,w,i),_=[d,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),l,{className:"string",contains:m,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},p,{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:b("s|tr|y",e.either(...g,{capture:!0}))},{begin:b("s|tr|y","\\(","\\)")},{begin:b("s|tr|y","\\[","\\]")},{begin:b("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:v("(?:m|qr)?",/\//,/\//)},{begin:v("m|qr",e.either(...g,{capture:!0}),/\1/)},{begin:v("m|qr",/\(/,/\)/)},{begin:v("m|qr",/\[/,/\]/)},{begin:v("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,c]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,c,p]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return s.contains=_,l.contains=_,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:_}}function FP(t){const e=t.regex,n=/(?![A-Za-z0-9])(?![$])/,i=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),r=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),s=e.concat(/[A-Z]+/,n),l={scope:"variable",match:"\\$+"+i},c={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},d={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},p=t.inherit(t.APOS_STRING_MODE,{illegal:null}),m=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(d)}),g={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(d),"on:begin":(H,W)=>{W.data._beginMatch=H[1]||H[2]},"on:end":(H,W)=>{W.data._beginMatch!==H[1]&&W.ignoreMatch()}},b=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),v=`[
|
|
376
|
+
]`,_={scope:"string",variants:[m,p,g,b]},C={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},T=["false","null","true"],w=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],k=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],O={keyword:w,literal:(H=>{const W=[];return H.forEach(B=>{W.push(B),B.toLowerCase()===B?W.push(B.toUpperCase()):W.push(B.toLowerCase())}),W})(T),built_in:k},j=H=>H.map(W=>W.replace(/\|\d+$/,"")),D={variants:[{match:[/new/,e.concat(v,"+"),e.concat("(?!",j(k).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},F=e.concat(i,"\\b(?!\\()"),$={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),F],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,e.concat(/::/,e.lookahead(/(?!class\b)/)),F],scope:{1:"title.class",3:"variable.constant"}},{match:[r,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},P={scope:"attr",match:e.concat(i,e.lookahead(":"),e.lookahead(/(?!::)/))},I={relevance:0,begin:/\(/,end:/\)/,keywords:O,contains:[P,l,$,t.C_BLOCK_COMMENT_MODE,_,C,D]},K={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",j(w).join("\\b|"),"|",j(k).join("\\b|"),"\\b)"),i,e.concat(v,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[I]};I.contains.push(K);const G=[P,$,t.C_BLOCK_COMMENT_MODE,_,C,D],te={begin:e.concat(/#\[\s*\\?/,e.either(r,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:T,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:T,keyword:["new","array"]},contains:["self",...G]},...G,{scope:"meta",variants:[{match:r},{match:s}]}]};return{case_insensitive:!1,keywords:O,contains:[te,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},c,{scope:"variable.language",match:/\$this\b/},l,K,$,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},D,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:O,contains:["self",te,l,$,t.C_BLOCK_COMMENT_MODE,_,C]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},_,C]}}function qP(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function YP(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function VP(t){const e=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],c={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},d={className:"meta",begin:/^(>>>|\.\.\.) /},p={className:"subst",begin:/\{/,end:/\}/,keywords:c,illegal:/#/},m={begin:/\{\{/,relevance:0},g={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d,m,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,m,p]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,m,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,m,p]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},b="[0-9](_?[0-9])*",v=`(\\b(${b}))?\\.(${b})|\\b(${b})\\.`,_=`\\b|${i.join("|")}`,C={className:"number",relevance:0,variants:[{begin:`(\\b(${b})|(${v}))[eE][+-]?(${b})[jJ]?(?=${_})`},{begin:`(${v})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${_})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${_})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${_})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${_})`},{begin:`\\b(${b})[jJ](?=${_})`}]},T={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:c,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},w={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",d,C,g,t.HASH_COMMENT_MODE]}]};return p.contains=[g,C,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:c,illegal:/(<\/|\?)|=>/,contains:[d,C,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},g,T,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[w]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[C,w,g]}]}}function XP(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function KP(t){const e=t.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,i=e.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),r=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[r,i]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,i]},{scope:{1:"punctuation",2:"number"},match:[s,i]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,i]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:r},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function WP(t){const e=t.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),r=e.concat(i,/(::\w+)*/),l={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},c={className:"doctag",begin:"@[A-Za-z]+"},d={begin:"#<",end:">"},p=[t.COMMENT("#","$",{contains:[c]}),t.COMMENT("^=begin","^=end",{contains:[c],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],m={className:"subst",begin:/#\{/,end:/\}/,keywords:l},g={className:"string",contains:[t.BACKSLASH_ESCAPE,m],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,m]})]}]},b="[1-9](_?[0-9])*|0",v="[0-9](_?[0-9])*",_={className:"number",relevance:0,variants:[{begin:`\\b(${b})(\\.(${v}))?([eE][+-]?(${v})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},C={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:l}]},D=[g,{variants:[{match:[/class\s+/,r,/\s+<\s+/,r]},{match:[/\b(class|module)\s+/,r]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:l},{match:[/(include|extend)\s+/,r],scope:{2:"title.class"},keywords:l},{relevance:0,match:[r,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:i,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[C]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[g,{begin:n}],relevance:0},_,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:l},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,m],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(d,p),relevance:0}].concat(d,p);m.contains=D,C.contains=D;const I=[{begin:/^\s*=>/,starts:{end:"$",contains:D}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:l,contains:D}}];return p.unshift(d),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:l,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(I).concat(p).concat(D)}}function $P(t){const e=t.regex,n=/(r#)?/,i=e.concat(n,t.UNDERSCORE_IDENT_RE),r=e.concat(n,t.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,r,e.lookahead(/\s*\(/))},l="([ui](8|16|32|64|128|size)|f(32|64))?",c=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],d=["true","false","Some","None","Ok","Err"],p=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],m=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:m,keyword:c,literal:d,built_in:p},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+l},{begin:"\\b0o([0-7_]+)"+l},{begin:"\\b0x([A-Fa-f0-9_]+)"+l},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+l}],relevance:0},{begin:[/fn/,/\s+/,i],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,i],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,i,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:p,type:m}},{className:"punctuation",begin:"->"},s]}}const ZP=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),QP=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],JP=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],eG=[...QP,...JP],tG=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),nG=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),iG=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),rG=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function aG(t){const e=ZP(t),n=iG,i=nG,r="@[a-z-]+",s="and or not only",c={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+eG.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+i.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},c,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+rG.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[e.BLOCK_COMMENT,c,e.HEXCOLOR,e.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:r,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:tG.join(" ")},contains:[{begin:r,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},c,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function sG(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function lG(t){const e=t.regex,n=t.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],l=["double precision","large object","with timezone","without timezone"],c=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],d=["add","asc","collation","desc","final","first","last","view"],p=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],m=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],g=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],b=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],v=m,_=[...p,...d].filter(j=>!m.includes(j)),C={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},T={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},w={match:e.concat(/\b/,e.either(...v),/\s*\(/),relevance:0,keywords:{built_in:v}};function k(j){return e.concat(/\b/,e.either(...j.map(D=>D.replace(/\s+/,"\\s+"))),/\b/)}const R={scope:"keyword",match:k(b),relevance:0};function O(j,{exceptions:D,when:F}={}){const $=F;return D=D||[],j.map(P=>P.match(/\|\d+$/)||D.includes(P)?P:$(P)?`${P}|0`:P)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:O(_,{when:j=>j.length<3}),literal:s,type:c,built_in:g},contains:[{scope:"type",match:k(l)},R,w,C,i,r,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,T]}}function LR(t){return t?typeof t=="string"?t:t.source:null}function sm(t){return wn("(?=",t,")")}function wn(...t){return t.map(n=>LR(n)).join("")}function oG(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function aa(...t){return"("+(oG(t).capture?"":"?:")+t.map(i=>LR(i)).join("|")+")"}const C1=t=>wn(/\b/,t,/\w$/.test(t)?/\b/:/\B/),cG=["Protocol","Type"].map(C1),X2=["init","self"].map(C1),uG=["Any","Self"],hv=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],K2=["false","nil","true"],fG=["assignment","associativity","higherThan","left","lowerThan","none","right"],dG=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],W2=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],UR=aa(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),IR=aa(UR,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),pv=wn(UR,IR,"*"),jR=aa(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),z0=aa(jR,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),oo=wn(jR,z0,"*"),Qy=wn(/[A-Z]/,z0,"*"),hG=["attached","autoclosure",wn(/convention\(/,aa("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",wn(/objc\(/,oo,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],pG=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function mG(t){const e={match:/\s+/,relevance:0},n=t.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[t.C_LINE_COMMENT_MODE,n],r={match:[/\./,aa(...cG,...X2)],className:{2:"keyword"}},s={match:wn(/\./,aa(...hv)),relevance:0},l=hv.filter(He=>typeof He=="string").concat(["_|0"]),c=hv.filter(He=>typeof He!="string").concat(uG).map(C1),d={variants:[{className:"keyword",match:aa(...c,...X2)}]},p={$pattern:aa(/\b\w+/,/#\w+/),keyword:l.concat(dG),literal:K2},m=[r,s,d],g={match:wn(/\./,aa(...W2)),relevance:0},b={className:"built_in",match:wn(/\b/,aa(...W2),/(?=\()/)},v=[g,b],_={match:/->/,relevance:0},C={className:"operator",relevance:0,variants:[{match:pv},{match:`\\.(\\.|${IR})+`}]},T=[_,C],w="([0-9]_*)+",k="([0-9a-fA-F]_*)+",R={className:"number",relevance:0,variants:[{match:`\\b(${w})(\\.(${w}))?([eE][+-]?(${w}))?\\b`},{match:`\\b0x(${k})(\\.(${k}))?([pP][+-]?(${w}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},O=(He="")=>({className:"subst",variants:[{match:wn(/\\/,He,/[0\\tnr"']/)},{match:wn(/\\/,He,/u\{[0-9a-fA-F]{1,8}\}/)}]}),j=(He="")=>({className:"subst",match:wn(/\\/,He,/[\t ]*(?:[\r\n]|\r\n)/)}),D=(He="")=>({className:"subst",label:"interpol",begin:wn(/\\/,He,/\(/),end:/\)/}),F=(He="")=>({begin:wn(He,/"""/),end:wn(/"""/,He),contains:[O(He),j(He),D(He)]}),$=(He="")=>({begin:wn(He,/"/),end:wn(/"/,He),contains:[O(He),D(He)]}),P={className:"string",variants:[F(),F("#"),F("##"),F("###"),$(),$("#"),$("##"),$("###")]},I=[t.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[t.BACKSLASH_ESCAPE]}],K={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:I},G=He=>{const At=wn(He,/\//),zn=wn(/\//,He);return{begin:At,end:zn,contains:[...I,{scope:"comment",begin:`#(?!.*${zn})`,end:/$/}]}},te={scope:"regexp",variants:[G("###"),G("##"),G("#"),K]},H={match:wn(/`/,oo,/`/)},W={className:"variable",match:/\$\d+/},B={className:"variable",match:`\\$${z0}+`},X=[H,W,B],Z={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:pG,contains:[...T,R,P]}]}},Q={scope:"keyword",match:wn(/@/,aa(...hG),sm(aa(/\(/,/\s+/)))},q={scope:"meta",match:wn(/@/,oo)},Y=[Z,Q,q],ee={match:sm(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:wn(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,z0,"+")},{className:"type",match:Qy,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:wn(/\s+&\s+/,sm(Qy)),relevance:0}]},V={begin:/</,end:/>/,keywords:p,contains:[...i,...m,...Y,_,ee]};ee.contains.push(V);const oe={match:wn(oo,/\s*:/),keywords:"_|0",relevance:0},be={begin:/\(/,end:/\)/,relevance:0,keywords:p,contains:["self",oe,...i,te,...m,...v,...T,R,P,...X,...Y,ee]},ve={begin:/</,end:/>/,keywords:"repeat each",contains:[...i,ee]},se={begin:aa(sm(wn(oo,/\s*:/)),sm(wn(oo,/\s+/,oo,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:oo}]},ge={begin:/\(/,end:/\)/,keywords:p,contains:[se,...i,...m,...T,R,P,...Y,ee,be],endsParent:!0,illegal:/["']/},le={match:[/(func|macro)/,/\s+/,aa(H.match,oo,pv)],className:{1:"keyword",3:"title.function"},contains:[ve,ge,e],illegal:[/\[/,/%/]},Re={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ve,ge,e],illegal:/\[|%/},Ie={match:[/operator/,/\s+/,pv],className:{1:"keyword",3:"title"}},Ue={begin:[/precedencegroup/,/\s+/,Qy],className:{1:"keyword",3:"title"},contains:[ee],keywords:[...fG,...K2],end:/}/},Le={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Ve={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},ut={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,oo,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:p,contains:[ve,...m,{begin:/:/,end:/\{/,keywords:p,contains:[{scope:"title.class.inherited",match:Qy},...m],relevance:0}]};for(const He of P.variants){const At=He.contains.find(Bn=>Bn.label==="interpol");At.keywords=p;const zn=[...m,...v,...T,R,P,...X];At.contains=[...zn,{begin:/\(/,end:/\)/,contains:["self",...zn]}]}return{name:"Swift",keywords:p,contains:[...i,le,Re,Le,Ve,ut,Ie,Ue,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},te,...m,...v,...T,R,P,...X,...Y,ee,be]}}const B0="[A-Za-z$_][0-9A-Za-z$_]*",HR=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],PR=["true","false","null","undefined","NaN","Infinity"],GR=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],FR=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],qR=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],YR=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],VR=[].concat(qR,GR,FR);function gG(t){const e=t.regex,n=(Z,{after:Q})=>{const q="</"+Z[0].slice(1);return Z.input.indexOf(q,Q)!==-1},i=B0,r={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,l={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Z,Q)=>{const q=Z[0].length+Z.index,Y=Z.input[q];if(Y==="<"||Y===","){Q.ignoreMatch();return}Y===">"&&(n(Z,{after:q})||Q.ignoreMatch());let ee;const V=Z.input.substring(q);if(ee=V.match(/^\s*=/)){Q.ignoreMatch();return}if((ee=V.match(/^\s+extends\s+/))&&ee.index===0){Q.ignoreMatch();return}}},c={$pattern:B0,keyword:HR,literal:PR,built_in:VR,"variable.language":YR},d="[0-9](_?[0-9])*",p=`\\.(${d})`,m="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${m})((${p})|\\.)?|(${p}))[eE][+-]?(${d})\\b`},{begin:`\\b(${m})\\b((${p})\\b|\\.)?|(${p})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},b={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},v={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,b],subLanguage:"xml"}},_={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,b],subLanguage:"css"}},C={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,b],subLanguage:"graphql"}},T={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,b]},k={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},R=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,v,_,C,T,{match:/\$\d+/},g];b.contains=R.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(R)});const O=[].concat(k,b.contains),j=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(O)}]),D={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:j},F={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,e.concat(i,"(",e.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},$={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...GR,...FR]}},P={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[D],illegal:/%/},K={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function G(Z){return e.concat("(?!",Z.join("|"),")")}const te={match:e.concat(/\b/,G([...qR,"super","import"].map(Z=>`${Z}\\s*\\(`)),i,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},H={begin:e.concat(/\./,e.lookahead(e.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},W={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},D]},B="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",X={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(B)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[D]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:j,CLASS_REFERENCE:$},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),P,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,v,_,C,T,k,{match:/\$\d+/},g,$,{scope:"attr",match:i+e.lookahead(":"),relevance:0},X,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[k,t.REGEXP_MODE,{className:"function",begin:B,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:j}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:l.begin,"on:begin":l.isTrulyOpeningTag,end:l.end}],subLanguage:"xml",contains:[{begin:l.begin,end:l.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[D,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},H,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[D]},te,K,F,W,{match:/\$[(.]/}]}}function yG(t){const e=t.regex,n=gG(t),i=B0,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},l={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[n.exports.CLASS_REFERENCE]},c={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],p={$pattern:B0,keyword:HR.concat(d),literal:PR,built_in:VR.concat(r),"variable.language":YR},m={className:"meta",begin:"@"+i},g=(C,T,w)=>{const k=C.contains.findIndex(R=>R.label===T);if(k===-1)throw new Error("can not find mode to replace");C.contains.splice(k,1,w)};Object.assign(n.keywords,p),n.exports.PARAMS_CONTAINS.push(m);const b=n.contains.find(C=>C.scope==="attr"),v=Object.assign({},b,{match:e.concat(i,e.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,b,v]),n.contains=n.contains.concat([m,s,l,v]),g(n,"shebang",t.SHEBANG()),g(n,"use_strict",c);const _=n.contains.find(C=>C.label==="func.def");return _.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function bG(t){const e=t.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},i={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},r=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,l=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,c=/\d{1,2}(:\d{1,2}){1,2}/,d={className:"literal",variants:[{begin:e.concat(/# */,e.either(s,r),/ *#/)},{begin:e.concat(/# */,c,/ *#/)},{begin:e.concat(/# */,l,/ *#/)},{begin:e.concat(/# */,e.either(s,r),/ +/,e.either(l,c),/ *#/)}]},p={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},m={className:"label",begin:/^\w+:/},g=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),b=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,i,d,p,m,g,b,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[b]}]}}function xG(t){t.regex;const e=t.COMMENT(/\(;/,/;\)/);e.contains.push("self");const n=t.COMMENT(/;;/,/$/),i=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],r={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={className:"variable",begin:/\$[\w_]+/},l={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},c={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},d={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},p={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:i},contains:[n,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,l,r,t.QUOTE_STRING_MODE,d,p,c]}}function vG(t){const e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},l=t.inherit(s,{begin:/\(/,end:/\)/}),c=t.inherit(t.APOS_STRING_MODE,{className:"string"}),d=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),p={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:i,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[r]},{begin:/'/,end:/'/,contains:[r]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[s,d,c,l,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,l,d,c]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[d]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[p],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[p],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(n,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:p}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function _G(t){const e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},l={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,r]},c=t.inherit(l,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),b={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},v={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},_={begin:/\{/,end:/\}/,contains:[v],illegal:"\\n",relevance:0},C={begin:"\\[",end:"\\]",contains:[v],illegal:"\\n",relevance:0},T=[i,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},b,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},_,C,s,l],w=[...T];return w.pop(),w.push(c),v.contains=w,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:T}}const SG={arduino:iP,bash:rP,c:aP,cpp:sP,csharp:lP,css:gP,diff:yP,go:bP,graphql:xP,ini:vP,java:_P,javascript:CP,json:AP,kotlin:RP,less:UP,lua:IP,makefile:jP,markdown:HP,objectivec:PP,perl:GP,php:FP,"php-template":qP,plaintext:YP,python:VP,"python-repl":XP,r:KP,ruby:WP,rust:$P,scss:aG,shell:sG,sql:lG,swift:mG,typescript:yG,vbnet:bG,wasm:xG,xml:vG,yaml:_G};var mv,$2;function EG(){if($2)return mv;$2=1;function t(ae){return ae instanceof Map?ae.clear=ae.delete=ae.set=function(){throw new Error("map is read-only")}:ae instanceof Set&&(ae.add=ae.clear=ae.delete=function(){throw new Error("set is read-only")}),Object.freeze(ae),Object.getOwnPropertyNames(ae).forEach(we=>{const Be=ae[we],et=typeof Be;(et==="object"||et==="function")&&!Object.isFrozen(Be)&&t(Be)}),ae}class e{constructor(we){we.data===void 0&&(we.data={}),this.data=we.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(ae){return ae.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function i(ae,...we){const Be=Object.create(null);for(const et in ae)Be[et]=ae[et];return we.forEach(function(et){for(const Jt in et)Be[Jt]=et[Jt]}),Be}const r="</span>",s=ae=>!!ae.scope,l=(ae,{prefix:we})=>{if(ae.startsWith("language:"))return ae.replace("language:","language-");if(ae.includes(".")){const Be=ae.split(".");return[`${we}${Be.shift()}`,...Be.map((et,Jt)=>`${et}${"_".repeat(Jt+1)}`)].join(" ")}return`${we}${ae}`};class c{constructor(we,Be){this.buffer="",this.classPrefix=Be.classPrefix,we.walk(this)}addText(we){this.buffer+=n(we)}openNode(we){if(!s(we))return;const Be=l(we.scope,{prefix:this.classPrefix});this.span(Be)}closeNode(we){s(we)&&(this.buffer+=r)}value(){return this.buffer}span(we){this.buffer+=`<span class="${we}">`}}const d=(ae={})=>{const we={children:[]};return Object.assign(we,ae),we};class p{constructor(){this.rootNode=d(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(we){this.top.children.push(we)}openNode(we){const Be=d({scope:we});this.add(Be),this.stack.push(Be)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(we){return this.constructor._walk(we,this.rootNode)}static _walk(we,Be){return typeof Be=="string"?we.addText(Be):Be.children&&(we.openNode(Be),Be.children.forEach(et=>this._walk(we,et)),we.closeNode(Be)),we}static _collapse(we){typeof we!="string"&&we.children&&(we.children.every(Be=>typeof Be=="string")?we.children=[we.children.join("")]:we.children.forEach(Be=>{p._collapse(Be)}))}}class m extends p{constructor(we){super(),this.options=we}addText(we){we!==""&&this.add(we)}startScope(we){this.openNode(we)}endScope(){this.closeNode()}__addSublanguage(we,Be){const et=we.root;Be&&(et.scope=`language:${Be}`),this.add(et)}toHTML(){return new c(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function g(ae){return ae?typeof ae=="string"?ae:ae.source:null}function b(ae){return C("(?=",ae,")")}function v(ae){return C("(?:",ae,")*")}function _(ae){return C("(?:",ae,")?")}function C(...ae){return ae.map(Be=>g(Be)).join("")}function T(ae){const we=ae[ae.length-1];return typeof we=="object"&&we.constructor===Object?(ae.splice(ae.length-1,1),we):{}}function w(...ae){return"("+(T(ae).capture?"":"?:")+ae.map(et=>g(et)).join("|")+")"}function k(ae){return new RegExp(ae.toString()+"|").exec("").length-1}function R(ae,we){const Be=ae&&ae.exec(we);return Be&&Be.index===0}const O=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function j(ae,{joinWith:we}){let Be=0;return ae.map(et=>{Be+=1;const Jt=Be;let en=g(et),Fe="";for(;en.length>0;){const Pe=O.exec(en);if(!Pe){Fe+=en;break}Fe+=en.substring(0,Pe.index),en=en.substring(Pe.index+Pe[0].length),Pe[0][0]==="\\"&&Pe[1]?Fe+="\\"+String(Number(Pe[1])+Jt):(Fe+=Pe[0],Pe[0]==="("&&Be++)}return Fe}).map(et=>`(${et})`).join(we)}const D=/\b\B/,F="[a-zA-Z]\\w*",$="[a-zA-Z_]\\w*",P="\\b\\d+(\\.\\d+)?",I="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",K="\\b(0b[01]+)",G="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",te=(ae={})=>{const we=/^#![ ]*\//;return ae.binary&&(ae.begin=C(we,/.*\b/,ae.binary,/\b.*/)),i({scope:"meta",begin:we,end:/$/,relevance:0,"on:begin":(Be,et)=>{Be.index!==0&&et.ignoreMatch()}},ae)},H={begin:"\\\\[\\s\\S]",relevance:0},W={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[H]},B={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[H]},X={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Z=function(ae,we,Be={}){const et=i({scope:"comment",begin:ae,end:we,contains:[]},Be);et.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Jt=w("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return et.contains.push({begin:C(/[ ]+/,"(",Jt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),et},Q=Z("//","$"),q=Z("/\\*","\\*/"),Y=Z("#","$"),ee={scope:"number",begin:P,relevance:0},V={scope:"number",begin:I,relevance:0},oe={scope:"number",begin:K,relevance:0},be={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[H,{begin:/\[/,end:/\]/,relevance:0,contains:[H]}]},ve={scope:"title",begin:F,relevance:0},se={scope:"title",begin:$,relevance:0},ge={begin:"\\.\\s*"+$,relevance:0};var Re=Object.freeze({__proto__:null,APOS_STRING_MODE:W,BACKSLASH_ESCAPE:H,BINARY_NUMBER_MODE:oe,BINARY_NUMBER_RE:K,COMMENT:Z,C_BLOCK_COMMENT_MODE:q,C_LINE_COMMENT_MODE:Q,C_NUMBER_MODE:V,C_NUMBER_RE:I,END_SAME_AS_BEGIN:function(ae){return Object.assign(ae,{"on:begin":(we,Be)=>{Be.data._beginMatch=we[1]},"on:end":(we,Be)=>{Be.data._beginMatch!==we[1]&&Be.ignoreMatch()}})},HASH_COMMENT_MODE:Y,IDENT_RE:F,MATCH_NOTHING_RE:D,METHOD_GUARD:ge,NUMBER_MODE:ee,NUMBER_RE:P,PHRASAL_WORDS_MODE:X,QUOTE_STRING_MODE:B,REGEXP_MODE:be,RE_STARTERS_RE:G,SHEBANG:te,TITLE_MODE:ve,UNDERSCORE_IDENT_RE:$,UNDERSCORE_TITLE_MODE:se});function Ie(ae,we){ae.input[ae.index-1]==="."&&we.ignoreMatch()}function Ue(ae,we){ae.className!==void 0&&(ae.scope=ae.className,delete ae.className)}function Le(ae,we){we&&ae.beginKeywords&&(ae.begin="\\b("+ae.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",ae.__beforeBegin=Ie,ae.keywords=ae.keywords||ae.beginKeywords,delete ae.beginKeywords,ae.relevance===void 0&&(ae.relevance=0))}function Ve(ae,we){Array.isArray(ae.illegal)&&(ae.illegal=w(...ae.illegal))}function ut(ae,we){if(ae.match){if(ae.begin||ae.end)throw new Error("begin & end are not supported with match");ae.begin=ae.match,delete ae.match}}function He(ae,we){ae.relevance===void 0&&(ae.relevance=1)}const At=(ae,we)=>{if(!ae.beforeMatch)return;if(ae.starts)throw new Error("beforeMatch cannot be used with starts");const Be=Object.assign({},ae);Object.keys(ae).forEach(et=>{delete ae[et]}),ae.keywords=Be.keywords,ae.begin=C(Be.beforeMatch,b(Be.begin)),ae.starts={relevance:0,contains:[Object.assign(Be,{endsParent:!0})]},ae.relevance=0,delete Be.beforeMatch},zn=["of","and","for","in","not","or","if","then","parent","list","value"],Bn="keyword";function bn(ae,we,Be=Bn){const et=Object.create(null);return typeof ae=="string"?Jt(Be,ae.split(" ")):Array.isArray(ae)?Jt(Be,ae):Object.keys(ae).forEach(function(en){Object.assign(et,bn(ae[en],we,en))}),et;function Jt(en,Fe){we&&(Fe=Fe.map(Pe=>Pe.toLowerCase())),Fe.forEach(function(Pe){const tt=Pe.split("|");et[tt[0]]=[en,wi(tt[0],tt[1])]})}}function wi(ae,we){return we?Number(we):ka(ae)?0:1}function ka(ae){return zn.includes(ae.toLowerCase())}const Lr={},hn=ae=>{console.error(ae)},ua=(ae,...we)=>{console.log(`WARN: ${ae}`,...we)},Se=(ae,we)=>{Lr[`${ae}/${we}`]||(console.log(`Deprecated as of ${ae}. ${we}`),Lr[`${ae}/${we}`]=!0)},ke=new Error;function Je(ae,we,{key:Be}){let et=0;const Jt=ae[Be],en={},Fe={};for(let Pe=1;Pe<=we.length;Pe++)Fe[Pe+et]=Jt[Pe],en[Pe+et]=!0,et+=k(we[Pe-1]);ae[Be]=Fe,ae[Be]._emit=en,ae[Be]._multi=!0}function bt(ae){if(Array.isArray(ae.begin)){if(ae.skip||ae.excludeBegin||ae.returnBegin)throw hn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ke;if(typeof ae.beginScope!="object"||ae.beginScope===null)throw hn("beginScope must be object"),ke;Je(ae,ae.begin,{key:"beginScope"}),ae.begin=j(ae.begin,{joinWith:""})}}function kt(ae){if(Array.isArray(ae.end)){if(ae.skip||ae.excludeEnd||ae.returnEnd)throw hn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ke;if(typeof ae.endScope!="object"||ae.endScope===null)throw hn("endScope must be object"),ke;Je(ae,ae.end,{key:"endScope"}),ae.end=j(ae.end,{joinWith:""})}}function yi(ae){ae.scope&&typeof ae.scope=="object"&&ae.scope!==null&&(ae.beginScope=ae.scope,delete ae.scope)}function rr(ae){yi(ae),typeof ae.beginScope=="string"&&(ae.beginScope={_wrap:ae.beginScope}),typeof ae.endScope=="string"&&(ae.endScope={_wrap:ae.endScope}),bt(ae),kt(ae)}function xn(ae){function we(Fe,Pe){return new RegExp(g(Fe),"m"+(ae.case_insensitive?"i":"")+(ae.unicodeRegex?"u":"")+(Pe?"g":""))}class Be{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Pe,tt){tt.position=this.position++,this.matchIndexes[this.matchAt]=tt,this.regexes.push([tt,Pe]),this.matchAt+=k(Pe)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Pe=this.regexes.map(tt=>tt[1]);this.matcherRe=we(j(Pe,{joinWith:"|"}),!0),this.lastIndex=0}exec(Pe){this.matcherRe.lastIndex=this.lastIndex;const tt=this.matcherRe.exec(Pe);if(!tt)return null;const Cn=tt.findIndex((fa,ar)=>ar>0&&fa!==void 0),Gt=this.matchIndexes[Cn];return tt.splice(0,Cn),Object.assign(tt,Gt)}}class et{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Pe){if(this.multiRegexes[Pe])return this.multiRegexes[Pe];const tt=new Be;return this.rules.slice(Pe).forEach(([Cn,Gt])=>tt.addRule(Cn,Gt)),tt.compile(),this.multiRegexes[Pe]=tt,tt}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Pe,tt){this.rules.push([Pe,tt]),tt.type==="begin"&&this.count++}exec(Pe){const tt=this.getMatcher(this.regexIndex);tt.lastIndex=this.lastIndex;let Cn=tt.exec(Pe);if(this.resumingScanAtSamePosition()&&!(Cn&&Cn.index===this.lastIndex)){const Gt=this.getMatcher(0);Gt.lastIndex=this.lastIndex+1,Cn=Gt.exec(Pe)}return Cn&&(this.regexIndex+=Cn.position+1,this.regexIndex===this.count&&this.considerAll()),Cn}}function Jt(Fe){const Pe=new et;return Fe.contains.forEach(tt=>Pe.addRule(tt.begin,{rule:tt,type:"begin"})),Fe.terminatorEnd&&Pe.addRule(Fe.terminatorEnd,{type:"end"}),Fe.illegal&&Pe.addRule(Fe.illegal,{type:"illegal"}),Pe}function en(Fe,Pe){const tt=Fe;if(Fe.isCompiled)return tt;[Ue,ut,rr,At].forEach(Gt=>Gt(Fe,Pe)),ae.compilerExtensions.forEach(Gt=>Gt(Fe,Pe)),Fe.__beforeBegin=null,[Le,Ve,He].forEach(Gt=>Gt(Fe,Pe)),Fe.isCompiled=!0;let Cn=null;return typeof Fe.keywords=="object"&&Fe.keywords.$pattern&&(Fe.keywords=Object.assign({},Fe.keywords),Cn=Fe.keywords.$pattern,delete Fe.keywords.$pattern),Cn=Cn||/\w+/,Fe.keywords&&(Fe.keywords=bn(Fe.keywords,ae.case_insensitive)),tt.keywordPatternRe=we(Cn,!0),Pe&&(Fe.begin||(Fe.begin=/\B|\b/),tt.beginRe=we(tt.begin),!Fe.end&&!Fe.endsWithParent&&(Fe.end=/\B|\b/),Fe.end&&(tt.endRe=we(tt.end)),tt.terminatorEnd=g(tt.end)||"",Fe.endsWithParent&&Pe.terminatorEnd&&(tt.terminatorEnd+=(Fe.end?"|":"")+Pe.terminatorEnd)),Fe.illegal&&(tt.illegalRe=we(Fe.illegal)),Fe.contains||(Fe.contains=[]),Fe.contains=[].concat(...Fe.contains.map(function(Gt){return Gn(Gt==="self"?Fe:Gt)})),Fe.contains.forEach(function(Gt){en(Gt,tt)}),Fe.starts&&en(Fe.starts,Pe),tt.matcher=Jt(tt),tt}if(ae.compilerExtensions||(ae.compilerExtensions=[]),ae.contains&&ae.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return ae.classNameAliases=i(ae.classNameAliases||{}),en(ae)}function $t(ae){return ae?ae.endsWithParent||$t(ae.starts):!1}function Gn(ae){return ae.variants&&!ae.cachedVariants&&(ae.cachedVariants=ae.variants.map(function(we){return i(ae,{variants:null},we)})),ae.cachedVariants?ae.cachedVariants:$t(ae)?i(ae,{starts:ae.starts?i(ae.starts):null}):Object.isFrozen(ae)?i(ae):ae}var Pt="11.11.1";class Fi extends Error{constructor(we,Be){super(we),this.name="HTMLInjectionError",this.html=Be}}const Qn=n,bo=i,as=Symbol("nomatch"),Oa=7,ss=function(ae){const we=Object.create(null),Be=Object.create(null),et=[];let Jt=!0;const en="Could not find the language '{}', did you forget to load/include a language module?",Fe={disableAutodetect:!0,name:"Plain text",contains:[]};let Pe={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:m};function tt(Me){return Pe.noHighlightRe.test(Me)}function Cn(Me){let Xe=Me.className+" ";Xe+=Me.parentNode?Me.parentNode.className:"";const xt=Pe.languageDetectRe.exec(Xe);if(xt){const Xt=tn(xt[1]);return Xt||(ua(en.replace("{}",xt[1])),ua("Falling back to no-highlight mode for this block.",Me)),Xt?xt[1]:"no-highlight"}return Xe.split(/\s+/).find(Xt=>tt(Xt)||tn(Xt))}function Gt(Me,Xe,xt){let Xt="",Un="";typeof Xe=="object"?(Xt=Me,xt=Xe.ignoreIllegals,Un=Xe.language):(Se("10.7.0","highlight(lang, code, ...args) has been deprecated."),Se("10.7.0",`Please use highlight(code, options) instead.
|
|
377
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),Un=Me,Xt=Xe),xt===void 0&&(xt=!0);const xi={code:Xt,language:Un};da("before:highlight",xi);const Yi=xi.result?xi.result:fa(xi.language,xi.code,xt);return Yi.code=xi.code,da("after:highlight",Yi),Yi}function fa(Me,Xe,xt,Xt){const Un=Object.create(null);function xi(ze,qe){return ze.keywords[qe]}function Yi(){if(!it.keywords){jn.addText(rn);return}let ze=0;it.keywordPatternRe.lastIndex=0;let qe=it.keywordPatternRe.exec(rn),mt="";for(;qe;){mt+=rn.substring(ze,qe.index);const Nt=oi.case_insensitive?qe[0].toLowerCase():qe[0],An=xi(it,Nt);if(An){const[Hr,dc]=An;if(jn.addText(mt),mt="",Un[Nt]=(Un[Nt]||0)+1,Un[Nt]<=Oa&&(cs+=dc),Hr.startsWith("_"))mt+=qe[0];else{const hu=oi.classNameAliases[Hr]||Hr;or(qe[0],hu)}}else mt+=qe[0];ze=it.keywordPatternRe.lastIndex,qe=it.keywordPatternRe.exec(rn)}mt+=rn.substring(ze),jn.addText(mt)}function Ti(){if(rn==="")return;let ze=null;if(typeof it.subLanguage=="string"){if(!we[it.subLanguage]){jn.addText(rn);return}ze=fa(it.subLanguage,rn,!0,vo[it.subLanguage]),vo[it.subLanguage]=ze._top}else ze=qi(rn,it.subLanguage.length?it.subLanguage:null);it.relevance>0&&(cs+=ze.relevance),jn.__addSublanguage(ze._emitter,ze.language)}function un(){it.subLanguage!=null?Ti():Yi(),rn=""}function or(ze,qe){ze!==""&&(jn.startScope(qe),jn.addText(ze),jn.endScope())}function xo(ze,qe){let mt=1;const Nt=qe.length-1;for(;mt<=Nt;){if(!ze._emit[mt]){mt++;continue}const An=oi.classNameAliases[ze[mt]]||ze[mt],Hr=qe[mt];An?or(Hr,An):(rn=Hr,Yi(),rn=""),mt++}}function ha(ze,qe){return ze.scope&&typeof ze.scope=="string"&&jn.openNode(oi.classNameAliases[ze.scope]||ze.scope),ze.beginScope&&(ze.beginScope._wrap?(or(rn,oi.classNameAliases[ze.beginScope._wrap]||ze.beginScope._wrap),rn=""):ze.beginScope._multi&&(xo(ze.beginScope,qe),rn="")),it=Object.create(ze,{parent:{value:it}}),it}function Cl(ze,qe,mt){let Nt=R(ze.endRe,mt);if(Nt){if(ze["on:end"]){const An=new e(ze);ze["on:end"](qe,An),An.isMatchIgnored&&(Nt=!1)}if(Nt){for(;ze.endsParent&&ze.parent;)ze=ze.parent;return ze}}if(ze.endsWithParent)return Cl(ze.parent,qe,mt)}function za(ze){return it.matcher.regexIndex===0?(rn+=ze[0],1):(Hs=!0,0)}function uc(ze){const qe=ze[0],mt=ze.rule,Nt=new e(mt),An=[mt.__beforeBegin,mt["on:begin"]];for(const Hr of An)if(Hr&&(Hr(ze,Nt),Nt.isMatchIgnored))return za(qe);return mt.skip?rn+=qe:(mt.excludeBegin&&(rn+=qe),un(),!mt.returnBegin&&!mt.excludeBegin&&(rn=qe)),ha(mt,ze),mt.returnBegin?0:qe.length}function Di(ze){const qe=ze[0],mt=Xe.substring(ze.index),Nt=Cl(it,ze,mt);if(!Nt)return as;const An=it;it.endScope&&it.endScope._wrap?(un(),or(qe,it.endScope._wrap)):it.endScope&&it.endScope._multi?(un(),xo(it.endScope,ze)):An.skip?rn+=qe:(An.returnEnd||An.excludeEnd||(rn+=qe),un(),An.excludeEnd&&(rn=qe));do it.scope&&jn.closeNode(),!it.skip&&!it.subLanguage&&(cs+=it.relevance),it=it.parent;while(it!==Nt.parent);return Nt.starts&&ha(Nt.starts,ze),An.returnEnd?0:qe.length}function ls(){const ze=[];for(let qe=it;qe!==oi;qe=qe.parent)qe.scope&&ze.unshift(qe.scope);ze.forEach(qe=>jn.openNode(qe))}let os={};function js(ze,qe){const mt=qe&&qe[0];if(rn+=ze,mt==null)return un(),0;if(os.type==="begin"&&qe.type==="end"&&os.index===qe.index&&mt===""){if(rn+=Xe.slice(qe.index,qe.index+1),!Jt){const Nt=new Error(`0 width match regex (${Me})`);throw Nt.languageName=Me,Nt.badRule=os.rule,Nt}return 1}if(os=qe,qe.type==="begin")return uc(qe);if(qe.type==="illegal"&&!xt){const Nt=new Error('Illegal lexeme "'+mt+'" for mode "'+(it.scope||"<unnamed>")+'"');throw Nt.mode=it,Nt}else if(qe.type==="end"){const Nt=Di(qe);if(Nt!==as)return Nt}if(qe.type==="illegal"&&mt==="")return rn+=`
|
|
378
|
+
`,1;if(fc>1e5&&fc>qe.index*3)throw new Error("potential infinite loop, way more iterations than matches");return rn+=mt,mt.length}const oi=tn(Me);if(!oi)throw hn(en.replace("{}",Me)),new Error('Unknown language: "'+Me+'"');const du=xn(oi);let Ba="",it=Xt||du;const vo={},jn=new Pe.__emitter(Pe);ls();let rn="",cs=0,us=0,fc=0,Hs=!1;try{if(oi.__emitTokens)oi.__emitTokens(Xe,jn);else{for(it.matcher.considerAll();;){fc++,Hs?Hs=!1:it.matcher.considerAll(),it.matcher.lastIndex=us;const ze=it.matcher.exec(Xe);if(!ze)break;const qe=Xe.substring(us,ze.index),mt=js(qe,ze);us=ze.index+mt}js(Xe.substring(us))}return jn.finalize(),Ba=jn.toHTML(),{language:Me,value:Ba,relevance:cs,illegal:!1,_emitter:jn,_top:it}}catch(ze){if(ze.message&&ze.message.includes("Illegal"))return{language:Me,value:Qn(Xe),illegal:!0,relevance:0,_illegalBy:{message:ze.message,index:us,context:Xe.slice(us-100,us+100),mode:ze.mode,resultSoFar:Ba},_emitter:jn};if(Jt)return{language:Me,value:Qn(Xe),illegal:!1,relevance:0,errorRaised:ze,_emitter:jn,_top:it};throw ze}}function ar(Me){const Xe={value:Qn(Me),illegal:!1,relevance:0,_top:Fe,_emitter:new Pe.__emitter(Pe)};return Xe._emitter.addText(Me),Xe}function qi(Me,Xe){Xe=Xe||Pe.languages||Object.keys(we);const xt=ar(Me),Xt=Xe.filter(tn).filter(lr).map(un=>fa(un,Me,!1));Xt.unshift(xt);const Un=Xt.sort((un,or)=>{if(un.relevance!==or.relevance)return or.relevance-un.relevance;if(un.language&&or.language){if(tn(un.language).supersetOf===or.language)return 1;if(tn(or.language).supersetOf===un.language)return-1}return 0}),[xi,Yi]=Un,Ti=xi;return Ti.secondBest=Yi,Ti}function sr(Me,Xe,xt){const Xt=Xe&&Be[Xe]||xt;Me.classList.add("hljs"),Me.classList.add(`language-${Xt}`)}function yt(Me){let Xe=null;const xt=Cn(Me);if(tt(xt))return;if(da("before:highlightElement",{el:Me,language:xt}),Me.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Me);return}if(Me.children.length>0&&(Pe.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(Me)),Pe.throwUnescapedHTML))throw new Fi("One of your code blocks includes unescaped HTML.",Me.innerHTML);Xe=Me;const Xt=Xe.textContent,Un=xt?Gt(Xt,{language:xt,ignoreIllegals:!0}):qi(Xt);Me.innerHTML=Un.value,Me.dataset.highlighted="yes",sr(Me,xt,Un.language),Me.result={language:Un.language,re:Un.relevance,relevance:Un.relevance},Un.secondBest&&(Me.secondBest={language:Un.secondBest.language,relevance:Un.secondBest.relevance}),da("after:highlightElement",{el:Me,result:Un,text:Xt})}function li(Me){Pe=bo(Pe,Me)}const Ur=()=>{wl(),Se("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Us(){wl(),Se("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let El=!1;function wl(){function Me(){wl()}if(document.readyState==="loading"){El||window.addEventListener("DOMContentLoaded",Me,!1),El=!0;return}document.querySelectorAll(Pe.cssSelector).forEach(yt)}function Tl(Me,Xe){let xt=null;try{xt=Xe(ae)}catch(Xt){if(hn("Language definition for '{}' could not be registered.".replace("{}",Me)),Jt)hn(Xt);else throw Xt;xt=Fe}xt.name||(xt.name=Me),we[Me]=xt,xt.rawDefinition=Xe.bind(null,ae),xt.aliases&&nn(xt.aliases,{languageName:Me})}function Da(Me){delete we[Me];for(const Xe of Object.keys(Be))Be[Xe]===Me&&delete Be[Xe]}function Is(){return Object.keys(we)}function tn(Me){return Me=(Me||"").toLowerCase(),we[Me]||we[Be[Me]]}function nn(Me,{languageName:Xe}){typeof Me=="string"&&(Me=[Me]),Me.forEach(xt=>{Be[xt.toLowerCase()]=Xe})}function lr(Me){const Xe=tn(Me);return Xe&&!Xe.disableAutodetect}function Ir(Me){Me["before:highlightBlock"]&&!Me["before:highlightElement"]&&(Me["before:highlightElement"]=Xe=>{Me["before:highlightBlock"](Object.assign({block:Xe.el},Xe))}),Me["after:highlightBlock"]&&!Me["after:highlightElement"]&&(Me["after:highlightElement"]=Xe=>{Me["after:highlightBlock"](Object.assign({block:Xe.el},Xe))})}function Ln(Me){Ir(Me),et.push(Me)}function xr(Me){const Xe=et.indexOf(Me);Xe!==-1&&et.splice(Xe,1)}function da(Me,Xe){const xt=Me;et.forEach(function(Xt){Xt[xt]&&Xt[xt](Xe)})}function jr(Me){return Se("10.7.0","highlightBlock will be removed entirely in v12.0"),Se("10.7.0","Please use highlightElement now."),yt(Me)}Object.assign(ae,{highlight:Gt,highlightAuto:qi,highlightAll:wl,highlightElement:yt,highlightBlock:jr,configure:li,initHighlighting:Ur,initHighlightingOnLoad:Us,registerLanguage:Tl,unregisterLanguage:Da,listLanguages:Is,getLanguage:tn,registerAliases:nn,autoDetection:lr,inherit:bo,addPlugin:Ln,removePlugin:xr}),ae.debugMode=function(){Jt=!1},ae.safeMode=function(){Jt=!0},ae.versionString=Pt,ae.regex={concat:C,lookahead:b,either:w,optional:_,anyNumberOfTimes:v};for(const Me in Re)typeof Re[Me]=="object"&&t(Re[Me]);return Object.assign(ae,Re),ae},bi=ss({});return bi.newInstance=()=>ss({}),mv=bi,bi.HighlightJS=bi,bi.default=bi,mv}var wG=EG();const TG=uu(wG),Z2={},CG="hljs-";function AG(t){const e=TG.newInstance();return t&&s(t),{highlight:n,highlightAuto:i,listLanguages:r,register:s,registerAlias:l,registered:c};function n(d,p,m){const g=m||Z2,b=typeof g.prefix=="string"?g.prefix:CG;if(!e.getLanguage(d))throw new Error("Unknown language: `"+d+"` is not registered");e.configure({__emitter:MG,classPrefix:b});const v=e.highlight(p,{ignoreIllegals:!0,language:d});if(v.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:v.errorRaised});const _=v._emitter.root,C=_.data;return C.language=v.language,C.relevance=v.relevance,_}function i(d,p){const g=(p||Z2).subset||r();let b=-1,v=0,_;for(;++b<g.length;){const C=g[b];if(!e.getLanguage(C))continue;const T=n(C,d,p);T.data&&T.data.relevance!==void 0&&T.data.relevance>v&&(v=T.data.relevance,_=T)}return _||{type:"root",children:[],data:{language:void 0,relevance:v}}}function r(){return e.listLanguages()}function s(d,p){if(typeof d=="string")e.registerLanguage(d,p);else{let m;for(m in d)Object.hasOwn(d,m)&&e.registerLanguage(m,d[m])}}function l(d,p){if(typeof d=="string")e.registerAliases(typeof p=="string"?p:[...p],{languageName:d});else{let m;for(m in d)if(Object.hasOwn(d,m)){const g=d[m];e.registerAliases(typeof g=="string"?g:[...g],{languageName:m})}}}function c(d){return!!e.getLanguage(d)}}class MG{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e==="")return;const n=this.stack[this.stack.length-1],i=n.children[n.children.length-1];i&&i.type==="text"?i.value+=e:n.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,n){const i=this.stack[this.stack.length-1],r=e.root.children;n?i.children.push({type:"element",tagName:"span",properties:{className:[n]},children:r}):i.children.push(...r)}openNode(e){const n=this,i=e.split(".").map(function(l,c){return c?l+"_".repeat(c):n.options.classPrefix+l}),r=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:i},children:[]};r.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const RG={};function NG(t){const e=t||RG,n=e.aliases,i=e.detect||!1,r=e.languages||SG,s=e.plainText,l=e.prefix,c=e.subset;let d="hljs";const p=AG(r);if(n&&p.registerAlias(n),l){const m=l.indexOf("-");d=m===-1?l:l.slice(0,m)}return function(m,g){ob(m,"element",function(b,v,_){if(b.tagName!=="code"||!_||_.type!=="element"||_.tagName!=="pre")return;const C=kG(b);if(C===!1||!C&&!i||C&&s&&s.includes(C))return;Array.isArray(b.properties.className)||(b.properties.className=[]),b.properties.className.includes(d)||b.properties.className.unshift(d);const T=W9(b,{whitespace:"pre"});let w;try{w=C?p.highlight(C,T,{prefix:l}):p.highlightAuto(T,{prefix:l,subset:c})}catch(k){const R=k;if(C&&/Unknown language/.test(R.message)){g.message("Cannot highlight as `"+C+"`, it’s not registered",{ancestors:[_,b],cause:R,place:b.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw R}!C&&w.data&&w.data.language&&b.properties.className.push("language-"+w.data.language),w.children.length>0&&(b.children=w.children)})}}function kG(t){const e=t.properties.className;let n=-1;if(!Array.isArray(e))return;let i;for(;++n<e.length;){const r=String(e[n]);if(r==="no-highlight"||r==="nohighlight")return!1;!i&&r.slice(0,5)==="lang-"&&(i=r.slice(5)),!i&&r.slice(0,9)==="language-"&&(i=r.slice(9))}return i}function OG({text:t}){const[e,n]=U.useState(!1),i=()=>{navigator.clipboard.writeText(t).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)})};return A.jsx("button",{onClick:i,style:{position:"absolute",top:6,right:6,background:"var(--surface-4)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-xs)",color:e?"var(--status-active)":"var(--text-muted)",fontSize:"0.65rem",fontFamily:"var(--font-mono)",padding:"2px 8px",cursor:"pointer",transition:"color var(--duration-fast) var(--ease-out)"},children:e?"Copied!":"Copy"})}function b_({content:t}){return A.jsx("div",{className:"markdown-message",children:A.jsx(RH,{remarkPlugins:[G9],rehypePlugins:[NG],components:{pre({children:e,...n}){const i=Array.isArray(e)?e.find(s=>{var l,c;return(s==null?void 0:s.type)==="code"||((c=(l=s==null?void 0:s.props)==null?void 0:l.node)==null?void 0:c.tagName)==="code"}):e,r=typeof i=="object"&&i!==null&&"props"in i?x_(i.props.children):"";return A.jsxs("div",{style:{position:"relative"},children:[A.jsx(OG,{text:r}),A.jsx("pre",{...n,style:{background:"var(--surface-0)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",padding:"12px 14px",paddingTop:28,margin:"8px 0",overflowX:"auto",fontSize:"0.78rem",lineHeight:1.6,fontFamily:"var(--font-mono)"},children:e})]})},code({className:e,children:n,...i}){return e?A.jsx("code",{className:e,...i,children:n}):A.jsx("code",{...i,style:{background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",padding:"1px 5px",fontSize:"0.82em",fontFamily:"var(--font-mono)",color:"var(--accent)"},children:n})},a({href:e,children:n,...i}){return A.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent)",textDecoration:"none"},...i,children:n})},table({children:e,...n}){return A.jsx("div",{style:{overflowX:"auto",margin:"8px 0"},children:A.jsx("table",{...n,style:{borderCollapse:"collapse",width:"100%",fontSize:"0.82rem"},children:e})})},th({children:e,...n}){return A.jsx("th",{...n,style:{borderBottom:"2px solid var(--border-default)",padding:"6px 10px",textAlign:"left",fontWeight:600,color:"var(--text-primary)"},children:e})},td({children:e,...n}){return A.jsx("td",{...n,style:{borderBottom:"1px solid var(--border-subtle)",padding:"5px 10px",color:"var(--text-secondary)"},children:e})},blockquote({children:e,...n}){return A.jsx("blockquote",{...n,style:{borderLeft:"3px solid var(--accent-dim)",margin:"8px 0",padding:"4px 12px",color:"var(--text-secondary)",background:"rgba(0, 200, 255, 0.04)",borderRadius:"0 var(--radius-xs) var(--radius-xs) 0"},children:e})},hr(){return A.jsx("hr",{style:{border:"none",borderTop:"1px solid var(--border-default)",margin:"12px 0"}})},ul({children:e,...n}){return A.jsx("ul",{...n,style:{paddingLeft:20,margin:"4px 0"},children:e})},ol({children:e,...n}){return A.jsx("ol",{...n,style:{paddingLeft:20,margin:"4px 0"},children:e})},li({children:e,...n}){return A.jsx("li",{...n,style:{marginBottom:2},children:e})},h1({children:e,...n}){return A.jsx("h1",{...n,style:{fontSize:"1.3em",fontWeight:700,margin:"12px 0 6px"},children:e})},h2({children:e,...n}){return A.jsx("h2",{...n,style:{fontSize:"1.15em",fontWeight:600,margin:"10px 0 4px"},children:e})},h3({children:e,...n}){return A.jsx("h3",{...n,style:{fontSize:"1.05em",fontWeight:600,margin:"8px 0 4px"},children:e})},p({children:e,...n}){return A.jsx("p",{...n,style:{margin:"4px 0",lineHeight:1.6},children:e})}},children:t})})}function x_(t){var e;return typeof t=="string"?t:Array.isArray(t)?t.map(x_).join(""):(e=t==null?void 0:t.props)!=null&&e.children?x_(t.props.children):""}function DG({commands:t,filter:e,selectedIndex:n,onSelect:i,visible:r}){const s=U.useRef(null),l=U.useRef(null),c=t.filter(d=>d.command.toLowerCase().includes(e.toLowerCase())||d.description.toLowerCase().includes(e.toLowerCase()));return U.useEffect(()=>{var d;(d=l.current)==null||d.scrollIntoView({block:"nearest"})},[n]),!r||c.length===0?null:A.jsxs("div",{ref:s,style:{position:"absolute",bottom:"100%",left:0,right:0,marginBottom:4,background:"var(--surface-2)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-md)",boxShadow:"var(--shadow-lg)",maxHeight:280,overflowY:"auto",zIndex:100,animation:"fadeInUp 0.15s var(--ease-out) both"},children:[A.jsx("div",{style:{padding:"8px 12px 4px",fontSize:"0.65rem",fontFamily:"var(--font-mono)",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Commands"}),c.map((d,p)=>{const m=p===n;return A.jsxs("div",{ref:m?l:void 0,onClick:()=>i(d),style:{display:"flex",alignItems:"center",gap:10,padding:"8px 12px",cursor:"pointer",background:m?"var(--accent-glow)":"transparent",borderLeft:m?"2px solid var(--accent)":"2px solid transparent",transition:"background var(--duration-fast) var(--ease-out)"},onMouseEnter:g=>{m||(g.currentTarget.style.background="var(--surface-3)")},onMouseLeave:g=>{m||(g.currentTarget.style.background="transparent")},children:[A.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.8rem",fontWeight:600,color:m?"var(--accent)":"var(--text-primary)",whiteSpace:"nowrap"},children:["/",d.command,d.args&&A.jsxs("span",{style:{color:"var(--text-muted)",fontWeight:400},children:[" ",d.args]})]}),A.jsx("span",{style:{fontSize:"0.75rem",color:"var(--text-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.description})]},d.command)})]})}const Q2=[{command:"expxagents",description:"Show main menu"},{command:"expxagents create",args:"[description]",description:"Design a new squad"},{command:"expxagents run",args:"<name>",description:"Execute a squad pipeline"},{command:"expxagents list",description:"List all squads"},{command:"expxagents edit",args:"<name>",description:"Modify a squad"},{command:"expxagents delete",args:"<name>",description:"Delete a squad"},{command:"expxagents skills",description:"Browse skills"},{command:"expxagents install",args:"<name>",description:"Install a skill"},{command:"expxagents uninstall",args:"<name>",description:"Remove a skill"},{command:"expxagents dashboard",description:"Open virtual office"},{command:"expxagents virtual-office",description:"Open virtual office in browser"},{command:"expxagents jarvis",description:"Open Jarvis voice assistant"},{command:"expxagents help",description:"Show help text"}],Jy="_expxagents",Qc=[.72,.78,.85,.95,1.08,1.2],zG=2;function BG({file:t,onRemove:e}){return A.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:4,background:"var(--surface-3)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-xs)",padding:"2px 8px",fontSize:"0.72rem",fontFamily:"var(--font-mono)",color:"var(--accent)",maxWidth:180},children:[A.jsx("span",{style:{opacity:.6},children:"📎"}),A.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.name}),A.jsx("button",{onClick:e,style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",padding:0,fontSize:"0.8rem",lineHeight:1},"aria-label":`Remove ${t.name}`,children:"×"})]})}function LG({message:t,fontSize:e}){if(t.role==="agent_dm")return A.jsxs("div",{"data-role":"agent_dm",style:{alignSelf:"flex-start",background:"var(--surface-3)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-md)",padding:"10px 14px",maxWidth:"85%",marginBottom:"var(--sp-2)",animation:"fadeInUp 0.3s var(--ease-out) both"},children:[A.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--accent)",fontWeight:600,marginBottom:4,letterSpacing:"0.02em"},children:t.agentName}),A.jsx("div",{style:{color:"var(--text-primary)",fontSize:`${e}rem`,lineHeight:1.55},children:A.jsx(b_,{content:t.content})})]});const n=t.role==="user";return A.jsx("div",{"data-role":t.role,style:{alignSelf:n?"flex-end":"flex-start",background:n?"var(--user-bubble)":"var(--agent-bubble)",border:n?"1px solid rgba(100, 160, 255, 0.15)":"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"10px 14px",maxWidth:n?"75%":"85%",marginBottom:"var(--sp-2)",animation:"fadeInUp 0.3s var(--ease-out) both"},children:A.jsx("div",{style:{color:"var(--text-primary)",fontSize:`${e}rem`,lineHeight:1.55},children:n?A.jsx("span",{style:{whiteSpace:"pre-wrap"},children:t.content}):A.jsx(b_,{content:t.content})})})}function UG({conv:t,isActive:e,onSelect:n,onDelete:i}){const[r,s]=U.useState(!1),l=new Date(t.createdAt),c=l.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),d=l.toLocaleDateString([],{day:"2-digit",month:"2-digit"});return A.jsxs("div",{onClick:n,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),style:{padding:"8px 10px",borderRadius:"var(--radius-sm)",cursor:"pointer",background:e?"var(--accent-glow)":r?"var(--surface-3)":"transparent",border:e?"1px solid rgba(0, 200, 255, 0.12)":"1px solid transparent",transition:"all var(--duration-fast) var(--ease-out)",display:"flex",alignItems:"center",gap:8},children:[A.jsxs("div",{style:{flex:1,minWidth:0},children:[A.jsx("div",{style:{fontSize:"0.72rem",fontFamily:"var(--font-mono)",color:e?"var(--accent)":"var(--text-secondary)",fontWeight:e?600:400,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.preview||"New conversation"}),A.jsxs("div",{style:{fontSize:"0.6rem",fontFamily:"var(--font-mono)",color:"var(--text-muted)",marginTop:2},children:[d," ",c]})]}),r&&A.jsx("button",{onClick:p=>{p.stopPropagation(),i()},title:"Delete conversation","aria-label":"Delete conversation",style:{background:"none",border:"none",color:"var(--status-error)",cursor:"pointer",padding:"2px 4px",fontSize:"0.75rem",lineHeight:1,opacity:.7,flexShrink:0},children:"×"})]})}function IG(){const[t,e]=U.useState(""),[n,i]=U.useState([]),[r,s]=U.useState(zG),[l,c]=U.useState(!1),[d,p]=U.useState(""),[m,g]=U.useState(0),b=U.useRef(null),v=U.useRef(null),_=U.useRef(null),C=U.useRef(null),T=nr(se=>se.conversations),w=nr(se=>se.conversationId),k=nr(se=>se.messages),R=nr(se=>se.streaming),O=nr(se=>se.streamingText),j=nr(se=>se.activity),D=nr(se=>se.error),F=nr(se=>se.addUserMessage),$=nr(se=>se.startStreaming),P=nr(se=>se.loadHistory),I=nr(se=>se.selectConversation),K=nr(se=>se.deleteConversation);U.useEffect(()=>{P(Jy)},[P]),U.useEffect(()=>{var se,ge;(ge=(se=b.current)==null?void 0:se.scrollIntoView)==null||ge.call(se,{behavior:"smooth"})},[k,O]);const G=U.useCallback(()=>{const se=v.current;se&&(se.style.height="auto",se.style.height=Math.min(se.scrollHeight,200)+"px")},[]);U.useEffect(()=>{G()},[t,G]);const te=U.useCallback(se=>{if(se.startsWith("/")){const ge=se.slice(1);p(ge),c(!0),g(0)}else c(!1)},[]),H=U.useCallback(()=>Q2.filter(se=>se.command.toLowerCase().includes(d.toLowerCase())||se.description.toLowerCase().includes(d.toLowerCase())),[d]),W=U.useCallback(se=>{var ge;e("/"+se.command+(se.args?" ":"")),c(!1),(ge=v.current)==null||ge.focus()},[]),B=U.useCallback(()=>{R||CD(Jy)},[R]),X=U.useCallback(se=>{R||K(se,Jy)},[R,K]),Z=U.useCallback(se=>{R||se===w||I(se)},[R,w,I]),Q=U.useCallback(()=>{const se=t.trim();!se||R||(F(se),$(),kC(Jy,se,n.length>0?n:void 0),e(""),i([]),c(!1),v.current&&(v.current.style.height="auto"))},[t,R,n,F,$]),q=U.useCallback(se=>{if(l){const ge=H();if(se.key==="ArrowDown"){se.preventDefault(),g(le=>Math.min(le+1,ge.length-1));return}if(se.key==="ArrowUp"){se.preventDefault(),g(le=>Math.max(le-1,0));return}if(se.key==="Enter"&&!se.shiftKey){se.preventDefault(),ge[m]&&W(ge[m]);return}if(se.key==="Escape"){se.preventDefault(),c(!1);return}if(se.key==="Tab"){se.preventDefault(),ge[m]&&W(ge[m]);return}}se.key==="Enter"&&!se.shiftKey&&(se.preventDefault(),Q())},[l,H,m,W,Q]),Y=U.useCallback(se=>{const ge=se.target.value;e(ge),te(ge)},[te]),ee=U.useCallback(async se=>{var le;if(!se)return;const ge=[];for(const Re of Array.from(se))if(!(Re.size>512e3))try{const Ie=await Re.text();ge.push({name:Re.name,content:Ie})}catch{}i(Re=>[...Re,...ge]),(le=v.current)==null||le.focus()},[]),V=U.useCallback(se=>{se.preventDefault(),se.stopPropagation(),ee(se.dataTransfer.files)},[ee]),oe=U.useCallback(se=>{se.preventDefault(),se.stopPropagation()},[]),be=U.useCallback(se=>{i(ge=>ge.filter((le,Re)=>Re!==se))},[]),ve=t.trim()&&!R;return A.jsxs("div",{style:{display:"flex",height:"100%"},onDrop:V,onDragOver:oe,children:[A.jsxs("div",{style:{width:220,borderRight:"1px solid var(--border-subtle)",background:"var(--surface-1)",display:"flex",flexDirection:"column",flexShrink:0},children:[A.jsx("div",{style:{padding:"var(--sp-2)"},children:A.jsx("button",{onClick:B,disabled:R,"aria-label":"New conversation",style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:6,padding:"8px 10px",background:"var(--accent-glow)",border:"1px solid rgba(0, 200, 255, 0.15)",borderRadius:"var(--radius-sm)",color:"var(--accent)",cursor:R?"not-allowed":"pointer",fontFamily:"var(--font-mono)",fontSize:"0.72rem",fontWeight:600,letterSpacing:"0.02em",opacity:R?.5:1,transition:"all var(--duration-fast) var(--ease-out)"},children:"+ New Chat"})}),A.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"0 var(--sp-2) var(--sp-2)",display:"flex",flexDirection:"column",gap:2},children:[T.length===0&&A.jsx("div",{style:{padding:"var(--sp-4) var(--sp-2)",textAlign:"center",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)"},children:"No conversations yet"}),T.map(se=>A.jsx(UG,{conv:se,isActive:se.id===w,onSelect:()=>Z(se.id),onDelete:()=>X(se.id)},se.id))]})]}),A.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[A.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",padding:"4px var(--sp-4)",borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-1)",gap:2},children:[A.jsx("button",{onClick:()=>s(se=>Math.max(se-1,0)),disabled:r===0,title:"Decrease font size","aria-label":"Decrease font size",style:{background:"none",border:"1px solid var(--border-default)",borderRadius:"var(--radius-xs)",color:r===0?"var(--text-muted)":"var(--text-secondary)",cursor:r===0?"not-allowed":"pointer",padding:"2px 7px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",fontWeight:700,lineHeight:1.4,opacity:r===0?.35:.7},children:"A-"}),A.jsx("button",{onClick:()=>s(se=>Math.min(se+1,Qc.length-1)),disabled:r===Qc.length-1,title:"Increase font size","aria-label":"Increase font size",style:{background:"none",border:"1px solid var(--border-default)",borderRadius:"var(--radius-xs)",color:r===Qc.length-1?"var(--text-muted)":"var(--text-secondary)",cursor:r===Qc.length-1?"not-allowed":"pointer",padding:"2px 7px",fontFamily:"var(--font-mono)",fontSize:"0.8rem",fontWeight:700,lineHeight:1.4,opacity:r===Qc.length-1?.35:.7},children:"A+"})]}),A.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"var(--sp-4)",display:"flex",flexDirection:"column"},children:[k.length===0&&!R&&A.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flex:1,gap:"var(--sp-3)",opacity:.6},children:[A.jsx("div",{style:{width:48,height:48,borderRadius:"var(--radius-md)",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.2rem",color:"var(--accent)"},children:"EX"}),A.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.82rem",fontFamily:"var(--font-display)"},children:"ExpxAgents Terminal"}),A.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.7rem",fontFamily:"var(--font-mono)"},children:"Type / to see available commands"})]}),k.map(se=>A.jsx(LG,{message:se,fontSize:Qc[r]},se.id)),R&&O&&A.jsx("div",{"data-role":"assistant",style:{alignSelf:"flex-start",background:"var(--agent-bubble)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"10px 14px",maxWidth:"85%",marginBottom:"var(--sp-2)"},children:A.jsxs("div",{style:{color:"var(--text-primary)",fontSize:`${Qc[r]}rem`,lineHeight:1.55},children:[A.jsx(b_,{content:O}),A.jsx("span",{style:{display:"inline-block",width:6,height:14,background:"var(--accent)",marginLeft:2,animation:"pulse 1s ease-in-out infinite",borderRadius:1,verticalAlign:"text-bottom"}})]})}),R&&!O&&A.jsx("div",{style:{alignSelf:"flex-start",display:"flex",flexDirection:"column",gap:4,padding:"10px 14px",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:A.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[A.jsx("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:"var(--accent)",animation:"pulse 1s ease-in-out infinite"}}),j||"Thinking..."]})}),D&&A.jsx("div",{style:{alignSelf:"center",background:"var(--status-error-glow)",border:"1px solid rgba(255, 64, 112, 0.25)",borderRadius:"var(--radius-sm)",padding:"8px 14px",color:"var(--status-error)",fontFamily:"var(--font-mono)",fontSize:"0.78rem",marginBottom:"var(--sp-2)"},children:D}),A.jsx("div",{ref:b})]}),A.jsxs("div",{ref:C,style:{borderTop:"1px solid var(--border-subtle)",background:"var(--surface-1)",position:"relative"},children:[A.jsx("div",{style:{position:"relative",padding:"0 var(--sp-4)"},children:A.jsx(DG,{commands:Q2,filter:d,selectedIndex:m,onSelect:W,visible:l})}),n.length>0&&A.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,padding:"var(--sp-2) var(--sp-4) 0"},children:n.map((se,ge)=>A.jsx(BG,{file:se,onRemove:()=>be(ge)},`${se.name}-${ge}`))}),A.jsxs("div",{style:{display:"flex",padding:"var(--sp-3) var(--sp-4)",gap:"var(--sp-2)",alignItems:"flex-end"},children:[A.jsx("button",{onClick:()=>{var se;return(se=_.current)==null?void 0:se.click()},disabled:R,title:"Attach files (text only, max 500KB)",style:{background:"none",border:"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",color:"var(--text-muted)",cursor:R?"not-allowed":"pointer",padding:"6px 8px",fontSize:"1rem",lineHeight:1,opacity:R?.4:.7,transition:"opacity var(--duration-fast) var(--ease-out)",flexShrink:0},"aria-label":"Attach file",children:"📎"}),A.jsx("input",{ref:_,type:"file",multiple:!0,style:{display:"none"},onChange:se=>ee(se.target.files)}),A.jsx("textarea",{ref:v,className:"input",value:t,onChange:Y,onKeyDown:q,placeholder:"Type a message... (/ for commands)",disabled:R,rows:1,style:{flex:1,resize:"none",overflow:"hidden",minHeight:36,maxHeight:200,lineHeight:1.5,fontFamily:"var(--font-mono)",fontSize:`${Qc[r]}rem`}}),A.jsx("button",{onClick:Q,disabled:!ve,"aria-label":"Send",className:ve?"btn btn-accent":"btn",style:{padding:"0 var(--sp-5)",cursor:ve?"pointer":"not-allowed",opacity:ve?1:.4,flexShrink:0,height:36},children:"Send"})]})]})]})]})}const jG={planned:"var(--status-idle)",executing:"var(--accent)",done:"var(--status-active)"},HG={planned:"planejado",executing:"executando",done:"finalizado"};function PG({task:t,selected:e,onClick:n,onDelete:i}){const r=jG[t.status],s=t.status==="executing",l=d=>{d.dataTransfer.setData("text/plain",`task:${t.id}`),d.dataTransfer.effectAllowed="move",d.currentTarget.style.opacity="0.5"},c=d=>{d.currentTarget.style.opacity="1"};return A.jsxs("div",{draggable:!0,onDragStart:l,onDragEnd:c,onClick:()=>n==null?void 0:n(t),"data-testid":`task-card-${t.id}`,style:{background:e?"var(--surface-4)":"var(--surface-3)",borderRadius:"var(--radius-sm)",padding:"12px 14px",marginBottom:"var(--sp-2)",border:"1px solid",borderColor:e?"var(--accent)":s?r:"var(--border-subtle)",transition:"border-color var(--duration-fast) var(--ease-out), opacity 0.15s ease",cursor:"pointer"},children:[A.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:6},children:[A.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",fontWeight:600,color:r,padding:"2px 8px",borderRadius:"var(--radius-full)",border:`1px solid ${r}`,letterSpacing:"0.02em"},children:HG[t.status]}),i&&A.jsx("button",{onClick:d=>{d.stopPropagation(),i(t.id)},style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontSize:"0.7rem",padding:"0 2px",lineHeight:1,opacity:.5,transition:"opacity 0.15s, color 0.15s"},onMouseEnter:d=>{d.currentTarget.style.opacity="1",d.currentTarget.style.color="var(--status-error)"},onMouseLeave:d=>{d.currentTarget.style.opacity="0.5",d.currentTarget.style.color="var(--text-muted)"},title:"Delete task",children:"✕"})]}),A.jsx("div",{style:{fontWeight:600,fontSize:"0.82rem",color:"var(--text-primary)",marginBottom:t.description?6:0,lineHeight:1.4},children:t.title}),t.description&&A.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-secondary)",lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.description}),t.result&&A.jsxs("div",{style:{marginTop:6,fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--status-active)",display:"flex",alignItems:"center",gap:4},children:[A.jsx("span",{style:{width:5,height:5,borderRadius:"50%",background:"var(--status-active)",display:"inline-block"}}),"has output"]})]})}const XR=[{key:"planned",label:"Planejado",color:"var(--status-idle)",glow:"none"},{key:"executing",label:"Executando",color:"var(--accent)",glow:"var(--accent-glow)"},{key:"done",label:"Finalizado",color:"var(--status-active)",glow:"var(--status-active-glow)"}];function e0(t){if(!t)return"—";const e=new Date(t);return e.toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit",year:"2-digit"})+" "+e.toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit"})}function GG(){const t=Ja(G=>G.squads),e=Ja(G=>G.activeStates),[n,i]=U.useState(null),[r,s]=U.useState(""),[l,c]=U.useState([]),[d,p]=U.useState(null),[m,g]=U.useState(""),[b,v]=U.useState(""),[_,C]=U.useState(null),[T,w]=U.useState(null),k=n;U.useEffect(()=>{if(!k){c([]),w(null);return}fetch(`/api/kanban/${k}/tasks`,{credentials:"include"}).then(G=>G.json()).then(G=>c(Array.isArray(G)?G:[])).catch(()=>c([]))},[k]);const R=U.useMemo(()=>XR.map(G=>({...G,tasks:l.filter(te=>te.status===G.key).sort((te,H)=>te.position-H.position)})),[l]),O=t.filter(G=>{if(!r)return!0;const te=r.toLowerCase();return G.name.toLowerCase().includes(te)||G.code.toLowerCase().includes(te)}),j=U.useCallback(async G=>{if(!k||!m.trim())return;const te=await fetch(`/api/kanban/${k}/tasks`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:m.trim(),description:b.trim()||void 0,status:G})});if(te.ok){const H=await te.json();c(W=>[...W,H]),g(""),v(""),p(null)}},[k,m,b]),D=U.useCallback(async G=>{if(!k)return;(await fetch(`/api/kanban/${k}/tasks/${G}`,{method:"DELETE",credentials:"include"})).ok&&(c(H=>H.filter(W=>W.id!==G)),(T==null?void 0:T.id)===G&&w(null))},[k,T]),F=U.useCallback(async(G,te)=>{if(!k)return;const H=l.find(B=>B.id===G);if(!H||H.status===te)return;c(B=>B.map(X=>X.id===G?{...X,status:te}:X));const W=await fetch(`/api/kanban/${k}/tasks/${G}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:te})});if(W.ok){const B=await W.json();c(X=>X.map(Z=>Z.id===G?B:Z)),(T==null?void 0:T.id)===G&&w(B),te==="executing"&&kC(k,`Execute a seguinte tarefa do kanban: ${H.title}${H.description?" — "+H.description:""}`)}else c(B=>B.map(X=>X.id===G?H:X))},[k,l,T]),$=U.useCallback(async(G,te)=>{if(!k)return;const H=await fetch(`/api/kanban/${k}/tasks/${G}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({result:te})});if(H.ok){const W=await H.json();c(B=>B.map(X=>X.id===G?W:X)),w(W)}},[k]),P=U.useCallback((G,te)=>{G.preventDefault(),G.dataTransfer.dropEffect="move",C(te)},[]),I=U.useCallback(()=>{C(null)},[]),K=U.useCallback((G,te)=>{G.preventDefault(),C(null);const H=G.dataTransfer.getData("text/plain");if(!H.startsWith("task:"))return;const W=H.replace("task:","");F(W,te)},[F]);return A.jsxs("div",{style:{display:"flex",height:"100%",overflow:"hidden"},children:[A.jsxs("div",{style:{width:240,minWidth:240,borderRight:"1px solid var(--border-subtle)",background:"var(--surface-1)",display:"flex",flexDirection:"column",overflow:"hidden"},children:[A.jsx("div",{style:{padding:"12px 14px",fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.1em",borderBottom:"1px solid var(--border-subtle)"},children:"Squads"}),A.jsx("div",{style:{padding:"8px 10px",borderBottom:"1px solid var(--border-subtle)"},children:A.jsx("input",{type:"text",placeholder:"Search squads...",value:r,onChange:G=>s(G.target.value),style:{width:"100%",padding:"5px 8px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",outline:"none"}})}),A.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"6px 8px"},children:[O.map(G=>{var W;const te=G.code===k,H=!!e[G.code];return A.jsxs("button",{onClick:()=>{i(G.code),w(null)},style:{width:"100%",background:te?"var(--accent-glow)":"none",border:te?"1px solid rgba(0, 200, 255, 0.12)":"1px solid transparent",borderRadius:"var(--radius-sm)",padding:"8px 10px",display:"flex",alignItems:"center",gap:8,cursor:"pointer",textAlign:"left",marginBottom:2},children:[A.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:H?"var(--status-active)":"var(--status-idle)",flexShrink:0}}),A.jsxs("div",{style:{overflow:"hidden"},children:[A.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",fontWeight:te?600:400,color:te?"var(--accent)":"var(--text-primary)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:G.name}),A.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)"},children:[((W=G.agents)==null?void 0:W.length)||0," agents"]})]})]},G.code)}),O.length===0&&A.jsx("div",{style:{padding:"16px 10px",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-muted)",textAlign:"center"},children:"No squads found"})]})]}),A.jsx("div",{style:{flex:1,overflow:"hidden",display:"flex",flexDirection:"column"},children:k?A.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[A.jsx("div",{style:{display:"flex",gap:"var(--sp-4)",padding:"var(--sp-5)",flex:1,overflow:"auto"},children:R.map((G,te)=>{const H=_===G.key;return A.jsxs("div",{"data-testid":`column-${G.key}`,onDragOver:W=>P(W,G.key),onDragLeave:I,onDrop:W=>K(W,G.key),style:{flex:1,background:H?"rgba(0, 200, 255, 0.04)":"var(--surface-2)",border:H?"1px dashed var(--accent)":"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-4)",display:"flex",flexDirection:"column",minWidth:220,animation:`fadeInUp 0.4s var(--ease-out) ${te*80}ms both`,transition:"background 0.15s ease, border-color 0.15s ease"},children:[A.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"var(--sp-4)",paddingBottom:"var(--sp-3)",borderBottom:`2px solid ${G.color}`},children:[A.jsx("span",{style:{fontWeight:600,fontSize:"0.82rem",color:"var(--text-primary)"},children:G.label}),A.jsx("span",{"data-testid":`count-${G.key}`,style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",fontWeight:700,color:G.color,background:G.glow,width:22,height:22,borderRadius:"var(--radius-full)",display:"flex",alignItems:"center",justifyContent:"center",border:`1px solid ${G.color}`},children:G.tasks.length})]}),A.jsx("div",{style:{flex:1,overflowY:"auto"},children:G.tasks.map(W=>A.jsx(PG,{task:W,selected:(T==null?void 0:T.id)===W.id,onClick:w,onDelete:D},W.id))}),d===G.key?A.jsxs("div",{style:{marginTop:"var(--sp-3)",background:"var(--surface-3)",borderRadius:"var(--radius-sm)",padding:"10px 12px",border:"1px solid var(--border-default)"},children:[A.jsx("input",{type:"text",placeholder:"Title",value:m,onChange:W=>g(W.target.value),autoFocus:!0,onKeyDown:W=>{W.key==="Enter"&&m.trim()&&j(G.key),W.key==="Escape"&&(p(null),g(""),v(""))},style:{width:"100%",padding:"5px 8px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:"var(--font-display)",fontSize:"0.82rem",fontWeight:600,outline:"none",marginBottom:6}}),A.jsx("textarea",{placeholder:"Description (optional)",value:b,onChange:W=>v(W.target.value),onKeyDown:W=>{W.key==="Escape"&&(p(null),g(""),v(""))},rows:2,style:{width:"100%",padding:"5px 8px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",background:"var(--surface-0)",color:"var(--text-secondary)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",outline:"none",resize:"none",marginBottom:8}}),A.jsxs("div",{style:{display:"flex",gap:6},children:[A.jsx("button",{onClick:()=>j(G.key),disabled:!m.trim(),style:{background:m.trim()?"var(--accent)":"var(--surface-4)",border:"none",borderRadius:"var(--radius-xs)",padding:"4px 12px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",fontWeight:600,color:m.trim()?"var(--text-inverse)":"var(--text-muted)",cursor:m.trim()?"pointer":"default"},children:"Add"}),A.jsx("button",{onClick:()=>{p(null),g(""),v("")},style:{background:"none",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",padding:"4px 12px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-secondary)",cursor:"pointer"},children:"Cancel"})]})]}):A.jsx("button",{"data-testid":`add-task-${G.key}`,onClick:()=>{p(G.key),g(""),v("")},style:{marginTop:"var(--sp-3)",width:"100%",background:"none",border:"1px dashed var(--border-default)",borderRadius:"var(--radius-sm)",padding:"8px",fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-muted)",cursor:"pointer",transition:"all 0.15s ease"},onMouseEnter:W=>{W.currentTarget.style.borderColor="var(--accent-dim)",W.currentTarget.style.color="var(--accent)"},onMouseLeave:W=>{W.currentTarget.style.borderColor="var(--border-default)",W.currentTarget.style.color="var(--text-muted)"},children:"+ New Task"})]},G.key)})}),T&&A.jsx(FG,{task:T,onClose:()=>w(null),onMove:F,onUpdateResult:$})]}):A.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"var(--sp-3)",animation:"fadeIn 0.5s var(--ease-out) both"},children:[A.jsx("span",{style:{fontSize:"1.5rem",color:"var(--text-muted)",opacity:.4},children:"▦"}),A.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.85rem"},children:"Select a squad to view the kanban"})]})})]})}function FG({task:t,onClose:e,onMove:n,onUpdateResult:i}){const[r,s]=U.useState(!1),[l,c]=U.useState(t.result||"");U.useEffect(()=>{c(t.result||""),s(!1)},[t.id,t.result]);const d=()=>{i(t.id,l),s(!1)},p=t.status==="planned"?"var(--status-idle)":t.status==="executing"?"var(--accent)":"var(--status-active)";return A.jsxs("div",{"data-testid":"task-detail-panel",style:{width:360,minWidth:360,borderLeft:"1px solid var(--border-subtle)",background:"var(--surface-1)",display:"flex",flexDirection:"column",overflow:"hidden",animation:"slideInRight 0.2s var(--ease-out) both"},children:[A.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid var(--border-subtle)"},children:[A.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",fontWeight:600,color:p,padding:"2px 10px",borderRadius:"var(--radius-full)",border:`1px solid ${p}`,textTransform:"uppercase"},children:t.status==="planned"?"planejado":t.status==="executing"?"executando":"finalizado"}),A.jsx("button",{onClick:e,style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontSize:"1rem",padding:"0 4px"},children:"✕"})]}),A.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"16px"},children:[A.jsx("h3",{style:{fontFamily:"var(--font-display)",fontSize:"1rem",fontWeight:700,color:"var(--text-primary)",marginBottom:8,lineHeight:1.3},children:t.title}),t.description&&A.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.78rem",color:"var(--text-secondary)",lineHeight:1.5,marginBottom:16},children:t.description}),A.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,marginBottom:20,padding:"12px",background:"var(--surface-2)",borderRadius:"var(--radius-sm)"},children:[A.jsxs("div",{children:[A.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.58rem",color:"var(--text-muted)",textTransform:"uppercase",marginBottom:2},children:"Created"}),A.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-secondary)"},children:e0(t.created_at)})]}),A.jsxs("div",{children:[A.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.58rem",color:"var(--text-muted)",textTransform:"uppercase",marginBottom:2},children:"Started"}),A.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-secondary)"},children:e0(t.started_at)})]}),A.jsxs("div",{children:[A.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.58rem",color:"var(--text-muted)",textTransform:"uppercase",marginBottom:2},children:"Finished"}),A.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-secondary)"},children:e0(t.finished_at)})]}),A.jsxs("div",{children:[A.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.58rem",color:"var(--text-muted)",textTransform:"uppercase",marginBottom:2},children:"Updated"}),A.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-secondary)"},children:e0(t.updated_at)})]})]}),A.jsxs("div",{style:{marginBottom:20},children:[A.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:8},children:"Move to"}),A.jsx("div",{style:{display:"flex",gap:6},children:XR.filter(m=>m.key!==t.status).map(m=>A.jsx("button",{"data-testid":`move-to-${m.key}`,onClick:()=>n(t.id,m.key),style:{flex:1,background:"var(--surface-3)",border:`1px solid ${m.color}`,borderRadius:"var(--radius-xs)",padding:"6px 10px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",fontWeight:600,color:m.color,cursor:"pointer",transition:"all 0.15s ease"},onMouseEnter:g=>{g.currentTarget.style.background=m.glow!=="none"?m.glow:"var(--surface-4)"},onMouseLeave:g=>{g.currentTarget.style.background="var(--surface-3)"},children:m.label},m.key))})]}),A.jsxs("div",{children:[A.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:[A.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em"},children:"Output / Result"}),!r&&A.jsx("button",{onClick:()=>{s(!0),c(t.result||"")},style:{background:"none",border:"none",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--accent-dim)",cursor:"pointer"},children:t.result?"edit":"+ add"})]}),r?A.jsxs("div",{children:[A.jsx("textarea",{value:l,onChange:m=>c(m.target.value),autoFocus:!0,rows:8,style:{width:"100%",padding:"10px 12px",border:"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",lineHeight:1.6,outline:"none",resize:"vertical",marginBottom:8}}),A.jsxs("div",{style:{display:"flex",gap:6},children:[A.jsx("button",{onClick:d,style:{background:"var(--accent)",border:"none",borderRadius:"var(--radius-xs)",padding:"4px 12px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",fontWeight:600,color:"var(--text-inverse)",cursor:"pointer"},children:"Save"}),A.jsx("button",{onClick:()=>s(!1),style:{background:"none",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",padding:"4px 12px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-secondary)",cursor:"pointer"},children:"Cancel"})]})]}):t.result?A.jsx("div",{style:{padding:"12px",background:"var(--surface-2)",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-subtle)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-primary)",lineHeight:1.6,whiteSpace:"pre-wrap",maxHeight:300,overflowY:"auto"},children:t.result}):A.jsx("div",{style:{padding:"20px",background:"var(--surface-2)",borderRadius:"var(--radius-sm)",border:"1px dashed var(--border-default)",textAlign:"center",fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-muted)"},children:"No output yet"})]})]})]})}function qG(){const t=pl(R=>R.user),[e,n]=U.useState([]),[i,r]=U.useState(!0),[s,l]=U.useState(""),[c,d]=U.useState(""),[p,m]=U.useState("viewer"),[g,b]=U.useState(null),[v,_]=U.useState(null),C=U.useCallback(async()=>{try{const R=await fetch("/api/users",{credentials:"include"});if(R.ok){const O=await R.json();n(O.users)}}catch{b("Failed to load users")}finally{r(!1)}},[]);U.useEffect(()=>{C()},[C]);const T=async()=>{if(!(!s.trim()||!c.trim())){b(null);try{const R=await fetch("/api/auth/register",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:s,password:c,role:p}),credentials:"include"});if(!R.ok){const O=await R.json();b(O.error||"Failed to create user");return}l(""),d(""),m("viewer"),await C()}catch{b("Network error")}}},w=async(R,O)=>{try{(await fetch(`/api/users/${R}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({role:O}),credentials:"include"})).ok&&await C()}catch{b("Failed to update role")}},k=async R=>{try{(await fetch(`/api/users/${R}`,{method:"DELETE",credentials:"include"})).ok&&(_(null),await C())}catch{b("Failed to delete user")}};return i?A.jsx("div",{style:{color:"var(--text-muted)",padding:"var(--sp-5)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",animation:"pulse 1.5s ease-in-out infinite"},children:"Loading users..."}):A.jsxs("div",{children:[A.jsx("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",marginBottom:"var(--sp-4)"},children:"User Management"}),g&&A.jsx("div",{style:{background:"var(--status-error-glow)",border:"1px solid rgba(255, 64, 112, 0.2)",color:"var(--status-error)",padding:"var(--sp-2) var(--sp-3)",borderRadius:"var(--radius-sm)",marginBottom:"var(--sp-3)",fontFamily:"var(--font-mono)",fontSize:"0.78rem"},children:g}),A.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",marginBottom:"var(--sp-5)",flexWrap:"wrap",alignItems:"center"},children:[A.jsx("input",{className:"input",placeholder:"Username",value:s,onChange:R=>l(R.target.value),style:{flex:1,minWidth:120}}),A.jsx("input",{className:"input",placeholder:"Password",type:"password",value:c,onChange:R=>d(R.target.value),style:{flex:1,minWidth:120}}),A.jsxs("select",{className:"input",value:p,onChange:R=>m(R.target.value),style:{minWidth:100},children:[A.jsx("option",{value:"viewer",children:"viewer"}),A.jsx("option",{value:"operator",children:"operator"}),A.jsx("option",{value:"admin",children:"admin"})]}),A.jsx("button",{onClick:T,className:"btn btn-accent",children:"Create User"})]}),A.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[A.jsx("thead",{children:A.jsx("tr",{style:{borderBottom:"1px solid var(--border-default)"},children:["Username","Email","Role","Last Login","Actions"].map((R,O)=>A.jsx("th",{style:{textAlign:O===4?"right":"left",padding:"8px 12px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em"},children:R},R))})}),A.jsx("tbody",{children:e.map(R=>A.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[A.jsx("td",{style:{padding:"10px 12px",color:"var(--text-primary)",fontSize:"0.82rem"},children:R.username}),A.jsx("td",{style:{padding:"10px 12px",color:"var(--text-secondary)",fontSize:"0.82rem"},children:R.email||"—"}),A.jsx("td",{style:{padding:"10px 12px"},children:R.id===(t==null?void 0:t.id)?A.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-secondary)"},children:R.role}):A.jsxs("select",{className:"input",value:R.role,onChange:O=>w(R.id,O.target.value),style:{padding:"4px 8px",fontSize:"0.75rem"},children:[A.jsx("option",{value:"viewer",children:"viewer"}),A.jsx("option",{value:"operator",children:"operator"}),A.jsx("option",{value:"admin",children:"admin"})]})}),A.jsx("td",{style:{padding:"10px 12px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:R.last_login?new Date(R.last_login).toLocaleDateString():"—"}),A.jsx("td",{style:{padding:"10px 12px",textAlign:"right"},children:R.id!==(t==null?void 0:t.id)&&(v===R.id?A.jsxs("span",{style:{display:"inline-flex",gap:"var(--sp-2)",alignItems:"center"},children:[A.jsx("span",{style:{color:"var(--status-error)",fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:"Confirm?"}),A.jsx("button",{onClick:()=>k(R.id),className:"btn btn-sm btn-danger",children:"Yes"}),A.jsx("button",{onClick:()=>_(null),className:"btn btn-sm",children:"No"})]}):A.jsx("button",{onClick:()=>_(R.id),className:"btn btn-sm btn-danger",children:"Delete"}))})]},R.id))})]})]})}function YG(){const t=Ja(d=>d.selectedSquad),e=Ja(d=>d.activeStates),[n,i]=U.useState(null),[r,s]=U.useState(!1),l=t?e[t]:null;if(U.useEffect(()=>{if(!t){i(null);return}s(!0),fetch(`/api/squads/${t}`,{credentials:"include"}).then(d=>d.ok?d.json():null).then(d=>{d&&i(d.data)}).finally(()=>s(!1))},[t]),!t)return A.jsx("div",{style:{color:"var(--text-muted)",padding:"var(--sp-5)",fontSize:"0.85rem"},children:"Select a squad to view details"});if(r)return A.jsx("div",{style:{color:"var(--text-muted)",padding:"var(--sp-5)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",animation:"pulse 1.5s ease-in-out infinite"},children:"Loading squad details..."});const c={fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",fontWeight:600,marginBottom:"var(--sp-2)",textTransform:"uppercase",letterSpacing:"0.08em"};return A.jsxs("div",{children:[A.jsx("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",marginBottom:"var(--sp-4)"},children:"Squad Info"}),n&&A.jsxs(A.Fragment,{children:[A.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[A.jsx("div",{style:c,children:"Name"}),A.jsx("div",{style:{color:"var(--text-primary)",fontSize:"0.9rem",fontWeight:600},children:n.name})]}),A.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[A.jsx("div",{style:c,children:"Description"}),A.jsx("div",{style:{color:"var(--text-primary)",fontSize:"0.85rem",lineHeight:1.5},children:n.description})]}),A.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[A.jsx("div",{style:c,children:"Agents"}),A.jsx("div",{style:{display:"flex",gap:"var(--sp-2)",flexWrap:"wrap"},children:n.agents.map(d=>A.jsx("span",{style:{background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",padding:"4px 10px",fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-primary)"},children:d.name},d.id))})]}),A.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[A.jsx("div",{style:c,children:"Pipeline Steps"}),A.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:n.pipeline.steps.map((d,p)=>A.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",padding:"8px 12px",fontSize:"0.82rem"},children:[A.jsx("span",{style:{background:"var(--accent)",color:"var(--text-inverse)",width:22,height:22,borderRadius:"var(--radius-full)",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-mono)",fontSize:"0.65rem",fontWeight:700,flexShrink:0},children:p+1}),A.jsx("span",{style:{color:"var(--text-primary)"},children:d.label}),A.jsx("span",{style:{fontFamily:"var(--font-mono)",color:"var(--text-muted)",fontSize:"0.68rem",marginLeft:"auto"},children:d.agent})]},d.id))})]})]}),l&&A.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[A.jsx("div",{style:c,children:"Current State"}),A.jsx("pre",{"data-testid":"state-json",style:{background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",padding:"var(--sp-4)",fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--accent)",overflow:"auto",maxHeight:400,lineHeight:1.5},children:JSON.stringify(l,null,2)})]})]})}function VG(){const[t,e]=U.useState(null),[n,i]=U.useState(null),[r,s]=U.useState(!0),[l,c]=U.useState(null),d=U.useCallback(async()=>{s(!0);try{const g=await fetch("/api/health",{credentials:"include"});if(g.ok){const b=await g.json();e(b),i(b.status==="ok")}else i(!1)}catch{i(!1)}finally{s(!1),c(new Date().toLocaleTimeString())}},[]);U.useEffect(()=>{d()},[d]);const p={fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",fontWeight:600,marginBottom:"var(--sp-2)",textTransform:"uppercase",letterSpacing:"0.08em"},m={display:"flex",justifyContent:"space-between",alignItems:"center",padding:"10px 12px",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",marginBottom:"var(--sp-2)",fontSize:"0.82rem"};return A.jsxs("div",{children:[A.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"var(--sp-4)"},children:[A.jsx("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)"},children:"Server Info"}),A.jsx("button",{onClick:d,className:"btn btn-sm",children:"Refresh"})]}),A.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[A.jsx("div",{style:p,children:"Health Status"}),A.jsxs("div",{style:m,children:[A.jsx("span",{style:{color:"var(--text-primary)"},children:"API Server"}),r?A.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-muted)",animation:"pulse 1.5s ease-in-out infinite"},children:"Checking..."}):A.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"var(--sp-1)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",fontWeight:600,color:n?"var(--status-active)":"var(--status-error)"},children:[A.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:n?"var(--status-active)":"var(--status-error)",display:"inline-block",boxShadow:n?"0 0 8px var(--status-active-glow)":"0 0 8px var(--status-error-glow)"}}),n?"Healthy":"Unhealthy"]})]})]}),A.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[A.jsx("div",{style:p,children:"Environment"}),A.jsxs("div",{style:m,children:[A.jsx("span",{style:{color:"var(--text-primary)"},children:"API Port"}),A.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)"},children:"3001"})]}),A.jsxs("div",{style:m,children:[A.jsx("span",{style:{color:"var(--text-primary)"},children:"Dashboard Port (dev)"}),A.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)"},children:"5173"})]})]}),l&&A.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textAlign:"right"},children:["Last checked: ",l]})]})}const XG=[{key:"AWS_ACCESS_KEY_ID",label:"AWS Access Key ID",type:"password",hint:"Your AWS IAM access key"},{key:"AWS_SECRET_ACCESS_KEY",label:"AWS Secret Access Key",type:"password",hint:"Your AWS IAM secret key"},{key:"AWS_REGION",label:"AWS Region",type:"text",hint:"e.g. us-east-1, eu-west-1"},{key:"SES_FROM_EMAIL",label:"SES From Email",type:"text",hint:"Verified sender email in SES"},{key:"SES_RATE_LIMIT",label:"SES Rate Limit",type:"text",hint:"Max emails per second (default: 14)"},{key:"SERVER_URL",label:"Server URL",type:"text",hint:"Public URL for unsubscribe links"},{key:"PORT",label:"Port",type:"text",hint:"Server port (requires restart)"},{key:"CORS_ORIGIN",label:"CORS Origin",type:"text",hint:"Allowed origin for CORS"},{key:"NODE_ENV",label:"Node Environment",type:"text",hint:"development or production"}];function KG(){const[t,e]=U.useState({}),[n,i]=U.useState(!0),[r,s]=U.useState(!1),[l,c]=U.useState(null),[d,p]=U.useState(new Set);U.useEffect(()=>{fetch("/api/settings/env").then(b=>b.json()).then(b=>{e(b.settings||{}),i(!1)}).catch(()=>i(!1))},[]);const m=(b,v)=>{e(_=>({..._,[b]:v})),p(_=>new Set(_).add(b)),c(null)},g=async()=>{if(d.size===0)return;s(!0),c(null);const b={};for(const v of d)b[v]=t[v]||"";try{const v=await fetch("/api/settings/env",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)});if(v.ok){const _=await v.json();e(_.settings),p(new Set),c({type:"success",text:"Settings saved successfully"})}else{const _=await v.json();c({type:"error",text:_.error||"Failed to save"})}}catch{c({type:"error",text:"Network error"})}finally{s(!1)}};return n?A.jsx("div",{style:{textAlign:"center",padding:"var(--sp-6)",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:"Loading..."}):A.jsxs("div",{style:{maxWidth:640},children:[A.jsx("div",{style:{marginBottom:"var(--sp-4)"},children:A.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)",lineHeight:1.6},children:"Server environment variables. Secret values are masked. Changes to PORT or NODE_ENV require a server restart."})}),A.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-3)"},children:XG.map(b=>A.jsxs("div",{children:[A.jsx("label",{style:{display:"block",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-secondary)",fontWeight:600,letterSpacing:"0.04em",marginBottom:4},children:b.label}),A.jsx("input",{type:b.type,value:t[b.key]||"",onChange:v=>m(b.key,v.target.value),placeholder:b.hint,style:{width:"100%",padding:"8px 12px",background:"var(--surface-2)",border:d.has(b.key)?"1px solid var(--accent)":"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.78rem",boxSizing:"border-box"}}),A.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)"},children:b.hint})]},b.key))}),A.jsxs("div",{style:{marginTop:"var(--sp-4)",display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[A.jsx("button",{onClick:g,disabled:d.size===0||r,style:{padding:"8px 24px",background:d.size>0?"var(--accent)":"var(--surface-3)",border:"none",borderRadius:"var(--radius-sm)",color:d.size>0?"var(--text-inverse)":"var(--text-muted)",cursor:d.size>0?"pointer":"default",fontFamily:"var(--font-display)",fontSize:"0.82rem",fontWeight:600,opacity:r?.6:1},children:r?"Saving...":`Save ${d.size>0?`(${d.size})`:""}`}),l&&A.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:l.type==="success"?"var(--status-active)":"var(--status-error)"},children:l.text})]})]})}function WG(){const[t,e]=U.useState([]),[n,i]=U.useState(!0),[r,s]=U.useState(null),[l,c]=U.useState(null),[d,p]=U.useState(""),[m,g]=U.useState(""),[b,v]=U.useState(""),[_,C]=U.useState(""),[T,w]=U.useState(null),[k,R]=U.useState(""),[O,j]=U.useState(""),[D,F]=U.useState(""),[$,P]=U.useState(""),I=U.useCallback(async()=>{try{const B=await fetch("/api/team",{credentials:"include"});if(B.ok){const X=await B.json();e(X.members)}}catch{s("Failed to load team members")}finally{i(!1)}},[]);U.useEffect(()=>{I()},[I]);const K=async()=>{if(!(!d.trim()||!m.trim())){s(null);try{const B=await fetch("/api/team",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:d.trim(),role:m.trim(),email:b.trim()||void 0,phone:_.trim()||void 0}),credentials:"include"});if(!B.ok){const X=await B.json();s(X.error||"Failed to create team member");return}p(""),g(""),v(""),C(""),await I()}catch{s("Network error")}}},G=B=>{w(B.id),R(B.name),j(B.role),F(B.email||""),P(B.phone||"")},te=()=>{w(null)},H=async()=>{if(!(!T||!k.trim()||!O.trim())){s(null);try{(await fetch(`/api/team/${T}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:k.trim(),role:O.trim(),email:D.trim()||void 0,phone:$.trim()||void 0}),credentials:"include"})).ok&&(w(null),await I())}catch{s("Failed to update member")}}},W=async B=>{try{(await fetch(`/api/team/${B}`,{method:"DELETE",credentials:"include"})).ok&&(c(null),await I())}catch{s("Failed to delete member")}};return n?A.jsx("div",{style:{color:"var(--text-muted)",padding:"var(--sp-5)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",animation:"pulse 1.5s ease-in-out infinite"},children:"Loading team..."}):A.jsxs("div",{children:[A.jsx("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",marginBottom:"var(--sp-4)"},children:"Team Members"}),r&&A.jsx("div",{style:{background:"var(--status-error-glow)",border:"1px solid rgba(255, 64, 112, 0.2)",color:"var(--status-error)",padding:"var(--sp-2) var(--sp-3)",borderRadius:"var(--radius-sm)",marginBottom:"var(--sp-3)",fontFamily:"var(--font-mono)",fontSize:"0.78rem"},children:r}),A.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",marginBottom:"var(--sp-5)",flexWrap:"wrap",alignItems:"center"},children:[A.jsx("input",{className:"input",placeholder:"Name *",value:d,onChange:B=>p(B.target.value),style:{flex:1,minWidth:120}}),A.jsx("input",{className:"input",placeholder:"Role *",value:m,onChange:B=>g(B.target.value),style:{flex:1,minWidth:120}}),A.jsx("input",{className:"input",placeholder:"Email",type:"email",value:b,onChange:B=>v(B.target.value),style:{flex:1,minWidth:150}}),A.jsx("input",{className:"input",placeholder:"Phone",type:"tel",value:_,onChange:B=>C(B.target.value),style:{flex:1,minWidth:130}}),A.jsx("button",{onClick:K,className:"btn btn-accent",children:"Add Member"})]}),A.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[A.jsx("thead",{children:A.jsx("tr",{style:{borderBottom:"1px solid var(--border-default)"},children:["Name","Role","Email","Phone","Actions"].map((B,X)=>A.jsx("th",{style:{textAlign:X===4?"right":"left",padding:"8px 12px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em"},children:B},B))})}),A.jsxs("tbody",{children:[t.length===0&&A.jsx("tr",{children:A.jsx("td",{colSpan:5,style:{padding:"var(--sp-5)",textAlign:"center",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.78rem"},children:"No team members yet"})}),t.map(B=>T===B.id?A.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-3)"},children:[A.jsx("td",{style:{padding:"6px 12px"},children:A.jsx("input",{className:"input",value:k,onChange:X=>R(X.target.value),style:{width:"100%",fontSize:"0.82rem"}})}),A.jsx("td",{style:{padding:"6px 12px"},children:A.jsx("input",{className:"input",value:O,onChange:X=>j(X.target.value),style:{width:"100%",fontSize:"0.82rem"}})}),A.jsx("td",{style:{padding:"6px 12px"},children:A.jsx("input",{className:"input",value:D,onChange:X=>F(X.target.value),style:{width:"100%",fontSize:"0.82rem"}})}),A.jsx("td",{style:{padding:"6px 12px"},children:A.jsx("input",{className:"input",value:$,onChange:X=>P(X.target.value),style:{width:"100%",fontSize:"0.82rem"}})}),A.jsx("td",{style:{padding:"6px 12px",textAlign:"right"},children:A.jsxs("span",{style:{display:"inline-flex",gap:"var(--sp-2)"},children:[A.jsx("button",{onClick:H,className:"btn btn-sm btn-accent",children:"Save"}),A.jsx("button",{onClick:te,className:"btn btn-sm",children:"Cancel"})]})})]},B.id):A.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[A.jsx("td",{style:{padding:"10px 12px",color:"var(--text-primary)",fontSize:"0.82rem"},children:B.name}),A.jsx("td",{style:{padding:"10px 12px",color:"var(--text-secondary)",fontSize:"0.82rem"},children:B.role}),A.jsx("td",{style:{padding:"10px 12px",color:"var(--text-secondary)",fontSize:"0.82rem"},children:B.email||"—"}),A.jsx("td",{style:{padding:"10px 12px",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-muted)"},children:B.phone||"—"}),A.jsx("td",{style:{padding:"10px 12px",textAlign:"right"},children:l===B.id?A.jsxs("span",{style:{display:"inline-flex",gap:"var(--sp-2)",alignItems:"center"},children:[A.jsx("span",{style:{color:"var(--status-error)",fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:"Confirm?"}),A.jsx("button",{onClick:()=>W(B.id),className:"btn btn-sm btn-danger",children:"Yes"}),A.jsx("button",{onClick:()=>c(null),className:"btn btn-sm",children:"No"})]}):A.jsxs("span",{style:{display:"inline-flex",gap:"var(--sp-2)"},children:[A.jsx("button",{onClick:()=>G(B),className:"btn btn-sm",children:"Edit"}),A.jsx("button",{onClick:()=>c(B.id),className:"btn btn-sm btn-danger",children:"Delete"})]})})]},B.id))]})]})]})}const $G={dev:"Development",messaging:"Messaging",ads:"Advertising",crm:"CRM",support:"Support",email:"Email Marketing",sales:"Sales & Payments",pm:"Project Management",monitoring:"Monitoring",cloud:"Cloud & Deploy",design:"Design"},ZG={dev:"⌨",messaging:"💬",ads:"📢",crm:"📊",support:"🎧",email:"✉",sales:"💰",pm:"📋",monitoring:"🔍",cloud:"☁",design:"🎨"};function QG(){const[t,e]=U.useState([]),[n,i]=U.useState([]),[r,s]=U.useState(!0),[l,c]=U.useState(null),[d,p]=U.useState(null),[m,g]=U.useState(!1),[b,v]=U.useState({}),[_,C]=U.useState(!1),[T,w]=U.useState(null),[k,R]=U.useState(""),O=U.useCallback(async()=>{try{const[G,te]=await Promise.all([fetch("/api/integrations/catalog",{credentials:"include"}),fetch("/api/integrations",{credentials:"include"})]);if(G.ok){const H=await G.json();e(H.providers)}if(te.ok){const H=await te.json();i(H.integrations)}}catch{c("Failed to load integrations")}finally{s(!1)}},[]);U.useEffect(()=>{O()},[O]);const j=G=>n.find(te=>te.provider===G),D=G=>{const te=j(G.key),H={};for(const W of G.fields)H[W.key]=(te==null?void 0:te.config[W.key])||"";v(H),C((te==null?void 0:te.enabled)??!1),p(G.key),c(null)},F=async()=>{if(d){g(!0),c(null);try{const G=await fetch(`/api/integrations/${d}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:_,config:b}),credentials:"include"});if(!G.ok){const te=await G.json();c(te.error||"Failed to save");return}await O(),p(null)}catch{c("Network error")}finally{g(!1)}}},$=async G=>{try{(await fetch(`/api/integrations/${G}`,{method:"DELETE",credentials:"include"})).ok&&(await O(),d===G&&p(null))}catch{c("Failed to disconnect")}},P=Array.from(new Set(t.map(G=>G.category))),I=k.toLowerCase(),K=t.filter(G=>!(T&&G.category!==T||k&&!G.name.toLowerCase().includes(I)&&!G.description.toLowerCase().includes(I)));return r?A.jsx("div",{style:{color:"var(--text-muted)",padding:"var(--sp-5)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",animation:"pulse 1.5s ease-in-out infinite"},children:"Loading integrations..."}):A.jsxs("div",{children:[A.jsx("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",marginBottom:"var(--sp-2)"},children:"Integrations"}),A.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-muted)",marginBottom:"var(--sp-4)"},children:"Configure third-party services for your squads and agents"}),A.jsx("input",{className:"input",type:"text",placeholder:"Search integrations...",value:k,onChange:G=>R(G.target.value),style:{width:"100%",fontSize:"0.8rem",marginBottom:"var(--sp-3)"}}),l&&A.jsx("div",{style:{background:"var(--status-error-glow)",border:"1px solid rgba(255, 64, 112, 0.2)",color:"var(--status-error)",padding:"var(--sp-2) var(--sp-3)",borderRadius:"var(--radius-sm)",marginBottom:"var(--sp-3)",fontFamily:"var(--font-mono)",fontSize:"0.78rem"},children:l}),A.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",marginBottom:"var(--sp-4)",flexWrap:"wrap"},children:[A.jsx("button",{onClick:()=>w(null),style:{padding:"4px 12px",border:"1px solid",borderColor:T?"var(--border-subtle)":"var(--accent)",borderRadius:"var(--radius-sm)",background:T?"transparent":"var(--accent)",color:T?"var(--text-secondary)":"#fff",fontFamily:"var(--font-mono)",fontSize:"0.7rem",cursor:"pointer"},children:"All"}),P.map(G=>A.jsxs("button",{onClick:()=>w(G),style:{padding:"4px 12px",border:"1px solid",borderColor:T===G?"var(--accent)":"var(--border-subtle)",borderRadius:"var(--radius-sm)",background:T===G?"var(--accent)":"transparent",color:T===G?"#fff":"var(--text-secondary)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",cursor:"pointer"},children:[ZG[G]||""," ",$G[G]||G]},G))]}),A.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(260px, 1fr))",gap:"var(--sp-3)"},children:K.map(G=>{const te=j(G.key),H=d===G.key;return A.jsxs("div",{style:{background:"var(--surface-3)",border:"1px solid",borderColor:te!=null&&te.enabled?"var(--status-running)":"var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-3)",transition:"all var(--duration-fast) var(--ease-out)",gridColumn:H?"1 / -1":void 0},children:[A.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:H?"var(--sp-3)":0},children:[A.jsxs("div",{children:[A.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)"},children:[A.jsx("span",{style:{fontFamily:"var(--font-display)",fontWeight:600,fontSize:"0.85rem",color:"var(--text-primary)"},children:G.name}),(te==null?void 0:te.enabled)&&A.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--status-running)",boxShadow:"0 0 4px var(--status-running)",display:"inline-block"}})]}),A.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.68rem",color:"var(--text-muted)"},children:G.description})]}),A.jsx("button",{onClick:()=>H?p(null):D(G),className:"btn btn-sm",style:{flexShrink:0},children:H?"Close":te?"Edit":"Configure"})]}),H&&A.jsxs("div",{style:{borderTop:"1px solid var(--border-subtle)",paddingTop:"var(--sp-3)"},children:[A.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",marginBottom:"var(--sp-3)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)",cursor:"pointer"},children:[A.jsx("input",{type:"checkbox",checked:_,onChange:W=>C(W.target.checked)}),"Enabled"]}),A.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:G.fields.map(W=>A.jsxs("div",{children:[A.jsxs("label",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:2,display:"block"},children:[W.label," ",W.required&&"*"]}),A.jsx("input",{className:"input",type:W.type==="password"?"password":"text",placeholder:W.placeholder||"",value:b[W.key]||"",onChange:B=>v(X=>({...X,[W.key]:B.target.value})),style:{width:"100%",fontSize:"0.8rem"}})]},W.key))}),A.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",marginTop:"var(--sp-3)",justifyContent:"flex-end"},children:[te&&A.jsx("button",{onClick:()=>$(G.key),className:"btn btn-sm btn-danger",children:"Disconnect"}),A.jsx("button",{onClick:()=>p(null),className:"btn btn-sm",children:"Cancel"}),A.jsx("button",{onClick:F,className:"btn btn-sm btn-accent",disabled:m,children:m?"Saving...":"Save"})]})]})]},G.key)})})]})}function JG(){const t=pl(l=>l.user),e=(t==null?void 0:t.role)==="admin",[n,i]=U.useState(e?"users":"squad"),s=[{key:"users",label:"Users",icon:"◉",adminOnly:!0},{key:"team",label:"Team",icon:"◎"},{key:"integrations",label:"Integrations",icon:"⬡"},{key:"squad",label:"Squad",icon:"⬢"},{key:"server",label:"Server",icon:"⚙"},{key:"env",label:"Environment",icon:"◆",adminOnly:!0}].filter(l=>!l.adminOnly||e);return A.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",padding:"var(--sp-5)",animation:"fadeIn 0.4s var(--ease-out) both"},children:[A.jsxs("div",{style:{marginBottom:"var(--sp-4)"},children:[A.jsx("h2",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"1.1rem",color:"var(--text-primary)",marginBottom:"var(--sp-1)"},children:"Settings"}),A.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:"Configuration and management"})]}),A.jsx("div",{style:{display:"flex",gap:"var(--sp-1)",marginBottom:"var(--sp-5)",borderBottom:"1px solid var(--border-subtle)"},children:s.map(l=>A.jsxs("button",{onClick:()=>i(l.key),style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"10px 16px",border:"none",borderBottom:n===l.key?"2px solid var(--accent)":"2px solid transparent",background:"transparent",color:n===l.key?"var(--text-primary)":"var(--text-muted)",fontFamily:"var(--font-display)",fontWeight:n===l.key?600:400,fontSize:"0.82rem",cursor:"pointer",transition:"all var(--duration-fast) var(--ease-out)"},children:[A.jsx("span",{style:{fontSize:"0.75rem",opacity:.7},children:l.icon}),l.label]},l.key))}),A.jsxs("div",{style:{flex:1,overflow:"auto"},children:[n==="users"&&e&&A.jsx(qG,{}),n==="team"&&A.jsx(WG,{}),n==="integrations"&&A.jsx(QG,{}),n==="squad"&&A.jsx(YG,{}),n==="server"&&A.jsx(VG,{}),n==="env"&&e&&A.jsx(KG,{})]})]})}const KR=[{value:"0",label:"Domingo"},{value:"1",label:"Segunda"},{value:"2",label:"Terça"},{value:"3",label:"Quarta"},{value:"4",label:"Quinta"},{value:"5",label:"Sexta"},{value:"6",label:"Sábado"}];function eF(t,e){switch(t){case"every_n_minutes":return`*/${e.everyNMinutes||"30"} * * * *`;case"hourly":return`${e.minute||"0"} * * * *`;case"daily":return`${e.minute||"0"} ${e.hour||"9"} * * *`;case"weekly":return`${e.minute||"0"} ${e.hour||"9"} * * ${e.dayOfWeek||"1"}`;case"monthly":return`${e.minute||"0"} ${e.hour||"9"} ${e.dayOfMonth||"1"} * *`;case"custom":return"";default:return"0 9 * * *"}}function J2(t){var l;if(!t)return"";const e=t.split(" ");if(e.length!==5)return t;const[n,i,r,,s]=e;return n.startsWith("*/")?`A cada ${n.replace("*/","")} minutos`:i==="*"&&r==="*"?`A cada hora no minuto ${n}`:r==="*"&&s==="*"?`Diariamente às ${i.padStart(2,"0")}:${n.padStart(2,"0")}`:r==="*"&&s!=="*"?`Semanalmente, ${((l=KR.find(d=>d.value===s))==null?void 0:l.label)||`dia ${s}`} às ${i.padStart(2,"0")}:${n.padStart(2,"0")}`:s==="*"&&r!=="*"?`Mensalmente, dia ${r} às ${i.padStart(2,"0")}:${n.padStart(2,"0")}`:t}const hm={width:"100%",padding:"6px 10px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.78rem",outline:"none"},ao={...hm,cursor:"pointer",appearance:"none",backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")`,backgroundRepeat:"no-repeat",backgroundPosition:"right 8px center",paddingRight:"28px"},Wa={fontFamily:"var(--font-mono)",fontSize:"0.62rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:4,display:"block"},Jc={padding:"6px 16px",borderRadius:"var(--radius-xs)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",fontWeight:600,cursor:"pointer",border:"none",transition:"all 0.15s ease"};function tF(){const t=ks(le=>le.jobs),e=ks(le=>le.loading),n=ks(le=>le.fetchJobs),i=ks(le=>le.createJob),r=ks(le=>le.deleteJob),s=ks(le=>le.pauseJob),l=ks(le=>le.resumeJob),c=ks(le=>le.triggerJob),d=Ja(le=>le.squads),[p,m]=U.useState(!1),[g,b]=U.useState(null),[v,_]=U.useState(""),[C,T]=U.useState("daily"),[w,k]=U.useState("0"),[R,O]=U.useState("9"),[j,D]=U.useState("1"),[F,$]=U.useState("1"),[P,I]=U.useState("30"),[K,G]=U.useState(""),[te,H]=U.useState(""),[W,B]=U.useState("America/Sao_Paulo"),[X,Z]=U.useState("30"),[Q,q]=U.useState("0");U.useEffect(()=>{n()},[n]);const Y=U.useCallback(()=>{_(""),T("daily"),k("0"),O("9"),D("1"),$("1"),I("30"),G(""),H(""),B("America/Sao_Paulo"),Z("30"),q("0"),b(null)},[]),ee=()=>{Y(),m(!0)},V=le=>{_(le.squad_name),H(le.prompt||""),B(le.timezone||"America/Sao_Paulo"),Z(String(le.timeout_minutes||30)),q(String(le.retry_on_failure||0)),b(le.squad_name);const Re=le.cron_expression.split(" ");if(Re.length===5){const[Ie,Ue,Le,,Ve]=Re;Ie.startsWith("*/")?(T("every_n_minutes"),I(Ie.replace("*/",""))):Ue==="*"?(T("hourly"),k(Ie)):Le==="*"&&Ve==="*"?(T("daily"),k(Ie),O(Ue)):Le==="*"&&Ve!=="*"?(T("weekly"),k(Ie),O(Ue),D(Ve)):Ve==="*"&&Le!=="*"?(T("monthly"),k(Ie),O(Ue),$(Le)):(T("custom"),G(le.cron_expression))}else T("custom"),G(le.cron_expression);m(!0)},oe=C==="custom"?K:eF(C,{minute:w,hour:R,dayOfMonth:F,dayOfWeek:j,everyNMinutes:P}),be=async()=>{if(!v||!oe||!te.trim())return;const le={squad_name:v,cron_expression:oe,prompt:te.trim(),timezone:W||void 0,timeout_minutes:parseInt(X)||30,retry_on_failure:parseInt(Q)||0};await i(le)&&(m(!1),Y())},ve=le=>le==="active"?"var(--status-active)":le==="paused"?"var(--status-warning)":"var(--status-error)",se=le=>le==="active"?"var(--status-active-glow)":le==="paused"?"var(--status-warning-glow)":"var(--status-error-glow)",ge=d.filter(le=>!t.some(Re=>Re.squad_name===le.code));return A.jsxs("div",{style:{padding:"var(--sp-6)",animation:"fadeIn 0.4s var(--ease-out) both",maxWidth:900},children:[A.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"var(--sp-5)"},children:[A.jsxs("div",{children:[A.jsx("h2",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"1.1rem",color:"var(--text-primary)",marginBottom:"var(--sp-1)"},children:"Scheduler"}),A.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:"Autonomous job execution and monitoring"})]}),A.jsx("button",{"data-testid":"btn-new-schedule",onClick:ee,style:{...Jc,background:"var(--accent)",color:"var(--text-inverse)"},children:"+ New Schedule"})]}),p&&A.jsxs("div",{"data-testid":"schedule-form",style:{background:"var(--surface-2)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-md)",padding:"var(--sp-5)",marginBottom:"var(--sp-5)",animation:"fadeInUp 0.3s var(--ease-out) both"},children:[A.jsx("div",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.9rem",color:"var(--text-primary)",marginBottom:"var(--sp-4)"},children:g?"Edit Schedule":"New Schedule"}),A.jsxs("div",{style:{marginBottom:"var(--sp-4)"},children:[A.jsx("label",{style:Wa,children:"Squad"}),g?A.jsx("div",{style:{...hm,background:"var(--surface-3)",color:"var(--text-secondary)"},children:g}):A.jsxs("select",{"data-testid":"select-squad",value:v,onChange:le=>_(le.target.value),style:ao,children:[A.jsx("option",{value:"",children:"Select a squad..."}),ge.map(le=>A.jsxs("option",{value:le.code,children:[le.name," (",le.code,")"]},le.code)),t.length===0&&d.length===0&&A.jsx("option",{disabled:!0,children:"No squads available"})]})]}),A.jsxs("div",{style:{marginBottom:"var(--sp-4)"},children:[A.jsx("label",{style:Wa,children:"Frequency"}),A.jsxs("select",{"data-testid":"select-frequency",value:C,onChange:le=>T(le.target.value),style:ao,children:[A.jsx("option",{value:"every_n_minutes",children:"Every N minutes"}),A.jsx("option",{value:"hourly",children:"Hourly"}),A.jsx("option",{value:"daily",children:"Daily"}),A.jsx("option",{value:"weekly",children:"Weekly"}),A.jsx("option",{value:"monthly",children:"Monthly"}),A.jsx("option",{value:"custom",children:"Custom cron"})]})]}),A.jsxs("div",{style:{display:"flex",gap:"var(--sp-3)",marginBottom:"var(--sp-4)",flexWrap:"wrap"},children:[C==="every_n_minutes"&&A.jsxs("div",{style:{flex:1,minWidth:120},children:[A.jsx("label",{style:Wa,children:"Every (minutes)"}),A.jsx("select",{value:P,onChange:le=>I(le.target.value),style:ao,children:[1,2,5,10,15,20,30].map(le=>A.jsx("option",{value:String(le),children:le},le))})]}),C==="hourly"&&A.jsxs("div",{style:{flex:1,minWidth:120},children:[A.jsx("label",{style:Wa,children:"At minute"}),A.jsx("select",{value:w,onChange:le=>k(le.target.value),style:ao,children:Array.from({length:60},(le,Re)=>A.jsx("option",{value:String(Re),children:String(Re).padStart(2,"0")},Re))})]}),(C==="daily"||C==="weekly"||C==="monthly")&&A.jsxs(A.Fragment,{children:[A.jsxs("div",{style:{flex:1,minWidth:100},children:[A.jsx("label",{style:Wa,children:"Hour"}),A.jsx("select",{value:R,onChange:le=>O(le.target.value),style:ao,children:Array.from({length:24},(le,Re)=>A.jsx("option",{value:String(Re),children:String(Re).padStart(2,"0")},Re))})]}),A.jsxs("div",{style:{flex:1,minWidth:100},children:[A.jsx("label",{style:Wa,children:"Minute"}),A.jsx("select",{value:w,onChange:le=>k(le.target.value),style:ao,children:Array.from({length:60},(le,Re)=>A.jsx("option",{value:String(Re),children:String(Re).padStart(2,"0")},Re))})]})]}),C==="weekly"&&A.jsxs("div",{style:{flex:1,minWidth:140},children:[A.jsx("label",{style:Wa,children:"Day of week"}),A.jsx("select",{value:j,onChange:le=>D(le.target.value),style:ao,children:KR.map(le=>A.jsx("option",{value:le.value,children:le.label},le.value))})]}),C==="monthly"&&A.jsxs("div",{style:{flex:1,minWidth:120},children:[A.jsx("label",{style:Wa,children:"Day of month"}),A.jsx("select",{value:F,onChange:le=>$(le.target.value),style:ao,children:Array.from({length:31},(le,Re)=>A.jsx("option",{value:String(Re+1),children:Re+1},Re+1))})]}),C==="custom"&&A.jsxs("div",{style:{flex:1,minWidth:200},children:[A.jsx("label",{style:Wa,children:"Cron expression"}),A.jsx("input",{type:"text",placeholder:"* * * * *",value:K,onChange:le=>G(le.target.value),style:hm})]})]}),oe&&A.jsxs("div",{style:{marginBottom:"var(--sp-4)",padding:"8px 12px",background:"var(--surface-3)",borderRadius:"var(--radius-xs)",border:"1px solid var(--border-subtle)",fontFamily:"var(--font-mono)",fontSize:"0.72rem",display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[A.jsx("code",{style:{color:"var(--accent)",fontWeight:600},children:oe}),A.jsx("span",{style:{color:"var(--text-muted)"},children:"—"}),A.jsx("span",{"data-testid":"cron-preview",style:{color:"var(--text-secondary)"},children:J2(oe)})]}),A.jsxs("div",{style:{marginBottom:"var(--sp-4)"},children:[A.jsx("label",{style:Wa,children:"Instruction for the agent"}),A.jsx("textarea",{"data-testid":"input-prompt",placeholder:"What should the squad do on each execution?",value:te,onChange:le=>H(le.target.value),rows:3,style:{...hm,resize:"vertical",lineHeight:1.5}})]}),A.jsxs("div",{style:{display:"flex",gap:"var(--sp-3)",marginBottom:"var(--sp-4)",flexWrap:"wrap"},children:[A.jsxs("div",{style:{flex:2,minWidth:180},children:[A.jsx("label",{style:Wa,children:"Timezone"}),A.jsxs("select",{value:W,onChange:le=>B(le.target.value),style:ao,children:[A.jsx("option",{value:"America/Sao_Paulo",children:"America/Sao_Paulo"}),A.jsx("option",{value:"America/New_York",children:"America/New_York"}),A.jsx("option",{value:"America/Chicago",children:"America/Chicago"}),A.jsx("option",{value:"America/Los_Angeles",children:"America/Los_Angeles"}),A.jsx("option",{value:"Europe/London",children:"Europe/London"}),A.jsx("option",{value:"Europe/Berlin",children:"Europe/Berlin"}),A.jsx("option",{value:"Asia/Tokyo",children:"Asia/Tokyo"}),A.jsx("option",{value:"UTC",children:"UTC"})]})]}),A.jsxs("div",{style:{flex:1,minWidth:100},children:[A.jsx("label",{style:Wa,children:"Timeout (min)"}),A.jsx("input",{type:"number",min:1,max:480,value:X,onChange:le=>Z(le.target.value),style:hm})]}),A.jsxs("div",{style:{flex:1,minWidth:100},children:[A.jsx("label",{style:Wa,children:"Retries"}),A.jsx("select",{value:Q,onChange:le=>q(le.target.value),style:ao,children:[0,1,2,3,4,5].map(le=>A.jsx("option",{value:String(le),children:le},le))})]})]}),A.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)"},children:[A.jsx("button",{"data-testid":"btn-save-schedule",onClick:be,disabled:!v||!oe||!te.trim(),style:{...Jc,background:v&&oe&&te.trim()?"var(--accent)":"var(--surface-4)",color:v&&oe&&te.trim()?"var(--text-inverse)":"var(--text-muted)"},children:g?"Update":"Create"}),A.jsx("button",{onClick:()=>{m(!1),Y()},style:{...Jc,background:"none",border:"1px solid var(--border-subtle)",color:"var(--text-secondary)"},children:"Cancel"})]})]}),e&&A.jsx("p",{style:{color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",animation:"pulse 1.5s ease-in-out infinite"},children:"Loading jobs..."}),!e&&t.length===0&&!p&&A.jsxs("div",{style:{padding:"var(--sp-8)",textAlign:"center",color:"var(--text-muted)"},children:[A.jsx("div",{style:{fontSize:"1.5rem",marginBottom:"var(--sp-3)"},children:"⏣"}),A.jsx("p",{style:{fontSize:"0.85rem",marginBottom:"var(--sp-2)"},children:"No scheduled jobs"}),A.jsxs("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:["Click ",A.jsx("strong",{children:"+ New Schedule"})," to create your first automated job."]})]}),A.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-3)"},children:t.map((le,Re)=>A.jsxs("div",{"data-testid":`job-${le.squad_name}`,style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-4)",transition:"border-color var(--duration-fast) var(--ease-out)",animation:`fadeInUp 0.4s var(--ease-out) ${Re*60}ms both`},children:[A.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"var(--sp-2)"},children:[A.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)"},children:[A.jsx("span",{style:{fontWeight:600,fontSize:"0.9rem",color:"var(--text-primary)"},children:le.squad_name}),A.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:ve(le.status)},children:[A.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:ve(le.status),boxShadow:`0 0 8px ${se(le.status)}`,display:"inline-block",animation:le.status==="active"?"statusPulse 2s ease-in-out infinite":"none"}}),le.status]})]}),A.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)"},children:[A.jsx("button",{onClick:()=>V(le),style:{...Jc,padding:"4px 10px",fontSize:"0.68rem",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",color:"var(--text-secondary)"},children:"Edit"}),le.status==="active"?A.jsx("button",{onClick:()=>s(le.squad_name),style:{...Jc,padding:"4px 10px",fontSize:"0.68rem",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",color:"var(--status-warning)"},children:"Pause"}):A.jsx("button",{onClick:()=>l(le.squad_name),style:{...Jc,padding:"4px 10px",fontSize:"0.68rem",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",color:"var(--status-active)"},children:"Resume"}),A.jsx("button",{onClick:()=>c(le.squad_name),style:{...Jc,padding:"4px 10px",fontSize:"0.68rem",background:"var(--accent)",color:"var(--text-inverse)"},children:"Trigger"}),A.jsx("button",{onClick:()=>{confirm(`Delete schedule for ${le.squad_name}?`)&&r(le.squad_name)},style:{...Jc,padding:"4px 10px",fontSize:"0.68rem",background:"none",border:"1px solid var(--border-subtle)",color:"var(--text-muted)"},title:"Delete schedule",children:"✕"})]})]}),A.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-secondary)",display:"flex",alignItems:"center",gap:"var(--sp-3)",flexWrap:"wrap",marginBottom:"var(--sp-2)"},children:[A.jsx("code",{style:{background:"var(--surface-3)",padding:"1px 5px",borderRadius:"var(--radius-xs)",fontSize:"0.65rem"},children:le.cron_expression}),A.jsx("span",{style:{color:"var(--text-muted)"},children:J2(le.cron_expression)}),le.last_run_at&&A.jsxs(A.Fragment,{children:[A.jsx("span",{style:{color:"var(--border-strong)"},children:"|"}),A.jsxs("span",{children:["Last: ",new Date(le.last_run_at).toLocaleString()]})]}),le.last_result&&A.jsxs(A.Fragment,{children:[A.jsx("span",{style:{color:"var(--border-strong)"},children:"|"}),A.jsx("span",{children:le.last_result})]})]}),le.prompt&&A.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.68rem",color:"var(--text-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"6px 10px",background:"var(--surface-3)",borderRadius:"var(--radius-xs)"},children:le.prompt})]},le.squad_name))})]})}const fl=Tf(t=>({leads:[],campaigns:[],lists:[],tags:[],total:0,loading:!1,fetchLeads:async(e={})=>{t({loading:!0});try{const n=new URLSearchParams(e),i=await fetch(`/api/email/leads?${n}`);if(i.ok){const r=await i.json();t({leads:r.data,total:r.total})}}finally{t({loading:!1})}},fetchCampaigns:async(e={})=>{t({loading:!0});try{const n=new URLSearchParams(e),i=await fetch(`/api/email/campaigns?${n}`);if(i.ok){const r=await i.json();t({campaigns:r.data})}}finally{t({loading:!1})}},fetchLists:async()=>{const e=await fetch("/api/email/leads/lists");if(e.ok){const n=await e.json();t({lists:n.lists})}},fetchTags:async()=>{const e=await fetch("/api/email/leads/tags");if(e.ok){const n=await e.json();t({tags:n.tags})}}}));function nF(){const t=fl(g=>g.leads),e=fl(g=>g.total),n=fl(g=>g.lists),i=fl(g=>g.tags),r=fl(g=>g.loading),s=fl(g=>g.fetchLeads),l=fl(g=>g.fetchLists),c=fl(g=>g.fetchTags),[d,p]=U.useState("");U.useEffect(()=>{s(),l(),c()},[s,l,c]);const m=()=>{s(d?{search:d}:{})};return A.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-4)"},children:[A.jsxs("div",{style:{display:"flex",gap:"var(--sp-3)"},children:[A.jsx(gv,{label:"Total Leads",value:e}),A.jsx(gv,{label:"Lists",value:n.length}),A.jsx(gv,{label:"Tags",value:i.length})]}),A.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)"},children:[A.jsx("input",{type:"text",placeholder:"Search leads...",value:d,onChange:g=>p(g.target.value),onKeyDown:g=>g.key==="Enter"&&m(),style:{flex:1,padding:"8px 12px",background:"var(--surface-2)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",color:"var(--text-primary)",fontFamily:"var(--font-body)",fontSize:"0.82rem"}}),A.jsx("button",{onClick:m,className:"btn-ghost",style:{padding:"8px 16px",background:"var(--accent-glow)",border:"1px solid rgba(0, 200, 255, 0.2)",borderRadius:"var(--radius-sm)",color:"var(--accent)",cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:"Search"})]}),r?A.jsx("div",{style:{textAlign:"center",padding:"var(--sp-6)",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:"Loading..."}):A.jsx("div",{style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",overflow:"hidden"},children:A.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[A.jsx("thead",{children:A.jsx("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:["Email","Name","Company","Status","Source","Created"].map(g=>A.jsx("th",{style:{textAlign:"left",padding:"10px 14px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:600},children:g},g))})}),A.jsxs("tbody",{children:[t.map(g=>A.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[A.jsx("td",{style:sa,children:g.email}),A.jsx("td",{style:sa,children:g.name||"—"}),A.jsx("td",{style:sa,children:g.company||"—"}),A.jsx("td",{style:sa,children:A.jsx(WR,{status:g.status})}),A.jsx("td",{style:sa,children:g.source||"—"}),A.jsx("td",{style:{...sa,fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:new Date(g.created_at).toLocaleDateString()})]},g.id)),t.length===0&&A.jsx("tr",{children:A.jsx("td",{colSpan:6,style:{...sa,textAlign:"center",color:"var(--text-muted)"},children:"No leads found"})})]})]})})]})}function iF(){const t=fl(i=>i.campaigns),e=fl(i=>i.loading),n=fl(i=>i.fetchCampaigns);return U.useEffect(()=>{n()},[n]),A.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-4)"},children:e?A.jsx("div",{style:{textAlign:"center",padding:"var(--sp-6)",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:"Loading..."}):A.jsx("div",{style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",overflow:"hidden"},children:A.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[A.jsx("thead",{children:A.jsx("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:["Name","Subject","Status","Recipients","Sent","Bounced","Created"].map(i=>A.jsx("th",{style:{textAlign:"left",padding:"10px 14px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:600},children:i},i))})}),A.jsxs("tbody",{children:[t.map(i=>A.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[A.jsx("td",{style:sa,children:i.name}),A.jsx("td",{style:sa,children:i.subject}),A.jsx("td",{style:sa,children:A.jsx(WR,{status:i.status})}),A.jsx("td",{style:{...sa,fontFamily:"var(--font-mono)"},children:i.total_recipients}),A.jsx("td",{style:{...sa,fontFamily:"var(--font-mono)"},children:i.sent_count}),A.jsx("td",{style:{...sa,fontFamily:"var(--font-mono)"},children:i.bounce_count}),A.jsx("td",{style:{...sa,fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:new Date(i.created_at).toLocaleDateString()})]},i.id)),t.length===0&&A.jsx("tr",{children:A.jsx("td",{colSpan:7,style:{...sa,textAlign:"center",color:"var(--text-muted)"},children:"No campaigns yet"})})]})]})})})}function rF(){return A.jsxs("div",{style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-4)"},children:[A.jsx("h3",{style:{fontFamily:"var(--font-display)",fontSize:"0.9rem",color:"var(--text-primary)",marginBottom:"var(--sp-3)"},children:"Amazon SES Configuration"}),A.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)",lineHeight:1.8},children:[A.jsx("p",{children:"Configure these environment variables on the server:"}),A.jsxs("div",{style:{background:"var(--surface-2)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",padding:"var(--sp-3)",marginTop:"var(--sp-2)"},children:[A.jsx("code",{children:"AWS_ACCESS_KEY_ID=..."}),A.jsx("br",{}),A.jsx("code",{children:"AWS_SECRET_ACCESS_KEY=..."}),A.jsx("br",{}),A.jsx("code",{children:"AWS_REGION=us-east-1"}),A.jsx("br",{}),A.jsx("code",{children:"SES_FROM_EMAIL=noreply@yourdomain.com"}),A.jsx("br",{}),A.jsx("code",{children:"SES_RATE_LIMIT=14"}),A.jsx("br",{}),A.jsx("code",{children:"SERVER_URL=https://yourdomain.com"})]})]})]})}function gv({label:t,value:e}){return A.jsxs("div",{style:{flex:1,background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-3)"},children:[A.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:"var(--sp-1)"},children:t}),A.jsx("div",{style:{fontFamily:"var(--font-display)",fontSize:"1.4rem",fontWeight:700,color:"var(--accent)"},children:e})]})}function WR({status:t}){const n={active:{bg:"rgba(0, 230, 138, 0.1)",text:"var(--status-active)"},unsubscribed:{bg:"rgba(255, 100, 100, 0.1)",text:"var(--status-error)"},draft:{bg:"rgba(150, 150, 150, 0.1)",text:"var(--text-muted)"},queued:{bg:"rgba(0, 200, 255, 0.1)",text:"var(--accent)"},sending:{bg:"rgba(255, 180, 0, 0.1)",text:"var(--status-warning)"},sent:{bg:"rgba(0, 230, 138, 0.1)",text:"var(--status-active)"},paused:{bg:"rgba(255, 180, 0, 0.1)",text:"var(--status-warning)"},cancelled:{bg:"rgba(255, 100, 100, 0.1)",text:"var(--status-error)"}}[t]||{bg:"rgba(150, 150, 150, 0.1)",text:"var(--text-muted)"};return A.jsx("span",{style:{display:"inline-block",padding:"2px 8px",borderRadius:"var(--radius-xs)",background:n.bg,color:n.text,fontFamily:"var(--font-mono)",fontSize:"0.65rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em"},children:t})}const sa={padding:"10px 14px",fontSize:"0.82rem",color:"var(--text-secondary)"};function aF(){const[t,e]=U.useState("leads"),n=[{key:"leads",label:"Leads"},{key:"campaigns",label:"Campaigns"},{key:"settings",label:"Settings"}];return A.jsxs("div",{style:{padding:"var(--sp-4)",maxWidth:1100,margin:"0 auto"},children:[A.jsxs("div",{style:{marginBottom:"var(--sp-4)"},children:[A.jsx("h2",{style:{fontFamily:"var(--font-display)",fontSize:"1.1rem",fontWeight:700,color:"var(--text-primary)",marginBottom:"var(--sp-1)"},children:"Email Engine"}),A.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:"Lead management, campaigns, and Amazon SES integration"})]}),A.jsx("div",{style:{display:"flex",gap:"var(--sp-1)",marginBottom:"var(--sp-4)",borderBottom:"1px solid var(--border-subtle)",paddingBottom:"var(--sp-1)"},children:n.map(i=>A.jsx("button",{onClick:()=>e(i.key),style:{padding:"8px 16px",background:t===i.key?"var(--accent-glow)":"transparent",border:t===i.key?"1px solid rgba(0, 200, 255, 0.15)":"1px solid transparent",borderRadius:"var(--radius-sm)",color:t===i.key?"var(--accent)":"var(--text-secondary)",cursor:"pointer",fontFamily:"var(--font-display)",fontSize:"0.82rem",fontWeight:t===i.key?600:400,transition:"all var(--duration-fast) var(--ease-out)"},children:i.label},i.key))}),t==="leads"&&A.jsx(nF,{}),t==="campaigns"&&A.jsx(iF,{}),t==="settings"&&A.jsx(rF,{})]})}function Oi(t){if(typeof t=="string"||typeof t=="number")return""+t;let e="";if(Array.isArray(t))for(let n=0,i;n<t.length;n++)(i=Oi(t[n]))!==""&&(e+=(e&&" ")+i);else for(let n in t)t[n]&&(e+=(e&&" ")+n);return e}var sF={value:()=>{}};function cb(){for(var t=0,e=arguments.length,n={},i;t<e;++t){if(!(i=arguments[t]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new g0(n)}function g0(t){this._=t}function lF(t,e){return t.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}g0.prototype=cb.prototype={constructor:g0,on:function(t,e){var n=this._,i=lF(t+"",n),r,s=-1,l=i.length;if(arguments.length<2){for(;++s<l;)if((r=(t=i[s]).type)&&(r=oF(n[r],t.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++s<l;)if(r=(t=i[s]).type)n[r]=eT(n[r],t.name,e);else if(e==null)for(r in n)n[r]=eT(n[r],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new g0(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,s;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=this._[t],i=0,r=s.length;i<r;++i)s[i].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,s=i.length;r<s;++r)i[r].value.apply(e,n)}};function oF(t,e){for(var n=0,i=t.length,r;n<i;++n)if((r=t[n]).name===e)return r.value}function eT(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=sF,t=t.slice(0,i).concat(t.slice(i+1));break}return n!=null&&t.push({name:e,value:n}),t}var v_="http://www.w3.org/1999/xhtml";const tT={svg:"http://www.w3.org/2000/svg",xhtml:v_,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ub(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),tT.hasOwnProperty(e)?{space:tT[e],local:t}:t}function cF(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===v_&&e.documentElement.namespaceURI===v_?e.createElement(t):e.createElementNS(n,t)}}function uF(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function $R(t){var e=ub(t);return(e.local?uF:cF)(e)}function fF(){}function A1(t){return t==null?fF:function(){return this.querySelector(t)}}function dF(t){typeof t!="function"&&(t=A1(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var s=e[r],l=s.length,c=i[r]=new Array(l),d,p,m=0;m<l;++m)(d=s[m])&&(p=t.call(d,d.__data__,m,s))&&("__data__"in d&&(p.__data__=d.__data__),c[m]=p);return new is(i,this._parents)}function hF(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function pF(){return[]}function ZR(t){return t==null?pF:function(){return this.querySelectorAll(t)}}function mF(t){return function(){return hF(t.apply(this,arguments))}}function gF(t){typeof t=="function"?t=mF(t):t=ZR(t);for(var e=this._groups,n=e.length,i=[],r=[],s=0;s<n;++s)for(var l=e[s],c=l.length,d,p=0;p<c;++p)(d=l[p])&&(i.push(t.call(d,d.__data__,p,l)),r.push(d));return new is(i,r)}function QR(t){return function(){return this.matches(t)}}function JR(t){return function(e){return e.matches(t)}}var yF=Array.prototype.find;function bF(t){return function(){return yF.call(this.children,t)}}function xF(){return this.firstElementChild}function vF(t){return this.select(t==null?xF:bF(typeof t=="function"?t:JR(t)))}var _F=Array.prototype.filter;function SF(){return Array.from(this.children)}function EF(t){return function(){return _F.call(this.children,t)}}function wF(t){return this.selectAll(t==null?SF:EF(typeof t=="function"?t:JR(t)))}function TF(t){typeof t!="function"&&(t=QR(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var s=e[r],l=s.length,c=i[r]=[],d,p=0;p<l;++p)(d=s[p])&&t.call(d,d.__data__,p,s)&&c.push(d);return new is(i,this._parents)}function eN(t){return new Array(t.length)}function CF(){return new is(this._enter||this._groups.map(eN),this._parents)}function L0(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}L0.prototype={constructor:L0,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function AF(t){return function(){return t}}function MF(t,e,n,i,r,s){for(var l=0,c,d=e.length,p=s.length;l<p;++l)(c=e[l])?(c.__data__=s[l],i[l]=c):n[l]=new L0(t,s[l]);for(;l<d;++l)(c=e[l])&&(r[l]=c)}function RF(t,e,n,i,r,s,l){var c,d,p=new Map,m=e.length,g=s.length,b=new Array(m),v;for(c=0;c<m;++c)(d=e[c])&&(b[c]=v=l.call(d,d.__data__,c,e)+"",p.has(v)?r[c]=d:p.set(v,d));for(c=0;c<g;++c)v=l.call(t,s[c],c,s)+"",(d=p.get(v))?(i[c]=d,d.__data__=s[c],p.delete(v)):n[c]=new L0(t,s[c]);for(c=0;c<m;++c)(d=e[c])&&p.get(b[c])===d&&(r[c]=d)}function NF(t){return t.__data__}function kF(t,e){if(!arguments.length)return Array.from(this,NF);var n=e?RF:MF,i=this._parents,r=this._groups;typeof t!="function"&&(t=AF(t));for(var s=r.length,l=new Array(s),c=new Array(s),d=new Array(s),p=0;p<s;++p){var m=i[p],g=r[p],b=g.length,v=OF(t.call(m,m&&m.__data__,p,i)),_=v.length,C=c[p]=new Array(_),T=l[p]=new Array(_),w=d[p]=new Array(b);n(m,g,C,T,w,v,e);for(var k=0,R=0,O,j;k<_;++k)if(O=C[k]){for(k>=R&&(R=k+1);!(j=T[R])&&++R<_;);O._next=j||null}}return l=new is(l,i),l._enter=c,l._exit=d,l}function OF(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function DF(){return new is(this._exit||this._groups.map(eN),this._parents)}function zF(t,e,n){var i=this.enter(),r=this,s=this.exit();return typeof t=="function"?(i=t(i),i&&(i=i.selection())):i=i.append(t+""),e!=null&&(r=e(r),r&&(r=r.selection())),n==null?s.remove():n(s),i&&r?i.merge(r).order():r}function BF(t){for(var e=t.selection?t.selection():t,n=this._groups,i=e._groups,r=n.length,s=i.length,l=Math.min(r,s),c=new Array(r),d=0;d<l;++d)for(var p=n[d],m=i[d],g=p.length,b=c[d]=new Array(g),v,_=0;_<g;++_)(v=p[_]||m[_])&&(b[_]=v);for(;d<r;++d)c[d]=n[d];return new is(c,this._parents)}function LF(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i=t[e],r=i.length-1,s=i[r],l;--r>=0;)(l=i[r])&&(s&&l.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(l,s),s=l);return this}function UF(t){t||(t=IF);function e(g,b){return g&&b?t(g.__data__,b.__data__):!g-!b}for(var n=this._groups,i=n.length,r=new Array(i),s=0;s<i;++s){for(var l=n[s],c=l.length,d=r[s]=new Array(c),p,m=0;m<c;++m)(p=l[m])&&(d[m]=p);d.sort(e)}return new is(r,this._parents).order()}function IF(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function jF(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function HF(){return Array.from(this)}function PF(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,s=i.length;r<s;++r){var l=i[r];if(l)return l}return null}function GF(){let t=0;for(const e of this)++t;return t}function FF(){return!this.node()}function qF(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var r=e[n],s=0,l=r.length,c;s<l;++s)(c=r[s])&&t.call(c,c.__data__,s,r);return this}function YF(t){return function(){this.removeAttribute(t)}}function VF(t){return function(){this.removeAttributeNS(t.space,t.local)}}function XF(t,e){return function(){this.setAttribute(t,e)}}function KF(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function WF(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function $F(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function ZF(t,e){var n=ub(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((e==null?n.local?VF:YF:typeof e=="function"?n.local?$F:WF:n.local?KF:XF)(n,e))}function tN(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function QF(t){return function(){this.style.removeProperty(t)}}function JF(t,e,n){return function(){this.style.setProperty(t,e,n)}}function eq(t,e,n){return function(){var i=e.apply(this,arguments);i==null?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function tq(t,e,n){return arguments.length>1?this.each((e==null?QF:typeof e=="function"?eq:JF)(t,e,n??"")):uh(this.node(),t)}function uh(t,e){return t.style.getPropertyValue(e)||tN(t).getComputedStyle(t,null).getPropertyValue(e)}function nq(t){return function(){delete this[t]}}function iq(t,e){return function(){this[t]=e}}function rq(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function aq(t,e){return arguments.length>1?this.each((e==null?nq:typeof e=="function"?rq:iq)(t,e)):this.node()[t]}function nN(t){return t.trim().split(/^|\s+/)}function M1(t){return t.classList||new iN(t)}function iN(t){this._node=t,this._names=nN(t.getAttribute("class")||"")}iN.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function rN(t,e){for(var n=M1(t),i=-1,r=e.length;++i<r;)n.add(e[i])}function aN(t,e){for(var n=M1(t),i=-1,r=e.length;++i<r;)n.remove(e[i])}function sq(t){return function(){rN(this,t)}}function lq(t){return function(){aN(this,t)}}function oq(t,e){return function(){(e.apply(this,arguments)?rN:aN)(this,t)}}function cq(t,e){var n=nN(t+"");if(arguments.length<2){for(var i=M1(this.node()),r=-1,s=n.length;++r<s;)if(!i.contains(n[r]))return!1;return!0}return this.each((typeof e=="function"?oq:e?sq:lq)(n,e))}function uq(){this.textContent=""}function fq(t){return function(){this.textContent=t}}function dq(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function hq(t){return arguments.length?this.each(t==null?uq:(typeof t=="function"?dq:fq)(t)):this.node().textContent}function pq(){this.innerHTML=""}function mq(t){return function(){this.innerHTML=t}}function gq(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function yq(t){return arguments.length?this.each(t==null?pq:(typeof t=="function"?gq:mq)(t)):this.node().innerHTML}function bq(){this.nextSibling&&this.parentNode.appendChild(this)}function xq(){return this.each(bq)}function vq(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function _q(){return this.each(vq)}function Sq(t){var e=typeof t=="function"?t:$R(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Eq(){return null}function wq(t,e){var n=typeof t=="function"?t:$R(t),i=e==null?Eq:typeof e=="function"?e:A1(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function Tq(){var t=this.parentNode;t&&t.removeChild(this)}function Cq(){return this.each(Tq)}function Aq(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Mq(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Rq(t){return this.select(t?Mq:Aq)}function Nq(t){return arguments.length?this.property("__data__",t):this.node().__data__}function kq(t){return function(e){t.call(this,e,this.__data__)}}function Oq(t){return t.trim().split(/^|\s+/).map(function(e){var n="",i=e.indexOf(".");return i>=0&&(n=e.slice(i+1),e=e.slice(0,i)),{type:e,name:n}})}function Dq(t){return function(){var e=this.__on;if(e){for(var n=0,i=-1,r=e.length,s;n<r;++n)s=e[n],(!t.type||s.type===t.type)&&s.name===t.name?this.removeEventListener(s.type,s.listener,s.options):e[++i]=s;++i?e.length=i:delete this.__on}}}function zq(t,e,n){return function(){var i=this.__on,r,s=kq(e);if(i){for(var l=0,c=i.length;l<c;++l)if((r=i[l]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=s,r.options=n),r.value=e;return}}this.addEventListener(t.type,s,n),r={type:t.type,name:t.name,value:e,listener:s,options:n},i?i.push(r):this.__on=[r]}}function Bq(t,e,n){var i=Oq(t+""),r,s=i.length,l;if(arguments.length<2){var c=this.node().__on;if(c){for(var d=0,p=c.length,m;d<p;++d)for(r=0,m=c[d];r<s;++r)if((l=i[r]).type===m.type&&l.name===m.name)return m.value}return}for(c=e?zq:Dq,r=0;r<s;++r)this.each(c(i[r],e,n));return this}function sN(t,e,n){var i=tN(t),r=i.CustomEvent;typeof r=="function"?r=new r(e,n):(r=i.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function Lq(t,e){return function(){return sN(this,t,e)}}function Uq(t,e){return function(){return sN(this,t,e.apply(this,arguments))}}function Iq(t,e){return this.each((typeof e=="function"?Uq:Lq)(t,e))}function*jq(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,s=i.length,l;r<s;++r)(l=i[r])&&(yield l)}var lN=[null];function is(t,e){this._groups=t,this._parents=e}function eg(){return new is([[document.documentElement]],lN)}function Hq(){return this}is.prototype=eg.prototype={constructor:is,select:dF,selectAll:gF,selectChild:vF,selectChildren:wF,filter:TF,data:kF,enter:CF,exit:DF,join:zF,merge:BF,selection:Hq,order:LF,sort:UF,call:jF,nodes:HF,node:PF,size:GF,empty:FF,each:qF,attr:ZF,style:tq,property:aq,classed:cq,text:hq,html:yq,raise:xq,lower:_q,append:Sq,insert:wq,remove:Cq,clone:Rq,datum:Nq,on:Bq,dispatch:Iq,[Symbol.iterator]:jq};function es(t){return typeof t=="string"?new is([[document.querySelector(t)]],[document.documentElement]):new is([[t]],lN)}function Pq(t){let e;for(;e=t.sourceEvent;)t=e;return t}function dl(t,e){if(t=Pq(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=t.clientX,i.y=t.clientY,i=i.matrixTransform(e.getScreenCTM().inverse()),[i.x,i.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}const Gq={passive:!1},Lm={capture:!0,passive:!1};function yv(t){t.stopImmediatePropagation()}function eh(t){t.preventDefault(),t.stopImmediatePropagation()}function oN(t){var e=t.document.documentElement,n=es(t).on("dragstart.drag",eh,Lm);"onselectstart"in e?n.on("selectstart.drag",eh,Lm):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function cN(t,e){var n=t.document.documentElement,i=es(t).on("dragstart.drag",null);e&&(i.on("click.drag",eh,Lm),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const t0=t=>()=>t;function __(t,{sourceEvent:e,subject:n,target:i,identifier:r,active:s,x:l,y:c,dx:d,dy:p,dispatch:m}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:d,enumerable:!0,configurable:!0},dy:{value:p,enumerable:!0,configurable:!0},_:{value:m}})}__.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function Fq(t){return!t.ctrlKey&&!t.button}function qq(){return this.parentNode}function Yq(t,e){return e??{x:t.x,y:t.y}}function Vq(){return navigator.maxTouchPoints||"ontouchstart"in this}function uN(){var t=Fq,e=qq,n=Yq,i=Vq,r={},s=cb("start","drag","end"),l=0,c,d,p,m,g=0;function b(O){O.on("mousedown.drag",v).filter(i).on("touchstart.drag",T).on("touchmove.drag",w,Gq).on("touchend.drag touchcancel.drag",k).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(O,j){if(!(m||!t.call(this,O,j))){var D=R(this,e.call(this,O,j),O,j,"mouse");D&&(es(O.view).on("mousemove.drag",_,Lm).on("mouseup.drag",C,Lm),oN(O.view),yv(O),p=!1,c=O.clientX,d=O.clientY,D("start",O))}}function _(O){if(eh(O),!p){var j=O.clientX-c,D=O.clientY-d;p=j*j+D*D>g}r.mouse("drag",O)}function C(O){es(O.view).on("mousemove.drag mouseup.drag",null),cN(O.view,p),eh(O),r.mouse("end",O)}function T(O,j){if(t.call(this,O,j)){var D=O.changedTouches,F=e.call(this,O,j),$=D.length,P,I;for(P=0;P<$;++P)(I=R(this,F,O,j,D[P].identifier,D[P]))&&(yv(O),I("start",O,D[P]))}}function w(O){var j=O.changedTouches,D=j.length,F,$;for(F=0;F<D;++F)($=r[j[F].identifier])&&(eh(O),$("drag",O,j[F]))}function k(O){var j=O.changedTouches,D=j.length,F,$;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),F=0;F<D;++F)($=r[j[F].identifier])&&(yv(O),$("end",O,j[F]))}function R(O,j,D,F,$,P){var I=s.copy(),K=dl(P||D,j),G,te,H;if((H=n.call(O,new __("beforestart",{sourceEvent:D,target:b,identifier:$,active:l,x:K[0],y:K[1],dx:0,dy:0,dispatch:I}),F))!=null)return G=H.x-K[0]||0,te=H.y-K[1]||0,function W(B,X,Z){var Q=K,q;switch(B){case"start":r[$]=W,q=l++;break;case"end":delete r[$],--l;case"drag":K=dl(Z||X,j),q=l;break}I.call(B,O,new __(B,{sourceEvent:X,subject:H,target:b,identifier:$,active:q,x:K[0]+G,y:K[1]+te,dx:K[0]-Q[0],dy:K[1]-Q[1],dispatch:I}),F)}}return b.filter=function(O){return arguments.length?(t=typeof O=="function"?O:t0(!!O),b):t},b.container=function(O){return arguments.length?(e=typeof O=="function"?O:t0(O),b):e},b.subject=function(O){return arguments.length?(n=typeof O=="function"?O:t0(O),b):n},b.touchable=function(O){return arguments.length?(i=typeof O=="function"?O:t0(!!O),b):i},b.on=function(){var O=s.on.apply(s,arguments);return O===s?b:O},b.clickDistance=function(O){return arguments.length?(g=(O=+O)*O,b):Math.sqrt(g)},b}function R1(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function fN(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function tg(){}var Um=.7,U0=1/Um,th="\\s*([+-]?\\d+)\\s*",Im="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ho="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Xq=/^#([0-9a-f]{3,8})$/,Kq=new RegExp(`^rgb\\(${th},${th},${th}\\)$`),Wq=new RegExp(`^rgb\\(${ho},${ho},${ho}\\)$`),$q=new RegExp(`^rgba\\(${th},${th},${th},${Im}\\)$`),Zq=new RegExp(`^rgba\\(${ho},${ho},${ho},${Im}\\)$`),Qq=new RegExp(`^hsl\\(${Im},${ho},${ho}\\)$`),Jq=new RegExp(`^hsla\\(${Im},${ho},${ho},${Im}\\)$`),nT={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};R1(tg,_f,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:iT,formatHex:iT,formatHex8:eY,formatHsl:tY,formatRgb:rT,toString:rT});function iT(){return this.rgb().formatHex()}function eY(){return this.rgb().formatHex8()}function tY(){return dN(this).formatHsl()}function rT(){return this.rgb().formatRgb()}function _f(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Xq.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?aT(e):n===3?new Ma(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?n0(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?n0(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Kq.exec(t))?new Ma(e[1],e[2],e[3],1):(e=Wq.exec(t))?new Ma(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=$q.exec(t))?n0(e[1],e[2],e[3],e[4]):(e=Zq.exec(t))?n0(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Qq.exec(t))?oT(e[1],e[2]/100,e[3]/100,1):(e=Jq.exec(t))?oT(e[1],e[2]/100,e[3]/100,e[4]):nT.hasOwnProperty(t)?aT(nT[t]):t==="transparent"?new Ma(NaN,NaN,NaN,0):null}function aT(t){return new Ma(t>>16&255,t>>8&255,t&255,1)}function n0(t,e,n,i){return i<=0&&(t=e=n=NaN),new Ma(t,e,n,i)}function nY(t){return t instanceof tg||(t=_f(t)),t?(t=t.rgb(),new Ma(t.r,t.g,t.b,t.opacity)):new Ma}function S_(t,e,n,i){return arguments.length===1?nY(t):new Ma(t,e,n,i??1)}function Ma(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}R1(Ma,S_,fN(tg,{brighter(t){return t=t==null?U0:Math.pow(U0,t),new Ma(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Um:Math.pow(Um,t),new Ma(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ma(gf(this.r),gf(this.g),gf(this.b),I0(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:sT,formatHex:sT,formatHex8:iY,formatRgb:lT,toString:lT}));function sT(){return`#${mf(this.r)}${mf(this.g)}${mf(this.b)}`}function iY(){return`#${mf(this.r)}${mf(this.g)}${mf(this.b)}${mf((isNaN(this.opacity)?1:this.opacity)*255)}`}function lT(){const t=I0(this.opacity);return`${t===1?"rgb(":"rgba("}${gf(this.r)}, ${gf(this.g)}, ${gf(this.b)}${t===1?")":`, ${t})`}`}function I0(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function gf(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function mf(t){return t=gf(t),(t<16?"0":"")+t.toString(16)}function oT(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new ml(t,e,n,i)}function dN(t){if(t instanceof ml)return new ml(t.h,t.s,t.l,t.opacity);if(t instanceof tg||(t=_f(t)),!t)return new ml;if(t instanceof ml)return t;t=t.rgb();var e=t.r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),s=Math.max(e,n,i),l=NaN,c=s-r,d=(s+r)/2;return c?(e===s?l=(n-i)/c+(n<i)*6:n===s?l=(i-e)/c+2:l=(e-n)/c+4,c/=d<.5?s+r:2-s-r,l*=60):c=d>0&&d<1?0:l,new ml(l,c,d,t.opacity)}function rY(t,e,n,i){return arguments.length===1?dN(t):new ml(t,e,n,i??1)}function ml(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}R1(ml,rY,fN(tg,{brighter(t){return t=t==null?U0:Math.pow(U0,t),new ml(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Um:Math.pow(Um,t),new ml(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new Ma(bv(t>=240?t-240:t+120,r,i),bv(t,r,i),bv(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new ml(cT(this.h),i0(this.s),i0(this.l),I0(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=I0(this.opacity);return`${t===1?"hsl(":"hsla("}${cT(this.h)}, ${i0(this.s)*100}%, ${i0(this.l)*100}%${t===1?")":`, ${t})`}`}}));function cT(t){return t=(t||0)%360,t<0?t+360:t}function i0(t){return Math.max(0,Math.min(1,t||0))}function bv(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const N1=t=>()=>t;function aY(t,e){return function(n){return t+n*e}}function sY(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}function lY(t){return(t=+t)==1?hN:function(e,n){return n-e?sY(e,n,t):N1(isNaN(e)?n:e)}}function hN(t,e){var n=e-t;return n?aY(t,n):N1(isNaN(t)?e:t)}const j0=(function t(e){var n=lY(e);function i(r,s){var l=n((r=S_(r)).r,(s=S_(s)).r),c=n(r.g,s.g),d=n(r.b,s.b),p=hN(r.opacity,s.opacity);return function(m){return r.r=l(m),r.g=c(m),r.b=d(m),r.opacity=p(m),r+""}}return i.gamma=t,i})(1);function oY(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,i=e.slice(),r;return function(s){for(r=0;r<n;++r)i[r]=t[r]*(1-s)+e[r]*s;return i}}function cY(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function uY(t,e){var n=e?e.length:0,i=t?Math.min(n,t.length):0,r=new Array(i),s=new Array(n),l;for(l=0;l<i;++l)r[l]=Tm(t[l],e[l]);for(;l<n;++l)s[l]=e[l];return function(c){for(l=0;l<i;++l)s[l]=r[l](c);return s}}function fY(t,e){var n=new Date;return t=+t,e=+e,function(i){return n.setTime(t*(1-i)+e*i),n}}function uo(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function dY(t,e){var n={},i={},r;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(r in e)r in t?n[r]=Tm(t[r],e[r]):i[r]=e[r];return function(s){for(r in n)i[r]=n[r](s);return i}}var E_=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,xv=new RegExp(E_.source,"g");function hY(t){return function(){return t}}function pY(t){return function(e){return t(e)+""}}function pN(t,e){var n=E_.lastIndex=xv.lastIndex=0,i,r,s,l=-1,c=[],d=[];for(t=t+"",e=e+"";(i=E_.exec(t))&&(r=xv.exec(e));)(s=r.index)>n&&(s=e.slice(n,s),c[l]?c[l]+=s:c[++l]=s),(i=i[0])===(r=r[0])?c[l]?c[l]+=r:c[++l]=r:(c[++l]=null,d.push({i:l,x:uo(i,r)})),n=xv.lastIndex;return n<e.length&&(s=e.slice(n),c[l]?c[l]+=s:c[++l]=s),c.length<2?d[0]?pY(d[0].x):hY(e):(e=d.length,function(p){for(var m=0,g;m<e;++m)c[(g=d[m]).i]=g.x(p);return c.join("")})}function Tm(t,e){var n=typeof e,i;return e==null||n==="boolean"?N1(e):(n==="number"?uo:n==="string"?(i=_f(e))?(e=i,j0):pN:e instanceof _f?j0:e instanceof Date?fY:cY(e)?oY:Array.isArray(e)?uY:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?dY:uo)(t,e)}var uT=180/Math.PI,w_={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function mN(t,e,n,i,r,s){var l,c,d;return(l=Math.sqrt(t*t+e*e))&&(t/=l,e/=l),(d=t*n+e*i)&&(n-=t*d,i-=e*d),(c=Math.sqrt(n*n+i*i))&&(n/=c,i/=c,d/=c),t*i<e*n&&(t=-t,e=-e,d=-d,l=-l),{translateX:r,translateY:s,rotate:Math.atan2(e,t)*uT,skewX:Math.atan(d)*uT,scaleX:l,scaleY:c}}var r0;function mY(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?w_:mN(e.a,e.b,e.c,e.d,e.e,e.f)}function gY(t){return t==null||(r0||(r0=document.createElementNS("http://www.w3.org/2000/svg","g")),r0.setAttribute("transform",t),!(t=r0.transform.baseVal.consolidate()))?w_:(t=t.matrix,mN(t.a,t.b,t.c,t.d,t.e,t.f))}function gN(t,e,n,i){function r(p){return p.length?p.pop()+" ":""}function s(p,m,g,b,v,_){if(p!==g||m!==b){var C=v.push("translate(",null,e,null,n);_.push({i:C-4,x:uo(p,g)},{i:C-2,x:uo(m,b)})}else(g||b)&&v.push("translate("+g+e+b+n)}function l(p,m,g,b){p!==m?(p-m>180?m+=360:m-p>180&&(p+=360),b.push({i:g.push(r(g)+"rotate(",null,i)-2,x:uo(p,m)})):m&&g.push(r(g)+"rotate("+m+i)}function c(p,m,g,b){p!==m?b.push({i:g.push(r(g)+"skewX(",null,i)-2,x:uo(p,m)}):m&&g.push(r(g)+"skewX("+m+i)}function d(p,m,g,b,v,_){if(p!==g||m!==b){var C=v.push(r(v)+"scale(",null,",",null,")");_.push({i:C-4,x:uo(p,g)},{i:C-2,x:uo(m,b)})}else(g!==1||b!==1)&&v.push(r(v)+"scale("+g+","+b+")")}return function(p,m){var g=[],b=[];return p=t(p),m=t(m),s(p.translateX,p.translateY,m.translateX,m.translateY,g,b),l(p.rotate,m.rotate,g,b),c(p.skewX,m.skewX,g,b),d(p.scaleX,p.scaleY,m.scaleX,m.scaleY,g,b),p=m=null,function(v){for(var _=-1,C=b.length,T;++_<C;)g[(T=b[_]).i]=T.x(v);return g.join("")}}}var yY=gN(mY,"px, ","px)","deg)"),bY=gN(gY,", ",")",")"),xY=1e-12;function fT(t){return((t=Math.exp(t))+1/t)/2}function vY(t){return((t=Math.exp(t))-1/t)/2}function _Y(t){return((t=Math.exp(2*t))-1)/(t+1)}const y0=(function t(e,n,i){function r(s,l){var c=s[0],d=s[1],p=s[2],m=l[0],g=l[1],b=l[2],v=m-c,_=g-d,C=v*v+_*_,T,w;if(C<xY)w=Math.log(b/p)/e,T=function(F){return[c+F*v,d+F*_,p*Math.exp(e*F*w)]};else{var k=Math.sqrt(C),R=(b*b-p*p+i*C)/(2*p*n*k),O=(b*b-p*p-i*C)/(2*b*n*k),j=Math.log(Math.sqrt(R*R+1)-R),D=Math.log(Math.sqrt(O*O+1)-O);w=(D-j)/e,T=function(F){var $=F*w,P=fT(j),I=p/(n*k)*(P*_Y(e*$+j)-vY(j));return[c+I*v,d+I*_,p*P/fT(e*$+j)]}}return T.duration=w*1e3*e/Math.SQRT2,T}return r.rho=function(s){var l=Math.max(.001,+s),c=l*l,d=c*c;return t(l,c,d)},r})(Math.SQRT2,2,4);var fh=0,pm=0,lm=0,yN=1e3,H0,mm,P0=0,Sf=0,fb=0,jm=typeof performance=="object"&&performance.now?performance:Date,bN=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function k1(){return Sf||(bN(SY),Sf=jm.now()+fb)}function SY(){Sf=0}function G0(){this._call=this._time=this._next=null}G0.prototype=xN.prototype={constructor:G0,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?k1():+n)+(e==null?0:+e),!this._next&&mm!==this&&(mm?mm._next=this:H0=this,mm=this),this._call=t,this._time=n,T_()},stop:function(){this._call&&(this._call=null,this._time=1/0,T_())}};function xN(t,e,n){var i=new G0;return i.restart(t,e,n),i}function EY(){k1(),++fh;for(var t=H0,e;t;)(e=Sf-t._time)>=0&&t._call.call(void 0,e),t=t._next;--fh}function dT(){Sf=(P0=jm.now())+fb,fh=pm=0;try{EY()}finally{fh=0,TY(),Sf=0}}function wY(){var t=jm.now(),e=t-P0;e>yN&&(fb-=e,P0=t)}function TY(){for(var t,e=H0,n,i=1/0;e;)e._call?(i>e._time&&(i=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:H0=n);mm=t,T_(i)}function T_(t){if(!fh){pm&&(pm=clearTimeout(pm));var e=t-Sf;e>24?(t<1/0&&(pm=setTimeout(dT,t-jm.now()-fb)),lm&&(lm=clearInterval(lm))):(lm||(P0=jm.now(),lm=setInterval(wY,yN)),fh=1,bN(dT))}}function hT(t,e,n){var i=new G0;return e=e==null?0:+e,i.restart(r=>{i.stop(),t(r+e)},e,n),i}var CY=cb("start","end","cancel","interrupt"),AY=[],vN=0,pT=1,C_=2,b0=3,mT=4,A_=5,x0=6;function db(t,e,n,i,r,s){var l=t.__transition;if(!l)t.__transition={};else if(n in l)return;MY(t,n,{name:e,index:i,group:r,on:CY,tween:AY,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:vN})}function O1(t,e){var n=Sl(t,e);if(n.state>vN)throw new Error("too late; already scheduled");return n}function yo(t,e){var n=Sl(t,e);if(n.state>b0)throw new Error("too late; already running");return n}function Sl(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function MY(t,e,n){var i=t.__transition,r;i[e]=n,n.timer=xN(s,0,n.time);function s(p){n.state=pT,n.timer.restart(l,n.delay,n.time),n.delay<=p&&l(p-n.delay)}function l(p){var m,g,b,v;if(n.state!==pT)return d();for(m in i)if(v=i[m],v.name===n.name){if(v.state===b0)return hT(l);v.state===mT?(v.state=x0,v.timer.stop(),v.on.call("interrupt",t,t.__data__,v.index,v.group),delete i[m]):+m<e&&(v.state=x0,v.timer.stop(),v.on.call("cancel",t,t.__data__,v.index,v.group),delete i[m])}if(hT(function(){n.state===b0&&(n.state=mT,n.timer.restart(c,n.delay,n.time),c(p))}),n.state=C_,n.on.call("start",t,t.__data__,n.index,n.group),n.state===C_){for(n.state=b0,r=new Array(b=n.tween.length),m=0,g=-1;m<b;++m)(v=n.tween[m].value.call(t,t.__data__,n.index,n.group))&&(r[++g]=v);r.length=g+1}}function c(p){for(var m=p<n.duration?n.ease.call(null,p/n.duration):(n.timer.restart(d),n.state=A_,1),g=-1,b=r.length;++g<b;)r[g].call(t,m);n.state===A_&&(n.on.call("end",t,t.__data__,n.index,n.group),d())}function d(){n.state=x0,n.timer.stop(),delete i[e];for(var p in i)return;delete t.__transition}}function v0(t,e){var n=t.__transition,i,r,s=!0,l;if(n){e=e==null?null:e+"";for(l in n){if((i=n[l]).name!==e){s=!1;continue}r=i.state>C_&&i.state<A_,i.state=x0,i.timer.stop(),i.on.call(r?"interrupt":"cancel",t,t.__data__,i.index,i.group),delete n[l]}s&&delete t.__transition}}function RY(t){return this.each(function(){v0(this,t)})}function NY(t,e){var n,i;return function(){var r=yo(this,t),s=r.tween;if(s!==n){i=n=s;for(var l=0,c=i.length;l<c;++l)if(i[l].name===e){i=i.slice(),i.splice(l,1);break}}r.tween=i}}function kY(t,e,n){var i,r;if(typeof n!="function")throw new Error;return function(){var s=yo(this,t),l=s.tween;if(l!==i){r=(i=l).slice();for(var c={name:e,value:n},d=0,p=r.length;d<p;++d)if(r[d].name===e){r[d]=c;break}d===p&&r.push(c)}s.tween=r}}function OY(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i=Sl(this.node(),n).tween,r=0,s=i.length,l;r<s;++r)if((l=i[r]).name===t)return l.value;return null}return this.each((e==null?NY:kY)(n,t,e))}function D1(t,e,n){var i=t._id;return t.each(function(){var r=yo(this,i);(r.value||(r.value={}))[e]=n.apply(this,arguments)}),function(r){return Sl(r,i).value[e]}}function _N(t,e){var n;return(typeof e=="number"?uo:e instanceof _f?j0:(n=_f(e))?(e=n,j0):pN)(t,e)}function DY(t){return function(){this.removeAttribute(t)}}function zY(t){return function(){this.removeAttributeNS(t.space,t.local)}}function BY(t,e,n){var i,r=n+"",s;return function(){var l=this.getAttribute(t);return l===r?null:l===i?s:s=e(i=l,n)}}function LY(t,e,n){var i,r=n+"",s;return function(){var l=this.getAttributeNS(t.space,t.local);return l===r?null:l===i?s:s=e(i=l,n)}}function UY(t,e,n){var i,r,s;return function(){var l,c=n(this),d;return c==null?void this.removeAttribute(t):(l=this.getAttribute(t),d=c+"",l===d?null:l===i&&d===r?s:(r=d,s=e(i=l,c)))}}function IY(t,e,n){var i,r,s;return function(){var l,c=n(this),d;return c==null?void this.removeAttributeNS(t.space,t.local):(l=this.getAttributeNS(t.space,t.local),d=c+"",l===d?null:l===i&&d===r?s:(r=d,s=e(i=l,c)))}}function jY(t,e){var n=ub(t),i=n==="transform"?bY:_N;return this.attrTween(t,typeof e=="function"?(n.local?IY:UY)(n,i,D1(this,"attr."+t,e)):e==null?(n.local?zY:DY)(n):(n.local?LY:BY)(n,i,e))}function HY(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function PY(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function GY(t,e){var n,i;function r(){var s=e.apply(this,arguments);return s!==i&&(n=(i=s)&&PY(t,s)),n}return r._value=e,r}function FY(t,e){var n,i;function r(){var s=e.apply(this,arguments);return s!==i&&(n=(i=s)&&HY(t,s)),n}return r._value=e,r}function qY(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var i=ub(t);return this.tween(n,(i.local?GY:FY)(i,e))}function YY(t,e){return function(){O1(this,t).delay=+e.apply(this,arguments)}}function VY(t,e){return e=+e,function(){O1(this,t).delay=e}}function XY(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?YY:VY)(e,t)):Sl(this.node(),e).delay}function KY(t,e){return function(){yo(this,t).duration=+e.apply(this,arguments)}}function WY(t,e){return e=+e,function(){yo(this,t).duration=e}}function $Y(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?KY:WY)(e,t)):Sl(this.node(),e).duration}function ZY(t,e){if(typeof e!="function")throw new Error;return function(){yo(this,t).ease=e}}function QY(t){var e=this._id;return arguments.length?this.each(ZY(e,t)):Sl(this.node(),e).ease}function JY(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;yo(this,t).ease=n}}function eV(t){if(typeof t!="function")throw new Error;return this.each(JY(this._id,t))}function tV(t){typeof t!="function"&&(t=QR(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var s=e[r],l=s.length,c=i[r]=[],d,p=0;p<l;++p)(d=s[p])&&t.call(d,d.__data__,p,s)&&c.push(d);return new sc(i,this._parents,this._name,this._id)}function nV(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,i=e.length,r=n.length,s=Math.min(i,r),l=new Array(i),c=0;c<s;++c)for(var d=e[c],p=n[c],m=d.length,g=l[c]=new Array(m),b,v=0;v<m;++v)(b=d[v]||p[v])&&(g[v]=b);for(;c<i;++c)l[c]=e[c];return new sc(l,this._parents,this._name,this._id)}function iV(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function rV(t,e,n){var i,r,s=iV(e)?O1:yo;return function(){var l=s(this,t),c=l.on;c!==i&&(r=(i=c).copy()).on(e,n),l.on=r}}function aV(t,e){var n=this._id;return arguments.length<2?Sl(this.node(),n).on.on(t):this.each(rV(n,t,e))}function sV(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function lV(){return this.on("end.remove",sV(this._id))}function oV(t){var e=this._name,n=this._id;typeof t!="function"&&(t=A1(t));for(var i=this._groups,r=i.length,s=new Array(r),l=0;l<r;++l)for(var c=i[l],d=c.length,p=s[l]=new Array(d),m,g,b=0;b<d;++b)(m=c[b])&&(g=t.call(m,m.__data__,b,c))&&("__data__"in m&&(g.__data__=m.__data__),p[b]=g,db(p[b],e,n,b,p,Sl(m,n)));return new sc(s,this._parents,e,n)}function cV(t){var e=this._name,n=this._id;typeof t!="function"&&(t=ZR(t));for(var i=this._groups,r=i.length,s=[],l=[],c=0;c<r;++c)for(var d=i[c],p=d.length,m,g=0;g<p;++g)if(m=d[g]){for(var b=t.call(m,m.__data__,g,d),v,_=Sl(m,n),C=0,T=b.length;C<T;++C)(v=b[C])&&db(v,e,n,C,b,_);s.push(b),l.push(m)}return new sc(s,l,e,n)}var uV=eg.prototype.constructor;function fV(){return new uV(this._groups,this._parents)}function dV(t,e){var n,i,r;return function(){var s=uh(this,t),l=(this.style.removeProperty(t),uh(this,t));return s===l?null:s===n&&l===i?r:r=e(n=s,i=l)}}function SN(t){return function(){this.style.removeProperty(t)}}function hV(t,e,n){var i,r=n+"",s;return function(){var l=uh(this,t);return l===r?null:l===i?s:s=e(i=l,n)}}function pV(t,e,n){var i,r,s;return function(){var l=uh(this,t),c=n(this),d=c+"";return c==null&&(d=c=(this.style.removeProperty(t),uh(this,t))),l===d?null:l===i&&d===r?s:(r=d,s=e(i=l,c))}}function mV(t,e){var n,i,r,s="style."+e,l="end."+s,c;return function(){var d=yo(this,t),p=d.on,m=d.value[s]==null?c||(c=SN(e)):void 0;(p!==n||r!==m)&&(i=(n=p).copy()).on(l,r=m),d.on=i}}function gV(t,e,n){var i=(t+="")=="transform"?yY:_N;return e==null?this.styleTween(t,dV(t,i)).on("end.style."+t,SN(t)):typeof e=="function"?this.styleTween(t,pV(t,i,D1(this,"style."+t,e))).each(mV(this._id,t)):this.styleTween(t,hV(t,i,e),n).on("end.style."+t,null)}function yV(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}function bV(t,e,n){var i,r;function s(){var l=e.apply(this,arguments);return l!==r&&(i=(r=l)&&yV(t,l,n)),i}return s._value=e,s}function xV(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(e==null)return this.tween(i,null);if(typeof e!="function")throw new Error;return this.tween(i,bV(t,e,n??""))}function vV(t){return function(){this.textContent=t}}function _V(t){return function(){var e=t(this);this.textContent=e??""}}function SV(t){return this.tween("text",typeof t=="function"?_V(D1(this,"text",t)):vV(t==null?"":t+""))}function EV(t){return function(e){this.textContent=t.call(this,e)}}function wV(t){var e,n;function i(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&EV(r)),e}return i._value=t,i}function TV(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,wV(t))}function CV(){for(var t=this._name,e=this._id,n=EN(),i=this._groups,r=i.length,s=0;s<r;++s)for(var l=i[s],c=l.length,d,p=0;p<c;++p)if(d=l[p]){var m=Sl(d,e);db(d,t,n,p,l,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new sc(i,this._parents,t,n)}function AV(){var t,e,n=this,i=n._id,r=n.size();return new Promise(function(s,l){var c={value:l},d={value:function(){--r===0&&s()}};n.each(function(){var p=yo(this,i),m=p.on;m!==t&&(e=(t=m).copy(),e._.cancel.push(c),e._.interrupt.push(c),e._.end.push(d)),p.on=e}),r===0&&s()})}var MV=0;function sc(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function EN(){return++MV}var Zo=eg.prototype;sc.prototype={constructor:sc,select:oV,selectAll:cV,selectChild:Zo.selectChild,selectChildren:Zo.selectChildren,filter:tV,merge:nV,selection:fV,transition:CV,call:Zo.call,nodes:Zo.nodes,node:Zo.node,size:Zo.size,empty:Zo.empty,each:Zo.each,on:aV,attr:jY,attrTween:qY,style:gV,styleTween:xV,text:SV,textTween:TV,remove:lV,tween:OY,delay:XY,duration:$Y,ease:QY,easeVarying:eV,end:AV,[Symbol.iterator]:Zo[Symbol.iterator]};function RV(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var NV={time:null,delay:0,duration:250,ease:RV};function kV(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function OV(t){var e,n;t instanceof sc?(e=t._id,t=t._name):(e=EN(),(n=NV).time=k1(),t=t==null?null:t+"");for(var i=this._groups,r=i.length,s=0;s<r;++s)for(var l=i[s],c=l.length,d,p=0;p<c;++p)(d=l[p])&&db(d,t,e,p,l,n||kV(d,e));return new sc(i,this._parents,t,e)}eg.prototype.interrupt=RY;eg.prototype.transition=OV;const a0=t=>()=>t;function DV(t,{sourceEvent:e,target:n,transform:i,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:r}})}function tc(t,e,n){this.k=t,this.x=e,this.y=n}tc.prototype={constructor:tc,scale:function(t){return t===1?this:new tc(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new tc(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var hb=new tc(1,0,0);wN.prototype=tc.prototype;function wN(t){for(;!t.__zoom;)if(!(t=t.parentNode))return hb;return t.__zoom}function vv(t){t.stopImmediatePropagation()}function om(t){t.preventDefault(),t.stopImmediatePropagation()}function zV(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function BV(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function gT(){return this.__zoom||hb}function LV(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function UV(){return navigator.maxTouchPoints||"ontouchstart"in this}function IV(t,e,n){var i=t.invertX(e[0][0])-n[0][0],r=t.invertX(e[1][0])-n[1][0],s=t.invertY(e[0][1])-n[0][1],l=t.invertY(e[1][1])-n[1][1];return t.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),l>s?(s+l)/2:Math.min(0,s)||Math.max(0,l))}function TN(){var t=zV,e=BV,n=IV,i=LV,r=UV,s=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,d=y0,p=cb("start","zoom","end"),m,g,b,v=500,_=150,C=0,T=10;function w(H){H.property("__zoom",gT).on("wheel.zoom",$,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",I).filter(r).on("touchstart.zoom",K).on("touchmove.zoom",G).on("touchend.zoom touchcancel.zoom",te).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(H,W,B,X){var Z=H.selection?H.selection():H;Z.property("__zoom",gT),H!==Z?j(H,W,B,X):Z.interrupt().each(function(){D(this,arguments).event(X).start().zoom(null,typeof W=="function"?W.apply(this,arguments):W).end()})},w.scaleBy=function(H,W,B,X){w.scaleTo(H,function(){var Z=this.__zoom.k,Q=typeof W=="function"?W.apply(this,arguments):W;return Z*Q},B,X)},w.scaleTo=function(H,W,B,X){w.transform(H,function(){var Z=e.apply(this,arguments),Q=this.__zoom,q=B==null?O(Z):typeof B=="function"?B.apply(this,arguments):B,Y=Q.invert(q),ee=typeof W=="function"?W.apply(this,arguments):W;return n(R(k(Q,ee),q,Y),Z,l)},B,X)},w.translateBy=function(H,W,B,X){w.transform(H,function(){return n(this.__zoom.translate(typeof W=="function"?W.apply(this,arguments):W,typeof B=="function"?B.apply(this,arguments):B),e.apply(this,arguments),l)},null,X)},w.translateTo=function(H,W,B,X,Z){w.transform(H,function(){var Q=e.apply(this,arguments),q=this.__zoom,Y=X==null?O(Q):typeof X=="function"?X.apply(this,arguments):X;return n(hb.translate(Y[0],Y[1]).scale(q.k).translate(typeof W=="function"?-W.apply(this,arguments):-W,typeof B=="function"?-B.apply(this,arguments):-B),Q,l)},X,Z)};function k(H,W){return W=Math.max(s[0],Math.min(s[1],W)),W===H.k?H:new tc(W,H.x,H.y)}function R(H,W,B){var X=W[0]-B[0]*H.k,Z=W[1]-B[1]*H.k;return X===H.x&&Z===H.y?H:new tc(H.k,X,Z)}function O(H){return[(+H[0][0]+ +H[1][0])/2,(+H[0][1]+ +H[1][1])/2]}function j(H,W,B,X){H.on("start.zoom",function(){D(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){D(this,arguments).event(X).end()}).tween("zoom",function(){var Z=this,Q=arguments,q=D(Z,Q).event(X),Y=e.apply(Z,Q),ee=B==null?O(Y):typeof B=="function"?B.apply(Z,Q):B,V=Math.max(Y[1][0]-Y[0][0],Y[1][1]-Y[0][1]),oe=Z.__zoom,be=typeof W=="function"?W.apply(Z,Q):W,ve=d(oe.invert(ee).concat(V/oe.k),be.invert(ee).concat(V/be.k));return function(se){if(se===1)se=be;else{var ge=ve(se),le=V/ge[2];se=new tc(le,ee[0]-ge[0]*le,ee[1]-ge[1]*le)}q.zoom(null,se)}})}function D(H,W,B){return!B&&H.__zooming||new F(H,W)}function F(H,W){this.that=H,this.args=W,this.active=0,this.sourceEvent=null,this.extent=e.apply(H,W),this.taps=0}F.prototype={event:function(H){return H&&(this.sourceEvent=H),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(H,W){return this.mouse&&H!=="mouse"&&(this.mouse[1]=W.invert(this.mouse[0])),this.touch0&&H!=="touch"&&(this.touch0[1]=W.invert(this.touch0[0])),this.touch1&&H!=="touch"&&(this.touch1[1]=W.invert(this.touch1[0])),this.that.__zoom=W,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(H){var W=es(this.that).datum();p.call(H,this.that,new DV(H,{sourceEvent:this.sourceEvent,target:w,transform:this.that.__zoom,dispatch:p}),W)}};function $(H,...W){if(!t.apply(this,arguments))return;var B=D(this,W).event(H),X=this.__zoom,Z=Math.max(s[0],Math.min(s[1],X.k*Math.pow(2,i.apply(this,arguments)))),Q=dl(H);if(B.wheel)(B.mouse[0][0]!==Q[0]||B.mouse[0][1]!==Q[1])&&(B.mouse[1]=X.invert(B.mouse[0]=Q)),clearTimeout(B.wheel);else{if(X.k===Z)return;B.mouse=[Q,X.invert(Q)],v0(this),B.start()}om(H),B.wheel=setTimeout(q,_),B.zoom("mouse",n(R(k(X,Z),B.mouse[0],B.mouse[1]),B.extent,l));function q(){B.wheel=null,B.end()}}function P(H,...W){if(b||!t.apply(this,arguments))return;var B=H.currentTarget,X=D(this,W,!0).event(H),Z=es(H.view).on("mousemove.zoom",ee,!0).on("mouseup.zoom",V,!0),Q=dl(H,B),q=H.clientX,Y=H.clientY;oN(H.view),vv(H),X.mouse=[Q,this.__zoom.invert(Q)],v0(this),X.start();function ee(oe){if(om(oe),!X.moved){var be=oe.clientX-q,ve=oe.clientY-Y;X.moved=be*be+ve*ve>C}X.event(oe).zoom("mouse",n(R(X.that.__zoom,X.mouse[0]=dl(oe,B),X.mouse[1]),X.extent,l))}function V(oe){Z.on("mousemove.zoom mouseup.zoom",null),cN(oe.view,X.moved),om(oe),X.event(oe).end()}}function I(H,...W){if(t.apply(this,arguments)){var B=this.__zoom,X=dl(H.changedTouches?H.changedTouches[0]:H,this),Z=B.invert(X),Q=B.k*(H.shiftKey?.5:2),q=n(R(k(B,Q),X,Z),e.apply(this,W),l);om(H),c>0?es(this).transition().duration(c).call(j,q,X,H):es(this).call(w.transform,q,X,H)}}function K(H,...W){if(t.apply(this,arguments)){var B=H.touches,X=B.length,Z=D(this,W,H.changedTouches.length===X).event(H),Q,q,Y,ee;for(vv(H),q=0;q<X;++q)Y=B[q],ee=dl(Y,this),ee=[ee,this.__zoom.invert(ee),Y.identifier],Z.touch0?!Z.touch1&&Z.touch0[2]!==ee[2]&&(Z.touch1=ee,Z.taps=0):(Z.touch0=ee,Q=!0,Z.taps=1+!!m);m&&(m=clearTimeout(m)),Q&&(Z.taps<2&&(g=ee[0],m=setTimeout(function(){m=null},v)),v0(this),Z.start())}}function G(H,...W){if(this.__zooming){var B=D(this,W).event(H),X=H.changedTouches,Z=X.length,Q,q,Y,ee;for(om(H),Q=0;Q<Z;++Q)q=X[Q],Y=dl(q,this),B.touch0&&B.touch0[2]===q.identifier?B.touch0[0]=Y:B.touch1&&B.touch1[2]===q.identifier&&(B.touch1[0]=Y);if(q=B.that.__zoom,B.touch1){var V=B.touch0[0],oe=B.touch0[1],be=B.touch1[0],ve=B.touch1[1],se=(se=be[0]-V[0])*se+(se=be[1]-V[1])*se,ge=(ge=ve[0]-oe[0])*ge+(ge=ve[1]-oe[1])*ge;q=k(q,Math.sqrt(se/ge)),Y=[(V[0]+be[0])/2,(V[1]+be[1])/2],ee=[(oe[0]+ve[0])/2,(oe[1]+ve[1])/2]}else if(B.touch0)Y=B.touch0[0],ee=B.touch0[1];else return;B.zoom("touch",n(R(q,Y,ee),B.extent,l))}}function te(H,...W){if(this.__zooming){var B=D(this,W).event(H),X=H.changedTouches,Z=X.length,Q,q;for(vv(H),b&&clearTimeout(b),b=setTimeout(function(){b=null},v),Q=0;Q<Z;++Q)q=X[Q],B.touch0&&B.touch0[2]===q.identifier?delete B.touch0:B.touch1&&B.touch1[2]===q.identifier&&delete B.touch1;if(B.touch1&&!B.touch0&&(B.touch0=B.touch1,delete B.touch1),B.touch0)B.touch0[1]=this.__zoom.invert(B.touch0[0]);else if(B.end(),B.taps===2&&(q=dl(q,this),Math.hypot(g[0]-q[0],g[1]-q[1])<T)){var Y=es(this).on("dblclick.zoom");Y&&Y.apply(this,arguments)}}}return w.wheelDelta=function(H){return arguments.length?(i=typeof H=="function"?H:a0(+H),w):i},w.filter=function(H){return arguments.length?(t=typeof H=="function"?H:a0(!!H),w):t},w.touchable=function(H){return arguments.length?(r=typeof H=="function"?H:a0(!!H),w):r},w.extent=function(H){return arguments.length?(e=typeof H=="function"?H:a0([[+H[0][0],+H[0][1]],[+H[1][0],+H[1][1]]]),w):e},w.scaleExtent=function(H){return arguments.length?(s[0]=+H[0],s[1]=+H[1],w):[s[0],s[1]]},w.translateExtent=function(H){return arguments.length?(l[0][0]=+H[0][0],l[1][0]=+H[1][0],l[0][1]=+H[0][1],l[1][1]=+H[1][1],w):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},w.constrain=function(H){return arguments.length?(n=H,w):n},w.duration=function(H){return arguments.length?(c=+H,w):c},w.interpolate=function(H){return arguments.length?(d=H,w):d},w.on=function(){var H=p.on.apply(p,arguments);return H===p?w:H},w.clickDistance=function(H){return arguments.length?(C=(H=+H)*H,w):Math.sqrt(C)},w.tapDistance=function(H){return arguments.length?(T=+H,w):T},w}const po={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:e,sourceHandle:n,targetHandle:i})=>`Couldn't create edge for ${t} handle id: "${t==="source"?n:i}", edge id: ${e}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Hm=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],CN=["Enter"," ","Escape"],AN={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:t,x:e,y:n})=>`Moved selected node ${t}. New position, x: ${e}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var dh;(function(t){t.Strict="strict",t.Loose="loose"})(dh||(dh={}));var yf;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(yf||(yf={}));var Pm;(function(t){t.Partial="partial",t.Full="full"})(Pm||(Pm={}));const MN={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var au;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(au||(au={}));var F0;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(F0||(F0={}));var Qe;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(Qe||(Qe={}));const yT={[Qe.Left]:Qe.Right,[Qe.Right]:Qe.Left,[Qe.Top]:Qe.Bottom,[Qe.Bottom]:Qe.Top};function RN(t){return t===null?null:t?"valid":"invalid"}const NN=t=>"id"in t&&"source"in t&&"target"in t,jV=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),z1=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),ng=(t,e=[0,0])=>{const{width:n,height:i}=cc(t),r=t.origin??e,s=n*r[0],l=i*r[1];return{x:t.position.x-s,y:t.position.y-l}},HV=(t,e={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const n=t.reduce((i,r)=>{const s=typeof r=="string";let l=!e.nodeLookup&&!s?r:void 0;e.nodeLookup&&(l=s?e.nodeLookup.get(r):z1(r)?r:e.nodeLookup.get(r.id));const c=l?q0(l,e.nodeOrigin):{x:0,y:0,x2:0,y2:0};return pb(i,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return mb(n)},ig=(t,e={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},i=!1;return t.forEach(r=>{(e.filter===void 0||e.filter(r))&&(n=pb(n,q0(r)),i=!0)}),i?mb(n):{x:0,y:0,width:0,height:0}},B1=(t,e,[n,i,r]=[0,0,1],s=!1,l=!1)=>{const c={...ag(e,[n,i,r]),width:e.width/r,height:e.height/r},d=[];for(const p of t.values()){const{measured:m,selectable:g=!0,hidden:b=!1}=p;if(l&&!g||b)continue;const v=m.width??p.width??p.initialWidth??null,_=m.height??p.height??p.initialHeight??null,C=Gm(c,ph(p)),T=(v??0)*(_??0),w=s&&C>0;(!p.internals.handleBounds||w||C>=T||p.dragging)&&d.push(p)}return d},PV=(t,e)=>{const n=new Set;return t.forEach(i=>{n.add(i.id)}),e.filter(i=>n.has(i.source)||n.has(i.target))};function GV(t,e){const n=new Map,i=e!=null&&e.nodes?new Set(e.nodes.map(r=>r.id)):null;return t.forEach(r=>{r.measured.width&&r.measured.height&&((e==null?void 0:e.includeHiddenNodes)||!r.hidden)&&(!i||i.has(r.id))&&n.set(r.id,r)}),n}async function FV({nodes:t,width:e,height:n,panZoom:i,minZoom:r,maxZoom:s},l){if(t.size===0)return Promise.resolve(!0);const c=GV(t,l),d=ig(c),p=L1(d,e,n,(l==null?void 0:l.minZoom)??r,(l==null?void 0:l.maxZoom)??s,(l==null?void 0:l.padding)??.1);return await i.setViewport(p,{duration:l==null?void 0:l.duration,ease:l==null?void 0:l.ease,interpolate:l==null?void 0:l.interpolate}),Promise.resolve(!0)}function kN({nodeId:t,nextPosition:e,nodeLookup:n,nodeOrigin:i=[0,0],nodeExtent:r,onError:s}){const l=n.get(t),c=l.parentId?n.get(l.parentId):void 0,{x:d,y:p}=c?c.internals.positionAbsolute:{x:0,y:0},m=l.origin??i;let g=l.extent||r;if(l.extent==="parent"&&!l.expandParent)if(!c)s==null||s("005",po.error005());else{const v=c.measured.width,_=c.measured.height;v&&_&&(g=[[d,p],[d+v,p+_]])}else c&&mh(l.extent)&&(g=[[l.extent[0][0]+d,l.extent[0][1]+p],[l.extent[1][0]+d,l.extent[1][1]+p]]);const b=mh(g)?Ef(e,g,l.measured):e;return(l.measured.width===void 0||l.measured.height===void 0)&&(s==null||s("015",po.error015())),{position:{x:b.x-d+(l.measured.width??0)*m[0],y:b.y-p+(l.measured.height??0)*m[1]},positionAbsolute:b}}async function qV({nodesToRemove:t=[],edgesToRemove:e=[],nodes:n,edges:i,onBeforeDelete:r}){const s=new Set(t.map(b=>b.id)),l=[];for(const b of n){if(b.deletable===!1)continue;const v=s.has(b.id),_=!v&&b.parentId&&l.find(C=>C.id===b.parentId);(v||_)&&l.push(b)}const c=new Set(e.map(b=>b.id)),d=i.filter(b=>b.deletable!==!1),m=PV(l,d);for(const b of d)c.has(b.id)&&!m.find(_=>_.id===b.id)&&m.push(b);if(!r)return{edges:m,nodes:l};const g=await r({nodes:l,edges:m});return typeof g=="boolean"?g?{edges:m,nodes:l}:{edges:[],nodes:[]}:g}const hh=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),Ef=(t={x:0,y:0},e,n)=>({x:hh(t.x,e[0][0],e[1][0]-((n==null?void 0:n.width)??0)),y:hh(t.y,e[0][1],e[1][1]-((n==null?void 0:n.height)??0))});function ON(t,e,n){const{width:i,height:r}=cc(n),{x:s,y:l}=n.internals.positionAbsolute;return Ef(t,[[s,l],[s+i,l+r]],e)}const bT=(t,e,n)=>t<e?hh(Math.abs(t-e),1,e)/e:t>n?-hh(Math.abs(t-n),1,e)/e:0,DN=(t,e,n=15,i=40)=>{const r=bT(t.x,i,e.width-i)*n,s=bT(t.y,i,e.height-i)*n;return[r,s]},pb=(t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}),M_=({x:t,y:e,width:n,height:i})=>({x:t,y:e,x2:t+n,y2:e+i}),mb=({x:t,y:e,x2:n,y2:i})=>({x:t,y:e,width:n-t,height:i-e}),ph=(t,e=[0,0])=>{var r,s;const{x:n,y:i}=z1(t)?t.internals.positionAbsolute:ng(t,e);return{x:n,y:i,width:((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth??0,height:((s=t.measured)==null?void 0:s.height)??t.height??t.initialHeight??0}},q0=(t,e=[0,0])=>{var r,s;const{x:n,y:i}=z1(t)?t.internals.positionAbsolute:ng(t,e);return{x:n,y:i,x2:n+(((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth??0),y2:i+(((s=t.measured)==null?void 0:s.height)??t.height??t.initialHeight??0)}},zN=(t,e)=>mb(pb(M_(t),M_(e))),Gm=(t,e)=>{const n=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),i=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(n*i)},xT=t=>gl(t.width)&&gl(t.height)&&gl(t.x)&&gl(t.y),gl=t=>!isNaN(t)&&isFinite(t),YV=(t,e)=>{},rg=(t,e=[1,1])=>({x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}),ag=({x:t,y:e},[n,i,r],s=!1,l=[1,1])=>{const c={x:(t-n)/r,y:(e-i)/r};return s?rg(c,l):c},Y0=({x:t,y:e},[n,i,r])=>({x:t*r+n,y:e*r+i});function jd(t,e){if(typeof t=="number")return Math.floor((e-e/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(n)}if(typeof t=="string"&&t.endsWith("%")){const n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(e*n*.01)}return console.error(`[React Flow] The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function VV(t,e,n){if(typeof t=="string"||typeof t=="number"){const i=jd(t,n),r=jd(t,e);return{top:i,right:r,bottom:i,left:r,x:r*2,y:i*2}}if(typeof t=="object"){const i=jd(t.top??t.y??0,n),r=jd(t.bottom??t.y??0,n),s=jd(t.left??t.x??0,e),l=jd(t.right??t.x??0,e);return{top:i,right:l,bottom:r,left:s,x:s+l,y:i+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function XV(t,e,n,i,r,s){const{x:l,y:c}=Y0(t,[e,n,i]),{x:d,y:p}=Y0({x:t.x+t.width,y:t.y+t.height},[e,n,i]),m=r-d,g=s-p;return{left:Math.floor(l),top:Math.floor(c),right:Math.floor(m),bottom:Math.floor(g)}}const L1=(t,e,n,i,r,s)=>{const l=VV(s,e,n),c=(e-l.x)/t.width,d=(n-l.y)/t.height,p=Math.min(c,d),m=hh(p,i,r),g=t.x+t.width/2,b=t.y+t.height/2,v=e/2-g*m,_=n/2-b*m,C=XV(t,v,_,m,e,n),T={left:Math.min(C.left-l.left,0),top:Math.min(C.top-l.top,0),right:Math.min(C.right-l.right,0),bottom:Math.min(C.bottom-l.bottom,0)};return{x:v-T.left+T.right,y:_-T.top+T.bottom,zoom:m}},Fm=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function mh(t){return t!=null&&t!=="parent"}function cc(t){var e,n;return{width:((e=t.measured)==null?void 0:e.width)??t.width??t.initialWidth??0,height:((n=t.measured)==null?void 0:n.height)??t.height??t.initialHeight??0}}function BN(t){var e,n;return(((e=t.measured)==null?void 0:e.width)??t.width??t.initialWidth)!==void 0&&(((n=t.measured)==null?void 0:n.height)??t.height??t.initialHeight)!==void 0}function LN(t,e={width:0,height:0},n,i,r){const s={...t},l=i.get(n);if(l){const c=l.origin||r;s.x+=l.internals.positionAbsolute.x-(e.width??0)*c[0],s.y+=l.internals.positionAbsolute.y-(e.height??0)*c[1]}return s}function vT(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}function KV(){let t,e;return{promise:new Promise((i,r)=>{t=i,e=r}),resolve:t,reject:e}}function WV(t){return{...AN,...t||{}}}function Cm(t,{snapGrid:e=[0,0],snapToGrid:n=!1,transform:i,containerBounds:r}){const{x:s,y:l}=yl(t),c=ag({x:s-((r==null?void 0:r.left)??0),y:l-((r==null?void 0:r.top)??0)},i),{x:d,y:p}=n?rg(c,e):c;return{xSnapped:d,ySnapped:p,...c}}const U1=t=>({width:t.offsetWidth,height:t.offsetHeight}),UN=t=>{var e;return((e=t==null?void 0:t.getRootNode)==null?void 0:e.call(t))||(window==null?void 0:window.document)},$V=["INPUT","SELECT","TEXTAREA"];function IN(t){var i,r;const e=((r=(i=t.composedPath)==null?void 0:i.call(t))==null?void 0:r[0])||t.target;return(e==null?void 0:e.nodeType)!==1?!1:$V.includes(e.nodeName)||e.hasAttribute("contenteditable")||!!e.closest(".nokey")}const jN=t=>"clientX"in t,yl=(t,e)=>{var s,l;const n=jN(t),i=n?t.clientX:(s=t.touches)==null?void 0:s[0].clientX,r=n?t.clientY:(l=t.touches)==null?void 0:l[0].clientY;return{x:i-((e==null?void 0:e.left)??0),y:r-((e==null?void 0:e.top)??0)}},_T=(t,e,n,i,r)=>{const s=e.querySelectorAll(`.${t}`);return!s||!s.length?null:Array.from(s).map(l=>{const c=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:t,nodeId:r,position:l.getAttribute("data-handlepos"),x:(c.left-n.left)/i,y:(c.top-n.top)/i,...U1(l)}})};function HN({sourceX:t,sourceY:e,targetX:n,targetY:i,sourceControlX:r,sourceControlY:s,targetControlX:l,targetControlY:c}){const d=t*.125+r*.375+l*.375+n*.125,p=e*.125+s*.375+c*.375+i*.125,m=Math.abs(d-t),g=Math.abs(p-e);return[d,p,m,g]}function s0(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function ST({pos:t,x1:e,y1:n,x2:i,y2:r,c:s}){switch(t){case Qe.Left:return[e-s0(e-i,s),n];case Qe.Right:return[e+s0(i-e,s),n];case Qe.Top:return[e,n-s0(n-r,s)];case Qe.Bottom:return[e,n+s0(r-n,s)]}}function PN({sourceX:t,sourceY:e,sourcePosition:n=Qe.Bottom,targetX:i,targetY:r,targetPosition:s=Qe.Top,curvature:l=.25}){const[c,d]=ST({pos:n,x1:t,y1:e,x2:i,y2:r,c:l}),[p,m]=ST({pos:s,x1:i,y1:r,x2:t,y2:e,c:l}),[g,b,v,_]=HN({sourceX:t,sourceY:e,targetX:i,targetY:r,sourceControlX:c,sourceControlY:d,targetControlX:p,targetControlY:m});return[`M${t},${e} C${c},${d} ${p},${m} ${i},${r}`,g,b,v,_]}function GN({sourceX:t,sourceY:e,targetX:n,targetY:i}){const r=Math.abs(n-t)/2,s=n<t?n+r:n-r,l=Math.abs(i-e)/2,c=i<e?i+l:i-l;return[s,c,r,l]}function ZV({sourceNode:t,targetNode:e,selected:n=!1,zIndex:i=0,elevateOnSelect:r=!1,zIndexMode:s="basic"}){if(s==="manual")return i;const l=r&&n?i+1e3:i,c=Math.max(t.parentId||r&&t.selected?t.internals.z:0,e.parentId||r&&e.selected?e.internals.z:0);return l+c}function QV({sourceNode:t,targetNode:e,width:n,height:i,transform:r}){const s=pb(q0(t),q0(e));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const l={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:i/r[2]};return Gm(l,mb(s))>0}const JV=({source:t,sourceHandle:e,target:n,targetHandle:i})=>`xy-edge__${t}${e||""}-${n}${i||""}`,eX=(t,e)=>e.some(n=>n.source===t.source&&n.target===t.target&&(n.sourceHandle===t.sourceHandle||!n.sourceHandle&&!t.sourceHandle)&&(n.targetHandle===t.targetHandle||!n.targetHandle&&!t.targetHandle)),tX=(t,e,n={})=>{if(!t.source||!t.target)return e;const i=n.getEdgeId||JV;let r;return NN(t)?r={...t}:r={...t,id:i(t)},eX(r,e)?e:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,e.concat(r))};function FN({sourceX:t,sourceY:e,targetX:n,targetY:i}){const[r,s,l,c]=GN({sourceX:t,sourceY:e,targetX:n,targetY:i});return[`M ${t},${e}L ${n},${i}`,r,s,l,c]}const ET={[Qe.Left]:{x:-1,y:0},[Qe.Right]:{x:1,y:0},[Qe.Top]:{x:0,y:-1},[Qe.Bottom]:{x:0,y:1}},nX=({source:t,sourcePosition:e=Qe.Bottom,target:n})=>e===Qe.Left||e===Qe.Right?t.x<n.x?{x:1,y:0}:{x:-1,y:0}:t.y<n.y?{x:0,y:1}:{x:0,y:-1},wT=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function iX({source:t,sourcePosition:e=Qe.Bottom,target:n,targetPosition:i=Qe.Top,center:r,offset:s,stepPosition:l}){const c=ET[e],d=ET[i],p={x:t.x+c.x*s,y:t.y+c.y*s},m={x:n.x+d.x*s,y:n.y+d.y*s},g=nX({source:p,sourcePosition:e,target:m}),b=g.x!==0?"x":"y",v=g[b];let _=[],C,T;const w={x:0,y:0},k={x:0,y:0},[,,R,O]=GN({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(c[b]*d[b]===-1){b==="x"?(C=r.x??p.x+(m.x-p.x)*l,T=r.y??(p.y+m.y)/2):(C=r.x??(p.x+m.x)/2,T=r.y??p.y+(m.y-p.y)*l);const D=[{x:C,y:p.y},{x:C,y:m.y}],F=[{x:p.x,y:T},{x:m.x,y:T}];c[b]===v?_=b==="x"?D:F:_=b==="x"?F:D}else{const D=[{x:p.x,y:m.y}],F=[{x:m.x,y:p.y}];if(b==="x"?_=c.x===v?F:D:_=c.y===v?D:F,e===i){const G=Math.abs(t[b]-n[b]);if(G<=s){const te=Math.min(s-1,s-G);c[b]===v?w[b]=(p[b]>t[b]?-1:1)*te:k[b]=(m[b]>n[b]?-1:1)*te}}if(e!==i){const G=b==="x"?"y":"x",te=c[b]===d[G],H=p[G]>m[G],W=p[G]<m[G];(c[b]===1&&(!te&&H||te&&W)||c[b]!==1&&(!te&&W||te&&H))&&(_=b==="x"?D:F)}const $={x:p.x+w.x,y:p.y+w.y},P={x:m.x+k.x,y:m.y+k.y},I=Math.max(Math.abs($.x-_[0].x),Math.abs(P.x-_[0].x)),K=Math.max(Math.abs($.y-_[0].y),Math.abs(P.y-_[0].y));I>=K?(C=($.x+P.x)/2,T=_[0].y):(C=_[0].x,T=($.y+P.y)/2)}return[[t,{x:p.x+w.x,y:p.y+w.y},..._,{x:m.x+k.x,y:m.y+k.y},n],C,T,R,O]}function rX(t,e,n,i){const r=Math.min(wT(t,e)/2,wT(e,n)/2,i),{x:s,y:l}=e;if(t.x===s&&s===n.x||t.y===l&&l===n.y)return`L${s} ${l}`;if(t.y===l){const p=t.x<n.x?-1:1,m=t.y<n.y?1:-1;return`L ${s+r*p},${l}Q ${s},${l} ${s},${l+r*m}`}const c=t.x<n.x?1:-1,d=t.y<n.y?-1:1;return`L ${s},${l+r*d}Q ${s},${l} ${s+r*c},${l}`}function R_({sourceX:t,sourceY:e,sourcePosition:n=Qe.Bottom,targetX:i,targetY:r,targetPosition:s=Qe.Top,borderRadius:l=5,centerX:c,centerY:d,offset:p=20,stepPosition:m=.5}){const[g,b,v,_,C]=iX({source:{x:t,y:e},sourcePosition:n,target:{x:i,y:r},targetPosition:s,center:{x:c,y:d},offset:p,stepPosition:m});return[g.reduce((w,k,R)=>{let O="";return R>0&&R<g.length-1?O=rX(g[R-1],k,g[R+1],l):O=`${R===0?"M":"L"}${k.x} ${k.y}`,w+=O,w},""),b,v,_,C]}function TT(t){var e;return t&&!!(t.internals.handleBounds||(e=t.handles)!=null&&e.length)&&!!(t.measured.width||t.width||t.initialWidth)}function aX(t){var g;const{sourceNode:e,targetNode:n}=t;if(!TT(e)||!TT(n))return null;const i=e.internals.handleBounds||CT(e.handles),r=n.internals.handleBounds||CT(n.handles),s=AT((i==null?void 0:i.source)??[],t.sourceHandle),l=AT(t.connectionMode===dh.Strict?(r==null?void 0:r.target)??[]:((r==null?void 0:r.target)??[]).concat((r==null?void 0:r.source)??[]),t.targetHandle);if(!s||!l)return(g=t.onError)==null||g.call(t,"008",po.error008(s?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const c=(s==null?void 0:s.position)||Qe.Bottom,d=(l==null?void 0:l.position)||Qe.Top,p=wf(e,s,c),m=wf(n,l,d);return{sourceX:p.x,sourceY:p.y,targetX:m.x,targetY:m.y,sourcePosition:c,targetPosition:d}}function CT(t){if(!t)return null;const e=[],n=[];for(const i of t)i.width=i.width??1,i.height=i.height??1,i.type==="source"?e.push(i):i.type==="target"&&n.push(i);return{source:e,target:n}}function wf(t,e,n=Qe.Left,i=!1){const r=((e==null?void 0:e.x)??0)+t.internals.positionAbsolute.x,s=((e==null?void 0:e.y)??0)+t.internals.positionAbsolute.y,{width:l,height:c}=e??cc(t);if(i)return{x:r+l/2,y:s+c/2};switch((e==null?void 0:e.position)??n){case Qe.Top:return{x:r+l/2,y:s};case Qe.Right:return{x:r+l,y:s+c/2};case Qe.Bottom:return{x:r+l/2,y:s+c};case Qe.Left:return{x:r,y:s+c/2}}}function AT(t,e){return t&&(e?t.find(n=>n.id===e):t[0])||null}function N_(t,e){return t?typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(i=>`${i}=${t[i]}`).join("&")}`:""}function sX(t,{id:e,defaultColor:n,defaultMarkerStart:i,defaultMarkerEnd:r}){const s=new Set;return t.reduce((l,c)=>([c.markerStart||i,c.markerEnd||r].forEach(d=>{if(d&&typeof d=="object"){const p=N_(d,e);s.has(p)||(l.push({id:p,color:d.color||n,...d}),s.add(p))}}),l),[]).sort((l,c)=>l.id.localeCompare(c.id))}const qN=1e3,lX=10,I1={nodeOrigin:[0,0],nodeExtent:Hm,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},oX={...I1,checkEquality:!0};function j1(t,e){const n={...t};for(const i in e)e[i]!==void 0&&(n[i]=e[i]);return n}function cX(t,e,n){const i=j1(I1,n);for(const r of t.values())if(r.parentId)P1(r,t,e,i);else{const s=ng(r,i.nodeOrigin),l=mh(r.extent)?r.extent:i.nodeExtent,c=Ef(s,l,cc(r));r.internals.positionAbsolute=c}}function uX(t,e){if(!t.handles)return t.measured?e==null?void 0:e.internals.handleBounds:void 0;const n=[],i=[];for(const r of t.handles){const s={id:r.id,width:r.width??1,height:r.height??1,nodeId:t.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(s):r.type==="target"&&i.push(s)}return{source:n,target:i}}function H1(t){return t==="manual"}function k_(t,e,n,i={}){var p,m;const r=j1(oX,i),s={i:0},l=new Map(e),c=r!=null&&r.elevateNodesOnSelect&&!H1(r.zIndexMode)?qN:0;let d=t.length>0;e.clear(),n.clear();for(const g of t){let b=l.get(g.id);if(r.checkEquality&&g===(b==null?void 0:b.internals.userNode))e.set(g.id,b);else{const v=ng(g,r.nodeOrigin),_=mh(g.extent)?g.extent:r.nodeExtent,C=Ef(v,_,cc(g));b={...r.defaults,...g,measured:{width:(p=g.measured)==null?void 0:p.width,height:(m=g.measured)==null?void 0:m.height},internals:{positionAbsolute:C,handleBounds:uX(g,b),z:YN(g,c,r.zIndexMode),userNode:g}},e.set(g.id,b)}(b.measured===void 0||b.measured.width===void 0||b.measured.height===void 0)&&!b.hidden&&(d=!1),g.parentId&&P1(b,e,n,i,s)}return d}function fX(t,e){if(!t.parentId)return;const n=e.get(t.parentId);n?n.set(t.id,t):e.set(t.parentId,new Map([[t.id,t]]))}function P1(t,e,n,i,r){const{elevateNodesOnSelect:s,nodeOrigin:l,nodeExtent:c,zIndexMode:d}=j1(I1,i),p=t.parentId,m=e.get(p);if(!m){console.warn(`Parent node ${p} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}fX(t,n),r&&!m.parentId&&m.internals.rootParentIndex===void 0&&d==="auto"&&(m.internals.rootParentIndex=++r.i,m.internals.z=m.internals.z+r.i*lX),r&&m.internals.rootParentIndex!==void 0&&(r.i=m.internals.rootParentIndex);const g=s&&!H1(d)?qN:0,{x:b,y:v,z:_}=dX(t,m,l,c,g,d),{positionAbsolute:C}=t.internals,T=b!==C.x||v!==C.y;(T||_!==t.internals.z)&&e.set(t.id,{...t,internals:{...t.internals,positionAbsolute:T?{x:b,y:v}:C,z:_}})}function YN(t,e,n){const i=gl(t.zIndex)?t.zIndex:0;return H1(n)?i:i+(t.selected?e:0)}function dX(t,e,n,i,r,s){const{x:l,y:c}=e.internals.positionAbsolute,d=cc(t),p=ng(t,n),m=mh(t.extent)?Ef(p,t.extent,d):p;let g=Ef({x:l+m.x,y:c+m.y},i,d);t.extent==="parent"&&(g=ON(g,d,e));const b=YN(t,r,s),v=e.internals.z??0;return{x:g.x,y:g.y,z:v>=b?v+1:b}}function G1(t,e,n,i=[0,0]){var l;const r=[],s=new Map;for(const c of t){const d=e.get(c.parentId);if(!d)continue;const p=((l=s.get(c.parentId))==null?void 0:l.expandedRect)??ph(d),m=zN(p,c.rect);s.set(c.parentId,{expandedRect:m,parent:d})}return s.size>0&&s.forEach(({expandedRect:c,parent:d},p)=>{var R;const m=d.internals.positionAbsolute,g=cc(d),b=d.origin??i,v=c.x<m.x?Math.round(Math.abs(m.x-c.x)):0,_=c.y<m.y?Math.round(Math.abs(m.y-c.y)):0,C=Math.max(g.width,Math.round(c.width)),T=Math.max(g.height,Math.round(c.height)),w=(C-g.width)*b[0],k=(T-g.height)*b[1];(v>0||_>0||w||k)&&(r.push({id:p,type:"position",position:{x:d.position.x-v+w,y:d.position.y-_+k}}),(R=n.get(p))==null||R.forEach(O=>{t.some(j=>j.id===O.id)||r.push({id:O.id,type:"position",position:{x:O.position.x+v,y:O.position.y+_}})})),(g.width<c.width||g.height<c.height||v||_)&&r.push({id:p,type:"dimensions",setAttributes:!0,dimensions:{width:C+(v?b[0]*v-w:0),height:T+(_?b[1]*_-k:0)}})}),r}function hX(t,e,n,i,r,s,l){const c=i==null?void 0:i.querySelector(".xyflow__viewport");let d=!1;if(!c)return{changes:[],updatedInternals:d};const p=[],m=window.getComputedStyle(c),{m22:g}=new window.DOMMatrixReadOnly(m.transform),b=[];for(const v of t.values()){const _=e.get(v.id);if(!_)continue;if(_.hidden){e.set(_.id,{..._,internals:{..._.internals,handleBounds:void 0}}),d=!0;continue}const C=U1(v.nodeElement),T=_.measured.width!==C.width||_.measured.height!==C.height;if(!!(C.width&&C.height&&(T||!_.internals.handleBounds||v.force))){const k=v.nodeElement.getBoundingClientRect(),R=mh(_.extent)?_.extent:s;let{positionAbsolute:O}=_.internals;_.parentId&&_.extent==="parent"?O=ON(O,C,e.get(_.parentId)):R&&(O=Ef(O,R,C));const j={..._,measured:C,internals:{..._.internals,positionAbsolute:O,handleBounds:{source:_T("source",v.nodeElement,k,g,_.id),target:_T("target",v.nodeElement,k,g,_.id)}}};e.set(_.id,j),_.parentId&&P1(j,e,n,{nodeOrigin:r,zIndexMode:l}),d=!0,T&&(p.push({id:_.id,type:"dimensions",dimensions:C}),_.expandParent&&_.parentId&&b.push({id:_.id,parentId:_.parentId,rect:ph(j,r)}))}}if(b.length>0){const v=G1(b,e,n,r);p.push(...v)}return{changes:p,updatedInternals:d}}async function pX({delta:t,panZoom:e,transform:n,translateExtent:i,width:r,height:s}){if(!e||!t.x&&!t.y)return Promise.resolve(!1);const l=await e.setViewportConstrained({x:n[0]+t.x,y:n[1]+t.y,zoom:n[2]},[[0,0],[r,s]],i),c=!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2]);return Promise.resolve(c)}function MT(t,e,n,i,r,s){let l=r;const c=i.get(l)||new Map;i.set(l,c.set(n,e)),l=`${r}-${t}`;const d=i.get(l)||new Map;if(i.set(l,d.set(n,e)),s){l=`${r}-${t}-${s}`;const p=i.get(l)||new Map;i.set(l,p.set(n,e))}}function VN(t,e,n){t.clear(),e.clear();for(const i of n){const{source:r,target:s,sourceHandle:l=null,targetHandle:c=null}=i,d={edgeId:i.id,source:r,target:s,sourceHandle:l,targetHandle:c},p=`${r}-${l}--${s}-${c}`,m=`${s}-${c}--${r}-${l}`;MT("source",d,m,t,r,l),MT("target",d,p,t,s,c),e.set(i.id,i)}}function XN(t,e){if(!t.parentId)return!1;const n=e.get(t.parentId);return n?n.selected?!0:XN(n,e):!1}function RT(t,e,n){var r;let i=t;do{if((r=i==null?void 0:i.matches)!=null&&r.call(i,e))return!0;if(i===n)return!1;i=i==null?void 0:i.parentElement}while(i);return!1}function mX(t,e,n,i){const r=new Map;for(const[s,l]of t)if((l.selected||l.id===i)&&(!l.parentId||!XN(l,t))&&(l.draggable||e&&typeof l.draggable>"u")){const c=t.get(s);c&&r.set(s,{id:s,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return r}function _v({nodeId:t,dragItems:e,nodeLookup:n,dragging:i=!0}){var l,c,d;const r=[];for(const[p,m]of e){const g=(l=n.get(p))==null?void 0:l.internals.userNode;g&&r.push({...g,position:m.position,dragging:i})}if(!t)return[r[0],r];const s=(c=n.get(t))==null?void 0:c.internals.userNode;return[s?{...s,position:((d=e.get(t))==null?void 0:d.position)||s.position,dragging:i}:r[0],r]}function gX({dragItems:t,snapGrid:e,x:n,y:i}){const r=t.values().next().value;if(!r)return null;const s={x:n-r.distance.x,y:i-r.distance.y},l=rg(s,e);return{x:l.x-s.x,y:l.y-s.y}}function yX({onNodeMouseDown:t,getStoreItems:e,onDragStart:n,onDrag:i,onDragStop:r}){let s={x:null,y:null},l=0,c=new Map,d=!1,p={x:0,y:0},m=null,g=!1,b=null,v=!1,_=!1,C=null;function T({noDragClassName:k,handleSelector:R,domNode:O,isSelectable:j,nodeId:D,nodeClickDistance:F=0}){b=es(O);function $({x:G,y:te}){const{nodeLookup:H,nodeExtent:W,snapGrid:B,snapToGrid:X,nodeOrigin:Z,onNodeDrag:Q,onSelectionDrag:q,onError:Y,updateNodePositions:ee}=e();s={x:G,y:te};let V=!1;const oe=c.size>1,be=oe&&W?M_(ig(c)):null,ve=oe&&X?gX({dragItems:c,snapGrid:B,x:G,y:te}):null;for(const[se,ge]of c){if(!H.has(se))continue;let le={x:G-ge.distance.x,y:te-ge.distance.y};X&&(le=ve?{x:Math.round(le.x+ve.x),y:Math.round(le.y+ve.y)}:rg(le,B));let Re=null;if(oe&&W&&!ge.extent&&be){const{positionAbsolute:Le}=ge.internals,Ve=Le.x-be.x+W[0][0],ut=Le.x+ge.measured.width-be.x2+W[1][0],He=Le.y-be.y+W[0][1],At=Le.y+ge.measured.height-be.y2+W[1][1];Re=[[Ve,He],[ut,At]]}const{position:Ie,positionAbsolute:Ue}=kN({nodeId:se,nextPosition:le,nodeLookup:H,nodeExtent:Re||W,nodeOrigin:Z,onError:Y});V=V||ge.position.x!==Ie.x||ge.position.y!==Ie.y,ge.position=Ie,ge.internals.positionAbsolute=Ue}if(_=_||V,!!V&&(ee(c,!0),C&&(i||Q||!D&&q))){const[se,ge]=_v({nodeId:D,dragItems:c,nodeLookup:H});i==null||i(C,c,se,ge),Q==null||Q(C,se,ge),D||q==null||q(C,ge)}}async function P(){if(!m)return;const{transform:G,panBy:te,autoPanSpeed:H,autoPanOnNodeDrag:W}=e();if(!W){d=!1,cancelAnimationFrame(l);return}const[B,X]=DN(p,m,H);(B!==0||X!==0)&&(s.x=(s.x??0)-B/G[2],s.y=(s.y??0)-X/G[2],await te({x:B,y:X})&&$(s)),l=requestAnimationFrame(P)}function I(G){var oe;const{nodeLookup:te,multiSelectionActive:H,nodesDraggable:W,transform:B,snapGrid:X,snapToGrid:Z,selectNodesOnDrag:Q,onNodeDragStart:q,onSelectionDragStart:Y,unselectNodesAndEdges:ee}=e();g=!0,(!Q||!j)&&!H&&D&&((oe=te.get(D))!=null&&oe.selected||ee()),j&&Q&&D&&(t==null||t(D));const V=Cm(G.sourceEvent,{transform:B,snapGrid:X,snapToGrid:Z,containerBounds:m});if(s=V,c=mX(te,W,V,D),c.size>0&&(n||q||!D&&Y)){const[be,ve]=_v({nodeId:D,dragItems:c,nodeLookup:te});n==null||n(G.sourceEvent,c,be,ve),q==null||q(G.sourceEvent,be,ve),D||Y==null||Y(G.sourceEvent,ve)}}const K=uN().clickDistance(F).on("start",G=>{const{domNode:te,nodeDragThreshold:H,transform:W,snapGrid:B,snapToGrid:X}=e();m=(te==null?void 0:te.getBoundingClientRect())||null,v=!1,_=!1,C=G.sourceEvent,H===0&&I(G),s=Cm(G.sourceEvent,{transform:W,snapGrid:B,snapToGrid:X,containerBounds:m}),p=yl(G.sourceEvent,m)}).on("drag",G=>{const{autoPanOnNodeDrag:te,transform:H,snapGrid:W,snapToGrid:B,nodeDragThreshold:X,nodeLookup:Z}=e(),Q=Cm(G.sourceEvent,{transform:H,snapGrid:W,snapToGrid:B,containerBounds:m});if(C=G.sourceEvent,(G.sourceEvent.type==="touchmove"&&G.sourceEvent.touches.length>1||D&&!Z.has(D))&&(v=!0),!v){if(!d&&te&&g&&(d=!0,P()),!g){const q=yl(G.sourceEvent,m),Y=q.x-p.x,ee=q.y-p.y;Math.sqrt(Y*Y+ee*ee)>X&&I(G)}(s.x!==Q.xSnapped||s.y!==Q.ySnapped)&&c&&g&&(p=yl(G.sourceEvent,m),$(Q))}}).on("end",G=>{if(!(!g||v)&&(d=!1,g=!1,cancelAnimationFrame(l),c.size>0)){const{nodeLookup:te,updateNodePositions:H,onNodeDragStop:W,onSelectionDragStop:B}=e();if(_&&(H(c,!1),_=!1),r||W||!D&&B){const[X,Z]=_v({nodeId:D,dragItems:c,nodeLookup:te,dragging:!1});r==null||r(G.sourceEvent,c,X,Z),W==null||W(G.sourceEvent,X,Z),D||B==null||B(G.sourceEvent,Z)}}}).filter(G=>{const te=G.target;return!G.button&&(!k||!RT(te,`.${k}`,O))&&(!R||RT(te,R,O))});b.call(K)}function w(){b==null||b.on(".drag",null)}return{update:T,destroy:w}}function bX(t,e,n){const i=[],r={x:t.x-n,y:t.y-n,width:n*2,height:n*2};for(const s of e.values())Gm(r,ph(s))>0&&i.push(s);return i}const xX=250;function vX(t,e,n,i){var c,d;let r=[],s=1/0;const l=bX(t,n,e+xX);for(const p of l){const m=[...((c=p.internals.handleBounds)==null?void 0:c.source)??[],...((d=p.internals.handleBounds)==null?void 0:d.target)??[]];for(const g of m){if(i.nodeId===g.nodeId&&i.type===g.type&&i.id===g.id)continue;const{x:b,y:v}=wf(p,g,g.position,!0),_=Math.sqrt(Math.pow(b-t.x,2)+Math.pow(v-t.y,2));_>e||(_<s?(r=[{...g,x:b,y:v}],s=_):_===s&&r.push({...g,x:b,y:v}))}}if(!r.length)return null;if(r.length>1){const p=i.type==="source"?"target":"source";return r.find(m=>m.type===p)??r[0]}return r[0]}function KN(t,e,n,i,r,s=!1){var p,m,g;const l=i.get(t);if(!l)return null;const c=r==="strict"?(p=l.internals.handleBounds)==null?void 0:p[e]:[...((m=l.internals.handleBounds)==null?void 0:m.source)??[],...((g=l.internals.handleBounds)==null?void 0:g.target)??[]],d=(n?c==null?void 0:c.find(b=>b.id===n):c==null?void 0:c[0])??null;return d&&s?{...d,...wf(l,d,d.position,!0)}:d}function WN(t,e){return t||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function _X(t,e){let n=null;return e?n=!0:t&&!e&&(n=!1),n}const $N=()=>!0;function SX(t,{connectionMode:e,connectionRadius:n,handleId:i,nodeId:r,edgeUpdaterType:s,isTarget:l,domNode:c,nodeLookup:d,lib:p,autoPanOnConnect:m,flowId:g,panBy:b,cancelConnection:v,onConnectStart:_,onConnect:C,onConnectEnd:T,isValidConnection:w=$N,onReconnectEnd:k,updateConnection:R,getTransform:O,getFromHandle:j,autoPanSpeed:D,dragThreshold:F=1,handleDomNode:$}){const P=UN(t.target);let I=0,K;const{x:G,y:te}=yl(t),H=WN(s,$),W=c==null?void 0:c.getBoundingClientRect();let B=!1;if(!W||!H)return;const X=KN(r,H,i,d,e);if(!X)return;let Z=yl(t,W),Q=!1,q=null,Y=!1,ee=null;function V(){if(!m||!W)return;const[Ie,Ue]=DN(Z,W,D);b({x:Ie,y:Ue}),I=requestAnimationFrame(V)}const oe={...X,nodeId:r,type:H,position:X.position},be=d.get(r);let se={inProgress:!0,isValid:null,from:wf(be,oe,Qe.Left,!0),fromHandle:oe,fromPosition:oe.position,fromNode:be,to:Z,toHandle:null,toPosition:yT[oe.position],toNode:null,pointer:Z};function ge(){B=!0,R(se),_==null||_(t,{nodeId:r,handleId:i,handleType:H})}F===0&&ge();function le(Ie){if(!B){const{x:At,y:zn}=yl(Ie),Bn=At-G,bn=zn-te;if(!(Bn*Bn+bn*bn>F*F))return;ge()}if(!j()||!oe){Re(Ie);return}const Ue=O();Z=yl(Ie,W),K=vX(ag(Z,Ue,!1,[1,1]),n,d,oe),Q||(V(),Q=!0);const Le=ZN(Ie,{handle:K,connectionMode:e,fromNodeId:r,fromHandleId:i,fromType:l?"target":"source",isValidConnection:w,doc:P,lib:p,flowId:g,nodeLookup:d});ee=Le.handleDomNode,q=Le.connection,Y=_X(!!K,Le.isValid);const Ve=d.get(r),ut=Ve?wf(Ve,oe,Qe.Left,!0):se.from,He={...se,from:ut,isValid:Y,to:Le.toHandle&&Y?Y0({x:Le.toHandle.x,y:Le.toHandle.y},Ue):Z,toHandle:Le.toHandle,toPosition:Y&&Le.toHandle?Le.toHandle.position:yT[oe.position],toNode:Le.toHandle?d.get(Le.toHandle.nodeId):null,pointer:Z};R(He),se=He}function Re(Ie){if(!("touches"in Ie&&Ie.touches.length>0)){if(B){(K||ee)&&q&&Y&&(C==null||C(q));const{inProgress:Ue,...Le}=se,Ve={...Le,toPosition:se.toHandle?se.toPosition:null};T==null||T(Ie,Ve),s&&(k==null||k(Ie,Ve))}v(),cancelAnimationFrame(I),Q=!1,Y=!1,q=null,ee=null,P.removeEventListener("mousemove",le),P.removeEventListener("mouseup",Re),P.removeEventListener("touchmove",le),P.removeEventListener("touchend",Re)}}P.addEventListener("mousemove",le),P.addEventListener("mouseup",Re),P.addEventListener("touchmove",le),P.addEventListener("touchend",Re)}function ZN(t,{handle:e,connectionMode:n,fromNodeId:i,fromHandleId:r,fromType:s,doc:l,lib:c,flowId:d,isValidConnection:p=$N,nodeLookup:m}){const g=s==="target",b=e?l.querySelector(`.${c}-flow__handle[data-id="${d}-${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`):null,{x:v,y:_}=yl(t),C=l.elementFromPoint(v,_),T=C!=null&&C.classList.contains(`${c}-flow__handle`)?C:b,w={handleDomNode:T,isValid:!1,connection:null,toHandle:null};if(T){const k=WN(void 0,T),R=T.getAttribute("data-nodeid"),O=T.getAttribute("data-handleid"),j=T.classList.contains("connectable"),D=T.classList.contains("connectableend");if(!R||!k)return w;const F={source:g?R:i,sourceHandle:g?O:r,target:g?i:R,targetHandle:g?r:O};w.connection=F;const P=j&&D&&(n===dh.Strict?g&&k==="source"||!g&&k==="target":R!==i||O!==r);w.isValid=P&&p(F),w.toHandle=KN(R,k,O,m,n,!0)}return w}const O_={onPointerDown:SX,isValid:ZN};function EX({domNode:t,panZoom:e,getTransform:n,getViewScale:i}){const r=es(t);function s({translateExtent:c,width:d,height:p,zoomStep:m=1,pannable:g=!0,zoomable:b=!0,inversePan:v=!1}){const _=R=>{if(R.sourceEvent.type!=="wheel"||!e)return;const O=n(),j=R.sourceEvent.ctrlKey&&Fm()?10:1,D=-R.sourceEvent.deltaY*(R.sourceEvent.deltaMode===1?.05:R.sourceEvent.deltaMode?1:.002)*m,F=O[2]*Math.pow(2,D*j);e.scaleTo(F)};let C=[0,0];const T=R=>{(R.sourceEvent.type==="mousedown"||R.sourceEvent.type==="touchstart")&&(C=[R.sourceEvent.clientX??R.sourceEvent.touches[0].clientX,R.sourceEvent.clientY??R.sourceEvent.touches[0].clientY])},w=R=>{const O=n();if(R.sourceEvent.type!=="mousemove"&&R.sourceEvent.type!=="touchmove"||!e)return;const j=[R.sourceEvent.clientX??R.sourceEvent.touches[0].clientX,R.sourceEvent.clientY??R.sourceEvent.touches[0].clientY],D=[j[0]-C[0],j[1]-C[1]];C=j;const F=i()*Math.max(O[2],Math.log(O[2]))*(v?-1:1),$={x:O[0]-D[0]*F,y:O[1]-D[1]*F},P=[[0,0],[d,p]];e.setViewportConstrained({x:$.x,y:$.y,zoom:O[2]},P,c)},k=TN().on("start",T).on("zoom",g?w:null).on("zoom.wheel",b?_:null);r.call(k,{})}function l(){r.on("zoom",null)}return{update:s,destroy:l,pointer:dl}}const gb=t=>({x:t.x,y:t.y,zoom:t.k}),Sv=({x:t,y:e,zoom:n})=>hb.translate(t,e).scale(n),Wd=(t,e)=>t.target.closest(`.${e}`),QN=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),wX=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,Ev=(t,e=0,n=wX,i=()=>{})=>{const r=typeof e=="number"&&e>0;return r||i(),r?t.transition().duration(e).ease(n).on("end",i):t},JN=t=>{const e=t.ctrlKey&&Fm()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e};function TX({zoomPanValues:t,noWheelClassName:e,d3Selection:n,d3Zoom:i,panOnScrollMode:r,panOnScrollSpeed:s,zoomOnPinch:l,onPanZoomStart:c,onPanZoom:d,onPanZoomEnd:p}){return m=>{if(Wd(m,e))return m.ctrlKey&&m.preventDefault(),!1;m.preventDefault(),m.stopImmediatePropagation();const g=n.property("__zoom").k||1;if(m.ctrlKey&&l){const T=dl(m),w=JN(m),k=g*Math.pow(2,w);i.scaleTo(n,k,T,m);return}const b=m.deltaMode===1?20:1;let v=r===yf.Vertical?0:m.deltaX*b,_=r===yf.Horizontal?0:m.deltaY*b;!Fm()&&m.shiftKey&&r!==yf.Vertical&&(v=m.deltaY*b,_=0),i.translateBy(n,-(v/g)*s,-(_/g)*s,{internal:!0});const C=gb(n.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(d==null||d(m,C),t.panScrollTimeout=setTimeout(()=>{p==null||p(m,C),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,c==null||c(m,C))}}function CX({noWheelClassName:t,preventScrolling:e,d3ZoomHandler:n}){return function(i,r){const s=i.type==="wheel",l=!e&&s&&!i.ctrlKey,c=Wd(i,t);if(i.ctrlKey&&s&&c&&i.preventDefault(),l||c)return null;i.preventDefault(),n.call(this,i,r)}}function AX({zoomPanValues:t,onDraggingChange:e,onPanZoomStart:n}){return i=>{var s,l,c;if((s=i.sourceEvent)!=null&&s.internal)return;const r=gb(i.transform);t.mouseButton=((l=i.sourceEvent)==null?void 0:l.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=r,((c=i.sourceEvent)==null?void 0:c.type)==="mousedown"&&e(!0),n&&(n==null||n(i.sourceEvent,r))}}function MX({zoomPanValues:t,panOnDrag:e,onPaneContextMenu:n,onTransformChange:i,onPanZoom:r}){return s=>{var l,c;t.usedRightMouseButton=!!(n&&QN(e,t.mouseButton??0)),(l=s.sourceEvent)!=null&&l.sync||i([s.transform.x,s.transform.y,s.transform.k]),r&&!((c=s.sourceEvent)!=null&&c.internal)&&(r==null||r(s.sourceEvent,gb(s.transform)))}}function RX({zoomPanValues:t,panOnDrag:e,panOnScroll:n,onDraggingChange:i,onPanZoomEnd:r,onPaneContextMenu:s}){return l=>{var c;if(!((c=l.sourceEvent)!=null&&c.internal)&&(t.isZoomingOrPanning=!1,s&&QN(e,t.mouseButton??0)&&!t.usedRightMouseButton&&l.sourceEvent&&s(l.sourceEvent),t.usedRightMouseButton=!1,i(!1),r)){const d=gb(l.transform);t.prevViewport=d,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{r==null||r(l.sourceEvent,d)},n?150:0)}}}function NX({zoomActivationKeyPressed:t,zoomOnScroll:e,zoomOnPinch:n,panOnDrag:i,panOnScroll:r,zoomOnDoubleClick:s,userSelectionActive:l,noWheelClassName:c,noPanClassName:d,lib:p,connectionInProgress:m}){return g=>{var T;const b=t||e,v=n&&g.ctrlKey,_=g.type==="wheel";if(g.button===1&&g.type==="mousedown"&&(Wd(g,`${p}-flow__node`)||Wd(g,`${p}-flow__edge`)))return!0;if(!i&&!b&&!r&&!s&&!n||l||m&&!_||Wd(g,c)&&_||Wd(g,d)&&(!_||r&&_&&!t)||!n&&g.ctrlKey&&_)return!1;if(!n&&g.type==="touchstart"&&((T=g.touches)==null?void 0:T.length)>1)return g.preventDefault(),!1;if(!b&&!r&&!v&&_||!i&&(g.type==="mousedown"||g.type==="touchstart")||Array.isArray(i)&&!i.includes(g.button)&&g.type==="mousedown")return!1;const C=Array.isArray(i)&&i.includes(g.button)||!g.button||g.button<=1;return(!g.ctrlKey||_)&&C}}function kX({domNode:t,minZoom:e,maxZoom:n,translateExtent:i,viewport:r,onPanZoom:s,onPanZoomStart:l,onPanZoomEnd:c,onDraggingChange:d}){const p={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},m=t.getBoundingClientRect(),g=TN().scaleExtent([e,n]).translateExtent(i),b=es(t).call(g);k({x:r.x,y:r.y,zoom:hh(r.zoom,e,n)},[[0,0],[m.width,m.height]],i);const v=b.on("wheel.zoom"),_=b.on("dblclick.zoom");g.wheelDelta(JN);function C(K,G){return b?new Promise(te=>{g==null||g.interpolate((G==null?void 0:G.interpolate)==="linear"?Tm:y0).transform(Ev(b,G==null?void 0:G.duration,G==null?void 0:G.ease,()=>te(!0)),K)}):Promise.resolve(!1)}function T({noWheelClassName:K,noPanClassName:G,onPaneContextMenu:te,userSelectionActive:H,panOnScroll:W,panOnDrag:B,panOnScrollMode:X,panOnScrollSpeed:Z,preventScrolling:Q,zoomOnPinch:q,zoomOnScroll:Y,zoomOnDoubleClick:ee,zoomActivationKeyPressed:V,lib:oe,onTransformChange:be,connectionInProgress:ve,paneClickDistance:se,selectionOnDrag:ge}){H&&!p.isZoomingOrPanning&&w();const le=W&&!V&&!H;g.clickDistance(ge?1/0:!gl(se)||se<0?0:se);const Re=le?TX({zoomPanValues:p,noWheelClassName:K,d3Selection:b,d3Zoom:g,panOnScrollMode:X,panOnScrollSpeed:Z,zoomOnPinch:q,onPanZoomStart:l,onPanZoom:s,onPanZoomEnd:c}):CX({noWheelClassName:K,preventScrolling:Q,d3ZoomHandler:v});if(b.on("wheel.zoom",Re,{passive:!1}),!H){const Ue=AX({zoomPanValues:p,onDraggingChange:d,onPanZoomStart:l});g.on("start",Ue);const Le=MX({zoomPanValues:p,panOnDrag:B,onPaneContextMenu:!!te,onPanZoom:s,onTransformChange:be});g.on("zoom",Le);const Ve=RX({zoomPanValues:p,panOnDrag:B,panOnScroll:W,onPaneContextMenu:te,onPanZoomEnd:c,onDraggingChange:d});g.on("end",Ve)}const Ie=NX({zoomActivationKeyPressed:V,panOnDrag:B,zoomOnScroll:Y,panOnScroll:W,zoomOnDoubleClick:ee,zoomOnPinch:q,userSelectionActive:H,noPanClassName:G,noWheelClassName:K,lib:oe,connectionInProgress:ve});g.filter(Ie),ee?b.on("dblclick.zoom",_):b.on("dblclick.zoom",null)}function w(){g.on("zoom",null)}async function k(K,G,te){const H=Sv(K),W=g==null?void 0:g.constrain()(H,G,te);return W&&await C(W),new Promise(B=>B(W))}async function R(K,G){const te=Sv(K);return await C(te,G),new Promise(H=>H(te))}function O(K){if(b){const G=Sv(K),te=b.property("__zoom");(te.k!==K.zoom||te.x!==K.x||te.y!==K.y)&&(g==null||g.transform(b,G,null,{sync:!0}))}}function j(){const K=b?wN(b.node()):{x:0,y:0,k:1};return{x:K.x,y:K.y,zoom:K.k}}function D(K,G){return b?new Promise(te=>{g==null||g.interpolate((G==null?void 0:G.interpolate)==="linear"?Tm:y0).scaleTo(Ev(b,G==null?void 0:G.duration,G==null?void 0:G.ease,()=>te(!0)),K)}):Promise.resolve(!1)}function F(K,G){return b?new Promise(te=>{g==null||g.interpolate((G==null?void 0:G.interpolate)==="linear"?Tm:y0).scaleBy(Ev(b,G==null?void 0:G.duration,G==null?void 0:G.ease,()=>te(!0)),K)}):Promise.resolve(!1)}function $(K){g==null||g.scaleExtent(K)}function P(K){g==null||g.translateExtent(K)}function I(K){const G=!gl(K)||K<0?0:K;g==null||g.clickDistance(G)}return{update:T,destroy:w,setViewport:R,setViewportConstrained:k,getViewport:j,scaleTo:D,scaleBy:F,setScaleExtent:$,setTranslateExtent:P,syncViewport:O,setClickDistance:I}}var gh;(function(t){t.Line="line",t.Handle="handle"})(gh||(gh={}));function OX({width:t,prevWidth:e,height:n,prevHeight:i,affectsX:r,affectsY:s}){const l=t-e,c=n-i,d=[l>0?1:l<0?-1:0,c>0?1:c<0?-1:0];return l&&r&&(d[0]=d[0]*-1),c&&s&&(d[1]=d[1]*-1),d}function NT(t){const e=t.includes("right")||t.includes("left"),n=t.includes("bottom")||t.includes("top"),i=t.includes("left"),r=t.includes("top");return{isHorizontal:e,isVertical:n,affectsX:i,affectsY:r}}function eu(t,e){return Math.max(0,e-t)}function tu(t,e){return Math.max(0,t-e)}function l0(t,e,n){return Math.max(0,e-t,t-n)}function kT(t,e){return t?!e:e}function DX(t,e,n,i,r,s,l,c){let{affectsX:d,affectsY:p}=e;const{isHorizontal:m,isVertical:g}=e,b=m&&g,{xSnapped:v,ySnapped:_}=n,{minWidth:C,maxWidth:T,minHeight:w,maxHeight:k}=i,{x:R,y:O,width:j,height:D,aspectRatio:F}=t;let $=Math.floor(m?v-t.pointerX:0),P=Math.floor(g?_-t.pointerY:0);const I=j+(d?-$:$),K=D+(p?-P:P),G=-s[0]*j,te=-s[1]*D;let H=l0(I,C,T),W=l0(K,w,k);if(l){let Z=0,Q=0;d&&$<0?Z=eu(R+$+G,l[0][0]):!d&&$>0&&(Z=tu(R+I+G,l[1][0])),p&&P<0?Q=eu(O+P+te,l[0][1]):!p&&P>0&&(Q=tu(O+K+te,l[1][1])),H=Math.max(H,Z),W=Math.max(W,Q)}if(c){let Z=0,Q=0;d&&$>0?Z=tu(R+$,c[0][0]):!d&&$<0&&(Z=eu(R+I,c[1][0])),p&&P>0?Q=tu(O+P,c[0][1]):!p&&P<0&&(Q=eu(O+K,c[1][1])),H=Math.max(H,Z),W=Math.max(W,Q)}if(r){if(m){const Z=l0(I/F,w,k)*F;if(H=Math.max(H,Z),l){let Q=0;!d&&!p||d&&!p&&b?Q=tu(O+te+I/F,l[1][1])*F:Q=eu(O+te+(d?$:-$)/F,l[0][1])*F,H=Math.max(H,Q)}if(c){let Q=0;!d&&!p||d&&!p&&b?Q=eu(O+I/F,c[1][1])*F:Q=tu(O+(d?$:-$)/F,c[0][1])*F,H=Math.max(H,Q)}}if(g){const Z=l0(K*F,C,T)/F;if(W=Math.max(W,Z),l){let Q=0;!d&&!p||p&&!d&&b?Q=tu(R+K*F+G,l[1][0])/F:Q=eu(R+(p?P:-P)*F+G,l[0][0])/F,W=Math.max(W,Q)}if(c){let Q=0;!d&&!p||p&&!d&&b?Q=eu(R+K*F,c[1][0])/F:Q=tu(R+(p?P:-P)*F,c[0][0])/F,W=Math.max(W,Q)}}}P=P+(P<0?W:-W),$=$+($<0?H:-H),r&&(b?I>K*F?P=(kT(d,p)?-$:$)/F:$=(kT(d,p)?-P:P)*F:m?(P=$/F,p=d):($=P*F,d=p));const B=d?R+$:R,X=p?O+P:O;return{width:j+(d?-$:$),height:D+(p?-P:P),x:s[0]*$*(d?-1:1)+B,y:s[1]*P*(p?-1:1)+X}}const ek={width:0,height:0,x:0,y:0},zX={...ek,pointerX:0,pointerY:0,aspectRatio:1};function BX(t){return[[0,0],[t.measured.width,t.measured.height]]}function LX(t,e,n){const i=e.position.x+t.position.x,r=e.position.y+t.position.y,s=t.measured.width??0,l=t.measured.height??0,c=n[0]*s,d=n[1]*l;return[[i-c,r-d],[i+s-c,r+l-d]]}function UX({domNode:t,nodeId:e,getStoreItems:n,onChange:i,onEnd:r}){const s=es(t);let l={controlDirection:NT("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function c({controlPosition:p,boundaries:m,keepAspectRatio:g,resizeDirection:b,onResizeStart:v,onResize:_,onResizeEnd:C,shouldResize:T}){let w={...ek},k={...zX};l={boundaries:m,resizeDirection:b,keepAspectRatio:g,controlDirection:NT(p)};let R,O=null,j=[],D,F,$,P=!1;const I=uN().on("start",K=>{const{nodeLookup:G,transform:te,snapGrid:H,snapToGrid:W,nodeOrigin:B,paneDomNode:X}=n();if(R=G.get(e),!R)return;O=(X==null?void 0:X.getBoundingClientRect())??null;const{xSnapped:Z,ySnapped:Q}=Cm(K.sourceEvent,{transform:te,snapGrid:H,snapToGrid:W,containerBounds:O});w={width:R.measured.width??0,height:R.measured.height??0,x:R.position.x??0,y:R.position.y??0},k={...w,pointerX:Z,pointerY:Q,aspectRatio:w.width/w.height},D=void 0,R.parentId&&(R.extent==="parent"||R.expandParent)&&(D=G.get(R.parentId),F=D&&R.extent==="parent"?BX(D):void 0),j=[],$=void 0;for(const[q,Y]of G)if(Y.parentId===e&&(j.push({id:q,position:{...Y.position},extent:Y.extent}),Y.extent==="parent"||Y.expandParent)){const ee=LX(Y,R,Y.origin??B);$?$=[[Math.min(ee[0][0],$[0][0]),Math.min(ee[0][1],$[0][1])],[Math.max(ee[1][0],$[1][0]),Math.max(ee[1][1],$[1][1])]]:$=ee}v==null||v(K,{...w})}).on("drag",K=>{const{transform:G,snapGrid:te,snapToGrid:H,nodeOrigin:W}=n(),B=Cm(K.sourceEvent,{transform:G,snapGrid:te,snapToGrid:H,containerBounds:O}),X=[];if(!R)return;const{x:Z,y:Q,width:q,height:Y}=w,ee={},V=R.origin??W,{width:oe,height:be,x:ve,y:se}=DX(k,l.controlDirection,B,l.boundaries,l.keepAspectRatio,V,F,$),ge=oe!==q,le=be!==Y,Re=ve!==Z&&ge,Ie=se!==Q&≤if(!Re&&!Ie&&!ge&&!le)return;if((Re||Ie||V[0]===1||V[1]===1)&&(ee.x=Re?ve:w.x,ee.y=Ie?se:w.y,w.x=ee.x,w.y=ee.y,j.length>0)){const ut=ve-Z,He=se-Q;for(const At of j)At.position={x:At.position.x-ut+V[0]*(oe-q),y:At.position.y-He+V[1]*(be-Y)},X.push(At)}if((ge||le)&&(ee.width=ge&&(!l.resizeDirection||l.resizeDirection==="horizontal")?oe:w.width,ee.height=le&&(!l.resizeDirection||l.resizeDirection==="vertical")?be:w.height,w.width=ee.width,w.height=ee.height),D&&R.expandParent){const ut=V[0]*(ee.width??0);ee.x&&ee.x<ut&&(w.x=ut,k.x=k.x-(ee.x-ut));const He=V[1]*(ee.height??0);ee.y&&ee.y<He&&(w.y=He,k.y=k.y-(ee.y-He))}const Ue=OX({width:w.width,prevWidth:q,height:w.height,prevHeight:Y,affectsX:l.controlDirection.affectsX,affectsY:l.controlDirection.affectsY}),Le={...w,direction:Ue};(T==null?void 0:T(K,Le))!==!1&&(P=!0,_==null||_(K,Le),i(ee,X))}).on("end",K=>{P&&(C==null||C(K,{...w}),r==null||r({...w}),P=!1)});s.call(I)}function d(){s.on(".drag",null)}return{update:c,destroy:d}}var wv={exports:{}},Tv={},Cv={exports:{}},Av={};/**
|
|
379
|
+
* @license React
|
|
380
|
+
* use-sync-external-store-shim.production.js
|
|
381
|
+
*
|
|
382
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
383
|
+
*
|
|
384
|
+
* This source code is licensed under the MIT license found in the
|
|
385
|
+
* LICENSE file in the root directory of this source tree.
|
|
386
|
+
*/var OT;function IX(){if(OT)return Av;OT=1;var t=yh();function e(g,b){return g===b&&(g!==0||1/g===1/b)||g!==g&&b!==b}var n=typeof Object.is=="function"?Object.is:e,i=t.useState,r=t.useEffect,s=t.useLayoutEffect,l=t.useDebugValue;function c(g,b){var v=b(),_=i({inst:{value:v,getSnapshot:b}}),C=_[0].inst,T=_[1];return s(function(){C.value=v,C.getSnapshot=b,d(C)&&T({inst:C})},[g,v,b]),r(function(){return d(C)&&T({inst:C}),g(function(){d(C)&&T({inst:C})})},[g]),l(v),v}function d(g){var b=g.getSnapshot;g=g.value;try{var v=b();return!n(g,v)}catch{return!0}}function p(g,b){return b()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:c;return Av.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:m,Av}var DT;function jX(){return DT||(DT=1,Cv.exports=IX()),Cv.exports}/**
|
|
387
|
+
* @license React
|
|
388
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
389
|
+
*
|
|
390
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
391
|
+
*
|
|
392
|
+
* This source code is licensed under the MIT license found in the
|
|
393
|
+
* LICENSE file in the root directory of this source tree.
|
|
394
|
+
*/var zT;function HX(){if(zT)return Tv;zT=1;var t=yh(),e=jX();function n(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var i=typeof Object.is=="function"?Object.is:n,r=e.useSyncExternalStore,s=t.useRef,l=t.useEffect,c=t.useMemo,d=t.useDebugValue;return Tv.useSyncExternalStoreWithSelector=function(p,m,g,b,v){var _=s(null);if(_.current===null){var C={hasValue:!1,value:null};_.current=C}else C=_.current;_=c(function(){function w(D){if(!k){if(k=!0,R=D,D=b(D),v!==void 0&&C.hasValue){var F=C.value;if(v(F,D))return O=F}return O=D}if(F=O,i(R,D))return F;var $=b(D);return v!==void 0&&v(F,$)?(R=D,F):(R=D,O=$)}var k=!1,R,O,j=g===void 0?null:g;return[function(){return w(m())},j===null?void 0:function(){return w(j())}]},[m,g,b,v]);var T=r(p,_[0],_[1]);return l(function(){C.hasValue=!0,C.value=T},[T]),d(T),T},Tv}var BT;function PX(){return BT||(BT=1,wv.exports=HX()),wv.exports}var GX=PX();const FX=uu(GX),qX={},LT=t=>{let e;const n=new Set,i=(m,g)=>{const b=typeof m=="function"?m(e):m;if(!Object.is(b,e)){const v=e;e=g??(typeof b!="object"||b===null)?b:Object.assign({},e,b),n.forEach(_=>_(e,v))}},r=()=>e,d={setState:i,getState:r,getInitialState:()=>p,subscribe:m=>(n.add(m),()=>n.delete(m)),destroy:()=>{(qX?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},p=e=t(i,r,d);return d},YX=t=>t?LT(t):LT,{useDebugValue:VX}=cm,{useSyncExternalStoreWithSelector:XX}=FX,KX=t=>t;function tk(t,e=KX,n){const i=XX(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return VX(i),i}const UT=(t,e)=>{const n=YX(t),i=(r,s=e)=>tk(n,r,s);return Object.assign(i,n),i},WX=(t,e)=>t?UT(t,e):UT;function $n(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[i,r]of t)if(!Object.is(r,e.get(i)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0}const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(e,i)||!Object.is(t[i],e[i]))return!1;return!0}const yb=U.createContext(null),$X=yb.Provider,nk=po.error001();function Wt(t,e){const n=U.useContext(yb);if(n===null)throw new Error(nk);return tk(n,t,e)}function Zn(){const t=U.useContext(yb);if(t===null)throw new Error(nk);return U.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const IT={display:"none"},ZX={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ik="react-flow__node-desc",rk="react-flow__edge-desc",QX="react-flow__aria-live",JX=t=>t.ariaLiveMessage,eK=t=>t.ariaLabelConfig;function tK({rfId:t}){const e=Wt(JX);return A.jsx("div",{id:`${QX}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:ZX,children:e})}function nK({rfId:t,disableKeyboardA11y:e}){const n=Wt(eK);return A.jsxs(A.Fragment,{children:[A.jsx("div",{id:`${ik}-${t}`,style:IT,children:e?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),A.jsx("div",{id:`${rk}-${t}`,style:IT,children:n["edge.a11yDescription.default"]}),!e&&A.jsx(tK,{rfId:t})]})}const bb=U.forwardRef(({position:t="top-left",children:e,className:n,style:i,...r},s)=>{const l=`${t}`.split("-");return A.jsx("div",{className:Oi(["react-flow__panel",n,...l]),style:i,ref:s,...r,children:e})});bb.displayName="Panel";function iK({proOptions:t,position:e="bottom-right"}){return t!=null&&t.hideAttribution?null:A.jsx(bb,{position:e,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:A.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const rK=t=>{const e=[],n=[];for(const[,i]of t.nodeLookup)i.selected&&e.push(i.internals.userNode);for(const[,i]of t.edgeLookup)i.selected&&n.push(i);return{selectedNodes:e,selectedEdges:n}},o0=t=>t.id;function aK(t,e){return $n(t.selectedNodes.map(o0),e.selectedNodes.map(o0))&&$n(t.selectedEdges.map(o0),e.selectedEdges.map(o0))}function sK({onSelectionChange:t}){const e=Zn(),{selectedNodes:n,selectedEdges:i}=Wt(rK,aK);return U.useEffect(()=>{const r={nodes:n,edges:i};t==null||t(r),e.getState().onSelectionChangeHandlers.forEach(s=>s(r))},[n,i,t]),null}const lK=t=>!!t.onSelectionChangeHandlers;function oK({onSelectionChange:t}){const e=Wt(lK);return t||e?A.jsx(sK,{onSelectionChange:t}):null}const ak=[0,0],cK={x:0,y:0,zoom:1},uK=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],jT=[...uK,"rfId"],fK=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges}),HT={translateExtent:Hm,nodeOrigin:ak,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function dK(t){const{setNodes:e,setEdges:n,setMinZoom:i,setMaxZoom:r,setTranslateExtent:s,setNodeExtent:l,reset:c,setDefaultNodesAndEdges:d}=Wt(fK,$n),p=Zn();U.useEffect(()=>(d(t.defaultNodes,t.defaultEdges),()=>{m.current=HT,c()}),[]);const m=U.useRef(HT);return U.useEffect(()=>{for(const g of jT){const b=t[g],v=m.current[g];b!==v&&(typeof t[g]>"u"||(g==="nodes"?e(b):g==="edges"?n(b):g==="minZoom"?i(b):g==="maxZoom"?r(b):g==="translateExtent"?s(b):g==="nodeExtent"?l(b):g==="ariaLabelConfig"?p.setState({ariaLabelConfig:WV(b)}):g==="fitView"?p.setState({fitViewQueued:b}):g==="fitViewOptions"?p.setState({fitViewOptions:b}):p.setState({[g]:b})))}m.current=t},jT.map(g=>t[g])),null}function PT(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function hK(t){var i;const[e,n]=U.useState(t==="system"?null:t);return U.useEffect(()=>{if(t!=="system"){n(t);return}const r=PT(),s=()=>n(r!=null&&r.matches?"dark":"light");return s(),r==null||r.addEventListener("change",s),()=>{r==null||r.removeEventListener("change",s)}},[t]),e!==null?e:(i=PT())!=null&&i.matches?"dark":"light"}const GT=typeof document<"u"?document:null;function qm(t=null,e={target:GT,actInsideInputWithModifier:!0}){const[n,i]=U.useState(!1),r=U.useRef(!1),s=U.useRef(new Set([])),[l,c]=U.useMemo(()=>{if(t!==null){const p=(Array.isArray(t)?t:[t]).filter(g=>typeof g=="string").map(g=>g.replace("+",`
|
|
395
|
+
`).replace(`
|
|
396
|
+
|
|
397
|
+
`,`
|
|
398
|
+
+`).split(`
|
|
399
|
+
`)),m=p.reduce((g,b)=>g.concat(...b),[]);return[p,m]}return[[],[]]},[t]);return U.useEffect(()=>{const d=(e==null?void 0:e.target)??GT,p=(e==null?void 0:e.actInsideInputWithModifier)??!0;if(t!==null){const m=v=>{var T,w;if(r.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!r.current||r.current&&!p)&&IN(v))return!1;const C=qT(v.code,c);if(s.current.add(v[C]),FT(l,s.current,!1)){const k=((w=(T=v.composedPath)==null?void 0:T.call(v))==null?void 0:w[0])||v.target,R=(k==null?void 0:k.nodeName)==="BUTTON"||(k==null?void 0:k.nodeName)==="A";e.preventDefault!==!1&&(r.current||!R)&&v.preventDefault(),i(!0)}},g=v=>{const _=qT(v.code,c);FT(l,s.current,!0)?(i(!1),s.current.clear()):s.current.delete(v[_]),v.key==="Meta"&&s.current.clear(),r.current=!1},b=()=>{s.current.clear(),i(!1)};return d==null||d.addEventListener("keydown",m),d==null||d.addEventListener("keyup",g),window.addEventListener("blur",b),window.addEventListener("contextmenu",b),()=>{d==null||d.removeEventListener("keydown",m),d==null||d.removeEventListener("keyup",g),window.removeEventListener("blur",b),window.removeEventListener("contextmenu",b)}}},[t,i]),n}function FT(t,e,n){return t.filter(i=>n||i.length===e.size).some(i=>i.every(r=>e.has(r)))}function qT(t,e){return e.includes(t)?"code":"key"}const pK=()=>{const t=Zn();return U.useMemo(()=>({zoomIn:e=>{const{panZoom:n}=t.getState();return n?n.scaleBy(1.2,{duration:e==null?void 0:e.duration}):Promise.resolve(!1)},zoomOut:e=>{const{panZoom:n}=t.getState();return n?n.scaleBy(1/1.2,{duration:e==null?void 0:e.duration}):Promise.resolve(!1)},zoomTo:(e,n)=>{const{panZoom:i}=t.getState();return i?i.scaleTo(e,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>t.getState().transform[2],setViewport:async(e,n)=>{const{transform:[i,r,s],panZoom:l}=t.getState();return l?(await l.setViewport({x:e.x??i,y:e.y??r,zoom:e.zoom??s},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[e,n,i]=t.getState().transform;return{x:e,y:n,zoom:i}},setCenter:async(e,n,i)=>t.getState().setCenter(e,n,i),fitBounds:async(e,n)=>{const{width:i,height:r,minZoom:s,maxZoom:l,panZoom:c}=t.getState(),d=L1(e,i,r,s,l,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(d,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(e,n={})=>{const{transform:i,snapGrid:r,snapToGrid:s,domNode:l}=t.getState();if(!l)return e;const{x:c,y:d}=l.getBoundingClientRect(),p={x:e.x-c,y:e.y-d},m=n.snapGrid??r,g=n.snapToGrid??s;return ag(p,i,g,m)},flowToScreenPosition:e=>{const{transform:n,domNode:i}=t.getState();if(!i)return e;const{x:r,y:s}=i.getBoundingClientRect(),l=Y0(e,n);return{x:l.x+r,y:l.y+s}}}),[])};function sk(t,e){const n=[],i=new Map,r=[];for(const s of t)if(s.type==="add"){r.push(s);continue}else if(s.type==="remove"||s.type==="replace")i.set(s.id,[s]);else{const l=i.get(s.id);l?l.push(s):i.set(s.id,[s])}for(const s of e){const l=i.get(s.id);if(!l){n.push(s);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}const c={...s};for(const d of l)mK(d,c);n.push(c)}return r.length&&r.forEach(s=>{s.index!==void 0?n.splice(s.index,0,{...s.item}):n.push({...s.item})}),n}function mK(t,e){switch(t.type){case"select":{e.selected=t.selected;break}case"position":{typeof t.position<"u"&&(e.position=t.position),typeof t.dragging<"u"&&(e.dragging=t.dragging);break}case"dimensions":{typeof t.dimensions<"u"&&(e.measured={...t.dimensions},t.setAttributes&&((t.setAttributes===!0||t.setAttributes==="width")&&(e.width=t.dimensions.width),(t.setAttributes===!0||t.setAttributes==="height")&&(e.height=t.dimensions.height))),typeof t.resizing=="boolean"&&(e.resizing=t.resizing);break}}}function gK(t,e){return sk(t,e)}function yK(t,e){return sk(t,e)}function df(t,e){return{id:t,type:"select",selected:e}}function $d(t,e=new Set,n=!1){const i=[];for(const[r,s]of t){const l=e.has(r);!(s.selected===void 0&&!l)&&s.selected!==l&&(n&&(s.selected=l),i.push(df(s.id,l)))}return i}function YT({items:t=[],lookup:e}){var r;const n=[],i=new Map(t.map(s=>[s.id,s]));for(const[s,l]of t.entries()){const c=e.get(l.id),d=((r=c==null?void 0:c.internals)==null?void 0:r.userNode)??c;d!==void 0&&d!==l&&n.push({id:l.id,item:l,type:"replace"}),d===void 0&&n.push({item:l,type:"add",index:s})}for(const[s]of e)i.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function VT(t){return{id:t.id,type:"remove"}}const XT=t=>jV(t),bK=t=>NN(t);function lk(t){return U.forwardRef(t)}const xK=typeof window<"u"?U.useLayoutEffect:U.useEffect;function KT(t){const[e,n]=U.useState(BigInt(0)),[i]=U.useState(()=>vK(()=>n(r=>r+BigInt(1))));return xK(()=>{const r=i.get();r.length&&(t(r),i.reset())},[e]),i}function vK(t){let e=[];return{get:()=>e,reset:()=>{e=[]},push:n=>{e.push(n),t()}}}const ok=U.createContext(null);function _K({children:t}){const e=Zn(),n=U.useCallback(c=>{const{nodes:d=[],setNodes:p,hasDefaultNodes:m,onNodesChange:g,nodeLookup:b,fitViewQueued:v,onNodesChangeMiddlewareMap:_}=e.getState();let C=d;for(const w of c)C=typeof w=="function"?w(C):w;let T=YT({items:C,lookup:b});for(const w of _.values())T=w(T);m&&p(C),T.length>0?g==null||g(T):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:w,nodes:k,setNodes:R}=e.getState();w&&R(k)})},[]),i=KT(n),r=U.useCallback(c=>{const{edges:d=[],setEdges:p,hasDefaultEdges:m,onEdgesChange:g,edgeLookup:b}=e.getState();let v=d;for(const _ of c)v=typeof _=="function"?_(v):_;m?p(v):g&&g(YT({items:v,lookup:b}))},[]),s=KT(r),l=U.useMemo(()=>({nodeQueue:i,edgeQueue:s}),[]);return A.jsx(ok.Provider,{value:l,children:t})}function SK(){const t=U.useContext(ok);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const EK=t=>!!t.panZoom;function xb(){const t=pK(),e=Zn(),n=SK(),i=Wt(EK),r=U.useMemo(()=>{const s=g=>e.getState().nodeLookup.get(g),l=g=>{n.nodeQueue.push(g)},c=g=>{n.edgeQueue.push(g)},d=g=>{var w,k;const{nodeLookup:b,nodeOrigin:v}=e.getState(),_=XT(g)?g:b.get(g.id),C=_.parentId?LN(_.position,_.measured,_.parentId,b,v):_.position,T={..._,position:C,width:((w=_.measured)==null?void 0:w.width)??_.width,height:((k=_.measured)==null?void 0:k.height)??_.height};return ph(T)},p=(g,b,v={replace:!1})=>{l(_=>_.map(C=>{if(C.id===g){const T=typeof b=="function"?b(C):b;return v.replace&&XT(T)?T:{...C,...T}}return C}))},m=(g,b,v={replace:!1})=>{c(_=>_.map(C=>{if(C.id===g){const T=typeof b=="function"?b(C):b;return v.replace&&bK(T)?T:{...C,...T}}return C}))};return{getNodes:()=>e.getState().nodes.map(g=>({...g})),getNode:g=>{var b;return(b=s(g))==null?void 0:b.internals.userNode},getInternalNode:s,getEdges:()=>{const{edges:g=[]}=e.getState();return g.map(b=>({...b}))},getEdge:g=>e.getState().edgeLookup.get(g),setNodes:l,setEdges:c,addNodes:g=>{const b=Array.isArray(g)?g:[g];n.nodeQueue.push(v=>[...v,...b])},addEdges:g=>{const b=Array.isArray(g)?g:[g];n.edgeQueue.push(v=>[...v,...b])},toObject:()=>{const{nodes:g=[],edges:b=[],transform:v}=e.getState(),[_,C,T]=v;return{nodes:g.map(w=>({...w})),edges:b.map(w=>({...w})),viewport:{x:_,y:C,zoom:T}}},deleteElements:async({nodes:g=[],edges:b=[]})=>{const{nodes:v,edges:_,onNodesDelete:C,onEdgesDelete:T,triggerNodeChanges:w,triggerEdgeChanges:k,onDelete:R,onBeforeDelete:O}=e.getState(),{nodes:j,edges:D}=await qV({nodesToRemove:g,edgesToRemove:b,nodes:v,edges:_,onBeforeDelete:O}),F=D.length>0,$=j.length>0;if(F){const P=D.map(VT);T==null||T(D),k(P)}if($){const P=j.map(VT);C==null||C(j),w(P)}return($||F)&&(R==null||R({nodes:j,edges:D})),{deletedNodes:j,deletedEdges:D}},getIntersectingNodes:(g,b=!0,v)=>{const _=xT(g),C=_?g:d(g),T=v!==void 0;return C?(v||e.getState().nodes).filter(w=>{const k=e.getState().nodeLookup.get(w.id);if(k&&!_&&(w.id===g.id||!k.internals.positionAbsolute))return!1;const R=ph(T?w:k),O=Gm(R,C);return b&&O>0||O>=R.width*R.height||O>=C.width*C.height}):[]},isNodeIntersecting:(g,b,v=!0)=>{const C=xT(g)?g:d(g);if(!C)return!1;const T=Gm(C,b);return v&&T>0||T>=b.width*b.height||T>=C.width*C.height},updateNode:p,updateNodeData:(g,b,v={replace:!1})=>{p(g,_=>{const C=typeof b=="function"?b(_):b;return v.replace?{..._,data:C}:{..._,data:{..._.data,...C}}},v)},updateEdge:m,updateEdgeData:(g,b,v={replace:!1})=>{m(g,_=>{const C=typeof b=="function"?b(_):b;return v.replace?{..._,data:C}:{..._,data:{..._.data,...C}}},v)},getNodesBounds:g=>{const{nodeLookup:b,nodeOrigin:v}=e.getState();return HV(g,{nodeLookup:b,nodeOrigin:v})},getHandleConnections:({type:g,id:b,nodeId:v})=>{var _;return Array.from(((_=e.getState().connectionLookup.get(`${v}-${g}${b?`-${b}`:""}`))==null?void 0:_.values())??[])},getNodeConnections:({type:g,handleId:b,nodeId:v})=>{var _;return Array.from(((_=e.getState().connectionLookup.get(`${v}${g?b?`-${g}-${b}`:`-${g}`:""}`))==null?void 0:_.values())??[])},fitView:async g=>{const b=e.getState().fitViewResolver??KV();return e.setState({fitViewQueued:!0,fitViewOptions:g,fitViewResolver:b}),n.nodeQueue.push(v=>[...v]),b.promise}}},[]);return U.useMemo(()=>({...r,...t,viewportInitialized:i}),[i])}const WT=t=>t.selected,wK=typeof window<"u"?window:void 0;function TK({deleteKeyCode:t,multiSelectionKeyCode:e}){const n=Zn(),{deleteElements:i}=xb(),r=qm(t,{actInsideInputWithModifier:!1}),s=qm(e,{target:wK});U.useEffect(()=>{if(r){const{edges:l,nodes:c}=n.getState();i({nodes:c.filter(WT),edges:l.filter(WT)}),n.setState({nodesSelectionActive:!1})}},[r]),U.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function CK(t){const e=Zn();U.useEffect(()=>{const n=()=>{var r,s,l,c;if(!t.current||!(((s=(r=t.current).checkVisibility)==null?void 0:s.call(r))??!0))return!1;const i=U1(t.current);(i.height===0||i.width===0)&&((c=(l=e.getState()).onError)==null||c.call(l,"004",po.error004())),e.setState({width:i.width||500,height:i.height||500})};if(t.current){n(),window.addEventListener("resize",n);const i=new ResizeObserver(()=>n());return i.observe(t.current),()=>{window.removeEventListener("resize",n),i&&t.current&&i.unobserve(t.current)}}},[])}const vb={position:"absolute",width:"100%",height:"100%",top:0,left:0},AK=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function MK({onPaneContextMenu:t,zoomOnScroll:e=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:r=.5,panOnScrollMode:s=yf.Free,zoomOnDoubleClick:l=!0,panOnDrag:c=!0,defaultViewport:d,translateExtent:p,minZoom:m,maxZoom:g,zoomActivationKeyCode:b,preventScrolling:v=!0,children:_,noWheelClassName:C,noPanClassName:T,onViewportChange:w,isControlledViewport:k,paneClickDistance:R,selectionOnDrag:O}){const j=Zn(),D=U.useRef(null),{userSelectionActive:F,lib:$,connectionInProgress:P}=Wt(AK,$n),I=qm(b),K=U.useRef();CK(D);const G=U.useCallback(te=>{w==null||w({x:te[0],y:te[1],zoom:te[2]}),k||j.setState({transform:te})},[w,k]);return U.useEffect(()=>{if(D.current){K.current=kX({domNode:D.current,minZoom:m,maxZoom:g,translateExtent:p,viewport:d,onDraggingChange:B=>j.setState(X=>X.paneDragging===B?X:{paneDragging:B}),onPanZoomStart:(B,X)=>{const{onViewportChangeStart:Z,onMoveStart:Q}=j.getState();Q==null||Q(B,X),Z==null||Z(X)},onPanZoom:(B,X)=>{const{onViewportChange:Z,onMove:Q}=j.getState();Q==null||Q(B,X),Z==null||Z(X)},onPanZoomEnd:(B,X)=>{const{onViewportChangeEnd:Z,onMoveEnd:Q}=j.getState();Q==null||Q(B,X),Z==null||Z(X)}});const{x:te,y:H,zoom:W}=K.current.getViewport();return j.setState({panZoom:K.current,transform:[te,H,W],domNode:D.current.closest(".react-flow")}),()=>{var B;(B=K.current)==null||B.destroy()}}},[]),U.useEffect(()=>{var te;(te=K.current)==null||te.update({onPaneContextMenu:t,zoomOnScroll:e,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:r,panOnScrollMode:s,zoomOnDoubleClick:l,panOnDrag:c,zoomActivationKeyPressed:I,preventScrolling:v,noPanClassName:T,userSelectionActive:F,noWheelClassName:C,lib:$,onTransformChange:G,connectionInProgress:P,selectionOnDrag:O,paneClickDistance:R})},[t,e,n,i,r,s,l,c,I,v,T,F,C,$,G,P,O,R]),A.jsx("div",{className:"react-flow__renderer",ref:D,style:vb,children:_})}const RK=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function NK(){const{userSelectionActive:t,userSelectionRect:e}=Wt(RK,$n);return t&&e?A.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:e.width,height:e.height,transform:`translate(${e.x}px, ${e.y}px)`}}):null}const Mv=(t,e)=>n=>{n.target===e.current&&(t==null||t(n))},kK=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function OK({isSelecting:t,selectionKeyPressed:e,selectionMode:n=Pm.Full,panOnDrag:i,paneClickDistance:r,selectionOnDrag:s,onSelectionStart:l,onSelectionEnd:c,onPaneClick:d,onPaneContextMenu:p,onPaneScroll:m,onPaneMouseEnter:g,onPaneMouseMove:b,onPaneMouseLeave:v,children:_}){const C=Zn(),{userSelectionActive:T,elementsSelectable:w,dragging:k,connectionInProgress:R}=Wt(kK,$n),O=w&&(t||T),j=U.useRef(null),D=U.useRef(),F=U.useRef(new Set),$=U.useRef(new Set),P=U.useRef(!1),I=Z=>{if(P.current||R){P.current=!1;return}d==null||d(Z),C.getState().resetSelectedElements(),C.setState({nodesSelectionActive:!1})},K=Z=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){Z.preventDefault();return}p==null||p(Z)},G=m?Z=>m(Z):void 0,te=Z=>{P.current&&(Z.stopPropagation(),P.current=!1)},H=Z=>{var be,ve;const{domNode:Q}=C.getState();if(D.current=Q==null?void 0:Q.getBoundingClientRect(),!D.current)return;const q=Z.target===j.current;if(!q&&!!Z.target.closest(".nokey")||!t||!(s&&q||e)||Z.button!==0||!Z.isPrimary)return;(ve=(be=Z.target)==null?void 0:be.setPointerCapture)==null||ve.call(be,Z.pointerId),P.current=!1;const{x:V,y:oe}=yl(Z.nativeEvent,D.current);C.setState({userSelectionRect:{width:0,height:0,startX:V,startY:oe,x:V,y:oe}}),q||(Z.stopPropagation(),Z.preventDefault())},W=Z=>{const{userSelectionRect:Q,transform:q,nodeLookup:Y,edgeLookup:ee,connectionLookup:V,triggerNodeChanges:oe,triggerEdgeChanges:be,defaultEdgeOptions:ve,resetSelectedElements:se}=C.getState();if(!D.current||!Q)return;const{x:ge,y:le}=yl(Z.nativeEvent,D.current),{startX:Re,startY:Ie}=Q;if(!P.current){const He=e?0:r;if(Math.hypot(ge-Re,le-Ie)<=He)return;se(),l==null||l(Z)}P.current=!0;const Ue={startX:Re,startY:Ie,x:ge<Re?ge:Re,y:le<Ie?le:Ie,width:Math.abs(ge-Re),height:Math.abs(le-Ie)},Le=F.current,Ve=$.current;F.current=new Set(B1(Y,Ue,q,n===Pm.Partial,!0).map(He=>He.id)),$.current=new Set;const ut=(ve==null?void 0:ve.selectable)??!0;for(const He of F.current){const At=V.get(He);if(At)for(const{edgeId:zn}of At.values()){const Bn=ee.get(zn);Bn&&(Bn.selectable??ut)&&$.current.add(zn)}}if(!vT(Le,F.current)){const He=$d(Y,F.current,!0);oe(He)}if(!vT(Ve,$.current)){const He=$d(ee,$.current);be(He)}C.setState({userSelectionRect:Ue,userSelectionActive:!0,nodesSelectionActive:!1})},B=Z=>{var Q,q;Z.button===0&&((q=(Q=Z.target)==null?void 0:Q.releasePointerCapture)==null||q.call(Q,Z.pointerId),!T&&Z.target===j.current&&C.getState().userSelectionRect&&(I==null||I(Z)),C.setState({userSelectionActive:!1,userSelectionRect:null}),P.current&&(c==null||c(Z),C.setState({nodesSelectionActive:F.current.size>0})))},X=i===!0||Array.isArray(i)&&i.includes(0);return A.jsxs("div",{className:Oi(["react-flow__pane",{draggable:X,dragging:k,selection:t}]),onClick:O?void 0:Mv(I,j),onContextMenu:Mv(K,j),onWheel:Mv(G,j),onPointerEnter:O?void 0:g,onPointerMove:O?W:b,onPointerUp:O?B:void 0,onPointerDownCapture:O?H:void 0,onClickCapture:O?te:void 0,onPointerLeave:v,ref:j,style:vb,children:[_,A.jsx(NK,{})]})}function D_({id:t,store:e,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:r,unselectNodesAndEdges:s,multiSelectionActive:l,nodeLookup:c,onError:d}=e.getState(),p=c.get(t);if(!p){d==null||d("012",po.error012(t));return}e.setState({nodesSelectionActive:!1}),p.selected?(n||p.selected&&l)&&(s({nodes:[p],edges:[]}),requestAnimationFrame(()=>{var m;return(m=i==null?void 0:i.current)==null?void 0:m.blur()})):r([t])}function ck({nodeRef:t,disabled:e=!1,noDragClassName:n,handleSelector:i,nodeId:r,isSelectable:s,nodeClickDistance:l}){const c=Zn(),[d,p]=U.useState(!1),m=U.useRef();return U.useEffect(()=>{m.current=yX({getStoreItems:()=>c.getState(),onNodeMouseDown:g=>{D_({id:g,store:c,nodeRef:t})},onDragStart:()=>{p(!0)},onDragStop:()=>{p(!1)}})},[]),U.useEffect(()=>{if(!(e||!t.current||!m.current))return m.current.update({noDragClassName:n,handleSelector:i,domNode:t.current,isSelectable:s,nodeId:r,nodeClickDistance:l}),()=>{var g;(g=m.current)==null||g.destroy()}},[n,i,e,s,t,r,l]),d}const DK=t=>e=>e.selected&&(e.draggable||t&&typeof e.draggable>"u");function uk(){const t=Zn();return U.useCallback(n=>{const{nodeExtent:i,snapToGrid:r,snapGrid:s,nodesDraggable:l,onError:c,updateNodePositions:d,nodeLookup:p,nodeOrigin:m}=t.getState(),g=new Map,b=DK(l),v=r?s[0]:5,_=r?s[1]:5,C=n.direction.x*v*n.factor,T=n.direction.y*_*n.factor;for(const[,w]of p){if(!b(w))continue;let k={x:w.internals.positionAbsolute.x+C,y:w.internals.positionAbsolute.y+T};r&&(k=rg(k,s));const{position:R,positionAbsolute:O}=kN({nodeId:w.id,nextPosition:k,nodeLookup:p,nodeExtent:i,nodeOrigin:m,onError:c});w.position=R,w.internals.positionAbsolute=O,g.set(w.id,w)}d(g)},[])}const F1=U.createContext(null),zK=F1.Provider;F1.Consumer;const fk=()=>U.useContext(F1),BK=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),LK=(t,e,n)=>i=>{const{connectionClickStartHandle:r,connectionMode:s,connection:l}=i,{fromHandle:c,toHandle:d,isValid:p}=l,m=(d==null?void 0:d.nodeId)===t&&(d==null?void 0:d.id)===e&&(d==null?void 0:d.type)===n;return{connectingFrom:(c==null?void 0:c.nodeId)===t&&(c==null?void 0:c.id)===e&&(c==null?void 0:c.type)===n,connectingTo:m,clickConnecting:(r==null?void 0:r.nodeId)===t&&(r==null?void 0:r.id)===e&&(r==null?void 0:r.type)===n,isPossibleEndHandle:s===dh.Strict?(c==null?void 0:c.type)!==n:t!==(c==null?void 0:c.nodeId)||e!==(c==null?void 0:c.id),connectionInProcess:!!c,clickConnectionInProcess:!!r,valid:m&&p}};function UK({type:t="source",position:e=Qe.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:r=!0,isConnectableEnd:s=!0,id:l,onConnect:c,children:d,className:p,onMouseDown:m,onTouchStart:g,...b},v){var W,B;const _=l||null,C=t==="target",T=Zn(),w=fk(),{connectOnClick:k,noPanClassName:R,rfId:O}=Wt(BK,$n),{connectingFrom:j,connectingTo:D,clickConnecting:F,isPossibleEndHandle:$,connectionInProcess:P,clickConnectionInProcess:I,valid:K}=Wt(LK(w,_,t),$n);w||(B=(W=T.getState()).onError)==null||B.call(W,"010",po.error010());const G=X=>{const{defaultEdgeOptions:Z,onConnect:Q,hasDefaultEdges:q}=T.getState(),Y={...Z,...X};if(q){const{edges:ee,setEdges:V}=T.getState();V(tX(Y,ee))}Q==null||Q(Y),c==null||c(Y)},te=X=>{if(!w)return;const Z=jN(X.nativeEvent);if(r&&(Z&&X.button===0||!Z)){const Q=T.getState();O_.onPointerDown(X.nativeEvent,{handleDomNode:X.currentTarget,autoPanOnConnect:Q.autoPanOnConnect,connectionMode:Q.connectionMode,connectionRadius:Q.connectionRadius,domNode:Q.domNode,nodeLookup:Q.nodeLookup,lib:Q.lib,isTarget:C,handleId:_,nodeId:w,flowId:Q.rfId,panBy:Q.panBy,cancelConnection:Q.cancelConnection,onConnectStart:Q.onConnectStart,onConnectEnd:(...q)=>{var Y,ee;return(ee=(Y=T.getState()).onConnectEnd)==null?void 0:ee.call(Y,...q)},updateConnection:Q.updateConnection,onConnect:G,isValidConnection:n||((...q)=>{var Y,ee;return((ee=(Y=T.getState()).isValidConnection)==null?void 0:ee.call(Y,...q))??!0}),getTransform:()=>T.getState().transform,getFromHandle:()=>T.getState().connection.fromHandle,autoPanSpeed:Q.autoPanSpeed,dragThreshold:Q.connectionDragThreshold})}Z?m==null||m(X):g==null||g(X)},H=X=>{const{onClickConnectStart:Z,onClickConnectEnd:Q,connectionClickStartHandle:q,connectionMode:Y,isValidConnection:ee,lib:V,rfId:oe,nodeLookup:be,connection:ve}=T.getState();if(!w||!q&&!r)return;if(!q){Z==null||Z(X.nativeEvent,{nodeId:w,handleId:_,handleType:t}),T.setState({connectionClickStartHandle:{nodeId:w,type:t,id:_}});return}const se=UN(X.target),ge=n||ee,{connection:le,isValid:Re}=O_.isValid(X.nativeEvent,{handle:{nodeId:w,id:_,type:t},connectionMode:Y,fromNodeId:q.nodeId,fromHandleId:q.id||null,fromType:q.type,isValidConnection:ge,flowId:oe,doc:se,lib:V,nodeLookup:be});Re&&le&&G(le);const Ie=structuredClone(ve);delete Ie.inProgress,Ie.toPosition=Ie.toHandle?Ie.toHandle.position:null,Q==null||Q(X,Ie),T.setState({connectionClickStartHandle:null})};return A.jsx("div",{"data-handleid":_,"data-nodeid":w,"data-handlepos":e,"data-id":`${O}-${w}-${_}-${t}`,className:Oi(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",R,p,{source:!C,target:C,connectable:i,connectablestart:r,connectableend:s,clickconnecting:F,connectingfrom:j,connectingto:D,valid:K,connectionindicator:i&&(!P||$)&&(P||I?s:r)}]),onMouseDown:te,onTouchStart:te,onClick:k?H:void 0,ref:v,...b,children:d})}const cu=U.memo(lk(UK));function IK({data:t,isConnectable:e,sourcePosition:n=Qe.Bottom}){return A.jsxs(A.Fragment,{children:[t==null?void 0:t.label,A.jsx(cu,{type:"source",position:n,isConnectable:e})]})}function jK({data:t,isConnectable:e,targetPosition:n=Qe.Top,sourcePosition:i=Qe.Bottom}){return A.jsxs(A.Fragment,{children:[A.jsx(cu,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label,A.jsx(cu,{type:"source",position:i,isConnectable:e})]})}function HK(){return null}function PK({data:t,isConnectable:e,targetPosition:n=Qe.Top}){return A.jsxs(A.Fragment,{children:[A.jsx(cu,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label]})}const V0={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},$T={input:IK,default:jK,output:PK,group:HK};function GK(t){var e,n,i,r;return t.internals.handleBounds===void 0?{width:t.width??t.initialWidth??((e=t.style)==null?void 0:e.width),height:t.height??t.initialHeight??((n=t.style)==null?void 0:n.height)}:{width:t.width??((i=t.style)==null?void 0:i.width),height:t.height??((r=t.style)==null?void 0:r.height)}}const FK=t=>{const{width:e,height:n,x:i,y:r}=ig(t.nodeLookup,{filter:s=>!!s.selected});return{width:gl(e)?e:null,height:gl(n)?n:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${i}px,${r}px)`}};function qK({onSelectionContextMenu:t,noPanClassName:e,disableKeyboardA11y:n}){const i=Zn(),{width:r,height:s,transformString:l,userSelectionActive:c}=Wt(FK,$n),d=uk(),p=U.useRef(null);U.useEffect(()=>{var v;n||(v=p.current)==null||v.focus({preventScroll:!0})},[n]);const m=!c&&r!==null&&s!==null;if(ck({nodeRef:p,disabled:!m}),!m)return null;const g=t?v=>{const _=i.getState().nodes.filter(C=>C.selected);t(v,_)}:void 0,b=v=>{Object.prototype.hasOwnProperty.call(V0,v.key)&&(v.preventDefault(),d({direction:V0[v.key],factor:v.shiftKey?4:1}))};return A.jsx("div",{className:Oi(["react-flow__nodesselection","react-flow__container",e]),style:{transform:l},children:A.jsx("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:n?void 0:-1,onKeyDown:n?void 0:b,style:{width:r,height:s}})})}const ZT=typeof window<"u"?window:void 0,YK=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function dk({children:t,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:l,paneClickDistance:c,deleteKeyCode:d,selectionKeyCode:p,selectionOnDrag:m,selectionMode:g,onSelectionStart:b,onSelectionEnd:v,multiSelectionKeyCode:_,panActivationKeyCode:C,zoomActivationKeyCode:T,elementsSelectable:w,zoomOnScroll:k,zoomOnPinch:R,panOnScroll:O,panOnScrollSpeed:j,panOnScrollMode:D,zoomOnDoubleClick:F,panOnDrag:$,defaultViewport:P,translateExtent:I,minZoom:K,maxZoom:G,preventScrolling:te,onSelectionContextMenu:H,noWheelClassName:W,noPanClassName:B,disableKeyboardA11y:X,onViewportChange:Z,isControlledViewport:Q}){const{nodesSelectionActive:q,userSelectionActive:Y}=Wt(YK,$n),ee=qm(p,{target:ZT}),V=qm(C,{target:ZT}),oe=V||$,be=V||O,ve=m&&oe!==!0,se=ee||Y||ve;return TK({deleteKeyCode:d,multiSelectionKeyCode:_}),A.jsx(MK,{onPaneContextMenu:s,elementsSelectable:w,zoomOnScroll:k,zoomOnPinch:R,panOnScroll:be,panOnScrollSpeed:j,panOnScrollMode:D,zoomOnDoubleClick:F,panOnDrag:!ee&&oe,defaultViewport:P,translateExtent:I,minZoom:K,maxZoom:G,zoomActivationKeyCode:T,preventScrolling:te,noWheelClassName:W,noPanClassName:B,onViewportChange:Z,isControlledViewport:Q,paneClickDistance:c,selectionOnDrag:ve,children:A.jsxs(OK,{onSelectionStart:b,onSelectionEnd:v,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:l,panOnDrag:oe,isSelecting:!!se,selectionMode:g,selectionKeyPressed:ee,paneClickDistance:c,selectionOnDrag:ve,children:[t,q&&A.jsx(qK,{onSelectionContextMenu:H,noPanClassName:B,disableKeyboardA11y:X})]})})}dk.displayName="FlowRenderer";const VK=U.memo(dk),XK=t=>e=>t?B1(e.nodeLookup,{x:0,y:0,width:e.width,height:e.height},e.transform,!0).map(n=>n.id):Array.from(e.nodeLookup.keys());function KK(t){return Wt(U.useCallback(XK(t),[t]),$n)}const WK=t=>t.updateNodeInternals;function $K(){const t=Wt(WK),[e]=U.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const i=new Map;n.forEach(r=>{const s=r.target.getAttribute("data-id");i.set(s,{id:s,nodeElement:r.target,force:!0})}),t(i)}));return U.useEffect(()=>()=>{e==null||e.disconnect()},[e]),e}function ZK({node:t,nodeType:e,hasDimensions:n,resizeObserver:i}){const r=Zn(),s=U.useRef(null),l=U.useRef(null),c=U.useRef(t.sourcePosition),d=U.useRef(t.targetPosition),p=U.useRef(e),m=n&&!!t.internals.handleBounds;return U.useEffect(()=>{s.current&&!t.hidden&&(!m||l.current!==s.current)&&(l.current&&(i==null||i.unobserve(l.current)),i==null||i.observe(s.current),l.current=s.current)},[m,t.hidden]),U.useEffect(()=>()=>{l.current&&(i==null||i.unobserve(l.current),l.current=null)},[]),U.useEffect(()=>{if(s.current){const g=p.current!==e,b=c.current!==t.sourcePosition,v=d.current!==t.targetPosition;(g||b||v)&&(p.current=e,c.current=t.sourcePosition,d.current=t.targetPosition,r.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:s.current,force:!0}]])))}},[t.id,e,t.sourcePosition,t.targetPosition]),s}function QK({id:t,onClick:e,onMouseEnter:n,onMouseMove:i,onMouseLeave:r,onContextMenu:s,onDoubleClick:l,nodesDraggable:c,elementsSelectable:d,nodesConnectable:p,nodesFocusable:m,resizeObserver:g,noDragClassName:b,noPanClassName:v,disableKeyboardA11y:_,rfId:C,nodeTypes:T,nodeClickDistance:w,onError:k}){const{node:R,internals:O,isParent:j}=Wt(ge=>{const le=ge.nodeLookup.get(t),Re=ge.parentLookup.has(t);return{node:le,internals:le.internals,isParent:Re}},$n);let D=R.type||"default",F=(T==null?void 0:T[D])||$T[D];F===void 0&&(k==null||k("003",po.error003(D)),D="default",F=(T==null?void 0:T.default)||$T.default);const $=!!(R.draggable||c&&typeof R.draggable>"u"),P=!!(R.selectable||d&&typeof R.selectable>"u"),I=!!(R.connectable||p&&typeof R.connectable>"u"),K=!!(R.focusable||m&&typeof R.focusable>"u"),G=Zn(),te=BN(R),H=ZK({node:R,nodeType:D,hasDimensions:te,resizeObserver:g}),W=ck({nodeRef:H,disabled:R.hidden||!$,noDragClassName:b,handleSelector:R.dragHandle,nodeId:t,isSelectable:P,nodeClickDistance:w}),B=uk();if(R.hidden)return null;const X=cc(R),Z=GK(R),Q=P||$||e||n||i||r,q=n?ge=>n(ge,{...O.userNode}):void 0,Y=i?ge=>i(ge,{...O.userNode}):void 0,ee=r?ge=>r(ge,{...O.userNode}):void 0,V=s?ge=>s(ge,{...O.userNode}):void 0,oe=l?ge=>l(ge,{...O.userNode}):void 0,be=ge=>{const{selectNodesOnDrag:le,nodeDragThreshold:Re}=G.getState();P&&(!le||!$||Re>0)&&D_({id:t,store:G,nodeRef:H}),e&&e(ge,{...O.userNode})},ve=ge=>{if(!(IN(ge.nativeEvent)||_)){if(CN.includes(ge.key)&&P){const le=ge.key==="Escape";D_({id:t,store:G,unselect:le,nodeRef:H})}else if($&&R.selected&&Object.prototype.hasOwnProperty.call(V0,ge.key)){ge.preventDefault();const{ariaLabelConfig:le}=G.getState();G.setState({ariaLiveMessage:le["node.a11yDescription.ariaLiveMessage"]({direction:ge.key.replace("Arrow","").toLowerCase(),x:~~O.positionAbsolute.x,y:~~O.positionAbsolute.y})}),B({direction:V0[ge.key],factor:ge.shiftKey?4:1})}}},se=()=>{var Ve;if(_||!((Ve=H.current)!=null&&Ve.matches(":focus-visible")))return;const{transform:ge,width:le,height:Re,autoPanOnNodeFocus:Ie,setCenter:Ue}=G.getState();if(!Ie)return;B1(new Map([[t,R]]),{x:0,y:0,width:le,height:Re},ge,!0).length>0||Ue(R.position.x+X.width/2,R.position.y+X.height/2,{zoom:ge[2]})};return A.jsx("div",{className:Oi(["react-flow__node",`react-flow__node-${D}`,{[v]:$},R.className,{selected:R.selected,selectable:P,parent:j,draggable:$,dragging:W}]),ref:H,style:{zIndex:O.z,transform:`translate(${O.positionAbsolute.x}px,${O.positionAbsolute.y}px)`,pointerEvents:Q?"all":"none",visibility:te?"visible":"hidden",...R.style,...Z},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:q,onMouseMove:Y,onMouseLeave:ee,onContextMenu:V,onClick:be,onDoubleClick:oe,onKeyDown:K?ve:void 0,tabIndex:K?0:void 0,onFocus:K?se:void 0,role:R.ariaRole??(K?"group":void 0),"aria-roledescription":"node","aria-describedby":_?void 0:`${ik}-${C}`,"aria-label":R.ariaLabel,...R.domAttributes,children:A.jsx(zK,{value:t,children:A.jsx(F,{id:t,data:R.data,type:D,positionAbsoluteX:O.positionAbsolute.x,positionAbsoluteY:O.positionAbsolute.y,selected:R.selected??!1,selectable:P,draggable:$,deletable:R.deletable??!0,isConnectable:I,sourcePosition:R.sourcePosition,targetPosition:R.targetPosition,dragging:W,dragHandle:R.dragHandle,zIndex:O.z,parentId:R.parentId,...X})})})}var JK=U.memo(QK);const eW=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function hk(t){const{nodesDraggable:e,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,onError:s}=Wt(eW,$n),l=KK(t.onlyRenderVisibleElements),c=$K();return A.jsx("div",{className:"react-flow__nodes",style:vb,children:l.map(d=>A.jsx(JK,{id:d,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:c,nodesDraggable:e,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,nodeClickDistance:t.nodeClickDistance,onError:s},d))})}hk.displayName="NodeRenderer";const tW=U.memo(hk);function nW(t){return Wt(U.useCallback(n=>{if(!t)return n.edges.map(r=>r.id);const i=[];if(n.width&&n.height)for(const r of n.edges){const s=n.nodeLookup.get(r.source),l=n.nodeLookup.get(r.target);s&&l&&QV({sourceNode:s,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&i.push(r.id)}return i},[t]),$n)}const iW=({color:t="none",strokeWidth:e=1})=>{const n={strokeWidth:e,...t&&{stroke:t}};return A.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},rW=({color:t="none",strokeWidth:e=1})=>{const n={strokeWidth:e,...t&&{stroke:t,fill:t}};return A.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},QT={[F0.Arrow]:iW,[F0.ArrowClosed]:rW};function aW(t){const e=Zn();return U.useMemo(()=>{var r,s;return Object.prototype.hasOwnProperty.call(QT,t)?QT[t]:((s=(r=e.getState()).onError)==null||s.call(r,"009",po.error009(t)),null)},[t])}const sW=({id:t,type:e,color:n,width:i=12.5,height:r=12.5,markerUnits:s="strokeWidth",strokeWidth:l,orient:c="auto-start-reverse"})=>{const d=aW(e);return d?A.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${i}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:c,refX:"0",refY:"0",children:A.jsx(d,{color:n,strokeWidth:l})}):null},pk=({defaultColor:t,rfId:e})=>{const n=Wt(s=>s.edges),i=Wt(s=>s.defaultEdgeOptions),r=U.useMemo(()=>sX(n,{id:e,defaultColor:t,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[n,i,e,t]);return r.length?A.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:A.jsx("defs",{children:r.map(s=>A.jsx(sW,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};pk.displayName="MarkerDefinitions";var lW=U.memo(pk);function mk({x:t,y:e,label:n,labelStyle:i,labelShowBg:r=!0,labelBgStyle:s,labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:d,className:p,...m}){const[g,b]=U.useState({x:1,y:0,width:0,height:0}),v=Oi(["react-flow__edge-textwrapper",p]),_=U.useRef(null);return U.useEffect(()=>{if(_.current){const C=_.current.getBBox();b({x:C.x,y:C.y,width:C.width,height:C.height})}},[n]),n?A.jsxs("g",{transform:`translate(${t-g.width/2} ${e-g.height/2})`,className:v,visibility:g.width?"visible":"hidden",...m,children:[r&&A.jsx("rect",{width:g.width+2*l[0],x:-l[0],y:-l[1],height:g.height+2*l[1],className:"react-flow__edge-textbg",style:s,rx:c,ry:c}),A.jsx("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:_,style:i,children:n}),d]}):null}mk.displayName="EdgeText";const oW=U.memo(mk);function _b({path:t,labelX:e,labelY:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:d,interactionWidth:p=20,...m}){return A.jsxs(A.Fragment,{children:[A.jsx("path",{...m,d:t,fill:"none",className:Oi(["react-flow__edge-path",m.className])}),p?A.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:p,className:"react-flow__edge-interaction"}):null,i&&gl(e)&&gl(n)?A.jsx(oW,{x:e,y:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:d}):null]})}function JT({pos:t,x1:e,y1:n,x2:i,y2:r}){return t===Qe.Left||t===Qe.Right?[.5*(e+i),n]:[e,.5*(n+r)]}function gk({sourceX:t,sourceY:e,sourcePosition:n=Qe.Bottom,targetX:i,targetY:r,targetPosition:s=Qe.Top}){const[l,c]=JT({pos:n,x1:t,y1:e,x2:i,y2:r}),[d,p]=JT({pos:s,x1:i,y1:r,x2:t,y2:e}),[m,g,b,v]=HN({sourceX:t,sourceY:e,targetX:i,targetY:r,sourceControlX:l,sourceControlY:c,targetControlX:d,targetControlY:p});return[`M${t},${e} C${l},${c} ${d},${p} ${i},${r}`,m,g,b,v]}function yk(t){return U.memo(({id:e,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:l,targetPosition:c,label:d,labelStyle:p,labelShowBg:m,labelBgStyle:g,labelBgPadding:b,labelBgBorderRadius:v,style:_,markerEnd:C,markerStart:T,interactionWidth:w})=>{const[k,R,O]=gk({sourceX:n,sourceY:i,sourcePosition:l,targetX:r,targetY:s,targetPosition:c}),j=t.isInternal?void 0:e;return A.jsx(_b,{id:j,path:k,labelX:R,labelY:O,label:d,labelStyle:p,labelShowBg:m,labelBgStyle:g,labelBgPadding:b,labelBgBorderRadius:v,style:_,markerEnd:C,markerStart:T,interactionWidth:w})})}const cW=yk({isInternal:!1}),bk=yk({isInternal:!0});cW.displayName="SimpleBezierEdge";bk.displayName="SimpleBezierEdgeInternal";function xk(t){return U.memo(({id:e,sourceX:n,sourceY:i,targetX:r,targetY:s,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:b,sourcePosition:v=Qe.Bottom,targetPosition:_=Qe.Top,markerEnd:C,markerStart:T,pathOptions:w,interactionWidth:k})=>{const[R,O,j]=R_({sourceX:n,sourceY:i,sourcePosition:v,targetX:r,targetY:s,targetPosition:_,borderRadius:w==null?void 0:w.borderRadius,offset:w==null?void 0:w.offset,stepPosition:w==null?void 0:w.stepPosition}),D=t.isInternal?void 0:e;return A.jsx(_b,{id:D,path:R,labelX:O,labelY:j,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:b,markerEnd:C,markerStart:T,interactionWidth:k})})}const vk=xk({isInternal:!1}),_k=xk({isInternal:!0});vk.displayName="SmoothStepEdge";_k.displayName="SmoothStepEdgeInternal";function Sk(t){return U.memo(({id:e,...n})=>{var r;const i=t.isInternal?void 0:e;return A.jsx(vk,{...n,id:i,pathOptions:U.useMemo(()=>{var s;return{borderRadius:0,offset:(s=n.pathOptions)==null?void 0:s.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const uW=Sk({isInternal:!1}),Ek=Sk({isInternal:!0});uW.displayName="StepEdge";Ek.displayName="StepEdgeInternal";function wk(t){return U.memo(({id:e,sourceX:n,sourceY:i,targetX:r,targetY:s,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:b,markerEnd:v,markerStart:_,interactionWidth:C})=>{const[T,w,k]=FN({sourceX:n,sourceY:i,targetX:r,targetY:s}),R=t.isInternal?void 0:e;return A.jsx(_b,{id:R,path:T,labelX:w,labelY:k,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:b,markerEnd:v,markerStart:_,interactionWidth:C})})}const fW=wk({isInternal:!1}),Tk=wk({isInternal:!0});fW.displayName="StraightEdge";Tk.displayName="StraightEdgeInternal";function Ck(t){return U.memo(({id:e,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:l=Qe.Bottom,targetPosition:c=Qe.Top,label:d,labelStyle:p,labelShowBg:m,labelBgStyle:g,labelBgPadding:b,labelBgBorderRadius:v,style:_,markerEnd:C,markerStart:T,pathOptions:w,interactionWidth:k})=>{const[R,O,j]=PN({sourceX:n,sourceY:i,sourcePosition:l,targetX:r,targetY:s,targetPosition:c,curvature:w==null?void 0:w.curvature}),D=t.isInternal?void 0:e;return A.jsx(_b,{id:D,path:R,labelX:O,labelY:j,label:d,labelStyle:p,labelShowBg:m,labelBgStyle:g,labelBgPadding:b,labelBgBorderRadius:v,style:_,markerEnd:C,markerStart:T,interactionWidth:k})})}const dW=Ck({isInternal:!1}),Ak=Ck({isInternal:!0});dW.displayName="BezierEdge";Ak.displayName="BezierEdgeInternal";const eC={default:Ak,straight:Tk,step:Ek,smoothstep:_k,simplebezier:bk},tC={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},hW=(t,e,n)=>n===Qe.Left?t-e:n===Qe.Right?t+e:t,pW=(t,e,n)=>n===Qe.Top?t-e:n===Qe.Bottom?t+e:t,nC="react-flow__edgeupdater";function iC({position:t,centerX:e,centerY:n,radius:i=10,onMouseDown:r,onMouseEnter:s,onMouseOut:l,type:c}){return A.jsx("circle",{onMouseDown:r,onMouseEnter:s,onMouseOut:l,className:Oi([nC,`${nC}-${c}`]),cx:hW(e,i,t),cy:pW(n,i,t),r:i,stroke:"transparent",fill:"transparent"})}function mW({isReconnectable:t,reconnectRadius:e,edge:n,sourceX:i,sourceY:r,targetX:s,targetY:l,sourcePosition:c,targetPosition:d,onReconnect:p,onReconnectStart:m,onReconnectEnd:g,setReconnecting:b,setUpdateHover:v}){const _=Zn(),C=(O,j)=>{if(O.button!==0)return;const{autoPanOnConnect:D,domNode:F,connectionMode:$,connectionRadius:P,lib:I,onConnectStart:K,cancelConnection:G,nodeLookup:te,rfId:H,panBy:W,updateConnection:B}=_.getState(),X=j.type==="target",Z=(Y,ee)=>{b(!1),g==null||g(Y,n,j.type,ee)},Q=Y=>p==null?void 0:p(n,Y),q=(Y,ee)=>{b(!0),m==null||m(O,n,j.type),K==null||K(Y,ee)};O_.onPointerDown(O.nativeEvent,{autoPanOnConnect:D,connectionMode:$,connectionRadius:P,domNode:F,handleId:j.id,nodeId:j.nodeId,nodeLookup:te,isTarget:X,edgeUpdaterType:j.type,lib:I,flowId:H,cancelConnection:G,panBy:W,isValidConnection:(...Y)=>{var ee,V;return((V=(ee=_.getState()).isValidConnection)==null?void 0:V.call(ee,...Y))??!0},onConnect:Q,onConnectStart:q,onConnectEnd:(...Y)=>{var ee,V;return(V=(ee=_.getState()).onConnectEnd)==null?void 0:V.call(ee,...Y)},onReconnectEnd:Z,updateConnection:B,getTransform:()=>_.getState().transform,getFromHandle:()=>_.getState().connection.fromHandle,dragThreshold:_.getState().connectionDragThreshold,handleDomNode:O.currentTarget})},T=O=>C(O,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),w=O=>C(O,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),k=()=>v(!0),R=()=>v(!1);return A.jsxs(A.Fragment,{children:[(t===!0||t==="source")&&A.jsx(iC,{position:c,centerX:i,centerY:r,radius:e,onMouseDown:T,onMouseEnter:k,onMouseOut:R,type:"source"}),(t===!0||t==="target")&&A.jsx(iC,{position:d,centerX:s,centerY:l,radius:e,onMouseDown:w,onMouseEnter:k,onMouseOut:R,type:"target"})]})}function gW({id:t,edgesFocusable:e,edgesReconnectable:n,elementsSelectable:i,onClick:r,onDoubleClick:s,onContextMenu:l,onMouseEnter:c,onMouseMove:d,onMouseLeave:p,reconnectRadius:m,onReconnect:g,onReconnectStart:b,onReconnectEnd:v,rfId:_,edgeTypes:C,noPanClassName:T,onError:w,disableKeyboardA11y:k}){let R=Wt(Ue=>Ue.edgeLookup.get(t));const O=Wt(Ue=>Ue.defaultEdgeOptions);R=O?{...O,...R}:R;let j=R.type||"default",D=(C==null?void 0:C[j])||eC[j];D===void 0&&(w==null||w("011",po.error011(j)),j="default",D=(C==null?void 0:C.default)||eC.default);const F=!!(R.focusable||e&&typeof R.focusable>"u"),$=typeof g<"u"&&(R.reconnectable||n&&typeof R.reconnectable>"u"),P=!!(R.selectable||i&&typeof R.selectable>"u"),I=U.useRef(null),[K,G]=U.useState(!1),[te,H]=U.useState(!1),W=Zn(),{zIndex:B,sourceX:X,sourceY:Z,targetX:Q,targetY:q,sourcePosition:Y,targetPosition:ee}=Wt(U.useCallback(Ue=>{const Le=Ue.nodeLookup.get(R.source),Ve=Ue.nodeLookup.get(R.target);if(!Le||!Ve)return{zIndex:R.zIndex,...tC};const ut=aX({id:t,sourceNode:Le,targetNode:Ve,sourceHandle:R.sourceHandle||null,targetHandle:R.targetHandle||null,connectionMode:Ue.connectionMode,onError:w});return{zIndex:ZV({selected:R.selected,zIndex:R.zIndex,sourceNode:Le,targetNode:Ve,elevateOnSelect:Ue.elevateEdgesOnSelect,zIndexMode:Ue.zIndexMode}),...ut||tC}},[R.source,R.target,R.sourceHandle,R.targetHandle,R.selected,R.zIndex]),$n),V=U.useMemo(()=>R.markerStart?`url('#${N_(R.markerStart,_)}')`:void 0,[R.markerStart,_]),oe=U.useMemo(()=>R.markerEnd?`url('#${N_(R.markerEnd,_)}')`:void 0,[R.markerEnd,_]);if(R.hidden||X===null||Z===null||Q===null||q===null)return null;const be=Ue=>{var He;const{addSelectedEdges:Le,unselectNodesAndEdges:Ve,multiSelectionActive:ut}=W.getState();P&&(W.setState({nodesSelectionActive:!1}),R.selected&&ut?(Ve({nodes:[],edges:[R]}),(He=I.current)==null||He.blur()):Le([t])),r&&r(Ue,R)},ve=s?Ue=>{s(Ue,{...R})}:void 0,se=l?Ue=>{l(Ue,{...R})}:void 0,ge=c?Ue=>{c(Ue,{...R})}:void 0,le=d?Ue=>{d(Ue,{...R})}:void 0,Re=p?Ue=>{p(Ue,{...R})}:void 0,Ie=Ue=>{var Le;if(!k&&CN.includes(Ue.key)&&P){const{unselectNodesAndEdges:Ve,addSelectedEdges:ut}=W.getState();Ue.key==="Escape"?((Le=I.current)==null||Le.blur(),Ve({edges:[R]})):ut([t])}};return A.jsx("svg",{style:{zIndex:B},children:A.jsxs("g",{className:Oi(["react-flow__edge",`react-flow__edge-${j}`,R.className,T,{selected:R.selected,animated:R.animated,inactive:!P&&!r,updating:K,selectable:P}]),onClick:be,onDoubleClick:ve,onContextMenu:se,onMouseEnter:ge,onMouseMove:le,onMouseLeave:Re,onKeyDown:F?Ie:void 0,tabIndex:F?0:void 0,role:R.ariaRole??(F?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":R.ariaLabel===null?void 0:R.ariaLabel||`Edge from ${R.source} to ${R.target}`,"aria-describedby":F?`${rk}-${_}`:void 0,ref:I,...R.domAttributes,children:[!te&&A.jsx(D,{id:t,source:R.source,target:R.target,type:R.type,selected:R.selected,animated:R.animated,selectable:P,deletable:R.deletable??!0,label:R.label,labelStyle:R.labelStyle,labelShowBg:R.labelShowBg,labelBgStyle:R.labelBgStyle,labelBgPadding:R.labelBgPadding,labelBgBorderRadius:R.labelBgBorderRadius,sourceX:X,sourceY:Z,targetX:Q,targetY:q,sourcePosition:Y,targetPosition:ee,data:R.data,style:R.style,sourceHandleId:R.sourceHandle,targetHandleId:R.targetHandle,markerStart:V,markerEnd:oe,pathOptions:"pathOptions"in R?R.pathOptions:void 0,interactionWidth:R.interactionWidth}),$&&A.jsx(mW,{edge:R,isReconnectable:$,reconnectRadius:m,onReconnect:g,onReconnectStart:b,onReconnectEnd:v,sourceX:X,sourceY:Z,targetX:Q,targetY:q,sourcePosition:Y,targetPosition:ee,setUpdateHover:G,setReconnecting:H})]})})}var yW=U.memo(gW);const bW=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function Mk({defaultMarkerColor:t,onlyRenderVisibleElements:e,rfId:n,edgeTypes:i,noPanClassName:r,onReconnect:s,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:d,onEdgeMouseLeave:p,onEdgeClick:m,reconnectRadius:g,onEdgeDoubleClick:b,onReconnectStart:v,onReconnectEnd:_,disableKeyboardA11y:C}){const{edgesFocusable:T,edgesReconnectable:w,elementsSelectable:k,onError:R}=Wt(bW,$n),O=nW(e);return A.jsxs("div",{className:"react-flow__edges",children:[A.jsx(lW,{defaultColor:t,rfId:n}),O.map(j=>A.jsx(yW,{id:j,edgesFocusable:T,edgesReconnectable:w,elementsSelectable:k,noPanClassName:r,onReconnect:s,onContextMenu:l,onMouseEnter:c,onMouseMove:d,onMouseLeave:p,onClick:m,reconnectRadius:g,onDoubleClick:b,onReconnectStart:v,onReconnectEnd:_,rfId:n,onError:R,edgeTypes:i,disableKeyboardA11y:C},j))]})}Mk.displayName="EdgeRenderer";const xW=U.memo(Mk),vW=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function _W({children:t}){const e=Wt(vW);return A.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:e},children:t})}function SW(t){const e=xb(),n=U.useRef(!1);U.useEffect(()=>{!n.current&&e.viewportInitialized&&t&&(setTimeout(()=>t(e),1),n.current=!0)},[t,e.viewportInitialized])}const EW=t=>{var e;return(e=t.panZoom)==null?void 0:e.syncViewport};function wW(t){const e=Wt(EW),n=Zn();return U.useEffect(()=>{t&&(e==null||e(t),n.setState({transform:[t.x,t.y,t.zoom]}))},[t,e]),null}function TW(t){return t.connection.inProgress?{...t.connection,to:ag(t.connection.to,t.transform)}:{...t.connection}}function CW(t){return TW}function AW(t){const e=CW();return Wt(e,$n)}const MW=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function RW({containerStyle:t,style:e,type:n,component:i}){const{nodesConnectable:r,width:s,height:l,isValid:c,inProgress:d}=Wt(MW,$n);return!(s&&r&&d)?null:A.jsx("svg",{style:t,width:s,height:l,className:"react-flow__connectionline react-flow__container",children:A.jsx("g",{className:Oi(["react-flow__connection",RN(c)]),children:A.jsx(Rk,{style:e,type:n,CustomComponent:i,isValid:c})})})}const Rk=({style:t,type:e=au.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:r,from:s,fromNode:l,fromHandle:c,fromPosition:d,to:p,toNode:m,toHandle:g,toPosition:b,pointer:v}=AW();if(!r)return;if(n)return A.jsx(n,{connectionLineType:e,connectionLineStyle:t,fromNode:l,fromHandle:c,fromX:s.x,fromY:s.y,toX:p.x,toY:p.y,fromPosition:d,toPosition:b,connectionStatus:RN(i),toNode:m,toHandle:g,pointer:v});let _="";const C={sourceX:s.x,sourceY:s.y,sourcePosition:d,targetX:p.x,targetY:p.y,targetPosition:b};switch(e){case au.Bezier:[_]=PN(C);break;case au.SimpleBezier:[_]=gk(C);break;case au.Step:[_]=R_({...C,borderRadius:0});break;case au.SmoothStep:[_]=R_(C);break;default:[_]=FN(C)}return A.jsx("path",{d:_,fill:"none",className:"react-flow__connection-path",style:t})};Rk.displayName="ConnectionLine";const NW={};function rC(t=NW){U.useRef(t),Zn(),U.useEffect(()=>{},[t])}function kW(){Zn(),U.useRef(!1),U.useEffect(()=>{},[])}function Nk({nodeTypes:t,edgeTypes:e,onInit:n,onNodeClick:i,onEdgeClick:r,onNodeDoubleClick:s,onEdgeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:p,onNodeContextMenu:m,onSelectionContextMenu:g,onSelectionStart:b,onSelectionEnd:v,connectionLineType:_,connectionLineStyle:C,connectionLineComponent:T,connectionLineContainerStyle:w,selectionKeyCode:k,selectionOnDrag:R,selectionMode:O,multiSelectionKeyCode:j,panActivationKeyCode:D,zoomActivationKeyCode:F,deleteKeyCode:$,onlyRenderVisibleElements:P,elementsSelectable:I,defaultViewport:K,translateExtent:G,minZoom:te,maxZoom:H,preventScrolling:W,defaultMarkerColor:B,zoomOnScroll:X,zoomOnPinch:Z,panOnScroll:Q,panOnScrollSpeed:q,panOnScrollMode:Y,zoomOnDoubleClick:ee,panOnDrag:V,onPaneClick:oe,onPaneMouseEnter:be,onPaneMouseMove:ve,onPaneMouseLeave:se,onPaneScroll:ge,onPaneContextMenu:le,paneClickDistance:Re,nodeClickDistance:Ie,onEdgeContextMenu:Ue,onEdgeMouseEnter:Le,onEdgeMouseMove:Ve,onEdgeMouseLeave:ut,reconnectRadius:He,onReconnect:At,onReconnectStart:zn,onReconnectEnd:Bn,noDragClassName:bn,noWheelClassName:wi,noPanClassName:ka,disableKeyboardA11y:Lr,nodeExtent:hn,rfId:ua,viewport:Se,onViewportChange:ke}){return rC(t),rC(e),kW(),SW(n),wW(Se),A.jsx(VK,{onPaneClick:oe,onPaneMouseEnter:be,onPaneMouseMove:ve,onPaneMouseLeave:se,onPaneContextMenu:le,onPaneScroll:ge,paneClickDistance:Re,deleteKeyCode:$,selectionKeyCode:k,selectionOnDrag:R,selectionMode:O,onSelectionStart:b,onSelectionEnd:v,multiSelectionKeyCode:j,panActivationKeyCode:D,zoomActivationKeyCode:F,elementsSelectable:I,zoomOnScroll:X,zoomOnPinch:Z,zoomOnDoubleClick:ee,panOnScroll:Q,panOnScrollSpeed:q,panOnScrollMode:Y,panOnDrag:V,defaultViewport:K,translateExtent:G,minZoom:te,maxZoom:H,onSelectionContextMenu:g,preventScrolling:W,noDragClassName:bn,noWheelClassName:wi,noPanClassName:ka,disableKeyboardA11y:Lr,onViewportChange:ke,isControlledViewport:!!Se,children:A.jsxs(_W,{children:[A.jsx(xW,{edgeTypes:e,onEdgeClick:r,onEdgeDoubleClick:l,onReconnect:At,onReconnectStart:zn,onReconnectEnd:Bn,onlyRenderVisibleElements:P,onEdgeContextMenu:Ue,onEdgeMouseEnter:Le,onEdgeMouseMove:Ve,onEdgeMouseLeave:ut,reconnectRadius:He,defaultMarkerColor:B,noPanClassName:ka,disableKeyboardA11y:Lr,rfId:ua}),A.jsx(RW,{style:C,type:_,component:T,containerStyle:w}),A.jsx("div",{className:"react-flow__edgelabel-renderer"}),A.jsx(tW,{nodeTypes:t,onNodeClick:i,onNodeDoubleClick:s,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:p,onNodeContextMenu:m,nodeClickDistance:Ie,onlyRenderVisibleElements:P,noPanClassName:ka,noDragClassName:bn,disableKeyboardA11y:Lr,nodeExtent:hn,rfId:ua}),A.jsx("div",{className:"react-flow__viewport-portal"})]})})}Nk.displayName="GraphView";const OW=U.memo(Nk),aC=({nodes:t,edges:e,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:l,fitViewOptions:c,minZoom:d=.5,maxZoom:p=2,nodeOrigin:m,nodeExtent:g,zIndexMode:b="basic"}={})=>{const v=new Map,_=new Map,C=new Map,T=new Map,w=i??e??[],k=n??t??[],R=m??[0,0],O=g??Hm;VN(C,T,w);const j=k_(k,v,_,{nodeOrigin:R,nodeExtent:O,zIndexMode:b});let D=[0,0,1];if(l&&r&&s){const F=ig(v,{filter:K=>!!((K.width||K.initialWidth)&&(K.height||K.initialHeight))}),{x:$,y:P,zoom:I}=L1(F,r,s,d,p,(c==null?void 0:c.padding)??.1);D=[$,P,I]}return{rfId:"1",width:r??0,height:s??0,transform:D,nodes:k,nodesInitialized:j,nodeLookup:v,parentLookup:_,edges:w,edgeLookup:T,connectionLookup:C,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:d,maxZoom:p,translateExtent:Hm,nodeExtent:O,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:dh.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:R,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:l??!1,fitViewOptions:c,fitViewResolver:null,connection:{...MN},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:YV,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:AN,zIndexMode:b,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},DW=({nodes:t,edges:e,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:l,fitViewOptions:c,minZoom:d,maxZoom:p,nodeOrigin:m,nodeExtent:g,zIndexMode:b})=>WX((v,_)=>{async function C(){const{nodeLookup:T,panZoom:w,fitViewOptions:k,fitViewResolver:R,width:O,height:j,minZoom:D,maxZoom:F}=_();w&&(await FV({nodes:T,width:O,height:j,panZoom:w,minZoom:D,maxZoom:F},k),R==null||R.resolve(!0),v({fitViewResolver:null}))}return{...aC({nodes:t,edges:e,width:r,height:s,fitView:l,fitViewOptions:c,minZoom:d,maxZoom:p,nodeOrigin:m,nodeExtent:g,defaultNodes:n,defaultEdges:i,zIndexMode:b}),setNodes:T=>{const{nodeLookup:w,parentLookup:k,nodeOrigin:R,elevateNodesOnSelect:O,fitViewQueued:j,zIndexMode:D}=_(),F=k_(T,w,k,{nodeOrigin:R,nodeExtent:g,elevateNodesOnSelect:O,checkEquality:!0,zIndexMode:D});j&&F?(C(),v({nodes:T,nodesInitialized:F,fitViewQueued:!1,fitViewOptions:void 0})):v({nodes:T,nodesInitialized:F})},setEdges:T=>{const{connectionLookup:w,edgeLookup:k}=_();VN(w,k,T),v({edges:T})},setDefaultNodesAndEdges:(T,w)=>{if(T){const{setNodes:k}=_();k(T),v({hasDefaultNodes:!0})}if(w){const{setEdges:k}=_();k(w),v({hasDefaultEdges:!0})}},updateNodeInternals:T=>{const{triggerNodeChanges:w,nodeLookup:k,parentLookup:R,domNode:O,nodeOrigin:j,nodeExtent:D,debug:F,fitViewQueued:$,zIndexMode:P}=_(),{changes:I,updatedInternals:K}=hX(T,k,R,O,j,D,P);K&&(cX(k,R,{nodeOrigin:j,nodeExtent:D,zIndexMode:P}),$?(C(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),(I==null?void 0:I.length)>0&&(F&&console.log("React Flow: trigger node changes",I),w==null||w(I)))},updateNodePositions:(T,w=!1)=>{const k=[];let R=[];const{nodeLookup:O,triggerNodeChanges:j,connection:D,updateConnection:F,onNodesChangeMiddlewareMap:$}=_();for(const[P,I]of T){const K=O.get(P),G=!!(K!=null&&K.expandParent&&(K!=null&&K.parentId)&&(I!=null&&I.position)),te={id:P,type:"position",position:G?{x:Math.max(0,I.position.x),y:Math.max(0,I.position.y)}:I.position,dragging:w};if(K&&D.inProgress&&D.fromNode.id===K.id){const H=wf(K,D.fromHandle,Qe.Left,!0);F({...D,from:H})}G&&K.parentId&&k.push({id:P,parentId:K.parentId,rect:{...I.internals.positionAbsolute,width:I.measured.width??0,height:I.measured.height??0}}),R.push(te)}if(k.length>0){const{parentLookup:P,nodeOrigin:I}=_(),K=G1(k,O,P,I);R.push(...K)}for(const P of $.values())R=P(R);j(R)},triggerNodeChanges:T=>{const{onNodesChange:w,setNodes:k,nodes:R,hasDefaultNodes:O,debug:j}=_();if(T!=null&&T.length){if(O){const D=gK(T,R);k(D)}j&&console.log("React Flow: trigger node changes",T),w==null||w(T)}},triggerEdgeChanges:T=>{const{onEdgesChange:w,setEdges:k,edges:R,hasDefaultEdges:O,debug:j}=_();if(T!=null&&T.length){if(O){const D=yK(T,R);k(D)}j&&console.log("React Flow: trigger edge changes",T),w==null||w(T)}},addSelectedNodes:T=>{const{multiSelectionActive:w,edgeLookup:k,nodeLookup:R,triggerNodeChanges:O,triggerEdgeChanges:j}=_();if(w){const D=T.map(F=>df(F,!0));O(D);return}O($d(R,new Set([...T]),!0)),j($d(k))},addSelectedEdges:T=>{const{multiSelectionActive:w,edgeLookup:k,nodeLookup:R,triggerNodeChanges:O,triggerEdgeChanges:j}=_();if(w){const D=T.map(F=>df(F,!0));j(D);return}j($d(k,new Set([...T]))),O($d(R,new Set,!0))},unselectNodesAndEdges:({nodes:T,edges:w}={})=>{const{edges:k,nodes:R,nodeLookup:O,triggerNodeChanges:j,triggerEdgeChanges:D}=_(),F=T||R,$=w||k,P=[];for(const K of F){if(!K.selected)continue;const G=O.get(K.id);G&&(G.selected=!1),P.push(df(K.id,!1))}const I=[];for(const K of $)K.selected&&I.push(df(K.id,!1));j(P),D(I)},setMinZoom:T=>{const{panZoom:w,maxZoom:k}=_();w==null||w.setScaleExtent([T,k]),v({minZoom:T})},setMaxZoom:T=>{const{panZoom:w,minZoom:k}=_();w==null||w.setScaleExtent([k,T]),v({maxZoom:T})},setTranslateExtent:T=>{var w;(w=_().panZoom)==null||w.setTranslateExtent(T),v({translateExtent:T})},resetSelectedElements:()=>{const{edges:T,nodes:w,triggerNodeChanges:k,triggerEdgeChanges:R,elementsSelectable:O}=_();if(!O)return;const j=w.reduce((F,$)=>$.selected?[...F,df($.id,!1)]:F,[]),D=T.reduce((F,$)=>$.selected?[...F,df($.id,!1)]:F,[]);k(j),R(D)},setNodeExtent:T=>{const{nodes:w,nodeLookup:k,parentLookup:R,nodeOrigin:O,elevateNodesOnSelect:j,nodeExtent:D,zIndexMode:F}=_();T[0][0]===D[0][0]&&T[0][1]===D[0][1]&&T[1][0]===D[1][0]&&T[1][1]===D[1][1]||(k_(w,k,R,{nodeOrigin:O,nodeExtent:T,elevateNodesOnSelect:j,checkEquality:!1,zIndexMode:F}),v({nodeExtent:T}))},panBy:T=>{const{transform:w,width:k,height:R,panZoom:O,translateExtent:j}=_();return pX({delta:T,panZoom:O,transform:w,translateExtent:j,width:k,height:R})},setCenter:async(T,w,k)=>{const{width:R,height:O,maxZoom:j,panZoom:D}=_();if(!D)return Promise.resolve(!1);const F=typeof(k==null?void 0:k.zoom)<"u"?k.zoom:j;return await D.setViewport({x:R/2-T*F,y:O/2-w*F,zoom:F},{duration:k==null?void 0:k.duration,ease:k==null?void 0:k.ease,interpolate:k==null?void 0:k.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{v({connection:{...MN}})},updateConnection:T=>{v({connection:T})},reset:()=>v({...aC()})}},Object.is);function kk({initialNodes:t,initialEdges:e,defaultNodes:n,defaultEdges:i,initialWidth:r,initialHeight:s,initialMinZoom:l,initialMaxZoom:c,initialFitViewOptions:d,fitView:p,nodeOrigin:m,nodeExtent:g,zIndexMode:b,children:v}){const[_]=U.useState(()=>DW({nodes:t,edges:e,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:p,minZoom:l,maxZoom:c,fitViewOptions:d,nodeOrigin:m,nodeExtent:g,zIndexMode:b}));return A.jsx($X,{value:_,children:A.jsx(_K,{children:v})})}function zW({children:t,nodes:e,edges:n,defaultNodes:i,defaultEdges:r,width:s,height:l,fitView:c,fitViewOptions:d,minZoom:p,maxZoom:m,nodeOrigin:g,nodeExtent:b,zIndexMode:v}){return U.useContext(yb)?A.jsx(A.Fragment,{children:t}):A.jsx(kk,{initialNodes:e,initialEdges:n,defaultNodes:i,defaultEdges:r,initialWidth:s,initialHeight:l,fitView:c,initialFitViewOptions:d,initialMinZoom:p,initialMaxZoom:m,nodeOrigin:g,nodeExtent:b,zIndexMode:v,children:t})}const BW={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function LW({nodes:t,edges:e,defaultNodes:n,defaultEdges:i,className:r,nodeTypes:s,edgeTypes:l,onNodeClick:c,onEdgeClick:d,onInit:p,onMove:m,onMoveStart:g,onMoveEnd:b,onConnect:v,onConnectStart:_,onConnectEnd:C,onClickConnectStart:T,onClickConnectEnd:w,onNodeMouseEnter:k,onNodeMouseMove:R,onNodeMouseLeave:O,onNodeContextMenu:j,onNodeDoubleClick:D,onNodeDragStart:F,onNodeDrag:$,onNodeDragStop:P,onNodesDelete:I,onEdgesDelete:K,onDelete:G,onSelectionChange:te,onSelectionDragStart:H,onSelectionDrag:W,onSelectionDragStop:B,onSelectionContextMenu:X,onSelectionStart:Z,onSelectionEnd:Q,onBeforeDelete:q,connectionMode:Y,connectionLineType:ee=au.Bezier,connectionLineStyle:V,connectionLineComponent:oe,connectionLineContainerStyle:be,deleteKeyCode:ve="Backspace",selectionKeyCode:se="Shift",selectionOnDrag:ge=!1,selectionMode:le=Pm.Full,panActivationKeyCode:Re="Space",multiSelectionKeyCode:Ie=Fm()?"Meta":"Control",zoomActivationKeyCode:Ue=Fm()?"Meta":"Control",snapToGrid:Le,snapGrid:Ve,onlyRenderVisibleElements:ut=!1,selectNodesOnDrag:He,nodesDraggable:At,autoPanOnNodeFocus:zn,nodesConnectable:Bn,nodesFocusable:bn,nodeOrigin:wi=ak,edgesFocusable:ka,edgesReconnectable:Lr,elementsSelectable:hn=!0,defaultViewport:ua=cK,minZoom:Se=.5,maxZoom:ke=2,translateExtent:Je=Hm,preventScrolling:bt=!0,nodeExtent:kt,defaultMarkerColor:yi="#b1b1b7",zoomOnScroll:rr=!0,zoomOnPinch:xn=!0,panOnScroll:$t=!1,panOnScrollSpeed:Gn=.5,panOnScrollMode:Pt=yf.Free,zoomOnDoubleClick:Fi=!0,panOnDrag:Qn=!0,onPaneClick:bo,onPaneMouseEnter:as,onPaneMouseMove:Oa,onPaneMouseLeave:ss,onPaneScroll:bi,onPaneContextMenu:ae,paneClickDistance:we=1,nodeClickDistance:Be=0,children:et,onReconnect:Jt,onReconnectStart:en,onReconnectEnd:Fe,onEdgeContextMenu:Pe,onEdgeDoubleClick:tt,onEdgeMouseEnter:Cn,onEdgeMouseMove:Gt,onEdgeMouseLeave:fa,reconnectRadius:ar=10,onNodesChange:qi,onEdgesChange:sr,noDragClassName:yt="nodrag",noWheelClassName:li="nowheel",noPanClassName:Ur="nopan",fitView:Us,fitViewOptions:El,connectOnClick:wl,attributionPosition:Tl,proOptions:Da,defaultEdgeOptions:Is,elevateNodesOnSelect:tn=!0,elevateEdgesOnSelect:nn=!1,disableKeyboardA11y:lr=!1,autoPanOnConnect:Ir,autoPanOnNodeDrag:Ln,autoPanSpeed:xr,connectionRadius:da,isValidConnection:jr,onError:Me,style:Xe,id:xt,nodeDragThreshold:Xt,connectionDragThreshold:Un,viewport:xi,onViewportChange:Yi,width:Ti,height:un,colorMode:or="light",debug:xo,onScroll:ha,ariaLabelConfig:Cl,zIndexMode:za="basic",...uc},Di){const ls=xt||"1",os=hK(or),js=U.useCallback(oi=>{oi.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ha==null||ha(oi)},[ha]);return A.jsx("div",{"data-testid":"rf__wrapper",...uc,onScroll:js,style:{...Xe,...BW},ref:Di,className:Oi(["react-flow",r,os]),id:xt,role:"application",children:A.jsxs(zW,{nodes:t,edges:e,width:Ti,height:un,fitView:Us,fitViewOptions:El,minZoom:Se,maxZoom:ke,nodeOrigin:wi,nodeExtent:kt,zIndexMode:za,children:[A.jsx(OW,{onInit:p,onNodeClick:c,onEdgeClick:d,onNodeMouseEnter:k,onNodeMouseMove:R,onNodeMouseLeave:O,onNodeContextMenu:j,onNodeDoubleClick:D,nodeTypes:s,edgeTypes:l,connectionLineType:ee,connectionLineStyle:V,connectionLineComponent:oe,connectionLineContainerStyle:be,selectionKeyCode:se,selectionOnDrag:ge,selectionMode:le,deleteKeyCode:ve,multiSelectionKeyCode:Ie,panActivationKeyCode:Re,zoomActivationKeyCode:Ue,onlyRenderVisibleElements:ut,defaultViewport:ua,translateExtent:Je,minZoom:Se,maxZoom:ke,preventScrolling:bt,zoomOnScroll:rr,zoomOnPinch:xn,zoomOnDoubleClick:Fi,panOnScroll:$t,panOnScrollSpeed:Gn,panOnScrollMode:Pt,panOnDrag:Qn,onPaneClick:bo,onPaneMouseEnter:as,onPaneMouseMove:Oa,onPaneMouseLeave:ss,onPaneScroll:bi,onPaneContextMenu:ae,paneClickDistance:we,nodeClickDistance:Be,onSelectionContextMenu:X,onSelectionStart:Z,onSelectionEnd:Q,onReconnect:Jt,onReconnectStart:en,onReconnectEnd:Fe,onEdgeContextMenu:Pe,onEdgeDoubleClick:tt,onEdgeMouseEnter:Cn,onEdgeMouseMove:Gt,onEdgeMouseLeave:fa,reconnectRadius:ar,defaultMarkerColor:yi,noDragClassName:yt,noWheelClassName:li,noPanClassName:Ur,rfId:ls,disableKeyboardA11y:lr,nodeExtent:kt,viewport:xi,onViewportChange:Yi}),A.jsx(dK,{nodes:t,edges:e,defaultNodes:n,defaultEdges:i,onConnect:v,onConnectStart:_,onConnectEnd:C,onClickConnectStart:T,onClickConnectEnd:w,nodesDraggable:At,autoPanOnNodeFocus:zn,nodesConnectable:Bn,nodesFocusable:bn,edgesFocusable:ka,edgesReconnectable:Lr,elementsSelectable:hn,elevateNodesOnSelect:tn,elevateEdgesOnSelect:nn,minZoom:Se,maxZoom:ke,nodeExtent:kt,onNodesChange:qi,onEdgesChange:sr,snapToGrid:Le,snapGrid:Ve,connectionMode:Y,translateExtent:Je,connectOnClick:wl,defaultEdgeOptions:Is,fitView:Us,fitViewOptions:El,onNodesDelete:I,onEdgesDelete:K,onDelete:G,onNodeDragStart:F,onNodeDrag:$,onNodeDragStop:P,onSelectionDrag:W,onSelectionDragStart:H,onSelectionDragStop:B,onMove:m,onMoveStart:g,onMoveEnd:b,noPanClassName:Ur,nodeOrigin:wi,rfId:ls,autoPanOnConnect:Ir,autoPanOnNodeDrag:Ln,autoPanSpeed:xr,onError:Me,connectionRadius:da,isValidConnection:jr,selectNodesOnDrag:He,nodeDragThreshold:Xt,connectionDragThreshold:Un,onBeforeDelete:q,debug:xo,ariaLabelConfig:Cl,zIndexMode:za}),A.jsx(oK,{onSelectionChange:te}),et,A.jsx(iK,{proOptions:Da,position:Tl}),A.jsx(nK,{rfId:ls,disableKeyboardA11y:lr})]})})}var UW=lk(LW);function IW({dimensions:t,lineWidth:e,variant:n,className:i}){return A.jsx("path",{strokeWidth:e,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:Oi(["react-flow__background-pattern",n,i])})}function jW({radius:t,className:e}){return A.jsx("circle",{cx:t,cy:t,r:t,className:Oi(["react-flow__background-pattern","dots",e])})}var lu;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(lu||(lu={}));const HW={[lu.Dots]:1,[lu.Lines]:1,[lu.Cross]:6},PW=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function Ok({id:t,variant:e=lu.Dots,gap:n=20,size:i,lineWidth:r=1,offset:s=0,color:l,bgColor:c,style:d,className:p,patternClassName:m}){const g=U.useRef(null),{transform:b,patternId:v}=Wt(PW,$n),_=i||HW[e],C=e===lu.Dots,T=e===lu.Cross,w=Array.isArray(n)?n:[n,n],k=[w[0]*b[2]||1,w[1]*b[2]||1],R=_*b[2],O=Array.isArray(s)?s:[s,s],j=T?[R,R]:k,D=[O[0]*b[2]||1+j[0]/2,O[1]*b[2]||1+j[1]/2],F=`${v}${t||""}`;return A.jsxs("svg",{className:Oi(["react-flow__background",p]),style:{...d,...vb,"--xy-background-color-props":c,"--xy-background-pattern-color-props":l},ref:g,"data-testid":"rf__background",children:[A.jsx("pattern",{id:F,x:b[0]%k[0],y:b[1]%k[1],width:k[0],height:k[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${D[0]},-${D[1]})`,children:C?A.jsx(jW,{radius:R/2,className:m}):A.jsx(IW,{dimensions:j,lineWidth:r,variant:e,className:m})}),A.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${F})`})]})}Ok.displayName="Background";const GW=U.memo(Ok);function FW(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:A.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function qW(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:A.jsx("path",{d:"M0 0h32v4.2H0z"})})}function YW(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:A.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function VW(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:A.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function XW(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:A.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function c0({children:t,className:e,...n}){return A.jsx("button",{type:"button",className:Oi(["react-flow__controls-button",e]),...n,children:t})}const KW=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function Dk({style:t,showZoom:e=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:r,onZoomIn:s,onZoomOut:l,onFitView:c,onInteractiveChange:d,className:p,children:m,position:g="bottom-left",orientation:b="vertical","aria-label":v}){const _=Zn(),{isInteractive:C,minZoomReached:T,maxZoomReached:w,ariaLabelConfig:k}=Wt(KW,$n),{zoomIn:R,zoomOut:O,fitView:j}=xb(),D=()=>{R(),s==null||s()},F=()=>{O(),l==null||l()},$=()=>{j(r),c==null||c()},P=()=>{_.setState({nodesDraggable:!C,nodesConnectable:!C,elementsSelectable:!C}),d==null||d(!C)},I=b==="horizontal"?"horizontal":"vertical";return A.jsxs(bb,{className:Oi(["react-flow__controls",I,p]),position:g,style:t,"data-testid":"rf__controls","aria-label":v??k["controls.ariaLabel"],children:[e&&A.jsxs(A.Fragment,{children:[A.jsx(c0,{onClick:D,className:"react-flow__controls-zoomin",title:k["controls.zoomIn.ariaLabel"],"aria-label":k["controls.zoomIn.ariaLabel"],disabled:w,children:A.jsx(FW,{})}),A.jsx(c0,{onClick:F,className:"react-flow__controls-zoomout",title:k["controls.zoomOut.ariaLabel"],"aria-label":k["controls.zoomOut.ariaLabel"],disabled:T,children:A.jsx(qW,{})})]}),n&&A.jsx(c0,{className:"react-flow__controls-fitview",onClick:$,title:k["controls.fitView.ariaLabel"],"aria-label":k["controls.fitView.ariaLabel"],children:A.jsx(YW,{})}),i&&A.jsx(c0,{className:"react-flow__controls-interactive",onClick:P,title:k["controls.interactive.ariaLabel"],"aria-label":k["controls.interactive.ariaLabel"],children:C?A.jsx(XW,{}):A.jsx(VW,{})}),m]})}Dk.displayName="Controls";const WW=U.memo(Dk);function $W({id:t,x:e,y:n,width:i,height:r,style:s,color:l,strokeColor:c,strokeWidth:d,className:p,borderRadius:m,shapeRendering:g,selected:b,onClick:v}){const{background:_,backgroundColor:C}=s||{},T=l||_||C;return A.jsx("rect",{className:Oi(["react-flow__minimap-node",{selected:b},p]),x:e,y:n,rx:m,ry:m,width:i,height:r,style:{fill:T,stroke:c,strokeWidth:d},shapeRendering:g,onClick:v?w=>v(w,t):void 0})}const ZW=U.memo($W),QW=t=>t.nodes.map(e=>e.id),Rv=t=>t instanceof Function?t:()=>t;function JW({nodeStrokeColor:t,nodeColor:e,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:r,nodeComponent:s=ZW,onClick:l}){const c=Wt(QW,$n),d=Rv(e),p=Rv(t),m=Rv(n),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return A.jsx(A.Fragment,{children:c.map(b=>A.jsx(t$,{id:b,nodeColorFunc:d,nodeStrokeColorFunc:p,nodeClassNameFunc:m,nodeBorderRadius:i,nodeStrokeWidth:r,NodeComponent:s,onClick:l,shapeRendering:g},b))})}function e$({id:t,nodeColorFunc:e,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:r,nodeStrokeWidth:s,shapeRendering:l,NodeComponent:c,onClick:d}){const{node:p,x:m,y:g,width:b,height:v}=Wt(_=>{const C=_.nodeLookup.get(t);if(!C)return{node:void 0,x:0,y:0,width:0,height:0};const T=C.internals.userNode,{x:w,y:k}=C.internals.positionAbsolute,{width:R,height:O}=cc(T);return{node:T,x:w,y:k,width:R,height:O}},$n);return!p||p.hidden||!BN(p)?null:A.jsx(c,{x:m,y:g,width:b,height:v,style:p.style,selected:!!p.selected,className:i(p),color:e(p),borderRadius:r,strokeColor:n(p),strokeWidth:s,shapeRendering:l,onClick:d,id:p.id})}const t$=U.memo(e$);var n$=U.memo(JW);const i$=200,r$=150,a$=t=>!t.hidden,s$=t=>{const e={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:e,boundingRect:t.nodeLookup.size>0?zN(ig(t.nodeLookup,{filter:a$}),e):e,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},l$="react-flow__minimap-desc";function zk({style:t,className:e,nodeStrokeColor:n,nodeColor:i,nodeClassName:r="",nodeBorderRadius:s=5,nodeStrokeWidth:l,nodeComponent:c,bgColor:d,maskColor:p,maskStrokeColor:m,maskStrokeWidth:g,position:b="bottom-right",onClick:v,onNodeClick:_,pannable:C=!1,zoomable:T=!1,ariaLabel:w,inversePan:k,zoomStep:R=1,offsetScale:O=5}){const j=Zn(),D=U.useRef(null),{boundingRect:F,viewBB:$,rfId:P,panZoom:I,translateExtent:K,flowWidth:G,flowHeight:te,ariaLabelConfig:H}=Wt(s$,$n),W=(t==null?void 0:t.width)??i$,B=(t==null?void 0:t.height)??r$,X=F.width/W,Z=F.height/B,Q=Math.max(X,Z),q=Q*W,Y=Q*B,ee=O*Q,V=F.x-(q-F.width)/2-ee,oe=F.y-(Y-F.height)/2-ee,be=q+ee*2,ve=Y+ee*2,se=`${l$}-${P}`,ge=U.useRef(0),le=U.useRef();ge.current=Q,U.useEffect(()=>{if(D.current&&I)return le.current=EX({domNode:D.current,panZoom:I,getTransform:()=>j.getState().transform,getViewScale:()=>ge.current}),()=>{var Le;(Le=le.current)==null||Le.destroy()}},[I]),U.useEffect(()=>{var Le;(Le=le.current)==null||Le.update({translateExtent:K,width:G,height:te,inversePan:k,pannable:C,zoomStep:R,zoomable:T})},[C,T,k,R,K,G,te]);const Re=v?Le=>{var He;const[Ve,ut]=((He=le.current)==null?void 0:He.pointer(Le))||[0,0];v(Le,{x:Ve,y:ut})}:void 0,Ie=_?U.useCallback((Le,Ve)=>{const ut=j.getState().nodeLookup.get(Ve).internals.userNode;_(Le,ut)},[]):void 0,Ue=w??H["minimap.ariaLabel"];return A.jsx(bb,{position:b,style:{...t,"--xy-minimap-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-background-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-width-props":typeof g=="number"?g*Q:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof l=="number"?l:void 0},className:Oi(["react-flow__minimap",e]),"data-testid":"rf__minimap",children:A.jsxs("svg",{width:W,height:B,viewBox:`${V} ${oe} ${be} ${ve}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":se,ref:D,onClick:Re,children:[Ue&&A.jsx("title",{id:se,children:Ue}),A.jsx(n$,{onClick:Ie,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:r,nodeStrokeWidth:l,nodeComponent:c}),A.jsx("path",{className:"react-flow__minimap-mask",d:`M${V-ee},${oe-ee}h${be+ee*2}v${ve+ee*2}h${-be-ee*2}z
|
|
400
|
+
M${$.x},${$.y}h${$.width}v${$.height}h${-$.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}zk.displayName="MiniMap";const o$=U.memo(zk),c$=t=>e=>t?`${Math.max(1/e.transform[2],1)}`:void 0,u$={[gh.Line]:"right",[gh.Handle]:"bottom-right"};function f$({nodeId:t,position:e,variant:n=gh.Handle,className:i,style:r=void 0,children:s,color:l,minWidth:c=10,minHeight:d=10,maxWidth:p=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:g=!1,resizeDirection:b,autoScale:v=!0,shouldResize:_,onResizeStart:C,onResize:T,onResizeEnd:w}){const k=fk(),R=typeof t=="string"?t:k,O=Zn(),j=U.useRef(null),D=n===gh.Handle,F=Wt(U.useCallback(c$(D&&v),[D,v]),$n),$=U.useRef(null),P=e??u$[n];U.useEffect(()=>{if(!(!j.current||!R))return $.current||($.current=UX({domNode:j.current,nodeId:R,getStoreItems:()=>{const{nodeLookup:K,transform:G,snapGrid:te,snapToGrid:H,nodeOrigin:W,domNode:B}=O.getState();return{nodeLookup:K,transform:G,snapGrid:te,snapToGrid:H,nodeOrigin:W,paneDomNode:B}},onChange:(K,G)=>{const{triggerNodeChanges:te,nodeLookup:H,parentLookup:W,nodeOrigin:B}=O.getState(),X=[],Z={x:K.x,y:K.y},Q=H.get(R);if(Q&&Q.expandParent&&Q.parentId){const q=Q.origin??B,Y=K.width??Q.measured.width??0,ee=K.height??Q.measured.height??0,V={id:Q.id,parentId:Q.parentId,rect:{width:Y,height:ee,...LN({x:K.x??Q.position.x,y:K.y??Q.position.y},{width:Y,height:ee},Q.parentId,H,q)}},oe=G1([V],H,W,B);X.push(...oe),Z.x=K.x?Math.max(q[0]*Y,K.x):void 0,Z.y=K.y?Math.max(q[1]*ee,K.y):void 0}if(Z.x!==void 0&&Z.y!==void 0){const q={id:R,type:"position",position:{...Z}};X.push(q)}if(K.width!==void 0&&K.height!==void 0){const Y={id:R,type:"dimensions",resizing:!0,setAttributes:b?b==="horizontal"?"width":"height":!0,dimensions:{width:K.width,height:K.height}};X.push(Y)}for(const q of G){const Y={...q,type:"position"};X.push(Y)}te(X)},onEnd:({width:K,height:G})=>{const te={id:R,type:"dimensions",resizing:!1,dimensions:{width:K,height:G}};O.getState().triggerNodeChanges([te])}})),$.current.update({controlPosition:P,boundaries:{minWidth:c,minHeight:d,maxWidth:p,maxHeight:m},keepAspectRatio:g,resizeDirection:b,onResizeStart:C,onResize:T,onResizeEnd:w,shouldResize:_}),()=>{var K;(K=$.current)==null||K.destroy()}},[P,c,d,p,m,g,C,T,w,_]);const I=P.split("-");return A.jsx("div",{className:Oi(["react-flow__resize-control","nodrag",...I,n,i]),ref:j,style:{...r,scale:F,...l&&{[D?"backgroundColor":"borderColor"]:l}},children:s})}U.memo(f$);const Bk={background:"rgba(0, 200, 255, 0.4)",width:6,height:6,border:"none"},sC={background:"rgba(0, 230, 138, 0.4)",width:6,height:6,border:"none"};function d$({data:t}){return A.jsxs("div",{style:{padding:"16px 32px",border:"2px solid rgba(0, 200, 255, 0.4)",borderRadius:12,background:"linear-gradient(135deg, #121425, #1a1d35)",boxShadow:"0 0 30px rgba(0, 200, 255, 0.15), 0 4px 16px rgba(0,0,0,0.5)",textAlign:"center",minWidth:200},children:[A.jsx(cu,{type:"source",position:Qe.Bottom,style:Bk}),A.jsx("div",{style:{width:44,height:44,borderRadius:8,background:"linear-gradient(135deg, #00c8ff, #0090b8)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.1rem",fontWeight:700,color:"#07080e",margin:"0 auto 8px",boxShadow:"0 0 16px rgba(0, 200, 255, 0.35)"},children:t.label.slice(0,2).toUpperCase()}),A.jsx("div",{style:{fontFamily:"'Outfit', sans-serif",fontWeight:700,fontSize:"1rem",color:"#e8ecf4"},children:t.label}),A.jsx("div",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"0.6rem",color:"#555d73",marginTop:3},children:"CEO"})]})}function h$({data:t}){const e=t.agents;return A.jsxs("div",{style:{padding:"14px 20px",border:"1px solid rgba(0, 230, 138, 0.25)",borderRadius:10,background:"linear-gradient(135deg, #0d1a14, #121425)",boxShadow:"0 0 16px rgba(0, 230, 138, 0.08), 0 2px 8px rgba(0,0,0,0.3)",textAlign:"center",minWidth:160},children:[A.jsx(cu,{type:"target",position:Qe.Top,style:sC}),A.jsx(cu,{type:"source",position:Qe.Bottom,style:sC}),A.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:8,marginBottom:4},children:[A.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:5,background:"rgba(0, 230, 138, 0.15)",border:"1px solid rgba(0, 230, 138, 0.25)",fontSize:"0.6rem",color:"#00e68a",fontWeight:700},children:t.label.slice(0,1).toUpperCase()}),A.jsx("span",{style:{fontFamily:"'Outfit', sans-serif",fontWeight:600,fontSize:"0.82rem",color:"#00e68a"},children:t.label})]}),t.description?A.jsx("div",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"0.55rem",color:"#555d73",marginBottom:4,maxWidth:180},children:String(t.description)}):null,A.jsxs("div",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"0.55rem",color:"#555d73"},children:[e.length," agent",e.length!==1?"s":""]})]})}function p$({data:t}){return A.jsxs("div",{style:{padding:"8px 16px",border:"1px solid rgba(100, 120, 200, 0.12)",borderRadius:6,background:"#0c0e18",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",textAlign:"center",minWidth:110},children:[A.jsx(cu,{type:"target",position:Qe.Top,style:Bk}),A.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:6},children:[A.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:"#00e68a",boxShadow:"0 0 6px rgba(0,230,138,0.4)",flexShrink:0}}),A.jsx("span",{style:{fontFamily:"'Outfit', sans-serif",fontWeight:500,fontSize:"0.72rem",color:"#8b93a8"},children:t.label})]})]})}const m$={company:d$,squad:h$,agent:p$},lC=280,g$=52,y$=170;function b$(t){const{tree:e,squads:n}=t,i=[],r=[];if(n.length===0)return i.push({id:"company",type:"company",position:{x:0,y:0},data:{label:e.name},draggable:!0}),{nodes:i,edges:r};const l=n.length*lC/2-100;return i.push({id:"company",type:"company",position:{x:l,y:0},data:{label:e.name},draggable:!0}),n.forEach((c,d)=>{const p=`squad-${c.code}`,m=d*lC;i.push({id:p,type:"squad",position:{x:m,y:200},data:{label:c.name,description:c.description,agents:c.agents},draggable:!0}),r.push({id:`company-${p}`,source:"company",target:p,style:{stroke:"rgba(0, 230, 138, 0.3)",strokeWidth:2},animated:!1});const g=c.agents.length,b=Math.min(g,2),v=m+80;c.agents.forEach((_,C)=>{const T=C%b,w=Math.floor(C/b),k=v+(T-(b-1)/2)*y$-55,R=400+w*g$,O=`agent-${c.code}-${_.id}`;i.push({id:O,type:"agent",position:{x:k,y:R},data:{label:_.name},draggable:!0}),r.push({id:`${p}-${O}`,source:p,target:O,style:{stroke:"rgba(100, 120, 200, 0.15)",strokeWidth:1},animated:!1})})}),{nodes:i,edges:r}}function x$({data:t}){const{fitView:e}=xb(),{nodes:n,edges:i}=U.useMemo(()=>b$(t),[t]);U.useEffect(()=>{const s=setTimeout(()=>e({padding:.12,duration:400}),50);return()=>clearTimeout(s)},[n.length,e]);const r=t.squads.reduce((s,l)=>s+l.agents.length,0);return A.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",animation:"fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both"},children:[A.jsxs("div",{style:{padding:"16px 20px 12px",flexShrink:0},children:[A.jsxs("h2",{style:{fontFamily:"'Outfit', sans-serif",fontWeight:700,fontSize:"1.1rem",color:"#e8ecf4",marginBottom:2},children:[t.tree.name," — Org Chart"]}),A.jsxs("p",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"0.65rem",color:"#555d73"},children:[t.squads.length," active squad",t.squads.length!==1?"s":""," / ",r," agents"]})]}),A.jsx("div",{style:{flex:1,minHeight:0},children:A.jsxs(UW,{nodes:n,edges:i,nodeTypes:m$,fitView:!0,fitViewOptions:{padding:.12},minZoom:.1,maxZoom:2,proOptions:{hideAttribution:!0},style:{background:"#07080e"},nodesDraggable:!0,nodesConnectable:!1,children:[A.jsx(GW,{color:"rgba(100, 120, 200, 0.04)",gap:24,size:1}),A.jsx(WW,{showInteractive:!1,style:{background:"#121425",border:"1px solid rgba(100, 120, 200, 0.15)",borderRadius:8}}),A.jsx(o$,{nodeColor:s=>s.type==="company"?"#00c8ff":s.type==="squad"?"#00e68a":"#555d73",maskColor:"rgba(7, 8, 14, 0.85)",style:{background:"#0c0e18",border:"1px solid rgba(100, 120, 200, 0.1)",borderRadius:8}})]})})]})}function v$(){const[t,e]=U.useState(null),[n,i]=U.useState(!0),[r,s]=U.useState(null);return U.useEffect(()=>{fetch("/api/orgchart",{credentials:"include"}).then(l=>{if(!l.ok)throw new Error(`HTTP ${l.status}`);return l.json()}).then(l=>{e(l),i(!1)}).catch(l=>{s(l.message),i(!1)})},[]),n?A.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",fontFamily:"'JetBrains Mono', monospace",fontSize:"0.75rem",color:"#555d73"},children:"Loading org chart..."}):r||!t?A.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",fontFamily:"'JetBrains Mono', monospace",fontSize:"0.75rem",color:"#ff4070"},children:r||"Failed to load org chart"}):A.jsx(kk,{children:A.jsx(x$,{data:t})})}const Lk={squad:"#00c8ff",agent:"#00e68a",memory:"#b388ff",skill:"#ffab40"},z_={squad:18,agent:12,memory:8,skill:8},oC={contains:"rgba(255,255,255,0.08)",pipeline:"rgba(0,200,255,0.4)",delivers:"rgba(0,230,138,0.5)",uses_skill:"rgba(255,171,64,0.15)",has_memory:"rgba(179,136,255,0.15)",shared_skill:"rgba(255,171,64,0.3)",shared_memory:"rgba(179,136,255,0.3)"};function _$(t,e,n,i,r){const s=n/2,l=i/2,c=3e3*r,d=.008*r,p=.01*r,m=.85;for(let b=0;b<t.length;b++){let v=0,_=0;for(let C=0;C<t.length;C++){if(b===C)continue;const T=t[b].x-t[C].x,w=t[b].y-t[C].y,k=T*T+w*w+1,R=c/k,O=Math.sqrt(k);v+=T/O*R,_+=w/O*R}v+=(s-t[b].x)*p,_+=(l-t[b].y)*p,t[b].vx=(t[b].vx+v)*m,t[b].vy=(t[b].vy+_)*m}for(const b of e){const v=t.findIndex(j=>j.id===b.source),_=t.findIndex(j=>j.id===b.target);if(v===-1||_===-1)continue;const C=t[_].x-t[v].x,T=t[_].y-t[v].y,w=Math.sqrt(C*C+T*T)+1,k=(w-100)*d,R=C/w*k,O=T/w*k;t[v].vx+=R,t[v].vy+=O,t[_].vx-=R,t[_].vy-=O}let g=0;for(const b of t)b.x+=b.vx,b.y+=b.vy,g+=b.vx*b.vx+b.vy*b.vy;return g}function S$(t,e){const n=new Map;for(const l of e)n.has(l.source)||n.set(l.source,[]),n.has(l.target)||n.set(l.target,[]),n.get(l.source).push(l.target),n.get(l.target).push(l.source);const i=new Map;i.set(t,0);const r=[t];let s=0;for(;s<r.length;){const l=r[s++],c=i.get(l);for(const d of n.get(l)||[])i.has(d)||(i.set(d,c+1),r.push(d))}return i}function E$(t,e,n,i,r,s,l,c,d){t.clearRect(0,0,i,r),t.save(),t.translate(l,c),t.scale(d,d);const p=new Map(e.map(b=>[b.id,b]));let m=null;if(s){m=S$(s.id,n);for(const b of m.values());}const g=b=>{if(!s||!m||b===s.id)return 1;const v=m.get(b);return v===void 0?.06:Math.max(.08,1-v*.28)};for(const b of n){const v=p.get(b.source),_=p.get(b.target);if(!v||!_)continue;const C=Math.min(g(b.source),g(b.target)),T=s&&(b.source===s.id||b.target===s.id);if(t.globalAlpha=C,t.beginPath(),t.moveTo(v.x,v.y),t.lineTo(_.x,_.y),t.strokeStyle=T?"rgba(255,255,255,0.6)":oC[b.type]||"rgba(255,255,255,0.06)",t.lineWidth=T?1.8:b.type==="delivers"||b.type==="pipeline"?1.2:.5,t.stroke(),b.type==="delivers"||b.type==="pipeline"){const w=Math.atan2(_.y-v.y,_.x-v.x),k=z_[_.type]||10,R=_.x-Math.cos(w)*(k+4),O=_.y-Math.sin(w)*(k+4);t.beginPath(),t.moveTo(R,O),t.lineTo(R-Math.cos(w-.4)*6,O-Math.sin(w-.4)*6),t.lineTo(R-Math.cos(w+.4)*6,O-Math.sin(w+.4)*6),t.closePath(),t.fillStyle=oC[b.type],t.fill()}}t.globalAlpha=1;for(const b of e){const v=z_[b.type]||10,_=Lk[b.type]||"#888",C=(s==null?void 0:s.id)===b.id,T=g(b.id);t.globalAlpha=T,t.beginPath(),t.arc(b.x,b.y,v,0,Math.PI*2),C&&(t.shadowColor=_,t.shadowBlur=24),t.fillStyle=_,t.fill(),t.shadowBlur=0;const w=b.type==="squad"?11:9;t.font=`${b.type==="squad"?"600":"400"} ${w}px "JetBrains Mono", monospace`,t.textAlign="center",t.textBaseline="top",t.fillStyle="rgba(255,255,255,0.85)",t.fillText(b.label,b.x,b.y+v+4)}t.globalAlpha=1,t.restore()}function w$(){const t=U.useRef(null),[e,n]=U.useState([]),[i,r]=U.useState([]),[s,l]=U.useState(!0),[c,d]=U.useState(null),p=U.useRef(null),m=U.useRef(null),g=U.useRef(null),b=U.useRef(!1),v=U.useRef({x:0,y:0}),_=U.useRef(1),C=U.useRef(!1),T=U.useRef({x:0,y:0}),w=U.useRef([]),k=U.useRef([]),R=U.useRef(0),O=U.useRef(1),j=U.useRef(!0);U.useEffect(()=>{fetch("/api/graph",{credentials:"include"}).then($=>$.json()).then($=>{const P=window.innerWidth,I=window.innerHeight,K=$.nodes.map((G,te)=>({...G,x:P/2+(Math.random()-.5)*400,y:I/2+(Math.random()-.5)*400,vx:0,vy:0}));w.current=K,k.current=$.edges,n(K),r($.edges),l(!1)}).catch(()=>{d("Failed to load graph data"),l(!1)})},[]);const D=U.useCallback(($,P)=>{const I=v.current,K=_.current,G=($-I.x)/K,te=(P-I.y)/K;for(let H=w.current.length-1;H>=0;H--){const W=w.current[H],B=z_[W.type]||10,X=G-W.x,Z=te-W.y;if(X*X+Z*Z<(B+4)*(B+4))return W}return null},[]);U.useEffect(()=>{const $=t.current;if(!$)return;const P=H=>{const W=$.getBoundingClientRect(),B=H.clientX-W.left,X=H.clientY-W.top;if(g.current){b.current=!0;const Q=_.current,q=v.current;g.current.x=(B-q.x)/Q,g.current.y=(X-q.y)/Q,g.current.vx=0,g.current.vy=0,O.current=.3,j.current=!0;return}if(C.current){v.current.x+=B-T.current.x,v.current.y+=X-T.current.y,T.current={x:B,y:X};return}const Z=D(B,X);p.current=Z,$.style.cursor=Z?"grab":"default"},I=H=>{const W=$.getBoundingClientRect(),B=H.clientX-W.left,X=H.clientY-W.top;b.current=!1;const Z=D(B,X);Z?(g.current=Z,$.style.cursor="grabbing"):(C.current=!0,T.current={x:B,y:X},$.style.cursor="move")},K=H=>{var B;g.current;const W=C.current;if(g.current=null,C.current=!1,$.style.cursor="default",!b.current){const X=$.getBoundingClientRect(),Z=H.clientX-X.left,Q=H.clientY-X.top,q=D(Z,Q);q?m.current=((B=m.current)==null?void 0:B.id)===q.id?null:q:W||(m.current=null)}},G=H=>{H.preventDefault();const W=$.getBoundingClientRect(),B=H.clientX-W.left,X=H.clientY-W.top,Z=H.deltaY>0?.92:1.08,Q=Math.max(.2,Math.min(5,_.current*Z)),q=Q/_.current;v.current.x=B-(B-v.current.x)*q,v.current.y=X-(X-v.current.y)*q,_.current=Q},te=()=>{g.current=null,C.current=!1,$.style.cursor="default"};return $.addEventListener("mousemove",P),$.addEventListener("mousedown",I),$.addEventListener("mouseup",K),$.addEventListener("mouseleave",te),$.addEventListener("wheel",G,{passive:!1}),()=>{$.removeEventListener("mousemove",P),$.removeEventListener("mousedown",I),$.removeEventListener("mouseup",K),$.removeEventListener("mouseleave",te),$.removeEventListener("wheel",G)}},[D]),U.useEffect(()=>{if(s||w.current.length===0)return;const $=t.current;if(!$)return;const P=()=>{const te=$.parentElement;te&&($.width=te.clientWidth*window.devicePixelRatio,$.height=te.clientHeight*window.devicePixelRatio,$.style.width=te.clientWidth+"px",$.style.height=te.clientHeight+"px")};P(),window.addEventListener("resize",P);const I=$.getContext("2d");let K=!0;const G=()=>{if(!K)return;const te=$.width/window.devicePixelRatio,H=$.height/window.devicePixelRatio;I.setTransform(window.devicePixelRatio,0,0,window.devicePixelRatio,0,0),j.current&&(_$(w.current,k.current,te,H,O.current),O.current*=.98,O.current<.001&&(j.current=!1,O.current=0)),E$(I,w.current,k.current,te,H,m.current,v.current.x,v.current.y,_.current),R.current=requestAnimationFrame(G)};return R.current=requestAnimationFrame(G),()=>{K=!1,cancelAnimationFrame(R.current),window.removeEventListener("resize",P)}},[s]);const F=U.useCallback($=>{const P=t.current;if(!P)return;const I=$==="in"?1.25:.8,K=P.clientWidth/2,G=P.clientHeight/2,te=Math.max(.2,Math.min(5,_.current*I)),H=te/_.current;v.current.x=K-(K-v.current.x)*H,v.current.y=G-(G-v.current.y)*H,_.current=te},[]);return s?A.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.8rem"},children:"Loading graph..."}):c?A.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",color:"var(--status-error)",fontFamily:"var(--font-mono)",fontSize:"0.8rem"},children:c}):A.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden"},children:[A.jsx("canvas",{ref:t,style:{display:"block",touchAction:"none"}}),A.jsx("div",{style:{position:"absolute",bottom:16,left:16,background:"rgba(10, 12, 16, 0.85)",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-subtle)",padding:"10px 14px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",display:"flex",flexDirection:"column",gap:6},children:Object.entries(Lk).map(([$,P])=>A.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[A.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:P,display:"inline-block"}}),A.jsx("span",{style:{textTransform:"capitalize"},children:$})]},$))}),A.jsxs("div",{style:{position:"absolute",top:16,right:16,background:"rgba(10, 12, 16, 0.85)",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-subtle)",padding:"10px 14px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",display:"flex",gap:16},children:[A.jsxs("span",{children:[e.length," nodes"]}),A.jsxs("span",{children:[i.length," edges"]})]}),A.jsx("div",{style:{position:"absolute",bottom:16,right:16,display:"flex",flexDirection:"column",gap:4},children:[{label:"+",action:"in"},{label:"−",action:"out"}].map(({label:$,action:P})=>A.jsx("button",{onClick:()=>F(P),style:{width:32,height:32,background:"rgba(10, 12, 16, 0.85)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"1rem",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:$},P))})]})}function T$(){const[t,e]=U.useState([]),[n,i]=U.useState(null),[r,s]=U.useState(""),[l,c]=U.useState(""),[d,p]=U.useState(!1),[m,g]=U.useState(!1),[b,v]=U.useState(new Set),[_,C]=U.useState(""),T=U.useRef(null);U.useEffect(()=>{fetch("/api/files",{credentials:"include"}).then(D=>D.json()).then(D=>{const F=new Map;for(const P of D)F.has(P.squad)||F.set(P.squad,{squad:P.squad,squadName:P.squadName,files:[]}),F.get(P.squad).files.push(P);const $=[...F.values()];e($)})},[]);const w=U.useCallback(D=>{i(D),g(!0),fetch(`/api/files/${D.squad}/${D.path}`,{credentials:"include"}).then(F=>F.json()).then(F=>{s(F.content),c(F.content),g(!1)}).catch(()=>{s(""),c(""),g(!1)})},[]),k=U.useCallback(async()=>{n&&(p(!0),await fetch(`/api/files/${n.squad}/${n.path}`,{method:"PUT",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:r})}),c(r),p(!1))},[n,r]),R=U.useCallback(D=>{v(F=>{const $=new Set(F);return $.has(D)?$.delete(D):$.add(D),$})},[]),O=r!==l;U.useEffect(()=>{const D=F=>{(F.metaKey||F.ctrlKey)&&F.key==="s"&&(F.preventDefault(),O&&n&&k())};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[O,n,k]);const j=D=>D==="squad.yaml"?"⚙":D==="memories.md"?"◆":"◇";return A.jsxs("div",{style:{display:"flex",height:"100%",overflow:"hidden"},children:[A.jsxs("div",{style:{width:260,minWidth:260,borderRight:"1px solid var(--border-subtle)",background:"var(--surface-1)",display:"flex",flexDirection:"column",overflow:"hidden"},children:[A.jsx("div",{style:{padding:"12px 14px",fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.1em",borderBottom:"1px solid var(--border-subtle)"},children:"Squad Files"}),A.jsx("div",{style:{padding:"8px 10px",borderBottom:"1px solid var(--border-subtle)"},children:A.jsx("input",{type:"text",placeholder:"Search squads...",value:_,onChange:D=>C(D.target.value),style:{width:"100%",padding:"5px 8px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",outline:"none"}})}),A.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"8px 0"},children:[t.filter(D=>{if(!_)return!0;const F=_.toLowerCase();return D.squadName.toLowerCase().includes(F)||D.squad.toLowerCase().includes(F)}).map(D=>A.jsxs("div",{children:[A.jsxs("button",{onClick:()=>R(D.squad),style:{width:"100%",background:"none",border:"none",padding:"6px 14px",display:"flex",alignItems:"center",gap:8,cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.75rem",fontWeight:600,color:"var(--text-primary)",textAlign:"left"},children:[A.jsx("span",{style:{fontSize:"0.6rem",transition:"transform 0.15s ease",transform:b.has(D.squad)?"rotate(90deg)":"rotate(0deg)",display:"inline-block"},children:"▶"}),D.squadName]}),b.has(D.squad)&&A.jsx("div",{style:{paddingLeft:14},children:D.files.map(F=>{const $=(n==null?void 0:n.squad)===F.squad&&(n==null?void 0:n.path)===F.path;return A.jsxs("button",{onClick:()=>w(F),style:{width:"100%",background:$?"var(--accent-glow)":"none",border:$?"1px solid rgba(0, 200, 255, 0.12)":"1px solid transparent",borderRadius:"var(--radius-xs)",padding:"5px 10px",display:"flex",alignItems:"center",gap:6,cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:$?"var(--accent)":"var(--text-secondary)",textAlign:"left"},children:[A.jsx("span",{style:{opacity:.6},children:j(F.file)}),F.file]},`${F.squad}/${F.path}`)})})]},D.squad)),t.length===0&&A.jsx("div",{style:{padding:"20px 14px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)",textAlign:"center"},children:"No squads found"})]})]}),A.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:n?A.jsxs(A.Fragment,{children:[A.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[A.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)",display:"flex",alignItems:"center",gap:8},children:[A.jsx("span",{style:{color:"var(--text-muted)"},children:n.squadName}),A.jsx("span",{style:{color:"var(--text-muted)",opacity:.4},children:"/"}),A.jsx("span",{children:n.file}),O&&A.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--accent)",display:"inline-block"}})]}),A.jsxs("button",{onClick:k,disabled:!O||d,style:{background:O?"var(--accent)":"var(--surface-3)",border:"none",borderRadius:"var(--radius-xs)",padding:"4px 14px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",fontWeight:600,color:O?"var(--text-inverse)":"var(--text-muted)",cursor:O?"pointer":"default",opacity:O?1:.5,transition:"all 0.15s ease"},children:[d?"Saving...":"Save",A.jsx("span",{style:{marginLeft:6,fontSize:"0.6rem",opacity:.7},children:"⌘S"})]})]}),m?A.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.8rem"},children:"Loading..."}):A.jsx("textarea",{ref:T,value:r,onChange:D=>s(D.target.value),spellCheck:!1,style:{flex:1,width:"100%",padding:"16px 20px",border:"none",outline:"none",resize:"none",background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:'"JetBrains Mono", "Fira Code", monospace',fontSize:"0.8rem",lineHeight:1.7,tabSize:2,whiteSpace:"pre",overflowWrap:"normal",overflowX:"auto"}})]}):A.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,color:"var(--text-muted)",fontFamily:"var(--font-mono)"},children:[A.jsx("span",{style:{fontSize:"2rem",opacity:.3},children:"◇"}),A.jsx("span",{style:{fontSize:"0.8rem"},children:"Select a file to edit"})]})})]})}const C$=U.lazy(()=>Zd(()=>import("./JarvisView-Bkn01kRk.js"),[]).then(t=>({default:t.JarvisView})));UO.createRoot(document.getElementById("root")).render(A.jsx(U.StrictMode,{children:A.jsx(lD,{children:A.jsxs(U3,{children:[A.jsx(wa,{path:"/login",element:A.jsx(VD,{})}),A.jsxs(wa,{path:"/",element:A.jsx(YD,{}),children:[A.jsx(wa,{index:!0,element:A.jsx(B3,{to:"/office",replace:!0})}),A.jsx(wa,{path:"office",element:A.jsx(b8,{})}),A.jsx(wa,{path:"chat",element:A.jsx(IG,{})}),A.jsx(wa,{path:"kanban",element:A.jsx(GG,{})}),A.jsx(wa,{path:"settings",element:A.jsx(JG,{})}),A.jsx(wa,{path:"scheduler",element:A.jsx(tF,{})}),A.jsx(wa,{path:"email",element:A.jsx(aF,{})}),A.jsx(wa,{path:"orgchart",element:A.jsx(v$,{})}),A.jsx(wa,{path:"graph",element:A.jsx(w$,{})}),A.jsx(wa,{path:"files",element:A.jsx(T$,{})}),A.jsx(wa,{path:"jarvis",element:A.jsx(U.Suspense,{fallback:null,children:A.jsx(C$,{})})})]})]})})}));export{J0 as $,kA as A,Om as B,Gi as C,ts as D,mo as E,ac as F,Aa as G,K_ as H,Wm as I,GD as J,YE as K,p0 as L,Ht as M,V_ as N,MA as O,Dr as P,Ls as Q,Fv as R,i5 as S,Tn as T,w0 as U,_A as V,t_ as W,k5 as X,D5 as Y,H5 as Z,U5 as _,A$ as a,Cf as a0,u4 as a1,Km as a2,X_ as a3,F5 as a4,Ra as a5,WC as a6,Bs as a7,Z0 as a8,ME as a9,sh as aa,EB as ab,P4 as ac,NE as ad,Ex as ae,kE as af,F4 as ag,rh as ah,Ei as ai,QC as aj,V6 as ak,OA as al,Qt as am,Xm as an,mi as ao,Vz as ap,Pz as aq,h5 as ar,s5 as as,O5 as at,z5 as au,P5 as av,j5 as aw,G5 as ax,pl as b,Ja as c,Ez as d,Ca as e,gi as f,dz as g,On as h,h0 as i,A as j,Rt as k,a6 as l,ZC as m,eb as n,$5 as o,tb as p,lA as q,U as r,kC as s,si as t,hx as u,Vd as v,ca as w,w4 as x,br as y,e5 as z};
|