@kafca/agentdock 0.1.10 → 0.1.12

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.
@@ -1,487 +0,0 @@
1
- var tN=Object.defineProperty;var nN=(e,t,r)=>t in e?tN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Ls=(e,t,r)=>nN(e,typeof t!="symbol"?t+"":t,r);function rN(e,t){for(var r=0;r<t.length;r++){const i=t[r];if(typeof i!="string"&&!Array.isArray(i)){for(const l in i)if(l!=="default"&&!(l in e)){const o=Object.getOwnPropertyDescriptor(i,l);o&&Object.defineProperty(e,l,o.get?o:{enumerable:!0,get:()=>i[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&i(c)}).observe(document,{childList:!0,subtree:!0});function r(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(l){if(l.ep)return;l.ep=!0;const o=r(l);fetch(l.href,o)}})();function tl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Nh={exports:{}},no={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var V0;function aN(){if(V0)return no;V0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(i,l,o){var c=null;if(o!==void 0&&(c=""+o),l.key!==void 0&&(c=""+l.key),"key"in l){o={};for(var d in l)d!=="key"&&(o[d]=l[d])}else o=l;return l=o.ref,{$$typeof:e,type:i,key:c,ref:l!==void 0?l:null,props:o}}return no.Fragment=t,no.jsx=r,no.jsxs=r,no}var Y0;function iN(){return Y0||(Y0=1,Nh.exports=aN()),Nh.exports}var p=iN(),Th={exports:{}},et={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var X0;function sN(){if(X0)return et;X0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),x=Symbol.iterator;function v(I){return I===null||typeof I!="object"?null:(I=x&&I[x]||I["@@iterator"],typeof I=="function"?I:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,_={};function C(I,X,D){this.props=I,this.context=X,this.refs=_,this.updater=D||E}C.prototype.isReactComponent={},C.prototype.setState=function(I,X){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,X,"setState")},C.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function A(){}A.prototype=C.prototype;function T(I,X,D){this.props=I,this.context=X,this.refs=_,this.updater=D||E}var M=T.prototype=new A;M.constructor=T,S(M,C.prototype),M.isPureReactComponent=!0;var P=Array.isArray;function N(){}var z={H:null,A:null,T:null,S:null},G=Object.prototype.hasOwnProperty;function Q(I,X,D){var J=D.ref;return{$$typeof:e,type:I,key:X,ref:J!==void 0?J:null,props:D}}function R(I,X){return Q(I.type,X,I.props)}function q(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function Z(I){var X={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(D){return X[D]})}var ne=/\/+/g;function Y(I,X){return typeof I=="object"&&I!==null&&I.key!=null?Z(""+I.key):X.toString(36)}function H(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(N,N):(I.status="pending",I.then(function(X){I.status==="pending"&&(I.status="fulfilled",I.value=X)},function(X){I.status==="pending"&&(I.status="rejected",I.reason=X)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function j(I,X,D,J,be){var pe=typeof I;(pe==="undefined"||pe==="boolean")&&(I=null);var ue=!1;if(I===null)ue=!0;else switch(pe){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(I.$$typeof){case e:case t:ue=!0;break;case g:return ue=I._init,j(ue(I._payload),X,D,J,be)}}if(ue)return be=be(I),ue=J===""?"."+Y(I,0):J,P(be)?(D="",ue!=null&&(D=ue.replace(ne,"$&/")+"/"),j(be,X,D,"",function(we){return we})):be!=null&&(q(be)&&(be=R(be,D+(be.key==null||I&&I.key===be.key?"":(""+be.key).replace(ne,"$&/")+"/")+ue)),X.push(be)),1;ue=0;var ve=J===""?".":J+":";if(P(I))for(var ge=0;ge<I.length;ge++)J=I[ge],pe=ve+Y(J,ge),ue+=j(J,X,D,pe,be);else if(ge=v(I),typeof ge=="function")for(I=ge.call(I),ge=0;!(J=I.next()).done;)J=J.value,pe=ve+Y(J,ge++),ue+=j(J,X,D,pe,be);else if(pe==="object"){if(typeof I.then=="function")return j(H(I),X,D,J,be);throw X=String(I),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return ue}function F(I,X,D){if(I==null)return I;var J=[],be=0;return j(I,J,"","",function(pe){return X.call(D,pe,be++)}),J}function W(I){if(I._status===-1){var X=I._result;X=X(),X.then(function(D){(I._status===0||I._status===-1)&&(I._status=1,I._result=D)},function(D){(I._status===0||I._status===-1)&&(I._status=2,I._result=D)}),I._status===-1&&(I._status=0,I._result=X)}if(I._status===1)return I._result.default;throw I._result}var K=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},L={map:F,forEach:function(I,X,D){F(I,function(){X.apply(this,arguments)},D)},count:function(I){var X=0;return F(I,function(){X++}),X},toArray:function(I){return F(I,function(X){return X})||[]},only:function(I){if(!q(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return et.Activity=m,et.Children=L,et.Component=C,et.Fragment=r,et.Profiler=l,et.PureComponent=T,et.StrictMode=i,et.Suspense=f,et.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,et.__COMPILER_RUNTIME={__proto__:null,c:function(I){return z.H.useMemoCache(I)}},et.cache=function(I){return function(){return I.apply(null,arguments)}},et.cacheSignal=function(){return null},et.cloneElement=function(I,X,D){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var J=S({},I.props),be=I.key;if(X!=null)for(pe in X.key!==void 0&&(be=""+X.key),X)!G.call(X,pe)||pe==="key"||pe==="__self"||pe==="__source"||pe==="ref"&&X.ref===void 0||(J[pe]=X[pe]);var pe=arguments.length-2;if(pe===1)J.children=D;else if(1<pe){for(var ue=Array(pe),ve=0;ve<pe;ve++)ue[ve]=arguments[ve+2];J.children=ue}return Q(I.type,be,J)},et.createContext=function(I){return I={$$typeof:c,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:o,_context:I},I},et.createElement=function(I,X,D){var J,be={},pe=null;if(X!=null)for(J in X.key!==void 0&&(pe=""+X.key),X)G.call(X,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(be[J]=X[J]);var ue=arguments.length-2;if(ue===1)be.children=D;else if(1<ue){for(var ve=Array(ue),ge=0;ge<ue;ge++)ve[ge]=arguments[ge+2];be.children=ve}if(I&&I.defaultProps)for(J in ue=I.defaultProps,ue)be[J]===void 0&&(be[J]=ue[J]);return Q(I,pe,be)},et.createRef=function(){return{current:null}},et.forwardRef=function(I){return{$$typeof:d,render:I}},et.isValidElement=q,et.lazy=function(I){return{$$typeof:g,_payload:{_status:-1,_result:I},_init:W}},et.memo=function(I,X){return{$$typeof:h,type:I,compare:X===void 0?null:X}},et.startTransition=function(I){var X=z.T,D={};z.T=D;try{var J=I(),be=z.S;be!==null&&be(D,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(N,K)}catch(pe){K(pe)}finally{X!==null&&D.types!==null&&(X.types=D.types),z.T=X}},et.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},et.use=function(I){return z.H.use(I)},et.useActionState=function(I,X,D){return z.H.useActionState(I,X,D)},et.useCallback=function(I,X){return z.H.useCallback(I,X)},et.useContext=function(I){return z.H.useContext(I)},et.useDebugValue=function(){},et.useDeferredValue=function(I,X){return z.H.useDeferredValue(I,X)},et.useEffect=function(I,X){return z.H.useEffect(I,X)},et.useEffectEvent=function(I){return z.H.useEffectEvent(I)},et.useId=function(){return z.H.useId()},et.useImperativeHandle=function(I,X,D){return z.H.useImperativeHandle(I,X,D)},et.useInsertionEffect=function(I,X){return z.H.useInsertionEffect(I,X)},et.useLayoutEffect=function(I,X){return z.H.useLayoutEffect(I,X)},et.useMemo=function(I,X){return z.H.useMemo(I,X)},et.useOptimistic=function(I,X){return z.H.useOptimistic(I,X)},et.useReducer=function(I,X,D){return z.H.useReducer(I,X,D)},et.useRef=function(I){return z.H.useRef(I)},et.useState=function(I){return z.H.useState(I)},et.useSyncExternalStore=function(I,X,D){return z.H.useSyncExternalStore(I,X,D)},et.useTransition=function(){return z.H.useTransition()},et.version="19.2.5",et}var W0;function um(){return W0||(W0=1,Th.exports=sN()),Th.exports}var w=um();const kt=tl(w),dm=rN({__proto__:null,default:kt},[w]);/**
18
- * @license lucide-react v0.487.0 - ISC
19
- *
20
- * This source code is licensed under the ISC license.
21
- * See the LICENSE file in the root directory of this source tree.
22
- */const lN=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),oN=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,i)=>i?i.toUpperCase():r.toLowerCase()),Q0=e=>{const t=oN(e);return t.charAt(0).toUpperCase()+t.slice(1)},Cw=(...e)=>e.filter((t,r,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===r).join(" ").trim();/**
23
- * @license lucide-react v0.487.0 - ISC
24
- *
25
- * This source code is licensed under the ISC license.
26
- * See the LICENSE file in the root directory of this source tree.
27
- */var cN={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
28
- * @license lucide-react v0.487.0 - ISC
29
- *
30
- * This source code is licensed under the ISC license.
31
- * See the LICENSE file in the root directory of this source tree.
32
- */const uN=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:l="",children:o,iconNode:c,...d},f)=>w.createElement("svg",{ref:f,...cN,width:t,height:t,stroke:e,strokeWidth:i?Number(r)*24/Number(t):r,className:Cw("lucide",l),...d},[...c.map(([h,g])=>w.createElement(h,g)),...Array.isArray(o)?o:[o]]));/**
33
- * @license lucide-react v0.487.0 - ISC
34
- *
35
- * This source code is licensed under the ISC license.
36
- * See the LICENSE file in the root directory of this source tree.
37
- */const Pe=(e,t)=>{const r=w.forwardRef(({className:i,...l},o)=>w.createElement(uN,{ref:o,iconNode:t,className:Cw(`lucide-${lN(Q0(e))}`,`lucide-${e}`,i),...l}));return r.displayName=Q0(e),r};/**
38
- * @license lucide-react v0.487.0 - ISC
39
- *
40
- * This source code is licensed under the ISC license.
41
- * See the LICENSE file in the root directory of this source tree.
42
- */const dN=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],fN=Pe("activity",dN);/**
43
- * @license lucide-react v0.487.0 - ISC
44
- *
45
- * This source code is licensed under the ISC license.
46
- * See the LICENSE file in the root directory of this source tree.
47
- */const hN=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Xu=Pe("arrow-left",hN);/**
48
- * @license lucide-react v0.487.0 - ISC
49
- *
50
- * This source code is licensed under the ISC license.
51
- * See the LICENSE file in the root directory of this source tree.
52
- */const pN=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],fm=Pe("arrow-right",pN);/**
53
- * @license lucide-react v0.487.0 - ISC
54
- *
55
- * This source code is licensed under the ISC license.
56
- * See the LICENSE file in the root directory of this source tree.
57
- */const mN=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Nw=Pe("book-open",mN);/**
58
- * @license lucide-react v0.487.0 - ISC
59
- *
60
- * This source code is licensed under the ISC license.
61
- * See the LICENSE file in the root directory of this source tree.
62
- */const gN=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Wu=Pe("bot",gN);/**
63
- * @license lucide-react v0.487.0 - ISC
64
- *
65
- * This source code is licensed under the ISC license.
66
- * See the LICENSE file in the root directory of this source tree.
67
- */const bN=[["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M17.5 17.5 16 16.3V14",key:"akvzfd"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],yN=Pe("calendar-clock",bN);/**
68
- * @license lucide-react v0.487.0 - ISC
69
- *
70
- * This source code is licensed under the ISC license.
71
- * See the LICENSE file in the root directory of this source tree.
72
- */const xN=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],vo=Pe("check",xN);/**
73
- * @license lucide-react v0.487.0 - ISC
74
- *
75
- * This source code is licensed under the ISC license.
76
- * See the LICENSE file in the root directory of this source tree.
77
- */const vN=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Z0=Pe("chevron-down",vN);/**
78
- * @license lucide-react v0.487.0 - ISC
79
- *
80
- * This source code is licensed under the ISC license.
81
- * See the LICENSE file in the root directory of this source tree.
82
- */const wN=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],EN=Pe("chevron-left",wN);/**
83
- * @license lucide-react v0.487.0 - ISC
84
- *
85
- * This source code is licensed under the ISC license.
86
- * See the LICENSE file in the root directory of this source tree.
87
- */const SN=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Tw=Pe("chevron-right",SN);/**
88
- * @license lucide-react v0.487.0 - ISC
89
- *
90
- * This source code is licensed under the ISC license.
91
- * See the LICENSE file in the root directory of this source tree.
92
- */const _N=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],kN=Pe("chevron-up",_N);/**
93
- * @license lucide-react v0.487.0 - ISC
94
- *
95
- * This source code is licensed under the ISC license.
96
- * See the LICENSE file in the root directory of this source tree.
97
- */const CN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],NN=Pe("circle-alert",CN);/**
98
- * @license lucide-react v0.487.0 - ISC
99
- *
100
- * This source code is licensed under the ISC license.
101
- * See the LICENSE file in the root directory of this source tree.
102
- */const TN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],qs=Pe("circle",TN);/**
103
- * @license lucide-react v0.487.0 - ISC
104
- *
105
- * This source code is licensed under the ISC license.
106
- * See the LICENSE file in the root directory of this source tree.
107
- */const AN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],hm=Pe("clock",AN);/**
108
- * @license lucide-react v0.487.0 - ISC
109
- *
110
- * This source code is licensed under the ISC license.
111
- * See the LICENSE file in the root directory of this source tree.
112
- */const RN=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],ON=Pe("copy",RN);/**
113
- * @license lucide-react v0.487.0 - ISC
114
- *
115
- * This source code is licensed under the ISC license.
116
- * See the LICENSE file in the root directory of this source tree.
117
- */const MN=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],DN=Pe("database",MN);/**
118
- * @license lucide-react v0.487.0 - ISC
119
- *
120
- * This source code is licensed under the ISC license.
121
- * See the LICENSE file in the root directory of this source tree.
122
- */const jN=[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]],LN=Pe("file-code",jN);/**
123
- * @license lucide-react v0.487.0 - ISC
124
- *
125
- * This source code is licensed under the ISC license.
126
- * See the LICENSE file in the root directory of this source tree.
127
- */const IN=[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4.268 21a2 2 0 0 0 1.727 1H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"ms7g94"}],["path",{d:"m9 18-1.5-1.5",key:"1j6qii"}],["circle",{cx:"5",cy:"14",r:"3",key:"ufru5t"}]],zN=Pe("file-search",IN);/**
128
- * @license lucide-react v0.487.0 - ISC
129
- *
130
- * This source code is licensed under the ISC license.
131
- * See the LICENSE file in the root directory of this source tree.
132
- */const PN=[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]],Nu=Pe("folder-kanban",PN);/**
133
- * @license lucide-react v0.487.0 - ISC
134
- *
135
- * This source code is licensed under the ISC license.
136
- * See the LICENSE file in the root directory of this source tree.
137
- */const BN=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],UN=Pe("folder-plus",BN);/**
138
- * @license lucide-react v0.487.0 - ISC
139
- *
140
- * This source code is licensed under the ISC license.
141
- * See the LICENSE file in the root directory of this source tree.
142
- */const FN=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],$N=Pe("folder-tree",FN);/**
143
- * @license lucide-react v0.487.0 - ISC
144
- *
145
- * This source code is licensed under the ISC license.
146
- * See the LICENSE file in the root directory of this source tree.
147
- */const HN=[["path",{d:"M20 17a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3.9a2 2 0 0 1-1.69-.9l-.81-1.2a2 2 0 0 0-1.67-.9H8a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2Z",key:"4u7rpt"}],["path",{d:"M2 8v11a2 2 0 0 0 2 2h14",key:"1eicx1"}]],Ah=Pe("folders",HN);/**
148
- * @license lucide-react v0.487.0 - ISC
149
- *
150
- * This source code is licensed under the ISC license.
151
- * See the LICENSE file in the root directory of this source tree.
152
- */const KN=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Aw=Pe("funnel",KN);/**
153
- * @license lucide-react v0.487.0 - ISC
154
- *
155
- * This source code is licensed under the ISC license.
156
- * See the LICENSE file in the root directory of this source tree.
157
- */const qN=[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]],_p=Pe("heart",qN);/**
158
- * @license lucide-react v0.487.0 - ISC
159
- *
160
- * This source code is licensed under the ISC license.
161
- * See the LICENSE file in the root directory of this source tree.
162
- */const GN=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],VN=Pe("inbox",GN);/**
163
- * @license lucide-react v0.487.0 - ISC
164
- *
165
- * This source code is licensed under the ISC license.
166
- * See the LICENSE file in the root directory of this source tree.
167
- */const YN=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],XN=Pe("languages",YN);/**
168
- * @license lucide-react v0.487.0 - ISC
169
- *
170
- * This source code is licensed under the ISC license.
171
- * See the LICENSE file in the root directory of this source tree.
172
- */const WN=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],QN=Pe("layers",WN);/**
173
- * @license lucide-react v0.487.0 - ISC
174
- *
175
- * This source code is licensed under the ISC license.
176
- * See the LICENSE file in the root directory of this source tree.
177
- */const ZN=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],JN=Pe("layout-dashboard",ZN);/**
178
- * @license lucide-react v0.487.0 - ISC
179
- *
180
- * This source code is licensed under the ISC license.
181
- * See the LICENSE file in the root directory of this source tree.
182
- */const e2=[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]],Rw=Pe("library",e2);/**
183
- * @license lucide-react v0.487.0 - ISC
184
- *
185
- * This source code is licensed under the ISC license.
186
- * See the LICENSE file in the root directory of this source tree.
187
- */const t2=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Fs=Pe("loader-circle",t2);/**
188
- * @license lucide-react v0.487.0 - ISC
189
- *
190
- * This source code is licensed under the ISC license.
191
- * See the LICENSE file in the root directory of this source tree.
192
- */const n2=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],r2=Pe("log-out",n2);/**
193
- * @license lucide-react v0.487.0 - ISC
194
- *
195
- * This source code is licensed under the ISC license.
196
- * See the LICENSE file in the root directory of this source tree.
197
- */const a2=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M12 7v6",key:"lw1j43"}],["path",{d:"M9 10h6",key:"9gxzsh"}]],J0=Pe("message-square-plus",a2);/**
198
- * @license lucide-react v0.487.0 - ISC
199
- *
200
- * This source code is licensed under the ISC license.
201
- * See the LICENSE file in the root directory of this source tree.
202
- */const i2=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],_a=Pe("message-square",i2);/**
203
- * @license lucide-react v0.487.0 - ISC
204
- *
205
- * This source code is licensed under the ISC license.
206
- * See the LICENSE file in the root directory of this source tree.
207
- */const s2=[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]],l2=Pe("messages-square",s2);/**
208
- * @license lucide-react v0.487.0 - ISC
209
- *
210
- * This source code is licensed under the ISC license.
211
- * See the LICENSE file in the root directory of this source tree.
212
- */const o2=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Ow=Pe("monitor",o2);/**
213
- * @license lucide-react v0.487.0 - ISC
214
- *
215
- * This source code is licensed under the ISC license.
216
- * See the LICENSE file in the root directory of this source tree.
217
- */const c2=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],Mw=Pe("moon",c2);/**
218
- * @license lucide-react v0.487.0 - ISC
219
- *
220
- * This source code is licensed under the ISC license.
221
- * See the LICENSE file in the root directory of this source tree.
222
- */const u2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],d2=Pe("panel-left",u2);/**
223
- * @license lucide-react v0.487.0 - ISC
224
- *
225
- * This source code is licensed under the ISC license.
226
- * See the LICENSE file in the root directory of this source tree.
227
- */const f2=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],h2=Pe("pause",f2);/**
228
- * @license lucide-react v0.487.0 - ISC
229
- *
230
- * This source code is licensed under the ISC license.
231
- * See the LICENSE file in the root directory of this source tree.
232
- */const p2=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],wo=Pe("pencil",p2);/**
233
- * @license lucide-react v0.487.0 - ISC
234
- *
235
- * This source code is licensed under the ISC license.
236
- * See the LICENSE file in the root directory of this source tree.
237
- */const m2=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Dw=Pe("play",m2);/**
238
- * @license lucide-react v0.487.0 - ISC
239
- *
240
- * This source code is licensed under the ISC license.
241
- * See the LICENSE file in the root directory of this source tree.
242
- */const g2=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]],jw=Pe("plug",g2);/**
243
- * @license lucide-react v0.487.0 - ISC
244
- *
245
- * This source code is licensed under the ISC license.
246
- * See the LICENSE file in the root directory of this source tree.
247
- */const b2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],di=Pe("plus",b2);/**
248
- * @license lucide-react v0.487.0 - ISC
249
- *
250
- * This source code is licensed under the ISC license.
251
- * See the LICENSE file in the root directory of this source tree.
252
- */const y2=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],x2=Pe("qr-code",y2);/**
253
- * @license lucide-react v0.487.0 - ISC
254
- *
255
- * This source code is licensed under the ISC license.
256
- * See the LICENSE file in the root directory of this source tree.
257
- */const v2=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Qu=Pe("refresh-cw",v2);/**
258
- * @license lucide-react v0.487.0 - ISC
259
- *
260
- * This source code is licensed under the ISC license.
261
- * See the LICENSE file in the root directory of this source tree.
262
- */const w2=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],E2=Pe("rotate-ccw",w2);/**
263
- * @license lucide-react v0.487.0 - ISC
264
- *
265
- * This source code is licensed under the ISC license.
266
- * See the LICENSE file in the root directory of this source tree.
267
- */const S2=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Lw=Pe("rotate-cw",S2);/**
268
- * @license lucide-react v0.487.0 - ISC
269
- *
270
- * This source code is licensed under the ISC license.
271
- * See the LICENSE file in the root directory of this source tree.
272
- */const _2=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],kp=Pe("save",_2);/**
273
- * @license lucide-react v0.487.0 - ISC
274
- *
275
- * This source code is licensed under the ISC license.
276
- * See the LICENSE file in the root directory of this source tree.
277
- */const k2=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],C2=Pe("scroll-text",k2);/**
278
- * @license lucide-react v0.487.0 - ISC
279
- *
280
- * This source code is licensed under the ISC license.
281
- * See the LICENSE file in the root directory of this source tree.
282
- */const N2=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Zu=Pe("search",N2);/**
283
- * @license lucide-react v0.487.0 - ISC
284
- *
285
- * This source code is licensed under the ISC license.
286
- * See the LICENSE file in the root directory of this source tree.
287
- */const T2=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],pm=Pe("send",T2);/**
288
- * @license lucide-react v0.487.0 - ISC
289
- *
290
- * This source code is licensed under the ISC license.
291
- * See the LICENSE file in the root directory of this source tree.
292
- */const A2=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Iw=Pe("server",A2);/**
293
- * @license lucide-react v0.487.0 - ISC
294
- *
295
- * This source code is licensed under the ISC license.
296
- * See the LICENSE file in the root directory of this source tree.
297
- */const R2=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Oo=Pe("settings",R2);/**
298
- * @license lucide-react v0.487.0 - ISC
299
- *
300
- * This source code is licensed under the ISC license.
301
- * See the LICENSE file in the root directory of this source tree.
302
- */const O2=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],M2=Pe("shield-check",O2);/**
303
- * @license lucide-react v0.487.0 - ISC
304
- *
305
- * This source code is licensed under the ISC license.
306
- * See the LICENSE file in the root directory of this source tree.
307
- */const D2=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],zw=Pe("sun",D2);/**
308
- * @license lucide-react v0.487.0 - ISC
309
- *
310
- * This source code is licensed under the ISC license.
311
- * See the LICENSE file in the root directory of this source tree.
312
- */const j2=[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]],L2=Pe("terminal",j2);/**
313
- * @license lucide-react v0.487.0 - ISC
314
- *
315
- * This source code is licensed under the ISC license.
316
- * See the LICENSE file in the root directory of this source tree.
317
- */const I2=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],ta=Pe("trash-2",I2);/**
318
- * @license lucide-react v0.487.0 - ISC
319
- *
320
- * This source code is licensed under the ISC license.
321
- * See the LICENSE file in the root directory of this source tree.
322
- */const z2=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],P2=Pe("triangle-alert",z2);/**
323
- * @license lucide-react v0.487.0 - ISC
324
- *
325
- * This source code is licensed under the ISC license.
326
- * See the LICENSE file in the root directory of this source tree.
327
- */const B2=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],ex=Pe("upload",B2);/**
328
- * @license lucide-react v0.487.0 - ISC
329
- *
330
- * This source code is licensed under the ISC license.
331
- * See the LICENSE file in the root directory of this source tree.
332
- */const U2=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Ju=Pe("user",U2);/**
333
- * @license lucide-react v0.487.0 - ISC
334
- *
335
- * This source code is licensed under the ISC license.
336
- * See the LICENSE file in the root directory of this source tree.
337
- */const F2=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Cp=Pe("wifi-off",F2);/**
338
- * @license lucide-react v0.487.0 - ISC
339
- *
340
- * This source code is licensed under the ISC license.
341
- * See the LICENSE file in the root directory of this source tree.
342
- */const $2=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]],mm=Pe("wrench",$2);/**
343
- * @license lucide-react v0.487.0 - ISC
344
- *
345
- * This source code is licensed under the ISC license.
346
- * See the LICENSE file in the root directory of this source tree.
347
- */const H2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Np=Pe("x",H2);/**
348
- * @license lucide-react v0.487.0 - ISC
349
- *
350
- * This source code is licensed under the ISC license.
351
- * See the LICENSE file in the root directory of this source tree.
352
- */const K2=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Pw=Pe("zap",K2);var Rh={exports:{}},ro={},Oh={exports:{}},Mh={};/**
353
- * @license React
354
- * scheduler.production.js
355
- *
356
- * Copyright (c) Meta Platforms, Inc. and affiliates.
357
- *
358
- * This source code is licensed under the MIT license found in the
359
- * LICENSE file in the root directory of this source tree.
360
- */var tx;function q2(){return tx||(tx=1,(function(e){function t(j,F){var W=j.length;j.push(F);e:for(;0<W;){var K=W-1>>>1,L=j[K];if(0<l(L,F))j[K]=F,j[W]=L,W=K;else break e}}function r(j){return j.length===0?null:j[0]}function i(j){if(j.length===0)return null;var F=j[0],W=j.pop();if(W!==F){j[0]=W;e:for(var K=0,L=j.length,I=L>>>1;K<I;){var X=2*(K+1)-1,D=j[X],J=X+1,be=j[J];if(0>l(D,W))J<L&&0>l(be,D)?(j[K]=be,j[J]=W,K=J):(j[K]=D,j[X]=W,K=X);else if(J<L&&0>l(be,W))j[K]=be,j[J]=W,K=J;else break e}}return F}function l(j,F){var W=j.sortIndex-F.sortIndex;return W!==0?W:j.id-F.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var f=[],h=[],g=1,m=null,x=3,v=!1,E=!1,S=!1,_=!1,C=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function M(j){for(var F=r(h);F!==null;){if(F.callback===null)i(h);else if(F.startTime<=j)i(h),F.sortIndex=F.expirationTime,t(f,F);else break;F=r(h)}}function P(j){if(S=!1,M(j),!E)if(r(f)!==null)E=!0,N||(N=!0,Z());else{var F=r(h);F!==null&&H(P,F.startTime-j)}}var N=!1,z=-1,G=5,Q=-1;function R(){return _?!0:!(e.unstable_now()-Q<G)}function q(){if(_=!1,N){var j=e.unstable_now();Q=j;var F=!0;try{e:{E=!1,S&&(S=!1,A(z),z=-1),v=!0;var W=x;try{t:{for(M(j),m=r(f);m!==null&&!(m.expirationTime>j&&R());){var K=m.callback;if(typeof K=="function"){m.callback=null,x=m.priorityLevel;var L=K(m.expirationTime<=j);if(j=e.unstable_now(),typeof L=="function"){m.callback=L,M(j),F=!0;break t}m===r(f)&&i(f),M(j)}else i(f);m=r(f)}if(m!==null)F=!0;else{var I=r(h);I!==null&&H(P,I.startTime-j),F=!1}}break e}finally{m=null,x=W,v=!1}F=void 0}}finally{F?Z():N=!1}}}var Z;if(typeof T=="function")Z=function(){T(q)};else if(typeof MessageChannel<"u"){var ne=new MessageChannel,Y=ne.port2;ne.port1.onmessage=q,Z=function(){Y.postMessage(null)}}else Z=function(){C(q,0)};function H(j,F){z=C(function(){j(e.unstable_now())},F)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(j){j.callback=null},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):G=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(j){switch(x){case 1:case 2:case 3:var F=3;break;default:F=x}var W=x;x=F;try{return j()}finally{x=W}},e.unstable_requestPaint=function(){_=!0},e.unstable_runWithPriority=function(j,F){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var W=x;x=j;try{return F()}finally{x=W}},e.unstable_scheduleCallback=function(j,F,W){var K=e.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?K+W:K):W=K,j){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=W+L,j={id:g++,callback:F,priorityLevel:j,startTime:W,expirationTime:L,sortIndex:-1},W>K?(j.sortIndex=W,t(h,j),r(f)===null&&j===r(h)&&(S?(A(z),z=-1):S=!0,H(P,W-K))):(j.sortIndex=L,t(f,j),E||v||(E=!0,N||(N=!0,Z()))),j},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(j){var F=x;return function(){var W=x;x=F;try{return j.apply(this,arguments)}finally{x=W}}}})(Mh)),Mh}var nx;function G2(){return nx||(nx=1,Oh.exports=q2()),Oh.exports}var Dh={exports:{}},An={};/**
361
- * @license React
362
- * react-dom.production.js
363
- *
364
- * Copyright (c) Meta Platforms, Inc. and affiliates.
365
- *
366
- * This source code is licensed under the MIT license found in the
367
- * LICENSE file in the root directory of this source tree.
368
- */var rx;function V2(){if(rx)return An;rx=1;var e=um();function t(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+f+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var i={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},l=Symbol.for("react.portal");function o(f,h,g){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:m==null?null:""+m,children:f,containerInfo:h,implementation:g}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return An.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,An.createPortal=function(f,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return o(f,h,null,g)},An.flushSync=function(f){var h=c.T,g=i.p;try{if(c.T=null,i.p=2,f)return f()}finally{c.T=h,i.p=g,i.d.f()}},An.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(f,h))},An.prefetchDNS=function(f){typeof f=="string"&&i.d.D(f)},An.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var g=h.as,m=d(g,h.crossOrigin),x=typeof h.integrity=="string"?h.integrity:void 0,v=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?i.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:m,integrity:x,fetchPriority:v}):g==="script"&&i.d.X(f,{crossOrigin:m,integrity:x,fetchPriority:v,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},An.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=d(h.as,h.crossOrigin);i.d.M(f,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(f)},An.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,m=d(g,h.crossOrigin);i.d.L(f,g,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},An.preloadModule=function(f,h){if(typeof f=="string")if(h){var g=d(h.as,h.crossOrigin);i.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(f)},An.requestFormReset=function(f){i.d.r(f)},An.unstable_batchedUpdates=function(f,h){return f(h)},An.useFormState=function(f,h,g){return c.H.useFormState(f,h,g)},An.useFormStatus=function(){return c.H.useHostTransitionStatus()},An.version="19.2.5",An}var ax;function Bw(){if(ax)return Dh.exports;ax=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Dh.exports=V2(),Dh.exports}/**
369
- * @license React
370
- * react-dom-client.production.js
371
- *
372
- * Copyright (c) Meta Platforms, Inc. and affiliates.
373
- *
374
- * This source code is licensed under the MIT license found in the
375
- * LICENSE file in the root directory of this source tree.
376
- */var ix;function Y2(){if(ix)return ro;ix=1;var e=G2(),t=um(),r=Bw();function i(n){var a="https://react.dev/errors/"+n;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)a+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+n+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function o(n){var a=n,s=n;if(n.alternate)for(;a.return;)a=a.return;else{n=a;do a=n,(a.flags&4098)!==0&&(s=a.return),n=a.return;while(n)}return a.tag===3?s:null}function c(n){if(n.tag===13){var a=n.memoizedState;if(a===null&&(n=n.alternate,n!==null&&(a=n.memoizedState)),a!==null)return a.dehydrated}return null}function d(n){if(n.tag===31){var a=n.memoizedState;if(a===null&&(n=n.alternate,n!==null&&(a=n.memoizedState)),a!==null)return a.dehydrated}return null}function f(n){if(o(n)!==n)throw Error(i(188))}function h(n){var a=n.alternate;if(!a){if(a=o(n),a===null)throw Error(i(188));return a!==n?null:n}for(var s=n,u=a;;){var b=s.return;if(b===null)break;var y=b.alternate;if(y===null){if(u=b.return,u!==null){s=u;continue}break}if(b.child===y.child){for(y=b.child;y;){if(y===s)return f(b),n;if(y===u)return f(b),a;y=y.sibling}throw Error(i(188))}if(s.return!==u.return)s=b,u=y;else{for(var k=!1,O=b.child;O;){if(O===s){k=!0,s=b,u=y;break}if(O===u){k=!0,u=b,s=y;break}O=O.sibling}if(!k){for(O=y.child;O;){if(O===s){k=!0,s=y,u=b;break}if(O===u){k=!0,u=y,s=b;break}O=O.sibling}if(!k)throw Error(i(189))}}if(s.alternate!==u)throw Error(i(190))}if(s.tag!==3)throw Error(i(188));return s.stateNode.current===s?n:a}function g(n){var a=n.tag;if(a===5||a===26||a===27||a===6)return n;for(n=n.child;n!==null;){if(a=g(n),a!==null)return a;n=n.sibling}return null}var m=Object.assign,x=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),T=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),Q=Symbol.for("react.activity"),R=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function Z(n){return n===null||typeof n!="object"?null:(n=q&&n[q]||n["@@iterator"],typeof n=="function"?n:null)}var ne=Symbol.for("react.client.reference");function Y(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===ne?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case S:return"Fragment";case C:return"Profiler";case _:return"StrictMode";case P:return"Suspense";case N:return"SuspenseList";case Q:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case E:return"Portal";case T:return n.displayName||"Context";case A:return(n._context.displayName||"Context")+".Consumer";case M:var a=n.render;return n=n.displayName,n||(n=a.displayName||a.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case z:return a=n.displayName||null,a!==null?a:Y(n.type)||"Memo";case G:a=n._payload,n=n._init;try{return Y(n(a))}catch{}}return null}var H=Array.isArray,j=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},K=[],L=-1;function I(n){return{current:n}}function X(n){0>L||(n.current=K[L],K[L]=null,L--)}function D(n,a){L++,K[L]=n.current,n.current=a}var J=I(null),be=I(null),pe=I(null),ue=I(null);function ve(n,a){switch(D(pe,a),D(be,n),D(J,null),a.nodeType){case 9:case 11:n=(n=a.documentElement)&&(n=n.namespaceURI)?g0(n):0;break;default:if(n=a.tagName,a=a.namespaceURI)a=g0(a),n=b0(a,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}X(J),D(J,n)}function ge(){X(J),X(be),X(pe)}function we(n){n.memoizedState!==null&&D(ue,n);var a=J.current,s=b0(a,n.type);a!==s&&(D(be,n),D(J,s))}function ye(n){be.current===n&&(X(J),X(be)),ue.current===n&&(X(ue),Zl._currentValue=W)}var Oe,Me;function Te(n){if(Oe===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);Oe=a&&a[1]||"",Me=-1<s.stack.indexOf(`
377
- at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
378
- `+Oe+n+Me}var vt=!1;function Ie(n,a){if(!n||vt)return"";vt=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(a){var me=function(){throw Error()};if(Object.defineProperty(me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(me,[])}catch(oe){var se=oe}Reflect.construct(n,[],me)}else{try{me.call()}catch(oe){se=oe}n.call(me.prototype)}}else{try{throw Error()}catch(oe){se=oe}(me=n())&&typeof me.catch=="function"&&me.catch(function(){})}}catch(oe){if(oe&&se&&typeof oe.stack=="string")return[oe.stack,se.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=u.DetermineComponentFrameRoot(),k=y[0],O=y[1];if(k&&O){var U=k.split(`
379
- `),ie=O.split(`
380
- `);for(b=u=0;u<U.length&&!U[u].includes("DetermineComponentFrameRoot");)u++;for(;b<ie.length&&!ie[b].includes("DetermineComponentFrameRoot");)b++;if(u===U.length||b===ie.length)for(u=U.length-1,b=ie.length-1;1<=u&&0<=b&&U[u]!==ie[b];)b--;for(;1<=u&&0<=b;u--,b--)if(U[u]!==ie[b]){if(u!==1||b!==1)do if(u--,b--,0>b||U[u]!==ie[b]){var de=`
381
- `+U[u].replace(" at new "," at ");return n.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",n.displayName)),de}while(1<=u&&0<=b);break}}}finally{vt=!1,Error.prepareStackTrace=s}return(s=n?n.displayName||n.name:"")?Te(s):""}function Xe(n,a){switch(n.tag){case 26:case 27:case 5:return Te(n.type);case 16:return Te("Lazy");case 13:return n.child!==a&&a!==null?Te("Suspense Fallback"):Te("Suspense");case 19:return Te("SuspenseList");case 0:case 15:return Ie(n.type,!1);case 11:return Ie(n.type.render,!1);case 1:return Ie(n.type,!0);case 31:return Te("Activity");default:return""}}function te(n){try{var a="",s=null;do a+=Xe(n,s),s=n,n=n.return;while(n);return a}catch(u){return`
382
- Error generating stack: `+u.message+`
383
- `+u.stack}}var ce=Object.prototype.hasOwnProperty,Ne=e.unstable_scheduleCallback,De=e.unstable_cancelCallback,wt=e.unstable_shouldYield,Xt=e.unstable_requestPaint,ot=e.unstable_now,Zt=e.unstable_getCurrentPriorityLevel,B=e.unstable_ImmediatePriority,le=e.unstable_UserBlockingPriority,_e=e.unstable_NormalPriority,re=e.unstable_LowPriority,xe=e.unstable_IdlePriority,je=e.log,Fe=e.unstable_setDisableYieldValue,tt=null,st=null;function zt(n){if(typeof je=="function"&&Fe(n),st&&typeof st.setStrictMode=="function")try{st.setStrictMode(tt,n)}catch{}}var Ze=Math.clz32?Math.clz32:es,Dn=Math.log,vn=Math.LN2;function es(n){return n>>>=0,n===0?32:31-(Dn(n)/vn|0)|0}var br=256,Qn=262144,Hr=4194304;function Nn(n){var a=n&42;if(a!==0)return a;switch(n&-n){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 n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function $(n,a,s){var u=n.pendingLanes;if(u===0)return 0;var b=0,y=n.suspendedLanes,k=n.pingedLanes;n=n.warmLanes;var O=u&134217727;return O!==0?(u=O&~y,u!==0?b=Nn(u):(k&=O,k!==0?b=Nn(k):s||(s=O&~n,s!==0&&(b=Nn(s))))):(O=u&~y,O!==0?b=Nn(O):k!==0?b=Nn(k):s||(s=u&~n,s!==0&&(b=Nn(s)))),b===0?0:a!==0&&a!==b&&(a&y)===0&&(y=b&-b,s=a&-a,y>=s||y===32&&(s&4194048)!==0)?a:b}function fe(n,a){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&a)===0}function Ce(n,a){switch(n){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 We(){var n=Hr;return Hr<<=1,(Hr&62914560)===0&&(Hr=4194304),n}function Mt(n){for(var a=[],s=0;31>s;s++)a.push(n);return a}function Nt(n,a){n.pendingLanes|=a,a!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function ze(n,a,s,u,b,y){var k=n.pendingLanes;n.pendingLanes=s,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=s,n.entangledLanes&=s,n.errorRecoveryDisabledLanes&=s,n.shellSuspendCounter=0;var O=n.entanglements,U=n.expirationTimes,ie=n.hiddenUpdates;for(s=k&~s;0<s;){var de=31-Ze(s),me=1<<de;O[de]=0,U[de]=-1;var se=ie[de];if(se!==null)for(ie[de]=null,de=0;de<se.length;de++){var oe=se[de];oe!==null&&(oe.lane&=-536870913)}s&=~me}u!==0&&Re(n,u,0),y!==0&&b===0&&n.tag!==0&&(n.suspendedLanes|=y&~(k&~a))}function Re(n,a,s){n.pendingLanes|=a,n.suspendedLanes&=~a;var u=31-Ze(a);n.entangledLanes|=a,n.entanglements[u]=n.entanglements[u]|1073741824|s&261930}function Ge(n,a){var s=n.entangledLanes|=a;for(n=n.entanglements;s;){var u=31-Ze(s),b=1<<u;b&a|n[u]&a&&(n[u]|=a),s&=~b}}function Jt(n,a){var s=a&-a;return s=(s&42)!==0?1:Ut(s),(s&(n.suspendedLanes|a))!==0?0:s}function Ut(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=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:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function Rr(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function Ma(){var n=F.p;return n!==0?n:(n=window.event,n===void 0?32:U0(n.type))}function Zn(n,a){var s=F.p;try{return F.p=n,a()}finally{F.p=s}}var Un=Math.random().toString(36).slice(2),qt="__reactFiber$"+Un,en="__reactProps$"+Un,Da="__reactContainer$"+Un,cl="__reactEvents$"+Un,Fo="__reactListeners$"+Un,ts="__reactHandles$"+Un,$o="__reactResources$"+Un,yi="__reactMarker$"+Un;function ul(n){delete n[qt],delete n[en],delete n[cl],delete n[Fo],delete n[ts]}function jn(n){var a=n[qt];if(a)return a;for(var s=n.parentNode;s;){if(a=s[Da]||s[qt]){if(s=a.alternate,a.child!==null||s!==null&&s.child!==null)for(n=_0(n);n!==null;){if(s=n[qt])return s;n=_0(n)}return a}n=s,s=n.parentNode}return null}function ia(n){if(n=n[qt]||n[Da]){var a=n.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return n}return null}function ja(n){var a=n.tag;if(a===5||a===26||a===27||a===6)return n.stateNode;throw Error(i(33))}function La(n){var a=n[$o];return a||(a=n[$o]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function un(n){n[yi]=!0}var Ho=new Set,xi={};function sa(n,a){Ee(n,a),Ee(n+"Capture",a)}function Ee(n,a){for(xi[n]=a,n=0;n<a.length;n++)Ho.add(a[n])}var $e=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]*$"),ct={},Tt={};function sn(n){return ce.call(Tt,n)?!0:ce.call(ct,n)?!1:$e.test(n)?Tt[n]=!0:(ct[n]=!0,!1)}function Tn(n,a,s){if(sn(a))if(s===null)n.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":n.removeAttribute(a);return;case"boolean":var u=a.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){n.removeAttribute(a);return}}n.setAttribute(a,""+s)}}function Jn(n,a,s){if(s===null)n.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(a);return}n.setAttribute(a,""+s)}}function Fn(n,a,s,u){if(u===null)n.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(s);return}n.setAttributeNS(a,s,""+u)}}function Ft(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function er(n){var a=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function Ko(n,a,s){var u=Object.getOwnPropertyDescriptor(n.constructor.prototype,a);if(!n.hasOwnProperty(a)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var b=u.get,y=u.set;return Object.defineProperty(n,a,{configurable:!0,get:function(){return b.call(this)},set:function(k){s=""+k,y.call(this,k)}}),Object.defineProperty(n,a,{enumerable:u.enumerable}),{getValue:function(){return s},setValue:function(k){s=""+k},stopTracking:function(){n._valueTracker=null,delete n[a]}}}}function ns(n){if(!n._valueTracker){var a=er(n)?"checked":"value";n._valueTracker=Ko(n,a,""+n[a])}}function dl(n){if(!n)return!1;var a=n._valueTracker;if(!a)return!0;var s=a.getValue(),u="";return n&&(u=er(n)?n.checked?"true":"false":n.value),n=u,n!==s?(a.setValue(n),!0):!1}function rs(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var kd=/[\n"\\]/g;function $n(n){return n.replace(kd,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function fl(n,a,s,u,b,y,k,O){n.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?n.type=k:n.removeAttribute("type"),a!=null?k==="number"?(a===0&&n.value===""||n.value!=a)&&(n.value=""+Ft(a)):n.value!==""+Ft(a)&&(n.value=""+Ft(a)):k!=="submit"&&k!=="reset"||n.removeAttribute("value"),a!=null?as(n,k,Ft(a)):s!=null?as(n,k,Ft(s)):u!=null&&n.removeAttribute("value"),b==null&&y!=null&&(n.defaultChecked=!!y),b!=null&&(n.checked=b&&typeof b!="function"&&typeof b!="symbol"),O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?n.name=""+Ft(O):n.removeAttribute("name")}function vi(n,a,s,u,b,y,k,O){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(n.type=y),a!=null||s!=null){if(!(y!=="submit"&&y!=="reset"||a!=null)){ns(n);return}s=s!=null?""+Ft(s):"",a=a!=null?""+Ft(a):s,O||a===n.value||(n.value=a),n.defaultValue=a}u=u??b,u=typeof u!="function"&&typeof u!="symbol"&&!!u,n.checked=O?n.checked:!!u,n.defaultChecked=!!u,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(n.name=k),ns(n)}function as(n,a,s){a==="number"&&rs(n.ownerDocument)===n||n.defaultValue===""+s||(n.defaultValue=""+s)}function wn(n,a,s,u){if(n=n.options,a){a={};for(var b=0;b<s.length;b++)a["$"+s[b]]=!0;for(s=0;s<n.length;s++)b=a.hasOwnProperty("$"+n[s].value),n[s].selected!==b&&(n[s].selected=b),b&&u&&(n[s].defaultSelected=!0)}else{for(s=""+Ft(s),a=null,b=0;b<n.length;b++){if(n[b].value===s){n[b].selected=!0,u&&(n[b].defaultSelected=!0);return}a!==null||n[b].disabled||(a=n[b])}a!==null&&(a.selected=!0)}}function qo(n,a,s){if(a!=null&&(a=""+Ft(a),a!==n.value&&(n.value=a),s==null)){n.defaultValue!==a&&(n.defaultValue=a);return}n.defaultValue=s!=null?""+Ft(s):""}function is(n,a,s,u){if(a==null){if(u!=null){if(s!=null)throw Error(i(92));if(H(u)){if(1<u.length)throw Error(i(93));u=u[0]}s=u}s==null&&(s=""),a=s}s=Ft(a),n.defaultValue=s,u=n.textContent,u===s&&u!==""&&u!==null&&(n.value=u),ns(n)}function Qe(n,a){if(a){var s=n.firstChild;if(s&&s===n.lastChild&&s.nodeType===3){s.nodeValue=a;return}}n.textContent=a}var Go=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 dn(n,a,s){var u=a.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?u?n.setProperty(a,""):a==="float"?n.cssFloat="":n[a]="":u?n.setProperty(a,s):typeof s!="number"||s===0||Go.has(a)?a==="float"?n.cssFloat=s:n[a]=(""+s).trim():n[a]=s+"px"}function At(n,a,s){if(a!=null&&typeof a!="object")throw Error(i(62));if(n=n.style,s!=null){for(var u in s)!s.hasOwnProperty(u)||a!=null&&a.hasOwnProperty(u)||(u.indexOf("--")===0?n.setProperty(u,""):u==="float"?n.cssFloat="":n[u]="");for(var b in a)u=a[b],a.hasOwnProperty(b)&&s[b]!==u&&dn(n,b,u)}else for(var y in a)a.hasOwnProperty(y)&&dn(n,y,a[y])}function Ia(n){if(n.indexOf("-")===-1)return!1;switch(n){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 la=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"]]),hl=/^[\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 za(n){return hl.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function ke(){}var Be=null;function nt(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var pt=null,tn=null;function yr(n){var a=ia(n);if(a&&(n=a.stateNode)){var s=n[en]||null;e:switch(n=a.stateNode,a.type){case"input":if(fl(n,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),a=s.name,s.type==="radio"&&a!=null){for(s=n;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+$n(""+a)+'"][type="radio"]'),a=0;a<s.length;a++){var u=s[a];if(u!==n&&u.form===n.form){var b=u[en]||null;if(!b)throw Error(i(90));fl(u,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(a=0;a<s.length;a++)u=s[a],u.form===n.form&&dl(u)}break e;case"textarea":qo(n,s.value,s.defaultValue);break e;case"select":a=s.value,a!=null&&wn(n,!!s.multiple,a,!1)}}}var pl=!1;function Vo(n,a,s){if(pl)return n(a,s);pl=!0;try{var u=n(a);return u}finally{if(pl=!1,(pt!==null||tn!==null)&&(jc(),pt&&(a=pt,n=tn,tn=pt=null,yr(a),n)))for(a=0;a<n.length;a++)yr(n[a])}}function ml(n,a){var s=n.stateNode;if(s===null)return null;var u=s[en]||null;if(u===null)return null;s=u[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(n=n.type,u=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!u;break e;default:n=!1}if(n)return null;if(s&&typeof s!="function")throw Error(i(231,a,typeof s));return s}var oa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cd=!1;if(oa)try{var gl={};Object.defineProperty(gl,"passive",{get:function(){Cd=!0}}),window.addEventListener("test",gl,gl),window.removeEventListener("test",gl,gl)}catch{Cd=!1}var Pa=null,Nd=null,Yo=null;function bg(){if(Yo)return Yo;var n,a=Nd,s=a.length,u,b="value"in Pa?Pa.value:Pa.textContent,y=b.length;for(n=0;n<s&&a[n]===b[n];n++);var k=s-n;for(u=1;u<=k&&a[s-u]===b[y-u];u++);return Yo=b.slice(n,1<u?1-u:void 0)}function Xo(n){var a=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&a===13&&(n=13)):n=a,n===10&&(n=13),32<=n||n===13?n:0}function Wo(){return!0}function yg(){return!1}function Hn(n){function a(s,u,b,y,k){this._reactName=s,this._targetInst=b,this.type=u,this.nativeEvent=y,this.target=k,this.currentTarget=null;for(var O in n)n.hasOwnProperty(O)&&(s=n[O],this[O]=s?s(y):y[O]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Wo:yg,this.isPropagationStopped=yg,this}return m(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Wo)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Wo)},persist:function(){},isPersistent:Wo}),a}var wi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qo=Hn(wi),bl=m({},wi,{view:0,detail:0}),J_=Hn(bl),Td,Ad,yl,Zo=m({},bl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Od,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==yl&&(yl&&n.type==="mousemove"?(Td=n.screenX-yl.screenX,Ad=n.screenY-yl.screenY):Ad=Td=0,yl=n),Td)},movementY:function(n){return"movementY"in n?n.movementY:Ad}}),xg=Hn(Zo),ek=m({},Zo,{dataTransfer:0}),tk=Hn(ek),nk=m({},bl,{relatedTarget:0}),Rd=Hn(nk),rk=m({},wi,{animationName:0,elapsedTime:0,pseudoElement:0}),ak=Hn(rk),ik=m({},wi,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),sk=Hn(ik),lk=m({},wi,{data:0}),vg=Hn(lk),ok={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ck={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"},uk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dk(n){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(n):(n=uk[n])?!!a[n]:!1}function Od(){return dk}var fk=m({},bl,{key:function(n){if(n.key){var a=ok[n.key]||n.key;if(a!=="Unidentified")return a}return n.type==="keypress"?(n=Xo(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?ck[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Od,charCode:function(n){return n.type==="keypress"?Xo(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Xo(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),hk=Hn(fk),pk=m({},Zo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),wg=Hn(pk),mk=m({},bl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Od}),gk=Hn(mk),bk=m({},wi,{propertyName:0,elapsedTime:0,pseudoElement:0}),yk=Hn(bk),xk=m({},Zo,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),vk=Hn(xk),wk=m({},wi,{newState:0,oldState:0}),Ek=Hn(wk),Sk=[9,13,27,32],Md=oa&&"CompositionEvent"in window,xl=null;oa&&"documentMode"in document&&(xl=document.documentMode);var _k=oa&&"TextEvent"in window&&!xl,Eg=oa&&(!Md||xl&&8<xl&&11>=xl),Sg=" ",_g=!1;function kg(n,a){switch(n){case"keyup":return Sk.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Cg(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var ss=!1;function kk(n,a){switch(n){case"compositionend":return Cg(a);case"keypress":return a.which!==32?null:(_g=!0,Sg);case"textInput":return n=a.data,n===Sg&&_g?null:n;default:return null}}function Ck(n,a){if(ss)return n==="compositionend"||!Md&&kg(n,a)?(n=bg(),Yo=Nd=Pa=null,ss=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return Eg&&a.locale!=="ko"?null:a.data;default:return null}}var Nk={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 Ng(n){var a=n&&n.nodeName&&n.nodeName.toLowerCase();return a==="input"?!!Nk[n.type]:a==="textarea"}function Tg(n,a,s,u){pt?tn?tn.push(u):tn=[u]:pt=u,a=Fc(a,"onChange"),0<a.length&&(s=new Qo("onChange","change",null,s,u),n.push({event:s,listeners:a}))}var vl=null,wl=null;function Tk(n){u0(n,0)}function Jo(n){var a=ja(n);if(dl(a))return n}function Ag(n,a){if(n==="change")return a}var Rg=!1;if(oa){var Dd;if(oa){var jd="oninput"in document;if(!jd){var Og=document.createElement("div");Og.setAttribute("oninput","return;"),jd=typeof Og.oninput=="function"}Dd=jd}else Dd=!1;Rg=Dd&&(!document.documentMode||9<document.documentMode)}function Mg(){vl&&(vl.detachEvent("onpropertychange",Dg),wl=vl=null)}function Dg(n){if(n.propertyName==="value"&&Jo(wl)){var a=[];Tg(a,wl,n,nt(n)),Vo(Tk,a)}}function Ak(n,a,s){n==="focusin"?(Mg(),vl=a,wl=s,vl.attachEvent("onpropertychange",Dg)):n==="focusout"&&Mg()}function Rk(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Jo(wl)}function Ok(n,a){if(n==="click")return Jo(a)}function Mk(n,a){if(n==="input"||n==="change")return Jo(a)}function Dk(n,a){return n===a&&(n!==0||1/n===1/a)||n!==n&&a!==a}var tr=typeof Object.is=="function"?Object.is:Dk;function El(n,a){if(tr(n,a))return!0;if(typeof n!="object"||n===null||typeof a!="object"||a===null)return!1;var s=Object.keys(n),u=Object.keys(a);if(s.length!==u.length)return!1;for(u=0;u<s.length;u++){var b=s[u];if(!ce.call(a,b)||!tr(n[b],a[b]))return!1}return!0}function jg(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Lg(n,a){var s=jg(n);n=0;for(var u;s;){if(s.nodeType===3){if(u=n+s.textContent.length,n<=a&&u>=a)return{node:s,offset:a-n};n=u}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=jg(s)}}function Ig(n,a){return n&&a?n===a?!0:n&&n.nodeType===3?!1:a&&a.nodeType===3?Ig(n,a.parentNode):"contains"in n?n.contains(a):n.compareDocumentPosition?!!(n.compareDocumentPosition(a)&16):!1:!1}function zg(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var a=rs(n.document);a instanceof n.HTMLIFrameElement;){try{var s=typeof a.contentWindow.location.href=="string"}catch{s=!1}if(s)n=a.contentWindow;else break;a=rs(n.document)}return a}function Ld(n){var a=n&&n.nodeName&&n.nodeName.toLowerCase();return a&&(a==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||a==="textarea"||n.contentEditable==="true")}var jk=oa&&"documentMode"in document&&11>=document.documentMode,ls=null,Id=null,Sl=null,zd=!1;function Pg(n,a,s){var u=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;zd||ls==null||ls!==rs(u)||(u=ls,"selectionStart"in u&&Ld(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Sl&&El(Sl,u)||(Sl=u,u=Fc(Id,"onSelect"),0<u.length&&(a=new Qo("onSelect","select",null,a,s),n.push({event:a,listeners:u}),a.target=ls)))}function Ei(n,a){var s={};return s[n.toLowerCase()]=a.toLowerCase(),s["Webkit"+n]="webkit"+a,s["Moz"+n]="moz"+a,s}var os={animationend:Ei("Animation","AnimationEnd"),animationiteration:Ei("Animation","AnimationIteration"),animationstart:Ei("Animation","AnimationStart"),transitionrun:Ei("Transition","TransitionRun"),transitionstart:Ei("Transition","TransitionStart"),transitioncancel:Ei("Transition","TransitionCancel"),transitionend:Ei("Transition","TransitionEnd")},Pd={},Bg={};oa&&(Bg=document.createElement("div").style,"AnimationEvent"in window||(delete os.animationend.animation,delete os.animationiteration.animation,delete os.animationstart.animation),"TransitionEvent"in window||delete os.transitionend.transition);function Si(n){if(Pd[n])return Pd[n];if(!os[n])return n;var a=os[n],s;for(s in a)if(a.hasOwnProperty(s)&&s in Bg)return Pd[n]=a[s];return n}var Ug=Si("animationend"),Fg=Si("animationiteration"),$g=Si("animationstart"),Lk=Si("transitionrun"),Ik=Si("transitionstart"),zk=Si("transitioncancel"),Hg=Si("transitionend"),Kg=new Map,Bd="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(" ");Bd.push("scrollEnd");function Or(n,a){Kg.set(n,a),sa(a,[n])}var ec=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},xr=[],cs=0,Ud=0;function tc(){for(var n=cs,a=Ud=cs=0;a<n;){var s=xr[a];xr[a++]=null;var u=xr[a];xr[a++]=null;var b=xr[a];xr[a++]=null;var y=xr[a];if(xr[a++]=null,u!==null&&b!==null){var k=u.pending;k===null?b.next=b:(b.next=k.next,k.next=b),u.pending=b}y!==0&&qg(s,b,y)}}function nc(n,a,s,u){xr[cs++]=n,xr[cs++]=a,xr[cs++]=s,xr[cs++]=u,Ud|=u,n.lanes|=u,n=n.alternate,n!==null&&(n.lanes|=u)}function Fd(n,a,s,u){return nc(n,a,s,u),rc(n)}function _i(n,a){return nc(n,null,null,a),rc(n)}function qg(n,a,s){n.lanes|=s;var u=n.alternate;u!==null&&(u.lanes|=s);for(var b=!1,y=n.return;y!==null;)y.childLanes|=s,u=y.alternate,u!==null&&(u.childLanes|=s),y.tag===22&&(n=y.stateNode,n===null||n._visibility&1||(b=!0)),n=y,y=y.return;return n.tag===3?(y=n.stateNode,b&&a!==null&&(b=31-Ze(s),n=y.hiddenUpdates,u=n[b],u===null?n[b]=[a]:u.push(a),a.lane=s|536870912),y):null}function rc(n){if(50<ql)throw ql=0,Qf=null,Error(i(185));for(var a=n.return;a!==null;)n=a,a=n.return;return n.tag===3?n.stateNode:null}var us={};function Pk(n,a,s,u){this.tag=n,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nr(n,a,s,u){return new Pk(n,a,s,u)}function $d(n){return n=n.prototype,!(!n||!n.isReactComponent)}function ca(n,a){var s=n.alternate;return s===null?(s=nr(n.tag,a,n.key,n.mode),s.elementType=n.elementType,s.type=n.type,s.stateNode=n.stateNode,s.alternate=n,n.alternate=s):(s.pendingProps=a,s.type=n.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=n.flags&65011712,s.childLanes=n.childLanes,s.lanes=n.lanes,s.child=n.child,s.memoizedProps=n.memoizedProps,s.memoizedState=n.memoizedState,s.updateQueue=n.updateQueue,a=n.dependencies,s.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},s.sibling=n.sibling,s.index=n.index,s.ref=n.ref,s.refCleanup=n.refCleanup,s}function Gg(n,a){n.flags&=65011714;var s=n.alternate;return s===null?(n.childLanes=0,n.lanes=a,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=s.childLanes,n.lanes=s.lanes,n.child=s.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=s.memoizedProps,n.memoizedState=s.memoizedState,n.updateQueue=s.updateQueue,n.type=s.type,a=s.dependencies,n.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),n}function ac(n,a,s,u,b,y){var k=0;if(u=n,typeof n=="function")$d(n)&&(k=1);else if(typeof n=="string")k=HC(n,s,J.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case Q:return n=nr(31,s,a,b),n.elementType=Q,n.lanes=y,n;case S:return ki(s.children,b,y,a);case _:k=8,b|=24;break;case C:return n=nr(12,s,a,b|2),n.elementType=C,n.lanes=y,n;case P:return n=nr(13,s,a,b),n.elementType=P,n.lanes=y,n;case N:return n=nr(19,s,a,b),n.elementType=N,n.lanes=y,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case T:k=10;break e;case A:k=9;break e;case M:k=11;break e;case z:k=14;break e;case G:k=16,u=null;break e}k=29,s=Error(i(130,n===null?"null":typeof n,"")),u=null}return a=nr(k,s,a,b),a.elementType=n,a.type=u,a.lanes=y,a}function ki(n,a,s,u){return n=nr(7,n,u,a),n.lanes=s,n}function Hd(n,a,s){return n=nr(6,n,null,a),n.lanes=s,n}function Vg(n){var a=nr(18,null,null,0);return a.stateNode=n,a}function Kd(n,a,s){return a=nr(4,n.children!==null?n.children:[],n.key,a),a.lanes=s,a.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},a}var Yg=new WeakMap;function vr(n,a){if(typeof n=="object"&&n!==null){var s=Yg.get(n);return s!==void 0?s:(a={value:n,source:a,stack:te(a)},Yg.set(n,a),a)}return{value:n,source:a,stack:te(a)}}var ds=[],fs=0,ic=null,_l=0,wr=[],Er=0,Ba=null,Kr=1,qr="";function ua(n,a){ds[fs++]=_l,ds[fs++]=ic,ic=n,_l=a}function Xg(n,a,s){wr[Er++]=Kr,wr[Er++]=qr,wr[Er++]=Ba,Ba=n;var u=Kr;n=qr;var b=32-Ze(u)-1;u&=~(1<<b),s+=1;var y=32-Ze(a)+b;if(30<y){var k=b-b%5;y=(u&(1<<k)-1).toString(32),u>>=k,b-=k,Kr=1<<32-Ze(a)+b|s<<b|u,qr=y+n}else Kr=1<<y|s<<b|u,qr=n}function qd(n){n.return!==null&&(ua(n,1),Xg(n,1,0))}function Gd(n){for(;n===ic;)ic=ds[--fs],ds[fs]=null,_l=ds[--fs],ds[fs]=null;for(;n===Ba;)Ba=wr[--Er],wr[Er]=null,qr=wr[--Er],wr[Er]=null,Kr=wr[--Er],wr[Er]=null}function Wg(n,a){wr[Er++]=Kr,wr[Er++]=qr,wr[Er++]=Ba,Kr=a.id,qr=a.overflow,Ba=n}var En=null,Gt=null,bt=!1,Ua=null,Sr=!1,Vd=Error(i(519));function Fa(n){var a=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw kl(vr(a,n)),Vd}function Qg(n){var a=n.stateNode,s=n.type,u=n.memoizedProps;switch(a[qt]=n,a[en]=u,s){case"dialog":dt("cancel",a),dt("close",a);break;case"iframe":case"object":case"embed":dt("load",a);break;case"video":case"audio":for(s=0;s<Vl.length;s++)dt(Vl[s],a);break;case"source":dt("error",a);break;case"img":case"image":case"link":dt("error",a),dt("load",a);break;case"details":dt("toggle",a);break;case"input":dt("invalid",a),vi(a,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":dt("invalid",a);break;case"textarea":dt("invalid",a),is(a,u.value,u.defaultValue,u.children)}s=u.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||a.textContent===""+s||u.suppressHydrationWarning===!0||p0(a.textContent,s)?(u.popover!=null&&(dt("beforetoggle",a),dt("toggle",a)),u.onScroll!=null&&dt("scroll",a),u.onScrollEnd!=null&&dt("scrollend",a),u.onClick!=null&&(a.onclick=ke),a=!0):a=!1,a||Fa(n,!0)}function Zg(n){for(En=n.return;En;)switch(En.tag){case 5:case 31:case 13:Sr=!1;return;case 27:case 3:Sr=!0;return;default:En=En.return}}function hs(n){if(n!==En)return!1;if(!bt)return Zg(n),bt=!0,!1;var a=n.tag,s;if((s=a!==3&&a!==27)&&((s=a===5)&&(s=n.type,s=!(s!=="form"&&s!=="button")||fh(n.type,n.memoizedProps)),s=!s),s&&Gt&&Fa(n),Zg(n),a===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(317));Gt=S0(n)}else if(a===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(317));Gt=S0(n)}else a===27?(a=Gt,ti(n.type)?(n=bh,bh=null,Gt=n):Gt=a):Gt=En?kr(n.stateNode.nextSibling):null;return!0}function Ci(){Gt=En=null,bt=!1}function Yd(){var n=Ua;return n!==null&&(Vn===null?Vn=n:Vn.push.apply(Vn,n),Ua=null),n}function kl(n){Ua===null?Ua=[n]:Ua.push(n)}var Xd=I(null),Ni=null,da=null;function $a(n,a,s){D(Xd,a._currentValue),a._currentValue=s}function fa(n){n._currentValue=Xd.current,X(Xd)}function Wd(n,a,s){for(;n!==null;){var u=n.alternate;if((n.childLanes&a)!==a?(n.childLanes|=a,u!==null&&(u.childLanes|=a)):u!==null&&(u.childLanes&a)!==a&&(u.childLanes|=a),n===s)break;n=n.return}}function Qd(n,a,s,u){var b=n.child;for(b!==null&&(b.return=n);b!==null;){var y=b.dependencies;if(y!==null){var k=b.child;y=y.firstContext;e:for(;y!==null;){var O=y;y=b;for(var U=0;U<a.length;U++)if(O.context===a[U]){y.lanes|=s,O=y.alternate,O!==null&&(O.lanes|=s),Wd(y.return,s,n),u||(k=null);break e}y=O.next}}else if(b.tag===18){if(k=b.return,k===null)throw Error(i(341));k.lanes|=s,y=k.alternate,y!==null&&(y.lanes|=s),Wd(k,s,n),k=null}else k=b.child;if(k!==null)k.return=b;else for(k=b;k!==null;){if(k===n){k=null;break}if(b=k.sibling,b!==null){b.return=k.return,k=b;break}k=k.return}b=k}}function ps(n,a,s,u){n=null;for(var b=a,y=!1;b!==null;){if(!y){if((b.flags&524288)!==0)y=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var k=b.alternate;if(k===null)throw Error(i(387));if(k=k.memoizedProps,k!==null){var O=b.type;tr(b.pendingProps.value,k.value)||(n!==null?n.push(O):n=[O])}}else if(b===ue.current){if(k=b.alternate,k===null)throw Error(i(387));k.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(n!==null?n.push(Zl):n=[Zl])}b=b.return}n!==null&&Qd(a,n,s,u),a.flags|=262144}function sc(n){for(n=n.firstContext;n!==null;){if(!tr(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function Ti(n){Ni=n,da=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Sn(n){return Jg(Ni,n)}function lc(n,a){return Ni===null&&Ti(n),Jg(n,a)}function Jg(n,a){var s=a._currentValue;if(a={context:a,memoizedValue:s,next:null},da===null){if(n===null)throw Error(i(308));da=a,n.dependencies={lanes:0,firstContext:a},n.flags|=524288}else da=da.next=a;return s}var Bk=typeof AbortController<"u"?AbortController:function(){var n=[],a=this.signal={aborted:!1,addEventListener:function(s,u){n.push(u)}};this.abort=function(){a.aborted=!0,n.forEach(function(s){return s()})}},Uk=e.unstable_scheduleCallback,Fk=e.unstable_NormalPriority,fn={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Zd(){return{controller:new Bk,data:new Map,refCount:0}}function Cl(n){n.refCount--,n.refCount===0&&Uk(Fk,function(){n.controller.abort()})}var Nl=null,Jd=0,ms=0,gs=null;function $k(n,a){if(Nl===null){var s=Nl=[];Jd=0,ms=rh(),gs={status:"pending",value:void 0,then:function(u){s.push(u)}}}return Jd++,a.then(eb,eb),a}function eb(){if(--Jd===0&&Nl!==null){gs!==null&&(gs.status="fulfilled");var n=Nl;Nl=null,ms=0,gs=null;for(var a=0;a<n.length;a++)(0,n[a])()}}function Hk(n,a){var s=[],u={status:"pending",value:null,reason:null,then:function(b){s.push(b)}};return n.then(function(){u.status="fulfilled",u.value=a;for(var b=0;b<s.length;b++)(0,s[b])(a)},function(b){for(u.status="rejected",u.reason=b,b=0;b<s.length;b++)(0,s[b])(void 0)}),u}var tb=j.S;j.S=function(n,a){Py=ot(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&$k(n,a),tb!==null&&tb(n,a)};var Ai=I(null);function ef(){var n=Ai.current;return n!==null?n:Pt.pooledCache}function oc(n,a){a===null?D(Ai,Ai.current):D(Ai,a.pool)}function nb(){var n=ef();return n===null?null:{parent:fn._currentValue,pool:n}}var bs=Error(i(460)),tf=Error(i(474)),cc=Error(i(542)),uc={then:function(){}};function rb(n){return n=n.status,n==="fulfilled"||n==="rejected"}function ab(n,a,s){switch(s=n[s],s===void 0?n.push(a):s!==a&&(a.then(ke,ke),a=s),a.status){case"fulfilled":return a.value;case"rejected":throw n=a.reason,sb(n),n;default:if(typeof a.status=="string")a.then(ke,ke);else{if(n=Pt,n!==null&&100<n.shellSuspendCounter)throw Error(i(482));n=a,n.status="pending",n.then(function(u){if(a.status==="pending"){var b=a;b.status="fulfilled",b.value=u}},function(u){if(a.status==="pending"){var b=a;b.status="rejected",b.reason=u}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw n=a.reason,sb(n),n}throw Oi=a,bs}}function Ri(n){try{var a=n._init;return a(n._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Oi=s,bs):s}}var Oi=null;function ib(){if(Oi===null)throw Error(i(459));var n=Oi;return Oi=null,n}function sb(n){if(n===bs||n===cc)throw Error(i(483))}var ys=null,Tl=0;function dc(n){var a=Tl;return Tl+=1,ys===null&&(ys=[]),ab(ys,n,a)}function Al(n,a){a=a.props.ref,n.ref=a!==void 0?a:null}function fc(n,a){throw a.$$typeof===x?Error(i(525)):(n=Object.prototype.toString.call(a),Error(i(31,n==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":n)))}function lb(n){function a(ee,V){if(n){var ae=ee.deletions;ae===null?(ee.deletions=[V],ee.flags|=16):ae.push(V)}}function s(ee,V){if(!n)return null;for(;V!==null;)a(ee,V),V=V.sibling;return null}function u(ee){for(var V=new Map;ee!==null;)ee.key!==null?V.set(ee.key,ee):V.set(ee.index,ee),ee=ee.sibling;return V}function b(ee,V){return ee=ca(ee,V),ee.index=0,ee.sibling=null,ee}function y(ee,V,ae){return ee.index=ae,n?(ae=ee.alternate,ae!==null?(ae=ae.index,ae<V?(ee.flags|=67108866,V):ae):(ee.flags|=67108866,V)):(ee.flags|=1048576,V)}function k(ee){return n&&ee.alternate===null&&(ee.flags|=67108866),ee}function O(ee,V,ae,he){return V===null||V.tag!==6?(V=Hd(ae,ee.mode,he),V.return=ee,V):(V=b(V,ae),V.return=ee,V)}function U(ee,V,ae,he){var He=ae.type;return He===S?de(ee,V,ae.props.children,he,ae.key):V!==null&&(V.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===G&&Ri(He)===V.type)?(V=b(V,ae.props),Al(V,ae),V.return=ee,V):(V=ac(ae.type,ae.key,ae.props,null,ee.mode,he),Al(V,ae),V.return=ee,V)}function ie(ee,V,ae,he){return V===null||V.tag!==4||V.stateNode.containerInfo!==ae.containerInfo||V.stateNode.implementation!==ae.implementation?(V=Kd(ae,ee.mode,he),V.return=ee,V):(V=b(V,ae.children||[]),V.return=ee,V)}function de(ee,V,ae,he,He){return V===null||V.tag!==7?(V=ki(ae,ee.mode,he,He),V.return=ee,V):(V=b(V,ae),V.return=ee,V)}function me(ee,V,ae){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return V=Hd(""+V,ee.mode,ae),V.return=ee,V;if(typeof V=="object"&&V!==null){switch(V.$$typeof){case v:return ae=ac(V.type,V.key,V.props,null,ee.mode,ae),Al(ae,V),ae.return=ee,ae;case E:return V=Kd(V,ee.mode,ae),V.return=ee,V;case G:return V=Ri(V),me(ee,V,ae)}if(H(V)||Z(V))return V=ki(V,ee.mode,ae,null),V.return=ee,V;if(typeof V.then=="function")return me(ee,dc(V),ae);if(V.$$typeof===T)return me(ee,lc(ee,V),ae);fc(ee,V)}return null}function se(ee,V,ae,he){var He=V!==null?V.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return He!==null?null:O(ee,V,""+ae,he);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case v:return ae.key===He?U(ee,V,ae,he):null;case E:return ae.key===He?ie(ee,V,ae,he):null;case G:return ae=Ri(ae),se(ee,V,ae,he)}if(H(ae)||Z(ae))return He!==null?null:de(ee,V,ae,he,null);if(typeof ae.then=="function")return se(ee,V,dc(ae),he);if(ae.$$typeof===T)return se(ee,V,lc(ee,ae),he);fc(ee,ae)}return null}function oe(ee,V,ae,he,He){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return ee=ee.get(ae)||null,O(V,ee,""+he,He);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case v:return ee=ee.get(he.key===null?ae:he.key)||null,U(V,ee,he,He);case E:return ee=ee.get(he.key===null?ae:he.key)||null,ie(V,ee,he,He);case G:return he=Ri(he),oe(ee,V,ae,he,He)}if(H(he)||Z(he))return ee=ee.get(ae)||null,de(V,ee,he,He,null);if(typeof he.then=="function")return oe(ee,V,ae,dc(he),He);if(he.$$typeof===T)return oe(ee,V,ae,lc(V,he),He);fc(V,he)}return null}function Le(ee,V,ae,he){for(var He=null,Et=null,Ue=V,at=V=0,gt=null;Ue!==null&&at<ae.length;at++){Ue.index>at?(gt=Ue,Ue=null):gt=Ue.sibling;var St=se(ee,Ue,ae[at],he);if(St===null){Ue===null&&(Ue=gt);break}n&&Ue&&St.alternate===null&&a(ee,Ue),V=y(St,V,at),Et===null?He=St:Et.sibling=St,Et=St,Ue=gt}if(at===ae.length)return s(ee,Ue),bt&&ua(ee,at),He;if(Ue===null){for(;at<ae.length;at++)Ue=me(ee,ae[at],he),Ue!==null&&(V=y(Ue,V,at),Et===null?He=Ue:Et.sibling=Ue,Et=Ue);return bt&&ua(ee,at),He}for(Ue=u(Ue);at<ae.length;at++)gt=oe(Ue,ee,at,ae[at],he),gt!==null&&(n&&gt.alternate!==null&&Ue.delete(gt.key===null?at:gt.key),V=y(gt,V,at),Et===null?He=gt:Et.sibling=gt,Et=gt);return n&&Ue.forEach(function(si){return a(ee,si)}),bt&&ua(ee,at),He}function Ve(ee,V,ae,he){if(ae==null)throw Error(i(151));for(var He=null,Et=null,Ue=V,at=V=0,gt=null,St=ae.next();Ue!==null&&!St.done;at++,St=ae.next()){Ue.index>at?(gt=Ue,Ue=null):gt=Ue.sibling;var si=se(ee,Ue,St.value,he);if(si===null){Ue===null&&(Ue=gt);break}n&&Ue&&si.alternate===null&&a(ee,Ue),V=y(si,V,at),Et===null?He=si:Et.sibling=si,Et=si,Ue=gt}if(St.done)return s(ee,Ue),bt&&ua(ee,at),He;if(Ue===null){for(;!St.done;at++,St=ae.next())St=me(ee,St.value,he),St!==null&&(V=y(St,V,at),Et===null?He=St:Et.sibling=St,Et=St);return bt&&ua(ee,at),He}for(Ue=u(Ue);!St.done;at++,St=ae.next())St=oe(Ue,ee,at,St.value,he),St!==null&&(n&&St.alternate!==null&&Ue.delete(St.key===null?at:St.key),V=y(St,V,at),Et===null?He=St:Et.sibling=St,Et=St);return n&&Ue.forEach(function(eN){return a(ee,eN)}),bt&&ua(ee,at),He}function Lt(ee,V,ae,he){if(typeof ae=="object"&&ae!==null&&ae.type===S&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case v:e:{for(var He=ae.key;V!==null;){if(V.key===He){if(He=ae.type,He===S){if(V.tag===7){s(ee,V.sibling),he=b(V,ae.props.children),he.return=ee,ee=he;break e}}else if(V.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===G&&Ri(He)===V.type){s(ee,V.sibling),he=b(V,ae.props),Al(he,ae),he.return=ee,ee=he;break e}s(ee,V);break}else a(ee,V);V=V.sibling}ae.type===S?(he=ki(ae.props.children,ee.mode,he,ae.key),he.return=ee,ee=he):(he=ac(ae.type,ae.key,ae.props,null,ee.mode,he),Al(he,ae),he.return=ee,ee=he)}return k(ee);case E:e:{for(He=ae.key;V!==null;){if(V.key===He)if(V.tag===4&&V.stateNode.containerInfo===ae.containerInfo&&V.stateNode.implementation===ae.implementation){s(ee,V.sibling),he=b(V,ae.children||[]),he.return=ee,ee=he;break e}else{s(ee,V);break}else a(ee,V);V=V.sibling}he=Kd(ae,ee.mode,he),he.return=ee,ee=he}return k(ee);case G:return ae=Ri(ae),Lt(ee,V,ae,he)}if(H(ae))return Le(ee,V,ae,he);if(Z(ae)){if(He=Z(ae),typeof He!="function")throw Error(i(150));return ae=He.call(ae),Ve(ee,V,ae,he)}if(typeof ae.then=="function")return Lt(ee,V,dc(ae),he);if(ae.$$typeof===T)return Lt(ee,V,lc(ee,ae),he);fc(ee,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,V!==null&&V.tag===6?(s(ee,V.sibling),he=b(V,ae),he.return=ee,ee=he):(s(ee,V),he=Hd(ae,ee.mode,he),he.return=ee,ee=he),k(ee)):s(ee,V)}return function(ee,V,ae,he){try{Tl=0;var He=Lt(ee,V,ae,he);return ys=null,He}catch(Ue){if(Ue===bs||Ue===cc)throw Ue;var Et=nr(29,Ue,null,ee.mode);return Et.lanes=he,Et.return=ee,Et}finally{}}}var Mi=lb(!0),ob=lb(!1),Ha=!1;function nf(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function rf(n,a){n=n.updateQueue,a.updateQueue===n&&(a.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Ka(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function qa(n,a,s){var u=n.updateQueue;if(u===null)return null;if(u=u.shared,(Ct&2)!==0){var b=u.pending;return b===null?a.next=a:(a.next=b.next,b.next=a),u.pending=a,a=rc(n),qg(n,null,s),a}return nc(n,u,a,s),rc(n)}function Rl(n,a,s){if(a=a.updateQueue,a!==null&&(a=a.shared,(s&4194048)!==0)){var u=a.lanes;u&=n.pendingLanes,s|=u,a.lanes=s,Ge(n,s)}}function af(n,a){var s=n.updateQueue,u=n.alternate;if(u!==null&&(u=u.updateQueue,s===u)){var b=null,y=null;if(s=s.firstBaseUpdate,s!==null){do{var k={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};y===null?b=y=k:y=y.next=k,s=s.next}while(s!==null);y===null?b=y=a:y=y.next=a}else b=y=a;s={baseState:u.baseState,firstBaseUpdate:b,lastBaseUpdate:y,shared:u.shared,callbacks:u.callbacks},n.updateQueue=s;return}n=s.lastBaseUpdate,n===null?s.firstBaseUpdate=a:n.next=a,s.lastBaseUpdate=a}var sf=!1;function Ol(){if(sf){var n=gs;if(n!==null)throw n}}function Ml(n,a,s,u){sf=!1;var b=n.updateQueue;Ha=!1;var y=b.firstBaseUpdate,k=b.lastBaseUpdate,O=b.shared.pending;if(O!==null){b.shared.pending=null;var U=O,ie=U.next;U.next=null,k===null?y=ie:k.next=ie,k=U;var de=n.alternate;de!==null&&(de=de.updateQueue,O=de.lastBaseUpdate,O!==k&&(O===null?de.firstBaseUpdate=ie:O.next=ie,de.lastBaseUpdate=U))}if(y!==null){var me=b.baseState;k=0,de=ie=U=null,O=y;do{var se=O.lane&-536870913,oe=se!==O.lane;if(oe?(mt&se)===se:(u&se)===se){se!==0&&se===ms&&(sf=!0),de!==null&&(de=de.next={lane:0,tag:O.tag,payload:O.payload,callback:null,next:null});e:{var Le=n,Ve=O;se=a;var Lt=s;switch(Ve.tag){case 1:if(Le=Ve.payload,typeof Le=="function"){me=Le.call(Lt,me,se);break e}me=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=Ve.payload,se=typeof Le=="function"?Le.call(Lt,me,se):Le,se==null)break e;me=m({},me,se);break e;case 2:Ha=!0}}se=O.callback,se!==null&&(n.flags|=64,oe&&(n.flags|=8192),oe=b.callbacks,oe===null?b.callbacks=[se]:oe.push(se))}else oe={lane:se,tag:O.tag,payload:O.payload,callback:O.callback,next:null},de===null?(ie=de=oe,U=me):de=de.next=oe,k|=se;if(O=O.next,O===null){if(O=b.shared.pending,O===null)break;oe=O,O=oe.next,oe.next=null,b.lastBaseUpdate=oe,b.shared.pending=null}}while(!0);de===null&&(U=me),b.baseState=U,b.firstBaseUpdate=ie,b.lastBaseUpdate=de,y===null&&(b.shared.lanes=0),Wa|=k,n.lanes=k,n.memoizedState=me}}function cb(n,a){if(typeof n!="function")throw Error(i(191,n));n.call(a)}function ub(n,a){var s=n.callbacks;if(s!==null)for(n.callbacks=null,n=0;n<s.length;n++)cb(s[n],a)}var xs=I(null),hc=I(0);function db(n,a){n=wa,D(hc,n),D(xs,a),wa=n|a.baseLanes}function lf(){D(hc,wa),D(xs,xs.current)}function of(){wa=hc.current,X(xs),X(hc)}var rr=I(null),_r=null;function Ga(n){var a=n.alternate;D(ln,ln.current&1),D(rr,n),_r===null&&(a===null||xs.current!==null||a.memoizedState!==null)&&(_r=n)}function cf(n){D(ln,ln.current),D(rr,n),_r===null&&(_r=n)}function fb(n){n.tag===22?(D(ln,ln.current),D(rr,n),_r===null&&(_r=n)):Va()}function Va(){D(ln,ln.current),D(rr,rr.current)}function ar(n){X(rr),_r===n&&(_r=null),X(ln)}var ln=I(0);function pc(n){for(var a=n;a!==null;){if(a.tag===13){var s=a.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||mh(s)||gh(s)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===n)break;for(;a.sibling===null;){if(a.return===null||a.return===n)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var ha=0,rt=null,Dt=null,hn=null,mc=!1,vs=!1,Di=!1,gc=0,Dl=0,ws=null,Kk=0;function nn(){throw Error(i(321))}function uf(n,a){if(a===null)return!1;for(var s=0;s<a.length&&s<n.length;s++)if(!tr(n[s],a[s]))return!1;return!0}function df(n,a,s,u,b,y){return ha=y,rt=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,j.H=n===null||n.memoizedState===null?Xb:Cf,Di=!1,y=s(u,b),Di=!1,vs&&(y=pb(a,s,u,b)),hb(n),y}function hb(n){j.H=Il;var a=Dt!==null&&Dt.next!==null;if(ha=0,hn=Dt=rt=null,mc=!1,Dl=0,ws=null,a)throw Error(i(300));n===null||pn||(n=n.dependencies,n!==null&&sc(n)&&(pn=!0))}function pb(n,a,s,u){rt=n;var b=0;do{if(vs&&(ws=null),Dl=0,vs=!1,25<=b)throw Error(i(301));if(b+=1,hn=Dt=null,n.updateQueue!=null){var y=n.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}j.H=Wb,y=a(s,u)}while(vs);return y}function qk(){var n=j.H,a=n.useState()[0];return a=typeof a.then=="function"?jl(a):a,n=n.useState()[0],(Dt!==null?Dt.memoizedState:null)!==n&&(rt.flags|=1024),a}function ff(){var n=gc!==0;return gc=0,n}function hf(n,a,s){a.updateQueue=n.updateQueue,a.flags&=-2053,n.lanes&=~s}function pf(n){if(mc){for(n=n.memoizedState;n!==null;){var a=n.queue;a!==null&&(a.pending=null),n=n.next}mc=!1}ha=0,hn=Dt=rt=null,vs=!1,Dl=gc=0,ws=null}function Ln(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return hn===null?rt.memoizedState=hn=n:hn=hn.next=n,hn}function on(){if(Dt===null){var n=rt.alternate;n=n!==null?n.memoizedState:null}else n=Dt.next;var a=hn===null?rt.memoizedState:hn.next;if(a!==null)hn=a,Dt=n;else{if(n===null)throw rt.alternate===null?Error(i(467)):Error(i(310));Dt=n,n={memoizedState:Dt.memoizedState,baseState:Dt.baseState,baseQueue:Dt.baseQueue,queue:Dt.queue,next:null},hn===null?rt.memoizedState=hn=n:hn=hn.next=n}return hn}function bc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function jl(n){var a=Dl;return Dl+=1,ws===null&&(ws=[]),n=ab(ws,n,a),a=rt,(hn===null?a.memoizedState:hn.next)===null&&(a=a.alternate,j.H=a===null||a.memoizedState===null?Xb:Cf),n}function yc(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return jl(n);if(n.$$typeof===T)return Sn(n)}throw Error(i(438,String(n)))}function mf(n){var a=null,s=rt.updateQueue;if(s!==null&&(a=s.memoCache),a==null){var u=rt.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(a={data:u.data.map(function(b){return b.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),s===null&&(s=bc(),rt.updateQueue=s),s.memoCache=a,s=a.data[a.index],s===void 0)for(s=a.data[a.index]=Array(n),u=0;u<n;u++)s[u]=R;return a.index++,s}function pa(n,a){return typeof a=="function"?a(n):a}function xc(n){var a=on();return gf(a,Dt,n)}function gf(n,a,s){var u=n.queue;if(u===null)throw Error(i(311));u.lastRenderedReducer=s;var b=n.baseQueue,y=u.pending;if(y!==null){if(b!==null){var k=b.next;b.next=y.next,y.next=k}a.baseQueue=b=y,u.pending=null}if(y=n.baseState,b===null)n.memoizedState=y;else{a=b.next;var O=k=null,U=null,ie=a,de=!1;do{var me=ie.lane&-536870913;if(me!==ie.lane?(mt&me)===me:(ha&me)===me){var se=ie.revertLane;if(se===0)U!==null&&(U=U.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),me===ms&&(de=!0);else if((ha&se)===se){ie=ie.next,se===ms&&(de=!0);continue}else me={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},U===null?(O=U=me,k=y):U=U.next=me,rt.lanes|=se,Wa|=se;me=ie.action,Di&&s(y,me),y=ie.hasEagerState?ie.eagerState:s(y,me)}else se={lane:me,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},U===null?(O=U=se,k=y):U=U.next=se,rt.lanes|=me,Wa|=me;ie=ie.next}while(ie!==null&&ie!==a);if(U===null?k=y:U.next=O,!tr(y,n.memoizedState)&&(pn=!0,de&&(s=gs,s!==null)))throw s;n.memoizedState=y,n.baseState=k,n.baseQueue=U,u.lastRenderedState=y}return b===null&&(u.lanes=0),[n.memoizedState,u.dispatch]}function bf(n){var a=on(),s=a.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=n;var u=s.dispatch,b=s.pending,y=a.memoizedState;if(b!==null){s.pending=null;var k=b=b.next;do y=n(y,k.action),k=k.next;while(k!==b);tr(y,a.memoizedState)||(pn=!0),a.memoizedState=y,a.baseQueue===null&&(a.baseState=y),s.lastRenderedState=y}return[y,u]}function mb(n,a,s){var u=rt,b=on(),y=bt;if(y){if(s===void 0)throw Error(i(407));s=s()}else s=a();var k=!tr((Dt||b).memoizedState,s);if(k&&(b.memoizedState=s,pn=!0),b=b.queue,vf(yb.bind(null,u,b,n),[n]),b.getSnapshot!==a||k||hn!==null&&hn.memoizedState.tag&1){if(u.flags|=2048,Es(9,{destroy:void 0},bb.bind(null,u,b,s,a),null),Pt===null)throw Error(i(349));y||(ha&127)!==0||gb(u,a,s)}return s}function gb(n,a,s){n.flags|=16384,n={getSnapshot:a,value:s},a=rt.updateQueue,a===null?(a=bc(),rt.updateQueue=a,a.stores=[n]):(s=a.stores,s===null?a.stores=[n]:s.push(n))}function bb(n,a,s,u){a.value=s,a.getSnapshot=u,xb(a)&&vb(n)}function yb(n,a,s){return s(function(){xb(a)&&vb(n)})}function xb(n){var a=n.getSnapshot;n=n.value;try{var s=a();return!tr(n,s)}catch{return!0}}function vb(n){var a=_i(n,2);a!==null&&Yn(a,n,2)}function yf(n){var a=Ln();if(typeof n=="function"){var s=n;if(n=s(),Di){zt(!0);try{s()}finally{zt(!1)}}}return a.memoizedState=a.baseState=n,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pa,lastRenderedState:n},a}function wb(n,a,s,u){return n.baseState=s,gf(n,Dt,typeof u=="function"?u:pa)}function Gk(n,a,s,u,b){if(Ec(n))throw Error(i(485));if(n=a.action,n!==null){var y={payload:b,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){y.listeners.push(k)}};j.T!==null?s(!0):y.isTransition=!1,u(y),s=a.pending,s===null?(y.next=a.pending=y,Eb(a,y)):(y.next=s.next,a.pending=s.next=y)}}function Eb(n,a){var s=a.action,u=a.payload,b=n.state;if(a.isTransition){var y=j.T,k={};j.T=k;try{var O=s(b,u),U=j.S;U!==null&&U(k,O),Sb(n,a,O)}catch(ie){xf(n,a,ie)}finally{y!==null&&k.types!==null&&(y.types=k.types),j.T=y}}else try{y=s(b,u),Sb(n,a,y)}catch(ie){xf(n,a,ie)}}function Sb(n,a,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(u){_b(n,a,u)},function(u){return xf(n,a,u)}):_b(n,a,s)}function _b(n,a,s){a.status="fulfilled",a.value=s,kb(a),n.state=s,a=n.pending,a!==null&&(s=a.next,s===a?n.pending=null:(s=s.next,a.next=s,Eb(n,s)))}function xf(n,a,s){var u=n.pending;if(n.pending=null,u!==null){u=u.next;do a.status="rejected",a.reason=s,kb(a),a=a.next;while(a!==u)}n.action=null}function kb(n){n=n.listeners;for(var a=0;a<n.length;a++)(0,n[a])()}function Cb(n,a){return a}function Nb(n,a){if(bt){var s=Pt.formState;if(s!==null){e:{var u=rt;if(bt){if(Gt){t:{for(var b=Gt,y=Sr;b.nodeType!==8;){if(!y){b=null;break t}if(b=kr(b.nextSibling),b===null){b=null;break t}}y=b.data,b=y==="F!"||y==="F"?b:null}if(b){Gt=kr(b.nextSibling),u=b.data==="F!";break e}}Fa(u)}u=!1}u&&(a=s[0])}}return s=Ln(),s.memoizedState=s.baseState=a,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cb,lastRenderedState:a},s.queue=u,s=Gb.bind(null,rt,u),u.dispatch=s,u=yf(!1),y=kf.bind(null,rt,!1,u.queue),u=Ln(),b={state:a,dispatch:null,action:n,pending:null},u.queue=b,s=Gk.bind(null,rt,b,y,s),b.dispatch=s,u.memoizedState=n,[a,s,!1]}function Tb(n){var a=on();return Ab(a,Dt,n)}function Ab(n,a,s){if(a=gf(n,a,Cb)[0],n=xc(pa)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var u=jl(a)}catch(k){throw k===bs?cc:k}else u=a;a=on();var b=a.queue,y=b.dispatch;return s!==a.memoizedState&&(rt.flags|=2048,Es(9,{destroy:void 0},Vk.bind(null,b,s),null)),[u,y,n]}function Vk(n,a){n.action=a}function Rb(n){var a=on(),s=Dt;if(s!==null)return Ab(a,s,n);on(),a=a.memoizedState,s=on();var u=s.queue.dispatch;return s.memoizedState=n,[a,u,!1]}function Es(n,a,s,u){return n={tag:n,create:s,deps:u,inst:a,next:null},a=rt.updateQueue,a===null&&(a=bc(),rt.updateQueue=a),s=a.lastEffect,s===null?a.lastEffect=n.next=n:(u=s.next,s.next=n,n.next=u,a.lastEffect=n),n}function Ob(){return on().memoizedState}function vc(n,a,s,u){var b=Ln();rt.flags|=n,b.memoizedState=Es(1|a,{destroy:void 0},s,u===void 0?null:u)}function wc(n,a,s,u){var b=on();u=u===void 0?null:u;var y=b.memoizedState.inst;Dt!==null&&u!==null&&uf(u,Dt.memoizedState.deps)?b.memoizedState=Es(a,y,s,u):(rt.flags|=n,b.memoizedState=Es(1|a,y,s,u))}function Mb(n,a){vc(8390656,8,n,a)}function vf(n,a){wc(2048,8,n,a)}function Yk(n){rt.flags|=4;var a=rt.updateQueue;if(a===null)a=bc(),rt.updateQueue=a,a.events=[n];else{var s=a.events;s===null?a.events=[n]:s.push(n)}}function Db(n){var a=on().memoizedState;return Yk({ref:a,nextImpl:n}),function(){if((Ct&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}function jb(n,a){return wc(4,2,n,a)}function Lb(n,a){return wc(4,4,n,a)}function Ib(n,a){if(typeof a=="function"){n=n();var s=a(n);return function(){typeof s=="function"?s():a(null)}}if(a!=null)return n=n(),a.current=n,function(){a.current=null}}function zb(n,a,s){s=s!=null?s.concat([n]):null,wc(4,4,Ib.bind(null,a,n),s)}function wf(){}function Pb(n,a){var s=on();a=a===void 0?null:a;var u=s.memoizedState;return a!==null&&uf(a,u[1])?u[0]:(s.memoizedState=[n,a],n)}function Bb(n,a){var s=on();a=a===void 0?null:a;var u=s.memoizedState;if(a!==null&&uf(a,u[1]))return u[0];if(u=n(),Di){zt(!0);try{n()}finally{zt(!1)}}return s.memoizedState=[u,a],u}function Ef(n,a,s){return s===void 0||(ha&1073741824)!==0&&(mt&261930)===0?n.memoizedState=a:(n.memoizedState=s,n=Uy(),rt.lanes|=n,Wa|=n,s)}function Ub(n,a,s,u){return tr(s,a)?s:xs.current!==null?(n=Ef(n,s,u),tr(n,a)||(pn=!0),n):(ha&42)===0||(ha&1073741824)!==0&&(mt&261930)===0?(pn=!0,n.memoizedState=s):(n=Uy(),rt.lanes|=n,Wa|=n,a)}function Fb(n,a,s,u,b){var y=F.p;F.p=y!==0&&8>y?y:8;var k=j.T,O={};j.T=O,kf(n,!1,a,s);try{var U=b(),ie=j.S;if(ie!==null&&ie(O,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var de=Hk(U,u);Ll(n,a,de,lr(n))}else Ll(n,a,u,lr(n))}catch(me){Ll(n,a,{then:function(){},status:"rejected",reason:me},lr())}finally{F.p=y,k!==null&&O.types!==null&&(k.types=O.types),j.T=k}}function Xk(){}function Sf(n,a,s,u){if(n.tag!==5)throw Error(i(476));var b=$b(n).queue;Fb(n,b,a,W,s===null?Xk:function(){return Hb(n),s(u)})}function $b(n){var a=n.memoizedState;if(a!==null)return a;a={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pa,lastRenderedState:W},next:null};var s={};return a.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pa,lastRenderedState:s},next:null},n.memoizedState=a,n=n.alternate,n!==null&&(n.memoizedState=a),a}function Hb(n){var a=$b(n);a.next===null&&(a=n.alternate.memoizedState),Ll(n,a.next.queue,{},lr())}function _f(){return Sn(Zl)}function Kb(){return on().memoizedState}function qb(){return on().memoizedState}function Wk(n){for(var a=n.return;a!==null;){switch(a.tag){case 24:case 3:var s=lr();n=Ka(s);var u=qa(a,n,s);u!==null&&(Yn(u,a,s),Rl(u,a,s)),a={cache:Zd()},n.payload=a;return}a=a.return}}function Qk(n,a,s){var u=lr();s={lane:u,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Ec(n)?Vb(a,s):(s=Fd(n,a,s,u),s!==null&&(Yn(s,n,u),Yb(s,a,u)))}function Gb(n,a,s){var u=lr();Ll(n,a,s,u)}function Ll(n,a,s,u){var b={lane:u,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Ec(n))Vb(a,b);else{var y=n.alternate;if(n.lanes===0&&(y===null||y.lanes===0)&&(y=a.lastRenderedReducer,y!==null))try{var k=a.lastRenderedState,O=y(k,s);if(b.hasEagerState=!0,b.eagerState=O,tr(O,k))return nc(n,a,b,0),Pt===null&&tc(),!1}catch{}finally{}if(s=Fd(n,a,b,u),s!==null)return Yn(s,n,u),Yb(s,a,u),!0}return!1}function kf(n,a,s,u){if(u={lane:2,revertLane:rh(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Ec(n)){if(a)throw Error(i(479))}else a=Fd(n,s,u,2),a!==null&&Yn(a,n,2)}function Ec(n){var a=n.alternate;return n===rt||a!==null&&a===rt}function Vb(n,a){vs=mc=!0;var s=n.pending;s===null?a.next=a:(a.next=s.next,s.next=a),n.pending=a}function Yb(n,a,s){if((s&4194048)!==0){var u=a.lanes;u&=n.pendingLanes,s|=u,a.lanes=s,Ge(n,s)}}var Il={readContext:Sn,use:yc,useCallback:nn,useContext:nn,useEffect:nn,useImperativeHandle:nn,useLayoutEffect:nn,useInsertionEffect:nn,useMemo:nn,useReducer:nn,useRef:nn,useState:nn,useDebugValue:nn,useDeferredValue:nn,useTransition:nn,useSyncExternalStore:nn,useId:nn,useHostTransitionStatus:nn,useFormState:nn,useActionState:nn,useOptimistic:nn,useMemoCache:nn,useCacheRefresh:nn};Il.useEffectEvent=nn;var Xb={readContext:Sn,use:yc,useCallback:function(n,a){return Ln().memoizedState=[n,a===void 0?null:a],n},useContext:Sn,useEffect:Mb,useImperativeHandle:function(n,a,s){s=s!=null?s.concat([n]):null,vc(4194308,4,Ib.bind(null,a,n),s)},useLayoutEffect:function(n,a){return vc(4194308,4,n,a)},useInsertionEffect:function(n,a){vc(4,2,n,a)},useMemo:function(n,a){var s=Ln();a=a===void 0?null:a;var u=n();if(Di){zt(!0);try{n()}finally{zt(!1)}}return s.memoizedState=[u,a],u},useReducer:function(n,a,s){var u=Ln();if(s!==void 0){var b=s(a);if(Di){zt(!0);try{s(a)}finally{zt(!1)}}}else b=a;return u.memoizedState=u.baseState=b,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:b},u.queue=n,n=n.dispatch=Qk.bind(null,rt,n),[u.memoizedState,n]},useRef:function(n){var a=Ln();return n={current:n},a.memoizedState=n},useState:function(n){n=yf(n);var a=n.queue,s=Gb.bind(null,rt,a);return a.dispatch=s,[n.memoizedState,s]},useDebugValue:wf,useDeferredValue:function(n,a){var s=Ln();return Ef(s,n,a)},useTransition:function(){var n=yf(!1);return n=Fb.bind(null,rt,n.queue,!0,!1),Ln().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,a,s){var u=rt,b=Ln();if(bt){if(s===void 0)throw Error(i(407));s=s()}else{if(s=a(),Pt===null)throw Error(i(349));(mt&127)!==0||gb(u,a,s)}b.memoizedState=s;var y={value:s,getSnapshot:a};return b.queue=y,Mb(yb.bind(null,u,y,n),[n]),u.flags|=2048,Es(9,{destroy:void 0},bb.bind(null,u,y,s,a),null),s},useId:function(){var n=Ln(),a=Pt.identifierPrefix;if(bt){var s=qr,u=Kr;s=(u&~(1<<32-Ze(u)-1)).toString(32)+s,a="_"+a+"R_"+s,s=gc++,0<s&&(a+="H"+s.toString(32)),a+="_"}else s=Kk++,a="_"+a+"r_"+s.toString(32)+"_";return n.memoizedState=a},useHostTransitionStatus:_f,useFormState:Nb,useActionState:Nb,useOptimistic:function(n){var a=Ln();a.memoizedState=a.baseState=n;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=s,a=kf.bind(null,rt,!0,s),s.dispatch=a,[n,a]},useMemoCache:mf,useCacheRefresh:function(){return Ln().memoizedState=Wk.bind(null,rt)},useEffectEvent:function(n){var a=Ln(),s={impl:n};return a.memoizedState=s,function(){if((Ct&2)!==0)throw Error(i(440));return s.impl.apply(void 0,arguments)}}},Cf={readContext:Sn,use:yc,useCallback:Pb,useContext:Sn,useEffect:vf,useImperativeHandle:zb,useInsertionEffect:jb,useLayoutEffect:Lb,useMemo:Bb,useReducer:xc,useRef:Ob,useState:function(){return xc(pa)},useDebugValue:wf,useDeferredValue:function(n,a){var s=on();return Ub(s,Dt.memoizedState,n,a)},useTransition:function(){var n=xc(pa)[0],a=on().memoizedState;return[typeof n=="boolean"?n:jl(n),a]},useSyncExternalStore:mb,useId:Kb,useHostTransitionStatus:_f,useFormState:Tb,useActionState:Tb,useOptimistic:function(n,a){var s=on();return wb(s,Dt,n,a)},useMemoCache:mf,useCacheRefresh:qb};Cf.useEffectEvent=Db;var Wb={readContext:Sn,use:yc,useCallback:Pb,useContext:Sn,useEffect:vf,useImperativeHandle:zb,useInsertionEffect:jb,useLayoutEffect:Lb,useMemo:Bb,useReducer:bf,useRef:Ob,useState:function(){return bf(pa)},useDebugValue:wf,useDeferredValue:function(n,a){var s=on();return Dt===null?Ef(s,n,a):Ub(s,Dt.memoizedState,n,a)},useTransition:function(){var n=bf(pa)[0],a=on().memoizedState;return[typeof n=="boolean"?n:jl(n),a]},useSyncExternalStore:mb,useId:Kb,useHostTransitionStatus:_f,useFormState:Rb,useActionState:Rb,useOptimistic:function(n,a){var s=on();return Dt!==null?wb(s,Dt,n,a):(s.baseState=n,[n,s.queue.dispatch])},useMemoCache:mf,useCacheRefresh:qb};Wb.useEffectEvent=Db;function Nf(n,a,s,u){a=n.memoizedState,s=s(u,a),s=s==null?a:m({},a,s),n.memoizedState=s,n.lanes===0&&(n.updateQueue.baseState=s)}var Tf={enqueueSetState:function(n,a,s){n=n._reactInternals;var u=lr(),b=Ka(u);b.payload=a,s!=null&&(b.callback=s),a=qa(n,b,u),a!==null&&(Yn(a,n,u),Rl(a,n,u))},enqueueReplaceState:function(n,a,s){n=n._reactInternals;var u=lr(),b=Ka(u);b.tag=1,b.payload=a,s!=null&&(b.callback=s),a=qa(n,b,u),a!==null&&(Yn(a,n,u),Rl(a,n,u))},enqueueForceUpdate:function(n,a){n=n._reactInternals;var s=lr(),u=Ka(s);u.tag=2,a!=null&&(u.callback=a),a=qa(n,u,s),a!==null&&(Yn(a,n,s),Rl(a,n,s))}};function Qb(n,a,s,u,b,y,k){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(u,y,k):a.prototype&&a.prototype.isPureReactComponent?!El(s,u)||!El(b,y):!0}function Zb(n,a,s,u){n=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(s,u),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(s,u),a.state!==n&&Tf.enqueueReplaceState(a,a.state,null)}function ji(n,a){var s=a;if("ref"in a){s={};for(var u in a)u!=="ref"&&(s[u]=a[u])}if(n=n.defaultProps){s===a&&(s=m({},s));for(var b in n)s[b]===void 0&&(s[b]=n[b])}return s}function Jb(n){ec(n)}function ey(n){console.error(n)}function ty(n){ec(n)}function Sc(n,a){try{var s=n.onUncaughtError;s(a.value,{componentStack:a.stack})}catch(u){setTimeout(function(){throw u})}}function ny(n,a,s){try{var u=n.onCaughtError;u(s.value,{componentStack:s.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function Af(n,a,s){return s=Ka(s),s.tag=3,s.payload={element:null},s.callback=function(){Sc(n,a)},s}function ry(n){return n=Ka(n),n.tag=3,n}function ay(n,a,s,u){var b=s.type.getDerivedStateFromError;if(typeof b=="function"){var y=u.value;n.payload=function(){return b(y)},n.callback=function(){ny(a,s,u)}}var k=s.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(n.callback=function(){ny(a,s,u),typeof b!="function"&&(Qa===null?Qa=new Set([this]):Qa.add(this));var O=u.stack;this.componentDidCatch(u.value,{componentStack:O!==null?O:""})})}function Zk(n,a,s,u,b){if(s.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(a=s.alternate,a!==null&&ps(a,s,b,!0),s=rr.current,s!==null){switch(s.tag){case 31:case 13:return _r===null?Lc():s.alternate===null&&rn===0&&(rn=3),s.flags&=-257,s.flags|=65536,s.lanes=b,u===uc?s.flags|=16384:(a=s.updateQueue,a===null?s.updateQueue=new Set([u]):a.add(u),eh(n,u,b)),!1;case 22:return s.flags|=65536,u===uc?s.flags|=16384:(a=s.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([u])},s.updateQueue=a):(s=a.retryQueue,s===null?a.retryQueue=new Set([u]):s.add(u)),eh(n,u,b)),!1}throw Error(i(435,s.tag))}return eh(n,u,b),Lc(),!1}if(bt)return a=rr.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=b,u!==Vd&&(n=Error(i(422),{cause:u}),kl(vr(n,s)))):(u!==Vd&&(a=Error(i(423),{cause:u}),kl(vr(a,s))),n=n.current.alternate,n.flags|=65536,b&=-b,n.lanes|=b,u=vr(u,s),b=Af(n.stateNode,u,b),af(n,b),rn!==4&&(rn=2)),!1;var y=Error(i(520),{cause:u});if(y=vr(y,s),Kl===null?Kl=[y]:Kl.push(y),rn!==4&&(rn=2),a===null)return!0;u=vr(u,s),s=a;do{switch(s.tag){case 3:return s.flags|=65536,n=b&-b,s.lanes|=n,n=Af(s.stateNode,u,n),af(s,n),!1;case 1:if(a=s.type,y=s.stateNode,(s.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Qa===null||!Qa.has(y))))return s.flags|=65536,b&=-b,s.lanes|=b,b=ry(b),ay(b,n,s,u),af(s,b),!1}s=s.return}while(s!==null);return!1}var Rf=Error(i(461)),pn=!1;function _n(n,a,s,u){a.child=n===null?ob(a,null,s,u):Mi(a,n.child,s,u)}function iy(n,a,s,u,b){s=s.render;var y=a.ref;if("ref"in u){var k={};for(var O in u)O!=="ref"&&(k[O]=u[O])}else k=u;return Ti(a),u=df(n,a,s,k,y,b),O=ff(),n!==null&&!pn?(hf(n,a,b),ma(n,a,b)):(bt&&O&&qd(a),a.flags|=1,_n(n,a,u,b),a.child)}function sy(n,a,s,u,b){if(n===null){var y=s.type;return typeof y=="function"&&!$d(y)&&y.defaultProps===void 0&&s.compare===null?(a.tag=15,a.type=y,ly(n,a,y,u,b)):(n=ac(s.type,null,u,a,a.mode,b),n.ref=a.ref,n.return=a,a.child=n)}if(y=n.child,!Pf(n,b)){var k=y.memoizedProps;if(s=s.compare,s=s!==null?s:El,s(k,u)&&n.ref===a.ref)return ma(n,a,b)}return a.flags|=1,n=ca(y,u),n.ref=a.ref,n.return=a,a.child=n}function ly(n,a,s,u,b){if(n!==null){var y=n.memoizedProps;if(El(y,u)&&n.ref===a.ref)if(pn=!1,a.pendingProps=u=y,Pf(n,b))(n.flags&131072)!==0&&(pn=!0);else return a.lanes=n.lanes,ma(n,a,b)}return Of(n,a,s,u,b)}function oy(n,a,s,u){var b=u.children,y=n!==null?n.memoizedState:null;if(n===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((a.flags&128)!==0){if(y=y!==null?y.baseLanes|s:s,n!==null){for(u=a.child=n.child,b=0;u!==null;)b=b|u.lanes|u.childLanes,u=u.sibling;u=b&~y}else u=0,a.child=null;return cy(n,a,y,s,u)}if((s&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},n!==null&&oc(a,y!==null?y.cachePool:null),y!==null?db(a,y):lf(),fb(a);else return u=a.lanes=536870912,cy(n,a,y!==null?y.baseLanes|s:s,s,u)}else y!==null?(oc(a,y.cachePool),db(a,y),Va(),a.memoizedState=null):(n!==null&&oc(a,null),lf(),Va());return _n(n,a,b,s),a.child}function zl(n,a){return n!==null&&n.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function cy(n,a,s,u,b){var y=ef();return y=y===null?null:{parent:fn._currentValue,pool:y},a.memoizedState={baseLanes:s,cachePool:y},n!==null&&oc(a,null),lf(),fb(a),n!==null&&ps(n,a,u,!0),a.childLanes=b,null}function _c(n,a){return a=Cc({mode:a.mode,children:a.children},n.mode),a.ref=n.ref,n.child=a,a.return=n,a}function uy(n,a,s){return Mi(a,n.child,null,s),n=_c(a,a.pendingProps),n.flags|=2,ar(a),a.memoizedState=null,n}function Jk(n,a,s){var u=a.pendingProps,b=(a.flags&128)!==0;if(a.flags&=-129,n===null){if(bt){if(u.mode==="hidden")return n=_c(a,u),a.lanes=536870912,zl(null,n);if(cf(a),(n=Gt)?(n=E0(n,Sr),n=n!==null&&n.data==="&"?n:null,n!==null&&(a.memoizedState={dehydrated:n,treeContext:Ba!==null?{id:Kr,overflow:qr}:null,retryLane:536870912,hydrationErrors:null},s=Vg(n),s.return=a,a.child=s,En=a,Gt=null)):n=null,n===null)throw Fa(a);return a.lanes=536870912,null}return _c(a,u)}var y=n.memoizedState;if(y!==null){var k=y.dehydrated;if(cf(a),b)if(a.flags&256)a.flags&=-257,a=uy(n,a,s);else if(a.memoizedState!==null)a.child=n.child,a.flags|=128,a=null;else throw Error(i(558));else if(pn||ps(n,a,s,!1),b=(s&n.childLanes)!==0,pn||b){if(u=Pt,u!==null&&(k=Jt(u,s),k!==0&&k!==y.retryLane))throw y.retryLane=k,_i(n,k),Yn(u,n,k),Rf;Lc(),a=uy(n,a,s)}else n=y.treeContext,Gt=kr(k.nextSibling),En=a,bt=!0,Ua=null,Sr=!1,n!==null&&Wg(a,n),a=_c(a,u),a.flags|=4096;return a}return n=ca(n.child,{mode:u.mode,children:u.children}),n.ref=a.ref,a.child=n,n.return=a,n}function kc(n,a){var s=a.ref;if(s===null)n!==null&&n.ref!==null&&(a.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(i(284));(n===null||n.ref!==s)&&(a.flags|=4194816)}}function Of(n,a,s,u,b){return Ti(a),s=df(n,a,s,u,void 0,b),u=ff(),n!==null&&!pn?(hf(n,a,b),ma(n,a,b)):(bt&&u&&qd(a),a.flags|=1,_n(n,a,s,b),a.child)}function dy(n,a,s,u,b,y){return Ti(a),a.updateQueue=null,s=pb(a,u,s,b),hb(n),u=ff(),n!==null&&!pn?(hf(n,a,y),ma(n,a,y)):(bt&&u&&qd(a),a.flags|=1,_n(n,a,s,y),a.child)}function fy(n,a,s,u,b){if(Ti(a),a.stateNode===null){var y=us,k=s.contextType;typeof k=="object"&&k!==null&&(y=Sn(k)),y=new s(u,y),a.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Tf,a.stateNode=y,y._reactInternals=a,y=a.stateNode,y.props=u,y.state=a.memoizedState,y.refs={},nf(a),k=s.contextType,y.context=typeof k=="object"&&k!==null?Sn(k):us,y.state=a.memoizedState,k=s.getDerivedStateFromProps,typeof k=="function"&&(Nf(a,s,k,u),y.state=a.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(k=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),k!==y.state&&Tf.enqueueReplaceState(y,y.state,null),Ml(a,u,y,b),Ol(),y.state=a.memoizedState),typeof y.componentDidMount=="function"&&(a.flags|=4194308),u=!0}else if(n===null){y=a.stateNode;var O=a.memoizedProps,U=ji(s,O);y.props=U;var ie=y.context,de=s.contextType;k=us,typeof de=="object"&&de!==null&&(k=Sn(de));var me=s.getDerivedStateFromProps;de=typeof me=="function"||typeof y.getSnapshotBeforeUpdate=="function",O=a.pendingProps!==O,de||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(O||ie!==k)&&Zb(a,y,u,k),Ha=!1;var se=a.memoizedState;y.state=se,Ml(a,u,y,b),Ol(),ie=a.memoizedState,O||se!==ie||Ha?(typeof me=="function"&&(Nf(a,s,me,u),ie=a.memoizedState),(U=Ha||Qb(a,s,U,u,se,ie,k))?(de||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(a.flags|=4194308)):(typeof y.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=u,a.memoizedState=ie),y.props=u,y.state=ie,y.context=k,u=U):(typeof y.componentDidMount=="function"&&(a.flags|=4194308),u=!1)}else{y=a.stateNode,rf(n,a),k=a.memoizedProps,de=ji(s,k),y.props=de,me=a.pendingProps,se=y.context,ie=s.contextType,U=us,typeof ie=="object"&&ie!==null&&(U=Sn(ie)),O=s.getDerivedStateFromProps,(ie=typeof O=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(k!==me||se!==U)&&Zb(a,y,u,U),Ha=!1,se=a.memoizedState,y.state=se,Ml(a,u,y,b),Ol();var oe=a.memoizedState;k!==me||se!==oe||Ha||n!==null&&n.dependencies!==null&&sc(n.dependencies)?(typeof O=="function"&&(Nf(a,s,O,u),oe=a.memoizedState),(de=Ha||Qb(a,s,de,u,se,oe,U)||n!==null&&n.dependencies!==null&&sc(n.dependencies))?(ie||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(u,oe,U),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(u,oe,U)),typeof y.componentDidUpdate=="function"&&(a.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof y.componentDidUpdate!="function"||k===n.memoizedProps&&se===n.memoizedState||(a.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||k===n.memoizedProps&&se===n.memoizedState||(a.flags|=1024),a.memoizedProps=u,a.memoizedState=oe),y.props=u,y.state=oe,y.context=U,u=de):(typeof y.componentDidUpdate!="function"||k===n.memoizedProps&&se===n.memoizedState||(a.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||k===n.memoizedProps&&se===n.memoizedState||(a.flags|=1024),u=!1)}return y=u,kc(n,a),u=(a.flags&128)!==0,y||u?(y=a.stateNode,s=u&&typeof s.getDerivedStateFromError!="function"?null:y.render(),a.flags|=1,n!==null&&u?(a.child=Mi(a,n.child,null,b),a.child=Mi(a,null,s,b)):_n(n,a,s,b),a.memoizedState=y.state,n=a.child):n=ma(n,a,b),n}function hy(n,a,s,u){return Ci(),a.flags|=256,_n(n,a,s,u),a.child}var Mf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Df(n){return{baseLanes:n,cachePool:nb()}}function jf(n,a,s){return n=n!==null?n.childLanes&~s:0,a&&(n|=sr),n}function py(n,a,s){var u=a.pendingProps,b=!1,y=(a.flags&128)!==0,k;if((k=y)||(k=n!==null&&n.memoizedState===null?!1:(ln.current&2)!==0),k&&(b=!0,a.flags&=-129),k=(a.flags&32)!==0,a.flags&=-33,n===null){if(bt){if(b?Ga(a):Va(),(n=Gt)?(n=E0(n,Sr),n=n!==null&&n.data!=="&"?n:null,n!==null&&(a.memoizedState={dehydrated:n,treeContext:Ba!==null?{id:Kr,overflow:qr}:null,retryLane:536870912,hydrationErrors:null},s=Vg(n),s.return=a,a.child=s,En=a,Gt=null)):n=null,n===null)throw Fa(a);return gh(n)?a.lanes=32:a.lanes=536870912,null}var O=u.children;return u=u.fallback,b?(Va(),b=a.mode,O=Cc({mode:"hidden",children:O},b),u=ki(u,b,s,null),O.return=a,u.return=a,O.sibling=u,a.child=O,u=a.child,u.memoizedState=Df(s),u.childLanes=jf(n,k,s),a.memoizedState=Mf,zl(null,u)):(Ga(a),Lf(a,O))}var U=n.memoizedState;if(U!==null&&(O=U.dehydrated,O!==null)){if(y)a.flags&256?(Ga(a),a.flags&=-257,a=If(n,a,s)):a.memoizedState!==null?(Va(),a.child=n.child,a.flags|=128,a=null):(Va(),O=u.fallback,b=a.mode,u=Cc({mode:"visible",children:u.children},b),O=ki(O,b,s,null),O.flags|=2,u.return=a,O.return=a,u.sibling=O,a.child=u,Mi(a,n.child,null,s),u=a.child,u.memoizedState=Df(s),u.childLanes=jf(n,k,s),a.memoizedState=Mf,a=zl(null,u));else if(Ga(a),gh(O)){if(k=O.nextSibling&&O.nextSibling.dataset,k)var ie=k.dgst;k=ie,u=Error(i(419)),u.stack="",u.digest=k,kl({value:u,source:null,stack:null}),a=If(n,a,s)}else if(pn||ps(n,a,s,!1),k=(s&n.childLanes)!==0,pn||k){if(k=Pt,k!==null&&(u=Jt(k,s),u!==0&&u!==U.retryLane))throw U.retryLane=u,_i(n,u),Yn(k,n,u),Rf;mh(O)||Lc(),a=If(n,a,s)}else mh(O)?(a.flags|=192,a.child=n.child,a=null):(n=U.treeContext,Gt=kr(O.nextSibling),En=a,bt=!0,Ua=null,Sr=!1,n!==null&&Wg(a,n),a=Lf(a,u.children),a.flags|=4096);return a}return b?(Va(),O=u.fallback,b=a.mode,U=n.child,ie=U.sibling,u=ca(U,{mode:"hidden",children:u.children}),u.subtreeFlags=U.subtreeFlags&65011712,ie!==null?O=ca(ie,O):(O=ki(O,b,s,null),O.flags|=2),O.return=a,u.return=a,u.sibling=O,a.child=u,zl(null,u),u=a.child,O=n.child.memoizedState,O===null?O=Df(s):(b=O.cachePool,b!==null?(U=fn._currentValue,b=b.parent!==U?{parent:U,pool:U}:b):b=nb(),O={baseLanes:O.baseLanes|s,cachePool:b}),u.memoizedState=O,u.childLanes=jf(n,k,s),a.memoizedState=Mf,zl(n.child,u)):(Ga(a),s=n.child,n=s.sibling,s=ca(s,{mode:"visible",children:u.children}),s.return=a,s.sibling=null,n!==null&&(k=a.deletions,k===null?(a.deletions=[n],a.flags|=16):k.push(n)),a.child=s,a.memoizedState=null,s)}function Lf(n,a){return a=Cc({mode:"visible",children:a},n.mode),a.return=n,n.child=a}function Cc(n,a){return n=nr(22,n,null,a),n.lanes=0,n}function If(n,a,s){return Mi(a,n.child,null,s),n=Lf(a,a.pendingProps.children),n.flags|=2,a.memoizedState=null,n}function my(n,a,s){n.lanes|=a;var u=n.alternate;u!==null&&(u.lanes|=a),Wd(n.return,a,s)}function zf(n,a,s,u,b,y){var k=n.memoizedState;k===null?n.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:u,tail:s,tailMode:b,treeForkCount:y}:(k.isBackwards=a,k.rendering=null,k.renderingStartTime=0,k.last=u,k.tail=s,k.tailMode=b,k.treeForkCount=y)}function gy(n,a,s){var u=a.pendingProps,b=u.revealOrder,y=u.tail;u=u.children;var k=ln.current,O=(k&2)!==0;if(O?(k=k&1|2,a.flags|=128):k&=1,D(ln,k),_n(n,a,u,s),u=bt?_l:0,!O&&n!==null&&(n.flags&128)!==0)e:for(n=a.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&my(n,s,a);else if(n.tag===19)my(n,s,a);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===a)break e;for(;n.sibling===null;){if(n.return===null||n.return===a)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(b){case"forwards":for(s=a.child,b=null;s!==null;)n=s.alternate,n!==null&&pc(n)===null&&(b=s),s=s.sibling;s=b,s===null?(b=a.child,a.child=null):(b=s.sibling,s.sibling=null),zf(a,!1,b,s,y,u);break;case"backwards":case"unstable_legacy-backwards":for(s=null,b=a.child,a.child=null;b!==null;){if(n=b.alternate,n!==null&&pc(n)===null){a.child=b;break}n=b.sibling,b.sibling=s,s=b,b=n}zf(a,!0,s,null,y,u);break;case"together":zf(a,!1,null,null,void 0,u);break;default:a.memoizedState=null}return a.child}function ma(n,a,s){if(n!==null&&(a.dependencies=n.dependencies),Wa|=a.lanes,(s&a.childLanes)===0)if(n!==null){if(ps(n,a,s,!1),(s&a.childLanes)===0)return null}else return null;if(n!==null&&a.child!==n.child)throw Error(i(153));if(a.child!==null){for(n=a.child,s=ca(n,n.pendingProps),a.child=s,s.return=a;n.sibling!==null;)n=n.sibling,s=s.sibling=ca(n,n.pendingProps),s.return=a;s.sibling=null}return a.child}function Pf(n,a){return(n.lanes&a)!==0?!0:(n=n.dependencies,!!(n!==null&&sc(n)))}function eC(n,a,s){switch(a.tag){case 3:ve(a,a.stateNode.containerInfo),$a(a,fn,n.memoizedState.cache),Ci();break;case 27:case 5:we(a);break;case 4:ve(a,a.stateNode.containerInfo);break;case 10:$a(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,cf(a),null;break;case 13:var u=a.memoizedState;if(u!==null)return u.dehydrated!==null?(Ga(a),a.flags|=128,null):(s&a.child.childLanes)!==0?py(n,a,s):(Ga(a),n=ma(n,a,s),n!==null?n.sibling:null);Ga(a);break;case 19:var b=(n.flags&128)!==0;if(u=(s&a.childLanes)!==0,u||(ps(n,a,s,!1),u=(s&a.childLanes)!==0),b){if(u)return gy(n,a,s);a.flags|=128}if(b=a.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),D(ln,ln.current),u)break;return null;case 22:return a.lanes=0,oy(n,a,s,a.pendingProps);case 24:$a(a,fn,n.memoizedState.cache)}return ma(n,a,s)}function by(n,a,s){if(n!==null)if(n.memoizedProps!==a.pendingProps)pn=!0;else{if(!Pf(n,s)&&(a.flags&128)===0)return pn=!1,eC(n,a,s);pn=(n.flags&131072)!==0}else pn=!1,bt&&(a.flags&1048576)!==0&&Xg(a,_l,a.index);switch(a.lanes=0,a.tag){case 16:e:{var u=a.pendingProps;if(n=Ri(a.elementType),a.type=n,typeof n=="function")$d(n)?(u=ji(n,u),a.tag=1,a=fy(null,a,n,u,s)):(a.tag=0,a=Of(null,a,n,u,s));else{if(n!=null){var b=n.$$typeof;if(b===M){a.tag=11,a=iy(null,a,n,u,s);break e}else if(b===z){a.tag=14,a=sy(null,a,n,u,s);break e}}throw a=Y(n)||n,Error(i(306,a,""))}}return a;case 0:return Of(n,a,a.type,a.pendingProps,s);case 1:return u=a.type,b=ji(u,a.pendingProps),fy(n,a,u,b,s);case 3:e:{if(ve(a,a.stateNode.containerInfo),n===null)throw Error(i(387));u=a.pendingProps;var y=a.memoizedState;b=y.element,rf(n,a),Ml(a,u,null,s);var k=a.memoizedState;if(u=k.cache,$a(a,fn,u),u!==y.cache&&Qd(a,[fn],s,!0),Ol(),u=k.element,y.isDehydrated)if(y={element:u,isDehydrated:!1,cache:k.cache},a.updateQueue.baseState=y,a.memoizedState=y,a.flags&256){a=hy(n,a,u,s);break e}else if(u!==b){b=vr(Error(i(424)),a),kl(b),a=hy(n,a,u,s);break e}else{switch(n=a.stateNode.containerInfo,n.nodeType){case 9:n=n.body;break;default:n=n.nodeName==="HTML"?n.ownerDocument.body:n}for(Gt=kr(n.firstChild),En=a,bt=!0,Ua=null,Sr=!0,s=ob(a,null,u,s),a.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Ci(),u===b){a=ma(n,a,s);break e}_n(n,a,u,s)}a=a.child}return a;case 26:return kc(n,a),n===null?(s=T0(a.type,null,a.pendingProps,null))?a.memoizedState=s:bt||(s=a.type,n=a.pendingProps,u=$c(pe.current).createElement(s),u[qt]=a,u[en]=n,kn(u,s,n),un(u),a.stateNode=u):a.memoizedState=T0(a.type,n.memoizedProps,a.pendingProps,n.memoizedState),null;case 27:return we(a),n===null&&bt&&(u=a.stateNode=k0(a.type,a.pendingProps,pe.current),En=a,Sr=!0,b=Gt,ti(a.type)?(bh=b,Gt=kr(u.firstChild)):Gt=b),_n(n,a,a.pendingProps.children,s),kc(n,a),n===null&&(a.flags|=4194304),a.child;case 5:return n===null&&bt&&((b=u=Gt)&&(u=RC(u,a.type,a.pendingProps,Sr),u!==null?(a.stateNode=u,En=a,Gt=kr(u.firstChild),Sr=!1,b=!0):b=!1),b||Fa(a)),we(a),b=a.type,y=a.pendingProps,k=n!==null?n.memoizedProps:null,u=y.children,fh(b,y)?u=null:k!==null&&fh(b,k)&&(a.flags|=32),a.memoizedState!==null&&(b=df(n,a,qk,null,null,s),Zl._currentValue=b),kc(n,a),_n(n,a,u,s),a.child;case 6:return n===null&&bt&&((n=s=Gt)&&(s=OC(s,a.pendingProps,Sr),s!==null?(a.stateNode=s,En=a,Gt=null,n=!0):n=!1),n||Fa(a)),null;case 13:return py(n,a,s);case 4:return ve(a,a.stateNode.containerInfo),u=a.pendingProps,n===null?a.child=Mi(a,null,u,s):_n(n,a,u,s),a.child;case 11:return iy(n,a,a.type,a.pendingProps,s);case 7:return _n(n,a,a.pendingProps,s),a.child;case 8:return _n(n,a,a.pendingProps.children,s),a.child;case 12:return _n(n,a,a.pendingProps.children,s),a.child;case 10:return u=a.pendingProps,$a(a,a.type,u.value),_n(n,a,u.children,s),a.child;case 9:return b=a.type._context,u=a.pendingProps.children,Ti(a),b=Sn(b),u=u(b),a.flags|=1,_n(n,a,u,s),a.child;case 14:return sy(n,a,a.type,a.pendingProps,s);case 15:return ly(n,a,a.type,a.pendingProps,s);case 19:return gy(n,a,s);case 31:return Jk(n,a,s);case 22:return oy(n,a,s,a.pendingProps);case 24:return Ti(a),u=Sn(fn),n===null?(b=ef(),b===null&&(b=Pt,y=Zd(),b.pooledCache=y,y.refCount++,y!==null&&(b.pooledCacheLanes|=s),b=y),a.memoizedState={parent:u,cache:b},nf(a),$a(a,fn,b)):((n.lanes&s)!==0&&(rf(n,a),Ml(a,null,null,s),Ol()),b=n.memoizedState,y=a.memoizedState,b.parent!==u?(b={parent:u,cache:u},a.memoizedState=b,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=b),$a(a,fn,u)):(u=y.cache,$a(a,fn,u),u!==b.cache&&Qd(a,[fn],s,!0))),_n(n,a,a.pendingProps.children,s),a.child;case 29:throw a.pendingProps}throw Error(i(156,a.tag))}function ga(n){n.flags|=4}function Bf(n,a,s,u,b){if((a=(n.mode&32)!==0)&&(a=!1),a){if(n.flags|=16777216,(b&335544128)===b)if(n.stateNode.complete)n.flags|=8192;else if(Ky())n.flags|=8192;else throw Oi=uc,tf}else n.flags&=-16777217}function yy(n,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!D0(a))if(Ky())n.flags|=8192;else throw Oi=uc,tf}function Nc(n,a){a!==null&&(n.flags|=4),n.flags&16384&&(a=n.tag!==22?We():536870912,n.lanes|=a,Cs|=a)}function Pl(n,a){if(!bt)switch(n.tailMode){case"hidden":a=n.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?n.tail=null:s.sibling=null;break;case"collapsed":s=n.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?a||n.tail===null?n.tail=null:n.tail.sibling=null:u.sibling=null}}function Vt(n){var a=n.alternate!==null&&n.alternate.child===n.child,s=0,u=0;if(a)for(var b=n.child;b!==null;)s|=b.lanes|b.childLanes,u|=b.subtreeFlags&65011712,u|=b.flags&65011712,b.return=n,b=b.sibling;else for(b=n.child;b!==null;)s|=b.lanes|b.childLanes,u|=b.subtreeFlags,u|=b.flags,b.return=n,b=b.sibling;return n.subtreeFlags|=u,n.childLanes=s,a}function tC(n,a,s){var u=a.pendingProps;switch(Gd(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vt(a),null;case 1:return Vt(a),null;case 3:return s=a.stateNode,u=null,n!==null&&(u=n.memoizedState.cache),a.memoizedState.cache!==u&&(a.flags|=2048),fa(fn),ge(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(n===null||n.child===null)&&(hs(a)?ga(a):n===null||n.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Yd())),Vt(a),null;case 26:var b=a.type,y=a.memoizedState;return n===null?(ga(a),y!==null?(Vt(a),yy(a,y)):(Vt(a),Bf(a,b,null,u,s))):y?y!==n.memoizedState?(ga(a),Vt(a),yy(a,y)):(Vt(a),a.flags&=-16777217):(n=n.memoizedProps,n!==u&&ga(a),Vt(a),Bf(a,b,n,u,s)),null;case 27:if(ye(a),s=pe.current,b=a.type,n!==null&&a.stateNode!=null)n.memoizedProps!==u&&ga(a);else{if(!u){if(a.stateNode===null)throw Error(i(166));return Vt(a),null}n=J.current,hs(a)?Qg(a):(n=k0(b,u,s),a.stateNode=n,ga(a))}return Vt(a),null;case 5:if(ye(a),b=a.type,n!==null&&a.stateNode!=null)n.memoizedProps!==u&&ga(a);else{if(!u){if(a.stateNode===null)throw Error(i(166));return Vt(a),null}if(y=J.current,hs(a))Qg(a);else{var k=$c(pe.current);switch(y){case 1:y=k.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:y=k.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":y=k.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":y=k.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":y=k.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof u.is=="string"?k.createElement("select",{is:u.is}):k.createElement("select"),u.multiple?y.multiple=!0:u.size&&(y.size=u.size);break;default:y=typeof u.is=="string"?k.createElement(b,{is:u.is}):k.createElement(b)}}y[qt]=a,y[en]=u;e:for(k=a.child;k!==null;){if(k.tag===5||k.tag===6)y.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===a)break e;for(;k.sibling===null;){if(k.return===null||k.return===a)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}a.stateNode=y;e:switch(kn(y,b,u),b){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&ga(a)}}return Vt(a),Bf(a,a.type,n===null?null:n.memoizedProps,a.pendingProps,s),null;case 6:if(n&&a.stateNode!=null)n.memoizedProps!==u&&ga(a);else{if(typeof u!="string"&&a.stateNode===null)throw Error(i(166));if(n=pe.current,hs(a)){if(n=a.stateNode,s=a.memoizedProps,u=null,b=En,b!==null)switch(b.tag){case 27:case 5:u=b.memoizedProps}n[qt]=a,n=!!(n.nodeValue===s||u!==null&&u.suppressHydrationWarning===!0||p0(n.nodeValue,s)),n||Fa(a,!0)}else n=$c(n).createTextNode(u),n[qt]=a,a.stateNode=n}return Vt(a),null;case 31:if(s=a.memoizedState,n===null||n.memoizedState!==null){if(u=hs(a),s!==null){if(n===null){if(!u)throw Error(i(318));if(n=a.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(557));n[qt]=a}else Ci(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Vt(a),n=!1}else s=Yd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=s),n=!0;if(!n)return a.flags&256?(ar(a),a):(ar(a),null);if((a.flags&128)!==0)throw Error(i(558))}return Vt(a),null;case 13:if(u=a.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(b=hs(a),u!==null&&u.dehydrated!==null){if(n===null){if(!b)throw Error(i(318));if(b=a.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(i(317));b[qt]=a}else Ci(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Vt(a),b=!1}else b=Yd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=b),b=!0;if(!b)return a.flags&256?(ar(a),a):(ar(a),null)}return ar(a),(a.flags&128)!==0?(a.lanes=s,a):(s=u!==null,n=n!==null&&n.memoizedState!==null,s&&(u=a.child,b=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(b=u.alternate.memoizedState.cachePool.pool),y=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(y=u.memoizedState.cachePool.pool),y!==b&&(u.flags|=2048)),s!==n&&s&&(a.child.flags|=8192),Nc(a,a.updateQueue),Vt(a),null);case 4:return ge(),n===null&&lh(a.stateNode.containerInfo),Vt(a),null;case 10:return fa(a.type),Vt(a),null;case 19:if(X(ln),u=a.memoizedState,u===null)return Vt(a),null;if(b=(a.flags&128)!==0,y=u.rendering,y===null)if(b)Pl(u,!1);else{if(rn!==0||n!==null&&(n.flags&128)!==0)for(n=a.child;n!==null;){if(y=pc(n),y!==null){for(a.flags|=128,Pl(u,!1),n=y.updateQueue,a.updateQueue=n,Nc(a,n),a.subtreeFlags=0,n=s,s=a.child;s!==null;)Gg(s,n),s=s.sibling;return D(ln,ln.current&1|2),bt&&ua(a,u.treeForkCount),a.child}n=n.sibling}u.tail!==null&&ot()>Mc&&(a.flags|=128,b=!0,Pl(u,!1),a.lanes=4194304)}else{if(!b)if(n=pc(y),n!==null){if(a.flags|=128,b=!0,n=n.updateQueue,a.updateQueue=n,Nc(a,n),Pl(u,!0),u.tail===null&&u.tailMode==="hidden"&&!y.alternate&&!bt)return Vt(a),null}else 2*ot()-u.renderingStartTime>Mc&&s!==536870912&&(a.flags|=128,b=!0,Pl(u,!1),a.lanes=4194304);u.isBackwards?(y.sibling=a.child,a.child=y):(n=u.last,n!==null?n.sibling=y:a.child=y,u.last=y)}return u.tail!==null?(n=u.tail,u.rendering=n,u.tail=n.sibling,u.renderingStartTime=ot(),n.sibling=null,s=ln.current,D(ln,b?s&1|2:s&1),bt&&ua(a,u.treeForkCount),n):(Vt(a),null);case 22:case 23:return ar(a),of(),u=a.memoizedState!==null,n!==null?n.memoizedState!==null!==u&&(a.flags|=8192):u&&(a.flags|=8192),u?(s&536870912)!==0&&(a.flags&128)===0&&(Vt(a),a.subtreeFlags&6&&(a.flags|=8192)):Vt(a),s=a.updateQueue,s!==null&&Nc(a,s.retryQueue),s=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==s&&(a.flags|=2048),n!==null&&X(Ai),null;case 24:return s=null,n!==null&&(s=n.memoizedState.cache),a.memoizedState.cache!==s&&(a.flags|=2048),fa(fn),Vt(a),null;case 25:return null;case 30:return null}throw Error(i(156,a.tag))}function nC(n,a){switch(Gd(a),a.tag){case 1:return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 3:return fa(fn),ge(),n=a.flags,(n&65536)!==0&&(n&128)===0?(a.flags=n&-65537|128,a):null;case 26:case 27:case 5:return ye(a),null;case 31:if(a.memoizedState!==null){if(ar(a),a.alternate===null)throw Error(i(340));Ci()}return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 13:if(ar(a),n=a.memoizedState,n!==null&&n.dehydrated!==null){if(a.alternate===null)throw Error(i(340));Ci()}return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 19:return X(ln),null;case 4:return ge(),null;case 10:return fa(a.type),null;case 22:case 23:return ar(a),of(),n!==null&&X(Ai),n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 24:return fa(fn),null;case 25:return null;default:return null}}function xy(n,a){switch(Gd(a),a.tag){case 3:fa(fn),ge();break;case 26:case 27:case 5:ye(a);break;case 4:ge();break;case 31:a.memoizedState!==null&&ar(a);break;case 13:ar(a);break;case 19:X(ln);break;case 10:fa(a.type);break;case 22:case 23:ar(a),of(),n!==null&&X(Ai);break;case 24:fa(fn)}}function Bl(n,a){try{var s=a.updateQueue,u=s!==null?s.lastEffect:null;if(u!==null){var b=u.next;s=b;do{if((s.tag&n)===n){u=void 0;var y=s.create,k=s.inst;u=y(),k.destroy=u}s=s.next}while(s!==b)}}catch(O){Ot(a,a.return,O)}}function Ya(n,a,s){try{var u=a.updateQueue,b=u!==null?u.lastEffect:null;if(b!==null){var y=b.next;u=y;do{if((u.tag&n)===n){var k=u.inst,O=k.destroy;if(O!==void 0){k.destroy=void 0,b=a;var U=s,ie=O;try{ie()}catch(de){Ot(b,U,de)}}}u=u.next}while(u!==y)}}catch(de){Ot(a,a.return,de)}}function vy(n){var a=n.updateQueue;if(a!==null){var s=n.stateNode;try{ub(a,s)}catch(u){Ot(n,n.return,u)}}}function wy(n,a,s){s.props=ji(n.type,n.memoizedProps),s.state=n.memoizedState;try{s.componentWillUnmount()}catch(u){Ot(n,a,u)}}function Ul(n,a){try{var s=n.ref;if(s!==null){switch(n.tag){case 26:case 27:case 5:var u=n.stateNode;break;case 30:u=n.stateNode;break;default:u=n.stateNode}typeof s=="function"?n.refCleanup=s(u):s.current=u}}catch(b){Ot(n,a,b)}}function Gr(n,a){var s=n.ref,u=n.refCleanup;if(s!==null)if(typeof u=="function")try{u()}catch(b){Ot(n,a,b)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(b){Ot(n,a,b)}else s.current=null}function Ey(n){var a=n.type,s=n.memoizedProps,u=n.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":s.autoFocus&&u.focus();break e;case"img":s.src?u.src=s.src:s.srcSet&&(u.srcset=s.srcSet)}}catch(b){Ot(n,n.return,b)}}function Uf(n,a,s){try{var u=n.stateNode;_C(u,n.type,s,a),u[en]=a}catch(b){Ot(n,n.return,b)}}function Sy(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&ti(n.type)||n.tag===4}function Ff(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Sy(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&ti(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function $f(n,a,s){var u=n.tag;if(u===5||u===6)n=n.stateNode,a?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(n,a):(a=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,a.appendChild(n),s=s._reactRootContainer,s!=null||a.onclick!==null||(a.onclick=ke));else if(u!==4&&(u===27&&ti(n.type)&&(s=n.stateNode,a=null),n=n.child,n!==null))for($f(n,a,s),n=n.sibling;n!==null;)$f(n,a,s),n=n.sibling}function Tc(n,a,s){var u=n.tag;if(u===5||u===6)n=n.stateNode,a?s.insertBefore(n,a):s.appendChild(n);else if(u!==4&&(u===27&&ti(n.type)&&(s=n.stateNode),n=n.child,n!==null))for(Tc(n,a,s),n=n.sibling;n!==null;)Tc(n,a,s),n=n.sibling}function _y(n){var a=n.stateNode,s=n.memoizedProps;try{for(var u=n.type,b=a.attributes;b.length;)a.removeAttributeNode(b[0]);kn(a,u,s),a[qt]=n,a[en]=s}catch(y){Ot(n,n.return,y)}}var ba=!1,mn=!1,Hf=!1,ky=typeof WeakSet=="function"?WeakSet:Set,yn=null;function rC(n,a){if(n=n.containerInfo,uh=Xc,n=zg(n),Ld(n)){if("selectionStart"in n)var s={start:n.selectionStart,end:n.selectionEnd};else e:{s=(s=n.ownerDocument)&&s.defaultView||window;var u=s.getSelection&&s.getSelection();if(u&&u.rangeCount!==0){s=u.anchorNode;var b=u.anchorOffset,y=u.focusNode;u=u.focusOffset;try{s.nodeType,y.nodeType}catch{s=null;break e}var k=0,O=-1,U=-1,ie=0,de=0,me=n,se=null;t:for(;;){for(var oe;me!==s||b!==0&&me.nodeType!==3||(O=k+b),me!==y||u!==0&&me.nodeType!==3||(U=k+u),me.nodeType===3&&(k+=me.nodeValue.length),(oe=me.firstChild)!==null;)se=me,me=oe;for(;;){if(me===n)break t;if(se===s&&++ie===b&&(O=k),se===y&&++de===u&&(U=k),(oe=me.nextSibling)!==null)break;me=se,se=me.parentNode}me=oe}s=O===-1||U===-1?null:{start:O,end:U}}else s=null}s=s||{start:0,end:0}}else s=null;for(dh={focusedElem:n,selectionRange:s},Xc=!1,yn=a;yn!==null;)if(a=yn,n=a.child,(a.subtreeFlags&1028)!==0&&n!==null)n.return=a,yn=n;else for(;yn!==null;){switch(a=yn,y=a.alternate,n=a.flags,a.tag){case 0:if((n&4)!==0&&(n=a.updateQueue,n=n!==null?n.events:null,n!==null))for(s=0;s<n.length;s++)b=n[s],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&y!==null){n=void 0,s=a,b=y.memoizedProps,y=y.memoizedState,u=s.stateNode;try{var Le=ji(s.type,b);n=u.getSnapshotBeforeUpdate(Le,y),u.__reactInternalSnapshotBeforeUpdate=n}catch(Ve){Ot(s,s.return,Ve)}}break;case 3:if((n&1024)!==0){if(n=a.stateNode.containerInfo,s=n.nodeType,s===9)ph(n);else if(s===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":ph(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(i(163))}if(n=a.sibling,n!==null){n.return=a.return,yn=n;break}yn=a.return}}function Cy(n,a,s){var u=s.flags;switch(s.tag){case 0:case 11:case 15:xa(n,s),u&4&&Bl(5,s);break;case 1:if(xa(n,s),u&4)if(n=s.stateNode,a===null)try{n.componentDidMount()}catch(k){Ot(s,s.return,k)}else{var b=ji(s.type,a.memoizedProps);a=a.memoizedState;try{n.componentDidUpdate(b,a,n.__reactInternalSnapshotBeforeUpdate)}catch(k){Ot(s,s.return,k)}}u&64&&vy(s),u&512&&Ul(s,s.return);break;case 3:if(xa(n,s),u&64&&(n=s.updateQueue,n!==null)){if(a=null,s.child!==null)switch(s.child.tag){case 27:case 5:a=s.child.stateNode;break;case 1:a=s.child.stateNode}try{ub(n,a)}catch(k){Ot(s,s.return,k)}}break;case 27:a===null&&u&4&&_y(s);case 26:case 5:xa(n,s),a===null&&u&4&&Ey(s),u&512&&Ul(s,s.return);break;case 12:xa(n,s);break;case 31:xa(n,s),u&4&&Ay(n,s);break;case 13:xa(n,s),u&4&&Ry(n,s),u&64&&(n=s.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(s=fC.bind(null,s),MC(n,s))));break;case 22:if(u=s.memoizedState!==null||ba,!u){a=a!==null&&a.memoizedState!==null||mn,b=ba;var y=mn;ba=u,(mn=a)&&!y?va(n,s,(s.subtreeFlags&8772)!==0):xa(n,s),ba=b,mn=y}break;case 30:break;default:xa(n,s)}}function Ny(n){var a=n.alternate;a!==null&&(n.alternate=null,Ny(a)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(a=n.stateNode,a!==null&&ul(a)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var Wt=null,Kn=!1;function ya(n,a,s){for(s=s.child;s!==null;)Ty(n,a,s),s=s.sibling}function Ty(n,a,s){if(st&&typeof st.onCommitFiberUnmount=="function")try{st.onCommitFiberUnmount(tt,s)}catch{}switch(s.tag){case 26:mn||Gr(s,a),ya(n,a,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:mn||Gr(s,a);var u=Wt,b=Kn;ti(s.type)&&(Wt=s.stateNode,Kn=!1),ya(n,a,s),Xl(s.stateNode),Wt=u,Kn=b;break;case 5:mn||Gr(s,a);case 6:if(u=Wt,b=Kn,Wt=null,ya(n,a,s),Wt=u,Kn=b,Wt!==null)if(Kn)try{(Wt.nodeType===9?Wt.body:Wt.nodeName==="HTML"?Wt.ownerDocument.body:Wt).removeChild(s.stateNode)}catch(y){Ot(s,a,y)}else try{Wt.removeChild(s.stateNode)}catch(y){Ot(s,a,y)}break;case 18:Wt!==null&&(Kn?(n=Wt,v0(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,s.stateNode),js(n)):v0(Wt,s.stateNode));break;case 4:u=Wt,b=Kn,Wt=s.stateNode.containerInfo,Kn=!0,ya(n,a,s),Wt=u,Kn=b;break;case 0:case 11:case 14:case 15:Ya(2,s,a),mn||Ya(4,s,a),ya(n,a,s);break;case 1:mn||(Gr(s,a),u=s.stateNode,typeof u.componentWillUnmount=="function"&&wy(s,a,u)),ya(n,a,s);break;case 21:ya(n,a,s);break;case 22:mn=(u=mn)||s.memoizedState!==null,ya(n,a,s),mn=u;break;default:ya(n,a,s)}}function Ay(n,a){if(a.memoizedState===null&&(n=a.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{js(n)}catch(s){Ot(a,a.return,s)}}}function Ry(n,a){if(a.memoizedState===null&&(n=a.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{js(n)}catch(s){Ot(a,a.return,s)}}function aC(n){switch(n.tag){case 31:case 13:case 19:var a=n.stateNode;return a===null&&(a=n.stateNode=new ky),a;case 22:return n=n.stateNode,a=n._retryCache,a===null&&(a=n._retryCache=new ky),a;default:throw Error(i(435,n.tag))}}function Ac(n,a){var s=aC(n);a.forEach(function(u){if(!s.has(u)){s.add(u);var b=hC.bind(null,n,u);u.then(b,b)}})}function qn(n,a){var s=a.deletions;if(s!==null)for(var u=0;u<s.length;u++){var b=s[u],y=n,k=a,O=k;e:for(;O!==null;){switch(O.tag){case 27:if(ti(O.type)){Wt=O.stateNode,Kn=!1;break e}break;case 5:Wt=O.stateNode,Kn=!1;break e;case 3:case 4:Wt=O.stateNode.containerInfo,Kn=!0;break e}O=O.return}if(Wt===null)throw Error(i(160));Ty(y,k,b),Wt=null,Kn=!1,y=b.alternate,y!==null&&(y.return=null),b.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)Oy(a,n),a=a.sibling}var Mr=null;function Oy(n,a){var s=n.alternate,u=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:qn(a,n),Gn(n),u&4&&(Ya(3,n,n.return),Bl(3,n),Ya(5,n,n.return));break;case 1:qn(a,n),Gn(n),u&512&&(mn||s===null||Gr(s,s.return)),u&64&&ba&&(n=n.updateQueue,n!==null&&(u=n.callbacks,u!==null&&(s=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=s===null?u:s.concat(u))));break;case 26:var b=Mr;if(qn(a,n),Gn(n),u&512&&(mn||s===null||Gr(s,s.return)),u&4){var y=s!==null?s.memoizedState:null;if(u=n.memoizedState,s===null)if(u===null)if(n.stateNode===null){e:{u=n.type,s=n.memoizedProps,b=b.ownerDocument||b;t:switch(u){case"title":y=b.getElementsByTagName("title")[0],(!y||y[yi]||y[qt]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=b.createElement(u),b.head.insertBefore(y,b.querySelector("head > title"))),kn(y,u,s),y[qt]=n,un(y),u=y;break e;case"link":var k=O0("link","href",b).get(u+(s.href||""));if(k){for(var O=0;O<k.length;O++)if(y=k[O],y.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&y.getAttribute("rel")===(s.rel==null?null:s.rel)&&y.getAttribute("title")===(s.title==null?null:s.title)&&y.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){k.splice(O,1);break t}}y=b.createElement(u),kn(y,u,s),b.head.appendChild(y);break;case"meta":if(k=O0("meta","content",b).get(u+(s.content||""))){for(O=0;O<k.length;O++)if(y=k[O],y.getAttribute("content")===(s.content==null?null:""+s.content)&&y.getAttribute("name")===(s.name==null?null:s.name)&&y.getAttribute("property")===(s.property==null?null:s.property)&&y.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&y.getAttribute("charset")===(s.charSet==null?null:s.charSet)){k.splice(O,1);break t}}y=b.createElement(u),kn(y,u,s),b.head.appendChild(y);break;default:throw Error(i(468,u))}y[qt]=n,un(y),u=y}n.stateNode=u}else M0(b,n.type,n.stateNode);else n.stateNode=R0(b,u,n.memoizedProps);else y!==u?(y===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):y.count--,u===null?M0(b,n.type,n.stateNode):R0(b,u,n.memoizedProps)):u===null&&n.stateNode!==null&&Uf(n,n.memoizedProps,s.memoizedProps)}break;case 27:qn(a,n),Gn(n),u&512&&(mn||s===null||Gr(s,s.return)),s!==null&&u&4&&Uf(n,n.memoizedProps,s.memoizedProps);break;case 5:if(qn(a,n),Gn(n),u&512&&(mn||s===null||Gr(s,s.return)),n.flags&32){b=n.stateNode;try{Qe(b,"")}catch(Le){Ot(n,n.return,Le)}}u&4&&n.stateNode!=null&&(b=n.memoizedProps,Uf(n,b,s!==null?s.memoizedProps:b)),u&1024&&(Hf=!0);break;case 6:if(qn(a,n),Gn(n),u&4){if(n.stateNode===null)throw Error(i(162));u=n.memoizedProps,s=n.stateNode;try{s.nodeValue=u}catch(Le){Ot(n,n.return,Le)}}break;case 3:if(qc=null,b=Mr,Mr=Hc(a.containerInfo),qn(a,n),Mr=b,Gn(n),u&4&&s!==null&&s.memoizedState.isDehydrated)try{js(a.containerInfo)}catch(Le){Ot(n,n.return,Le)}Hf&&(Hf=!1,My(n));break;case 4:u=Mr,Mr=Hc(n.stateNode.containerInfo),qn(a,n),Gn(n),Mr=u;break;case 12:qn(a,n),Gn(n);break;case 31:qn(a,n),Gn(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,Ac(n,u)));break;case 13:qn(a,n),Gn(n),n.child.flags&8192&&n.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Oc=ot()),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,Ac(n,u)));break;case 22:b=n.memoizedState!==null;var U=s!==null&&s.memoizedState!==null,ie=ba,de=mn;if(ba=ie||b,mn=de||U,qn(a,n),mn=de,ba=ie,Gn(n),u&8192)e:for(a=n.stateNode,a._visibility=b?a._visibility&-2:a._visibility|1,b&&(s===null||U||ba||mn||Li(n)),s=null,a=n;;){if(a.tag===5||a.tag===26){if(s===null){U=s=a;try{if(y=U.stateNode,b)k=y.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{O=U.stateNode;var me=U.memoizedProps.style,se=me!=null&&me.hasOwnProperty("display")?me.display:null;O.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(Le){Ot(U,U.return,Le)}}}else if(a.tag===6){if(s===null){U=a;try{U.stateNode.nodeValue=b?"":U.memoizedProps}catch(Le){Ot(U,U.return,Le)}}}else if(a.tag===18){if(s===null){U=a;try{var oe=U.stateNode;b?w0(oe,!0):w0(U.stateNode,!1)}catch(Le){Ot(U,U.return,Le)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===n)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===n)break e;for(;a.sibling===null;){if(a.return===null||a.return===n)break e;s===a&&(s=null),a=a.return}s===a&&(s=null),a.sibling.return=a.return,a=a.sibling}u&4&&(u=n.updateQueue,u!==null&&(s=u.retryQueue,s!==null&&(u.retryQueue=null,Ac(n,s))));break;case 19:qn(a,n),Gn(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,Ac(n,u)));break;case 30:break;case 21:break;default:qn(a,n),Gn(n)}}function Gn(n){var a=n.flags;if(a&2){try{for(var s,u=n.return;u!==null;){if(Sy(u)){s=u;break}u=u.return}if(s==null)throw Error(i(160));switch(s.tag){case 27:var b=s.stateNode,y=Ff(n);Tc(n,y,b);break;case 5:var k=s.stateNode;s.flags&32&&(Qe(k,""),s.flags&=-33);var O=Ff(n);Tc(n,O,k);break;case 3:case 4:var U=s.stateNode.containerInfo,ie=Ff(n);$f(n,ie,U);break;default:throw Error(i(161))}}catch(de){Ot(n,n.return,de)}n.flags&=-3}a&4096&&(n.flags&=-4097)}function My(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var a=n;My(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),n=n.sibling}}function xa(n,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)Cy(n,a.alternate,a),a=a.sibling}function Li(n){for(n=n.child;n!==null;){var a=n;switch(a.tag){case 0:case 11:case 14:case 15:Ya(4,a,a.return),Li(a);break;case 1:Gr(a,a.return);var s=a.stateNode;typeof s.componentWillUnmount=="function"&&wy(a,a.return,s),Li(a);break;case 27:Xl(a.stateNode);case 26:case 5:Gr(a,a.return),Li(a);break;case 22:a.memoizedState===null&&Li(a);break;case 30:Li(a);break;default:Li(a)}n=n.sibling}}function va(n,a,s){for(s=s&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var u=a.alternate,b=n,y=a,k=y.flags;switch(y.tag){case 0:case 11:case 15:va(b,y,s),Bl(4,y);break;case 1:if(va(b,y,s),u=y,b=u.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(ie){Ot(u,u.return,ie)}if(u=y,b=u.updateQueue,b!==null){var O=u.stateNode;try{var U=b.shared.hiddenCallbacks;if(U!==null)for(b.shared.hiddenCallbacks=null,b=0;b<U.length;b++)cb(U[b],O)}catch(ie){Ot(u,u.return,ie)}}s&&k&64&&vy(y),Ul(y,y.return);break;case 27:_y(y);case 26:case 5:va(b,y,s),s&&u===null&&k&4&&Ey(y),Ul(y,y.return);break;case 12:va(b,y,s);break;case 31:va(b,y,s),s&&k&4&&Ay(b,y);break;case 13:va(b,y,s),s&&k&4&&Ry(b,y);break;case 22:y.memoizedState===null&&va(b,y,s),Ul(y,y.return);break;case 30:break;default:va(b,y,s)}a=a.sibling}}function Kf(n,a){var s=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),n=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(n=a.memoizedState.cachePool.pool),n!==s&&(n!=null&&n.refCount++,s!=null&&Cl(s))}function qf(n,a){n=null,a.alternate!==null&&(n=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==n&&(a.refCount++,n!=null&&Cl(n))}function Dr(n,a,s,u){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Dy(n,a,s,u),a=a.sibling}function Dy(n,a,s,u){var b=a.flags;switch(a.tag){case 0:case 11:case 15:Dr(n,a,s,u),b&2048&&Bl(9,a);break;case 1:Dr(n,a,s,u);break;case 3:Dr(n,a,s,u),b&2048&&(n=null,a.alternate!==null&&(n=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==n&&(a.refCount++,n!=null&&Cl(n)));break;case 12:if(b&2048){Dr(n,a,s,u),n=a.stateNode;try{var y=a.memoizedProps,k=y.id,O=y.onPostCommit;typeof O=="function"&&O(k,a.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(U){Ot(a,a.return,U)}}else Dr(n,a,s,u);break;case 31:Dr(n,a,s,u);break;case 13:Dr(n,a,s,u);break;case 23:break;case 22:y=a.stateNode,k=a.alternate,a.memoizedState!==null?y._visibility&2?Dr(n,a,s,u):Fl(n,a):y._visibility&2?Dr(n,a,s,u):(y._visibility|=2,Ss(n,a,s,u,(a.subtreeFlags&10256)!==0||!1)),b&2048&&Kf(k,a);break;case 24:Dr(n,a,s,u),b&2048&&qf(a.alternate,a);break;default:Dr(n,a,s,u)}}function Ss(n,a,s,u,b){for(b=b&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var y=n,k=a,O=s,U=u,ie=k.flags;switch(k.tag){case 0:case 11:case 15:Ss(y,k,O,U,b),Bl(8,k);break;case 23:break;case 22:var de=k.stateNode;k.memoizedState!==null?de._visibility&2?Ss(y,k,O,U,b):Fl(y,k):(de._visibility|=2,Ss(y,k,O,U,b)),b&&ie&2048&&Kf(k.alternate,k);break;case 24:Ss(y,k,O,U,b),b&&ie&2048&&qf(k.alternate,k);break;default:Ss(y,k,O,U,b)}a=a.sibling}}function Fl(n,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var s=n,u=a,b=u.flags;switch(u.tag){case 22:Fl(s,u),b&2048&&Kf(u.alternate,u);break;case 24:Fl(s,u),b&2048&&qf(u.alternate,u);break;default:Fl(s,u)}a=a.sibling}}var $l=8192;function _s(n,a,s){if(n.subtreeFlags&$l)for(n=n.child;n!==null;)jy(n,a,s),n=n.sibling}function jy(n,a,s){switch(n.tag){case 26:_s(n,a,s),n.flags&$l&&n.memoizedState!==null&&KC(s,Mr,n.memoizedState,n.memoizedProps);break;case 5:_s(n,a,s);break;case 3:case 4:var u=Mr;Mr=Hc(n.stateNode.containerInfo),_s(n,a,s),Mr=u;break;case 22:n.memoizedState===null&&(u=n.alternate,u!==null&&u.memoizedState!==null?(u=$l,$l=16777216,_s(n,a,s),$l=u):_s(n,a,s));break;default:_s(n,a,s)}}function Ly(n){var a=n.alternate;if(a!==null&&(n=a.child,n!==null)){a.child=null;do a=n.sibling,n.sibling=null,n=a;while(n!==null)}}function Hl(n){var a=n.deletions;if((n.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var u=a[s];yn=u,zy(u,n)}Ly(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Iy(n),n=n.sibling}function Iy(n){switch(n.tag){case 0:case 11:case 15:Hl(n),n.flags&2048&&Ya(9,n,n.return);break;case 3:Hl(n);break;case 12:Hl(n);break;case 22:var a=n.stateNode;n.memoizedState!==null&&a._visibility&2&&(n.return===null||n.return.tag!==13)?(a._visibility&=-3,Rc(n)):Hl(n);break;default:Hl(n)}}function Rc(n){var a=n.deletions;if((n.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var u=a[s];yn=u,zy(u,n)}Ly(n)}for(n=n.child;n!==null;){switch(a=n,a.tag){case 0:case 11:case 15:Ya(8,a,a.return),Rc(a);break;case 22:s=a.stateNode,s._visibility&2&&(s._visibility&=-3,Rc(a));break;default:Rc(a)}n=n.sibling}}function zy(n,a){for(;yn!==null;){var s=yn;switch(s.tag){case 0:case 11:case 15:Ya(8,s,a);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var u=s.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:Cl(s.memoizedState.cache)}if(u=s.child,u!==null)u.return=s,yn=u;else e:for(s=n;yn!==null;){u=yn;var b=u.sibling,y=u.return;if(Ny(u),u===s){yn=null;break e}if(b!==null){b.return=y,yn=b;break e}yn=y}}}var iC={getCacheForType:function(n){var a=Sn(fn),s=a.data.get(n);return s===void 0&&(s=n(),a.data.set(n,s)),s},cacheSignal:function(){return Sn(fn).controller.signal}},sC=typeof WeakMap=="function"?WeakMap:Map,Ct=0,Pt=null,ut=null,mt=0,Rt=0,ir=null,Xa=!1,ks=!1,Gf=!1,wa=0,rn=0,Wa=0,Ii=0,Vf=0,sr=0,Cs=0,Kl=null,Vn=null,Yf=!1,Oc=0,Py=0,Mc=1/0,Dc=null,Qa=null,bn=0,Za=null,Ns=null,Ea=0,Xf=0,Wf=null,By=null,ql=0,Qf=null;function lr(){return(Ct&2)!==0&&mt!==0?mt&-mt:j.T!==null?rh():Ma()}function Uy(){if(sr===0)if((mt&536870912)===0||bt){var n=Qn;Qn<<=1,(Qn&3932160)===0&&(Qn=262144),sr=n}else sr=536870912;return n=rr.current,n!==null&&(n.flags|=32),sr}function Yn(n,a,s){(n===Pt&&(Rt===2||Rt===9)||n.cancelPendingCommit!==null)&&(Ts(n,0),Ja(n,mt,sr,!1)),Nt(n,s),((Ct&2)===0||n!==Pt)&&(n===Pt&&((Ct&2)===0&&(Ii|=s),rn===4&&Ja(n,mt,sr,!1)),Vr(n))}function Fy(n,a,s){if((Ct&6)!==0)throw Error(i(327));var u=!s&&(a&127)===0&&(a&n.expiredLanes)===0||fe(n,a),b=u?cC(n,a):Jf(n,a,!0),y=u;do{if(b===0){ks&&!u&&Ja(n,a,0,!1);break}else{if(s=n.current.alternate,y&&!lC(s)){b=Jf(n,a,!1),y=!1;continue}if(b===2){if(y=a,n.errorRecoveryDisabledLanes&y)var k=0;else k=n.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){a=k;e:{var O=n;b=Kl;var U=O.current.memoizedState.isDehydrated;if(U&&(Ts(O,k).flags|=256),k=Jf(O,k,!1),k!==2){if(Gf&&!U){O.errorRecoveryDisabledLanes|=y,Ii|=y,b=4;break e}y=Vn,Vn=b,y!==null&&(Vn===null?Vn=y:Vn.push.apply(Vn,y))}b=k}if(y=!1,b!==2)continue}}if(b===1){Ts(n,0),Ja(n,a,0,!0);break}e:{switch(u=n,y=b,y){case 0:case 1:throw Error(i(345));case 4:if((a&4194048)!==a)break;case 6:Ja(u,a,sr,!Xa);break e;case 2:Vn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((a&62914560)===a&&(b=Oc+300-ot(),10<b)){if(Ja(u,a,sr,!Xa),$(u,0,!0)!==0)break e;Ea=a,u.timeoutHandle=y0($y.bind(null,u,s,Vn,Dc,Yf,a,sr,Ii,Cs,Xa,y,"Throttled",-0,0),b);break e}$y(u,s,Vn,Dc,Yf,a,sr,Ii,Cs,Xa,y,null,-0,0)}}break}while(!0);Vr(n)}function $y(n,a,s,u,b,y,k,O,U,ie,de,me,se,oe){if(n.timeoutHandle=-1,me=a.subtreeFlags,me&8192||(me&16785408)===16785408){me={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ke},jy(a,y,me);var Le=(y&62914560)===y?Oc-ot():(y&4194048)===y?Py-ot():0;if(Le=qC(me,Le),Le!==null){Ea=y,n.cancelPendingCommit=Le(Wy.bind(null,n,a,y,s,u,b,k,O,U,de,me,null,se,oe)),Ja(n,y,k,!ie);return}}Wy(n,a,y,s,u,b,k,O,U)}function lC(n){for(var a=n;;){var s=a.tag;if((s===0||s===11||s===15)&&a.flags&16384&&(s=a.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var u=0;u<s.length;u++){var b=s[u],y=b.getSnapshot;b=b.value;try{if(!tr(y(),b))return!1}catch{return!1}}if(s=a.child,a.subtreeFlags&16384&&s!==null)s.return=a,a=s;else{if(a===n)break;for(;a.sibling===null;){if(a.return===null||a.return===n)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Ja(n,a,s,u){a&=~Vf,a&=~Ii,n.suspendedLanes|=a,n.pingedLanes&=~a,u&&(n.warmLanes|=a),u=n.expirationTimes;for(var b=a;0<b;){var y=31-Ze(b),k=1<<y;u[y]=-1,b&=~k}s!==0&&Re(n,s,a)}function jc(){return(Ct&6)===0?(Gl(0),!1):!0}function Zf(){if(ut!==null){if(Rt===0)var n=ut.return;else n=ut,da=Ni=null,pf(n),ys=null,Tl=0,n=ut;for(;n!==null;)xy(n.alternate,n),n=n.return;ut=null}}function Ts(n,a){var s=n.timeoutHandle;s!==-1&&(n.timeoutHandle=-1,NC(s)),s=n.cancelPendingCommit,s!==null&&(n.cancelPendingCommit=null,s()),Ea=0,Zf(),Pt=n,ut=s=ca(n.current,null),mt=a,Rt=0,ir=null,Xa=!1,ks=fe(n,a),Gf=!1,Cs=sr=Vf=Ii=Wa=rn=0,Vn=Kl=null,Yf=!1,(a&8)!==0&&(a|=a&32);var u=n.entangledLanes;if(u!==0)for(n=n.entanglements,u&=a;0<u;){var b=31-Ze(u),y=1<<b;a|=n[b],u&=~y}return wa=a,tc(),s}function Hy(n,a){rt=null,j.H=Il,a===bs||a===cc?(a=ib(),Rt=3):a===tf?(a=ib(),Rt=4):Rt=a===Rf?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,ir=a,ut===null&&(rn=1,Sc(n,vr(a,n.current)))}function Ky(){var n=rr.current;return n===null?!0:(mt&4194048)===mt?_r===null:(mt&62914560)===mt||(mt&536870912)!==0?n===_r:!1}function qy(){var n=j.H;return j.H=Il,n===null?Il:n}function Gy(){var n=j.A;return j.A=iC,n}function Lc(){rn=4,Xa||(mt&4194048)!==mt&&rr.current!==null||(ks=!0),(Wa&134217727)===0&&(Ii&134217727)===0||Pt===null||Ja(Pt,mt,sr,!1)}function Jf(n,a,s){var u=Ct;Ct|=2;var b=qy(),y=Gy();(Pt!==n||mt!==a)&&(Dc=null,Ts(n,a)),a=!1;var k=rn;e:do try{if(Rt!==0&&ut!==null){var O=ut,U=ir;switch(Rt){case 8:Zf(),k=6;break e;case 3:case 2:case 9:case 6:rr.current===null&&(a=!0);var ie=Rt;if(Rt=0,ir=null,As(n,O,U,ie),s&&ks){k=0;break e}break;default:ie=Rt,Rt=0,ir=null,As(n,O,U,ie)}}oC(),k=rn;break}catch(de){Hy(n,de)}while(!0);return a&&n.shellSuspendCounter++,da=Ni=null,Ct=u,j.H=b,j.A=y,ut===null&&(Pt=null,mt=0,tc()),k}function oC(){for(;ut!==null;)Vy(ut)}function cC(n,a){var s=Ct;Ct|=2;var u=qy(),b=Gy();Pt!==n||mt!==a?(Dc=null,Mc=ot()+500,Ts(n,a)):ks=fe(n,a);e:do try{if(Rt!==0&&ut!==null){a=ut;var y=ir;t:switch(Rt){case 1:Rt=0,ir=null,As(n,a,y,1);break;case 2:case 9:if(rb(y)){Rt=0,ir=null,Yy(a);break}a=function(){Rt!==2&&Rt!==9||Pt!==n||(Rt=7),Vr(n)},y.then(a,a);break e;case 3:Rt=7;break e;case 4:Rt=5;break e;case 7:rb(y)?(Rt=0,ir=null,Yy(a)):(Rt=0,ir=null,As(n,a,y,7));break;case 5:var k=null;switch(ut.tag){case 26:k=ut.memoizedState;case 5:case 27:var O=ut;if(k?D0(k):O.stateNode.complete){Rt=0,ir=null;var U=O.sibling;if(U!==null)ut=U;else{var ie=O.return;ie!==null?(ut=ie,Ic(ie)):ut=null}break t}}Rt=0,ir=null,As(n,a,y,5);break;case 6:Rt=0,ir=null,As(n,a,y,6);break;case 8:Zf(),rn=6;break e;default:throw Error(i(462))}}uC();break}catch(de){Hy(n,de)}while(!0);return da=Ni=null,j.H=u,j.A=b,Ct=s,ut!==null?0:(Pt=null,mt=0,tc(),rn)}function uC(){for(;ut!==null&&!wt();)Vy(ut)}function Vy(n){var a=by(n.alternate,n,wa);n.memoizedProps=n.pendingProps,a===null?Ic(n):ut=a}function Yy(n){var a=n,s=a.alternate;switch(a.tag){case 15:case 0:a=dy(s,a,a.pendingProps,a.type,void 0,mt);break;case 11:a=dy(s,a,a.pendingProps,a.type.render,a.ref,mt);break;case 5:pf(a);default:xy(s,a),a=ut=Gg(a,wa),a=by(s,a,wa)}n.memoizedProps=n.pendingProps,a===null?Ic(n):ut=a}function As(n,a,s,u){da=Ni=null,pf(a),ys=null,Tl=0;var b=a.return;try{if(Zk(n,b,a,s,mt)){rn=1,Sc(n,vr(s,n.current)),ut=null;return}}catch(y){if(b!==null)throw ut=b,y;rn=1,Sc(n,vr(s,n.current)),ut=null;return}a.flags&32768?(bt||u===1?n=!0:ks||(mt&536870912)!==0?n=!1:(Xa=n=!0,(u===2||u===9||u===3||u===6)&&(u=rr.current,u!==null&&u.tag===13&&(u.flags|=16384))),Xy(a,n)):Ic(a)}function Ic(n){var a=n;do{if((a.flags&32768)!==0){Xy(a,Xa);return}n=a.return;var s=tC(a.alternate,a,wa);if(s!==null){ut=s;return}if(a=a.sibling,a!==null){ut=a;return}ut=a=n}while(a!==null);rn===0&&(rn=5)}function Xy(n,a){do{var s=nC(n.alternate,n);if(s!==null){s.flags&=32767,ut=s;return}if(s=n.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!a&&(n=n.sibling,n!==null)){ut=n;return}ut=n=s}while(n!==null);rn=6,ut=null}function Wy(n,a,s,u,b,y,k,O,U){n.cancelPendingCommit=null;do zc();while(bn!==0);if((Ct&6)!==0)throw Error(i(327));if(a!==null){if(a===n.current)throw Error(i(177));if(y=a.lanes|a.childLanes,y|=Ud,ze(n,s,y,k,O,U),n===Pt&&(ut=Pt=null,mt=0),Ns=a,Za=n,Ea=s,Xf=y,Wf=b,By=u,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,pC(_e,function(){return t0(),null})):(n.callbackNode=null,n.callbackPriority=0),u=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||u){u=j.T,j.T=null,b=F.p,F.p=2,k=Ct,Ct|=4;try{rC(n,a,s)}finally{Ct=k,F.p=b,j.T=u}}bn=1,Qy(),Zy(),Jy()}}function Qy(){if(bn===1){bn=0;var n=Za,a=Ns,s=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||s){s=j.T,j.T=null;var u=F.p;F.p=2;var b=Ct;Ct|=4;try{Oy(a,n);var y=dh,k=zg(n.containerInfo),O=y.focusedElem,U=y.selectionRange;if(k!==O&&O&&O.ownerDocument&&Ig(O.ownerDocument.documentElement,O)){if(U!==null&&Ld(O)){var ie=U.start,de=U.end;if(de===void 0&&(de=ie),"selectionStart"in O)O.selectionStart=ie,O.selectionEnd=Math.min(de,O.value.length);else{var me=O.ownerDocument||document,se=me&&me.defaultView||window;if(se.getSelection){var oe=se.getSelection(),Le=O.textContent.length,Ve=Math.min(U.start,Le),Lt=U.end===void 0?Ve:Math.min(U.end,Le);!oe.extend&&Ve>Lt&&(k=Lt,Lt=Ve,Ve=k);var ee=Lg(O,Ve),V=Lg(O,Lt);if(ee&&V&&(oe.rangeCount!==1||oe.anchorNode!==ee.node||oe.anchorOffset!==ee.offset||oe.focusNode!==V.node||oe.focusOffset!==V.offset)){var ae=me.createRange();ae.setStart(ee.node,ee.offset),oe.removeAllRanges(),Ve>Lt?(oe.addRange(ae),oe.extend(V.node,V.offset)):(ae.setEnd(V.node,V.offset),oe.addRange(ae))}}}}for(me=[],oe=O;oe=oe.parentNode;)oe.nodeType===1&&me.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof O.focus=="function"&&O.focus(),O=0;O<me.length;O++){var he=me[O];he.element.scrollLeft=he.left,he.element.scrollTop=he.top}}Xc=!!uh,dh=uh=null}finally{Ct=b,F.p=u,j.T=s}}n.current=a,bn=2}}function Zy(){if(bn===2){bn=0;var n=Za,a=Ns,s=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||s){s=j.T,j.T=null;var u=F.p;F.p=2;var b=Ct;Ct|=4;try{Cy(n,a.alternate,a)}finally{Ct=b,F.p=u,j.T=s}}bn=3}}function Jy(){if(bn===4||bn===3){bn=0,Xt();var n=Za,a=Ns,s=Ea,u=By;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?bn=5:(bn=0,Ns=Za=null,e0(n,n.pendingLanes));var b=n.pendingLanes;if(b===0&&(Qa=null),Rr(s),a=a.stateNode,st&&typeof st.onCommitFiberRoot=="function")try{st.onCommitFiberRoot(tt,a,void 0,(a.current.flags&128)===128)}catch{}if(u!==null){a=j.T,b=F.p,F.p=2,j.T=null;try{for(var y=n.onRecoverableError,k=0;k<u.length;k++){var O=u[k];y(O.value,{componentStack:O.stack})}}finally{j.T=a,F.p=b}}(Ea&3)!==0&&zc(),Vr(n),b=n.pendingLanes,(s&261930)!==0&&(b&42)!==0?n===Qf?ql++:(ql=0,Qf=n):ql=0,Gl(0)}}function e0(n,a){(n.pooledCacheLanes&=a)===0&&(a=n.pooledCache,a!=null&&(n.pooledCache=null,Cl(a)))}function zc(){return Qy(),Zy(),Jy(),t0()}function t0(){if(bn!==5)return!1;var n=Za,a=Xf;Xf=0;var s=Rr(Ea),u=j.T,b=F.p;try{F.p=32>s?32:s,j.T=null,s=Wf,Wf=null;var y=Za,k=Ea;if(bn=0,Ns=Za=null,Ea=0,(Ct&6)!==0)throw Error(i(331));var O=Ct;if(Ct|=4,Iy(y.current),Dy(y,y.current,k,s),Ct=O,Gl(0,!1),st&&typeof st.onPostCommitFiberRoot=="function")try{st.onPostCommitFiberRoot(tt,y)}catch{}return!0}finally{F.p=b,j.T=u,e0(n,a)}}function n0(n,a,s){a=vr(s,a),a=Af(n.stateNode,a,2),n=qa(n,a,2),n!==null&&(Nt(n,2),Vr(n))}function Ot(n,a,s){if(n.tag===3)n0(n,n,s);else for(;a!==null;){if(a.tag===3){n0(a,n,s);break}else if(a.tag===1){var u=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Qa===null||!Qa.has(u))){n=vr(s,n),s=ry(2),u=qa(a,s,2),u!==null&&(ay(s,u,a,n),Nt(u,2),Vr(u));break}}a=a.return}}function eh(n,a,s){var u=n.pingCache;if(u===null){u=n.pingCache=new sC;var b=new Set;u.set(a,b)}else b=u.get(a),b===void 0&&(b=new Set,u.set(a,b));b.has(s)||(Gf=!0,b.add(s),n=dC.bind(null,n,a,s),a.then(n,n))}function dC(n,a,s){var u=n.pingCache;u!==null&&u.delete(a),n.pingedLanes|=n.suspendedLanes&s,n.warmLanes&=~s,Pt===n&&(mt&s)===s&&(rn===4||rn===3&&(mt&62914560)===mt&&300>ot()-Oc?(Ct&2)===0&&Ts(n,0):Vf|=s,Cs===mt&&(Cs=0)),Vr(n)}function r0(n,a){a===0&&(a=We()),n=_i(n,a),n!==null&&(Nt(n,a),Vr(n))}function fC(n){var a=n.memoizedState,s=0;a!==null&&(s=a.retryLane),r0(n,s)}function hC(n,a){var s=0;switch(n.tag){case 31:case 13:var u=n.stateNode,b=n.memoizedState;b!==null&&(s=b.retryLane);break;case 19:u=n.stateNode;break;case 22:u=n.stateNode._retryCache;break;default:throw Error(i(314))}u!==null&&u.delete(a),r0(n,s)}function pC(n,a){return Ne(n,a)}var Pc=null,Rs=null,th=!1,Bc=!1,nh=!1,ei=0;function Vr(n){n!==Rs&&n.next===null&&(Rs===null?Pc=Rs=n:Rs=Rs.next=n),Bc=!0,th||(th=!0,gC())}function Gl(n,a){if(!nh&&Bc){nh=!0;do for(var s=!1,u=Pc;u!==null;){if(n!==0){var b=u.pendingLanes;if(b===0)var y=0;else{var k=u.suspendedLanes,O=u.pingedLanes;y=(1<<31-Ze(42|n)+1)-1,y&=b&~(k&~O),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(s=!0,l0(u,y))}else y=mt,y=$(u,u===Pt?y:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(y&3)===0||fe(u,y)||(s=!0,l0(u,y));u=u.next}while(s);nh=!1}}function mC(){a0()}function a0(){Bc=th=!1;var n=0;ei!==0&&CC()&&(n=ei);for(var a=ot(),s=null,u=Pc;u!==null;){var b=u.next,y=i0(u,a);y===0?(u.next=null,s===null?Pc=b:s.next=b,b===null&&(Rs=s)):(s=u,(n!==0||(y&3)!==0)&&(Bc=!0)),u=b}bn!==0&&bn!==5||Gl(n),ei!==0&&(ei=0)}function i0(n,a){for(var s=n.suspendedLanes,u=n.pingedLanes,b=n.expirationTimes,y=n.pendingLanes&-62914561;0<y;){var k=31-Ze(y),O=1<<k,U=b[k];U===-1?((O&s)===0||(O&u)!==0)&&(b[k]=Ce(O,a)):U<=a&&(n.expiredLanes|=O),y&=~O}if(a=Pt,s=mt,s=$(n,n===a?s:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u=n.callbackNode,s===0||n===a&&(Rt===2||Rt===9)||n.cancelPendingCommit!==null)return u!==null&&u!==null&&De(u),n.callbackNode=null,n.callbackPriority=0;if((s&3)===0||fe(n,s)){if(a=s&-s,a===n.callbackPriority)return a;switch(u!==null&&De(u),Rr(s)){case 2:case 8:s=le;break;case 32:s=_e;break;case 268435456:s=xe;break;default:s=_e}return u=s0.bind(null,n),s=Ne(s,u),n.callbackPriority=a,n.callbackNode=s,a}return u!==null&&u!==null&&De(u),n.callbackPriority=2,n.callbackNode=null,2}function s0(n,a){if(bn!==0&&bn!==5)return n.callbackNode=null,n.callbackPriority=0,null;var s=n.callbackNode;if(zc()&&n.callbackNode!==s)return null;var u=mt;return u=$(n,n===Pt?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u===0?null:(Fy(n,u,a),i0(n,ot()),n.callbackNode!=null&&n.callbackNode===s?s0.bind(null,n):null)}function l0(n,a){if(zc())return null;Fy(n,a,!0)}function gC(){TC(function(){(Ct&6)!==0?Ne(B,mC):a0()})}function rh(){if(ei===0){var n=ms;n===0&&(n=br,br<<=1,(br&261888)===0&&(br=256)),ei=n}return ei}function o0(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:za(""+n)}function c0(n,a){var s=a.ownerDocument.createElement("input");return s.name=a.name,s.value=a.value,n.id&&s.setAttribute("form",n.id),a.parentNode.insertBefore(s,a),n=new FormData(n),s.parentNode.removeChild(s),n}function bC(n,a,s,u,b){if(a==="submit"&&s&&s.stateNode===b){var y=o0((b[en]||null).action),k=u.submitter;k&&(a=(a=k[en]||null)?o0(a.formAction):k.getAttribute("formAction"),a!==null&&(y=a,k=null));var O=new Qo("action","action",null,u,b);n.push({event:O,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(ei!==0){var U=k?c0(b,k):new FormData(b);Sf(s,{pending:!0,data:U,method:b.method,action:y},null,U)}}else typeof y=="function"&&(O.preventDefault(),U=k?c0(b,k):new FormData(b),Sf(s,{pending:!0,data:U,method:b.method,action:y},y,U))},currentTarget:b}]})}}for(var ah=0;ah<Bd.length;ah++){var ih=Bd[ah],yC=ih.toLowerCase(),xC=ih[0].toUpperCase()+ih.slice(1);Or(yC,"on"+xC)}Or(Ug,"onAnimationEnd"),Or(Fg,"onAnimationIteration"),Or($g,"onAnimationStart"),Or("dblclick","onDoubleClick"),Or("focusin","onFocus"),Or("focusout","onBlur"),Or(Lk,"onTransitionRun"),Or(Ik,"onTransitionStart"),Or(zk,"onTransitionCancel"),Or(Hg,"onTransitionEnd"),Ee("onMouseEnter",["mouseout","mouseover"]),Ee("onMouseLeave",["mouseout","mouseover"]),Ee("onPointerEnter",["pointerout","pointerover"]),Ee("onPointerLeave",["pointerout","pointerover"]),sa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),sa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),sa("onBeforeInput",["compositionend","keypress","textInput","paste"]),sa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),sa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),sa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Vl="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(" "),vC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Vl));function u0(n,a){a=(a&4)!==0;for(var s=0;s<n.length;s++){var u=n[s],b=u.event;u=u.listeners;e:{var y=void 0;if(a)for(var k=u.length-1;0<=k;k--){var O=u[k],U=O.instance,ie=O.currentTarget;if(O=O.listener,U!==y&&b.isPropagationStopped())break e;y=O,b.currentTarget=ie;try{y(b)}catch(de){ec(de)}b.currentTarget=null,y=U}else for(k=0;k<u.length;k++){if(O=u[k],U=O.instance,ie=O.currentTarget,O=O.listener,U!==y&&b.isPropagationStopped())break e;y=O,b.currentTarget=ie;try{y(b)}catch(de){ec(de)}b.currentTarget=null,y=U}}}}function dt(n,a){var s=a[cl];s===void 0&&(s=a[cl]=new Set);var u=n+"__bubble";s.has(u)||(d0(a,n,2,!1),s.add(u))}function sh(n,a,s){var u=0;a&&(u|=4),d0(s,n,u,a)}var Uc="_reactListening"+Math.random().toString(36).slice(2);function lh(n){if(!n[Uc]){n[Uc]=!0,Ho.forEach(function(s){s!=="selectionchange"&&(vC.has(s)||sh(s,!1,n),sh(s,!0,n))});var a=n.nodeType===9?n:n.ownerDocument;a===null||a[Uc]||(a[Uc]=!0,sh("selectionchange",!1,a))}}function d0(n,a,s,u){switch(U0(a)){case 2:var b=YC;break;case 8:b=XC;break;default:b=Eh}s=b.bind(null,a,s,n),b=void 0,!Cd||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(b=!0),u?b!==void 0?n.addEventListener(a,s,{capture:!0,passive:b}):n.addEventListener(a,s,!0):b!==void 0?n.addEventListener(a,s,{passive:b}):n.addEventListener(a,s,!1)}function oh(n,a,s,u,b){var y=u;if((a&1)===0&&(a&2)===0&&u!==null)e:for(;;){if(u===null)return;var k=u.tag;if(k===3||k===4){var O=u.stateNode.containerInfo;if(O===b)break;if(k===4)for(k=u.return;k!==null;){var U=k.tag;if((U===3||U===4)&&k.stateNode.containerInfo===b)return;k=k.return}for(;O!==null;){if(k=jn(O),k===null)return;if(U=k.tag,U===5||U===6||U===26||U===27){u=y=k;continue e}O=O.parentNode}}u=u.return}Vo(function(){var ie=y,de=nt(s),me=[];e:{var se=Kg.get(n);if(se!==void 0){var oe=Qo,Le=n;switch(n){case"keypress":if(Xo(s)===0)break e;case"keydown":case"keyup":oe=hk;break;case"focusin":Le="focus",oe=Rd;break;case"focusout":Le="blur",oe=Rd;break;case"beforeblur":case"afterblur":oe=Rd;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":oe=xg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=tk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=gk;break;case Ug:case Fg:case $g:oe=ak;break;case Hg:oe=yk;break;case"scroll":case"scrollend":oe=J_;break;case"wheel":oe=vk;break;case"copy":case"cut":case"paste":oe=sk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=wg;break;case"toggle":case"beforetoggle":oe=Ek}var Ve=(a&4)!==0,Lt=!Ve&&(n==="scroll"||n==="scrollend"),ee=Ve?se!==null?se+"Capture":null:se;Ve=[];for(var V=ie,ae;V!==null;){var he=V;if(ae=he.stateNode,he=he.tag,he!==5&&he!==26&&he!==27||ae===null||ee===null||(he=ml(V,ee),he!=null&&Ve.push(Yl(V,he,ae))),Lt)break;V=V.return}0<Ve.length&&(se=new oe(se,Le,null,s,de),me.push({event:se,listeners:Ve}))}}if((a&7)===0){e:{if(se=n==="mouseover"||n==="pointerover",oe=n==="mouseout"||n==="pointerout",se&&s!==Be&&(Le=s.relatedTarget||s.fromElement)&&(jn(Le)||Le[Da]))break e;if((oe||se)&&(se=de.window===de?de:(se=de.ownerDocument)?se.defaultView||se.parentWindow:window,oe?(Le=s.relatedTarget||s.toElement,oe=ie,Le=Le?jn(Le):null,Le!==null&&(Lt=o(Le),Ve=Le.tag,Le!==Lt||Ve!==5&&Ve!==27&&Ve!==6)&&(Le=null)):(oe=null,Le=ie),oe!==Le)){if(Ve=xg,he="onMouseLeave",ee="onMouseEnter",V="mouse",(n==="pointerout"||n==="pointerover")&&(Ve=wg,he="onPointerLeave",ee="onPointerEnter",V="pointer"),Lt=oe==null?se:ja(oe),ae=Le==null?se:ja(Le),se=new Ve(he,V+"leave",oe,s,de),se.target=Lt,se.relatedTarget=ae,he=null,jn(de)===ie&&(Ve=new Ve(ee,V+"enter",Le,s,de),Ve.target=ae,Ve.relatedTarget=Lt,he=Ve),Lt=he,oe&&Le)t:{for(Ve=wC,ee=oe,V=Le,ae=0,he=ee;he;he=Ve(he))ae++;he=0;for(var He=V;He;He=Ve(He))he++;for(;0<ae-he;)ee=Ve(ee),ae--;for(;0<he-ae;)V=Ve(V),he--;for(;ae--;){if(ee===V||V!==null&&ee===V.alternate){Ve=ee;break t}ee=Ve(ee),V=Ve(V)}Ve=null}else Ve=null;oe!==null&&f0(me,se,oe,Ve,!1),Le!==null&&Lt!==null&&f0(me,Lt,Le,Ve,!0)}}e:{if(se=ie?ja(ie):window,oe=se.nodeName&&se.nodeName.toLowerCase(),oe==="select"||oe==="input"&&se.type==="file")var Et=Ag;else if(Ng(se))if(Rg)Et=Mk;else{Et=Rk;var Ue=Ak}else oe=se.nodeName,!oe||oe.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?ie&&Ia(ie.elementType)&&(Et=Ag):Et=Ok;if(Et&&(Et=Et(n,ie))){Tg(me,Et,s,de);break e}Ue&&Ue(n,se,ie),n==="focusout"&&ie&&se.type==="number"&&ie.memoizedProps.value!=null&&as(se,"number",se.value)}switch(Ue=ie?ja(ie):window,n){case"focusin":(Ng(Ue)||Ue.contentEditable==="true")&&(ls=Ue,Id=ie,Sl=null);break;case"focusout":Sl=Id=ls=null;break;case"mousedown":zd=!0;break;case"contextmenu":case"mouseup":case"dragend":zd=!1,Pg(me,s,de);break;case"selectionchange":if(jk)break;case"keydown":case"keyup":Pg(me,s,de)}var at;if(Md)e:{switch(n){case"compositionstart":var gt="onCompositionStart";break e;case"compositionend":gt="onCompositionEnd";break e;case"compositionupdate":gt="onCompositionUpdate";break e}gt=void 0}else ss?kg(n,s)&&(gt="onCompositionEnd"):n==="keydown"&&s.keyCode===229&&(gt="onCompositionStart");gt&&(Eg&&s.locale!=="ko"&&(ss||gt!=="onCompositionStart"?gt==="onCompositionEnd"&&ss&&(at=bg()):(Pa=de,Nd="value"in Pa?Pa.value:Pa.textContent,ss=!0)),Ue=Fc(ie,gt),0<Ue.length&&(gt=new vg(gt,n,null,s,de),me.push({event:gt,listeners:Ue}),at?gt.data=at:(at=Cg(s),at!==null&&(gt.data=at)))),(at=_k?kk(n,s):Ck(n,s))&&(gt=Fc(ie,"onBeforeInput"),0<gt.length&&(Ue=new vg("onBeforeInput","beforeinput",null,s,de),me.push({event:Ue,listeners:gt}),Ue.data=at)),bC(me,n,ie,s,de)}u0(me,a)})}function Yl(n,a,s){return{instance:n,listener:a,currentTarget:s}}function Fc(n,a){for(var s=a+"Capture",u=[];n!==null;){var b=n,y=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||y===null||(b=ml(n,s),b!=null&&u.unshift(Yl(n,b,y)),b=ml(n,a),b!=null&&u.push(Yl(n,b,y))),n.tag===3)return u;n=n.return}return[]}function wC(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function f0(n,a,s,u,b){for(var y=a._reactName,k=[];s!==null&&s!==u;){var O=s,U=O.alternate,ie=O.stateNode;if(O=O.tag,U!==null&&U===u)break;O!==5&&O!==26&&O!==27||ie===null||(U=ie,b?(ie=ml(s,y),ie!=null&&k.unshift(Yl(s,ie,U))):b||(ie=ml(s,y),ie!=null&&k.push(Yl(s,ie,U)))),s=s.return}k.length!==0&&n.push({event:a,listeners:k})}var EC=/\r\n?/g,SC=/\u0000|\uFFFD/g;function h0(n){return(typeof n=="string"?n:""+n).replace(EC,`
384
- `).replace(SC,"")}function p0(n,a){return a=h0(a),h0(n)===a}function jt(n,a,s,u,b,y){switch(s){case"children":typeof u=="string"?a==="body"||a==="textarea"&&u===""||Qe(n,u):(typeof u=="number"||typeof u=="bigint")&&a!=="body"&&Qe(n,""+u);break;case"className":Jn(n,"class",u);break;case"tabIndex":Jn(n,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":Jn(n,s,u);break;case"style":At(n,u,y);break;case"data":if(a!=="object"){Jn(n,"data",u);break}case"src":case"href":if(u===""&&(a!=="a"||s!=="href")){n.removeAttribute(s);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(s);break}u=za(""+u),n.setAttribute(s,u);break;case"action":case"formAction":if(typeof u=="function"){n.setAttribute(s,"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 y=="function"&&(s==="formAction"?(a!=="input"&&jt(n,a,"name",b.name,b,null),jt(n,a,"formEncType",b.formEncType,b,null),jt(n,a,"formMethod",b.formMethod,b,null),jt(n,a,"formTarget",b.formTarget,b,null)):(jt(n,a,"encType",b.encType,b,null),jt(n,a,"method",b.method,b,null),jt(n,a,"target",b.target,b,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(s);break}u=za(""+u),n.setAttribute(s,u);break;case"onClick":u!=null&&(n.onclick=ke);break;case"onScroll":u!=null&&dt("scroll",n);break;case"onScrollEnd":u!=null&&dt("scrollend",n);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(i(61));if(s=u.__html,s!=null){if(b.children!=null)throw Error(i(60));n.innerHTML=s}}break;case"multiple":n.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":n.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){n.removeAttribute("xlink:href");break}s=za(""+u),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(s,""+u):n.removeAttribute(s);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":u&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(s,""):n.removeAttribute(s);break;case"capture":case"download":u===!0?n.setAttribute(s,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(s,u):n.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?n.setAttribute(s,u):n.removeAttribute(s);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?n.removeAttribute(s):n.setAttribute(s,u);break;case"popover":dt("beforetoggle",n),dt("toggle",n),Tn(n,"popover",u);break;case"xlinkActuate":Fn(n,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Fn(n,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Fn(n,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Fn(n,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Fn(n,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Fn(n,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Fn(n,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Fn(n,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Fn(n,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":Tn(n,"is",u);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=la.get(s)||s,Tn(n,s,u))}}function ch(n,a,s,u,b,y){switch(s){case"style":At(n,u,y);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(i(61));if(s=u.__html,s!=null){if(b.children!=null)throw Error(i(60));n.innerHTML=s}}break;case"children":typeof u=="string"?Qe(n,u):(typeof u=="number"||typeof u=="bigint")&&Qe(n,""+u);break;case"onScroll":u!=null&&dt("scroll",n);break;case"onScrollEnd":u!=null&&dt("scrollend",n);break;case"onClick":u!=null&&(n.onclick=ke);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!xi.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(b=s.endsWith("Capture"),a=s.slice(2,b?s.length-7:void 0),y=n[en]||null,y=y!=null?y[s]:null,typeof y=="function"&&n.removeEventListener(a,y,b),typeof u=="function")){typeof y!="function"&&y!==null&&(s in n?n[s]=null:n.hasAttribute(s)&&n.removeAttribute(s)),n.addEventListener(a,u,b);break e}s in n?n[s]=u:u===!0?n.setAttribute(s,""):Tn(n,s,u)}}}function kn(n,a,s){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":dt("error",n),dt("load",n);var u=!1,b=!1,y;for(y in s)if(s.hasOwnProperty(y)){var k=s[y];if(k!=null)switch(y){case"src":u=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,a));default:jt(n,a,y,k,s,null)}}b&&jt(n,a,"srcSet",s.srcSet,s,null),u&&jt(n,a,"src",s.src,s,null);return;case"input":dt("invalid",n);var O=y=k=b=null,U=null,ie=null;for(u in s)if(s.hasOwnProperty(u)){var de=s[u];if(de!=null)switch(u){case"name":b=de;break;case"type":k=de;break;case"checked":U=de;break;case"defaultChecked":ie=de;break;case"value":y=de;break;case"defaultValue":O=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(i(137,a));break;default:jt(n,a,u,de,s,null)}}vi(n,y,O,U,ie,k,b,!1);return;case"select":dt("invalid",n),u=k=y=null;for(b in s)if(s.hasOwnProperty(b)&&(O=s[b],O!=null))switch(b){case"value":y=O;break;case"defaultValue":k=O;break;case"multiple":u=O;default:jt(n,a,b,O,s,null)}a=y,s=k,n.multiple=!!u,a!=null?wn(n,!!u,a,!1):s!=null&&wn(n,!!u,s,!0);return;case"textarea":dt("invalid",n),y=b=u=null;for(k in s)if(s.hasOwnProperty(k)&&(O=s[k],O!=null))switch(k){case"value":u=O;break;case"defaultValue":b=O;break;case"children":y=O;break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(i(91));break;default:jt(n,a,k,O,s,null)}is(n,u,b,y);return;case"option":for(U in s)if(s.hasOwnProperty(U)&&(u=s[U],u!=null))switch(U){case"selected":n.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:jt(n,a,U,u,s,null)}return;case"dialog":dt("beforetoggle",n),dt("toggle",n),dt("cancel",n),dt("close",n);break;case"iframe":case"object":dt("load",n);break;case"video":case"audio":for(u=0;u<Vl.length;u++)dt(Vl[u],n);break;case"image":dt("error",n),dt("load",n);break;case"details":dt("toggle",n);break;case"embed":case"source":case"link":dt("error",n),dt("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ie in s)if(s.hasOwnProperty(ie)&&(u=s[ie],u!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,a));default:jt(n,a,ie,u,s,null)}return;default:if(Ia(a)){for(de in s)s.hasOwnProperty(de)&&(u=s[de],u!==void 0&&ch(n,a,de,u,s,void 0));return}}for(O in s)s.hasOwnProperty(O)&&(u=s[O],u!=null&&jt(n,a,O,u,s,null))}function _C(n,a,s,u){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,y=null,k=null,O=null,U=null,ie=null,de=null;for(oe in s){var me=s[oe];if(s.hasOwnProperty(oe)&&me!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":U=me;default:u.hasOwnProperty(oe)||jt(n,a,oe,null,u,me)}}for(var se in u){var oe=u[se];if(me=s[se],u.hasOwnProperty(se)&&(oe!=null||me!=null))switch(se){case"type":y=oe;break;case"name":b=oe;break;case"checked":ie=oe;break;case"defaultChecked":de=oe;break;case"value":k=oe;break;case"defaultValue":O=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(i(137,a));break;default:oe!==me&&jt(n,a,se,oe,u,me)}}fl(n,k,O,U,ie,de,y,b);return;case"select":oe=k=O=se=null;for(y in s)if(U=s[y],s.hasOwnProperty(y)&&U!=null)switch(y){case"value":break;case"multiple":oe=U;default:u.hasOwnProperty(y)||jt(n,a,y,null,u,U)}for(b in u)if(y=u[b],U=s[b],u.hasOwnProperty(b)&&(y!=null||U!=null))switch(b){case"value":se=y;break;case"defaultValue":O=y;break;case"multiple":k=y;default:y!==U&&jt(n,a,b,y,u,U)}a=O,s=k,u=oe,se!=null?wn(n,!!s,se,!1):!!u!=!!s&&(a!=null?wn(n,!!s,a,!0):wn(n,!!s,s?[]:"",!1));return;case"textarea":oe=se=null;for(O in s)if(b=s[O],s.hasOwnProperty(O)&&b!=null&&!u.hasOwnProperty(O))switch(O){case"value":break;case"children":break;default:jt(n,a,O,null,u,b)}for(k in u)if(b=u[k],y=s[k],u.hasOwnProperty(k)&&(b!=null||y!=null))switch(k){case"value":se=b;break;case"defaultValue":oe=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(i(91));break;default:b!==y&&jt(n,a,k,b,u,y)}qo(n,se,oe);return;case"option":for(var Le in s)if(se=s[Le],s.hasOwnProperty(Le)&&se!=null&&!u.hasOwnProperty(Le))switch(Le){case"selected":n.selected=!1;break;default:jt(n,a,Le,null,u,se)}for(U in u)if(se=u[U],oe=s[U],u.hasOwnProperty(U)&&se!==oe&&(se!=null||oe!=null))switch(U){case"selected":n.selected=se&&typeof se!="function"&&typeof se!="symbol";break;default:jt(n,a,U,se,u,oe)}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 Ve in s)se=s[Ve],s.hasOwnProperty(Ve)&&se!=null&&!u.hasOwnProperty(Ve)&&jt(n,a,Ve,null,u,se);for(ie in u)if(se=u[ie],oe=s[ie],u.hasOwnProperty(ie)&&se!==oe&&(se!=null||oe!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(i(137,a));break;default:jt(n,a,ie,se,u,oe)}return;default:if(Ia(a)){for(var Lt in s)se=s[Lt],s.hasOwnProperty(Lt)&&se!==void 0&&!u.hasOwnProperty(Lt)&&ch(n,a,Lt,void 0,u,se);for(de in u)se=u[de],oe=s[de],!u.hasOwnProperty(de)||se===oe||se===void 0&&oe===void 0||ch(n,a,de,se,u,oe);return}}for(var ee in s)se=s[ee],s.hasOwnProperty(ee)&&se!=null&&!u.hasOwnProperty(ee)&&jt(n,a,ee,null,u,se);for(me in u)se=u[me],oe=s[me],!u.hasOwnProperty(me)||se===oe||se==null&&oe==null||jt(n,a,me,se,u,oe)}function m0(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function kC(){if(typeof performance.getEntriesByType=="function"){for(var n=0,a=0,s=performance.getEntriesByType("resource"),u=0;u<s.length;u++){var b=s[u],y=b.transferSize,k=b.initiatorType,O=b.duration;if(y&&O&&m0(k)){for(k=0,O=b.responseEnd,u+=1;u<s.length;u++){var U=s[u],ie=U.startTime;if(ie>O)break;var de=U.transferSize,me=U.initiatorType;de&&m0(me)&&(U=U.responseEnd,k+=de*(U<O?1:(O-ie)/(U-ie)))}if(--u,a+=8*(y+k)/(b.duration/1e3),n++,10<n)break}}if(0<n)return a/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var uh=null,dh=null;function $c(n){return n.nodeType===9?n:n.ownerDocument}function g0(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function b0(n,a){if(n===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&a==="foreignObject"?0:n}function fh(n,a){return n==="textarea"||n==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var hh=null;function CC(){var n=window.event;return n&&n.type==="popstate"?n===hh?!1:(hh=n,!0):(hh=null,!1)}var y0=typeof setTimeout=="function"?setTimeout:void 0,NC=typeof clearTimeout=="function"?clearTimeout:void 0,x0=typeof Promise=="function"?Promise:void 0,TC=typeof queueMicrotask=="function"?queueMicrotask:typeof x0<"u"?function(n){return x0.resolve(null).then(n).catch(AC)}:y0;function AC(n){setTimeout(function(){throw n})}function ti(n){return n==="head"}function v0(n,a){var s=a,u=0;do{var b=s.nextSibling;if(n.removeChild(s),b&&b.nodeType===8)if(s=b.data,s==="/$"||s==="/&"){if(u===0){n.removeChild(b),js(a);return}u--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")u++;else if(s==="html")Xl(n.ownerDocument.documentElement);else if(s==="head"){s=n.ownerDocument.head,Xl(s);for(var y=s.firstChild;y;){var k=y.nextSibling,O=y.nodeName;y[yi]||O==="SCRIPT"||O==="STYLE"||O==="LINK"&&y.rel.toLowerCase()==="stylesheet"||s.removeChild(y),y=k}}else s==="body"&&Xl(n.ownerDocument.body);s=b}while(s);js(a)}function w0(n,a){var s=n;n=0;do{var u=s.nextSibling;if(s.nodeType===1?a?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(a?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),u&&u.nodeType===8)if(s=u.data,s==="/$"){if(n===0)break;n--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||n++;s=u}while(s)}function ph(n){var a=n.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var s=a;switch(a=a.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":ph(s),ul(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}n.removeChild(s)}}function RC(n,a,s,u){for(;n.nodeType===1;){var b=s;if(n.nodeName.toLowerCase()!==a.toLowerCase()){if(!u&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(u){if(!n[yi])switch(a){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(y=n.getAttribute("rel"),y==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(y!==b.rel||n.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||n.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||n.getAttribute("title")!==(b.title==null?null:b.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(y=n.getAttribute("src"),(y!==(b.src==null?null:b.src)||n.getAttribute("type")!==(b.type==null?null:b.type)||n.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&y&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(a==="input"&&n.type==="hidden"){var y=b.name==null?null:""+b.name;if(b.type==="hidden"&&n.getAttribute("name")===y)return n}else return n;if(n=kr(n.nextSibling),n===null)break}return null}function OC(n,a,s){if(a==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!s||(n=kr(n.nextSibling),n===null))return null;return n}function E0(n,a){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!a||(n=kr(n.nextSibling),n===null))return null;return n}function mh(n){return n.data==="$?"||n.data==="$~"}function gh(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function MC(n,a){var s=n.ownerDocument;if(n.data==="$~")n._reactRetry=a;else if(n.data!=="$?"||s.readyState!=="loading")a();else{var u=function(){a(),s.removeEventListener("DOMContentLoaded",u)};s.addEventListener("DOMContentLoaded",u),n._reactRetry=u}}function kr(n){for(;n!=null;n=n.nextSibling){var a=n.nodeType;if(a===1||a===3)break;if(a===8){if(a=n.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return n}var bh=null;function S0(n){n=n.nextSibling;for(var a=0;n;){if(n.nodeType===8){var s=n.data;if(s==="/$"||s==="/&"){if(a===0)return kr(n.nextSibling);a--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||a++}n=n.nextSibling}return null}function _0(n){n=n.previousSibling;for(var a=0;n;){if(n.nodeType===8){var s=n.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(a===0)return n;a--}else s!=="/$"&&s!=="/&"||a++}n=n.previousSibling}return null}function k0(n,a,s){switch(a=$c(s),n){case"html":if(n=a.documentElement,!n)throw Error(i(452));return n;case"head":if(n=a.head,!n)throw Error(i(453));return n;case"body":if(n=a.body,!n)throw Error(i(454));return n;default:throw Error(i(451))}}function Xl(n){for(var a=n.attributes;a.length;)n.removeAttributeNode(a[0]);ul(n)}var Cr=new Map,C0=new Set;function Hc(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Sa=F.d;F.d={f:DC,r:jC,D:LC,C:IC,L:zC,m:PC,X:UC,S:BC,M:FC};function DC(){var n=Sa.f(),a=jc();return n||a}function jC(n){var a=ia(n);a!==null&&a.tag===5&&a.type==="form"?Hb(a):Sa.r(n)}var Os=typeof document>"u"?null:document;function N0(n,a,s){var u=Os;if(u&&typeof a=="string"&&a){var b=$n(a);b='link[rel="'+n+'"][href="'+b+'"]',typeof s=="string"&&(b+='[crossorigin="'+s+'"]'),C0.has(b)||(C0.add(b),n={rel:n,crossOrigin:s,href:a},u.querySelector(b)===null&&(a=u.createElement("link"),kn(a,"link",n),un(a),u.head.appendChild(a)))}}function LC(n){Sa.D(n),N0("dns-prefetch",n,null)}function IC(n,a){Sa.C(n,a),N0("preconnect",n,a)}function zC(n,a,s){Sa.L(n,a,s);var u=Os;if(u&&n&&a){var b='link[rel="preload"][as="'+$n(a)+'"]';a==="image"&&s&&s.imageSrcSet?(b+='[imagesrcset="'+$n(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(b+='[imagesizes="'+$n(s.imageSizes)+'"]')):b+='[href="'+$n(n)+'"]';var y=b;switch(a){case"style":y=Ms(n);break;case"script":y=Ds(n)}Cr.has(y)||(n=m({rel:"preload",href:a==="image"&&s&&s.imageSrcSet?void 0:n,as:a},s),Cr.set(y,n),u.querySelector(b)!==null||a==="style"&&u.querySelector(Wl(y))||a==="script"&&u.querySelector(Ql(y))||(a=u.createElement("link"),kn(a,"link",n),un(a),u.head.appendChild(a)))}}function PC(n,a){Sa.m(n,a);var s=Os;if(s&&n){var u=a&&typeof a.as=="string"?a.as:"script",b='link[rel="modulepreload"][as="'+$n(u)+'"][href="'+$n(n)+'"]',y=b;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Ds(n)}if(!Cr.has(y)&&(n=m({rel:"modulepreload",href:n},a),Cr.set(y,n),s.querySelector(b)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Ql(y)))return}u=s.createElement("link"),kn(u,"link",n),un(u),s.head.appendChild(u)}}}function BC(n,a,s){Sa.S(n,a,s);var u=Os;if(u&&n){var b=La(u).hoistableStyles,y=Ms(n);a=a||"default";var k=b.get(y);if(!k){var O={loading:0,preload:null};if(k=u.querySelector(Wl(y)))O.loading=5;else{n=m({rel:"stylesheet",href:n,"data-precedence":a},s),(s=Cr.get(y))&&yh(n,s);var U=k=u.createElement("link");un(U),kn(U,"link",n),U._p=new Promise(function(ie,de){U.onload=ie,U.onerror=de}),U.addEventListener("load",function(){O.loading|=1}),U.addEventListener("error",function(){O.loading|=2}),O.loading|=4,Kc(k,a,u)}k={type:"stylesheet",instance:k,count:1,state:O},b.set(y,k)}}}function UC(n,a){Sa.X(n,a);var s=Os;if(s&&n){var u=La(s).hoistableScripts,b=Ds(n),y=u.get(b);y||(y=s.querySelector(Ql(b)),y||(n=m({src:n,async:!0},a),(a=Cr.get(b))&&xh(n,a),y=s.createElement("script"),un(y),kn(y,"link",n),s.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},u.set(b,y))}}function FC(n,a){Sa.M(n,a);var s=Os;if(s&&n){var u=La(s).hoistableScripts,b=Ds(n),y=u.get(b);y||(y=s.querySelector(Ql(b)),y||(n=m({src:n,async:!0,type:"module"},a),(a=Cr.get(b))&&xh(n,a),y=s.createElement("script"),un(y),kn(y,"link",n),s.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},u.set(b,y))}}function T0(n,a,s,u){var b=(b=pe.current)?Hc(b):null;if(!b)throw Error(i(446));switch(n){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(a=Ms(s.href),s=La(b).hoistableStyles,u=s.get(a),u||(u={type:"style",instance:null,count:0,state:null},s.set(a,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){n=Ms(s.href);var y=La(b).hoistableStyles,k=y.get(n);if(k||(b=b.ownerDocument||b,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(n,k),(y=b.querySelector(Wl(n)))&&!y._p&&(k.instance=y,k.state.loading=5),Cr.has(n)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Cr.set(n,s),y||$C(b,n,s,k.state))),a&&u===null)throw Error(i(528,""));return k}if(a&&u!==null)throw Error(i(529,""));return null;case"script":return a=s.async,s=s.src,typeof s=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=Ds(s),s=La(b).hoistableScripts,u=s.get(a),u||(u={type:"script",instance:null,count:0,state:null},s.set(a,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,n))}}function Ms(n){return'href="'+$n(n)+'"'}function Wl(n){return'link[rel="stylesheet"]['+n+"]"}function A0(n){return m({},n,{"data-precedence":n.precedence,precedence:null})}function $C(n,a,s,u){n.querySelector('link[rel="preload"][as="style"]['+a+"]")?u.loading=1:(a=n.createElement("link"),u.preload=a,a.addEventListener("load",function(){return u.loading|=1}),a.addEventListener("error",function(){return u.loading|=2}),kn(a,"link",s),un(a),n.head.appendChild(a))}function Ds(n){return'[src="'+$n(n)+'"]'}function Ql(n){return"script[async]"+n}function R0(n,a,s){if(a.count++,a.instance===null)switch(a.type){case"style":var u=n.querySelector('style[data-href~="'+$n(s.href)+'"]');if(u)return a.instance=u,un(u),u;var b=m({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return u=(n.ownerDocument||n).createElement("style"),un(u),kn(u,"style",b),Kc(u,s.precedence,n),a.instance=u;case"stylesheet":b=Ms(s.href);var y=n.querySelector(Wl(b));if(y)return a.state.loading|=4,a.instance=y,un(y),y;u=A0(s),(b=Cr.get(b))&&yh(u,b),y=(n.ownerDocument||n).createElement("link"),un(y);var k=y;return k._p=new Promise(function(O,U){k.onload=O,k.onerror=U}),kn(y,"link",u),a.state.loading|=4,Kc(y,s.precedence,n),a.instance=y;case"script":return y=Ds(s.src),(b=n.querySelector(Ql(y)))?(a.instance=b,un(b),b):(u=s,(b=Cr.get(y))&&(u=m({},s),xh(u,b)),n=n.ownerDocument||n,b=n.createElement("script"),un(b),kn(b,"link",u),n.head.appendChild(b),a.instance=b);case"void":return null;default:throw Error(i(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(u=a.instance,a.state.loading|=4,Kc(u,s.precedence,n));return a.instance}function Kc(n,a,s){for(var u=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=u.length?u[u.length-1]:null,y=b,k=0;k<u.length;k++){var O=u[k];if(O.dataset.precedence===a)y=O;else if(y!==b)break}y?y.parentNode.insertBefore(n,y.nextSibling):(a=s.nodeType===9?s.head:s,a.insertBefore(n,a.firstChild))}function yh(n,a){n.crossOrigin==null&&(n.crossOrigin=a.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=a.referrerPolicy),n.title==null&&(n.title=a.title)}function xh(n,a){n.crossOrigin==null&&(n.crossOrigin=a.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=a.referrerPolicy),n.integrity==null&&(n.integrity=a.integrity)}var qc=null;function O0(n,a,s){if(qc===null){var u=new Map,b=qc=new Map;b.set(s,u)}else b=qc,u=b.get(s),u||(u=new Map,b.set(s,u));if(u.has(n))return u;for(u.set(n,null),s=s.getElementsByTagName(n),b=0;b<s.length;b++){var y=s[b];if(!(y[yi]||y[qt]||n==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var k=y.getAttribute(a)||"";k=n+k;var O=u.get(k);O?O.push(y):u.set(k,[y])}}return u}function M0(n,a,s){n=n.ownerDocument||n,n.head.insertBefore(s,a==="title"?n.querySelector("head > title"):null)}function HC(n,a,s){if(s===1||a.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return n=a.disabled,typeof a.precedence=="string"&&n==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function D0(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function KC(n,a,s,u){if(s.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var b=Ms(u.href),y=a.querySelector(Wl(b));if(y){a=y._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(n.count++,n=Gc.bind(n),a.then(n,n)),s.state.loading|=4,s.instance=y,un(y);return}y=a.ownerDocument||a,u=A0(u),(b=Cr.get(b))&&yh(u,b),y=y.createElement("link"),un(y);var k=y;k._p=new Promise(function(O,U){k.onload=O,k.onerror=U}),kn(y,"link",u),s.instance=y}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(s,a),(a=s.state.preload)&&(s.state.loading&3)===0&&(n.count++,s=Gc.bind(n),a.addEventListener("load",s),a.addEventListener("error",s))}}var vh=0;function qC(n,a){return n.stylesheets&&n.count===0&&Yc(n,n.stylesheets),0<n.count||0<n.imgCount?function(s){var u=setTimeout(function(){if(n.stylesheets&&Yc(n,n.stylesheets),n.unsuspend){var y=n.unsuspend;n.unsuspend=null,y()}},6e4+a);0<n.imgBytes&&vh===0&&(vh=62500*kC());var b=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Yc(n,n.stylesheets),n.unsuspend)){var y=n.unsuspend;n.unsuspend=null,y()}},(n.imgBytes>vh?50:800)+a);return n.unsuspend=s,function(){n.unsuspend=null,clearTimeout(u),clearTimeout(b)}}:null}function Gc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Yc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Vc=null;function Yc(n,a){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Vc=new Map,a.forEach(GC,n),Vc=null,Gc.call(n))}function GC(n,a){if(!(a.state.loading&4)){var s=Vc.get(n);if(s)var u=s.get(null);else{s=new Map,Vc.set(n,s);for(var b=n.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<b.length;y++){var k=b[y];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(s.set(k.dataset.precedence,k),u=k)}u&&s.set(null,u)}b=a.instance,k=b.getAttribute("data-precedence"),y=s.get(k)||u,y===u&&s.set(null,b),s.set(k,b),this.count++,u=Gc.bind(this),b.addEventListener("load",u),b.addEventListener("error",u),y?y.parentNode.insertBefore(b,y.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(b,n.firstChild)),a.state.loading|=4}}var Zl={$$typeof:T,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function VC(n,a,s,u,b,y,k,O,U){this.tag=1,this.containerInfo=n,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=Mt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Mt(0),this.hiddenUpdates=Mt(null),this.identifierPrefix=u,this.onUncaughtError=b,this.onCaughtError=y,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=U,this.incompleteTransitions=new Map}function j0(n,a,s,u,b,y,k,O,U,ie,de,me){return n=new VC(n,a,s,k,U,ie,de,me,O),a=1,y===!0&&(a|=24),y=nr(3,null,null,a),n.current=y,y.stateNode=n,a=Zd(),a.refCount++,n.pooledCache=a,a.refCount++,y.memoizedState={element:u,isDehydrated:s,cache:a},nf(y),n}function L0(n){return n?(n=us,n):us}function I0(n,a,s,u,b,y){b=L0(b),u.context===null?u.context=b:u.pendingContext=b,u=Ka(a),u.payload={element:s},y=y===void 0?null:y,y!==null&&(u.callback=y),s=qa(n,u,a),s!==null&&(Yn(s,n,a),Rl(s,n,a))}function z0(n,a){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var s=n.retryLane;n.retryLane=s!==0&&s<a?s:a}}function wh(n,a){z0(n,a),(n=n.alternate)&&z0(n,a)}function P0(n){if(n.tag===13||n.tag===31){var a=_i(n,67108864);a!==null&&Yn(a,n,67108864),wh(n,67108864)}}function B0(n){if(n.tag===13||n.tag===31){var a=lr();a=Ut(a);var s=_i(n,a);s!==null&&Yn(s,n,a),wh(n,a)}}var Xc=!0;function YC(n,a,s,u){var b=j.T;j.T=null;var y=F.p;try{F.p=2,Eh(n,a,s,u)}finally{F.p=y,j.T=b}}function XC(n,a,s,u){var b=j.T;j.T=null;var y=F.p;try{F.p=8,Eh(n,a,s,u)}finally{F.p=y,j.T=b}}function Eh(n,a,s,u){if(Xc){var b=Sh(u);if(b===null)oh(n,a,u,Wc,s),F0(n,u);else if(QC(b,n,a,s,u))u.stopPropagation();else if(F0(n,u),a&4&&-1<WC.indexOf(n)){for(;b!==null;){var y=ia(b);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var k=Nn(y.pendingLanes);if(k!==0){var O=y;for(O.pendingLanes|=2,O.entangledLanes|=2;k;){var U=1<<31-Ze(k);O.entanglements[1]|=U,k&=~U}Vr(y),(Ct&6)===0&&(Mc=ot()+500,Gl(0))}}break;case 31:case 13:O=_i(y,2),O!==null&&Yn(O,y,2),jc(),wh(y,2)}if(y=Sh(u),y===null&&oh(n,a,u,Wc,s),y===b)break;b=y}b!==null&&u.stopPropagation()}else oh(n,a,u,null,s)}}function Sh(n){return n=nt(n),_h(n)}var Wc=null;function _h(n){if(Wc=null,n=jn(n),n!==null){var a=o(n);if(a===null)n=null;else{var s=a.tag;if(s===13){if(n=c(a),n!==null)return n;n=null}else if(s===31){if(n=d(a),n!==null)return n;n=null}else if(s===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;n=null}else a!==n&&(n=null)}}return Wc=n,null}function U0(n){switch(n){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(Zt()){case B:return 2;case le:return 8;case _e:case re:return 32;case xe:return 268435456;default:return 32}default:return 32}}var kh=!1,ni=null,ri=null,ai=null,Jl=new Map,eo=new Map,ii=[],WC="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 F0(n,a){switch(n){case"focusin":case"focusout":ni=null;break;case"dragenter":case"dragleave":ri=null;break;case"mouseover":case"mouseout":ai=null;break;case"pointerover":case"pointerout":Jl.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":eo.delete(a.pointerId)}}function to(n,a,s,u,b,y){return n===null||n.nativeEvent!==y?(n={blockedOn:a,domEventName:s,eventSystemFlags:u,nativeEvent:y,targetContainers:[b]},a!==null&&(a=ia(a),a!==null&&P0(a)),n):(n.eventSystemFlags|=u,a=n.targetContainers,b!==null&&a.indexOf(b)===-1&&a.push(b),n)}function QC(n,a,s,u,b){switch(a){case"focusin":return ni=to(ni,n,a,s,u,b),!0;case"dragenter":return ri=to(ri,n,a,s,u,b),!0;case"mouseover":return ai=to(ai,n,a,s,u,b),!0;case"pointerover":var y=b.pointerId;return Jl.set(y,to(Jl.get(y)||null,n,a,s,u,b)),!0;case"gotpointercapture":return y=b.pointerId,eo.set(y,to(eo.get(y)||null,n,a,s,u,b)),!0}return!1}function $0(n){var a=jn(n.target);if(a!==null){var s=o(a);if(s!==null){if(a=s.tag,a===13){if(a=c(s),a!==null){n.blockedOn=a,Zn(n.priority,function(){B0(s)});return}}else if(a===31){if(a=d(s),a!==null){n.blockedOn=a,Zn(n.priority,function(){B0(s)});return}}else if(a===3&&s.stateNode.current.memoizedState.isDehydrated){n.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Qc(n){if(n.blockedOn!==null)return!1;for(var a=n.targetContainers;0<a.length;){var s=Sh(n.nativeEvent);if(s===null){s=n.nativeEvent;var u=new s.constructor(s.type,s);Be=u,s.target.dispatchEvent(u),Be=null}else return a=ia(s),a!==null&&P0(a),n.blockedOn=s,!1;a.shift()}return!0}function H0(n,a,s){Qc(n)&&s.delete(a)}function ZC(){kh=!1,ni!==null&&Qc(ni)&&(ni=null),ri!==null&&Qc(ri)&&(ri=null),ai!==null&&Qc(ai)&&(ai=null),Jl.forEach(H0),eo.forEach(H0)}function Zc(n,a){n.blockedOn===a&&(n.blockedOn=null,kh||(kh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,ZC)))}var Jc=null;function K0(n){Jc!==n&&(Jc=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Jc===n&&(Jc=null);for(var a=0;a<n.length;a+=3){var s=n[a],u=n[a+1],b=n[a+2];if(typeof u!="function"){if(_h(u||s)===null)continue;break}var y=ia(s);y!==null&&(n.splice(a,3),a-=3,Sf(y,{pending:!0,data:b,method:s.method,action:u},u,b))}}))}function js(n){function a(U){return Zc(U,n)}ni!==null&&Zc(ni,n),ri!==null&&Zc(ri,n),ai!==null&&Zc(ai,n),Jl.forEach(a),eo.forEach(a);for(var s=0;s<ii.length;s++){var u=ii[s];u.blockedOn===n&&(u.blockedOn=null)}for(;0<ii.length&&(s=ii[0],s.blockedOn===null);)$0(s),s.blockedOn===null&&ii.shift();if(s=(n.ownerDocument||n).$$reactFormReplay,s!=null)for(u=0;u<s.length;u+=3){var b=s[u],y=s[u+1],k=b[en]||null;if(typeof y=="function")k||K0(s);else if(k){var O=null;if(y&&y.hasAttribute("formAction")){if(b=y,k=y[en]||null)O=k.formAction;else if(_h(b)!==null)continue}else O=k.action;typeof O=="function"?s[u+1]=O:(s.splice(u,3),u-=3),K0(s)}}}function q0(){function n(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(k){return b=k})},focusReset:"manual",scroll:"manual"})}function a(){b!==null&&(b(),b=null),u||setTimeout(s,20)}function s(){if(!u&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,b=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(s,100),function(){u=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),b!==null&&(b(),b=null)}}}function Ch(n){this._internalRoot=n}eu.prototype.render=Ch.prototype.render=function(n){var a=this._internalRoot;if(a===null)throw Error(i(409));var s=a.current,u=lr();I0(s,u,n,a,null,null)},eu.prototype.unmount=Ch.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var a=n.containerInfo;I0(n.current,2,null,n,null,null),jc(),a[Da]=null}};function eu(n){this._internalRoot=n}eu.prototype.unstable_scheduleHydration=function(n){if(n){var a=Ma();n={blockedOn:null,target:n,priority:a};for(var s=0;s<ii.length&&a!==0&&a<ii[s].priority;s++);ii.splice(s,0,n),s===0&&$0(n)}};var G0=t.version;if(G0!=="19.2.5")throw Error(i(527,G0,"19.2.5"));F.findDOMNode=function(n){var a=n._reactInternals;if(a===void 0)throw typeof n.render=="function"?Error(i(188)):(n=Object.keys(n).join(","),Error(i(268,n)));return n=h(a),n=n!==null?g(n):null,n=n===null?null:n.stateNode,n};var JC={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var tu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tu.isDisabled&&tu.supportsFiber)try{tt=tu.inject(JC),st=tu}catch{}}return ro.createRoot=function(n,a){if(!l(n))throw Error(i(299));var s=!1,u="",b=Jb,y=ey,k=ty;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(u=a.identifierPrefix),a.onUncaughtError!==void 0&&(b=a.onUncaughtError),a.onCaughtError!==void 0&&(y=a.onCaughtError),a.onRecoverableError!==void 0&&(k=a.onRecoverableError)),a=j0(n,1,!1,null,null,s,u,null,b,y,k,q0),n[Da]=a.current,lh(n),new Ch(a)},ro.hydrateRoot=function(n,a,s){if(!l(n))throw Error(i(299));var u=!1,b="",y=Jb,k=ey,O=ty,U=null;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(b=s.identifierPrefix),s.onUncaughtError!==void 0&&(y=s.onUncaughtError),s.onCaughtError!==void 0&&(k=s.onCaughtError),s.onRecoverableError!==void 0&&(O=s.onRecoverableError),s.formState!==void 0&&(U=s.formState)),a=j0(n,1,!0,a,s??null,u,b,U,y,k,O,q0),a.context=L0(null),s=a.current,u=lr(),u=Ut(u),b=Ka(u),b.callback=null,qa(s,b,u),s=u,a.current.lanes=s,Nt(a,s),Vr(a),n[Da]=a.current,lh(n),new eu(a)},ro.version="19.2.5",ro}var sx;function X2(){if(sx)return Rh.exports;sx=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Rh.exports=Y2(),Rh.exports}var W2=X2();const Q2=tl(W2);/**
385
- * react-router v7.14.2
386
- *
387
- * Copyright (c) Remix Software Inc.
388
- *
389
- * This source code is licensed under the MIT license found in the
390
- * LICENSE.md file in the root directory of this source tree.
391
- *
392
- * @license MIT
393
- */var lx="popstate";function ox(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Z2(e={}){function t(l,o){let{pathname:c="/",search:d="",hash:f=""}=Wi(l.location.hash.substring(1));return!c.startsWith("/")&&!c.startsWith(".")&&(c="/"+c),Tp("",{pathname:c,search:d,hash:f},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function r(l,o){let c=l.document.querySelector("base"),d="";if(c&&c.getAttribute("href")){let f=l.location.href,h=f.indexOf("#");d=h===-1?f:f.slice(0,h)}return d+"#"+(typeof o=="string"?o:Eo(o))}function i(l,o){hr(l.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(o)})`)}return eT(t,r,i,e)}function Qt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function hr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function J2(){return Math.random().toString(36).substring(2,10)}function cx(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Tp(e,t,r=null,i,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Wi(t):t,state:r,key:t&&t.key||i||J2(),unstable_mask:l}}function Eo({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Wi(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let i=e.indexOf("?");i>=0&&(t.search=e.substring(i),e=e.substring(0,i)),e&&(t.pathname=e)}return t}function eT(e,t,r,i={}){let{window:l=document.defaultView,v5Compat:o=!1}=i,c=l.history,d="POP",f=null,h=g();h==null&&(h=0,c.replaceState({...c.state,idx:h},""));function g(){return(c.state||{idx:null}).idx}function m(){d="POP";let _=g(),C=_==null?null:_-h;h=_,f&&f({action:d,location:S.location,delta:C})}function x(_,C){d="PUSH";let A=ox(_)?_:Tp(S.location,_,C);r&&r(A,_),h=g()+1;let T=cx(A,h),M=S.createHref(A.unstable_mask||A);try{c.pushState(T,"",M)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;l.location.assign(M)}o&&f&&f({action:d,location:S.location,delta:1})}function v(_,C){d="REPLACE";let A=ox(_)?_:Tp(S.location,_,C);r&&r(A,_),h=g();let T=cx(A,h),M=S.createHref(A.unstable_mask||A);c.replaceState(T,"",M),o&&f&&f({action:d,location:S.location,delta:0})}function E(_){return tT(_)}let S={get action(){return d},get location(){return e(l,c)},listen(_){if(f)throw new Error("A history only accepts one active listener");return l.addEventListener(lx,m),f=_,()=>{l.removeEventListener(lx,m),f=null}},createHref(_){return t(l,_)},createURL:E,encodeLocation(_){let C=E(_);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:x,replace:v,go(_){return c.go(_)}};return S}function tT(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),Qt(r,"No window.location.(origin|href) available to create URL");let i=typeof e=="string"?e:Eo(e);return i=i.replace(/ $/,"%20"),!t&&i.startsWith("//")&&(i=r+i),new URL(i,r)}function Uw(e,t,r="/"){return nT(e,t,r,!1)}function nT(e,t,r,i){let l=typeof t=="string"?Wi(t):t,o=Na(l.pathname||"/",r);if(o==null)return null;let c=Fw(e);rT(c);let d=null;for(let f=0;d==null&&f<c.length;++f){let h=pT(o);d=fT(c[f],h,i)}return d}function Fw(e,t=[],r=[],i="",l=!1){let o=(c,d,f=l,h)=>{let g={relativePath:h===void 0?c.path||"":h,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(i)&&f)return;Qt(g.relativePath.startsWith(i),`Absolute route path "${g.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(i.length)}let m=Ir([i,g.relativePath]),x=r.concat(g);c.children&&c.children.length>0&&(Qt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),Fw(c.children,t,x,m,f)),!(c.path==null&&!c.index)&&t.push({path:m,score:uT(m,c.index),routesMeta:x})};return e.forEach((c,d)=>{var f;if(c.path===""||!((f=c.path)!=null&&f.includes("?")))o(c,d);else for(let h of $w(c.path))o(c,d,!0,h)}),t}function $w(e){let t=e.split("/");if(t.length===0)return[];let[r,...i]=t,l=r.endsWith("?"),o=r.replace(/\?$/,"");if(i.length===0)return l?[o,""]:[o];let c=$w(i.join("/")),d=[];return d.push(...c.map(f=>f===""?o:[o,f].join("/"))),l&&d.push(...c),d.map(f=>e.startsWith("/")&&f===""?"/":f)}function rT(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:dT(t.routesMeta.map(i=>i.childrenIndex),r.routesMeta.map(i=>i.childrenIndex)))}var aT=/^:[\w-]+$/,iT=3,sT=2,lT=1,oT=10,cT=-2,ux=e=>e==="*";function uT(e,t){let r=e.split("/"),i=r.length;return r.some(ux)&&(i+=cT),t&&(i+=sT),r.filter(l=>!ux(l)).reduce((l,o)=>l+(aT.test(o)?iT:o===""?lT:oT),i)}function dT(e,t){return e.length===t.length&&e.slice(0,-1).every((i,l)=>i===t[l])?e[e.length-1]-t[t.length-1]:0}function fT(e,t,r=!1){let{routesMeta:i}=e,l={},o="/",c=[];for(let d=0;d<i.length;++d){let f=i[d],h=d===i.length-1,g=o==="/"?t:t.slice(o.length)||"/",m=Tu({path:f.relativePath,caseSensitive:f.caseSensitive,end:h},g),x=f.route;if(!m&&h&&r&&!i[i.length-1].route.index&&(m=Tu({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},g)),!m)return null;Object.assign(l,m.params),c.push({params:l,pathname:Ir([o,m.pathname]),pathnameBase:yT(Ir([o,m.pathnameBase])),route:x}),m.pathnameBase!=="/"&&(o=Ir([o,m.pathnameBase]))}return c}function Tu(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,i]=hT(e.path,e.caseSensitive,e.end),l=t.match(r);if(!l)return null;let o=l[0],c=o.replace(/(.)\/+$/,"$1"),d=l.slice(1);return{params:i.reduce((h,{paramName:g,isOptional:m},x)=>{if(g==="*"){let E=d[x]||"";c=o.slice(0,o.length-E.length).replace(/(.)\/+$/,"$1")}const v=d[x];return m&&!v?h[g]=void 0:h[g]=(v||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:c,pattern:e}}function hT(e,t=!1,r=!0){hr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let i=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,f,h,g)=>{if(i.push({paramName:d,isOptional:f!=null}),f){let m=g.charAt(h+c.length);return m&&m!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(i.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),i]}function pT(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return hr(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Na(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,i=e.charAt(r);return i&&i!=="/"?null:e.slice(r)||"/"}var mT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function gT(e,t="/"){let{pathname:r,search:i="",hash:l=""}=typeof e=="string"?Wi(e):e,o;return r?(r=Hw(r),r.startsWith("/")?o=dx(r.substring(1),"/"):o=dx(r,t)):o=t,{pathname:o,search:xT(i),hash:vT(l)}}function dx(e,t){let r=Au(t).split("/");return e.split("/").forEach(l=>{l===".."?r.length>1&&r.pop():l!=="."&&r.push(l)}),r.length>1?r.join("/"):"/"}function jh(e,t,r,i){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function bT(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function gm(e){let t=bT(e);return t.map((r,i)=>i===t.length-1?r.pathname:r.pathnameBase)}function ed(e,t,r,i=!1){let l;typeof e=="string"?l=Wi(e):(l={...e},Qt(!l.pathname||!l.pathname.includes("?"),jh("?","pathname","search",l)),Qt(!l.pathname||!l.pathname.includes("#"),jh("#","pathname","hash",l)),Qt(!l.search||!l.search.includes("#"),jh("#","search","hash",l)));let o=e===""||l.pathname==="",c=o?"/":l.pathname,d;if(c==null)d=r;else{let m=t.length-1;if(!i&&c.startsWith("..")){let x=c.split("/");for(;x[0]==="..";)x.shift(),m-=1;l.pathname=x.join("/")}d=m>=0?t[m]:"/"}let f=gT(l,d),h=c&&c!=="/"&&c.endsWith("/"),g=(o||c===".")&&r.endsWith("/");return!f.pathname.endsWith("/")&&(h||g)&&(f.pathname+="/"),f}var Hw=e=>e.replace(/\/\/+/g,"/"),Ir=e=>Hw(e.join("/")),Au=e=>e.replace(/\/+$/,""),yT=e=>Au(e).replace(/^\/*/,"/"),xT=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,vT=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,wT=class{constructor(e,t,r,i=!1){this.status=e,this.statusText=t||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function ET(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function ST(e){let t=e.map(r=>r.route.path).filter(Boolean);return Ir(t)||"/"}var Kw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function qw(e,t){let r=e;if(typeof r!="string"||!mT.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let i=r,l=!1;if(Kw)try{let o=new URL(window.location.href),c=r.startsWith("//")?new URL(o.protocol+r):new URL(r),d=Na(c.pathname,t);c.origin===o.origin&&d!=null?r=d+c.search+c.hash:l=!0}catch{hr(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:l,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Gw=["POST","PUT","PATCH","DELETE"];new Set(Gw);var _T=["GET",...Gw];new Set(_T);var nl=w.createContext(null);nl.displayName="DataRouter";var td=w.createContext(null);td.displayName="DataRouterState";var Vw=w.createContext(!1);function kT(){return w.useContext(Vw)}var Yw=w.createContext({isTransitioning:!1});Yw.displayName="ViewTransition";var CT=w.createContext(new Map);CT.displayName="Fetchers";var NT=w.createContext(null);NT.displayName="Await";var mr=w.createContext(null);mr.displayName="Navigation";var Mo=w.createContext(null);Mo.displayName="Location";var Tr=w.createContext({outlet:null,matches:[],isDataRoute:!1});Tr.displayName="Route";var bm=w.createContext(null);bm.displayName="RouteError";var Xw="REACT_ROUTER_ERROR",TT="REDIRECT",AT="ROUTE_ERROR_RESPONSE";function RT(e){if(e.startsWith(`${Xw}:${TT}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function OT(e){if(e.startsWith(`${Xw}:${AT}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new wT(t.status,t.statusText,t.data)}catch{}}function MT(e,{relative:t}={}){Qt(rl(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:i}=w.useContext(mr),{hash:l,pathname:o,search:c}=jo(e,{relative:t}),d=o;return r!=="/"&&(d=o==="/"?r:Ir([r,o])),i.createHref({pathname:d,search:c,hash:l})}function rl(){return w.useContext(Mo)!=null}function Ar(){return Qt(rl(),"useLocation() may be used only in the context of a <Router> component."),w.useContext(Mo).location}var Ww="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Qw(e){w.useContext(mr).static||w.useLayoutEffect(e)}function nd(){let{isDataRoute:e}=w.useContext(Tr);return e?VT():DT()}function DT(){Qt(rl(),"useNavigate() may be used only in the context of a <Router> component.");let e=w.useContext(nl),{basename:t,navigator:r}=w.useContext(mr),{matches:i}=w.useContext(Tr),{pathname:l}=Ar(),o=JSON.stringify(gm(i)),c=w.useRef(!1);return Qw(()=>{c.current=!0}),w.useCallback((f,h={})=>{if(hr(c.current,Ww),!c.current)return;if(typeof f=="number"){r.go(f);return}let g=ed(f,JSON.parse(o),l,h.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:Ir([t,g.pathname])),(h.replace?r.replace:r.push)(g,h.state,h)},[t,r,o,l,e])}var jT=w.createContext(null);function LT(e){let t=w.useContext(Tr).outlet;return w.useMemo(()=>t&&w.createElement(jT.Provider,{value:e},t),[t,e])}function Do(){let{matches:e}=w.useContext(Tr),t=e[e.length-1];return(t==null?void 0:t.params)??{}}function jo(e,{relative:t}={}){let{matches:r}=w.useContext(Tr),{pathname:i}=Ar(),l=JSON.stringify(gm(r));return w.useMemo(()=>ed(e,JSON.parse(l),i,t==="path"),[e,l,i,t])}function IT(e,t){return Zw(e,t)}function Zw(e,t,r){var _;Qt(rl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=w.useContext(mr),{matches:l}=w.useContext(Tr),o=l[l.length-1],c=o?o.params:{},d=o?o.pathname:"/",f=o?o.pathnameBase:"/",h=o&&o.route;{let C=h&&h.path||"";e1(d,!h||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${C}">) 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.
394
-
395
- Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let g=Ar(),m;if(t){let C=typeof t=="string"?Wi(t):t;Qt(f==="/"||((_=C.pathname)==null?void 0:_.startsWith(f)),`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 "${f}" but pathname "${C.pathname}" was given in the \`location\` prop.`),m=C}else m=g;let x=m.pathname||"/",v=x;if(f!=="/"){let C=f.replace(/^\//,"").split("/");v="/"+x.replace(/^\//,"").split("/").slice(C.length).join("/")}let E=Uw(e,{pathname:v});hr(h||E!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),hr(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.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 S=FT(E&&E.map(C=>Object.assign({},C,{params:Object.assign({},c,C.params),pathname:Ir([f,i.encodeLocation?i.encodeLocation(C.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?f:Ir([f,i.encodeLocation?i.encodeLocation(C.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),l,r);return t&&S?w.createElement(Mo.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...m},navigationType:"POP"}},S):S}function zT(){let e=GT(),t=ET(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:i},o={padding:"2px 4px",backgroundColor:i},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=w.createElement(w.Fragment,null,w.createElement("p",null,"💿 Hey developer 👋"),w.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",w.createElement("code",{style:o},"ErrorBoundary")," or"," ",w.createElement("code",{style:o},"errorElement")," prop on your route.")),w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),r?w.createElement("pre",{style:l},r):null,c)}var PT=w.createElement(zT,null),Jw=class extends w.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=OT(e.digest);r&&(e=r)}let t=e!==void 0?w.createElement(Tr.Provider,{value:this.props.routeContext},w.createElement(bm.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?w.createElement(BT,{error:e},t):t}};Jw.contextType=Vw;var Lh=new WeakMap;function BT({children:e,error:t}){let{basename:r}=w.useContext(mr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let i=RT(t.digest);if(i){let l=Lh.get(t);if(l)throw l;let o=qw(i.location,r);if(Kw&&!Lh.get(t))if(o.isExternal||i.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:i.replace}));throw Lh.set(t,c),c}return w.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function UT({routeContext:e,match:t,children:r}){let i=w.useContext(nl);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),w.createElement(Tr.Provider,{value:e},r)}function FT(e,t=[],r){let i=r==null?void 0:r.state;if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(t.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let l=e,o=i==null?void 0:i.errors;if(o!=null){let g=l.findIndex(m=>m.route.id&&(o==null?void 0:o[m.route.id])!==void 0);Qt(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),l=l.slice(0,Math.min(l.length,g+1))}let c=!1,d=-1;if(r&&i){c=i.renderFallback;for(let g=0;g<l.length;g++){let m=l[g];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(d=g),m.route.id){let{loaderData:x,errors:v}=i,E=m.route.loader&&!x.hasOwnProperty(m.route.id)&&(!v||v[m.route.id]===void 0);if(m.route.lazy||E){r.isStatic&&(c=!0),d>=0?l=l.slice(0,d+1):l=[l[0]];break}}}}let f=r==null?void 0:r.onError,h=i&&f?(g,m)=>{var x,v;f(g,{location:i.location,params:((v=(x=i.matches)==null?void 0:x[0])==null?void 0:v.params)??{},unstable_pattern:ST(i.matches),errorInfo:m})}:void 0;return l.reduceRight((g,m,x)=>{let v,E=!1,S=null,_=null;i&&(v=o&&m.route.id?o[m.route.id]:void 0,S=m.route.errorElement||PT,c&&(d<0&&x===0?(e1("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,_=null):d===x&&(E=!0,_=m.route.hydrateFallbackElement||null)));let C=t.concat(l.slice(0,x+1)),A=()=>{let T;return v?T=S:E?T=_:m.route.Component?T=w.createElement(m.route.Component,null):m.route.element?T=m.route.element:T=g,w.createElement(UT,{match:m,routeContext:{outlet:g,matches:C,isDataRoute:i!=null},children:T})};return i&&(m.route.ErrorBoundary||m.route.errorElement||x===0)?w.createElement(Jw,{location:i.location,revalidation:i.revalidation,component:S,error:v,children:A(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:h}):A()},null)}function ym(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function $T(e){let t=w.useContext(nl);return Qt(t,ym(e)),t}function HT(e){let t=w.useContext(td);return Qt(t,ym(e)),t}function KT(e){let t=w.useContext(Tr);return Qt(t,ym(e)),t}function xm(e){let t=KT(e),r=t.matches[t.matches.length-1];return Qt(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function qT(){return xm("useRouteId")}function GT(){var i;let e=w.useContext(bm),t=HT("useRouteError"),r=xm("useRouteError");return e!==void 0?e:(i=t.errors)==null?void 0:i[r]}function VT(){let{router:e}=$T("useNavigate"),t=xm("useNavigate"),r=w.useRef(!1);return Qw(()=>{r.current=!0}),w.useCallback(async(l,o={})=>{hr(r.current,Ww),r.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var fx={};function e1(e,t,r){!t&&!fx[e]&&(fx[e]=!0,hr(!1,r))}w.memo(YT);function YT({routes:e,future:t,state:r,isStatic:i,onError:l}){return Zw(e,void 0,{state:r,isStatic:i,onError:l})}function fi({to:e,replace:t,state:r,relative:i}){Qt(rl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=w.useContext(mr);hr(!l,"<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:o}=w.useContext(Tr),{pathname:c}=Ar(),d=nd(),f=ed(e,gm(o),c,i==="path"),h=JSON.stringify(f);return w.useEffect(()=>{d(JSON.parse(h),{replace:t,state:r,relative:i})},[d,h,i,t,r]),null}function XT(e){return LT(e.context)}function Ui(e){Qt(!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 WT({basename:e="/",children:t=null,location:r,navigationType:i="POP",navigator:l,static:o=!1,unstable_useTransitions:c}){Qt(!rl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),f=w.useMemo(()=>({basename:d,navigator:l,static:o,unstable_useTransitions:c,future:{}}),[d,l,o,c]);typeof r=="string"&&(r=Wi(r));let{pathname:h="/",search:g="",hash:m="",state:x=null,key:v="default",unstable_mask:E}=r,S=w.useMemo(()=>{let _=Na(h,d);return _==null?null:{location:{pathname:_,search:g,hash:m,state:x,key:v,unstable_mask:E},navigationType:i}},[d,h,g,m,x,v,i,E]);return hr(S!=null,`<Router basename="${d}"> is not able to match the URL "${h}${g}${m}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:w.createElement(mr.Provider,{value:f},w.createElement(Mo.Provider,{children:t,value:S}))}function QT({children:e,location:t}){return IT(Ap(e),t)}function Ap(e,t=[]){let r=[];return w.Children.forEach(e,(i,l)=>{if(!w.isValidElement(i))return;let o=[...t,l];if(i.type===w.Fragment){r.push.apply(r,Ap(i.props.children,o));return}Qt(i.type===Ui,`[${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>`),Qt(!i.props.index||!i.props.children,"An index route cannot have child routes.");let c={id:i.props.id||o.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&&(c.children=Ap(i.props.children,o)),r.push(c)}),r}var vu="get",wu="application/x-www-form-urlencoded";function rd(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function ZT(e){return rd(e)&&e.tagName.toLowerCase()==="button"}function JT(e){return rd(e)&&e.tagName.toLowerCase()==="form"}function eA(e){return rd(e)&&e.tagName.toLowerCase()==="input"}function tA(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function nA(e,t){return e.button===0&&(!t||t==="_self")&&!tA(e)}function Rp(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let i=e[r];return t.concat(Array.isArray(i)?i.map(l=>[r,l]):[[r,i]])},[]))}function rA(e,t){let r=Rp(e);return t&&t.forEach((i,l)=>{r.has(l)||t.getAll(l).forEach(o=>{r.append(l,o)})}),r}var nu=null;function aA(){if(nu===null)try{new FormData(document.createElement("form"),0),nu=!1}catch{nu=!0}return nu}var iA=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ih(e){return e!=null&&!iA.has(e)?(hr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${wu}"`),null):e}function sA(e,t){let r,i,l,o,c;if(JT(e)){let d=e.getAttribute("action");i=d?Na(d,t):null,r=e.getAttribute("method")||vu,l=Ih(e.getAttribute("enctype"))||wu,o=new FormData(e)}else if(ZT(e)||eA(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||d.getAttribute("action");if(i=f?Na(f,t):null,r=e.getAttribute("formmethod")||d.getAttribute("method")||vu,l=Ih(e.getAttribute("formenctype"))||Ih(d.getAttribute("enctype"))||wu,o=new FormData(d,e),!aA()){let{name:h,type:g,value:m}=e;if(g==="image"){let x=h?`${h}.`:"";o.append(`${x}x`,"0"),o.append(`${x}y`,"0")}else h&&o.append(h,m)}}else{if(rd(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=vu,i=null,l=wu,c=e}return o&&l==="text/plain"&&(c=o,o=void 0),{action:i,method:r.toLowerCase(),encType:l,formData:o,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function vm(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function t1(e,t,r,i){let l=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${i}`:l.pathname=`${l.pathname}.${i}`:l.pathname==="/"?l.pathname=`_root.${i}`:t&&Na(l.pathname,t)==="/"?l.pathname=`${Au(t)}/_root.${i}`:l.pathname=`${Au(l.pathname)}.${i}`,l}async function lA(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function oA(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function cA(e,t,r){let i=await Promise.all(e.map(async l=>{let o=t.routes[l.route.id];if(o){let c=await lA(o,r);return c.links?c.links():[]}return[]}));return hA(i.flat(1).filter(oA).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function hx(e,t,r,i,l,o){let c=(f,h)=>r[h]?f.route.id!==r[h].route.id:!0,d=(f,h)=>{var g;return r[h].pathname!==f.pathname||((g=r[h].route.path)==null?void 0:g.endsWith("*"))&&r[h].params["*"]!==f.params["*"]};return o==="assets"?t.filter((f,h)=>c(f,h)||d(f,h)):o==="data"?t.filter((f,h)=>{var m;let g=i.routes[f.route.id];if(!g||!g.hasLoader)return!1;if(c(f,h)||d(f,h))return!0;if(f.route.shouldRevalidate){let x=f.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:((m=r[0])==null?void 0:m.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function uA(e,t,{includeHydrateFallback:r}={}){return dA(e.map(i=>{let l=t.routes[i.route.id];if(!l)return[];let o=[l.module];return l.clientActionModule&&(o=o.concat(l.clientActionModule)),l.clientLoaderModule&&(o=o.concat(l.clientLoaderModule)),r&&l.hydrateFallbackModule&&(o=o.concat(l.hydrateFallbackModule)),l.imports&&(o=o.concat(l.imports)),o}).flat(1))}function dA(e){return[...new Set(e)]}function fA(e){let t={},r=Object.keys(e).sort();for(let i of r)t[i]=e[i];return t}function hA(e,t){let r=new Set;return new Set(t),e.reduce((i,l)=>{let o=JSON.stringify(fA(l));return r.has(o)||(r.add(o),i.push({key:o,link:l})),i},[])}function wm(){let e=w.useContext(nl);return vm(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function pA(){let e=w.useContext(td);return vm(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Em=w.createContext(void 0);Em.displayName="FrameworkContext";function Sm(){let e=w.useContext(Em);return vm(e,"You must render this element inside a <HydratedRouter> element"),e}function mA(e,t){let r=w.useContext(Em),[i,l]=w.useState(!1),[o,c]=w.useState(!1),{onFocus:d,onBlur:f,onMouseEnter:h,onMouseLeave:g,onTouchStart:m}=t,x=w.useRef(null);w.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let S=C=>{C.forEach(A=>{c(A.isIntersecting)})},_=new IntersectionObserver(S,{threshold:.5});return x.current&&_.observe(x.current),()=>{_.disconnect()}}},[e]),w.useEffect(()=>{if(i){let S=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(S)}}},[i]);let v=()=>{l(!0)},E=()=>{l(!1),c(!1)};return r?e!=="intent"?[o,x,{}]:[o,x,{onFocus:ao(d,v),onBlur:ao(f,E),onMouseEnter:ao(h,v),onMouseLeave:ao(g,E),onTouchStart:ao(m,v)}]:[!1,x,{}]}function ao(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function gA({page:e,...t}){let r=kT(),{router:i}=wm(),l=w.useMemo(()=>Uw(i.routes,e,i.basename),[i.routes,e,i.basename]);return l?r?w.createElement(yA,{page:e,matches:l,...t}):w.createElement(xA,{page:e,matches:l,...t}):null}function bA(e){let{manifest:t,routeModules:r}=Sm(),[i,l]=w.useState([]);return w.useEffect(()=>{let o=!1;return cA(e,t,r).then(c=>{o||l(c)}),()=>{o=!0}},[e,t,r]),i}function yA({page:e,matches:t,...r}){let i=Ar(),{future:l}=Sm(),{basename:o}=wm(),c=w.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let d=t1(e,o,l.unstable_trailingSlashAwareDataRequests,"rsc"),f=!1,h=[];for(let g of t)typeof g.route.shouldRevalidate=="function"?f=!0:h.push(g.route.id);return f&&h.length>0&&d.searchParams.set("_routes",h.join(",")),[d.pathname+d.search]},[o,l.unstable_trailingSlashAwareDataRequests,e,i,t]);return w.createElement(w.Fragment,null,c.map(d=>w.createElement("link",{key:d,rel:"prefetch",as:"fetch",href:d,...r})))}function xA({page:e,matches:t,...r}){let i=Ar(),{future:l,manifest:o,routeModules:c}=Sm(),{basename:d}=wm(),{loaderData:f,matches:h}=pA(),g=w.useMemo(()=>hx(e,t,h,o,i,"data"),[e,t,h,o,i]),m=w.useMemo(()=>hx(e,t,h,o,i,"assets"),[e,t,h,o,i]),x=w.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let S=new Set,_=!1;if(t.forEach(A=>{var M;let T=o.routes[A.route.id];!T||!T.hasLoader||(!g.some(P=>P.route.id===A.route.id)&&A.route.id in f&&((M=c[A.route.id])!=null&&M.shouldRevalidate)||T.hasClientLoader?_=!0:S.add(A.route.id))}),S.size===0)return[];let C=t1(e,d,l.unstable_trailingSlashAwareDataRequests,"data");return _&&S.size>0&&C.searchParams.set("_routes",t.filter(A=>S.has(A.route.id)).map(A=>A.route.id).join(",")),[C.pathname+C.search]},[d,l.unstable_trailingSlashAwareDataRequests,f,i,o,g,t,e,c]),v=w.useMemo(()=>uA(m,o),[m,o]),E=bA(m);return w.createElement(w.Fragment,null,x.map(S=>w.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...r})),v.map(S=>w.createElement("link",{key:S,rel:"modulepreload",href:S,...r})),E.map(({key:S,link:_})=>w.createElement("link",{key:S,nonce:r.nonce,..._,crossOrigin:_.crossOrigin??r.crossOrigin})))}function vA(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var wA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{wA&&(window.__reactRouterVersion="7.14.2")}catch{}function EA({basename:e,children:t,unstable_useTransitions:r,window:i}){let l=w.useRef();l.current==null&&(l.current=Z2({window:i,v5Compat:!0}));let o=l.current,[c,d]=w.useState({action:o.action,location:o.location}),f=w.useCallback(h=>{r===!1?d(h):w.startTransition(()=>d(h))},[r]);return w.useLayoutEffect(()=>o.listen(f),[o,f]),w.createElement(WT,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:o,unstable_useTransitions:r})}var n1=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Pn=w.forwardRef(function({onClick:t,discover:r="render",prefetch:i="none",relative:l,reloadDocument:o,replace:c,unstable_mask:d,state:f,target:h,to:g,preventScrollReset:m,viewTransition:x,unstable_defaultShouldRevalidate:v,...E},S){let{basename:_,navigator:C,unstable_useTransitions:A}=w.useContext(mr),T=typeof g=="string"&&n1.test(g),M=qw(g,_);g=M.to;let P=MT(g,{relative:l}),N=Ar(),z=null;if(d){let H=ed(d,[],N.unstable_mask?N.unstable_mask.pathname:"/",!0);_!=="/"&&(H.pathname=H.pathname==="/"?_:Ir([_,H.pathname])),z=C.createHref(H)}let[G,Q,R]=mA(i,E),q=kA(g,{replace:c,unstable_mask:d,state:f,target:h,preventScrollReset:m,relative:l,viewTransition:x,unstable_defaultShouldRevalidate:v,unstable_useTransitions:A});function Z(H){t&&t(H),H.defaultPrevented||q(H)}let ne=!(M.isExternal||o),Y=w.createElement("a",{...E,...R,href:(ne?z:void 0)||M.absoluteURL||P,onClick:ne?Z:t,ref:vA(S,Q),target:h,"data-discover":!T&&r==="render"?"true":void 0});return G&&!T?w.createElement(w.Fragment,null,Y,w.createElement(gA,{page:P})):Y});Pn.displayName="Link";var Op=w.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:i="",end:l=!1,style:o,to:c,viewTransition:d,children:f,...h},g){let m=jo(c,{relative:h.relative}),x=Ar(),v=w.useContext(td),{navigator:E,basename:S}=w.useContext(mr),_=v!=null&&RA(m)&&d===!0,C=E.encodeLocation?E.encodeLocation(m).pathname:m.pathname,A=x.pathname,T=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;r||(A=A.toLowerCase(),T=T?T.toLowerCase():null,C=C.toLowerCase()),T&&S&&(T=Na(T,S)||T);const M=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let P=A===C||!l&&A.startsWith(C)&&A.charAt(M)==="/",N=T!=null&&(T===C||!l&&T.startsWith(C)&&T.charAt(C.length)==="/"),z={isActive:P,isPending:N,isTransitioning:_},G=P?t:void 0,Q;typeof i=="function"?Q=i(z):Q=[i,P?"active":null,N?"pending":null,_?"transitioning":null].filter(Boolean).join(" ");let R=typeof o=="function"?o(z):o;return w.createElement(Pn,{...h,"aria-current":G,className:Q,ref:g,style:R,to:c,viewTransition:d},typeof f=="function"?f(z):f)});Op.displayName="NavLink";var SA=w.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:i,replace:l,state:o,method:c=vu,action:d,onSubmit:f,relative:h,preventScrollReset:g,viewTransition:m,unstable_defaultShouldRevalidate:x,...v},E)=>{let{unstable_useTransitions:S}=w.useContext(mr),_=TA(),C=AA(d,{relative:h}),A=c.toLowerCase()==="get"?"get":"post",T=typeof d=="string"&&n1.test(d),M=P=>{if(f&&f(P),P.defaultPrevented)return;P.preventDefault();let N=P.nativeEvent.submitter,z=(N==null?void 0:N.getAttribute("formmethod"))||c,G=()=>_(N||P.currentTarget,{fetcherKey:t,method:z,navigate:r,replace:l,state:o,relative:h,preventScrollReset:g,viewTransition:m,unstable_defaultShouldRevalidate:x});S&&r!==!1?w.startTransition(()=>G()):G()};return w.createElement("form",{ref:E,method:A,action:C,onSubmit:i?f:M,...v,"data-discover":!T&&e==="render"?"true":void 0})});SA.displayName="Form";function _A(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function r1(e){let t=w.useContext(nl);return Qt(t,_A(e)),t}function kA(e,{target:t,replace:r,unstable_mask:i,state:l,preventScrollReset:o,relative:c,viewTransition:d,unstable_defaultShouldRevalidate:f,unstable_useTransitions:h}={}){let g=nd(),m=Ar(),x=jo(e,{relative:c});return w.useCallback(v=>{if(nA(v,t)){v.preventDefault();let E=r!==void 0?r:Eo(m)===Eo(x),S=()=>g(e,{replace:E,unstable_mask:i,state:l,preventScrollReset:o,relative:c,viewTransition:d,unstable_defaultShouldRevalidate:f});h?w.startTransition(()=>S()):S()}},[m,g,x,r,i,l,t,e,o,c,d,f,h])}function _m(e){hr(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=w.useRef(Rp(e)),r=w.useRef(!1),i=Ar(),l=w.useMemo(()=>rA(i.search,r.current?null:t.current),[i.search]),o=nd(),c=w.useCallback((d,f)=>{const h=Rp(typeof d=="function"?d(new URLSearchParams(l)):d);r.current=!0,o("?"+h,f)},[o,l]);return[l,c]}var CA=0,NA=()=>`__${String(++CA)}__`;function TA(){let{router:e}=r1("useSubmit"),{basename:t}=w.useContext(mr),r=qT(),i=e.fetch,l=e.navigate;return w.useCallback(async(o,c={})=>{let{action:d,method:f,encType:h,formData:g,body:m}=sA(o,t);if(c.navigate===!1){let x=c.fetcherKey||NA();await i(x,r,c.action||d,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:g,body:m,formMethod:c.method||f,formEncType:c.encType||h,flushSync:c.flushSync})}else await l(c.action||d,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:g,body:m,formMethod:c.method||f,formEncType:c.encType||h,replace:c.replace,state:c.state,fromRouteId:r,flushSync:c.flushSync,viewTransition:c.viewTransition})},[i,l,t,r])}function AA(e,{relative:t}={}){let{basename:r}=w.useContext(mr),i=w.useContext(Tr);Qt(i,"useFormAction must be used inside a RouteContext");let[l]=i.matches.slice(-1),o={...jo(e||".",{relative:t})},c=Ar();if(e==null){o.search=c.search;let d=new URLSearchParams(o.search),f=d.getAll("index");if(f.some(g=>g==="")){d.delete("index"),f.filter(m=>m).forEach(m=>d.append("index",m));let g=d.toString();o.search=g?`?${g}`:""}}return(!e||e===".")&&l.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:Ir([r,o.pathname])),Eo(o)}function RA(e,{relative:t}={}){let r=w.useContext(Yw);Qt(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=r1("useViewTransitionState"),l=jo(e,{relative:t});if(!r.isTransitioning)return!1;let o=Na(r.currentLocation.pathname,i)||r.currentLocation.pathname,c=Na(r.nextLocation.pathname,i)||r.nextLocation.pathname;return Tu(l.pathname,c)!=null||Tu(l.pathname,o)!=null}var Lo=Bw();const OA=tl(Lo),px=e=>{let t;const r=new Set,i=(h,g)=>{const m=typeof h=="function"?h(t):h;if(!Object.is(m,t)){const x=t;t=g??(typeof m!="object"||m===null)?m:Object.assign({},t,m),r.forEach(v=>v(t,x))}},l=()=>t,d={setState:i,getState:l,getInitialState:()=>f,subscribe:h=>(r.add(h),()=>r.delete(h))},f=t=e(i,l,d);return d},MA=(e=>e?px(e):px),DA=e=>e;function jA(e,t=DA){const r=kt.useSyncExternalStore(e.subscribe,kt.useCallback(()=>t(e.getState()),[e,t]),kt.useCallback(()=>t(e.getInitialState()),[e,t]));return kt.useDebugValue(r),r}const mx=e=>{const t=MA(e),r=i=>jA(t,i);return Object.assign(r,t),r},km=(e=>e?mx(e):mx),gx="/api/v1";class LA{constructor(){Ls(this,"token","");Ls(this,"baseUrl",gx)}setToken(t){this.token=t}setBaseUrl(t){const r=t.trim();if(!r){this.baseUrl=gx;return}this.baseUrl=r.endsWith("/api/v1")?r:`${r.replace(/\/+$/,"")}/api/v1`}getToken(){return this.token}getBaseUrl(){return this.baseUrl}headers(){const t={"Content-Type":"application/json"};return this.token&&(t.Authorization=`Bearer ${this.token}`),t}async request(t,r,i,l){let o=this.resolveUrl(r);if(l){const f=new URLSearchParams(l).toString();f&&(o+=`?${f}`)}const c=await fetch(o,{method:t,headers:this.headers(),body:i?JSON.stringify(i):void 0}),d=await c.json();if(!d.ok)throw new IA(d.error||"Unknown error",c.status);return d.data}get(t,r){return this.request("GET",t,void 0,r)}post(t,r){return this.request("POST",t,r)}patch(t,r){return this.request("PATCH",t,r)}delete(t){return this.request("DELETE",t)}resolveUrl(t){const r=t.replace(/^\/+/,"");return this.baseUrl.startsWith("http://")||this.baseUrl.startsWith("https://")?new URL(r,`${this.baseUrl}/`).toString():`${this.baseUrl}/${r}`.replace(/([^:]\/)\/+/g,"$1")}}class IA extends Error{constructor(t,r){super(t),this.status=r,this.name="ApiError"}}const lt=new LA,pr=km(e=>({token:"",serverUrl:"",isAuthenticated:!1,desktopManaged:!1,managedBy:"none",login:(t,r)=>{lt.setToken(t),r&&lt.setBaseUrl(r),localStorage.setItem("cc_token",t),r&&localStorage.setItem("cc_server_url",r),e({token:t,serverUrl:r||"",isAuthenticated:!0,desktopManaged:!1,managedBy:"remote"})},setManagedSession:(t,r,i)=>{lt.setToken(t),lt.setBaseUrl(r),e({token:t,serverUrl:r,isAuthenticated:!0,desktopManaged:!0,managedBy:i})},setDesktopSession:(t,r)=>{pr.getState().setManagedSession(t,r,"electron")},logout:()=>{pr.getState().desktopManaged||(lt.setToken(""),lt.setBaseUrl(""),localStorage.removeItem("cc_token"),localStorage.removeItem("cc_server_url"),e({token:"",serverUrl:"",isAuthenticated:!1,desktopManaged:!1,managedBy:"none"}))},init:()=>{const t=localStorage.getItem("cc_token")||"",r=localStorage.getItem("cc_server_url")||"";t&&(lt.setToken(t),r&&lt.setBaseUrl(r),e({token:t,serverUrl:r,isAuthenticated:!0,desktopManaged:!1,managedBy:"remote"}))}})),zA=(e,t,r,i)=>{var o,c,d,f;const l=[r,{code:t,...i||{}}];if((c=(o=e==null?void 0:e.services)==null?void 0:o.logger)!=null&&c.forward)return e.services.logger.forward(l,"warn","react-i18next::",!0);Fi(l[0])&&(l[0]=`react-i18next:: ${l[0]}`),(f=(d=e==null?void 0:e.services)==null?void 0:d.logger)!=null&&f.warn?e.services.logger.warn(...l):console!=null&&console.warn&&console.warn(...l)},bx={},Mp=(e,t,r,i)=>{Fi(r)&&bx[r]||(Fi(r)&&(bx[r]=new Date),zA(e,t,r,i))},a1=(e,t)=>()=>{if(e.isInitialized)t();else{const r=()=>{setTimeout(()=>{e.off("initialized",r)},0),t()};e.on("initialized",r)}},Dp=(e,t,r)=>{e.loadNamespaces(t,a1(e,r))},yx=(e,t,r,i)=>{if(Fi(r)&&(r=[r]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Dp(e,r,i);r.forEach(l=>{e.options.ns.indexOf(l)<0&&e.options.ns.push(l)}),e.loadLanguages(t,a1(e,i))},PA=(e,t,r={})=>!t.languages||!t.languages.length?(Mp(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:r.lng,precheck:(i,l)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!l(i.isLanguageChangingTo,e))return!1}}),Fi=e=>typeof e=="string",BA=e=>typeof e=="object"&&e!==null,UA=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,FA={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},$A=e=>FA[e],HA=e=>e.replace(UA,$A);let jp={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:HA};const KA=(e={})=>{jp={...jp,...e}},qA=()=>jp;let i1;const GA=e=>{i1=e},VA=()=>i1,YA={type:"3rdParty",init(e){KA(e.options.react),GA(e)}},XA=w.createContext();class WA{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const QA=(e,t)=>{const r=w.useRef();return w.useEffect(()=>{r.current=e},[e,t]),r.current},s1=(e,t,r,i)=>e.getFixedT(t,r,i),ZA=(e,t,r,i)=>w.useCallback(s1(e,t,r,i),[e,t,r,i]),Fr=(e,t={})=>{var M,P,N,z;const{i18n:r}=t,{i18n:i,defaultNS:l}=w.useContext(XA)||{},o=r||i||VA();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new WA),!o){Mp(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const G=(R,q)=>Fi(q)?q:BA(q)&&Fi(q.defaultValue)?q.defaultValue:Array.isArray(R)?R[R.length-1]:R,Q=[G,{},!1];return Q.t=G,Q.i18n={},Q.ready=!1,Q}(M=o.options.react)!=null&&M.wait&&Mp(o,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const c={...qA(),...o.options.react,...t},{useSuspense:d,keyPrefix:f}=c;let h=l||((P=o.options)==null?void 0:P.defaultNS);h=Fi(h)?[h]:h||["translation"],(z=(N=o.reportNamespaces).addUsedNamespaces)==null||z.call(N,h);const g=(o.isInitialized||o.initializedStoreOnce)&&h.every(G=>PA(G,o,c)),m=ZA(o,t.lng||null,c.nsMode==="fallback"?h:h[0],f),x=()=>m,v=()=>s1(o,t.lng||null,c.nsMode==="fallback"?h:h[0],f),[E,S]=w.useState(x);let _=h.join();t.lng&&(_=`${t.lng}${_}`);const C=QA(_),A=w.useRef(!0);w.useEffect(()=>{const{bindI18n:G,bindI18nStore:Q}=c;A.current=!0,!g&&!d&&(t.lng?yx(o,t.lng,h,()=>{A.current&&S(v)}):Dp(o,h,()=>{A.current&&S(v)})),g&&C&&C!==_&&A.current&&S(v);const R=()=>{A.current&&S(v)};return G&&(o==null||o.on(G,R)),Q&&(o==null||o.store.on(Q,R)),()=>{A.current=!1,o&&G&&(G==null||G.split(" ").forEach(q=>o.off(q,R))),Q&&o&&Q.split(" ").forEach(q=>o.store.off(q,R))}},[o,_]),w.useEffect(()=>{A.current&&g&&S(x)},[o,f,g]);const T=[E,o,g];if(T.t=E,T.i18n=o,T.ready=g,g||!g&&!d)return T;throw new Promise(G=>{t.lng?yx(o,t.lng,h,()=>G()):Dp(o,h,()=>G())})};function l1(e){var t,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(r=l1(e[t]))&&(i&&(i+=" "),i+=r)}else for(r in e)e[r]&&(i&&(i+=" "),i+=r);return i}function JA(){for(var e,t,r=0,i="",l=arguments.length;r<l;r++)(e=arguments[r])&&(t=l1(e))&&(i&&(i+=" "),i+=t);return i}function Ke(...e){return JA(e)}function Zs(e){return e?new Date(e).toLocaleString():"-"}let So=typeof window<"u"&&window.desktop?"electron":"local_core";const Cm=km(e=>({snapshot:null,setSnapshot:t=>e({snapshot:t})}));function $i(){return So}function zh(e){So=e}function eR(){return So==="electron"}function tR(){return!1}function Ph(e){Cm.getState().setSnapshot(e)}function nR(){return Cm.getState().snapshot}function rR(e){return!!(e!=null&&e.knowledge.some(t=>t.enabled!==!1))}function aR(e){return!!(e!=null&&e.schedulers.some(t=>t.enabled!==!1))}function iR(e,t){return!!(e!=null&&e.agents.some(r=>r.agentType===t))}function sR(e){return!!(e!=null&&e.agents.some(t=>t.agentType))}function lR(e=nR()){const t=!!e,r=iR(e,"localcore-acp");return{desktopRuntime:t||So==="electron"||So==="local_core",desktopChat:r,chatRoute:t?r:!0,desktopWorkspace:t?sR(e):!0,knowledgeModule:t?rR(e):!0,schedulerModule:t?aR(e):!0}}function ad(){const e=Cm(t=>t.snapshot);return lR(e)}function xx(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function vx(e){document.documentElement.classList.toggle("dark",e==="dark")}const Nm=km(e=>({theme:"dark",resolved:"dark",setTheme:t=>{const r=xx(t);localStorage.setItem("cc_theme",t),vx(r),e({theme:t,resolved:r})},init:()=>{const t=localStorage.getItem("cc_theme")||"dark",r=xx(t);vx(r),e({theme:t,resolved:r})}}));function Ht({children:e,className:t,hover:r}){return p.jsx("div",{className:Ke("rounded-lg p-5 text-card-foreground transition-colors duration-200 animate-float-in","border border-black/[0.08] bg-white/62 shadow-[0_1px_1px_rgba(0,0,0,0.04)] backdrop-blur-2xl","dark:border-white/[0.07] dark:bg-white/[0.06] dark:shadow-none",r&&"cursor-pointer hover:border-black/[0.12] hover:bg-white/76 hover:shadow-[0_10px_26px_rgba(0,0,0,0.07)] dark:hover:border-white/[0.10] dark:hover:bg-white/[0.09] dark:hover:shadow-none",t),children:e})}function wx(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Tm(...e){return t=>{let r=!1;const i=e.map(l=>{const o=wx(l,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let l=0;l<i.length;l++){const o=i[l];typeof o=="function"?o():wx(e[l],null)}}}}function cn(...e){return w.useCallback(Tm(...e),e)}var oR=Symbol.for("react.lazy"),Ru=dm[" use ".trim().toString()];function cR(e){return typeof e=="object"&&e!==null&&"then"in e}function o1(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===oR&&"_payload"in e&&cR(e._payload)}function uR(e){const t=fR(e),r=w.forwardRef((i,l)=>{let{children:o,...c}=i;o1(o)&&typeof Ru=="function"&&(o=Ru(o._payload));const d=w.Children.toArray(o),f=d.find(pR);if(f){const h=f.props.children,g=d.map(m=>m===f?w.Children.count(h)>1?w.Children.only(null):w.isValidElement(h)?h.props.children:null:m);return p.jsx(t,{...c,ref:l,children:w.isValidElement(h)?w.cloneElement(h,void 0,g):null})}return p.jsx(t,{...c,ref:l,children:o})});return r.displayName=`${e}.Slot`,r}var dR=uR("Slot");function fR(e){const t=w.forwardRef((r,i)=>{let{children:l,...o}=r;if(o1(l)&&typeof Ru=="function"&&(l=Ru(l._payload)),w.isValidElement(l)){const c=gR(l),d=mR(o,l.props);return l.type!==w.Fragment&&(d.ref=i?Tm(i,c):c),w.cloneElement(l,d)}return w.Children.count(l)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hR=Symbol("radix.slottable");function pR(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hR}function mR(e,t){const r={...t};for(const i in t){const l=e[i],o=t[i];/^on[A-Z]/.test(i)?l&&o?r[i]=(...d)=>{const f=o(...d);return l(...d),f}:l&&(r[i]=l):i==="style"?r[i]={...l,...o}:i==="className"&&(r[i]=[l,o].filter(Boolean).join(" "))}return{...e,...r}}function gR(e){var i,l;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}const bR={default:"bg-primary text-primary-foreground hover:bg-accent-dim",primary:"bg-primary text-primary-foreground hover:bg-accent-dim",secondary:"bg-black/[0.05] text-secondary-foreground hover:bg-black/[0.08] dark:bg-white/[0.08] dark:hover:bg-white/[0.12]",outline:"border border-input bg-background hover:bg-black/[0.04] hover:text-foreground dark:hover:bg-white/[0.06]",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",danger:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"text-muted-foreground hover:bg-black/[0.05] hover:text-foreground dark:hover:bg-white/[0.07]",link:"text-primary underline-offset-4 hover:underline"},yR={default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",md:"h-9 rounded-md px-4 py-2 text-sm",lg:"h-10 rounded-md px-6 text-sm",icon:"h-9 w-9"};function Ae({variant:e="primary",size:t="md",className:r,children:i,loading:l,asChild:o,disabled:c,type:d="button",...f}){const h=t==="default"?"md":t,g=o?dR:"button";return p.jsxs(g,{...o?{}:{type:d},className:Ke("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors duration-200","cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background","disabled:pointer-events-none disabled:opacity-50",bR[e],yR[h],r),disabled:c||l,...f,children:[l&&p.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24","aria-hidden":!0,children:[p.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),p.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),i]})}const xR={default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",success:"border-transparent bg-primary/10 text-primary dark:bg-primary/15 dark:text-primary",warning:"border-transparent bg-amber-100 text-amber-700 dark:bg-amber-500/15 dark:text-amber-200",danger:"border-transparent bg-destructive/10 text-destructive dark:bg-destructive/20 dark:text-red-200",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground",info:"border-transparent bg-blue-100 text-blue-700 dark:bg-blue-500/15 dark:text-blue-200"};function Cn({children:e,variant:t="default"}){return p.jsx("span",{className:Ke("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",xR[t]),children:e})}function Yt(e,t,{checkForDefaultPrevented:r=!0}={}){return function(l){if(e==null||e(l),r===!1||!l.defaultPrevented)return t==null?void 0:t(l)}}function vR(e,t){const r=w.createContext(t),i=o=>{const{children:c,...d}=o,f=w.useMemo(()=>d,Object.values(d));return p.jsx(r.Provider,{value:f,children:c})};i.displayName=e+"Provider";function l(o){const c=w.useContext(r);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[i,l]}function id(e,t=[]){let r=[];function i(o,c){const d=w.createContext(c),f=r.length;r=[...r,c];const h=m=>{var C;const{scope:x,children:v,...E}=m,S=((C=x==null?void 0:x[e])==null?void 0:C[f])||d,_=w.useMemo(()=>E,Object.values(E));return p.jsx(S.Provider,{value:_,children:v})};h.displayName=o+"Provider";function g(m,x){var S;const v=((S=x==null?void 0:x[e])==null?void 0:S[f])||d,E=w.useContext(v);if(E)return E;if(c!==void 0)return c;throw new Error(`\`${m}\` must be used within \`${o}\``)}return[h,g]}const l=()=>{const o=r.map(c=>w.createContext(c));return function(d){const f=(d==null?void 0:d[e])||o;return w.useMemo(()=>({[`__scope${e}`]:{...d,[e]:f}}),[d,f])}};return l.scopeName=e,[i,wR(l,...t)]}function wR(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const i=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(o){const c=i.reduce((d,{useScope:f,scopeName:h})=>{const m=f(o)[`__scope${h}`];return{...d,...m}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return r.scopeName=t.scopeName,r}var On=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},ER=dm[" useId ".trim().toString()]||(()=>{}),SR=0;function Vs(e){const[t,r]=w.useState(ER());return On(()=>{r(i=>i??String(SR++))},[e]),e||(t?`radix-${t}`:"")}var _R=dm[" useInsertionEffect ".trim().toString()]||On;function Lp({prop:e,defaultProp:t,onChange:r=()=>{},caller:i}){const[l,o,c]=kR({defaultProp:t,onChange:r}),d=e!==void 0,f=d?e:l;{const g=w.useRef(e!==void 0);w.useEffect(()=>{const m=g.current;m!==d&&console.warn(`${i} is changing from ${m?"controlled":"uncontrolled"} to ${d?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),g.current=d},[d,i])}const h=w.useCallback(g=>{var m;if(d){const x=CR(g)?g(e):g;x!==e&&((m=c.current)==null||m.call(c,x))}else o(g)},[d,e,o,c]);return[f,h]}function kR({defaultProp:e,onChange:t}){const[r,i]=w.useState(e),l=w.useRef(r),o=w.useRef(t);return _R(()=>{o.current=t},[t]),w.useEffect(()=>{var c;l.current!==r&&((c=o.current)==null||c.call(o,r),l.current=r)},[r,l]),[r,i,o]}function CR(e){return typeof e=="function"}function _o(e){const t=NR(e),r=w.forwardRef((i,l)=>{const{children:o,...c}=i,d=w.Children.toArray(o),f=d.find(AR);if(f){const h=f.props.children,g=d.map(m=>m===f?w.Children.count(h)>1?w.Children.only(null):w.isValidElement(h)?h.props.children:null:m);return p.jsx(t,{...c,ref:l,children:w.isValidElement(h)?w.cloneElement(h,void 0,g):null})}return p.jsx(t,{...c,ref:l,children:o})});return r.displayName=`${e}.Slot`,r}function NR(e){const t=w.forwardRef((r,i)=>{const{children:l,...o}=r;if(w.isValidElement(l)){const c=OR(l),d=RR(o,l.props);return l.type!==w.Fragment&&(d.ref=i?Tm(i,c):c),w.cloneElement(l,d)}return w.Children.count(l)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var TR=Symbol("radix.slottable");function AR(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===TR}function RR(e,t){const r={...t};for(const i in t){const l=e[i],o=t[i];/^on[A-Z]/.test(i)?l&&o?r[i]=(...d)=>{const f=o(...d);return l(...d),f}:l&&(r[i]=l):i==="style"?r[i]={...l,...o}:i==="className"&&(r[i]=[l,o].filter(Boolean).join(" "))}return{...e,...r}}function OR(e){var i,l;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var MR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Kt=MR.reduce((e,t)=>{const r=_o(`Primitive.${t}`),i=w.forwardRef((l,o)=>{const{asChild:c,...d}=l,f=c?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(f,{...d,ref:o})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function DR(e,t){e&&Lo.flushSync(()=>e.dispatchEvent(t))}function Hi(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...r)=>{var i;return(i=t.current)==null?void 0:i.call(t,...r)},[])}function jR(e,t=globalThis==null?void 0:globalThis.document){const r=Hi(e);w.useEffect(()=>{const i=l=>{l.key==="Escape"&&r(l)};return t.addEventListener("keydown",i,{capture:!0}),()=>t.removeEventListener("keydown",i,{capture:!0})},[r,t])}var LR="DismissableLayer",Ip="dismissableLayer.update",IR="dismissableLayer.pointerDownOutside",zR="dismissableLayer.focusOutside",Ex,c1=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Am=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:o,onInteractOutside:c,onDismiss:d,...f}=e,h=w.useContext(c1),[g,m]=w.useState(null),x=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=w.useState({}),E=cn(t,z=>m(z)),S=Array.from(h.layers),[_]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=S.indexOf(_),A=g?S.indexOf(g):-1,T=h.layersWithOutsidePointerEventsDisabled.size>0,M=A>=C,P=UR(z=>{const G=z.target,Q=[...h.branches].some(R=>R.contains(G));!M||Q||(l==null||l(z),c==null||c(z),z.defaultPrevented||d==null||d())},x),N=FR(z=>{const G=z.target;[...h.branches].some(R=>R.contains(G))||(o==null||o(z),c==null||c(z),z.defaultPrevented||d==null||d())},x);return jR(z=>{A===h.layers.size-1&&(i==null||i(z),!z.defaultPrevented&&d&&(z.preventDefault(),d()))},x),w.useEffect(()=>{if(g)return r&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(Ex=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(g)),h.layers.add(g),Sx(),()=>{r&&h.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=Ex)}},[g,x,r,h]),w.useEffect(()=>()=>{g&&(h.layers.delete(g),h.layersWithOutsidePointerEventsDisabled.delete(g),Sx())},[g,h]),w.useEffect(()=>{const z=()=>v({});return document.addEventListener(Ip,z),()=>document.removeEventListener(Ip,z)},[]),p.jsx(Kt.div,{...f,ref:E,style:{pointerEvents:T?M?"auto":"none":void 0,...e.style},onFocusCapture:Yt(e.onFocusCapture,N.onFocusCapture),onBlurCapture:Yt(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:Yt(e.onPointerDownCapture,P.onPointerDownCapture)})});Am.displayName=LR;var PR="DismissableLayerBranch",BR=w.forwardRef((e,t)=>{const r=w.useContext(c1),i=w.useRef(null),l=cn(t,i);return w.useEffect(()=>{const o=i.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),p.jsx(Kt.div,{...e,ref:l})});BR.displayName=PR;function UR(e,t=globalThis==null?void 0:globalThis.document){const r=Hi(e),i=w.useRef(!1),l=w.useRef(()=>{});return w.useEffect(()=>{const o=d=>{if(d.target&&!i.current){let f=function(){u1(IR,r,h,{discrete:!0})};const h={originalEvent:d};d.pointerType==="touch"?(t.removeEventListener("click",l.current),l.current=f,t.addEventListener("click",l.current,{once:!0})):f()}else t.removeEventListener("click",l.current);i.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",o),t.removeEventListener("click",l.current)}},[t,r]),{onPointerDownCapture:()=>i.current=!0}}function FR(e,t=globalThis==null?void 0:globalThis.document){const r=Hi(e),i=w.useRef(!1);return w.useEffect(()=>{const l=o=>{o.target&&!i.current&&u1(zR,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",l),()=>t.removeEventListener("focusin",l)},[t,r]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function Sx(){const e=new CustomEvent(Ip);document.dispatchEvent(e)}function u1(e,t,r,{discrete:i}){const l=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&l.addEventListener(e,t,{once:!0}),i?DR(l,o):l.dispatchEvent(o)}var Bh="focusScope.autoFocusOnMount",Uh="focusScope.autoFocusOnUnmount",_x={bubbles:!1,cancelable:!0},$R="FocusScope",Rm=w.forwardRef((e,t)=>{const{loop:r=!1,trapped:i=!1,onMountAutoFocus:l,onUnmountAutoFocus:o,...c}=e,[d,f]=w.useState(null),h=Hi(l),g=Hi(o),m=w.useRef(null),x=cn(t,S=>f(S)),v=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(i){let S=function(T){if(v.paused||!d)return;const M=T.target;d.contains(M)?m.current=M:oi(m.current,{select:!0})},_=function(T){if(v.paused||!d)return;const M=T.relatedTarget;M!==null&&(d.contains(M)||oi(m.current,{select:!0}))},C=function(T){if(document.activeElement===document.body)for(const P of T)P.removedNodes.length>0&&oi(d)};document.addEventListener("focusin",S),document.addEventListener("focusout",_);const A=new MutationObserver(C);return d&&A.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",_),A.disconnect()}}},[i,d,v.paused]),w.useEffect(()=>{if(d){Cx.add(v);const S=document.activeElement;if(!d.contains(S)){const C=new CustomEvent(Bh,_x);d.addEventListener(Bh,h),d.dispatchEvent(C),C.defaultPrevented||(HR(YR(d1(d)),{select:!0}),document.activeElement===S&&oi(d))}return()=>{d.removeEventListener(Bh,h),setTimeout(()=>{const C=new CustomEvent(Uh,_x);d.addEventListener(Uh,g),d.dispatchEvent(C),C.defaultPrevented||oi(S??document.body,{select:!0}),d.removeEventListener(Uh,g),Cx.remove(v)},0)}}},[d,h,g,v]);const E=w.useCallback(S=>{if(!r&&!i||v.paused)return;const _=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,C=document.activeElement;if(_&&C){const A=S.currentTarget,[T,M]=KR(A);T&&M?!S.shiftKey&&C===M?(S.preventDefault(),r&&oi(T,{select:!0})):S.shiftKey&&C===T&&(S.preventDefault(),r&&oi(M,{select:!0})):C===A&&S.preventDefault()}},[r,i,v.paused]);return p.jsx(Kt.div,{tabIndex:-1,...c,ref:x,onKeyDown:E})});Rm.displayName=$R;function HR(e,{select:t=!1}={}){const r=document.activeElement;for(const i of e)if(oi(i,{select:t}),document.activeElement!==r)return}function KR(e){const t=d1(e),r=kx(t,e),i=kx(t.reverse(),e);return[r,i]}function d1(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const l=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||l?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function kx(e,t){for(const r of e)if(!qR(r,{upTo:t}))return r}function qR(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function GR(e){return e instanceof HTMLInputElement&&"select"in e}function oi(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&GR(e)&&t&&e.select()}}var Cx=VR();function VR(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Nx(e,t),e.unshift(t)},remove(t){var r;e=Nx(e,t),(r=e[0])==null||r.resume()}}}function Nx(e,t){const r=[...e],i=r.indexOf(t);return i!==-1&&r.splice(i,1),r}function YR(e){return e.filter(t=>t.tagName!=="A")}var XR="Portal",Om=w.forwardRef((e,t)=>{var d;const{container:r,...i}=e,[l,o]=w.useState(!1);On(()=>o(!0),[]);const c=r||l&&((d=globalThis==null?void 0:globalThis.document)==null?void 0:d.body);return c?OA.createPortal(p.jsx(Kt.div,{...i,ref:t}),c):null});Om.displayName=XR;function WR(e,t){return w.useReducer((r,i)=>t[r][i]??r,e)}var sd=e=>{const{present:t,children:r}=e,i=QR(t),l=typeof r=="function"?r({present:i.isPresent}):w.Children.only(r),o=cn(i.ref,ZR(l));return typeof r=="function"||i.isPresent?w.cloneElement(l,{ref:o}):null};sd.displayName="Presence";function QR(e){const[t,r]=w.useState(),i=w.useRef(null),l=w.useRef(e),o=w.useRef("none"),c=e?"mounted":"unmounted",[d,f]=WR(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const h=ru(i.current);o.current=d==="mounted"?h:"none"},[d]),On(()=>{const h=i.current,g=l.current;if(g!==e){const x=o.current,v=ru(h);e?f("MOUNT"):v==="none"||(h==null?void 0:h.display)==="none"?f("UNMOUNT"):f(g&&x!==v?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,f]),On(()=>{if(t){let h;const g=t.ownerDocument.defaultView??window,m=v=>{const S=ru(i.current).includes(CSS.escape(v.animationName));if(v.target===t&&S&&(f("ANIMATION_END"),!l.current)){const _=t.style.animationFillMode;t.style.animationFillMode="forwards",h=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=_)})}},x=v=>{v.target===t&&(o.current=ru(i.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{g.clearTimeout(h),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:w.useCallback(h=>{i.current=h?getComputedStyle(h):null,r(h)},[])}}function ru(e){return(e==null?void 0:e.animationName)||"none"}function ZR(e){var i,l;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Fh=0;function f1(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Tx()),document.body.insertAdjacentElement("beforeend",e[1]??Tx()),Fh++,()=>{Fh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Fh--}},[])}function Tx(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Qr=function(){return Qr=Object.assign||function(t){for(var r,i=1,l=arguments.length;i<l;i++){r=arguments[i];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},Qr.apply(this,arguments)};function h1(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,i=Object.getOwnPropertySymbols(e);l<i.length;l++)t.indexOf(i[l])<0&&Object.prototype.propertyIsEnumerable.call(e,i[l])&&(r[i[l]]=e[i[l]]);return r}function JR(e,t,r){if(r||arguments.length===2)for(var i=0,l=t.length,o;i<l;i++)(o||!(i in t))&&(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))}var Eu="right-scroll-bar-position",Su="width-before-scroll-bar",eO="with-scroll-bars-hidden",tO="--removed-body-scroll-bar-size";function $h(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function nO(e,t){var r=w.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(i){var l=r.value;l!==i&&(r.value=i,r.callback(i,l))}}}})[0];return r.callback=t,r.facade}var rO=typeof window<"u"?w.useLayoutEffect:w.useEffect,Ax=new WeakMap;function aO(e,t){var r=nO(null,function(i){return e.forEach(function(l){return $h(l,i)})});return rO(function(){var i=Ax.get(r);if(i){var l=new Set(i),o=new Set(e),c=r.current;l.forEach(function(d){o.has(d)||$h(d,null)}),o.forEach(function(d){l.has(d)||$h(d,c)})}Ax.set(r,e)},[e]),r}function iO(e){return e}function sO(e,t){t===void 0&&(t=iO);var r=[],i=!1,l={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(o){var c=t(o,i);return r.push(c),function(){r=r.filter(function(d){return d!==c})}},assignSyncMedium:function(o){for(i=!0;r.length;){var c=r;r=[],c.forEach(o)}r={push:function(d){return o(d)},filter:function(){return r}}},assignMedium:function(o){i=!0;var c=[];if(r.length){var d=r;r=[],d.forEach(o),c=r}var f=function(){var g=c;c=[],g.forEach(o)},h=function(){return Promise.resolve().then(f)};h(),r={push:function(g){c.push(g),h()},filter:function(g){return c=c.filter(g),r}}}};return l}function lO(e){e===void 0&&(e={});var t=sO(null);return t.options=Qr({async:!0,ssr:!1},e),t}var p1=function(e){var t=e.sideCar,r=h1(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=t.read();if(!i)throw new Error("Sidecar medium not found");return w.createElement(i,Qr({},r))};p1.isSideCarExport=!0;function oO(e,t){return e.useMedium(t),p1}var m1=lO(),Hh=function(){},ld=w.forwardRef(function(e,t){var r=w.useRef(null),i=w.useState({onScrollCapture:Hh,onWheelCapture:Hh,onTouchMoveCapture:Hh}),l=i[0],o=i[1],c=e.forwardProps,d=e.children,f=e.className,h=e.removeScrollBar,g=e.enabled,m=e.shards,x=e.sideCar,v=e.noRelative,E=e.noIsolation,S=e.inert,_=e.allowPinchZoom,C=e.as,A=C===void 0?"div":C,T=e.gapMode,M=h1(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=x,N=aO([r,t]),z=Qr(Qr({},M),l);return w.createElement(w.Fragment,null,g&&w.createElement(P,{sideCar:m1,removeScrollBar:h,shards:m,noRelative:v,noIsolation:E,inert:S,setCallbacks:o,allowPinchZoom:!!_,lockRef:r,gapMode:T}),c?w.cloneElement(w.Children.only(d),Qr(Qr({},z),{ref:N})):w.createElement(A,Qr({},z,{className:f,ref:N}),d))});ld.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ld.classNames={fullWidth:Su,zeroRight:Eu};var cO=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function uO(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=cO();return t&&e.setAttribute("nonce",t),e}function dO(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function fO(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var hO=function(){var e=0,t=null;return{add:function(r){e==0&&(t=uO())&&(dO(t,r),fO(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},pO=function(){var e=hO();return function(t,r){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},g1=function(){var e=pO(),t=function(r){var i=r.styles,l=r.dynamic;return e(i,l),null};return t},mO={left:0,top:0,right:0,gap:0},Kh=function(e){return parseInt(e||"",10)||0},gO=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],i=t[e==="padding"?"paddingTop":"marginTop"],l=t[e==="padding"?"paddingRight":"marginRight"];return[Kh(r),Kh(i),Kh(l)]},bO=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return mO;var t=gO(e),r=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-r+t[2]-t[0])}},yO=g1(),Ys="data-scroll-locked",xO=function(e,t,r,i){var l=e.left,o=e.top,c=e.right,d=e.gap;return r===void 0&&(r="margin"),`
396
- .`.concat(eO,` {
397
- overflow: hidden `).concat(i,`;
398
- padding-right: `).concat(d,"px ").concat(i,`;
399
- }
400
- body[`).concat(Ys,`] {
401
- overflow: hidden `).concat(i,`;
402
- overscroll-behavior: contain;
403
- `).concat([t&&"position: relative ".concat(i,";"),r==="margin"&&`
404
- padding-left: `.concat(l,`px;
405
- padding-top: `).concat(o,`px;
406
- padding-right: `).concat(c,`px;
407
- margin-left:0;
408
- margin-top:0;
409
- margin-right: `).concat(d,"px ").concat(i,`;
410
- `),r==="padding"&&"padding-right: ".concat(d,"px ").concat(i,";")].filter(Boolean).join(""),`
411
- }
412
-
413
- .`).concat(Eu,` {
414
- right: `).concat(d,"px ").concat(i,`;
415
- }
416
-
417
- .`).concat(Su,` {
418
- margin-right: `).concat(d,"px ").concat(i,`;
419
- }
420
-
421
- .`).concat(Eu," .").concat(Eu,` {
422
- right: 0 `).concat(i,`;
423
- }
424
-
425
- .`).concat(Su," .").concat(Su,` {
426
- margin-right: 0 `).concat(i,`;
427
- }
428
-
429
- body[`).concat(Ys,`] {
430
- `).concat(tO,": ").concat(d,`px;
431
- }
432
- `)},Rx=function(){var e=parseInt(document.body.getAttribute(Ys)||"0",10);return isFinite(e)?e:0},vO=function(){w.useEffect(function(){return document.body.setAttribute(Ys,(Rx()+1).toString()),function(){var e=Rx()-1;e<=0?document.body.removeAttribute(Ys):document.body.setAttribute(Ys,e.toString())}},[])},wO=function(e){var t=e.noRelative,r=e.noImportant,i=e.gapMode,l=i===void 0?"margin":i;vO();var o=w.useMemo(function(){return bO(l)},[l]);return w.createElement(yO,{styles:xO(o,!t,l,r?"":"!important")})},zp=!1;if(typeof window<"u")try{var au=Object.defineProperty({},"passive",{get:function(){return zp=!0,!0}});window.addEventListener("test",au,au),window.removeEventListener("test",au,au)}catch{zp=!1}var Is=zp?{passive:!1}:!1,EO=function(e){return e.tagName==="TEXTAREA"},b1=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!EO(e)&&r[t]==="visible")},SO=function(e){return b1(e,"overflowY")},_O=function(e){return b1(e,"overflowX")},Ox=function(e,t){var r=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var l=y1(e,i);if(l){var o=x1(e,i),c=o[1],d=o[2];if(c>d)return!0}i=i.parentNode}while(i&&i!==r.body);return!1},kO=function(e){var t=e.scrollTop,r=e.scrollHeight,i=e.clientHeight;return[t,r,i]},CO=function(e){var t=e.scrollLeft,r=e.scrollWidth,i=e.clientWidth;return[t,r,i]},y1=function(e,t){return e==="v"?SO(t):_O(t)},x1=function(e,t){return e==="v"?kO(t):CO(t)},NO=function(e,t){return e==="h"&&t==="rtl"?-1:1},TO=function(e,t,r,i,l){var o=NO(e,window.getComputedStyle(t).direction),c=o*i,d=r.target,f=t.contains(d),h=!1,g=c>0,m=0,x=0;do{if(!d)break;var v=x1(e,d),E=v[0],S=v[1],_=v[2],C=S-_-o*E;(E||C)&&y1(e,d)&&(m+=C,x+=E);var A=d.parentNode;d=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!f&&d!==document.body||f&&(t.contains(d)||t===d));return(g&&Math.abs(m)<1||!g&&Math.abs(x)<1)&&(h=!0),h},iu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Mx=function(e){return[e.deltaX,e.deltaY]},Dx=function(e){return e&&"current"in e?e.current:e},AO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},RO=function(e){return`
433
- .block-interactivity-`.concat(e,` {pointer-events: none;}
434
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
435
- `)},OO=0,zs=[];function MO(e){var t=w.useRef([]),r=w.useRef([0,0]),i=w.useRef(),l=w.useState(OO++)[0],o=w.useState(g1)[0],c=w.useRef(e);w.useEffect(function(){c.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var S=JR([e.lockRef.current],(e.shards||[]).map(Dx),!0).filter(Boolean);return S.forEach(function(_){return _.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),S.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var d=w.useCallback(function(S,_){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!c.current.allowPinchZoom;var C=iu(S),A=r.current,T="deltaX"in S?S.deltaX:A[0]-C[0],M="deltaY"in S?S.deltaY:A[1]-C[1],P,N=S.target,z=Math.abs(T)>Math.abs(M)?"h":"v";if("touches"in S&&z==="h"&&N.type==="range")return!1;var G=window.getSelection(),Q=G&&G.anchorNode,R=Q?Q===N||Q.contains(N):!1;if(R)return!1;var q=Ox(z,N);if(!q)return!0;if(q?P=z:(P=z==="v"?"h":"v",q=Ox(z,N)),!q)return!1;if(!i.current&&"changedTouches"in S&&(T||M)&&(i.current=P),!P)return!0;var Z=i.current||P;return TO(Z,_,S,Z==="h"?T:M)},[]),f=w.useCallback(function(S){var _=S;if(!(!zs.length||zs[zs.length-1]!==o)){var C="deltaY"in _?Mx(_):iu(_),A=t.current.filter(function(P){return P.name===_.type&&(P.target===_.target||_.target===P.shadowParent)&&AO(P.delta,C)})[0];if(A&&A.should){_.cancelable&&_.preventDefault();return}if(!A){var T=(c.current.shards||[]).map(Dx).filter(Boolean).filter(function(P){return P.contains(_.target)}),M=T.length>0?d(_,T[0]):!c.current.noIsolation;M&&_.cancelable&&_.preventDefault()}}},[]),h=w.useCallback(function(S,_,C,A){var T={name:S,delta:_,target:C,should:A,shadowParent:DO(C)};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(M){return M!==T})},1)},[]),g=w.useCallback(function(S){r.current=iu(S),i.current=void 0},[]),m=w.useCallback(function(S){h(S.type,Mx(S),S.target,d(S,e.lockRef.current))},[]),x=w.useCallback(function(S){h(S.type,iu(S),S.target,d(S,e.lockRef.current))},[]);w.useEffect(function(){return zs.push(o),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:x}),document.addEventListener("wheel",f,Is),document.addEventListener("touchmove",f,Is),document.addEventListener("touchstart",g,Is),function(){zs=zs.filter(function(S){return S!==o}),document.removeEventListener("wheel",f,Is),document.removeEventListener("touchmove",f,Is),document.removeEventListener("touchstart",g,Is)}},[]);var v=e.removeScrollBar,E=e.inert;return w.createElement(w.Fragment,null,E?w.createElement(o,{styles:RO(l)}):null,v?w.createElement(wO,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function DO(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const jO=oO(m1,MO);var Mm=w.forwardRef(function(e,t){return w.createElement(ld,Qr({},e,{ref:t,sideCar:jO}))});Mm.classNames=ld.classNames;var LO=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ps=new WeakMap,su=new WeakMap,lu={},qh=0,v1=function(e){return e&&(e.host||v1(e.parentNode))},IO=function(e,t){return t.map(function(r){if(e.contains(r))return r;var i=v1(r);return i&&e.contains(i)?i:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},zO=function(e,t,r,i){var l=IO(t,Array.isArray(e)?e:[e]);lu[r]||(lu[r]=new WeakMap);var o=lu[r],c=[],d=new Set,f=new Set(l),h=function(m){!m||d.has(m)||(d.add(m),h(m.parentNode))};l.forEach(h);var g=function(m){!m||f.has(m)||Array.prototype.forEach.call(m.children,function(x){if(d.has(x))g(x);else try{var v=x.getAttribute(i),E=v!==null&&v!=="false",S=(Ps.get(x)||0)+1,_=(o.get(x)||0)+1;Ps.set(x,S),o.set(x,_),c.push(x),S===1&&E&&su.set(x,!0),_===1&&x.setAttribute(r,"true"),E||x.setAttribute(i,"true")}catch(C){console.error("aria-hidden: cannot operate on ",x,C)}})};return g(t),d.clear(),qh++,function(){c.forEach(function(m){var x=Ps.get(m)-1,v=o.get(m)-1;Ps.set(m,x),o.set(m,v),x||(su.has(m)||m.removeAttribute(i),su.delete(m)),v||m.removeAttribute(r)}),qh--,qh||(Ps=new WeakMap,Ps=new WeakMap,su=new WeakMap,lu={})}},w1=function(e,t,r){r===void 0&&(r="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),l=LO(e);return l?(i.push.apply(i,Array.from(l.querySelectorAll("[aria-live], script"))),zO(i,l,r,"aria-hidden")):function(){return null}},od="Dialog",[E1]=id(od),[PO,$r]=E1(od),S1=e=>{const{__scopeDialog:t,children:r,open:i,defaultOpen:l,onOpenChange:o,modal:c=!0}=e,d=w.useRef(null),f=w.useRef(null),[h,g]=Lp({prop:i,defaultProp:l??!1,onChange:o,caller:od});return p.jsx(PO,{scope:t,triggerRef:d,contentRef:f,contentId:Vs(),titleId:Vs(),descriptionId:Vs(),open:h,onOpenChange:g,onOpenToggle:w.useCallback(()=>g(m=>!m),[g]),modal:c,children:r})};S1.displayName=od;var _1="DialogTrigger",BO=w.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,l=$r(_1,r),o=cn(t,l.triggerRef);return p.jsx(Kt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":Lm(l.open),...i,ref:o,onClick:Yt(e.onClick,l.onOpenToggle)})});BO.displayName=_1;var Dm="DialogPortal",[UO,k1]=E1(Dm,{forceMount:void 0}),C1=e=>{const{__scopeDialog:t,forceMount:r,children:i,container:l}=e,o=$r(Dm,t);return p.jsx(UO,{scope:t,forceMount:r,children:w.Children.map(i,c=>p.jsx(sd,{present:r||o.open,children:p.jsx(Om,{asChild:!0,container:l,children:c})}))})};C1.displayName=Dm;var Ou="DialogOverlay",N1=w.forwardRef((e,t)=>{const r=k1(Ou,e.__scopeDialog),{forceMount:i=r.forceMount,...l}=e,o=$r(Ou,e.__scopeDialog);return o.modal?p.jsx(sd,{present:i||o.open,children:p.jsx($O,{...l,ref:t})}):null});N1.displayName=Ou;var FO=_o("DialogOverlay.RemoveScroll"),$O=w.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,l=$r(Ou,r);return p.jsx(Mm,{as:FO,allowPinchZoom:!0,shards:[l.contentRef],children:p.jsx(Kt.div,{"data-state":Lm(l.open),...i,ref:t,style:{pointerEvents:"auto",...i.style}})})}),Ki="DialogContent",T1=w.forwardRef((e,t)=>{const r=k1(Ki,e.__scopeDialog),{forceMount:i=r.forceMount,...l}=e,o=$r(Ki,e.__scopeDialog);return p.jsx(sd,{present:i||o.open,children:o.modal?p.jsx(HO,{...l,ref:t}):p.jsx(KO,{...l,ref:t})})});T1.displayName=Ki;var HO=w.forwardRef((e,t)=>{const r=$r(Ki,e.__scopeDialog),i=w.useRef(null),l=cn(t,r.contentRef,i);return w.useEffect(()=>{const o=i.current;if(o)return w1(o)},[]),p.jsx(A1,{...e,ref:l,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Yt(e.onCloseAutoFocus,o=>{var c;o.preventDefault(),(c=r.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Yt(e.onPointerDownOutside,o=>{const c=o.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0;(c.button===2||d)&&o.preventDefault()}),onFocusOutside:Yt(e.onFocusOutside,o=>o.preventDefault())})}),KO=w.forwardRef((e,t)=>{const r=$r(Ki,e.__scopeDialog),i=w.useRef(!1),l=w.useRef(!1);return p.jsx(A1,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var c,d;(c=e.onCloseAutoFocus)==null||c.call(e,o),o.defaultPrevented||(i.current||(d=r.triggerRef.current)==null||d.focus(),o.preventDefault()),i.current=!1,l.current=!1},onInteractOutside:o=>{var f,h;(f=e.onInteractOutside)==null||f.call(e,o),o.defaultPrevented||(i.current=!0,o.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const c=o.target;((h=r.triggerRef.current)==null?void 0:h.contains(c))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&l.current&&o.preventDefault()}})}),A1=w.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:i,onOpenAutoFocus:l,onCloseAutoFocus:o,...c}=e,d=$r(Ki,r),f=w.useRef(null),h=cn(t,f);return f1(),p.jsxs(p.Fragment,{children:[p.jsx(Rm,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:l,onUnmountAutoFocus:o,children:p.jsx(Am,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":Lm(d.open),...c,ref:h,onDismiss:()=>d.onOpenChange(!1)})}),p.jsxs(p.Fragment,{children:[p.jsx(GO,{titleId:d.titleId}),p.jsx(YO,{contentRef:f,descriptionId:d.descriptionId})]})]})}),jm="DialogTitle",R1=w.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,l=$r(jm,r);return p.jsx(Kt.h2,{id:l.titleId,...i,ref:t})});R1.displayName=jm;var O1="DialogDescription",qO=w.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,l=$r(O1,r);return p.jsx(Kt.p,{id:l.descriptionId,...i,ref:t})});qO.displayName=O1;var M1="DialogClose",D1=w.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,l=$r(M1,r);return p.jsx(Kt.button,{type:"button",...i,ref:t,onClick:Yt(e.onClick,()=>l.onOpenChange(!1))})});D1.displayName=M1;function Lm(e){return e?"open":"closed"}var j1="DialogTitleWarning",[jF,L1]=vR(j1,{contentName:Ki,titleName:jm,docsSlug:"dialog"}),GO=({titleId:e})=>{const t=L1(j1),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
436
-
437
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
438
-
439
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return w.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},VO="DialogDescriptionWarning",YO=({contentRef:e,descriptionId:t})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${L1(VO).contentName}}.`;return w.useEffect(()=>{var o;const l=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&l&&(document.getElementById(t)||console.warn(i))},[i,e,t]),null},XO=S1,WO=C1,QO=N1,ZO=T1,JO=R1,eM=D1;function Pr({open:e,onClose:t,title:r,children:i,className:l}){return p.jsx(XO,{open:e,onOpenChange:o=>{o||t()},children:p.jsxs(WO,{children:[p.jsx(QO,{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-fade-in"}),p.jsxs(ZO,{className:Ke("fixed inset-x-4 top-1/2 z-50 grid max-h-[calc(100dvh-2rem)] max-w-lg -translate-y-1/2 gap-4 overflow-y-auto","rounded-lg border bg-popover p-5 text-popover-foreground shadow-lg outline-none sm:left-1/2 sm:right-auto sm:w-[calc(100%-2rem)] sm:-translate-x-1/2 sm:p-6",l),children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx(JO,{className:"text-lg font-semibold leading-none tracking-tight",children:r}),p.jsx(eM,{className:Ke("rounded-sm p-1 opacity-70 transition-opacity hover:opacity-100","focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2"),"aria-label":"Close",children:p.jsx(Np,{size:18})})]}),i]})]})})}function jx(e,[t,r]){return Math.min(r,Math.max(t,e))}function tM(e){const t=e+"CollectionProvider",[r,i]=id(t),[l,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:_,children:C}=S,A=kt.useRef(null),T=kt.useRef(new Map).current;return p.jsx(l,{scope:_,itemMap:T,collectionRef:A,children:C})};c.displayName=t;const d=e+"CollectionSlot",f=_o(d),h=kt.forwardRef((S,_)=>{const{scope:C,children:A}=S,T=o(d,C),M=cn(_,T.collectionRef);return p.jsx(f,{ref:M,children:A})});h.displayName=d;const g=e+"CollectionItemSlot",m="data-radix-collection-item",x=_o(g),v=kt.forwardRef((S,_)=>{const{scope:C,children:A,...T}=S,M=kt.useRef(null),P=cn(_,M),N=o(g,C);return kt.useEffect(()=>(N.itemMap.set(M,{ref:M,...T}),()=>void N.itemMap.delete(M))),p.jsx(x,{[m]:"",ref:P,children:A})});v.displayName=g;function E(S){const _=o(e+"CollectionConsumer",S);return kt.useCallback(()=>{const A=_.collectionRef.current;if(!A)return[];const T=Array.from(A.querySelectorAll(`[${m}]`));return Array.from(_.itemMap.values()).sort((N,z)=>T.indexOf(N.ref.current)-T.indexOf(z.ref.current))},[_.collectionRef,_.itemMap])}return[{Provider:c,Slot:h,ItemSlot:v},E,i]}var nM=w.createContext(void 0);function rM(e){const t=w.useContext(nM);return e||t||"ltr"}const aM=["top","right","bottom","left"],hi=Math.min,ur=Math.max,Mu=Math.round,ou=Math.floor,na=e=>({x:e,y:e}),iM={left:"right",right:"left",bottom:"top",top:"bottom"};function Pp(e,t,r){return ur(e,hi(t,r))}function Ta(e,t){return typeof e=="function"?e(t):e}function Aa(e){return e.split("-")[0]}function al(e){return e.split("-")[1]}function Im(e){return e==="x"?"y":"x"}function zm(e){return e==="y"?"height":"width"}function Zr(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Pm(e){return Im(Zr(e))}function sM(e,t,r){r===void 0&&(r=!1);const i=al(e),l=Pm(e),o=zm(l);let c=l==="x"?i===(r?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(c=Du(c)),[c,Du(c)]}function lM(e){const t=Du(e);return[Bp(e),t,Bp(t)]}function Bp(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Lx=["left","right"],Ix=["right","left"],oM=["top","bottom"],cM=["bottom","top"];function uM(e,t,r){switch(e){case"top":case"bottom":return r?t?Ix:Lx:t?Lx:Ix;case"left":case"right":return t?oM:cM;default:return[]}}function dM(e,t,r,i){const l=al(e);let o=uM(Aa(e),r==="start",i);return l&&(o=o.map(c=>c+"-"+l),t&&(o=o.concat(o.map(Bp)))),o}function Du(e){const t=Aa(e);return iM[t]+e.slice(t.length)}function fM(e){return{top:0,right:0,bottom:0,left:0,...e}}function I1(e){return typeof e!="number"?fM(e):{top:e,right:e,bottom:e,left:e}}function ju(e){const{x:t,y:r,width:i,height:l}=e;return{width:i,height:l,top:r,left:t,right:t+i,bottom:r+l,x:t,y:r}}function zx(e,t,r){let{reference:i,floating:l}=e;const o=Zr(t),c=Pm(t),d=zm(c),f=Aa(t),h=o==="y",g=i.x+i.width/2-l.width/2,m=i.y+i.height/2-l.height/2,x=i[d]/2-l[d]/2;let v;switch(f){case"top":v={x:g,y:i.y-l.height};break;case"bottom":v={x:g,y:i.y+i.height};break;case"right":v={x:i.x+i.width,y:m};break;case"left":v={x:i.x-l.width,y:m};break;default:v={x:i.x,y:i.y}}switch(al(t)){case"start":v[c]-=x*(r&&h?-1:1);break;case"end":v[c]+=x*(r&&h?-1:1);break}return v}async function hM(e,t){var r;t===void 0&&(t={});const{x:i,y:l,platform:o,rects:c,elements:d,strategy:f}=e,{boundary:h="clippingAncestors",rootBoundary:g="viewport",elementContext:m="floating",altBoundary:x=!1,padding:v=0}=Ta(t,e),E=I1(v),_=d[x?m==="floating"?"reference":"floating":m],C=ju(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(_)))==null||r?_:_.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(d.floating)),boundary:h,rootBoundary:g,strategy:f})),A=m==="floating"?{x:i,y:l,width:c.floating.width,height:c.floating.height}:c.reference,T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d.floating)),M=await(o.isElement==null?void 0:o.isElement(T))?await(o.getScale==null?void 0:o.getScale(T))||{x:1,y:1}:{x:1,y:1},P=ju(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:A,offsetParent:T,strategy:f}):A);return{top:(C.top-P.top+E.top)/M.y,bottom:(P.bottom-C.bottom+E.bottom)/M.y,left:(C.left-P.left+E.left)/M.x,right:(P.right-C.right+E.right)/M.x}}const pM=50,mM=async(e,t,r)=>{const{placement:i="bottom",strategy:l="absolute",middleware:o=[],platform:c}=r,d=c.detectOverflow?c:{...c,detectOverflow:hM},f=await(c.isRTL==null?void 0:c.isRTL(t));let h=await c.getElementRects({reference:e,floating:t,strategy:l}),{x:g,y:m}=zx(h,i,f),x=i,v=0;const E={};for(let S=0;S<o.length;S++){const _=o[S];if(!_)continue;const{name:C,fn:A}=_,{x:T,y:M,data:P,reset:N}=await A({x:g,y:m,initialPlacement:i,placement:x,strategy:l,middlewareData:E,rects:h,platform:d,elements:{reference:e,floating:t}});g=T??g,m=M??m,E[C]={...E[C],...P},N&&v<pM&&(v++,typeof N=="object"&&(N.placement&&(x=N.placement),N.rects&&(h=N.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:l}):N.rects),{x:g,y:m}=zx(h,x,f)),S=-1)}return{x:g,y:m,placement:x,strategy:l,middlewareData:E}},gM=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:i,placement:l,rects:o,platform:c,elements:d,middlewareData:f}=t,{element:h,padding:g=0}=Ta(e,t)||{};if(h==null)return{};const m=I1(g),x={x:r,y:i},v=Pm(l),E=zm(v),S=await c.getDimensions(h),_=v==="y",C=_?"top":"left",A=_?"bottom":"right",T=_?"clientHeight":"clientWidth",M=o.reference[E]+o.reference[v]-x[v]-o.floating[E],P=x[v]-o.reference[v],N=await(c.getOffsetParent==null?void 0:c.getOffsetParent(h));let z=N?N[T]:0;(!z||!await(c.isElement==null?void 0:c.isElement(N)))&&(z=d.floating[T]||o.floating[E]);const G=M/2-P/2,Q=z/2-S[E]/2-1,R=hi(m[C],Q),q=hi(m[A],Q),Z=R,ne=z-S[E]-q,Y=z/2-S[E]/2+G,H=Pp(Z,Y,ne),j=!f.arrow&&al(l)!=null&&Y!==H&&o.reference[E]/2-(Y<Z?R:q)-S[E]/2<0,F=j?Y<Z?Y-Z:Y-ne:0;return{[v]:x[v]+F,data:{[v]:H,centerOffset:Y-H-F,...j&&{alignmentOffset:F}},reset:j}}}),bM=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,i;const{placement:l,middlewareData:o,rects:c,initialPlacement:d,platform:f,elements:h}=t,{mainAxis:g=!0,crossAxis:m=!0,fallbackPlacements:x,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:S=!0,..._}=Ta(e,t);if((r=o.arrow)!=null&&r.alignmentOffset)return{};const C=Aa(l),A=Zr(d),T=Aa(d)===d,M=await(f.isRTL==null?void 0:f.isRTL(h.floating)),P=x||(T||!S?[Du(d)]:lM(d)),N=E!=="none";!x&&N&&P.push(...dM(d,S,E,M));const z=[d,...P],G=await f.detectOverflow(t,_),Q=[];let R=((i=o.flip)==null?void 0:i.overflows)||[];if(g&&Q.push(G[C]),m){const Y=sM(l,c,M);Q.push(G[Y[0]],G[Y[1]])}if(R=[...R,{placement:l,overflows:Q}],!Q.every(Y=>Y<=0)){var q,Z;const Y=(((q=o.flip)==null?void 0:q.index)||0)+1,H=z[Y];if(H&&(!(m==="alignment"?A!==Zr(H):!1)||R.every(W=>Zr(W.placement)===A?W.overflows[0]>0:!0)))return{data:{index:Y,overflows:R},reset:{placement:H}};let j=(Z=R.filter(F=>F.overflows[0]<=0).sort((F,W)=>F.overflows[1]-W.overflows[1])[0])==null?void 0:Z.placement;if(!j)switch(v){case"bestFit":{var ne;const F=(ne=R.filter(W=>{if(N){const K=Zr(W.placement);return K===A||K==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(K=>K>0).reduce((K,L)=>K+L,0)]).sort((W,K)=>W[1]-K[1])[0])==null?void 0:ne[0];F&&(j=F);break}case"initialPlacement":j=d;break}if(l!==j)return{reset:{placement:j}}}return{}}}};function Px(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Bx(e){return aM.some(t=>e[t]>=0)}const yM=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:i}=t,{strategy:l="referenceHidden",...o}=Ta(e,t);switch(l){case"referenceHidden":{const c=await i.detectOverflow(t,{...o,elementContext:"reference"}),d=Px(c,r.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:Bx(d)}}}case"escaped":{const c=await i.detectOverflow(t,{...o,altBoundary:!0}),d=Px(c,r.floating);return{data:{escapedOffsets:d,escaped:Bx(d)}}}default:return{}}}}},z1=new Set(["left","top"]);async function xM(e,t){const{placement:r,platform:i,elements:l}=e,o=await(i.isRTL==null?void 0:i.isRTL(l.floating)),c=Aa(r),d=al(r),f=Zr(r)==="y",h=z1.has(c)?-1:1,g=o&&f?-1:1,m=Ta(t,e);let{mainAxis:x,crossAxis:v,alignmentAxis:E}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return d&&typeof E=="number"&&(v=d==="end"?E*-1:E),f?{x:v*g,y:x*h}:{x:x*h,y:v*g}}const vM=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,i;const{x:l,y:o,placement:c,middlewareData:d}=t,f=await xM(t,e);return c===((r=d.offset)==null?void 0:r.placement)&&(i=d.arrow)!=null&&i.alignmentOffset?{}:{x:l+f.x,y:o+f.y,data:{...f,placement:c}}}}},wM=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:i,placement:l,platform:o}=t,{mainAxis:c=!0,crossAxis:d=!1,limiter:f={fn:C=>{let{x:A,y:T}=C;return{x:A,y:T}}},...h}=Ta(e,t),g={x:r,y:i},m=await o.detectOverflow(t,h),x=Zr(Aa(l)),v=Im(x);let E=g[v],S=g[x];if(c){const C=v==="y"?"top":"left",A=v==="y"?"bottom":"right",T=E+m[C],M=E-m[A];E=Pp(T,E,M)}if(d){const C=x==="y"?"top":"left",A=x==="y"?"bottom":"right",T=S+m[C],M=S-m[A];S=Pp(T,S,M)}const _=f.fn({...t,[v]:E,[x]:S});return{..._,data:{x:_.x-r,y:_.y-i,enabled:{[v]:c,[x]:d}}}}}},EM=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:i,placement:l,rects:o,middlewareData:c}=t,{offset:d=0,mainAxis:f=!0,crossAxis:h=!0}=Ta(e,t),g={x:r,y:i},m=Zr(l),x=Im(m);let v=g[x],E=g[m];const S=Ta(d,t),_=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(f){const T=x==="y"?"height":"width",M=o.reference[x]-o.floating[T]+_.mainAxis,P=o.reference[x]+o.reference[T]-_.mainAxis;v<M?v=M:v>P&&(v=P)}if(h){var C,A;const T=x==="y"?"width":"height",M=z1.has(Aa(l)),P=o.reference[m]-o.floating[T]+(M&&((C=c.offset)==null?void 0:C[m])||0)+(M?0:_.crossAxis),N=o.reference[m]+o.reference[T]+(M?0:((A=c.offset)==null?void 0:A[m])||0)-(M?_.crossAxis:0);E<P?E=P:E>N&&(E=N)}return{[x]:v,[m]:E}}}},SM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,i;const{placement:l,rects:o,platform:c,elements:d}=t,{apply:f=()=>{},...h}=Ta(e,t),g=await c.detectOverflow(t,h),m=Aa(l),x=al(l),v=Zr(l)==="y",{width:E,height:S}=o.floating;let _,C;m==="top"||m==="bottom"?(_=m,C=x===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(C=m,_=x==="end"?"top":"bottom");const A=S-g.top-g.bottom,T=E-g.left-g.right,M=hi(S-g[_],A),P=hi(E-g[C],T),N=!t.middlewareData.shift;let z=M,G=P;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(G=T),(i=t.middlewareData.shift)!=null&&i.enabled.y&&(z=A),N&&!x){const R=ur(g.left,0),q=ur(g.right,0),Z=ur(g.top,0),ne=ur(g.bottom,0);v?G=E-2*(R!==0||q!==0?R+q:ur(g.left,g.right)):z=S-2*(Z!==0||ne!==0?Z+ne:ur(g.top,g.bottom))}await f({...t,availableWidth:G,availableHeight:z});const Q=await c.getDimensions(d.floating);return E!==Q.width||S!==Q.height?{reset:{rects:!0}}:{}}}};function cd(){return typeof window<"u"}function il(e){return P1(e)?(e.nodeName||"").toLowerCase():"#document"}function dr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ra(e){var t;return(t=(P1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function P1(e){return cd()?e instanceof Node||e instanceof dr(e).Node:!1}function Br(e){return cd()?e instanceof Element||e instanceof dr(e).Element:!1}function Ra(e){return cd()?e instanceof HTMLElement||e instanceof dr(e).HTMLElement:!1}function Ux(e){return!cd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof dr(e).ShadowRoot}function Io(e){const{overflow:t,overflowX:r,overflowY:i,display:l}=Ur(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+r)&&l!=="inline"&&l!=="contents"}function _M(e){return/^(table|td|th)$/.test(il(e))}function ud(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const kM=/transform|translate|scale|rotate|perspective|filter/,CM=/paint|layout|strict|content/,zi=e=>!!e&&e!=="none";let Gh;function Bm(e){const t=Br(e)?Ur(e):e;return zi(t.transform)||zi(t.translate)||zi(t.scale)||zi(t.rotate)||zi(t.perspective)||!Um()&&(zi(t.backdropFilter)||zi(t.filter))||kM.test(t.willChange||"")||CM.test(t.contain||"")}function NM(e){let t=pi(e);for(;Ra(t)&&!Js(t);){if(Bm(t))return t;if(ud(t))return null;t=pi(t)}return null}function Um(){return Gh==null&&(Gh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Gh}function Js(e){return/^(html|body|#document)$/.test(il(e))}function Ur(e){return dr(e).getComputedStyle(e)}function dd(e){return Br(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function pi(e){if(il(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ux(e)&&e.host||ra(e);return Ux(t)?t.host:t}function B1(e){const t=pi(e);return Js(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ra(t)&&Io(t)?t:B1(t)}function ko(e,t,r){var i;t===void 0&&(t=[]),r===void 0&&(r=!0);const l=B1(e),o=l===((i=e.ownerDocument)==null?void 0:i.body),c=dr(l);if(o){const d=Up(c);return t.concat(c,c.visualViewport||[],Io(l)?l:[],d&&r?ko(d):[])}else return t.concat(l,ko(l,[],r))}function Up(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function U1(e){const t=Ur(e);let r=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const l=Ra(e),o=l?e.offsetWidth:r,c=l?e.offsetHeight:i,d=Mu(r)!==o||Mu(i)!==c;return d&&(r=o,i=c),{width:r,height:i,$:d}}function Fm(e){return Br(e)?e:e.contextElement}function Xs(e){const t=Fm(e);if(!Ra(t))return na(1);const r=t.getBoundingClientRect(),{width:i,height:l,$:o}=U1(t);let c=(o?Mu(r.width):r.width)/i,d=(o?Mu(r.height):r.height)/l;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const TM=na(0);function F1(e){const t=dr(e);return!Um()||!t.visualViewport?TM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function AM(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==dr(e)?!1:t}function qi(e,t,r,i){t===void 0&&(t=!1),r===void 0&&(r=!1);const l=e.getBoundingClientRect(),o=Fm(e);let c=na(1);t&&(i?Br(i)&&(c=Xs(i)):c=Xs(e));const d=AM(o,r,i)?F1(o):na(0);let f=(l.left+d.x)/c.x,h=(l.top+d.y)/c.y,g=l.width/c.x,m=l.height/c.y;if(o){const x=dr(o),v=i&&Br(i)?dr(i):i;let E=x,S=Up(E);for(;S&&i&&v!==E;){const _=Xs(S),C=S.getBoundingClientRect(),A=Ur(S),T=C.left+(S.clientLeft+parseFloat(A.paddingLeft))*_.x,M=C.top+(S.clientTop+parseFloat(A.paddingTop))*_.y;f*=_.x,h*=_.y,g*=_.x,m*=_.y,f+=T,h+=M,E=dr(S),S=Up(E)}}return ju({width:g,height:m,x:f,y:h})}function fd(e,t){const r=dd(e).scrollLeft;return t?t.left+r:qi(ra(e)).left+r}function $1(e,t){const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-fd(e,r),l=r.top+t.scrollTop;return{x:i,y:l}}function RM(e){let{elements:t,rect:r,offsetParent:i,strategy:l}=e;const o=l==="fixed",c=ra(i),d=t?ud(t.floating):!1;if(i===c||d&&o)return r;let f={scrollLeft:0,scrollTop:0},h=na(1);const g=na(0),m=Ra(i);if((m||!m&&!o)&&((il(i)!=="body"||Io(c))&&(f=dd(i)),m)){const v=qi(i);h=Xs(i),g.x=v.x+i.clientLeft,g.y=v.y+i.clientTop}const x=c&&!m&&!o?$1(c,f):na(0);return{width:r.width*h.x,height:r.height*h.y,x:r.x*h.x-f.scrollLeft*h.x+g.x+x.x,y:r.y*h.y-f.scrollTop*h.y+g.y+x.y}}function OM(e){return Array.from(e.getClientRects())}function MM(e){const t=ra(e),r=dd(e),i=e.ownerDocument.body,l=ur(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),o=ur(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let c=-r.scrollLeft+fd(e);const d=-r.scrollTop;return Ur(i).direction==="rtl"&&(c+=ur(t.clientWidth,i.clientWidth)-l),{width:l,height:o,x:c,y:d}}const Fx=25;function DM(e,t){const r=dr(e),i=ra(e),l=r.visualViewport;let o=i.clientWidth,c=i.clientHeight,d=0,f=0;if(l){o=l.width,c=l.height;const g=Um();(!g||g&&t==="fixed")&&(d=l.offsetLeft,f=l.offsetTop)}const h=fd(i);if(h<=0){const g=i.ownerDocument,m=g.body,x=getComputedStyle(m),v=g.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,E=Math.abs(i.clientWidth-m.clientWidth-v);E<=Fx&&(o-=E)}else h<=Fx&&(o+=h);return{width:o,height:c,x:d,y:f}}function jM(e,t){const r=qi(e,!0,t==="fixed"),i=r.top+e.clientTop,l=r.left+e.clientLeft,o=Ra(e)?Xs(e):na(1),c=e.clientWidth*o.x,d=e.clientHeight*o.y,f=l*o.x,h=i*o.y;return{width:c,height:d,x:f,y:h}}function $x(e,t,r){let i;if(t==="viewport")i=DM(e,r);else if(t==="document")i=MM(ra(e));else if(Br(t))i=jM(t,r);else{const l=F1(e);i={x:t.x-l.x,y:t.y-l.y,width:t.width,height:t.height}}return ju(i)}function H1(e,t){const r=pi(e);return r===t||!Br(r)||Js(r)?!1:Ur(r).position==="fixed"||H1(r,t)}function LM(e,t){const r=t.get(e);if(r)return r;let i=ko(e,[],!1).filter(d=>Br(d)&&il(d)!=="body"),l=null;const o=Ur(e).position==="fixed";let c=o?pi(e):e;for(;Br(c)&&!Js(c);){const d=Ur(c),f=Bm(c);!f&&d.position==="fixed"&&(l=null),(o?!f&&!l:!f&&d.position==="static"&&!!l&&(l.position==="absolute"||l.position==="fixed")||Io(c)&&!f&&H1(e,c))?i=i.filter(g=>g!==c):l=d,c=pi(c)}return t.set(e,i),i}function IM(e){let{element:t,boundary:r,rootBoundary:i,strategy:l}=e;const c=[...r==="clippingAncestors"?ud(t)?[]:LM(t,this._c):[].concat(r),i],d=$x(t,c[0],l);let f=d.top,h=d.right,g=d.bottom,m=d.left;for(let x=1;x<c.length;x++){const v=$x(t,c[x],l);f=ur(v.top,f),h=hi(v.right,h),g=hi(v.bottom,g),m=ur(v.left,m)}return{width:h-m,height:g-f,x:m,y:f}}function zM(e){const{width:t,height:r}=U1(e);return{width:t,height:r}}function PM(e,t,r){const i=Ra(t),l=ra(t),o=r==="fixed",c=qi(e,!0,o,t);let d={scrollLeft:0,scrollTop:0};const f=na(0);function h(){f.x=fd(l)}if(i||!i&&!o)if((il(t)!=="body"||Io(l))&&(d=dd(t)),i){const v=qi(t,!0,o,t);f.x=v.x+t.clientLeft,f.y=v.y+t.clientTop}else l&&h();o&&!i&&l&&h();const g=l&&!i&&!o?$1(l,d):na(0),m=c.left+d.scrollLeft-f.x-g.x,x=c.top+d.scrollTop-f.y-g.y;return{x:m,y:x,width:c.width,height:c.height}}function Vh(e){return Ur(e).position==="static"}function Hx(e,t){if(!Ra(e)||Ur(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return ra(e)===r&&(r=r.ownerDocument.body),r}function K1(e,t){const r=dr(e);if(ud(e))return r;if(!Ra(e)){let l=pi(e);for(;l&&!Js(l);){if(Br(l)&&!Vh(l))return l;l=pi(l)}return r}let i=Hx(e,t);for(;i&&_M(i)&&Vh(i);)i=Hx(i,t);return i&&Js(i)&&Vh(i)&&!Bm(i)?r:i||NM(e)||r}const BM=async function(e){const t=this.getOffsetParent||K1,r=this.getDimensions,i=await r(e.floating);return{reference:PM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function UM(e){return Ur(e).direction==="rtl"}const FM={convertOffsetParentRelativeRectToViewportRelativeRect:RM,getDocumentElement:ra,getClippingRect:IM,getOffsetParent:K1,getElementRects:BM,getClientRects:OM,getDimensions:zM,getScale:Xs,isElement:Br,isRTL:UM};function q1(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $M(e,t){let r=null,i;const l=ra(e);function o(){var d;clearTimeout(i),(d=r)==null||d.disconnect(),r=null}function c(d,f){d===void 0&&(d=!1),f===void 0&&(f=1),o();const h=e.getBoundingClientRect(),{left:g,top:m,width:x,height:v}=h;if(d||t(),!x||!v)return;const E=ou(m),S=ou(l.clientWidth-(g+x)),_=ou(l.clientHeight-(m+v)),C=ou(g),T={rootMargin:-E+"px "+-S+"px "+-_+"px "+-C+"px",threshold:ur(0,hi(1,f))||1};let M=!0;function P(N){const z=N[0].intersectionRatio;if(z!==f){if(!M)return c();z?c(!1,z):i=setTimeout(()=>{c(!1,1e-7)},1e3)}z===1&&!q1(h,e.getBoundingClientRect())&&c(),M=!1}try{r=new IntersectionObserver(P,{...T,root:l.ownerDocument})}catch{r=new IntersectionObserver(P,T)}r.observe(e)}return c(!0),o}function HM(e,t,r,i){i===void 0&&(i={});const{ancestorScroll:l=!0,ancestorResize:o=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:f=!1}=i,h=Fm(e),g=l||o?[...h?ko(h):[],...t?ko(t):[]]:[];g.forEach(C=>{l&&C.addEventListener("scroll",r,{passive:!0}),o&&C.addEventListener("resize",r)});const m=h&&d?$M(h,r):null;let x=-1,v=null;c&&(v=new ResizeObserver(C=>{let[A]=C;A&&A.target===h&&v&&t&&(v.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var T;(T=v)==null||T.observe(t)})),r()}),h&&!f&&v.observe(h),t&&v.observe(t));let E,S=f?qi(e):null;f&&_();function _(){const C=qi(e);S&&!q1(S,C)&&r(),S=C,E=requestAnimationFrame(_)}return r(),()=>{var C;g.forEach(A=>{l&&A.removeEventListener("scroll",r),o&&A.removeEventListener("resize",r)}),m==null||m(),(C=v)==null||C.disconnect(),v=null,f&&cancelAnimationFrame(E)}}const KM=vM,qM=wM,GM=bM,VM=SM,YM=yM,Kx=gM,XM=EM,WM=(e,t,r)=>{const i=new Map,l={platform:FM,...r},o={...l.platform,_c:i};return mM(e,t,{...l,platform:o})};var QM=typeof document<"u",ZM=function(){},_u=QM?w.useLayoutEffect:ZM;function Lu(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,i,l;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(i=r;i--!==0;)if(!Lu(e[i],t[i]))return!1;return!0}if(l=Object.keys(e),r=l.length,r!==Object.keys(t).length)return!1;for(i=r;i--!==0;)if(!{}.hasOwnProperty.call(t,l[i]))return!1;for(i=r;i--!==0;){const o=l[i];if(!(o==="_owner"&&e.$$typeof)&&!Lu(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function G1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qx(e,t){const r=G1(e);return Math.round(t*r)/r}function Yh(e){const t=w.useRef(e);return _u(()=>{t.current=e}),t}function JM(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:i=[],platform:l,elements:{reference:o,floating:c}={},transform:d=!0,whileElementsMounted:f,open:h}=e,[g,m]=w.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[x,v]=w.useState(i);Lu(x,i)||v(i);const[E,S]=w.useState(null),[_,C]=w.useState(null),A=w.useCallback(W=>{W!==N.current&&(N.current=W,S(W))},[]),T=w.useCallback(W=>{W!==z.current&&(z.current=W,C(W))},[]),M=o||E,P=c||_,N=w.useRef(null),z=w.useRef(null),G=w.useRef(g),Q=f!=null,R=Yh(f),q=Yh(l),Z=Yh(h),ne=w.useCallback(()=>{if(!N.current||!z.current)return;const W={placement:t,strategy:r,middleware:x};q.current&&(W.platform=q.current),WM(N.current,z.current,W).then(K=>{const L={...K,isPositioned:Z.current!==!1};Y.current&&!Lu(G.current,L)&&(G.current=L,Lo.flushSync(()=>{m(L)}))})},[x,t,r,q,Z]);_u(()=>{h===!1&&G.current.isPositioned&&(G.current.isPositioned=!1,m(W=>({...W,isPositioned:!1})))},[h]);const Y=w.useRef(!1);_u(()=>(Y.current=!0,()=>{Y.current=!1}),[]),_u(()=>{if(M&&(N.current=M),P&&(z.current=P),M&&P){if(R.current)return R.current(M,P,ne);ne()}},[M,P,ne,R,Q]);const H=w.useMemo(()=>({reference:N,floating:z,setReference:A,setFloating:T}),[A,T]),j=w.useMemo(()=>({reference:M,floating:P}),[M,P]),F=w.useMemo(()=>{const W={position:r,left:0,top:0};if(!j.floating)return W;const K=qx(j.floating,g.x),L=qx(j.floating,g.y);return d?{...W,transform:"translate("+K+"px, "+L+"px)",...G1(j.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:K,top:L}},[r,d,j.floating,g.x,g.y]);return w.useMemo(()=>({...g,update:ne,refs:H,elements:j,floatingStyles:F}),[g,ne,H,j,F])}const eD=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:i,padding:l}=typeof e=="function"?e(r):e;return i&&t(i)?i.current!=null?Kx({element:i.current,padding:l}).fn(r):{}:i?Kx({element:i,padding:l}).fn(r):{}}}},tD=(e,t)=>{const r=KM(e);return{name:r.name,fn:r.fn,options:[e,t]}},nD=(e,t)=>{const r=qM(e);return{name:r.name,fn:r.fn,options:[e,t]}},rD=(e,t)=>({fn:XM(e).fn,options:[e,t]}),aD=(e,t)=>{const r=GM(e);return{name:r.name,fn:r.fn,options:[e,t]}},iD=(e,t)=>{const r=VM(e);return{name:r.name,fn:r.fn,options:[e,t]}},sD=(e,t)=>{const r=YM(e);return{name:r.name,fn:r.fn,options:[e,t]}},lD=(e,t)=>{const r=eD(e);return{name:r.name,fn:r.fn,options:[e,t]}};var oD="Arrow",V1=w.forwardRef((e,t)=>{const{children:r,width:i=10,height:l=5,...o}=e;return p.jsx(Kt.svg,{...o,ref:t,width:i,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});V1.displayName=oD;var cD=V1;function uD(e){const[t,r]=w.useState(void 0);return On(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const o=l[0];let c,d;if("borderBoxSize"in o){const f=o.borderBoxSize,h=Array.isArray(f)?f[0]:f;c=h.inlineSize,d=h.blockSize}else c=e.offsetWidth,d=e.offsetHeight;r({width:c,height:d})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else r(void 0)},[e]),t}var $m="Popper",[Y1,X1]=id($m),[dD,W1]=Y1($m),Q1=e=>{const{__scopePopper:t,children:r}=e,[i,l]=w.useState(null);return p.jsx(dD,{scope:t,anchor:i,onAnchorChange:l,children:r})};Q1.displayName=$m;var Z1="PopperAnchor",J1=w.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:i,...l}=e,o=W1(Z1,r),c=w.useRef(null),d=cn(t,c),f=w.useRef(null);return w.useEffect(()=>{const h=f.current;f.current=(i==null?void 0:i.current)||c.current,h!==f.current&&o.onAnchorChange(f.current)}),i?null:p.jsx(Kt.div,{...l,ref:d})});J1.displayName=Z1;var Hm="PopperContent",[fD,hD]=Y1(Hm),eE=w.forwardRef((e,t)=>{var ue,ve,ge,we,ye,Oe;const{__scopePopper:r,side:i="bottom",sideOffset:l=0,align:o="center",alignOffset:c=0,arrowPadding:d=0,avoidCollisions:f=!0,collisionBoundary:h=[],collisionPadding:g=0,sticky:m="partial",hideWhenDetached:x=!1,updatePositionStrategy:v="optimized",onPlaced:E,...S}=e,_=W1(Hm,r),[C,A]=w.useState(null),T=cn(t,Me=>A(Me)),[M,P]=w.useState(null),N=uD(M),z=(N==null?void 0:N.width)??0,G=(N==null?void 0:N.height)??0,Q=i+(o!=="center"?"-"+o:""),R=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},q=Array.isArray(h)?h:[h],Z=q.length>0,ne={padding:R,boundary:q.filter(mD),altBoundary:Z},{refs:Y,floatingStyles:H,placement:j,isPositioned:F,middlewareData:W}=JM({strategy:"fixed",placement:Q,whileElementsMounted:(...Me)=>HM(...Me,{animationFrame:v==="always"}),elements:{reference:_.anchor},middleware:[tD({mainAxis:l+G,alignmentAxis:c}),f&&nD({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?rD():void 0,...ne}),f&&aD({...ne}),iD({...ne,apply:({elements:Me,rects:Te,availableWidth:vt,availableHeight:Ie})=>{const{width:Xe,height:te}=Te.reference,ce=Me.floating.style;ce.setProperty("--radix-popper-available-width",`${vt}px`),ce.setProperty("--radix-popper-available-height",`${Ie}px`),ce.setProperty("--radix-popper-anchor-width",`${Xe}px`),ce.setProperty("--radix-popper-anchor-height",`${te}px`)}}),M&&lD({element:M,padding:d}),gD({arrowWidth:z,arrowHeight:G}),x&&sD({strategy:"referenceHidden",...ne})]}),[K,L]=rE(j),I=Hi(E);On(()=>{F&&(I==null||I())},[F,I]);const X=(ue=W.arrow)==null?void 0:ue.x,D=(ve=W.arrow)==null?void 0:ve.y,J=((ge=W.arrow)==null?void 0:ge.centerOffset)!==0,[be,pe]=w.useState();return On(()=>{C&&pe(window.getComputedStyle(C).zIndex)},[C]),p.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:F?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[(we=W.transformOrigin)==null?void 0:we.x,(ye=W.transformOrigin)==null?void 0:ye.y].join(" "),...((Oe=W.hide)==null?void 0:Oe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(fD,{scope:r,placedSide:K,onArrowChange:P,arrowX:X,arrowY:D,shouldHideArrow:J,children:p.jsx(Kt.div,{"data-side":K,"data-align":L,...S,ref:T,style:{...S.style,animation:F?void 0:"none"}})})})});eE.displayName=Hm;var tE="PopperArrow",pD={top:"bottom",right:"left",bottom:"top",left:"right"},nE=w.forwardRef(function(t,r){const{__scopePopper:i,...l}=t,o=hD(tE,i),c=pD[o.placedSide];return p.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:p.jsx(cD,{...l,ref:r,style:{...l.style,display:"block"}})})});nE.displayName=tE;function mD(e){return e!==null}var gD=e=>({name:"transformOrigin",options:e,fn(t){var _,C,A;const{placement:r,rects:i,middlewareData:l}=t,c=((_=l.arrow)==null?void 0:_.centerOffset)!==0,d=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[h,g]=rE(r),m={start:"0%",center:"50%",end:"100%"}[g],x=(((C=l.arrow)==null?void 0:C.x)??0)+d/2,v=(((A=l.arrow)==null?void 0:A.y)??0)+f/2;let E="",S="";return h==="bottom"?(E=c?m:`${x}px`,S=`${-f}px`):h==="top"?(E=c?m:`${x}px`,S=`${i.floating.height+f}px`):h==="right"?(E=`${-f}px`,S=c?m:`${v}px`):h==="left"&&(E=`${i.floating.width+f}px`,S=c?m:`${v}px`),{data:{x:E,y:S}}}});function rE(e){const[t,r="center"]=e.split("-");return[t,r]}var bD=Q1,yD=J1,xD=eE,vD=nE;function wD(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var aE=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ED="VisuallyHidden",SD=w.forwardRef((e,t)=>p.jsx(Kt.span,{...e,ref:t,style:{...aE,...e.style}}));SD.displayName=ED;var _D=[" ","Enter","ArrowUp","ArrowDown"],kD=[" ","Enter"],Gi="Select",[hd,pd,CD]=tM(Gi),[sl]=id(Gi,[CD,X1]),md=X1(),[ND,mi]=sl(Gi),[TD,AD]=sl(Gi),iE=e=>{const{__scopeSelect:t,children:r,open:i,defaultOpen:l,onOpenChange:o,value:c,defaultValue:d,onValueChange:f,dir:h,name:g,autoComplete:m,disabled:x,required:v,form:E}=e,S=md(t),[_,C]=w.useState(null),[A,T]=w.useState(null),[M,P]=w.useState(!1),N=rM(h),[z,G]=Lp({prop:i,defaultProp:l??!1,onChange:o,caller:Gi}),[Q,R]=Lp({prop:c,defaultProp:d,onChange:f,caller:Gi}),q=w.useRef(null),Z=_?E||!!_.closest("form"):!0,[ne,Y]=w.useState(new Set),H=Array.from(ne).map(j=>j.props.value).join(";");return p.jsx(bD,{...S,children:p.jsxs(ND,{required:v,scope:t,trigger:_,onTriggerChange:C,valueNode:A,onValueNodeChange:T,valueNodeHasChildren:M,onValueNodeHasChildrenChange:P,contentId:Vs(),value:Q,onValueChange:R,open:z,onOpenChange:G,dir:N,triggerPointerDownPosRef:q,disabled:x,children:[p.jsx(hd.Provider,{scope:t,children:p.jsx(TD,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(j=>{Y(F=>new Set(F).add(j))},[]),onNativeOptionRemove:w.useCallback(j=>{Y(F=>{const W=new Set(F);return W.delete(j),W})},[]),children:r})}),Z?p.jsxs(NE,{"aria-hidden":!0,required:v,tabIndex:-1,name:g,autoComplete:m,value:Q,onChange:j=>R(j.target.value),disabled:x,form:E,children:[Q===void 0?p.jsx("option",{value:""}):null,Array.from(ne)]},H):null]})})};iE.displayName=Gi;var sE="SelectTrigger",lE=w.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:i=!1,...l}=e,o=md(r),c=mi(sE,r),d=c.disabled||i,f=cn(t,c.onTriggerChange),h=pd(r),g=w.useRef("touch"),[m,x,v]=AE(S=>{const _=h().filter(T=>!T.disabled),C=_.find(T=>T.value===c.value),A=RE(_,S,C);A!==void 0&&c.onValueChange(A.value)}),E=S=>{d||(c.onOpenChange(!0),v()),S&&(c.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return p.jsx(yD,{asChild:!0,...o,children:p.jsx(Kt.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":TE(c.value)?"":void 0,...l,ref:f,onClick:Yt(l.onClick,S=>{S.currentTarget.focus(),g.current!=="mouse"&&E(S)}),onPointerDown:Yt(l.onPointerDown,S=>{g.current=S.pointerType;const _=S.target;_.hasPointerCapture(S.pointerId)&&_.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(E(S),S.preventDefault())}),onKeyDown:Yt(l.onKeyDown,S=>{const _=m.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&x(S.key),!(_&&S.key===" ")&&_D.includes(S.key)&&(E(),S.preventDefault())})})})});lE.displayName=sE;var oE="SelectValue",cE=w.forwardRef((e,t)=>{const{__scopeSelect:r,className:i,style:l,children:o,placeholder:c="",...d}=e,f=mi(oE,r),{onValueNodeHasChildrenChange:h}=f,g=o!==void 0,m=cn(t,f.onValueNodeChange);return On(()=>{h(g)},[h,g]),p.jsx(Kt.span,{...d,ref:m,style:{pointerEvents:"none"},children:TE(f.value)?p.jsx(p.Fragment,{children:c}):o})});cE.displayName=oE;var RD="SelectIcon",uE=w.forwardRef((e,t)=>{const{__scopeSelect:r,children:i,...l}=e;return p.jsx(Kt.span,{"aria-hidden":!0,...l,ref:t,children:i||"▼"})});uE.displayName=RD;var OD="SelectPortal",dE=e=>p.jsx(Om,{asChild:!0,...e});dE.displayName=OD;var Vi="SelectContent",fE=w.forwardRef((e,t)=>{const r=mi(Vi,e.__scopeSelect),[i,l]=w.useState();if(On(()=>{l(new DocumentFragment)},[]),!r.open){const o=i;return o?Lo.createPortal(p.jsx(hE,{scope:e.__scopeSelect,children:p.jsx(hd.Slot,{scope:e.__scopeSelect,children:p.jsx("div",{children:e.children})})}),o):null}return p.jsx(pE,{...e,ref:t})});fE.displayName=Vi;var Lr=10,[hE,gi]=sl(Vi),MD="SelectContentImpl",DD=_o("SelectContent.RemoveScroll"),pE=w.forwardRef((e,t)=>{const{__scopeSelect:r,position:i="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:o,onPointerDownOutside:c,side:d,sideOffset:f,align:h,alignOffset:g,arrowPadding:m,collisionBoundary:x,collisionPadding:v,sticky:E,hideWhenDetached:S,avoidCollisions:_,...C}=e,A=mi(Vi,r),[T,M]=w.useState(null),[P,N]=w.useState(null),z=cn(t,ue=>M(ue)),[G,Q]=w.useState(null),[R,q]=w.useState(null),Z=pd(r),[ne,Y]=w.useState(!1),H=w.useRef(!1);w.useEffect(()=>{if(T)return w1(T)},[T]),f1();const j=w.useCallback(ue=>{const[ve,...ge]=Z().map(Oe=>Oe.ref.current),[we]=ge.slice(-1),ye=document.activeElement;for(const Oe of ue)if(Oe===ye||(Oe==null||Oe.scrollIntoView({block:"nearest"}),Oe===ve&&P&&(P.scrollTop=0),Oe===we&&P&&(P.scrollTop=P.scrollHeight),Oe==null||Oe.focus(),document.activeElement!==ye))return},[Z,P]),F=w.useCallback(()=>j([G,T]),[j,G,T]);w.useEffect(()=>{ne&&F()},[ne,F]);const{onOpenChange:W,triggerPointerDownPosRef:K}=A;w.useEffect(()=>{if(T){let ue={x:0,y:0};const ve=we=>{var ye,Oe;ue={x:Math.abs(Math.round(we.pageX)-(((ye=K.current)==null?void 0:ye.x)??0)),y:Math.abs(Math.round(we.pageY)-(((Oe=K.current)==null?void 0:Oe.y)??0))}},ge=we=>{ue.x<=10&&ue.y<=10?we.preventDefault():T.contains(we.target)||W(!1),document.removeEventListener("pointermove",ve),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",ve),document.addEventListener("pointerup",ge,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ve),document.removeEventListener("pointerup",ge,{capture:!0})}}},[T,W,K]),w.useEffect(()=>{const ue=()=>W(!1);return window.addEventListener("blur",ue),window.addEventListener("resize",ue),()=>{window.removeEventListener("blur",ue),window.removeEventListener("resize",ue)}},[W]);const[L,I]=AE(ue=>{const ve=Z().filter(ye=>!ye.disabled),ge=ve.find(ye=>ye.ref.current===document.activeElement),we=RE(ve,ue,ge);we&&setTimeout(()=>we.ref.current.focus())}),X=w.useCallback((ue,ve,ge)=>{const we=!H.current&&!ge;(A.value!==void 0&&A.value===ve||we)&&(Q(ue),we&&(H.current=!0))},[A.value]),D=w.useCallback(()=>T==null?void 0:T.focus(),[T]),J=w.useCallback((ue,ve,ge)=>{const we=!H.current&&!ge;(A.value!==void 0&&A.value===ve||we)&&q(ue)},[A.value]),be=i==="popper"?Fp:mE,pe=be===Fp?{side:d,sideOffset:f,align:h,alignOffset:g,arrowPadding:m,collisionBoundary:x,collisionPadding:v,sticky:E,hideWhenDetached:S,avoidCollisions:_}:{};return p.jsx(hE,{scope:r,content:T,viewport:P,onViewportChange:N,itemRefCallback:X,selectedItem:G,onItemLeave:D,itemTextRefCallback:J,focusSelectedItem:F,selectedItemText:R,position:i,isPositioned:ne,searchRef:L,children:p.jsx(Mm,{as:DD,allowPinchZoom:!0,children:p.jsx(Rm,{asChild:!0,trapped:A.open,onMountAutoFocus:ue=>{ue.preventDefault()},onUnmountAutoFocus:Yt(l,ue=>{var ve;(ve=A.trigger)==null||ve.focus({preventScroll:!0}),ue.preventDefault()}),children:p.jsx(Am,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:ue=>ue.preventDefault(),onDismiss:()=>A.onOpenChange(!1),children:p.jsx(be,{role:"listbox",id:A.contentId,"data-state":A.open?"open":"closed",dir:A.dir,onContextMenu:ue=>ue.preventDefault(),...C,...pe,onPlaced:()=>Y(!0),ref:z,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:Yt(C.onKeyDown,ue=>{const ve=ue.ctrlKey||ue.altKey||ue.metaKey;if(ue.key==="Tab"&&ue.preventDefault(),!ve&&ue.key.length===1&&I(ue.key),["ArrowUp","ArrowDown","Home","End"].includes(ue.key)){let we=Z().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);if(["ArrowUp","End"].includes(ue.key)&&(we=we.slice().reverse()),["ArrowUp","ArrowDown"].includes(ue.key)){const ye=ue.target,Oe=we.indexOf(ye);we=we.slice(Oe+1)}setTimeout(()=>j(we)),ue.preventDefault()}})})})})})})});pE.displayName=MD;var jD="SelectItemAlignedPosition",mE=w.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:i,...l}=e,o=mi(Vi,r),c=gi(Vi,r),[d,f]=w.useState(null),[h,g]=w.useState(null),m=cn(t,z=>g(z)),x=pd(r),v=w.useRef(!1),E=w.useRef(!0),{viewport:S,selectedItem:_,selectedItemText:C,focusSelectedItem:A}=c,T=w.useCallback(()=>{if(o.trigger&&o.valueNode&&d&&h&&S&&_&&C){const z=o.trigger.getBoundingClientRect(),G=h.getBoundingClientRect(),Q=o.valueNode.getBoundingClientRect(),R=C.getBoundingClientRect();if(o.dir!=="rtl"){const ye=R.left-G.left,Oe=Q.left-ye,Me=z.left-Oe,Te=z.width+Me,vt=Math.max(Te,G.width),Ie=window.innerWidth-Lr,Xe=jx(Oe,[Lr,Math.max(Lr,Ie-vt)]);d.style.minWidth=Te+"px",d.style.left=Xe+"px"}else{const ye=G.right-R.right,Oe=window.innerWidth-Q.right-ye,Me=window.innerWidth-z.right-Oe,Te=z.width+Me,vt=Math.max(Te,G.width),Ie=window.innerWidth-Lr,Xe=jx(Oe,[Lr,Math.max(Lr,Ie-vt)]);d.style.minWidth=Te+"px",d.style.right=Xe+"px"}const q=x(),Z=window.innerHeight-Lr*2,ne=S.scrollHeight,Y=window.getComputedStyle(h),H=parseInt(Y.borderTopWidth,10),j=parseInt(Y.paddingTop,10),F=parseInt(Y.borderBottomWidth,10),W=parseInt(Y.paddingBottom,10),K=H+j+ne+W+F,L=Math.min(_.offsetHeight*5,K),I=window.getComputedStyle(S),X=parseInt(I.paddingTop,10),D=parseInt(I.paddingBottom,10),J=z.top+z.height/2-Lr,be=Z-J,pe=_.offsetHeight/2,ue=_.offsetTop+pe,ve=H+j+ue,ge=K-ve;if(ve<=J){const ye=q.length>0&&_===q[q.length-1].ref.current;d.style.bottom="0px";const Oe=h.clientHeight-S.offsetTop-S.offsetHeight,Me=Math.max(be,pe+(ye?D:0)+Oe+F),Te=ve+Me;d.style.height=Te+"px"}else{const ye=q.length>0&&_===q[0].ref.current;d.style.top="0px";const Me=Math.max(J,H+S.offsetTop+(ye?X:0)+pe)+ge;d.style.height=Me+"px",S.scrollTop=ve-J+S.offsetTop}d.style.margin=`${Lr}px 0`,d.style.minHeight=L+"px",d.style.maxHeight=Z+"px",i==null||i(),requestAnimationFrame(()=>v.current=!0)}},[x,o.trigger,o.valueNode,d,h,S,_,C,o.dir,i]);On(()=>T(),[T]);const[M,P]=w.useState();On(()=>{h&&P(window.getComputedStyle(h).zIndex)},[h]);const N=w.useCallback(z=>{z&&E.current===!0&&(T(),A==null||A(),E.current=!1)},[T,A]);return p.jsx(ID,{scope:r,contentWrapper:d,shouldExpandOnScrollRef:v,onScrollButtonChange:N,children:p.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:p.jsx(Kt.div,{...l,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})});mE.displayName=jD;var LD="SelectPopperPosition",Fp=w.forwardRef((e,t)=>{const{__scopeSelect:r,align:i="start",collisionPadding:l=Lr,...o}=e,c=md(r);return p.jsx(xD,{...c,...o,ref:t,align:i,collisionPadding:l,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Fp.displayName=LD;var[ID,Km]=sl(Vi,{}),$p="SelectViewport",gE=w.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:i,...l}=e,o=gi($p,r),c=Km($p,r),d=cn(t,o.onViewportChange),f=w.useRef(0);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),p.jsx(hd.Slot,{scope:r,children:p.jsx(Kt.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:Yt(l.onScroll,h=>{const g=h.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:x}=c;if(x!=null&&x.current&&m){const v=Math.abs(f.current-g.scrollTop);if(v>0){const E=window.innerHeight-Lr*2,S=parseFloat(m.style.minHeight),_=parseFloat(m.style.height),C=Math.max(S,_);if(C<E){const A=C+v,T=Math.min(E,A),M=A-T;m.style.height=T+"px",m.style.bottom==="0px"&&(g.scrollTop=M>0?M:0,m.style.justifyContent="flex-end")}}}f.current=g.scrollTop})})})]})});gE.displayName=$p;var bE="SelectGroup",[zD,PD]=sl(bE),BD=w.forwardRef((e,t)=>{const{__scopeSelect:r,...i}=e,l=Vs();return p.jsx(zD,{scope:r,id:l,children:p.jsx(Kt.div,{role:"group","aria-labelledby":l,...i,ref:t})})});BD.displayName=bE;var yE="SelectLabel",UD=w.forwardRef((e,t)=>{const{__scopeSelect:r,...i}=e,l=PD(yE,r);return p.jsx(Kt.div,{id:l.id,...i,ref:t})});UD.displayName=yE;var Iu="SelectItem",[FD,xE]=sl(Iu),vE=w.forwardRef((e,t)=>{const{__scopeSelect:r,value:i,disabled:l=!1,textValue:o,...c}=e,d=mi(Iu,r),f=gi(Iu,r),h=d.value===i,[g,m]=w.useState(o??""),[x,v]=w.useState(!1),E=cn(t,A=>{var T;return(T=f.itemRefCallback)==null?void 0:T.call(f,A,i,l)}),S=Vs(),_=w.useRef("touch"),C=()=>{l||(d.onValueChange(i),d.onOpenChange(!1))};if(i==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return p.jsx(FD,{scope:r,value:i,disabled:l,textId:S,isSelected:h,onItemTextChange:w.useCallback(A=>{m(T=>T||((A==null?void 0:A.textContent)??"").trim())},[]),children:p.jsx(hd.ItemSlot,{scope:r,value:i,disabled:l,textValue:g,children:p.jsx(Kt.div,{role:"option","aria-labelledby":S,"data-highlighted":x?"":void 0,"aria-selected":h&&x,"data-state":h?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...c,ref:E,onFocus:Yt(c.onFocus,()=>v(!0)),onBlur:Yt(c.onBlur,()=>v(!1)),onClick:Yt(c.onClick,()=>{_.current!=="mouse"&&C()}),onPointerUp:Yt(c.onPointerUp,()=>{_.current==="mouse"&&C()}),onPointerDown:Yt(c.onPointerDown,A=>{_.current=A.pointerType}),onPointerMove:Yt(c.onPointerMove,A=>{var T;_.current=A.pointerType,l?(T=f.onItemLeave)==null||T.call(f):_.current==="mouse"&&A.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Yt(c.onPointerLeave,A=>{var T;A.currentTarget===document.activeElement&&((T=f.onItemLeave)==null||T.call(f))}),onKeyDown:Yt(c.onKeyDown,A=>{var M;((M=f.searchRef)==null?void 0:M.current)!==""&&A.key===" "||(kD.includes(A.key)&&C(),A.key===" "&&A.preventDefault())})})})})});vE.displayName=Iu;var po="SelectItemText",wE=w.forwardRef((e,t)=>{const{__scopeSelect:r,className:i,style:l,...o}=e,c=mi(po,r),d=gi(po,r),f=xE(po,r),h=AD(po,r),[g,m]=w.useState(null),x=cn(t,C=>m(C),f.onItemTextChange,C=>{var A;return(A=d.itemTextRefCallback)==null?void 0:A.call(d,C,f.value,f.disabled)}),v=g==null?void 0:g.textContent,E=w.useMemo(()=>p.jsx("option",{value:f.value,disabled:f.disabled,children:v},f.value),[f.disabled,f.value,v]),{onNativeOptionAdd:S,onNativeOptionRemove:_}=h;return On(()=>(S(E),()=>_(E)),[S,_,E]),p.jsxs(p.Fragment,{children:[p.jsx(Kt.span,{id:f.textId,...o,ref:x}),f.isSelected&&c.valueNode&&!c.valueNodeHasChildren?Lo.createPortal(o.children,c.valueNode):null]})});wE.displayName=po;var EE="SelectItemIndicator",SE=w.forwardRef((e,t)=>{const{__scopeSelect:r,...i}=e;return xE(EE,r).isSelected?p.jsx(Kt.span,{"aria-hidden":!0,...i,ref:t}):null});SE.displayName=EE;var Hp="SelectScrollUpButton",_E=w.forwardRef((e,t)=>{const r=gi(Hp,e.__scopeSelect),i=Km(Hp,e.__scopeSelect),[l,o]=w.useState(!1),c=cn(t,i.onScrollButtonChange);return On(()=>{if(r.viewport&&r.isPositioned){let d=function(){const h=f.scrollTop>0;o(h)};const f=r.viewport;return d(),f.addEventListener("scroll",d),()=>f.removeEventListener("scroll",d)}},[r.viewport,r.isPositioned]),l?p.jsx(CE,{...e,ref:c,onAutoScroll:()=>{const{viewport:d,selectedItem:f}=r;d&&f&&(d.scrollTop=d.scrollTop-f.offsetHeight)}}):null});_E.displayName=Hp;var Kp="SelectScrollDownButton",kE=w.forwardRef((e,t)=>{const r=gi(Kp,e.__scopeSelect),i=Km(Kp,e.__scopeSelect),[l,o]=w.useState(!1),c=cn(t,i.onScrollButtonChange);return On(()=>{if(r.viewport&&r.isPositioned){let d=function(){const h=f.scrollHeight-f.clientHeight,g=Math.ceil(f.scrollTop)<h;o(g)};const f=r.viewport;return d(),f.addEventListener("scroll",d),()=>f.removeEventListener("scroll",d)}},[r.viewport,r.isPositioned]),l?p.jsx(CE,{...e,ref:c,onAutoScroll:()=>{const{viewport:d,selectedItem:f}=r;d&&f&&(d.scrollTop=d.scrollTop+f.offsetHeight)}}):null});kE.displayName=Kp;var CE=w.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:i,...l}=e,o=gi("SelectScrollButton",r),c=w.useRef(null),d=pd(r),f=w.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return w.useEffect(()=>()=>f(),[f]),On(()=>{var g;const h=d().find(m=>m.ref.current===document.activeElement);(g=h==null?void 0:h.ref.current)==null||g.scrollIntoView({block:"nearest"})},[d]),p.jsx(Kt.div,{"aria-hidden":!0,...l,ref:t,style:{flexShrink:0,...l.style},onPointerDown:Yt(l.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(i,50))}),onPointerMove:Yt(l.onPointerMove,()=>{var h;(h=o.onItemLeave)==null||h.call(o),c.current===null&&(c.current=window.setInterval(i,50))}),onPointerLeave:Yt(l.onPointerLeave,()=>{f()})})}),$D="SelectSeparator",HD=w.forwardRef((e,t)=>{const{__scopeSelect:r,...i}=e;return p.jsx(Kt.div,{"aria-hidden":!0,...i,ref:t})});HD.displayName=$D;var qp="SelectArrow",KD=w.forwardRef((e,t)=>{const{__scopeSelect:r,...i}=e,l=md(r),o=mi(qp,r),c=gi(qp,r);return o.open&&c.position==="popper"?p.jsx(vD,{...l,...i,ref:t}):null});KD.displayName=qp;var qD="SelectBubbleInput",NE=w.forwardRef(({__scopeSelect:e,value:t,...r},i)=>{const l=w.useRef(null),o=cn(i,l),c=wD(t);return w.useEffect(()=>{const d=l.current;if(!d)return;const f=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(f,"value").set;if(c!==t&&g){const m=new Event("change",{bubbles:!0});g.call(d,t),d.dispatchEvent(m)}},[c,t]),p.jsx(Kt.select,{...r,style:{...aE,...r.style},ref:o,defaultValue:t})});NE.displayName=qD;function TE(e){return e===""||e===void 0}function AE(e){const t=Hi(e),r=w.useRef(""),i=w.useRef(0),l=w.useCallback(c=>{const d=r.current+c;t(d),(function f(h){r.current=h,window.clearTimeout(i.current),h!==""&&(i.current=window.setTimeout(()=>f(""),1e3))})(d)},[t]),o=w.useCallback(()=>{r.current="",window.clearTimeout(i.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(i.current),[]),[r,l,o]}function RE(e,t,r){const l=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let c=GD(e,Math.max(o,0));l.length===1&&(c=c.filter(h=>h!==r));const f=c.find(h=>h.textValue.toLowerCase().startsWith(l.toLowerCase()));return f!==r?f:void 0}function GD(e,t){return e.map((r,i)=>e[(t+i)%e.length])}var VD=iE,YD=lE,XD=cE,WD=uE,QD=dE,ZD=fE,JD=gE,ej=vE,tj=wE,nj=SE,rj=_E,aj=kE;function yt({label:e,className:t,...r}){return p.jsxs("div",{className:"space-y-1.5",children:[e&&p.jsx("label",{className:"block text-sm font-medium text-foreground",children:e}),p.jsx("input",{className:Ke("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors","file:border-0 file:bg-transparent file:text-sm file:font-medium","placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:cursor-not-allowed disabled:opacity-50",t),...r})]})}function gd({label:e,className:t,...r}){return p.jsxs("div",{className:"space-y-1.5",children:[e&&p.jsx("label",{className:"block text-sm font-medium text-foreground",children:e}),p.jsx("textarea",{className:Ke("flex min-h-20 w-full rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm transition-colors resize-none","placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:cursor-not-allowed disabled:opacity-50",t),...r})]})}const OE="__radix_empty_value__";function Gx(e){return typeof e=="string"||typeof e=="number"?String(e):w.Children.toArray(e).map(t=>typeof t=="string"||typeof t=="number"?String(t):"").join("")}function ij(e){return w.Children.toArray(e).flatMap(t=>{if(!w.isValidElement(t))return[];const r=t;if(r.type!=="option")return[];const i=r.props.value??Gx(r.props.children);return[{value:String(i),label:Gx(r.props.children),disabled:r.props.disabled}]})}function Vx(e){return e===""||e===void 0||e===null?OE:String(e)}function Yx(e){return e===OE?"":e}function Ca({label:e,className:t,children:r,...i}){var h;const l=ij(r),o=Vx(i.value??i.defaultValue??""),c=l.find(g=>g.value===Yx(o)),d=(h=l.find(g=>g.value===""))==null?void 0:h.label,f=g=>{var x;const m=Yx(g);(x=i.onChange)==null||x.call(i,{target:{value:m},currentTarget:{value:m}})};return p.jsxs("div",{className:"space-y-1.5",children:[e&&p.jsx("label",{className:"block text-sm font-medium text-foreground",children:e}),p.jsxs(VD,{value:o,onValueChange:f,disabled:i.disabled,name:i.name,children:[p.jsxs(YD,{id:i.id,className:Ke("flex h-9 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm transition-colors","placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring","disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),children:[p.jsx(XD,{placeholder:d,children:c==null?void 0:c.label}),p.jsx(WD,{asChild:!0,children:p.jsx(Z0,{className:"h-4 w-4 opacity-50"})})]}),p.jsx(QD,{children:p.jsxs(ZD,{className:"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md animate-fade-in",children:[p.jsx(rj,{className:"flex cursor-default items-center justify-center py-1",children:p.jsx(kN,{className:"h-4 w-4"})}),p.jsx(JD,{className:"p-1",children:l.map(g=>p.jsxs(ej,{value:Vx(g.value),disabled:g.disabled,className:Ke("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-accent/10 focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50"),children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(nj,{children:p.jsx(vo,{className:"h-4 w-4"})})}),p.jsx(tj,{children:g.label})]},`${g.value}-${g.label}`))}),p.jsx(aj,{className:"flex cursor-default items-center justify-center py-1",children:p.jsx(Z0,{className:"h-4 w-4"})})]})})]})]})}function xn({message:e,icon:t=VN}){return p.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed bg-card/70 py-12 text-muted-foreground",children:[p.jsx(t,{size:36,strokeWidth:1.5,className:"mb-3 opacity-80"}),p.jsx("p",{className:"text-sm",children:e})]})}const Gp="http://127.0.0.1:9831",sj=`${Gp}/api/local/v1`;function lj(e){const t=e.trim();return t?t.replace(/\/+$/,""):sj}const Jr=lj("/api/local/v1");Jr.endsWith("/api/local/v1")&&Jr.slice(0,-13);const Co=new Set;let cr=null;async function Ye(e,t,r){const i=await fetch(`${Jr}${t}`,{method:e,headers:{"Content-Type":"application/json"},body:r?JSON.stringify(r):void 0}),l=await i.json();if(!i.ok||!l.ok)throw new Error(l.error||`Local AI Core request failed: ${i.status}`);return l.data}function ME(){if(cr||typeof window>"u")return;cr=new EventSource(`${Jr}/events`);const e=t=>{try{const r=JSON.parse(t.data);Co.forEach(i=>i(r))}catch{}};["runtime.updated","thread.updated","message.created","message.updated","run.updated","scheduler.job.updated","scheduler.run.updated","presence.updated","stream.updated"].forEach(t=>{cr==null||cr.addEventListener(t,e)}),cr.onerror=()=>{cr==null||cr.close(),cr=null,Co.size>0&&window.setTimeout(()=>ME(),1e3)}}function oj(){Co.size===0&&cr&&(cr.close(),cr=null)}async function cj(e=350){var i;const t=new AbortController,r=window.setTimeout(()=>t.abort(),e);try{const l=await fetch(`${Jr}/health`,{signal:t.signal}),o=await l.json();return l.ok&&o.ok&&((i=o.data)==null?void 0:i.name)==="local-ai-core"}catch{return!1}finally{window.clearTimeout(r)}}function qm(e){return Co.add(e),ME(),()=>{Co.delete(e),oj()}}async function uj(){return Ye("GET","/runtime")}async function dj(){return Ye("POST","/runtime/service/start")}async function fj(){return Ye("POST","/runtime/service/stop")}async function hj(){return Ye("POST","/runtime/service/restart")}async function pj(e){const t=typeof e=="number"?`?limit=${encodeURIComponent(String(e))}`:"";return Ye("GET",`/runtime/logs${t}`)}async function mj(){return Ye("GET","/runtime/config")}async function gj(e){return Ye("POST","/runtime/config/raw",{raw:e})}async function bj(e){return Ye("POST","/runtime/config/structured",{config:e})}async function yj(e){return Ye("POST","/runtime/settings",e)}async function DE(e){return Ye("GET",`/platforms/${encodeURIComponent(e)}`)}async function jE(e,t){return Ye("GET",`/platforms/${encodeURIComponent(e)}/${encodeURIComponent(t)}`)}async function LE(e,t){return Ye("POST",`/platforms/${encodeURIComponent(e)}/${encodeURIComponent(t)}/test`)}async function IE(e,t){return Ye("POST",`/platforms/${encodeURIComponent(e)}/${encodeURIComponent(t)}/enable`)}async function zE(e,t){return Ye("POST",`/platforms/${encodeURIComponent(e)}/${encodeURIComponent(t)}/disable`)}async function PE(e,t){const r=t?`?workspace_id=${encodeURIComponent(t)}`:"";return Ye("GET",`/platforms/${encodeURIComponent(e)}/pairings${r}`)}async function BE(e,t){return Ye("POST",`/platforms/${encodeURIComponent(e)}/pairings/approve`,{code:t})}async function UE(e,t){return Ye("POST",`/platforms/${encodeURIComponent(e)}/pairings/reject`,{code:t})}async function FE(e,t){const r=t?`?workspace_id=${encodeURIComponent(t)}`:"";return Ye("GET",`/platforms/${encodeURIComponent(e)}/users${r}`)}async function xj(){return DE("lark")}async function vj(e){return jE("lark",e)}async function wj(e){return LE("lark",e)}async function Ej(e){return IE("lark",e)}async function Sj(e){return zE("lark",e)}async function _j(e){return PE("lark",e)}async function kj(e){return BE("lark",e)}async function Cj(e){return UE("lark",e)}async function Nj(e){return FE("lark",e)}async function $E(e){return Ye("POST",`/platforms/weixin/${encodeURIComponent(e)}/qrcode`)}async function HE(e,t){return Ye("GET",`/platforms/weixin/${encodeURIComponent(e)}/qrcode/status?ticket=${encodeURIComponent(t)}`)}async function Gm(){return Ye("GET","/workspaces")}async function Tj(e){return Ye("GET","/scheduler/jobs")}async function Aj(e){return Ye("POST","/scheduler/jobs",e)}async function Rj(e,t){return Ye("PATCH",`/scheduler/jobs/${encodeURIComponent(e)}`,t)}async function Oj(e){return Ye("DELETE",`/scheduler/jobs/${encodeURIComponent(e)}`)}async function Mj(e){return Ye("POST",`/scheduler/jobs/${encodeURIComponent(e)}/run`)}async function Dj(e){return Ye("GET",`/threads?workspace_id=${encodeURIComponent(e)}`)}async function KE(e,t){return Ye("POST","/threads",{workspaceId:e,title:t})}async function Vm(e){return Ye("GET",`/threads/${encodeURIComponent(e)}`)}async function jj(e,t){return Ye("PATCH",`/threads/${encodeURIComponent(e)}`,{title:t})}async function No(e,t){return Ye("PATCH",`/threads/${encodeURIComponent(e)}/knowledge-bases`,{knowledgeBaseIds:t})}async function Lj(e){return Ye("DELETE",`/threads/${encodeURIComponent(e)}`)}async function Ij(e,t){return Ye("POST",`/threads/${encodeURIComponent(e)}/messages`,{content:t})}async function qE(e,t){return Ye("POST",`/threads/${encodeURIComponent(e)}/actions`,{content:t})}async function zj(e){return Ye("POST",`/runs/${encodeURIComponent(e)}/interrupt`)}async function Vp(){return Ye("GET","/knowledge/config")}async function GE(){return Ye("GET","/knowledge/folders")}async function Pj(e){return Ye("POST","/knowledge/folders",e)}async function Bj(e,t){return Ye("PATCH",`/knowledge/folders/${encodeURIComponent(e)}`,t)}async function Uj(e){return Ye("DELETE",`/knowledge/folders/${encodeURIComponent(e)}`)}async function VE(){return Ye("GET","/knowledge/bases")}async function Fj(e){return Ye("POST","/knowledge/bases",e)}async function $j(e){return Ye("GET",`/knowledge/bases/${encodeURIComponent(e)}`)}async function Hj(e,t){return Ye("PATCH",`/knowledge/bases/${encodeURIComponent(e)}`,t)}async function Kj(e){return Ye("DELETE",`/knowledge/bases/${encodeURIComponent(e)}`)}async function qj(e){return Ye("GET",`/knowledge/bases/${encodeURIComponent(e)}/files`)}async function Gj(e,t){const r=new FormData;r.append("collection",t.collection),r.append("knowledgebase_id",e),t.folder&&r.append("folder",t.folder),t.files.forEach(o=>{r.append("files",o,o.name)});const i=await fetch(`${Jr}/knowledge/bases/${encodeURIComponent(e)}/files`,{method:"POST",body:r}),l=await i.json();if(!i.ok||!l.ok)throw new Error(l.error||`Local AI Core upload failed: ${i.status}`);return l.data}async function Vj(e,t){return Ye("DELETE",`/knowledge/bases/${encodeURIComponent(e)}/files/${encodeURIComponent(t)}`)}async function Yj(e,t){return Ye("POST",`/knowledge/bases/${encodeURIComponent(e)}/search`,t)}async function YE(){return Ye("GET","/capabilities/snapshot")}async function XE(){return Ye("GET","/plugins/diagnostics")}async function Xj(e){return Ye("POST",`/workspaces/${encodeURIComponent(e)}/streaming-probe`)}function Wj(e){return qm(t=>{t.type==="runtime.updated"&&e(t.runtime)})}function WE(e){return qm(t=>{t.type==="stream.updated"&&e(t.stream),(t.type==="message.created"||t.type==="message.updated"||t.type==="run.updated")&&"stream"in t&&t.stream&&e(t.stream)})}function _t(){if(!window.desktop)throw new Error("Desktop APIs are unavailable in the browser build");return window.desktop}const QE={getRuntimeStatus:()=>_t().getRuntimeStatus(),startService:()=>_t().startService(),stopService:()=>_t().stopService(),restartService:()=>_t().restartService(),getLogs:e=>_t().getLogs(e),readConfigFile:()=>_t().readConfigFile(),saveRawConfigFile:e=>_t().saveRawConfigFile(e),saveStructuredConfigFile:e=>_t().saveStructuredConfigFile(e),getThreadKnowledgeBases:(e,t)=>_t().getThreadKnowledgeBases(e,t),updateThreadKnowledgeBases:(e,t,r)=>_t().updateThreadKnowledgeBases(e,t,r),deleteThreadKnowledgeBases:(e,t)=>_t().deleteThreadKnowledgeBases(e,t),saveSettings:e=>_t().saveSettings(e),getCapabilitySnapshot:()=>YE(),getPluginDiagnostics:()=>XE(),listChannelGateways:e=>_t().listChannelGateways(e),getChannelGatewayStatus:(e,t)=>_t().getChannelGatewayStatus(e,t),testChannelConnection:(e,t)=>_t().testChannelConnection(e,t),enableChannelGateway:(e,t)=>_t().enableChannelGateway(e,t),disableChannelGateway:(e,t)=>_t().disableChannelGateway(e,t),listChannelPendingPairings:(e,t)=>_t().listChannelPendingPairings(e,t),approveChannelPairing:(e,t)=>_t().approveChannelPairing(e,t),rejectChannelPairing:(e,t)=>_t().rejectChannelPairing(e,t),listChannelAuthorizedUsers:(e,t)=>_t().listChannelAuthorizedUsers(e,t),getWeixinQrCode:e=>$E(e),checkWeixinQrCodeStatus:(e,t)=>HE(e,t),listLarkGateways:()=>_t().listLarkGateways(),getLarkGatewayStatus:e=>_t().getLarkGatewayStatus(e),testLarkConnection:e=>_t().testLarkConnection(e),enableLarkGateway:e=>_t().enableLarkGateway(e),disableLarkGateway:e=>_t().disableLarkGateway(e),listLarkPendingPairings:e=>_t().listLarkPendingPairings(e),approveLarkPairing:e=>_t().approveLarkPairing(e),rejectLarkPairing:e=>_t().rejectLarkPairing(e),listLarkAuthorizedUsers:e=>_t().listLarkAuthorizedUsers(e),probeWorkspaceStreaming:e=>_t().probeWorkspaceStreaming(e),onRuntimeEvent:e=>_t().onRuntimeEvent(e),onBridgeEvent:e=>WE(e)},zu={getRuntimeStatus:()=>uj(),startService:()=>dj(),stopService:()=>fj(),restartService:()=>hj(),getLogs:e=>pj(e),readConfigFile:()=>mj(),saveRawConfigFile:e=>gj(e),saveStructuredConfigFile:e=>bj(e),getThreadKnowledgeBases:(e,t)=>Vm(t).then(r=>r.selectedKnowledgeBaseIds||[]),updateThreadKnowledgeBases:(e,t,r)=>No(t,r).then(i=>i.knowledgeBaseIds),deleteThreadKnowledgeBases:(e,t)=>No(t,[]).then(()=>({deleted:!0})),saveSettings:e=>yj(e),getCapabilitySnapshot:()=>YE(),getPluginDiagnostics:()=>XE(),listChannelGateways:e=>DE(e).then(t=>t.gateways),getChannelGatewayStatus:(e,t)=>jE(e,t),testChannelConnection:(e,t)=>LE(e,t),enableChannelGateway:(e,t)=>IE(e,t),disableChannelGateway:(e,t)=>zE(e,t),listChannelPendingPairings:(e,t)=>PE(e,t).then(r=>r.pairings),approveChannelPairing:(e,t)=>BE(e,t),rejectChannelPairing:(e,t)=>UE(e,t),listChannelAuthorizedUsers:(e,t)=>FE(e,t).then(r=>r.users),getWeixinQrCode:e=>$E(e),checkWeixinQrCodeStatus:(e,t)=>HE(e,t),listLarkGateways:()=>xj().then(e=>e.gateways),getLarkGatewayStatus:e=>vj(e),testLarkConnection:e=>wj(e),enableLarkGateway:e=>Ej(e),disableLarkGateway:e=>Sj(e),listLarkPendingPairings:e=>_j(e).then(t=>t.pairings),approveLarkPairing:e=>kj(e),rejectLarkPairing:e=>Cj(e),listLarkAuthorizedUsers:e=>Nj(e).then(t=>t.users),probeWorkspaceStreaming:e=>Xj(e),onRuntimeEvent:e=>Wj(e),onBridgeEvent:e=>WE(e)};let ci=null;function Qj(e){return e==="electron"&&window.desktop?QE:zu}async function Zj(){return window.desktop?(zh("electron"),ci=QE,ci):(await cj(),zh("local_core"),ci=zu,ci)}function gr(){const e=ci||Qj($i());if(!e)throw new Error("Managed desktop APIs are unavailable in this build");return ci=e,e}async function Jj(){return Zj()}const Ym=()=>gr().getRuntimeStatus(),eL=()=>gr().startService(),tL=e=>gr().getLogs(e),nL=()=>gr().readConfigFile(),Xx=e=>gr().saveStructuredConfigFile(e),rL=(e,t,r)=>gr().updateThreadKnowledgeBases(e,t,r),aL=e=>gr().saveSettings(e),Wx=()=>gr().getCapabilitySnapshot(),iL=()=>gr().getPluginDiagnostics(),sL=e=>gr().getWeixinQrCode(e),lL=(e,t)=>gr().checkWeixinQrCodeStatus(e,t),Xm=e=>gr().onRuntimeEvent(e),oL=e=>gr().onBridgeEvent(e);function Qi({title:e,description:t,actions:r}){return p.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[p.jsxs("div",{className:"min-w-0",children:[p.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:e}),t?p.jsx("p",{className:"mt-1 max-w-3xl text-sm leading-6 text-muted-foreground",children:t}):null]}),r?p.jsx("div",{className:"flex shrink-0 flex-wrap gap-2",children:r}):null]})}function ka({title:e,description:t,actions:r,children:i,className:l,bodyClassName:o}){return p.jsxs(Ht,{className:Ke("p-0",l),children:[(e||t||r)&&p.jsxs("div",{className:"flex flex-col gap-3 border-b px-5 py-4 sm:flex-row sm:items-start sm:justify-between",children:[p.jsxs("div",{className:"min-w-0",children:[e?p.jsx("h2",{className:"text-sm font-semibold text-foreground",children:e}):null,t?p.jsx("p",{className:"mt-1 text-sm leading-5 text-muted-foreground",children:t}):null]}),r?p.jsx("div",{className:"flex shrink-0 flex-wrap gap-2",children:r}):null]}),p.jsx("div",{className:Ke("p-5",o),children:i})]})}const cL={neutral:"border-border bg-muted text-muted-foreground",success:"border-primary/20 bg-primary/10 text-primary",warning:"border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-400/20 dark:bg-amber-500/10 dark:text-amber-200",danger:"border-destructive/20 bg-destructive/10 text-destructive dark:text-red-200",info:"border-blue-200 bg-blue-50 text-blue-700 dark:border-blue-400/20 dark:bg-blue-500/10 dark:text-blue-200"};function ZE({children:e,tone:t="neutral"}){return p.jsx("span",{className:Ke("inline-flex items-center rounded-full border px-2.5 py-1 text-xs font-medium",cL[t]),children:e})}const bd=()=>lt.get("/projects"),uL=e=>lt.get(`/projects/${e}`);function dL({title:e,description:t,to:r,icon:i,primary:l}){return p.jsxs(Pn,{to:r,className:["group flex min-h-[118px] flex-col justify-between rounded-2xl p-5 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-ring",l?"bg-black/[0.07] text-foreground hover:bg-black/[0.09] dark:bg-white/[0.10] dark:hover:bg-white/[0.13]":"bg-white/54 text-foreground hover:bg-white/72 dark:bg-white/[0.055] dark:hover:bg-white/[0.085]"].join(" "),children:[p.jsxs("div",{className:"flex items-start justify-between gap-4",children:[p.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-white/70 text-primary shadow-[0_1px_1px_rgba(0,0,0,0.04)] dark:bg-white/[0.08]",children:p.jsx(i,{size:20})}),p.jsx(fm,{size:17,className:"mt-1 text-muted-foreground/45 transition-colors group-hover:text-foreground"})]}),p.jsxs("div",{children:[p.jsx("h2",{className:"text-base font-semibold text-foreground",children:e}),p.jsx("p",{className:"mt-2 max-w-sm text-sm leading-5 text-muted-foreground",children:t})]})]})}function fL(){const{t:e}=Fr(),[t,r]=w.useState([]),[i,l]=w.useState(!0),[o,c]=w.useState(""),{desktopRuntime:d,desktopWorkspace:f,knowledgeModule:h,schedulerModule:g}=ad(),m=[{title:"继续聊天",description:"打开本地对话,继续当前项目里的 agent 线程。",to:"/chat",icon:_a,primary:!0},{title:"工作区",description:"管理项目、平台、模型和本地运行配置。",to:f?"/workspace":"/projects",icon:f?mm:Nu}];h&&m.push({title:"知识库",description:"上传文档,维护可被检索的项目资料。",to:"/knowledge",icon:Nw}),g&&m.push({title:"定时任务",description:"查看和管理自动执行的计划任务。",to:"/cron",icon:yN}),(!h||!g)&&m.push({title:"系统设置",description:"查看配置、日志和桌面应用偏好。",to:"/system",icon:Oo});const x=w.useCallback(async()=>{l(!0),c("");try{if(d){const E=await Gm();r((E.workspaces||[]).map(S=>({name:S.name,agent_type:S.agentType,platforms:S.platforms,sessions_count:S.sessionsCount,heartbeat_enabled:S.heartbeatEnabled})));return}const v=await bd();r(v.projects||[])}catch(v){c(v.message||String(v))}finally{l(!1)}},[d]);return w.useEffect(()=>{x();const v=()=>x();window.addEventListener("cc:refresh",v);const E=d?Xm(()=>{x()}):()=>{};return()=>{window.removeEventListener("cc:refresh",v),E()}},[d,x]),i&&t.length===0?p.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:p.jsx(fN,{className:"animate-pulse",size:24})}):p.jsxs("div",{className:"animate-fade-in space-y-8",children:[p.jsx(Qi,{title:"概览",description:"继续最近的工作,或进入项目、知识和自动化配置。"}),o?p.jsx("div",{role:"alert",className:"rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-700 dark:border-amber-400/20 dark:bg-amber-500/10 dark:text-amber-200",children:o}):null,p.jsxs("section",{className:"space-y-3",children:[p.jsx("div",{className:"flex items-end justify-between gap-4",children:p.jsxs("div",{children:[p.jsx("h2",{className:"text-lg font-semibold tracking-tight text-foreground",children:"快速开始"}),p.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"常用入口会保留在最前面。"})]})}),p.jsx("div",{className:"grid grid-cols-1 gap-3 lg:grid-cols-2",children:m.map(v=>p.jsx(dL,{...v},v.to))})]}),p.jsxs(Ht,{className:"p-0",children:[p.jsxs("div",{className:"flex items-center justify-between gap-4 border-b border-black/[0.08] px-5 py-4 dark:border-white/[0.07]",children:[p.jsxs("div",{children:[p.jsx("h2",{className:"text-base font-semibold text-foreground",children:e("nav.projects")}),p.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"最近配置和会话概览。"})]}),p.jsx(Pn,{to:d?"/workspace":"/projects",className:"text-sm font-medium text-primary transition-colors hover:text-primary/80",children:e("common.viewAll")})]}),t.length===0?p.jsx("div",{className:"p-5",children:p.jsx(xn,{message:e("projects.noProjects"),icon:Nu})}):p.jsx("div",{className:"divide-y divide-black/[0.08] dark:divide-white/[0.07]",children:t.slice(0,6).map(v=>{var E;return p.jsxs(Pn,{to:d?`/workspace?project=${encodeURIComponent(v.name)}`:`/projects/${v.name}`,className:"group flex items-center justify-between gap-3 px-5 py-4 transition-colors duration-200 hover:bg-black/[0.04] dark:hover:bg-white/[0.06]",children:[p.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[p.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary",children:p.jsx(Iw,{size:17})}),p.jsxs("div",{className:"min-w-0",children:[p.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:v.name}),p.jsxs("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:[v.agent_type," · ",((E=v.platforms)==null?void 0:E.join(", "))||"no platform"," · ",v.sessions_count," sessions"]})]})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[v.heartbeat_enabled?p.jsx(Cn,{variant:"success",children:"heartbeat"}):null,p.jsx(fm,{size:16,className:"text-muted-foreground/45 transition-colors group-hover:text-foreground"})]})]},v.name)})})]})]})}function hL(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const pL=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,mL=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gL={};function Qx(e,t){return(gL.jsx?mL:pL).test(e)}const bL=/[ \t\n\f\r]/g;function yL(e){return typeof e=="object"?e.type==="text"?Zx(e.value):!1:Zx(e)}function Zx(e){return e.replace(bL,"")===""}class zo{constructor(t,r,i){this.normal=r,this.property=t,i&&(this.space=i)}}zo.prototype.normal={};zo.prototype.property={};zo.prototype.space=void 0;function JE(e,t){const r={},i={};for(const l of e)Object.assign(r,l.property),Object.assign(i,l.normal);return new zo(r,i,t)}function Yp(e){return e.toLowerCase()}class Wn{constructor(t,r){this.attribute=r,this.property=t}}Wn.prototype.attribute="";Wn.prototype.booleanish=!1;Wn.prototype.boolean=!1;Wn.prototype.commaOrSpaceSeparated=!1;Wn.prototype.commaSeparated=!1;Wn.prototype.defined=!1;Wn.prototype.mustUseProperty=!1;Wn.prototype.number=!1;Wn.prototype.overloadedBoolean=!1;Wn.prototype.property="";Wn.prototype.spaceSeparated=!1;Wn.prototype.space=void 0;let xL=0;const it=Zi(),gn=Zi(),Xp=Zi(),Se=Zi(),$t=Zi(),Ws=Zi(),or=Zi();function Zi(){return 2**++xL}const Wp=Object.freeze(Object.defineProperty({__proto__:null,boolean:it,booleanish:gn,commaOrSpaceSeparated:or,commaSeparated:Ws,number:Se,overloadedBoolean:Xp,spaceSeparated:$t},Symbol.toStringTag,{value:"Module"})),Xh=Object.keys(Wp);class Wm extends Wn{constructor(t,r,i,l){let o=-1;if(super(t,r),Jx(this,"space",l),typeof i=="number")for(;++o<Xh.length;){const c=Xh[o];Jx(this,Xh[o],(i&Wp[c])===Wp[c])}}}Wm.prototype.defined=!0;function Jx(e,t,r){r&&(e[t]=r)}function ll(e){const t={},r={};for(const[i,l]of Object.entries(e.properties)){const o=new Wm(i,e.transform(e.attributes||{},i),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(o.mustUseProperty=!0),t[i]=o,r[Yp(i)]=i,r[Yp(o.attribute)]=i}return new zo(t,r,e.space)}const eS=ll({properties:{ariaActiveDescendant:null,ariaAtomic:gn,ariaAutoComplete:null,ariaBusy:gn,ariaChecked:gn,ariaColCount:Se,ariaColIndex:Se,ariaColSpan:Se,ariaControls:$t,ariaCurrent:null,ariaDescribedBy:$t,ariaDetails:null,ariaDisabled:gn,ariaDropEffect:$t,ariaErrorMessage:null,ariaExpanded:gn,ariaFlowTo:$t,ariaGrabbed:gn,ariaHasPopup:null,ariaHidden:gn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:$t,ariaLevel:Se,ariaLive:null,ariaModal:gn,ariaMultiLine:gn,ariaMultiSelectable:gn,ariaOrientation:null,ariaOwns:$t,ariaPlaceholder:null,ariaPosInSet:Se,ariaPressed:gn,ariaReadOnly:gn,ariaRelevant:null,ariaRequired:gn,ariaRoleDescription:$t,ariaRowCount:Se,ariaRowIndex:Se,ariaRowSpan:Se,ariaSelected:gn,ariaSetSize:Se,ariaSort:null,ariaValueMax:Se,ariaValueMin:Se,ariaValueNow:Se,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function tS(e,t){return t in e?e[t]:t}function nS(e,t){return tS(e,t.toLowerCase())}const vL=ll({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ws,acceptCharset:$t,accessKey:$t,action:null,allow:null,allowFullScreen:it,allowPaymentRequest:it,allowUserMedia:it,alt:null,as:null,async:it,autoCapitalize:null,autoComplete:$t,autoFocus:it,autoPlay:it,blocking:$t,capture:null,charSet:null,checked:it,cite:null,className:$t,cols:Se,colSpan:null,content:null,contentEditable:gn,controls:it,controlsList:$t,coords:Se|Ws,crossOrigin:null,data:null,dateTime:null,decoding:null,default:it,defer:it,dir:null,dirName:null,disabled:it,download:Xp,draggable:gn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:it,formTarget:null,headers:$t,height:Se,hidden:Xp,high:Se,href:null,hrefLang:null,htmlFor:$t,httpEquiv:$t,id:null,imageSizes:null,imageSrcSet:null,inert:it,inputMode:null,integrity:null,is:null,isMap:it,itemId:null,itemProp:$t,itemRef:$t,itemScope:it,itemType:$t,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:it,low:Se,manifest:null,max:null,maxLength:Se,media:null,method:null,min:null,minLength:Se,multiple:it,muted:it,name:null,nonce:null,noModule:it,noValidate:it,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:it,optimum:Se,pattern:null,ping:$t,placeholder:null,playsInline:it,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:it,referrerPolicy:null,rel:$t,required:it,reversed:it,rows:Se,rowSpan:Se,sandbox:$t,scope:null,scoped:it,seamless:it,selected:it,shadowRootClonable:it,shadowRootDelegatesFocus:it,shadowRootMode:null,shape:null,size:Se,sizes:null,slot:null,span:Se,spellCheck:gn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Se,step:null,style:null,tabIndex:Se,target:null,title:null,translate:null,type:null,typeMustMatch:it,useMap:null,value:gn,width:Se,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:$t,axis:null,background:null,bgColor:null,border:Se,borderColor:null,bottomMargin:Se,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:it,declare:it,event:null,face:null,frame:null,frameBorder:null,hSpace:Se,leftMargin:Se,link:null,longDesc:null,lowSrc:null,marginHeight:Se,marginWidth:Se,noResize:it,noHref:it,noShade:it,noWrap:it,object:null,profile:null,prompt:null,rev:null,rightMargin:Se,rules:null,scheme:null,scrolling:gn,standby:null,summary:null,text:null,topMargin:Se,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Se,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:it,disableRemotePlayback:it,prefix:null,property:null,results:Se,security:null,unselectable:null},space:"html",transform:nS}),wL=ll({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:or,accentHeight:Se,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Se,amplitude:Se,arabicForm:null,ascent:Se,attributeName:null,attributeType:null,azimuth:Se,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Se,by:null,calcMode:null,capHeight:Se,className:$t,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:Se,diffuseConstant:Se,direction:null,display:null,dur:null,divisor:Se,dominantBaseline:null,download:it,dx:null,dy:null,edgeMode:null,editable:null,elevation:Se,enableBackground:null,end:null,event:null,exponent:Se,externalResourcesRequired:null,fill:null,fillOpacity:Se,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:Ws,g2:Ws,glyphName:Ws,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Se,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Se,horizOriginX:Se,horizOriginY:Se,id:null,ideographic:Se,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Se,k:Se,k1:Se,k2:Se,k3:Se,k4:Se,kernelMatrix:or,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Se,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:Se,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:Se,overlineThickness:Se,paintOrder:null,panose1:null,path:null,pathLength:Se,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:$t,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Se,pointsAtY:Se,pointsAtZ:Se,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:or,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:or,rev:or,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:or,requiredFeatures:or,requiredFonts:or,requiredFormats:or,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:Se,specularExponent:Se,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Se,strikethroughThickness:Se,string:null,stroke:null,strokeDashArray:or,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Se,strokeOpacity:Se,strokeWidth:null,style:null,surfaceScale:Se,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:or,tabIndex:Se,tableValues:null,target:null,targetX:Se,targetY:Se,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:or,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Se,underlineThickness:Se,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Se,values:null,vAlphabetic:Se,vMathematical:Se,vectorEffect:null,vHanging:Se,vIdeographic:Se,version:null,vertAdvY:Se,vertOriginX:Se,vertOriginY:Se,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Se,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:tS}),rS=ll({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),aS=ll({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:nS}),iS=ll({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),EL={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"},SL=/[A-Z]/g,ev=/-[a-z]/g,_L=/^data[-\w.:]+$/i;function kL(e,t){const r=Yp(t);let i=t,l=Wn;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&_L.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(ev,NL);i="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!ev.test(o)){let c=o.replace(SL,CL);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}l=Wm}return new l(i,t)}function CL(e){return"-"+e.toLowerCase()}function NL(e){return e.charAt(1).toUpperCase()}const TL=JE([eS,vL,rS,aS,iS],"html"),Qm=JE([eS,wL,rS,aS,iS],"svg");function AL(e){return e.join(" ").trim()}var Bs={},Wh,tv;function RL(){if(tv)return Wh;tv=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,d=/^\s+|\s+$/g,f=`
440
- `,h="/",g="*",m="",x="comment",v="declaration";function E(_,C){if(typeof _!="string")throw new TypeError("First argument must be a string");if(!_)return[];C=C||{};var A=1,T=1;function M(Y){var H=Y.match(t);H&&(A+=H.length);var j=Y.lastIndexOf(f);T=~j?Y.length-j:T+Y.length}function P(){var Y={line:A,column:T};return function(H){return H.position=new N(Y),Q(),H}}function N(Y){this.start=Y,this.end={line:A,column:T},this.source=C.source}N.prototype.content=_;function z(Y){var H=new Error(C.source+":"+A+":"+T+": "+Y);if(H.reason=Y,H.filename=C.source,H.line=A,H.column=T,H.source=_,!C.silent)throw H}function G(Y){var H=Y.exec(_);if(H){var j=H[0];return M(j),_=_.slice(j.length),H}}function Q(){G(r)}function R(Y){var H;for(Y=Y||[];H=q();)H!==!1&&Y.push(H);return Y}function q(){var Y=P();if(!(h!=_.charAt(0)||g!=_.charAt(1))){for(var H=2;m!=_.charAt(H)&&(g!=_.charAt(H)||h!=_.charAt(H+1));)++H;if(H+=2,m===_.charAt(H-1))return z("End of comment missing");var j=_.slice(2,H-2);return T+=2,M(j),_=_.slice(H),T+=2,Y({type:x,comment:j})}}function Z(){var Y=P(),H=G(i);if(H){if(q(),!G(l))return z("property missing ':'");var j=G(o),F=Y({type:v,property:S(H[0].replace(e,m)),value:j?S(j[0].replace(e,m)):m});return G(c),F}}function ne(){var Y=[];R(Y);for(var H;H=Z();)H!==!1&&(Y.push(H),R(Y));return Y}return Q(),ne()}function S(_){return _?_.replace(d,m):m}return Wh=E,Wh}var nv;function OL(){if(nv)return Bs;nv=1;var e=Bs&&Bs.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Bs,"__esModule",{value:!0}),Bs.default=r;const t=e(RL());function r(i,l){let o=null;if(!i||typeof i!="string")return o;const c=(0,t.default)(i),d=typeof l=="function";return c.forEach(f=>{if(f.type!=="declaration")return;const{property:h,value:g}=f;d?l(h,g,f):g&&(o=o||{},o[h]=g)}),o}return Bs}var io={},rv;function ML(){if(rv)return io;rv=1,Object.defineProperty(io,"__esModule",{value:!0}),io.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,o=function(h){return!h||r.test(h)||e.test(h)},c=function(h,g){return g.toUpperCase()},d=function(h,g){return"".concat(g,"-")},f=function(h,g){return g===void 0&&(g={}),o(h)?h:(h=h.toLowerCase(),g.reactCompat?h=h.replace(l,d):h=h.replace(i,d),h.replace(t,c))};return io.camelCase=f,io}var so,av;function DL(){if(av)return so;av=1;var e=so&&so.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(OL()),r=ML();function i(l,o){var c={};return!l||typeof l!="string"||(0,t.default)(l,function(d,f){d&&f&&(c[(0,r.camelCase)(d,o)]=f)}),c}return i.default=i,so=i,so}var jL=DL();const LL=tl(jL),sS=lS("end"),Zm=lS("start");function lS(e){return t;function t(r){const i=r&&r.position&&r.position[e]||{};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 IL(e){const t=Zm(e),r=sS(e);if(t&&r)return{start:t,end:r}}function mo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?iv(e.position):"start"in e||"end"in e?iv(e):"line"in e||"column"in e?Qp(e):""}function Qp(e){return sv(e&&e.line)+":"+sv(e&&e.column)}function iv(e){return Qp(e&&e.start)+"-"+Qp(e&&e.end)}function sv(e){return e&&typeof e=="number"?e:1}class Mn extends Error{constructor(t,r,i){super(),typeof r=="string"&&(i=r,r=void 0);let l="",o={},c=!1;if(r&&("line"in r&&"column"in r?o={place:r}:"start"in r&&"end"in r?o={place:r}:"type"in r?o={ancestors:[r],place:r.position}:o={...r}),typeof t=="string"?l=t:!o.cause&&t&&(c=!0,l=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof i=="string"){const f=i.indexOf(":");f===-1?o.ruleId=i:(o.source=i.slice(0,f),o.ruleId=i.slice(f+1))}if(!o.place&&o.ancestors&&o.ancestors){const f=o.ancestors[o.ancestors.length-1];f&&(o.place=f.position)}const d=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=d?d.line:void 0,this.name=mo(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=c&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Mn.prototype.file="";Mn.prototype.name="";Mn.prototype.reason="";Mn.prototype.message="";Mn.prototype.stack="";Mn.prototype.column=void 0;Mn.prototype.line=void 0;Mn.prototype.ancestors=void 0;Mn.prototype.cause=void 0;Mn.prototype.fatal=void 0;Mn.prototype.place=void 0;Mn.prototype.ruleId=void 0;Mn.prototype.source=void 0;const Jm={}.hasOwnProperty,zL=new Map,PL=/[A-Z]/g,BL=new Set(["table","tbody","thead","tfoot","tr"]),UL=new Set(["td","th"]),oS="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function FL(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=XL(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=YL(r,t.jsx,t.jsxs)}const l={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Qm:TL,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=cS(l,e,void 0);return o&&typeof o!="string"?o:l.create(e,l.Fragment,{children:o||void 0},void 0)}function cS(e,t,r){if(t.type==="element")return $L(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return HL(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return qL(e,t,r);if(t.type==="mdxjsEsm")return KL(e,t);if(t.type==="root")return GL(e,t,r);if(t.type==="text")return VL(e,t)}function $L(e,t,r){const i=e.schema;let l=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(l=Qm,e.schema=l),e.ancestors.push(t);const o=dS(e,t.tagName,!1),c=WL(e,t);let d=tg(e,t);return BL.has(t.tagName)&&(d=d.filter(function(f){return typeof f=="string"?!yL(f):!0})),uS(e,c,o,t),eg(c,d),e.ancestors.pop(),e.schema=i,e.create(t,o,c,r)}function HL(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}To(e,t.position)}function KL(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);To(e,t.position)}function qL(e,t,r){const i=e.schema;let l=i;t.name==="svg"&&i.space==="html"&&(l=Qm,e.schema=l),e.ancestors.push(t);const o=t.name===null?e.Fragment:dS(e,t.name,!0),c=QL(e,t),d=tg(e,t);return uS(e,c,o,t),eg(c,d),e.ancestors.pop(),e.schema=i,e.create(t,o,c,r)}function GL(e,t,r){const i={};return eg(i,tg(e,t)),e.create(t,e.Fragment,i,r)}function VL(e,t){return t.value}function uS(e,t,r,i){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=i)}function eg(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function YL(e,t,r){return i;function i(l,o,c,d){const h=Array.isArray(c.children)?r:t;return d?h(o,c,d):h(o,c)}}function XL(e,t){return r;function r(i,l,o,c){const d=Array.isArray(o.children),f=Zm(i);return t(l,o,c,d,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function WL(e,t){const r={};let i,l;for(l in t.properties)if(l!=="children"&&Jm.call(t.properties,l)){const o=ZL(e,l,t.properties[l]);if(o){const[c,d]=o;e.tableCellAlignToStyle&&c==="align"&&typeof d=="string"&&UL.has(t.tagName)?i=d:r[c]=d}}if(i){const o=r.style||(r.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return r}function QL(e,t){const r={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const o=i.data.estree.body[0];o.type;const c=o.expression;c.type;const d=c.properties[0];d.type,Object.assign(r,e.evaluater.evaluateExpression(d.argument))}else To(e,t.position);else{const l=i.name;let o;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const d=i.value.data.estree.body[0];d.type,o=e.evaluater.evaluateExpression(d.expression)}else To(e,t.position);else o=i.value===null?!0:i.value;r[l]=o}return r}function tg(e,t){const r=[];let i=-1;const l=e.passKeys?new Map:zL;for(;++i<t.children.length;){const o=t.children[i];let c;if(e.passKeys){const f=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(f){const h=l.get(f)||0;c=f+"-"+h,l.set(f,h+1)}}const d=cS(e,o,c);d!==void 0&&r.push(d)}return r}function ZL(e,t,r){const i=kL(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=i.commaSeparated?hL(r):AL(r)),i.property==="style"){let l=typeof r=="object"?r:JL(e,String(r));return e.stylePropertyNameCase==="css"&&(l=eI(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&i.space?EL[i.property]||i.property:i.attribute,r]}}function JL(e,t){try{return LL(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const i=r,l=new Mn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=oS+"#cannot-parse-style-attribute",l}}function dS(e,t,r){let i;if(!r)i={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let o=-1,c;for(;++o<l.length;){const d=Qx(l[o])?{type:"Identifier",name:l[o]}:{type:"Literal",value:l[o]};c=c?{type:"MemberExpression",object:c,property:d,computed:!!(o&&d.type==="Literal"),optional:!1}:d}i=c}else i=Qx(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const l=i.value;return Jm.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(i);To(e)}function To(e,t){const r=new Mn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=oS+"#cannot-handle-mdx-estrees-without-createevaluater",r}function eI(e){const t={};let r;for(r in e)Jm.call(e,r)&&(t[tI(r)]=e[r]);return t}function tI(e){let t=e.replace(PL,nI);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function nI(e){return"-"+e.toLowerCase()}const Qh={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"]},rI={};function ng(e,t){const r=rI,i=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,l=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return fS(e,i,l)}function fS(e,t,r){if(aI(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return lv(e.children,t,r)}return Array.isArray(e)?lv(e,t,r):""}function lv(e,t,r){const i=[];let l=-1;for(;++l<e.length;)i[l]=fS(e[l],t,r);return i.join("")}function aI(e){return!!(e&&typeof e=="object")}const ov=document.createElement("i");function rg(e){const t="&"+e+";";ov.innerHTML=t;const r=ov.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function fr(e,t,r,i){const l=e.length;let o=0,c;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,r=r>0?r:0,i.length<1e4)c=Array.from(i),c.unshift(t,r),e.splice(...c);else for(r&&e.splice(t,r);o<i.length;)c=i.slice(o,o+1e4),c.unshift(t,0),e.splice(...c),o+=1e4,t+=1e4}function Nr(e,t){return e.length>0?(fr(e,e.length,0,t),e):t}const cv={}.hasOwnProperty;function hS(e){const t={};let r=-1;for(;++r<e.length;)iI(t,e[r]);return t}function iI(e,t){let r;for(r in t){const l=(cv.call(e,r)?e[r]:void 0)||(e[r]={}),o=t[r];let c;if(o)for(c in o){cv.call(l,c)||(l[c]=[]);const d=o[c];sI(l[c],Array.isArray(d)?d:d?[d]:[])}}}function sI(e,t){let r=-1;const i=[];for(;++r<t.length;)(t[r].add==="after"?e:i).push(t[r]);fr(e,0,0,i)}function pS(e,t){const r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function zr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const zn=bi(/[A-Za-z]/),Rn=bi(/[\dA-Za-z]/),lI=bi(/[#-'*+\--9=?A-Z^-~]/);function Pu(e){return e!==null&&(e<32||e===127)}const Zp=bi(/\d/),oI=bi(/[\dA-Fa-f]/),cI=bi(/[!-/:-@[-`{-~]/);function qe(e){return e!==null&&e<-2}function Bt(e){return e!==null&&(e<0||e===32)}function ht(e){return e===-2||e===-1||e===32}const yd=bi(new RegExp("\\p{P}|\\p{S}","u")),Yi=bi(/\s/);function bi(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function ol(e){const t=[];let r=-1,i=0,l=0;for(;++r<e.length;){const o=e.charCodeAt(r);let c="";if(o===37&&Rn(e.charCodeAt(r+1))&&Rn(e.charCodeAt(r+2)))l=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(c=String.fromCharCode(o));else if(o>55295&&o<57344){const d=e.charCodeAt(r+1);o<56320&&d>56319&&d<57344?(c=String.fromCharCode(o,d),l=1):c="�"}else c=String.fromCharCode(o);c&&(t.push(e.slice(i,r),encodeURIComponent(c)),i=r+l+1,c=""),l&&(r+=l,l=0)}return t.join("")+e.slice(i)}function xt(e,t,r,i){const l=i?i-1:Number.POSITIVE_INFINITY;let o=0;return c;function c(f){return ht(f)?(e.enter(r),d(f)):t(f)}function d(f){return ht(f)&&o++<l?(e.consume(f),d):(e.exit(r),t(f))}}const uI={tokenize:dI};function dI(e){const t=e.attempt(this.parser.constructs.contentInitial,i,l);let r;return t;function i(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),xt(e,t,"linePrefix")}function l(d){return e.enter("paragraph"),o(d)}function o(d){const f=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=f),r=f,c(d)}function c(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return qe(d)?(e.consume(d),e.exit("chunkText"),o):(e.consume(d),c)}}const fI={tokenize:hI},uv={tokenize:pI};function hI(e){const t=this,r=[];let i=0,l,o,c;return d;function d(T){if(i<r.length){const M=r[i];return t.containerState=M[1],e.attempt(M[0].continuation,f,h)(T)}return h(T)}function f(T){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&A();const M=t.events.length;let P=M,N;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){N=t.events[P][1].end;break}C(i);let z=M;for(;z<t.events.length;)t.events[z][1].end={...N},z++;return fr(t.events,P+1,0,t.events.slice(M)),t.events.length=z,h(T)}return d(T)}function h(T){if(i===r.length){if(!l)return x(T);if(l.currentConstruct&&l.currentConstruct.concrete)return E(T);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(uv,g,m)(T)}function g(T){return l&&A(),C(i),x(T)}function m(T){return t.parser.lazy[t.now().line]=i!==r.length,c=t.now().offset,E(T)}function x(T){return t.containerState={},e.attempt(uv,v,E)(T)}function v(T){return i++,r.push([t.currentConstruct,t.containerState]),x(T)}function E(T){if(T===null){l&&A(),C(0),e.consume(T);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:o}),S(T)}function S(T){if(T===null){_(e.exit("chunkFlow"),!0),C(0),e.consume(T);return}return qe(T)?(e.consume(T),_(e.exit("chunkFlow")),i=0,t.interrupt=void 0,d):(e.consume(T),S)}function _(T,M){const P=t.sliceStream(T);if(M&&P.push(null),T.previous=o,o&&(o.next=T),o=T,l.defineSkip(T.start),l.write(P),t.parser.lazy[T.start.line]){let N=l.events.length;for(;N--;)if(l.events[N][1].start.offset<c&&(!l.events[N][1].end||l.events[N][1].end.offset>c))return;const z=t.events.length;let G=z,Q,R;for(;G--;)if(t.events[G][0]==="exit"&&t.events[G][1].type==="chunkFlow"){if(Q){R=t.events[G][1].end;break}Q=!0}for(C(i),N=z;N<t.events.length;)t.events[N][1].end={...R},N++;fr(t.events,G+1,0,t.events.slice(z)),t.events.length=N}}function C(T){let M=r.length;for(;M-- >T;){const P=r[M];t.containerState=P[1],P[0].exit.call(t,e)}r.length=T}function A(){l.write([null]),o=void 0,l=void 0,t.containerState._closeFlow=void 0}}function pI(e,t,r){return xt(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function el(e){if(e===null||Bt(e)||Yi(e))return 1;if(yd(e))return 2}function xd(e,t,r){const i=[];let l=-1;for(;++l<e.length;){const o=e[l].resolveAll;o&&!i.includes(o)&&(t=o(t,r),i.push(o))}return t}const Jp={name:"attention",resolveAll:mI,tokenize:gI};function mI(e,t){let r=-1,i,l,o,c,d,f,h,g;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(i=r;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[i][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;f=e[i][1].end.offset-e[i][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const m={...e[i][1].end},x={...e[r][1].start};dv(m,-f),dv(x,f),c={type:f>1?"strongSequence":"emphasisSequence",start:m,end:{...e[i][1].end}},d={type:f>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:x},o={type:f>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[r][1].start}},l={type:f>1?"strong":"emphasis",start:{...c.start},end:{...d.end}},e[i][1].end={...c.start},e[r][1].start={...d.end},h=[],e[i][1].end.offset-e[i][1].start.offset&&(h=Nr(h,[["enter",e[i][1],t],["exit",e[i][1],t]])),h=Nr(h,[["enter",l,t],["enter",c,t],["exit",c,t],["enter",o,t]]),h=Nr(h,xd(t.parser.constructs.insideSpan.null,e.slice(i+1,r),t)),h=Nr(h,[["exit",o,t],["enter",d,t],["exit",d,t],["exit",l,t]]),e[r][1].end.offset-e[r][1].start.offset?(g=2,h=Nr(h,[["enter",e[r][1],t],["exit",e[r][1],t]])):g=0,fr(e,i-1,r-i+3,h),r=i+h.length-g-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function gI(e,t){const r=this.parser.constructs.attentionMarkers.null,i=this.previous,l=el(i);let o;return c;function c(f){return o=f,e.enter("attentionSequence"),d(f)}function d(f){if(f===o)return e.consume(f),d;const h=e.exit("attentionSequence"),g=el(f),m=!g||g===2&&l||r.includes(f),x=!l||l===2&&g||r.includes(i);return h._open=!!(o===42?m:m&&(l||!x)),h._close=!!(o===42?x:x&&(g||!m)),t(f)}}function dv(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const bI={name:"autolink",tokenize:yI};function yI(e,t,r){let i=0;return l;function l(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(v){return zn(v)?(e.consume(v),c):v===64?r(v):h(v)}function c(v){return v===43||v===45||v===46||Rn(v)?(i=1,d(v)):h(v)}function d(v){return v===58?(e.consume(v),i=0,f):(v===43||v===45||v===46||Rn(v))&&i++<32?(e.consume(v),d):(i=0,h(v))}function f(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||Pu(v)?r(v):(e.consume(v),f)}function h(v){return v===64?(e.consume(v),g):lI(v)?(e.consume(v),h):r(v)}function g(v){return Rn(v)?m(v):r(v)}function m(v){return v===46?(e.consume(v),i=0,g):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):x(v)}function x(v){if((v===45||Rn(v))&&i++<63){const E=v===45?x:m;return e.consume(v),E}return r(v)}}const Po={partial:!0,tokenize:xI};function xI(e,t,r){return i;function i(o){return ht(o)?xt(e,l,"linePrefix")(o):l(o)}function l(o){return o===null||qe(o)?t(o):r(o)}}const mS={continuation:{tokenize:wI},exit:EI,name:"blockQuote",tokenize:vI};function vI(e,t,r){const i=this;return l;function l(c){if(c===62){const d=i.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),o}return r(c)}function o(c){return ht(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function wI(e,t,r){const i=this;return l;function l(c){return ht(c)?xt(e,o,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):o(c)}function o(c){return e.attempt(mS,t,r)(c)}}function EI(e){e.exit("blockQuote")}const gS={name:"characterEscape",tokenize:SI};function SI(e,t,r){return i;function i(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),l}function l(o){return cI(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(o)}}const bS={name:"characterReference",tokenize:_I};function _I(e,t,r){const i=this;let l=0,o,c;return d;function d(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),f}function f(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),o=31,c=Rn,g(m))}function h(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,c=oI,g):(e.enter("characterReferenceValue"),o=7,c=Zp,g(m))}function g(m){if(m===59&&l){const x=e.exit("characterReferenceValue");return c===Rn&&!rg(i.sliceSerialize(x))?r(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(m)&&l++<o?(e.consume(m),g):r(m)}}const fv={partial:!0,tokenize:CI},hv={concrete:!0,name:"codeFenced",tokenize:kI};function kI(e,t,r){const i=this,l={partial:!0,tokenize:P};let o=0,c=0,d;return f;function f(N){return h(N)}function h(N){const z=i.events[i.events.length-1];return o=z&&z[1].type==="linePrefix"?z[2].sliceSerialize(z[1],!0).length:0,d=N,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(N)}function g(N){return N===d?(c++,e.consume(N),g):c<3?r(N):(e.exit("codeFencedFenceSequence"),ht(N)?xt(e,m,"whitespace")(N):m(N))}function m(N){return N===null||qe(N)?(e.exit("codeFencedFence"),i.interrupt?t(N):e.check(fv,S,M)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(N))}function x(N){return N===null||qe(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(N)):ht(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),xt(e,v,"whitespace")(N)):N===96&&N===d?r(N):(e.consume(N),x)}function v(N){return N===null||qe(N)?m(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),E(N))}function E(N){return N===null||qe(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(N)):N===96&&N===d?r(N):(e.consume(N),E)}function S(N){return e.attempt(l,M,_)(N)}function _(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),C}function C(N){return o>0&&ht(N)?xt(e,A,"linePrefix",o+1)(N):A(N)}function A(N){return N===null||qe(N)?e.check(fv,S,M)(N):(e.enter("codeFlowValue"),T(N))}function T(N){return N===null||qe(N)?(e.exit("codeFlowValue"),A(N)):(e.consume(N),T)}function M(N){return e.exit("codeFenced"),t(N)}function P(N,z,G){let Q=0;return R;function R(H){return N.enter("lineEnding"),N.consume(H),N.exit("lineEnding"),q}function q(H){return N.enter("codeFencedFence"),ht(H)?xt(N,Z,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):Z(H)}function Z(H){return H===d?(N.enter("codeFencedFenceSequence"),ne(H)):G(H)}function ne(H){return H===d?(Q++,N.consume(H),ne):Q>=c?(N.exit("codeFencedFenceSequence"),ht(H)?xt(N,Y,"whitespace")(H):Y(H)):G(H)}function Y(H){return H===null||qe(H)?(N.exit("codeFencedFence"),z(H)):G(H)}}}function CI(e,t,r){const i=this;return l;function l(c){return c===null?r(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o)}function o(c){return i.parser.lazy[i.now().line]?r(c):t(c)}}const Zh={name:"codeIndented",tokenize:TI},NI={partial:!0,tokenize:AI};function TI(e,t,r){const i=this;return l;function l(h){return e.enter("codeIndented"),xt(e,o,"linePrefix",5)(h)}function o(h){const g=i.events[i.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?c(h):r(h)}function c(h){return h===null?f(h):qe(h)?e.attempt(NI,c,f)(h):(e.enter("codeFlowValue"),d(h))}function d(h){return h===null||qe(h)?(e.exit("codeFlowValue"),c(h)):(e.consume(h),d)}function f(h){return e.exit("codeIndented"),t(h)}}function AI(e,t,r){const i=this;return l;function l(c){return i.parser.lazy[i.now().line]?r(c):qe(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):xt(e,o,"linePrefix",5)(c)}function o(c){const d=i.events[i.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):qe(c)?l(c):r(c)}}const RI={name:"codeText",previous:MI,resolve:OI,tokenize:DI};function OI(e){let t=e.length-4,r=3,i,l;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=r;++i<t;)if(e[i][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(i=r-1,t++;++i<=t;)l===void 0?i!==t&&e[i][1].type!=="lineEnding"&&(l=i):(i===t||e[i][1].type==="lineEnding")&&(e[l][1].type="codeTextData",i!==l+2&&(e[l][1].end=e[i-1][1].end,e.splice(l+2,i-l-2),t-=i-l-2,i=l+2),l=void 0);return e}function MI(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function DI(e,t,r){let i=0,l,o;return c;function c(m){return e.enter("codeText"),e.enter("codeTextSequence"),d(m)}function d(m){return m===96?(e.consume(m),i++,d):(e.exit("codeTextSequence"),f(m))}function f(m){return m===null?r(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),f):m===96?(o=e.enter("codeTextSequence"),l=0,g(m)):qe(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),f):(e.enter("codeTextData"),h(m))}function h(m){return m===null||m===32||m===96||qe(m)?(e.exit("codeTextData"),f(m)):(e.consume(m),h)}function g(m){return m===96?(e.consume(m),l++,g):l===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(o.type="codeTextData",h(m))}}class jI{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,r){const i=r??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(t,i):t>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,r,i){const l=r||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return i&&lo(this.left,i),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),lo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),lo(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const r=this.left.splice(t,Number.POSITIVE_INFINITY);lo(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);lo(this.left,r.reverse())}}}function lo(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function yS(e){const t={};let r=-1,i,l,o,c,d,f,h;const g=new jI(e);for(;++r<g.length;){for(;r in t;)r=t[r];if(i=g.get(r),r&&i[1].type==="chunkFlow"&&g.get(r-1)[1].type==="listItemPrefix"&&(f=i[1]._tokenizer.events,o=0,o<f.length&&f[o][1].type==="lineEndingBlank"&&(o+=2),o<f.length&&f[o][1].type==="content"))for(;++o<f.length&&f[o][1].type!=="content";)f[o][1].type==="chunkText"&&(f[o][1]._isInFirstContentOfListItem=!0,o++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,LI(g,r)),r=t[r],h=!0);else if(i[1]._container){for(o=r,l=void 0;o--;)if(c=g.get(o),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(l&&(g.get(l)[1].type="lineEndingBlank"),c[1].type="lineEnding",l=o);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;l&&(i[1].end={...g.get(l)[1].start},d=g.slice(l,r),d.unshift(i),g.splice(l,r-l+1,d))}}return fr(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!h}function LI(e,t){const r=e.get(t)[1],i=e.get(t)[2];let l=t-1;const o=[];let c=r._tokenizer;c||(c=i.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const d=c.events,f=[],h={};let g,m,x=-1,v=r,E=0,S=0;const _=[S];for(;v;){for(;e.get(++l)[1]!==v;);o.push(l),v._tokenizer||(g=i.sliceStream(v),v.next||g.push(null),m&&c.defineSkip(v.start),v._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(g),v._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),m=v,v=v.next}for(v=r;++x<d.length;)d[x][0]==="exit"&&d[x-1][0]==="enter"&&d[x][1].type===d[x-1][1].type&&d[x][1].start.line!==d[x][1].end.line&&(S=x+1,_.push(S),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(c.events=[],v?(v._tokenizer=void 0,v.previous=void 0):_.pop(),x=_.length;x--;){const C=d.slice(_[x],_[x+1]),A=o.pop();f.push([A,A+C.length-1]),e.splice(A,2,C)}for(f.reverse(),x=-1;++x<f.length;)h[E+f[x][0]]=E+f[x][1],E+=f[x][1]-f[x][0]-1;return h}const II={resolve:PI,tokenize:BI},zI={partial:!0,tokenize:UI};function PI(e){return yS(e),e}function BI(e,t){let r;return i;function i(d){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),l(d)}function l(d){return d===null?o(d):qe(d)?e.check(zI,c,o)(d):(e.consume(d),l)}function o(d){return e.exit("chunkContent"),e.exit("content"),t(d)}function c(d){return e.consume(d),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,l}}function UI(e,t,r){const i=this;return l;function l(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),xt(e,o,"linePrefix")}function o(c){if(c===null||qe(c))return r(c);const d=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):e.interrupt(i.parser.constructs.flow,r,t)(c)}}function xS(e,t,r,i,l,o,c,d,f){const h=f||Number.POSITIVE_INFINITY;let g=0;return m;function m(C){return C===60?(e.enter(i),e.enter(l),e.enter(o),e.consume(C),e.exit(o),x):C===null||C===32||C===41||Pu(C)?r(C):(e.enter(i),e.enter(c),e.enter(d),e.enter("chunkString",{contentType:"string"}),S(C))}function x(C){return C===62?(e.enter(o),e.consume(C),e.exit(o),e.exit(l),e.exit(i),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),v(C))}function v(C){return C===62?(e.exit("chunkString"),e.exit(d),x(C)):C===null||C===60||qe(C)?r(C):(e.consume(C),C===92?E:v)}function E(C){return C===60||C===62||C===92?(e.consume(C),v):v(C)}function S(C){return!g&&(C===null||C===41||Bt(C))?(e.exit("chunkString"),e.exit(d),e.exit(c),e.exit(i),t(C)):g<h&&C===40?(e.consume(C),g++,S):C===41?(e.consume(C),g--,S):C===null||C===32||C===40||Pu(C)?r(C):(e.consume(C),C===92?_:S)}function _(C){return C===40||C===41||C===92?(e.consume(C),S):S(C)}}function vS(e,t,r,i,l,o){const c=this;let d=0,f;return h;function h(v){return e.enter(i),e.enter(l),e.consume(v),e.exit(l),e.enter(o),g}function g(v){return d>999||v===null||v===91||v===93&&!f||v===94&&!d&&"_hiddenFootnoteSupport"in c.parser.constructs?r(v):v===93?(e.exit(o),e.enter(l),e.consume(v),e.exit(l),e.exit(i),t):qe(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===null||v===91||v===93||qe(v)||d++>999?(e.exit("chunkString"),g(v)):(e.consume(v),f||(f=!ht(v)),v===92?x:m)}function x(v){return v===91||v===92||v===93?(e.consume(v),d++,m):m(v)}}function wS(e,t,r,i,l,o){let c;return d;function d(x){return x===34||x===39||x===40?(e.enter(i),e.enter(l),e.consume(x),e.exit(l),c=x===40?41:x,f):r(x)}function f(x){return x===c?(e.enter(l),e.consume(x),e.exit(l),e.exit(i),t):(e.enter(o),h(x))}function h(x){return x===c?(e.exit(o),f(c)):x===null?r(x):qe(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),xt(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===c||x===null||qe(x)?(e.exit("chunkString"),h(x)):(e.consume(x),x===92?m:g)}function m(x){return x===c||x===92?(e.consume(x),g):g(x)}}function go(e,t){let r;return i;function i(l){return qe(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),r=!0,i):ht(l)?xt(e,i,r?"linePrefix":"lineSuffix")(l):t(l)}}const FI={name:"definition",tokenize:HI},$I={partial:!0,tokenize:KI};function HI(e,t,r){const i=this;let l;return o;function o(v){return e.enter("definition"),c(v)}function c(v){return vS.call(i,e,d,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function d(v){return l=zr(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),f):r(v)}function f(v){return Bt(v)?go(e,h)(v):h(v)}function h(v){return xS(e,g,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function g(v){return e.attempt($I,m,m)(v)}function m(v){return ht(v)?xt(e,x,"whitespace")(v):x(v)}function x(v){return v===null||qe(v)?(e.exit("definition"),i.parser.defined.push(l),t(v)):r(v)}}function KI(e,t,r){return i;function i(d){return Bt(d)?go(e,l)(d):r(d)}function l(d){return wS(e,o,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function o(d){return ht(d)?xt(e,c,"whitespace")(d):c(d)}function c(d){return d===null||qe(d)?t(d):r(d)}}const qI={name:"hardBreakEscape",tokenize:GI};function GI(e,t,r){return i;function i(o){return e.enter("hardBreakEscape"),e.consume(o),l}function l(o){return qe(o)?(e.exit("hardBreakEscape"),t(o)):r(o)}}const VI={name:"headingAtx",resolve:YI,tokenize:XI};function YI(e,t){let r=e.length-2,i=3,l,o;return e[i][1].type==="whitespace"&&(i+=2),r-2>i&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(i===r-1||r-4>i&&e[r-2][1].type==="whitespace")&&(r-=i+1===r?2:4),r>i&&(l={type:"atxHeadingText",start:e[i][1].start,end:e[r][1].end},o={type:"chunkText",start:e[i][1].start,end:e[r][1].end,contentType:"text"},fr(e,i,r-i+1,[["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t]])),e}function XI(e,t,r){let i=0;return l;function l(g){return e.enter("atxHeading"),o(g)}function o(g){return e.enter("atxHeadingSequence"),c(g)}function c(g){return g===35&&i++<6?(e.consume(g),c):g===null||Bt(g)?(e.exit("atxHeadingSequence"),d(g)):r(g)}function d(g){return g===35?(e.enter("atxHeadingSequence"),f(g)):g===null||qe(g)?(e.exit("atxHeading"),t(g)):ht(g)?xt(e,d,"whitespace")(g):(e.enter("atxHeadingText"),h(g))}function f(g){return g===35?(e.consume(g),f):(e.exit("atxHeadingSequence"),d(g))}function h(g){return g===null||g===35||Bt(g)?(e.exit("atxHeadingText"),d(g)):(e.consume(g),h)}}const WI=["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"],pv=["pre","script","style","textarea"],QI={concrete:!0,name:"htmlFlow",resolveTo:e3,tokenize:t3},ZI={partial:!0,tokenize:r3},JI={partial:!0,tokenize:n3};function e3(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function t3(e,t,r){const i=this;let l,o,c,d,f;return h;function h(D){return g(D)}function g(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),m}function m(D){return D===33?(e.consume(D),x):D===47?(e.consume(D),o=!0,S):D===63?(e.consume(D),l=3,i.interrupt?t:L):zn(D)?(e.consume(D),c=String.fromCharCode(D),_):r(D)}function x(D){return D===45?(e.consume(D),l=2,v):D===91?(e.consume(D),l=5,d=0,E):zn(D)?(e.consume(D),l=4,i.interrupt?t:L):r(D)}function v(D){return D===45?(e.consume(D),i.interrupt?t:L):r(D)}function E(D){const J="CDATA[";return D===J.charCodeAt(d++)?(e.consume(D),d===J.length?i.interrupt?t:Z:E):r(D)}function S(D){return zn(D)?(e.consume(D),c=String.fromCharCode(D),_):r(D)}function _(D){if(D===null||D===47||D===62||Bt(D)){const J=D===47,be=c.toLowerCase();return!J&&!o&&pv.includes(be)?(l=1,i.interrupt?t(D):Z(D)):WI.includes(c.toLowerCase())?(l=6,J?(e.consume(D),C):i.interrupt?t(D):Z(D)):(l=7,i.interrupt&&!i.parser.lazy[i.now().line]?r(D):o?A(D):T(D))}return D===45||Rn(D)?(e.consume(D),c+=String.fromCharCode(D),_):r(D)}function C(D){return D===62?(e.consume(D),i.interrupt?t:Z):r(D)}function A(D){return ht(D)?(e.consume(D),A):R(D)}function T(D){return D===47?(e.consume(D),R):D===58||D===95||zn(D)?(e.consume(D),M):ht(D)?(e.consume(D),T):R(D)}function M(D){return D===45||D===46||D===58||D===95||Rn(D)?(e.consume(D),M):P(D)}function P(D){return D===61?(e.consume(D),N):ht(D)?(e.consume(D),P):T(D)}function N(D){return D===null||D===60||D===61||D===62||D===96?r(D):D===34||D===39?(e.consume(D),f=D,z):ht(D)?(e.consume(D),N):G(D)}function z(D){return D===f?(e.consume(D),f=null,Q):D===null||qe(D)?r(D):(e.consume(D),z)}function G(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||Bt(D)?P(D):(e.consume(D),G)}function Q(D){return D===47||D===62||ht(D)?T(D):r(D)}function R(D){return D===62?(e.consume(D),q):r(D)}function q(D){return D===null||qe(D)?Z(D):ht(D)?(e.consume(D),q):r(D)}function Z(D){return D===45&&l===2?(e.consume(D),j):D===60&&l===1?(e.consume(D),F):D===62&&l===4?(e.consume(D),I):D===63&&l===3?(e.consume(D),L):D===93&&l===5?(e.consume(D),K):qe(D)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(ZI,X,ne)(D)):D===null||qe(D)?(e.exit("htmlFlowData"),ne(D)):(e.consume(D),Z)}function ne(D){return e.check(JI,Y,X)(D)}function Y(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),H}function H(D){return D===null||qe(D)?ne(D):(e.enter("htmlFlowData"),Z(D))}function j(D){return D===45?(e.consume(D),L):Z(D)}function F(D){return D===47?(e.consume(D),c="",W):Z(D)}function W(D){if(D===62){const J=c.toLowerCase();return pv.includes(J)?(e.consume(D),I):Z(D)}return zn(D)&&c.length<8?(e.consume(D),c+=String.fromCharCode(D),W):Z(D)}function K(D){return D===93?(e.consume(D),L):Z(D)}function L(D){return D===62?(e.consume(D),I):D===45&&l===2?(e.consume(D),L):Z(D)}function I(D){return D===null||qe(D)?(e.exit("htmlFlowData"),X(D)):(e.consume(D),I)}function X(D){return e.exit("htmlFlow"),t(D)}}function n3(e,t,r){const i=this;return l;function l(c){return qe(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):r(c)}function o(c){return i.parser.lazy[i.now().line]?r(c):t(c)}}function r3(e,t,r){return i;function i(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(Po,t,r)}}const a3={name:"htmlText",tokenize:i3};function i3(e,t,r){const i=this;let l,o,c;return d;function d(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),f}function f(L){return L===33?(e.consume(L),h):L===47?(e.consume(L),P):L===63?(e.consume(L),T):zn(L)?(e.consume(L),G):r(L)}function h(L){return L===45?(e.consume(L),g):L===91?(e.consume(L),o=0,E):zn(L)?(e.consume(L),A):r(L)}function g(L){return L===45?(e.consume(L),v):r(L)}function m(L){return L===null?r(L):L===45?(e.consume(L),x):qe(L)?(c=m,F(L)):(e.consume(L),m)}function x(L){return L===45?(e.consume(L),v):m(L)}function v(L){return L===62?j(L):L===45?x(L):m(L)}function E(L){const I="CDATA[";return L===I.charCodeAt(o++)?(e.consume(L),o===I.length?S:E):r(L)}function S(L){return L===null?r(L):L===93?(e.consume(L),_):qe(L)?(c=S,F(L)):(e.consume(L),S)}function _(L){return L===93?(e.consume(L),C):S(L)}function C(L){return L===62?j(L):L===93?(e.consume(L),C):S(L)}function A(L){return L===null||L===62?j(L):qe(L)?(c=A,F(L)):(e.consume(L),A)}function T(L){return L===null?r(L):L===63?(e.consume(L),M):qe(L)?(c=T,F(L)):(e.consume(L),T)}function M(L){return L===62?j(L):T(L)}function P(L){return zn(L)?(e.consume(L),N):r(L)}function N(L){return L===45||Rn(L)?(e.consume(L),N):z(L)}function z(L){return qe(L)?(c=z,F(L)):ht(L)?(e.consume(L),z):j(L)}function G(L){return L===45||Rn(L)?(e.consume(L),G):L===47||L===62||Bt(L)?Q(L):r(L)}function Q(L){return L===47?(e.consume(L),j):L===58||L===95||zn(L)?(e.consume(L),R):qe(L)?(c=Q,F(L)):ht(L)?(e.consume(L),Q):j(L)}function R(L){return L===45||L===46||L===58||L===95||Rn(L)?(e.consume(L),R):q(L)}function q(L){return L===61?(e.consume(L),Z):qe(L)?(c=q,F(L)):ht(L)?(e.consume(L),q):Q(L)}function Z(L){return L===null||L===60||L===61||L===62||L===96?r(L):L===34||L===39?(e.consume(L),l=L,ne):qe(L)?(c=Z,F(L)):ht(L)?(e.consume(L),Z):(e.consume(L),Y)}function ne(L){return L===l?(e.consume(L),l=void 0,H):L===null?r(L):qe(L)?(c=ne,F(L)):(e.consume(L),ne)}function Y(L){return L===null||L===34||L===39||L===60||L===61||L===96?r(L):L===47||L===62||Bt(L)?Q(L):(e.consume(L),Y)}function H(L){return L===47||L===62||Bt(L)?Q(L):r(L)}function j(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),t):r(L)}function F(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),W}function W(L){return ht(L)?xt(e,K,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):K(L)}function K(L){return e.enter("htmlTextData"),c(L)}}const ag={name:"labelEnd",resolveAll:c3,resolveTo:u3,tokenize:d3},s3={tokenize:f3},l3={tokenize:h3},o3={tokenize:p3};function c3(e){let t=-1;const r=[];for(;++t<e.length;){const i=e[t][1];if(r.push(e[t]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const l=i.type==="labelImage"?4:2;i.type="data",t+=l}}return e.length!==r.length&&fr(e,0,e.length,r),e}function u3(e,t){let r=e.length,i=0,l,o,c,d;for(;r--;)if(l=e[r][1],o){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[r][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(c){if(e[r][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(o=r,l.type!=="labelLink")){i=2;break}}else l.type==="labelEnd"&&(c=r);const f={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[o][1].start},end:{...e[c][1].end}},g={type:"labelText",start:{...e[o+i+2][1].end},end:{...e[c-2][1].start}};return d=[["enter",f,t],["enter",h,t]],d=Nr(d,e.slice(o+1,o+i+3)),d=Nr(d,[["enter",g,t]]),d=Nr(d,xd(t.parser.constructs.insideSpan.null,e.slice(o+i+4,c-3),t)),d=Nr(d,[["exit",g,t],e[c-2],e[c-1],["exit",h,t]]),d=Nr(d,e.slice(c+1)),d=Nr(d,[["exit",f,t]]),fr(e,o,e.length,d),e}function d3(e,t,r){const i=this;let l=i.events.length,o,c;for(;l--;)if((i.events[l][1].type==="labelImage"||i.events[l][1].type==="labelLink")&&!i.events[l][1]._balanced){o=i.events[l][1];break}return d;function d(x){return o?o._inactive?m(x):(c=i.parser.defined.includes(zr(i.sliceSerialize({start:o.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),f):r(x)}function f(x){return x===40?e.attempt(s3,g,c?g:m)(x):x===91?e.attempt(l3,g,c?h:m)(x):c?g(x):m(x)}function h(x){return e.attempt(o3,g,m)(x)}function g(x){return t(x)}function m(x){return o._balanced=!0,r(x)}}function f3(e,t,r){return i;function i(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),l}function l(m){return Bt(m)?go(e,o)(m):o(m)}function o(m){return m===41?g(m):xS(e,c,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function c(m){return Bt(m)?go(e,f)(m):g(m)}function d(m){return r(m)}function f(m){return m===34||m===39||m===40?wS(e,h,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):g(m)}function h(m){return Bt(m)?go(e,g)(m):g(m)}function g(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):r(m)}}function h3(e,t,r){const i=this;return l;function l(d){return vS.call(i,e,o,c,"reference","referenceMarker","referenceString")(d)}function o(d){return i.parser.defined.includes(zr(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(d):r(d)}function c(d){return r(d)}}function p3(e,t,r){return i;function i(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),l}function l(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):r(o)}}const m3={name:"labelStartImage",resolveAll:ag.resolveAll,tokenize:g3};function g3(e,t,r){const i=this;return l;function l(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),o}function o(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),c):r(d)}function c(d){return d===94&&"_hiddenFootnoteSupport"in i.parser.constructs?r(d):t(d)}}const b3={name:"labelStartLink",resolveAll:ag.resolveAll,tokenize:y3};function y3(e,t,r){const i=this;return l;function l(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),o}function o(c){return c===94&&"_hiddenFootnoteSupport"in i.parser.constructs?r(c):t(c)}}const Jh={name:"lineEnding",tokenize:x3};function x3(e,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),xt(e,t,"linePrefix")}}const ku={name:"thematicBreak",tokenize:v3};function v3(e,t,r){let i=0,l;return o;function o(h){return e.enter("thematicBreak"),c(h)}function c(h){return l=h,d(h)}function d(h){return h===l?(e.enter("thematicBreakSequence"),f(h)):i>=3&&(h===null||qe(h))?(e.exit("thematicBreak"),t(h)):r(h)}function f(h){return h===l?(e.consume(h),i++,f):(e.exit("thematicBreakSequence"),ht(h)?xt(e,d,"whitespace")(h):d(h))}}const Xn={continuation:{tokenize:_3},exit:C3,name:"list",tokenize:S3},w3={partial:!0,tokenize:N3},E3={partial:!0,tokenize:k3};function S3(e,t,r){const i=this,l=i.events[i.events.length-1];let o=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,c=0;return d;function d(v){const E=i.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(E==="listUnordered"?!i.containerState.marker||v===i.containerState.marker:Zp(v)){if(i.containerState.type||(i.containerState.type=E,e.enter(E,{_container:!0})),E==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(ku,r,h)(v):h(v);if(!i.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(v)}return r(v)}function f(v){return Zp(v)&&++c<10?(e.consume(v),f):(!i.interrupt||c<2)&&(i.containerState.marker?v===i.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),h(v)):r(v)}function h(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||v,e.check(Po,i.interrupt?r:g,e.attempt(w3,x,m))}function g(v){return i.containerState.initialBlankLine=!0,o++,x(v)}function m(v){return ht(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),x):r(v)}function x(v){return i.containerState.size=o+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function _3(e,t,r){const i=this;return i.containerState._closeFlow=void 0,e.check(Po,l,o);function l(d){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,xt(e,t,"listItemIndent",i.containerState.size+1)(d)}function o(d){return i.containerState.furtherBlankLines||!ht(d)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,c(d)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(E3,t,c)(d))}function c(d){return i.containerState._closeFlow=!0,i.interrupt=void 0,xt(e,e.attempt(Xn,t,r),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function k3(e,t,r){const i=this;return xt(e,l,"listItemIndent",i.containerState.size+1);function l(o){const c=i.events[i.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===i.containerState.size?t(o):r(o)}}function C3(e){e.exit(this.containerState.type)}function N3(e,t,r){const i=this;return xt(e,l,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(o){const c=i.events[i.events.length-1];return!ht(o)&&c&&c[1].type==="listItemPrefixWhitespace"?t(o):r(o)}}const mv={name:"setextUnderline",resolveTo:T3,tokenize:A3};function T3(e,t){let r=e.length,i,l,o;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){i=r;break}e[r][1].type==="paragraph"&&(l=r)}else e[r][1].type==="content"&&e.splice(r,1),!o&&e[r][1].type==="definition"&&(o=r);const c={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",o?(e.splice(l,0,["enter",c,t]),e.splice(o+1,0,["exit",e[i][1],t]),e[i][1].end={...e[o][1].end}):e[i][1]=c,e.push(["exit",c,t]),e}function A3(e,t,r){const i=this;let l;return o;function o(h){let g=i.events.length,m;for(;g--;)if(i.events[g][1].type!=="lineEnding"&&i.events[g][1].type!=="linePrefix"&&i.events[g][1].type!=="content"){m=i.events[g][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||m)?(e.enter("setextHeadingLine"),l=h,c(h)):r(h)}function c(h){return e.enter("setextHeadingLineSequence"),d(h)}function d(h){return h===l?(e.consume(h),d):(e.exit("setextHeadingLineSequence"),ht(h)?xt(e,f,"lineSuffix")(h):f(h))}function f(h){return h===null||qe(h)?(e.exit("setextHeadingLine"),t(h)):r(h)}}const R3={tokenize:O3};function O3(e){const t=this,r=e.attempt(Po,i,e.attempt(this.parser.constructs.flowInitial,l,xt(e,e.attempt(this.parser.constructs.flow,l,e.attempt(II,l)),"linePrefix")));return r;function i(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function l(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,r}}const M3={resolveAll:SS()},D3=ES("string"),j3=ES("text");function ES(e){return{resolveAll:SS(e==="text"?L3:void 0),tokenize:t};function t(r){const i=this,l=this.parser.constructs[e],o=r.attempt(l,c,d);return c;function c(g){return h(g)?o(g):d(g)}function d(g){if(g===null){r.consume(g);return}return r.enter("data"),r.consume(g),f}function f(g){return h(g)?(r.exit("data"),o(g)):(r.consume(g),f)}function h(g){if(g===null)return!0;const m=l[g];let x=-1;if(m)for(;++x<m.length;){const v=m[x];if(!v.previous||v.previous.call(i,i.previous))return!0}return!1}}}function SS(e){return t;function t(r,i){let l=-1,o;for(;++l<=r.length;)o===void 0?r[l]&&r[l][1].type==="data"&&(o=l,l++):(!r[l]||r[l][1].type!=="data")&&(l!==o+2&&(r[o][1].end=r[l-1][1].end,r.splice(o+2,l-o-2),l=o+2),o=void 0);return e?e(r,i):r}}function L3(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const i=e[r-1][1],l=t.sliceStream(i);let o=l.length,c=-1,d=0,f;for(;o--;){const h=l[o];if(typeof h=="string"){for(c=h.length;h.charCodeAt(c-1)===32;)d++,c--;if(c)break;c=-1}else if(h===-2)f=!0,d++;else if(h!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(d=0),d){const h={type:r===e.length||f||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?c:i.start._bufferIndex+c,_index:i.start._index+o,line:i.end.line,column:i.end.column-d,offset:i.end.offset-d},end:{...i.end}};i.end={...h.start},i.start.offset===i.end.offset?Object.assign(i,h):(e.splice(r,0,["enter",h,t],["exit",h,t]),r+=2)}r++}return e}const I3={42:Xn,43:Xn,45:Xn,48:Xn,49:Xn,50:Xn,51:Xn,52:Xn,53:Xn,54:Xn,55:Xn,56:Xn,57:Xn,62:mS},z3={91:FI},P3={[-2]:Zh,[-1]:Zh,32:Zh},B3={35:VI,42:ku,45:[mv,ku],60:QI,61:mv,95:ku,96:hv,126:hv},U3={38:bS,92:gS},F3={[-5]:Jh,[-4]:Jh,[-3]:Jh,33:m3,38:bS,42:Jp,60:[bI,a3],91:b3,92:[qI,gS],93:ag,95:Jp,96:RI},$3={null:[Jp,M3]},H3={null:[42,95]},K3={null:[]},q3=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:H3,contentInitial:z3,disable:K3,document:I3,flow:B3,flowInitial:P3,insideSpan:$3,string:U3,text:F3},Symbol.toStringTag,{value:"Module"}));function G3(e,t,r){let i={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const l={},o=[];let c=[],d=[];const f={attempt:z(P),check:z(N),consume:A,enter:T,exit:M,interrupt:z(N,{interrupt:!0})},h={code:null,containerState:{},defineSkip:S,events:[],now:E,parser:e,previous:null,sliceSerialize:x,sliceStream:v,write:m};let g=t.tokenize.call(h,f);return t.resolveAll&&o.push(t),h;function m(q){return c=Nr(c,q),_(),c[c.length-1]!==null?[]:(G(t,0),h.events=xd(o,h.events,h),h.events)}function x(q,Z){return Y3(v(q),Z)}function v(q){return V3(c,q)}function E(){const{_bufferIndex:q,_index:Z,line:ne,column:Y,offset:H}=i;return{_bufferIndex:q,_index:Z,line:ne,column:Y,offset:H}}function S(q){l[q.line]=q.column,R()}function _(){let q;for(;i._index<c.length;){const Z=c[i._index];if(typeof Z=="string")for(q=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===q&&i._bufferIndex<Z.length;)C(Z.charCodeAt(i._bufferIndex));else C(Z)}}function C(q){g=g(q)}function A(q){qe(q)?(i.line++,i.column=1,i.offset+=q===-3?2:1,R()):q!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===c[i._index].length&&(i._bufferIndex=-1,i._index++)),h.previous=q}function T(q,Z){const ne=Z||{};return ne.type=q,ne.start=E(),h.events.push(["enter",ne,h]),d.push(ne),ne}function M(q){const Z=d.pop();return Z.end=E(),h.events.push(["exit",Z,h]),Z}function P(q,Z){G(q,Z.from)}function N(q,Z){Z.restore()}function z(q,Z){return ne;function ne(Y,H,j){let F,W,K,L;return Array.isArray(Y)?X(Y):"tokenize"in Y?X([Y]):I(Y);function I(pe){return ue;function ue(ve){const ge=ve!==null&&pe[ve],we=ve!==null&&pe.null,ye=[...Array.isArray(ge)?ge:ge?[ge]:[],...Array.isArray(we)?we:we?[we]:[]];return X(ye)(ve)}}function X(pe){return F=pe,W=0,pe.length===0?j:D(pe[W])}function D(pe){return ue;function ue(ve){return L=Q(),K=pe,pe.partial||(h.currentConstruct=pe),pe.name&&h.parser.constructs.disable.null.includes(pe.name)?be():pe.tokenize.call(Z?Object.assign(Object.create(h),Z):h,f,J,be)(ve)}}function J(pe){return q(K,L),H}function be(pe){return L.restore(),++W<F.length?D(F[W]):j}}}function G(q,Z){q.resolveAll&&!o.includes(q)&&o.push(q),q.resolve&&fr(h.events,Z,h.events.length-Z,q.resolve(h.events.slice(Z),h)),q.resolveTo&&(h.events=q.resolveTo(h.events,h))}function Q(){const q=E(),Z=h.previous,ne=h.currentConstruct,Y=h.events.length,H=Array.from(d);return{from:Y,restore:j};function j(){i=q,h.previous=Z,h.currentConstruct=ne,h.events.length=Y,d=H,R()}}function R(){i.line in l&&i.column<2&&(i.column=l[i.line],i.offset+=l[i.line]-1)}}function V3(e,t){const r=t.start._index,i=t.start._bufferIndex,l=t.end._index,o=t.end._bufferIndex;let c;if(r===l)c=[e[r].slice(i,o)];else{if(c=e.slice(r,l),i>-1){const d=c[0];typeof d=="string"?c[0]=d.slice(i):c.shift()}o>0&&c.push(e[l].slice(0,o))}return c}function Y3(e,t){let r=-1;const i=[];let l;for(;++r<e.length;){const o=e[r];let c;if(typeof o=="string")c=o;else switch(o){case-5:{c="\r";break}case-4:{c=`
441
- `;break}case-3:{c=`\r
442
- `;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&l)continue;c=" ";break}default:c=String.fromCharCode(o)}l=o===-2,i.push(c)}return i.join("")}function X3(e){const i={constructs:hS([q3,...(e||{}).extensions||[]]),content:l(uI),defined:[],document:l(fI),flow:l(R3),lazy:{},string:l(D3),text:l(j3)};return i;function l(o){return c;function c(d){return G3(i,o,d)}}}function W3(e){for(;!yS(e););return e}const gv=/[\0\t\n\r]/g;function Q3(){let e=1,t="",r=!0,i;return l;function l(o,c,d){const f=[];let h,g,m,x,v;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(c||void 0).decode(o)),m=0,t="",r&&(o.charCodeAt(0)===65279&&m++,r=void 0);m<o.length;){if(gv.lastIndex=m,h=gv.exec(o),x=h&&h.index!==void 0?h.index:o.length,v=o.charCodeAt(x),!h){t=o.slice(m);break}if(v===10&&m===x&&i)f.push(-3),i=void 0;else switch(i&&(f.push(-5),i=void 0),m<x&&(f.push(o.slice(m,x)),e+=x-m),v){case 0:{f.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,f.push(-2);e++<g;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:i=!0,e=1}m=x+1}return d&&(i&&f.push(-5),t&&f.push(t),f.push(null)),f}}const Z3=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function J3(e){return e.replace(Z3,e4)}function e4(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const l=r.charCodeAt(1),o=l===120||l===88;return pS(r.slice(o?2:1),o?16:10)}return rg(r)||e}const _S={}.hasOwnProperty;function t4(e,t,r){return t&&typeof t=="object"&&(r=t,t=void 0),n4(r)(W3(X3(r).document().write(Q3()(e,t,!0))))}function n4(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(ce),autolinkProtocol:Q,autolinkEmail:Q,atxHeading:o(vt),blockQuote:o(we),characterEscape:Q,characterReference:Q,codeFenced:o(ye),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:o(ye,c),codeText:o(Oe,c),codeTextData:Q,data:Q,codeFlowValue:Q,definition:o(Me),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:o(Te),hardBreakEscape:o(Ie),hardBreakTrailing:o(Ie),htmlFlow:o(Xe,c),htmlFlowData:Q,htmlText:o(Xe,c),htmlTextData:Q,image:o(te),label:c,link:o(ce),listItem:o(De),listItemValue:x,listOrdered:o(Ne,m),listUnordered:o(Ne),paragraph:o(wt),reference:D,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:o(vt),strong:o(Xt),thematicBreak:o(Zt)},exit:{atxHeading:f(),atxHeadingSequence:P,autolink:f(),autolinkEmail:ge,autolinkProtocol:ve,blockQuote:f(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:be,characterReferenceMarkerNumeric:be,characterReferenceValue:pe,characterReference:ue,codeFenced:f(_),codeFencedFence:S,codeFencedFenceInfo:v,codeFencedFenceMeta:E,codeFlowValue:R,codeIndented:f(C),codeText:f(H),codeTextData:R,data:R,definition:f(),definitionDestinationString:M,definitionLabelString:A,definitionTitleString:T,emphasis:f(),hardBreakEscape:f(Z),hardBreakTrailing:f(Z),htmlFlow:f(ne),htmlFlowData:R,htmlText:f(Y),htmlTextData:R,image:f(F),label:K,labelText:W,lineEnding:q,link:f(j),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:J,resourceDestinationString:L,resourceTitleString:I,resource:X,setextHeading:f(G),setextHeadingLineSequence:z,setextHeadingText:N,strong:f(),thematicBreak:f()}};kS(t,(e||{}).mdastExtensions||[]);const r={};return i;function i(B){let le={type:"root",children:[]};const _e={stack:[le],tokenStack:[],config:t,enter:d,exit:h,buffer:c,resume:g,data:r},re=[];let xe=-1;for(;++xe<B.length;)if(B[xe][1].type==="listOrdered"||B[xe][1].type==="listUnordered")if(B[xe][0]==="enter")re.push(xe);else{const je=re.pop();xe=l(B,je,xe)}for(xe=-1;++xe<B.length;){const je=t[B[xe][0]];_S.call(je,B[xe][1].type)&&je[B[xe][1].type].call(Object.assign({sliceSerialize:B[xe][2].sliceSerialize},_e),B[xe][1])}if(_e.tokenStack.length>0){const je=_e.tokenStack[_e.tokenStack.length-1];(je[1]||bv).call(_e,void 0,je[0])}for(le.position={start:li(B.length>0?B[0][1].start:{line:1,column:1,offset:0}),end:li(B.length>0?B[B.length-2][1].end:{line:1,column:1,offset:0})},xe=-1;++xe<t.transforms.length;)le=t.transforms[xe](le)||le;return le}function l(B,le,_e){let re=le-1,xe=-1,je=!1,Fe,tt,st,zt;for(;++re<=_e;){const Ze=B[re];switch(Ze[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ze[0]==="enter"?xe++:xe--,zt=void 0;break}case"lineEndingBlank":{Ze[0]==="enter"&&(Fe&&!zt&&!xe&&!st&&(st=re),zt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:zt=void 0}if(!xe&&Ze[0]==="enter"&&Ze[1].type==="listItemPrefix"||xe===-1&&Ze[0]==="exit"&&(Ze[1].type==="listUnordered"||Ze[1].type==="listOrdered")){if(Fe){let Dn=re;for(tt=void 0;Dn--;){const vn=B[Dn];if(vn[1].type==="lineEnding"||vn[1].type==="lineEndingBlank"){if(vn[0]==="exit")continue;tt&&(B[tt][1].type="lineEndingBlank",je=!0),vn[1].type="lineEnding",tt=Dn}else if(!(vn[1].type==="linePrefix"||vn[1].type==="blockQuotePrefix"||vn[1].type==="blockQuotePrefixWhitespace"||vn[1].type==="blockQuoteMarker"||vn[1].type==="listItemIndent"))break}st&&(!tt||st<tt)&&(Fe._spread=!0),Fe.end=Object.assign({},tt?B[tt][1].start:Ze[1].end),B.splice(tt||re,0,["exit",Fe,Ze[2]]),re++,_e++}if(Ze[1].type==="listItemPrefix"){const Dn={type:"listItem",_spread:!1,start:Object.assign({},Ze[1].start),end:void 0};Fe=Dn,B.splice(re,0,["enter",Dn,Ze[2]]),re++,_e++,st=void 0,zt=!0}}}return B[le][1]._spread=je,_e}function o(B,le){return _e;function _e(re){d.call(this,B(re),re),le&&le.call(this,re)}}function c(){this.stack.push({type:"fragment",children:[]})}function d(B,le,_e){this.stack[this.stack.length-1].children.push(B),this.stack.push(B),this.tokenStack.push([le,_e||void 0]),B.position={start:li(le.start),end:void 0}}function f(B){return le;function le(_e){B&&B.call(this,_e),h.call(this,_e)}}function h(B,le){const _e=this.stack.pop(),re=this.tokenStack.pop();if(re)re[0].type!==B.type&&(le?le.call(this,B,re[0]):(re[1]||bv).call(this,B,re[0]));else throw new Error("Cannot close `"+B.type+"` ("+mo({start:B.start,end:B.end})+"): it’s not open");_e.position.end=li(B.end)}function g(){return ng(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function x(B){if(this.data.expectingFirstListItemValue){const le=this.stack[this.stack.length-2];le.start=Number.parseInt(this.sliceSerialize(B),10),this.data.expectingFirstListItemValue=void 0}}function v(){const B=this.resume(),le=this.stack[this.stack.length-1];le.lang=B}function E(){const B=this.resume(),le=this.stack[this.stack.length-1];le.meta=B}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){const B=this.resume(),le=this.stack[this.stack.length-1];le.value=B.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const B=this.resume(),le=this.stack[this.stack.length-1];le.value=B.replace(/(\r?\n|\r)$/g,"")}function A(B){const le=this.resume(),_e=this.stack[this.stack.length-1];_e.label=le,_e.identifier=zr(this.sliceSerialize(B)).toLowerCase()}function T(){const B=this.resume(),le=this.stack[this.stack.length-1];le.title=B}function M(){const B=this.resume(),le=this.stack[this.stack.length-1];le.url=B}function P(B){const le=this.stack[this.stack.length-1];if(!le.depth){const _e=this.sliceSerialize(B).length;le.depth=_e}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function z(B){const le=this.stack[this.stack.length-1];le.depth=this.sliceSerialize(B).codePointAt(0)===61?1:2}function G(){this.data.setextHeadingSlurpLineEnding=void 0}function Q(B){const _e=this.stack[this.stack.length-1].children;let re=_e[_e.length-1];(!re||re.type!=="text")&&(re=ot(),re.position={start:li(B.start),end:void 0},_e.push(re)),this.stack.push(re)}function R(B){const le=this.stack.pop();le.value+=this.sliceSerialize(B),le.position.end=li(B.end)}function q(B){const le=this.stack[this.stack.length-1];if(this.data.atHardBreak){const _e=le.children[le.children.length-1];_e.position.end=li(B.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(le.type)&&(Q.call(this,B),R.call(this,B))}function Z(){this.data.atHardBreak=!0}function ne(){const B=this.resume(),le=this.stack[this.stack.length-1];le.value=B}function Y(){const B=this.resume(),le=this.stack[this.stack.length-1];le.value=B}function H(){const B=this.resume(),le=this.stack[this.stack.length-1];le.value=B}function j(){const B=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";B.type+="Reference",B.referenceType=le,delete B.url,delete B.title}else delete B.identifier,delete B.label;this.data.referenceType=void 0}function F(){const B=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";B.type+="Reference",B.referenceType=le,delete B.url,delete B.title}else delete B.identifier,delete B.label;this.data.referenceType=void 0}function W(B){const le=this.sliceSerialize(B),_e=this.stack[this.stack.length-2];_e.label=J3(le),_e.identifier=zr(le).toLowerCase()}function K(){const B=this.stack[this.stack.length-1],le=this.resume(),_e=this.stack[this.stack.length-1];if(this.data.inReference=!0,_e.type==="link"){const re=B.children;_e.children=re}else _e.alt=le}function L(){const B=this.resume(),le=this.stack[this.stack.length-1];le.url=B}function I(){const B=this.resume(),le=this.stack[this.stack.length-1];le.title=B}function X(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function J(B){const le=this.resume(),_e=this.stack[this.stack.length-1];_e.label=le,_e.identifier=zr(this.sliceSerialize(B)).toLowerCase(),this.data.referenceType="full"}function be(B){this.data.characterReferenceType=B.type}function pe(B){const le=this.sliceSerialize(B),_e=this.data.characterReferenceType;let re;_e?(re=pS(le,_e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):re=rg(le);const xe=this.stack[this.stack.length-1];xe.value+=re}function ue(B){const le=this.stack.pop();le.position.end=li(B.end)}function ve(B){R.call(this,B);const le=this.stack[this.stack.length-1];le.url=this.sliceSerialize(B)}function ge(B){R.call(this,B);const le=this.stack[this.stack.length-1];le.url="mailto:"+this.sliceSerialize(B)}function we(){return{type:"blockquote",children:[]}}function ye(){return{type:"code",lang:null,meta:null,value:""}}function Oe(){return{type:"inlineCode",value:""}}function Me(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Te(){return{type:"emphasis",children:[]}}function vt(){return{type:"heading",depth:0,children:[]}}function Ie(){return{type:"break"}}function Xe(){return{type:"html",value:""}}function te(){return{type:"image",title:null,url:"",alt:null}}function ce(){return{type:"link",title:null,url:"",children:[]}}function Ne(B){return{type:"list",ordered:B.type==="listOrdered",start:null,spread:B._spread,children:[]}}function De(B){return{type:"listItem",spread:B._spread,checked:null,children:[]}}function wt(){return{type:"paragraph",children:[]}}function Xt(){return{type:"strong",children:[]}}function ot(){return{type:"text",value:""}}function Zt(){return{type:"thematicBreak"}}}function li(e){return{line:e.line,column:e.column,offset:e.offset}}function kS(e,t){let r=-1;for(;++r<t.length;){const i=t[r];Array.isArray(i)?kS(e,i):r4(e,i)}}function r4(e,t){let r;for(r in t)if(_S.call(t,r))switch(r){case"canContainEols":{const i=t[r];i&&e[r].push(...i);break}case"transforms":{const i=t[r];i&&e[r].push(...i);break}case"enter":case"exit":{const i=t[r];i&&Object.assign(e[r],i);break}}}function bv(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+mo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+mo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+mo({start:t.start,end:t.end})+") is still open")}function a4(e){const t=this;t.parser=r;function r(i){return t4(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function i4(e,t){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function s4(e,t){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
443
- `}]}function l4(e,t){const r=t.value?t.value+`
444
- `:"",i={},l=t.lang?t.lang.split(/\s+/):[];l.length>0&&(i.className=["language-"+l[0]]);let o={type:"element",tagName:"code",properties:i,children:[{type:"text",value:r}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function o4(e,t){const r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function c4(e,t){const r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function u4(e,t){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),l=ol(i.toLowerCase()),o=e.footnoteOrder.indexOf(i);let c,d=e.footnoteCounts.get(i);d===void 0?(d=0,e.footnoteOrder.push(i),c=e.footnoteOrder.length):c=o+1,d+=1,e.footnoteCounts.set(i,d);const f={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+l,id:r+"fnref-"+l+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,f);const h={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,h),e.applyData(t,h)}function d4(e,t){const r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function f4(e,t){if(e.options.allowDangerousHtml){const r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}}function CS(e,t){const r=t.referenceType;let i="]";if(r==="collapsed"?i+="[]":r==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const l=e.all(t),o=l[0];o&&o.type==="text"?o.value="["+o.value:l.unshift({type:"text",value:"["});const c=l[l.length-1];return c&&c.type==="text"?c.value+=i:l.push({type:"text",value:i}),l}function h4(e,t){const r=String(t.identifier).toUpperCase(),i=e.definitionById.get(r);if(!i)return CS(e,t);const l={src:ol(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(l.title=i.title);const o={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,o),e.applyData(t,o)}function p4(e,t){const r={src:ol(t.url)};t.alt!==null&&t.alt!==void 0&&(r.alt=t.alt),t.title!==null&&t.title!==void 0&&(r.title=t.title);const i={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,i),e.applyData(t,i)}function m4(e,t){const r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);const i={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,i),e.applyData(t,i)}function g4(e,t){const r=String(t.identifier).toUpperCase(),i=e.definitionById.get(r);if(!i)return CS(e,t);const l={href:ol(i.url||"")};i.title!==null&&i.title!==void 0&&(l.title=i.title);const o={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function b4(e,t){const r={href:ol(t.url)};t.title!==null&&t.title!==void 0&&(r.title=t.title);const i={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function y4(e,t,r){const i=e.all(t),l=r?x4(r):NS(t),o={},c=[];if(typeof t.checked=="boolean"){const g=i[0];let m;g&&g.type==="element"&&g.tagName==="p"?m=g:(m={type:"element",tagName:"p",properties:{},children:[]},i.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let d=-1;for(;++d<i.length;){const g=i[d];(l||d!==0||g.type!=="element"||g.tagName!=="p")&&c.push({type:"text",value:`
445
- `}),g.type==="element"&&g.tagName==="p"&&!l?c.push(...g.children):c.push(g)}const f=i[i.length-1];f&&(l||f.type!=="element"||f.tagName!=="p")&&c.push({type:"text",value:`
446
- `});const h={type:"element",tagName:"li",properties:o,children:c};return e.patch(t,h),e.applyData(t,h)}function x4(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const r=e.children;let i=-1;for(;!t&&++i<r.length;)t=NS(r[i])}return t}function NS(e){const t=e.spread;return t??e.children.length>1}function v4(e,t){const r={},i=e.all(t);let l=-1;for(typeof t.start=="number"&&t.start!==1&&(r.start=t.start);++l<i.length;){const c=i[l];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:r,children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function w4(e,t){const r={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function E4(e,t){const r={type:"root",children:e.wrap(e.all(t))};return e.patch(t,r),e.applyData(t,r)}function S4(e,t){const r={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function _4(e,t){const r=e.all(t),i=r.shift(),l=[];if(i){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(t.children[0],c),l.push(c)}if(r.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},d=Zm(t.children[1]),f=sS(t.children[t.children.length-1]);d&&f&&(c.position={start:d,end:f}),l.push(c)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,o),e.applyData(t,o)}function k4(e,t,r){const i=r?r.children:void 0,o=(i?i.indexOf(t):1)===0?"th":"td",c=r&&r.type==="table"?r.align:void 0,d=c?c.length:t.children.length;let f=-1;const h=[];for(;++f<d;){const m=t.children[f],x={},v=c?c[f]:void 0;v&&(x.align=v);let E={type:"element",tagName:o,properties:x,children:[]};m&&(E.children=e.all(m),e.patch(m,E),E=e.applyData(m,E)),h.push(E)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,g),e.applyData(t,g)}function C4(e,t){const r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}const yv=9,xv=32;function N4(e){const t=String(e),r=/\r?\n|\r/g;let i=r.exec(t),l=0;const o=[];for(;i;)o.push(vv(t.slice(l,i.index),l>0,!0),i[0]),l=i.index+i[0].length,i=r.exec(t);return o.push(vv(t.slice(l),l>0,!1)),o.join("")}function vv(e,t,r){let i=0,l=e.length;if(t){let o=e.codePointAt(i);for(;o===yv||o===xv;)i++,o=e.codePointAt(i)}if(r){let o=e.codePointAt(l-1);for(;o===yv||o===xv;)l--,o=e.codePointAt(l-1)}return l>i?e.slice(i,l):""}function T4(e,t){const r={type:"text",value:N4(String(t.value))};return e.patch(t,r),e.applyData(t,r)}function A4(e,t){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)}const R4={blockquote:i4,break:s4,code:l4,delete:o4,emphasis:c4,footnoteReference:u4,heading:d4,html:f4,imageReference:h4,image:p4,inlineCode:m4,linkReference:g4,link:b4,listItem:y4,list:v4,paragraph:w4,root:E4,strong:S4,table:_4,tableCell:C4,tableRow:k4,text:T4,thematicBreak:A4,toml:cu,yaml:cu,definition:cu,footnoteDefinition:cu};function cu(){}const TS=-1,vd=0,bo=1,Bu=2,ig=3,sg=4,lg=5,og=6,AS=7,RS=8,wv=typeof self=="object"?self:globalThis,O4=(e,t)=>{const r=(l,o)=>(e.set(o,l),l),i=l=>{if(e.has(l))return e.get(l);const[o,c]=t[l];switch(o){case vd:case TS:return r(c,l);case bo:{const d=r([],l);for(const f of c)d.push(i(f));return d}case Bu:{const d=r({},l);for(const[f,h]of c)d[i(f)]=i(h);return d}case ig:return r(new Date(c),l);case sg:{const{source:d,flags:f}=c;return r(new RegExp(d,f),l)}case lg:{const d=r(new Map,l);for(const[f,h]of c)d.set(i(f),i(h));return d}case og:{const d=r(new Set,l);for(const f of c)d.add(i(f));return d}case AS:{const{name:d,message:f}=c;return r(new wv[d](f),l)}case RS:return r(BigInt(c),l);case"BigInt":return r(Object(BigInt(c)),l);case"ArrayBuffer":return r(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:d}=new Uint8Array(c);return r(new DataView(d),c)}}return r(new wv[o](c),l)};return i},Ev=e=>O4(new Map,e)(0),Us="",{toString:M4}={},{keys:D4}=Object,oo=e=>{const t=typeof e;if(t!=="object"||!e)return[vd,t];const r=M4.call(e).slice(8,-1);switch(r){case"Array":return[bo,Us];case"Object":return[Bu,Us];case"Date":return[ig,Us];case"RegExp":return[sg,Us];case"Map":return[lg,Us];case"Set":return[og,Us];case"DataView":return[bo,r]}return r.includes("Array")?[bo,r]:r.includes("Error")?[AS,r]:[Bu,r]},uu=([e,t])=>e===vd&&(t==="function"||t==="symbol"),j4=(e,t,r,i)=>{const l=(c,d)=>{const f=i.push(c)-1;return r.set(d,f),f},o=c=>{if(r.has(c))return r.get(c);let[d,f]=oo(c);switch(d){case vd:{let g=c;switch(f){case"bigint":d=RS,g=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);g=null;break;case"undefined":return l([TS],c)}return l([d,g],c)}case bo:{if(f){let x=c;return f==="DataView"?x=new Uint8Array(c.buffer):f==="ArrayBuffer"&&(x=new Uint8Array(c)),l([f,[...x]],c)}const g=[],m=l([d,g],c);for(const x of c)g.push(o(x));return m}case Bu:{if(f)switch(f){case"BigInt":return l([f,c.toString()],c);case"Boolean":case"Number":case"String":return l([f,c.valueOf()],c)}if(t&&"toJSON"in c)return o(c.toJSON());const g=[],m=l([d,g],c);for(const x of D4(c))(e||!uu(oo(c[x])))&&g.push([o(x),o(c[x])]);return m}case ig:return l([d,c.toISOString()],c);case sg:{const{source:g,flags:m}=c;return l([d,{source:g,flags:m}],c)}case lg:{const g=[],m=l([d,g],c);for(const[x,v]of c)(e||!(uu(oo(x))||uu(oo(v))))&&g.push([o(x),o(v)]);return m}case og:{const g=[],m=l([d,g],c);for(const x of c)(e||!uu(oo(x)))&&g.push(o(x));return m}}const{message:h}=c;return l([d,{name:f,message:h}],c)};return o},Sv=(e,{json:t,lossy:r}={})=>{const i=[];return j4(!(t||r),!!t,new Map,i)(e),i},Uu=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Ev(Sv(e,t)):structuredClone(e):(e,t)=>Ev(Sv(e,t));function L4(e,t){const r=[{type:"text",value:"↩"}];return t>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),r}function I4(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function z4(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||L4,i=e.options.footnoteBackLabel||I4,l=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let f=-1;for(;++f<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[f]);if(!h)continue;const g=e.all(h),m=String(h.identifier).toUpperCase(),x=ol(m.toLowerCase());let v=0;const E=[],S=e.footnoteCounts.get(m);for(;S!==void 0&&++v<=S;){E.length>0&&E.push({type:"text",value:" "});let A=typeof r=="string"?r:r(f,v);typeof A=="string"&&(A={type:"text",value:A}),E.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+x+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(f,v),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const _=g[g.length-1];if(_&&_.type==="element"&&_.tagName==="p"){const A=_.children[_.children.length-1];A&&A.type==="text"?A.value+=" ":_.children.push({type:"text",value:" "}),_.children.push(...E)}else g.push(...E);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+x},children:e.wrap(g,!0)};e.patch(h,C),d.push(C)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Uu(c),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
447
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
448
- `}]}}const Bo=(function(e){if(e==null)return F4;if(typeof e=="function")return wd(e);if(typeof e=="object")return Array.isArray(e)?P4(e):B4(e);if(typeof e=="string")return U4(e);throw new Error("Expected function, string, or object as test")});function P4(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=Bo(e[r]);return wd(i);function i(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function B4(e){const t=e;return wd(r);function r(i){const l=i;let o;for(o in e)if(l[o]!==t[o])return!1;return!0}}function U4(e){return wd(t);function t(r){return r&&r.type===e}}function wd(e){return t;function t(r,i,l){return!!($4(r)&&e.call(this,r,typeof i=="number"?i:void 0,l||void 0))}}function F4(){return!0}function $4(e){return e!==null&&typeof e=="object"&&"type"in e}const OS=[],H4=!0,em=!1,K4="skip";function MS(e,t,r,i){let l;typeof t=="function"&&typeof r!="function"?(i=r,r=t):l=t;const o=Bo(l),c=i?-1:1;d(e,void 0,[])();function d(f,h,g){const m=f&&typeof f=="object"?f:{};if(typeof m.type=="string"){const v=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(f.type+(v?"<"+v+">":""))+")"})}return x;function x(){let v=OS,E,S,_;if((!t||o(f,h,g[g.length-1]||void 0))&&(v=q4(r(f,g)),v[0]===em))return v;if("children"in f&&f.children){const C=f;if(C.children&&v[0]!==K4)for(S=(i?C.children.length:-1)+c,_=g.concat(C);S>-1&&S<C.children.length;){const A=C.children[S];if(E=d(A,S,_)(),E[0]===em)return E;S=typeof E[1]=="number"?E[1]:S+c}}return v}}}function q4(e){return Array.isArray(e)?e:typeof e=="number"?[H4,e]:e==null?OS:[e]}function Ed(e,t,r,i){let l,o,c;typeof t=="function"&&typeof r!="function"?(o=void 0,c=t,l=r):(o=t,c=r,l=i),MS(e,o,d,l);function d(f,h){const g=h[h.length-1],m=g?g.children.indexOf(f):void 0;return c(f,m,g)}}const tm={}.hasOwnProperty,G4={};function V4(e,t){const r=t||G4,i=new Map,l=new Map,o=new Map,c={...R4,...r.handlers},d={all:h,applyData:X4,definitionById:i,footnoteById:l,footnoteCounts:o,footnoteOrder:[],handlers:c,one:f,options:r,patch:Y4,wrap:Q4};return Ed(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const m=g.type==="definition"?i:l,x=String(g.identifier).toUpperCase();m.has(x)||m.set(x,g)}}),d;function f(g,m){const x=g.type,v=d.handlers[x];if(tm.call(d.handlers,x)&&v)return v(d,g,m);if(d.options.passThrough&&d.options.passThrough.includes(x)){if("children"in g){const{children:S,..._}=g,C=Uu(_);return C.children=d.all(g),C}return Uu(g)}return(d.options.unknownHandler||W4)(d,g,m)}function h(g){const m=[];if("children"in g){const x=g.children;let v=-1;for(;++v<x.length;){const E=d.one(x[v],g);if(E){if(v&&x[v-1].type==="break"&&(!Array.isArray(E)&&E.type==="text"&&(E.value=_v(E.value)),!Array.isArray(E)&&E.type==="element")){const S=E.children[0];S&&S.type==="text"&&(S.value=_v(S.value))}Array.isArray(E)?m.push(...E):m.push(E)}}}return m}}function Y4(e,t){e.position&&(t.position=IL(e))}function X4(e,t){let r=t;if(e&&e.data){const i=e.data.hName,l=e.data.hChildren,o=e.data.hProperties;if(typeof i=="string")if(r.type==="element")r.tagName=i;else{const c="children"in r?r.children:[r];r={type:"element",tagName:i,properties:{},children:c}}r.type==="element"&&o&&Object.assign(r.properties,Uu(o)),"children"in r&&r.children&&l!==null&&l!==void 0&&(r.children=l)}return r}function W4(e,t){const r=t.data||{},i="value"in t&&!(tm.call(r,"hProperties")||tm.call(r,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function Q4(e,t){const r=[];let i=-1;for(t&&r.push({type:"text",value:`
449
- `});++i<e.length;)i&&r.push({type:"text",value:`
450
- `}),r.push(e[i]);return t&&e.length>0&&r.push({type:"text",value:`
451
- `}),r}function _v(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function kv(e,t){const r=V4(e,t),i=r.one(e,void 0),l=z4(r),o=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return l&&o.children.push({type:"text",value:`
452
- `},l),o}function Z4(e,t){return e&&"run"in e?async function(r,i){const l=kv(r,{file:i,...t});await e.run(l,i)}:function(r,i){return kv(r,{file:i,...e||t})}}function Cv(e){if(e)throw e}var ep,Nv;function J4(){if(Nv)return ep;Nv=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,l=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},o=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var g=e.call(h,"constructor"),m=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!g&&!m)return!1;var x;for(x in h);return typeof x>"u"||e.call(h,x)},c=function(h,g){r&&g.name==="__proto__"?r(h,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):h[g.name]=g.newValue},d=function(h,g){if(g==="__proto__")if(e.call(h,g)){if(i)return i(h,g).value}else return;return h[g]};return ep=function f(){var h,g,m,x,v,E,S=arguments[0],_=1,C=arguments.length,A=!1;for(typeof S=="boolean"&&(A=S,S=arguments[1]||{},_=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});_<C;++_)if(h=arguments[_],h!=null)for(g in h)m=d(S,g),x=d(h,g),S!==x&&(A&&x&&(o(x)||(v=l(x)))?(v?(v=!1,E=m&&l(m)?m:[]):E=m&&o(m)?m:{},c(S,{name:g,newValue:f(A,E,x)})):typeof x<"u"&&c(S,{name:g,newValue:x}));return S},ep}var ez=J4();const tp=tl(ez);function nm(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function tz(){const e=[],t={run:r,use:i};return t;function r(...l){let o=-1;const c=l.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);d(null,...l);function d(f,...h){const g=e[++o];let m=-1;if(f){c(f);return}for(;++m<l.length;)(h[m]===null||h[m]===void 0)&&(h[m]=l[m]);l=h,g?nz(g,d)(...h):c(null,...h)}}function i(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),t}}function nz(e,t){let r;return i;function i(...c){const d=e.length>c.length;let f;d&&c.push(l);try{f=e.apply(this,c)}catch(h){const g=h;if(d&&r)throw g;return l(g)}d||(f&&f.then&&typeof f.then=="function"?f.then(o,l):f instanceof Error?l(f):o(f))}function l(c,...d){r||(r=!0,t(c,...d))}function o(c){l(null,c)}}const Wr={basename:rz,dirname:az,extname:iz,join:sz,sep:"/"};function rz(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Uo(e);let r=0,i=-1,l=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(o){r=l+1;break}}else i<0&&(o=!0,i=l+1);return i<0?"":e.slice(r,i)}if(t===e)return"";let c=-1,d=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(o){r=l+1;break}}else c<0&&(o=!0,c=l+1),d>-1&&(e.codePointAt(l)===t.codePointAt(d--)?d<0&&(i=l):(d=-1,i=c));return r===i?i=c:i<0&&(i=e.length),e.slice(r,i)}function az(e){if(Uo(e),e.length===0)return".";let t=-1,r=e.length,i;for(;--r;)if(e.codePointAt(r)===47){if(i){t=r;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function iz(e){Uo(e);let t=e.length,r=-1,i=0,l=-1,o=0,c;for(;t--;){const d=e.codePointAt(t);if(d===47){if(c){i=t+1;break}continue}r<0&&(c=!0,r=t+1),d===46?l<0?l=t:o!==1&&(o=1):l>-1&&(o=-1)}return l<0||r<0||o===0||o===1&&l===r-1&&l===i+1?"":e.slice(l,r)}function sz(...e){let t=-1,r;for(;++t<e.length;)Uo(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":lz(r)}function lz(e){Uo(e);const t=e.codePointAt(0)===47;let r=oz(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function oz(e,t){let r="",i=0,l=-1,o=0,c=-1,d,f;for(;++c<=e.length;){if(c<e.length)d=e.codePointAt(c);else{if(d===47)break;d=47}if(d===47){if(!(l===c-1||o===1))if(l!==c-1&&o===2){if(r.length<2||i!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(f=r.lastIndexOf("/"),f!==r.length-1){f<0?(r="",i=0):(r=r.slice(0,f),i=r.length-1-r.lastIndexOf("/")),l=c,o=0;continue}}else if(r.length>0){r="",i=0,l=c,o=0;continue}}t&&(r=r.length>0?r+"/..":"..",i=2)}else r.length>0?r+="/"+e.slice(l+1,c):r=e.slice(l+1,c),i=c-l-1;l=c,o=0}else d===46&&o>-1?o++:o=-1}return r}function Uo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const cz={cwd:uz};function uz(){return"/"}function rm(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function dz(e){if(typeof e=="string")e=new URL(e);else if(!rm(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return fz(e)}function fz(e){if(e.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 t=e.pathname;let r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){const i=t.codePointAt(r+2);if(i===70||i===102){const l=new TypeError("File URL path must not include encoded / characters");throw l.code="ERR_INVALID_FILE_URL_PATH",l}}return decodeURIComponent(t)}const np=["history","path","basename","stem","extname","dirname"];class DS{constructor(t){let r;t?rm(t)?r={path:t}:typeof t=="string"||hz(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":cz.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<np.length;){const o=np[i];o in r&&r[o]!==void 0&&r[o]!==null&&(this[o]=o==="history"?[...r[o]]:r[o])}let l;for(l in r)np.includes(l)||(this[l]=r[l])}get basename(){return typeof this.path=="string"?Wr.basename(this.path):void 0}set basename(t){ap(t,"basename"),rp(t,"basename"),this.path=Wr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Wr.dirname(this.path):void 0}set dirname(t){Tv(this.basename,"dirname"),this.path=Wr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Wr.extname(this.path):void 0}set extname(t){if(rp(t,"extname"),Tv(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Wr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){rm(t)&&(t=dz(t)),ap(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Wr.basename(this.path,this.extname):void 0}set stem(t){ap(t,"stem"),rp(t,"stem"),this.path=Wr.join(this.dirname||"",t+(this.extname||""))}fail(t,r,i){const l=this.message(t,r,i);throw l.fatal=!0,l}info(t,r,i){const l=this.message(t,r,i);return l.fatal=void 0,l}message(t,r,i){const l=new Mn(t,r,i);return this.path&&(l.name=this.path+":"+l.name,l.file=this.path),l.fatal=!1,this.messages.push(l),l}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function rp(e,t){if(e&&e.includes(Wr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Wr.sep+"`")}function ap(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Tv(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function hz(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const pz=(function(e){const i=this.constructor.prototype,l=i[e],o=function(){return l.apply(o,arguments)};return Object.setPrototypeOf(o,i),o}),mz={}.hasOwnProperty;class cg extends pz{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=tz()}copy(){const t=new cg;let r=-1;for(;++r<this.attachers.length;){const i=this.attachers[r];t.use(...i)}return t.data(tp(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(lp("data",this.frozen),this.namespace[t]=r,this):mz.call(this.namespace,t)&&this.namespace[t]||void 0:t?(lp("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const l=r.call(t,...i);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const r=du(t),i=this.parser||this.Parser;return ip("parse",i),i(String(r),r)}process(t,r){const i=this;return this.freeze(),ip("process",this.parser||this.Parser),sp("process",this.compiler||this.Compiler),r?l(void 0,r):new Promise(l);function l(o,c){const d=du(t),f=i.parse(d);i.run(f,d,function(g,m,x){if(g||!m||!x)return h(g);const v=m,E=i.stringify(v,x);yz(E)?x.value=E:x.result=E,h(g,x)});function h(g,m){g||!m?c(g):o?o(m):r(void 0,m)}}}processSync(t){let r=!1,i;return this.freeze(),ip("processSync",this.parser||this.Parser),sp("processSync",this.compiler||this.Compiler),this.process(t,l),Rv("processSync","process",r),i;function l(o,c){r=!0,Cv(o),i=c}}run(t,r,i){Av(t),this.freeze();const l=this.transformers;return!i&&typeof r=="function"&&(i=r,r=void 0),i?o(void 0,i):new Promise(o);function o(c,d){const f=du(r);l.run(t,f,h);function h(g,m,x){const v=m||t;g?d(g):c?c(v):i(void 0,v,x)}}}runSync(t,r){let i=!1,l;return this.run(t,r,o),Rv("runSync","run",i),l;function o(c,d){Cv(c),l=d,i=!0}}stringify(t,r){this.freeze();const i=du(r),l=this.compiler||this.Compiler;return sp("stringify",l),Av(t),l(t,i)}use(t,...r){const i=this.attachers,l=this.namespace;if(lp("use",this.frozen),t!=null)if(typeof t=="function")f(t,r);else if(typeof t=="object")Array.isArray(t)?d(t):c(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(h){if(typeof h=="function")f(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[g,...m]=h;f(g,m)}else c(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function c(h){if(!("plugins"in h)&&!("settings"in h))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");d(h.plugins),h.settings&&(l.settings=tp(!0,l.settings,h.settings))}function d(h){let g=-1;if(h!=null)if(Array.isArray(h))for(;++g<h.length;){const m=h[g];o(m)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function f(h,g){let m=-1,x=-1;for(;++m<i.length;)if(i[m][0]===h){x=m;break}if(x===-1)i.push([h,...g]);else if(g.length>0){let[v,...E]=g;const S=i[x][1];nm(S)&&nm(v)&&(v=tp(!0,S,v)),i[x]=[h,v,...E]}}}}const gz=new cg().freeze();function ip(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function sp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function lp(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Av(e){if(!nm(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Rv(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function du(e){return bz(e)?e:new DS(e)}function bz(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function yz(e){return typeof e=="string"||xz(e)}function xz(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const vz="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ov=[],Mv={allowDangerousHtml:!0},wz=/^(https?|ircs?|mailto|xmpp)$/i,Ez=[{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 Dv(e){const t=Sz(e),r=_z(e);return kz(t.runSync(t.parse(r),r),e)}function Sz(e){const t=e.rehypePlugins||Ov,r=e.remarkPlugins||Ov,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Mv}:Mv;return gz().use(a4).use(r).use(Z4,i).use(t)}function _z(e){const t=e.children||"",r=new DS;return typeof t=="string"&&(r.value=t),r}function kz(e,t){const r=t.allowedElements,i=t.allowElement,l=t.components,o=t.disallowedElements,c=t.skipHtml,d=t.unwrapDisallowed,f=t.urlTransform||Cz;for(const g of Ez)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+vz+g.id,void 0);return Ed(e,h),FL(e,{Fragment:p.Fragment,components:l,ignoreInvalidStyle:!0,jsx:p.jsx,jsxs:p.jsxs,passKeys:!0,passNode:!0});function h(g,m,x){if(g.type==="raw"&&x&&typeof m=="number")return c?x.children.splice(m,1):x.children[m]={type:"text",value:g.value},m;if(g.type==="element"){let v;for(v in Qh)if(Object.hasOwn(Qh,v)&&Object.hasOwn(g.properties,v)){const E=g.properties[v],S=Qh[v];(S===null||S.includes(g.tagName))&&(g.properties[v]=f(String(E||""),v,g))}}if(g.type==="element"){let v=r?!r.includes(g.tagName):o?o.includes(g.tagName):!1;if(!v&&i&&typeof m=="number"&&(v=!i(g,m,x)),v&&x&&typeof m=="number")return d&&g.children?x.children.splice(m,1,...g.children):x.children.splice(m,1),m}}}function Cz(e){const t=e.indexOf(":"),r=e.indexOf("?"),i=e.indexOf("#"),l=e.indexOf("/");return t===-1||l!==-1&&t>l||r!==-1&&t>r||i!==-1&&t>i||wz.test(e.slice(0,t))?e:""}function jv(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,l=r.indexOf(t);for(;l!==-1;)i++,l=r.indexOf(t,l+t.length);return i}function Nz(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Tz(e,t,r){const l=Bo((r||{}).ignore||[]),o=Az(t);let c=-1;for(;++c<o.length;)MS(e,"text",d);function d(h,g){let m=-1,x;for(;++m<g.length;){const v=g[m],E=x?x.children:void 0;if(l(v,E?E.indexOf(v):void 0,x))return;x=v}if(x)return f(h,g)}function f(h,g){const m=g[g.length-1],x=o[c][0],v=o[c][1];let E=0;const _=m.children.indexOf(h);let C=!1,A=[];x.lastIndex=0;let T=x.exec(h.value);for(;T;){const M=T.index,P={index:T.index,input:T.input,stack:[...g,h]};let N=v(...T,P);if(typeof N=="string"&&(N=N.length>0?{type:"text",value:N}:void 0),N===!1?x.lastIndex=M+1:(E!==M&&A.push({type:"text",value:h.value.slice(E,M)}),Array.isArray(N)?A.push(...N):N&&A.push(N),E=M+T[0].length,C=!0),!x.global)break;T=x.exec(h.value)}return C?(E<h.value.length&&A.push({type:"text",value:h.value.slice(E)}),m.children.splice(_,1,...A)):A=[h],_+A.length}}function Az(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const r=!e[0]||Array.isArray(e[0])?e:[e];let i=-1;for(;++i<r.length;){const l=r[i];t.push([Rz(l[0]),Oz(l[1])])}return t}function Rz(e){return typeof e=="string"?new RegExp(Nz(e),"g"):e}function Oz(e){return typeof e=="function"?e:function(){return e}}const op="phrasing",cp=["autolink","link","image","label"];function Mz(){return{transforms:[Bz],enter:{literalAutolink:jz,literalAutolinkEmail:up,literalAutolinkHttp:up,literalAutolinkWww:up},exit:{literalAutolink:Pz,literalAutolinkEmail:zz,literalAutolinkHttp:Lz,literalAutolinkWww:Iz}}}function Dz(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:op,notInConstruct:cp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:op,notInConstruct:cp},{character:":",before:"[ps]",after:"\\/",inConstruct:op,notInConstruct:cp}]}}function jz(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function up(e){this.config.enter.autolinkProtocol.call(this,e)}function Lz(e){this.config.exit.autolinkProtocol.call(this,e)}function Iz(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function zz(e){this.config.exit.autolinkEmail.call(this,e)}function Pz(e){this.exit(e)}function Bz(e){Tz(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Uz],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Fz]],{ignore:["link","linkReference"]})}function Uz(e,t,r,i,l){let o="";if(!jS(l)||(/^w/i.test(t)&&(r=t+r,t="",o="http://"),!$z(r)))return!1;const c=Hz(r+i);if(!c[0])return!1;const d={type:"link",title:null,url:o+t+c[0],children:[{type:"text",value:t+c[0]}]};return c[1]?[d,{type:"text",value:c[1]}]:d}function Fz(e,t,r,i){return!jS(i,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+r,children:[{type:"text",value:t+"@"+r}]}}function $z(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Hz(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let r=t[0],i=r.indexOf(")");const l=jv(e,"(");let o=jv(e,")");for(;i!==-1&&l>o;)e+=r.slice(0,i+1),r=r.slice(i+1),i=r.indexOf(")"),o++;return[e,r]}function jS(e,t){const r=e.input.charCodeAt(e.index-1);return(e.index===0||Yi(r)||yd(r))&&(!t||r!==47)}LS.peek=Zz;function Kz(){this.buffer()}function qz(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Gz(){this.buffer()}function Vz(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Yz(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=zr(this.sliceSerialize(e)).toLowerCase(),r.label=t}function Xz(e){this.exit(e)}function Wz(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=zr(this.sliceSerialize(e)).toLowerCase(),r.label=t}function Qz(e){this.exit(e)}function Zz(){return"["}function LS(e,t,r,i){const l=r.createTracker(i);let o=l.move("[^");const c=r.enter("footnoteReference"),d=r.enter("reference");return o+=l.move(r.safe(r.associationId(e),{after:"]",before:o})),d(),c(),o+=l.move("]"),o}function Jz(){return{enter:{gfmFootnoteCallString:Kz,gfmFootnoteCall:qz,gfmFootnoteDefinitionLabelString:Gz,gfmFootnoteDefinition:Vz},exit:{gfmFootnoteCallString:Yz,gfmFootnoteCall:Xz,gfmFootnoteDefinitionLabelString:Wz,gfmFootnoteDefinition:Qz}}}function e5(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:r,footnoteReference:LS},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(i,l,o,c){const d=o.createTracker(c);let f=d.move("[^");const h=o.enter("footnoteDefinition"),g=o.enter("label");return f+=d.move(o.safe(o.associationId(i),{before:f,after:"]"})),g(),f+=d.move("]:"),i.children&&i.children.length>0&&(d.shift(4),f+=d.move((t?`
453
- `:" ")+o.indentLines(o.containerFlow(i,d.current()),t?IS:t5))),h(),f}}function t5(e,t,r){return t===0?e:IS(e,t,r)}function IS(e,t,r){return(r?"":" ")+e}const n5=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];zS.peek=l5;function r5(){return{canContainEols:["delete"],enter:{strikethrough:i5},exit:{strikethrough:s5}}}function a5(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:n5}],handlers:{delete:zS}}}function i5(e){this.enter({type:"delete",children:[]},e)}function s5(e){this.exit(e)}function zS(e,t,r,i){const l=r.createTracker(i),o=r.enter("strikethrough");let c=l.move("~~");return c+=r.containerPhrasing(e,{...l.current(),before:c,after:"~"}),c+=l.move("~~"),o(),c}function l5(){return"~"}function o5(e){return e.length}function c5(e,t){const r=t||{},i=(r.align||[]).concat(),l=r.stringLength||o5,o=[],c=[],d=[],f=[];let h=0,g=-1;for(;++g<e.length;){const S=[],_=[];let C=-1;for(e[g].length>h&&(h=e[g].length);++C<e[g].length;){const A=u5(e[g][C]);if(r.alignDelimiters!==!1){const T=l(A);_[C]=T,(f[C]===void 0||T>f[C])&&(f[C]=T)}S.push(A)}c[g]=S,d[g]=_}let m=-1;if(typeof i=="object"&&"length"in i)for(;++m<h;)o[m]=Lv(i[m]);else{const S=Lv(i);for(;++m<h;)o[m]=S}m=-1;const x=[],v=[];for(;++m<h;){const S=o[m];let _="",C="";S===99?(_=":",C=":"):S===108?_=":":S===114&&(C=":");let A=r.alignDelimiters===!1?1:Math.max(1,f[m]-_.length-C.length);const T=_+"-".repeat(A)+C;r.alignDelimiters!==!1&&(A=_.length+A+C.length,A>f[m]&&(f[m]=A),v[m]=A),x[m]=T}c.splice(1,0,x),d.splice(1,0,v),g=-1;const E=[];for(;++g<c.length;){const S=c[g],_=d[g];m=-1;const C=[];for(;++m<h;){const A=S[m]||"";let T="",M="";if(r.alignDelimiters!==!1){const P=f[m]-(_[m]||0),N=o[m];N===114?T=" ".repeat(P):N===99?P%2?(T=" ".repeat(P/2+.5),M=" ".repeat(P/2-.5)):(T=" ".repeat(P/2),M=T):M=" ".repeat(P)}r.delimiterStart!==!1&&!m&&C.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&A==="")&&(r.delimiterStart!==!1||m)&&C.push(" "),r.alignDelimiters!==!1&&C.push(T),C.push(A),r.alignDelimiters!==!1&&C.push(M),r.padding!==!1&&C.push(" "),(r.delimiterEnd!==!1||m!==h-1)&&C.push("|")}E.push(r.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return E.join(`
454
- `)}function u5(e){return e==null?"":String(e)}function Lv(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function d5(e,t,r,i){const l=r.enter("blockquote"),o=r.createTracker(i);o.move("> "),o.shift(2);const c=r.indentLines(r.containerFlow(e,o.current()),f5);return l(),c}function f5(e,t,r){return">"+(r?"":" ")+e}function h5(e,t){return Iv(e,t.inConstruct,!0)&&!Iv(e,t.notInConstruct,!1)}function Iv(e,t,r){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return r;let i=-1;for(;++i<t.length;)if(e.includes(t[i]))return!0;return!1}function zv(e,t,r,i){let l=-1;for(;++l<r.unsafe.length;)if(r.unsafe[l].character===`
455
- `&&h5(r.stack,r.unsafe[l]))return/[ \t]/.test(i.before)?"":" ";return`\\
456
- `}function p5(e,t){const r=String(e);let i=r.indexOf(t),l=i,o=0,c=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===l?++o>c&&(c=o):o=1,l=i+t.length,i=r.indexOf(t,l);return c}function m5(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function g5(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function b5(e,t,r,i){const l=g5(r),o=e.value||"",c=l==="`"?"GraveAccent":"Tilde";if(m5(e,r)){const m=r.enter("codeIndented"),x=r.indentLines(o,y5);return m(),x}const d=r.createTracker(i),f=l.repeat(Math.max(p5(o,l)+1,3)),h=r.enter("codeFenced");let g=d.move(f);if(e.lang){const m=r.enter(`codeFencedLang${c}`);g+=d.move(r.safe(e.lang,{before:g,after:" ",encode:["`"],...d.current()})),m()}if(e.lang&&e.meta){const m=r.enter(`codeFencedMeta${c}`);g+=d.move(" "),g+=d.move(r.safe(e.meta,{before:g,after:`
457
- `,encode:["`"],...d.current()})),m()}return g+=d.move(`
458
- `),o&&(g+=d.move(o+`
459
- `)),g+=d.move(f),h(),g}function y5(e,t,r){return(r?"":" ")+e}function ug(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function x5(e,t,r,i){const l=ug(r),o=l==='"'?"Quote":"Apostrophe",c=r.enter("definition");let d=r.enter("label");const f=r.createTracker(i);let h=f.move("[");return h+=f.move(r.safe(r.associationId(e),{before:h,after:"]",...f.current()})),h+=f.move("]: "),d(),!e.url||/[\0- \u007F]/.test(e.url)?(d=r.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(r.safe(e.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(d=r.enter("destinationRaw"),h+=f.move(r.safe(e.url,{before:h,after:e.title?" ":`
460
- `,...f.current()}))),d(),e.title&&(d=r.enter(`title${o}`),h+=f.move(" "+l),h+=f.move(r.safe(e.title,{before:h,after:l,...f.current()})),h+=f.move(l),d()),c(),h}function v5(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Ao(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Fu(e,t,r){const i=el(e),l=el(t);return i===void 0?l===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}PS.peek=w5;function PS(e,t,r,i){const l=v5(r),o=r.enter("emphasis"),c=r.createTracker(i),d=c.move(l);let f=c.move(r.containerPhrasing(e,{after:l,before:d,...c.current()}));const h=f.charCodeAt(0),g=Fu(i.before.charCodeAt(i.before.length-1),h,l);g.inside&&(f=Ao(h)+f.slice(1));const m=f.charCodeAt(f.length-1),x=Fu(i.after.charCodeAt(0),m,l);x.inside&&(f=f.slice(0,-1)+Ao(m));const v=c.move(l);return o(),r.attentionEncodeSurroundingInfo={after:x.outside,before:g.outside},d+f+v}function w5(e,t,r){return r.options.emphasis||"*"}function E5(e,t){let r=!1;return Ed(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return r=!0,em}),!!((!e.depth||e.depth<3)&&ng(e)&&(t.options.setext||r))}function S5(e,t,r,i){const l=Math.max(Math.min(6,e.depth||1),1),o=r.createTracker(i);if(E5(e,r)){const g=r.enter("headingSetext"),m=r.enter("phrasing"),x=r.containerPhrasing(e,{...o.current(),before:`
461
- `,after:`
462
- `});return m(),g(),x+`
463
- `+(l===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
464
- `))+1))}const c="#".repeat(l),d=r.enter("headingAtx"),f=r.enter("phrasing");o.move(c+" ");let h=r.containerPhrasing(e,{before:"# ",after:`
465
- `,...o.current()});return/^[\t ]/.test(h)&&(h=Ao(h.charCodeAt(0))+h.slice(1)),h=h?c+" "+h:c,r.options.closeAtx&&(h+=" "+c),f(),d(),h}BS.peek=_5;function BS(e){return e.value||""}function _5(){return"<"}US.peek=k5;function US(e,t,r,i){const l=ug(r),o=l==='"'?"Quote":"Apostrophe",c=r.enter("image");let d=r.enter("label");const f=r.createTracker(i);let h=f.move("![");return h+=f.move(r.safe(e.alt,{before:h,after:"]",...f.current()})),h+=f.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=r.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(r.safe(e.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(d=r.enter("destinationRaw"),h+=f.move(r.safe(e.url,{before:h,after:e.title?" ":")",...f.current()}))),d(),e.title&&(d=r.enter(`title${o}`),h+=f.move(" "+l),h+=f.move(r.safe(e.title,{before:h,after:l,...f.current()})),h+=f.move(l),d()),h+=f.move(")"),c(),h}function k5(){return"!"}FS.peek=C5;function FS(e,t,r,i){const l=e.referenceType,o=r.enter("imageReference");let c=r.enter("label");const d=r.createTracker(i);let f=d.move("![");const h=r.safe(e.alt,{before:f,after:"]",...d.current()});f+=d.move(h+"]["),c();const g=r.stack;r.stack=[],c=r.enter("reference");const m=r.safe(r.associationId(e),{before:f,after:"]",...d.current()});return c(),r.stack=g,o(),l==="full"||!h||h!==m?f+=d.move(m+"]"):l==="shortcut"?f=f.slice(0,-1):f+=d.move("]"),f}function C5(){return"!"}$S.peek=N5;function $S(e,t,r){let i=e.value||"",l="`",o=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(i);)l+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++o<r.unsafe.length;){const c=r.unsafe[o],d=r.compilePattern(c);let f;if(c.atBreak)for(;f=d.exec(i);){let h=f.index;i.charCodeAt(h)===10&&i.charCodeAt(h-1)===13&&h--,i=i.slice(0,h)+" "+i.slice(f.index+1)}}return l+i+l}function N5(){return"`"}function HS(e,t){const r=ng(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(r===e.url||"mailto:"+r===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}KS.peek=T5;function KS(e,t,r,i){const l=ug(r),o=l==='"'?"Quote":"Apostrophe",c=r.createTracker(i);let d,f;if(HS(e,r)){const g=r.stack;r.stack=[],d=r.enter("autolink");let m=c.move("<");return m+=c.move(r.containerPhrasing(e,{before:m,after:">",...c.current()})),m+=c.move(">"),d(),r.stack=g,m}d=r.enter("link"),f=r.enter("label");let h=c.move("[");return h+=c.move(r.containerPhrasing(e,{before:h,after:"](",...c.current()})),h+=c.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=r.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(r.safe(e.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(f=r.enter("destinationRaw"),h+=c.move(r.safe(e.url,{before:h,after:e.title?" ":")",...c.current()}))),f(),e.title&&(f=r.enter(`title${o}`),h+=c.move(" "+l),h+=c.move(r.safe(e.title,{before:h,after:l,...c.current()})),h+=c.move(l),f()),h+=c.move(")"),d(),h}function T5(e,t,r){return HS(e,r)?"<":"["}qS.peek=A5;function qS(e,t,r,i){const l=e.referenceType,o=r.enter("linkReference");let c=r.enter("label");const d=r.createTracker(i);let f=d.move("[");const h=r.containerPhrasing(e,{before:f,after:"]",...d.current()});f+=d.move(h+"]["),c();const g=r.stack;r.stack=[],c=r.enter("reference");const m=r.safe(r.associationId(e),{before:f,after:"]",...d.current()});return c(),r.stack=g,o(),l==="full"||!h||h!==m?f+=d.move(m+"]"):l==="shortcut"?f=f.slice(0,-1):f+=d.move("]"),f}function A5(){return"["}function dg(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function R5(e){const t=dg(e),r=e.options.bulletOther;if(!r)return t==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+r+"`) to be different");return r}function O5(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function GS(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function M5(e,t,r,i){const l=r.enter("list"),o=r.bulletCurrent;let c=e.ordered?O5(r):dg(r);const d=e.ordered?c==="."?")":".":R5(r);let f=t&&r.bulletLastUsed?c===r.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((c==="*"||c==="-")&&g&&(!g.children||!g.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(f=!0),GS(r)===c&&g){let m=-1;for(;++m<e.children.length;){const x=e.children[m];if(x&&x.type==="listItem"&&x.children&&x.children[0]&&x.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(c=d),r.bulletCurrent=c;const h=r.containerFlow(e,i);return r.bulletLastUsed=c,r.bulletCurrent=o,l(),h}function D5(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function j5(e,t,r,i){const l=D5(r);let o=r.bulletCurrent||dg(r);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(r.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let c=o.length+1;(l==="tab"||l==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(c=Math.ceil(c/4)*4);const d=r.createTracker(i);d.move(o+" ".repeat(c-o.length)),d.shift(c);const f=r.enter("listItem"),h=r.indentLines(r.containerFlow(e,d.current()),g);return f(),h;function g(m,x,v){return x?(v?"":" ".repeat(c))+m:(v?o:o+" ".repeat(c-o.length))+m}}function L5(e,t,r,i){const l=r.enter("paragraph"),o=r.enter("phrasing"),c=r.containerPhrasing(e,i);return o(),l(),c}const I5=Bo(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function z5(e,t,r,i){return(e.children.some(function(c){return I5(c)})?r.containerPhrasing:r.containerFlow).call(r,e,i)}function P5(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}VS.peek=B5;function VS(e,t,r,i){const l=P5(r),o=r.enter("strong"),c=r.createTracker(i),d=c.move(l+l);let f=c.move(r.containerPhrasing(e,{after:l,before:d,...c.current()}));const h=f.charCodeAt(0),g=Fu(i.before.charCodeAt(i.before.length-1),h,l);g.inside&&(f=Ao(h)+f.slice(1));const m=f.charCodeAt(f.length-1),x=Fu(i.after.charCodeAt(0),m,l);x.inside&&(f=f.slice(0,-1)+Ao(m));const v=c.move(l+l);return o(),r.attentionEncodeSurroundingInfo={after:x.outside,before:g.outside},d+f+v}function B5(e,t,r){return r.options.strong||"*"}function U5(e,t,r,i){return r.safe(e.value,i)}function F5(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function $5(e,t,r){const i=(GS(r)+(r.options.ruleSpaces?" ":"")).repeat(F5(r));return r.options.ruleSpaces?i.slice(0,-1):i}const YS={blockquote:d5,break:zv,code:b5,definition:x5,emphasis:PS,hardBreak:zv,heading:S5,html:BS,image:US,imageReference:FS,inlineCode:$S,link:KS,linkReference:qS,list:M5,listItem:j5,paragraph:L5,root:z5,strong:VS,text:U5,thematicBreak:$5};function H5(){return{enter:{table:K5,tableData:Pv,tableHeader:Pv,tableRow:G5},exit:{codeText:V5,table:q5,tableData:dp,tableHeader:dp,tableRow:dp}}}function K5(e){const t=e._align;this.enter({type:"table",align:t.map(function(r){return r==="none"?null:r}),children:[]},e),this.data.inTable=!0}function q5(e){this.exit(e),this.data.inTable=void 0}function G5(e){this.enter({type:"tableRow",children:[]},e)}function dp(e){this.exit(e)}function Pv(e){this.enter({type:"tableCell",children:[]},e)}function V5(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Y5));const r=this.stack[this.stack.length-1];r.type,r.value=t,this.exit(e)}function Y5(e,t){return t==="|"?t:e}function X5(e){const t=e||{},r=t.tableCellPadding,i=t.tablePipeAlign,l=t.stringLength,o=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
466
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:c,tableCell:f,tableRow:d}};function c(v,E,S,_){return h(g(v,S,_),v.align)}function d(v,E,S,_){const C=m(v,S,_),A=h([C]);return A.slice(0,A.indexOf(`
467
- `))}function f(v,E,S,_){const C=S.enter("tableCell"),A=S.enter("phrasing"),T=S.containerPhrasing(v,{..._,before:o,after:o});return A(),C(),T}function h(v,E){return c5(v,{align:E,alignDelimiters:i,padding:r,stringLength:l})}function g(v,E,S){const _=v.children;let C=-1;const A=[],T=E.enter("table");for(;++C<_.length;)A[C]=m(_[C],E,S);return T(),A}function m(v,E,S){const _=v.children;let C=-1;const A=[],T=E.enter("tableRow");for(;++C<_.length;)A[C]=f(_[C],v,E,S);return T(),A}function x(v,E,S){let _=YS.inlineCode(v,E,S);return S.stack.includes("tableCell")&&(_=_.replace(/\|/g,"\\$&")),_}}function W5(){return{exit:{taskListCheckValueChecked:Bv,taskListCheckValueUnchecked:Bv,paragraph:Z5}}}function Q5(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:J5}}}function Bv(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Z5(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const i=r.children[0];if(i&&i.type==="text"){const l=t.children;let o=-1,c;for(;++o<l.length;){const d=l[o];if(d.type==="paragraph"){c=d;break}}c===r&&(i.value=i.value.slice(1),i.value.length===0?r.children.shift():r.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,r.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function J5(e,t,r,i){const l=e.children[0],o=typeof e.checked=="boolean"&&l&&l.type==="paragraph",c="["+(e.checked?"x":" ")+"] ",d=r.createTracker(i);o&&d.move(c);let f=YS.listItem(e,t,r,{...i,...d.current()});return o&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),f;function h(g){return g+c}}function eP(){return[Mz(),Jz(),r5(),H5(),W5()]}function tP(e){return{extensions:[Dz(),e5(e),a5(),X5(e),Q5()]}}const nP={tokenize:oP,partial:!0},XS={tokenize:cP,partial:!0},WS={tokenize:uP,partial:!0},QS={tokenize:dP,partial:!0},rP={tokenize:fP,partial:!0},ZS={name:"wwwAutolink",tokenize:sP,previous:e_},JS={name:"protocolAutolink",tokenize:lP,previous:t_},Oa={name:"emailAutolink",tokenize:iP,previous:n_},aa={};function aP(){return{text:aa}}let Pi=48;for(;Pi<123;)aa[Pi]=Oa,Pi++,Pi===58?Pi=65:Pi===91&&(Pi=97);aa[43]=Oa;aa[45]=Oa;aa[46]=Oa;aa[95]=Oa;aa[72]=[Oa,JS];aa[104]=[Oa,JS];aa[87]=[Oa,ZS];aa[119]=[Oa,ZS];function iP(e,t,r){const i=this;let l,o;return c;function c(m){return!am(m)||!n_.call(i,i.previous)||fg(i.events)?r(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(m))}function d(m){return am(m)?(e.consume(m),d):m===64?(e.consume(m),f):r(m)}function f(m){return m===46?e.check(rP,g,h)(m):m===45||m===95||Rn(m)?(o=!0,e.consume(m),f):g(m)}function h(m){return e.consume(m),l=!0,f}function g(m){return o&&l&&zn(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):r(m)}}function sP(e,t,r){const i=this;return l;function l(c){return c!==87&&c!==119||!e_.call(i,i.previous)||fg(i.events)?r(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(nP,e.attempt(XS,e.attempt(WS,o),r),r)(c))}function o(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(c)}}function lP(e,t,r){const i=this;let l="",o=!1;return c;function c(m){return(m===72||m===104)&&t_.call(i,i.previous)&&!fg(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(m),e.consume(m),d):r(m)}function d(m){if(zn(m)&&l.length<5)return l+=String.fromCodePoint(m),e.consume(m),d;if(m===58){const x=l.toLowerCase();if(x==="http"||x==="https")return e.consume(m),f}return r(m)}function f(m){return m===47?(e.consume(m),o?h:(o=!0,f)):r(m)}function h(m){return m===null||Pu(m)||Bt(m)||Yi(m)||yd(m)?r(m):e.attempt(XS,e.attempt(WS,g),r)(m)}function g(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function oP(e,t,r){let i=0;return l;function l(c){return(c===87||c===119)&&i<3?(i++,e.consume(c),l):c===46&&i===3?(e.consume(c),o):r(c)}function o(c){return c===null?r(c):t(c)}}function cP(e,t,r){let i,l,o;return c;function c(h){return h===46||h===95?e.check(QS,f,d)(h):h===null||Bt(h)||Yi(h)||h!==45&&yd(h)?f(h):(o=!0,e.consume(h),c)}function d(h){return h===95?i=!0:(l=i,i=void 0),e.consume(h),c}function f(h){return l||i||!o?r(h):t(h)}}function uP(e,t){let r=0,i=0;return l;function l(c){return c===40?(r++,e.consume(c),l):c===41&&i<r?o(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?e.check(QS,t,o)(c):c===null||Bt(c)||Yi(c)?t(c):(e.consume(c),l)}function o(c){return c===41&&i++,e.consume(c),l}}function dP(e,t,r){return i;function i(d){return d===33||d===34||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===63||d===95||d===126?(e.consume(d),i):d===38?(e.consume(d),o):d===93?(e.consume(d),l):d===60||d===null||Bt(d)||Yi(d)?t(d):r(d)}function l(d){return d===null||d===40||d===91||Bt(d)||Yi(d)?t(d):i(d)}function o(d){return zn(d)?c(d):r(d)}function c(d){return d===59?(e.consume(d),i):zn(d)?(e.consume(d),c):r(d)}}function fP(e,t,r){return i;function i(o){return e.consume(o),l}function l(o){return Rn(o)?r(o):t(o)}}function e_(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Bt(e)}function t_(e){return!zn(e)}function n_(e){return!(e===47||am(e))}function am(e){return e===43||e===45||e===46||e===95||Rn(e)}function fg(e){let t=e.length,r=!1;for(;t--;){const i=e[t][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){r=!0;break}if(i._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const hP={tokenize:wP,partial:!0};function pP(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:yP,continuation:{tokenize:xP},exit:vP}},text:{91:{name:"gfmFootnoteCall",tokenize:bP},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:mP,resolveTo:gP}}}}function mP(e,t,r){const i=this;let l=i.events.length;const o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let c;for(;l--;){const f=i.events[l][1];if(f.type==="labelImage"){c=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return d;function d(f){if(!c||!c._balanced)return r(f);const h=zr(i.sliceSerialize({start:c.end,end:i.now()}));return h.codePointAt(0)!==94||!o.includes(h.slice(1))?r(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function gP(e,t){let r=e.length;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},d=[e[r+1],e[r+2],["enter",i,t],e[r+3],e[r+4],["enter",l,t],["exit",l,t],["enter",o,t],["enter",c,t],["exit",c,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(r,e.length-r+1,...d),e}function bP(e,t,r){const i=this,l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o=0,c;return d;function d(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),f}function f(m){return m!==94?r(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(m){if(o>999||m===93&&!c||m===null||m===91||Bt(m))return r(m);if(m===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return l.includes(zr(i.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):r(m)}return Bt(m)||(c=!0),o++,e.consume(m),m===92?g:h}function g(m){return m===91||m===92||m===93?(e.consume(m),o++,h):h(m)}}function yP(e,t,r){const i=this,l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o,c=0,d;return f;function f(E){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(E){return E===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):r(E)}function g(E){if(c>999||E===93&&!d||E===null||E===91||Bt(E))return r(E);if(E===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return o=zr(i.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return Bt(E)||(d=!0),c++,e.consume(E),E===92?m:g}function m(E){return E===91||E===92||E===93?(e.consume(E),c++,g):g(E)}function x(E){return E===58?(e.enter("definitionMarker"),e.consume(E),e.exit("definitionMarker"),l.includes(o)||l.push(o),xt(e,v,"gfmFootnoteDefinitionWhitespace")):r(E)}function v(E){return t(E)}}function xP(e,t,r){return e.check(Po,t,e.attempt(hP,t,r))}function vP(e){e.exit("gfmFootnoteDefinition")}function wP(e,t,r){const i=this;return xt(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const c=i.events[i.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?t(o):r(o)}}function EP(e){let r=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:o,resolveAll:l};return r==null&&(r=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function l(c,d){let f=-1;for(;++f<c.length;)if(c[f][0]==="enter"&&c[f][1].type==="strikethroughSequenceTemporary"&&c[f][1]._close){let h=f;for(;h--;)if(c[h][0]==="exit"&&c[h][1].type==="strikethroughSequenceTemporary"&&c[h][1]._open&&c[f][1].end.offset-c[f][1].start.offset===c[h][1].end.offset-c[h][1].start.offset){c[f][1].type="strikethroughSequence",c[h][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},c[h][1].start),end:Object.assign({},c[f][1].end)},m={type:"strikethroughText",start:Object.assign({},c[h][1].end),end:Object.assign({},c[f][1].start)},x=[["enter",g,d],["enter",c[h][1],d],["exit",c[h][1],d],["enter",m,d]],v=d.parser.constructs.insideSpan.null;v&&fr(x,x.length,0,xd(v,c.slice(h+1,f),d)),fr(x,x.length,0,[["exit",m,d],["enter",c[f][1],d],["exit",c[f][1],d],["exit",g,d]]),fr(c,h-1,f-h+3,x),f=h+x.length-2;break}}for(f=-1;++f<c.length;)c[f][1].type==="strikethroughSequenceTemporary"&&(c[f][1].type="data");return c}function o(c,d,f){const h=this.previous,g=this.events;let m=0;return x;function x(E){return h===126&&g[g.length-1][1].type!=="characterEscape"?f(E):(c.enter("strikethroughSequenceTemporary"),v(E))}function v(E){const S=el(h);if(E===126)return m>1?f(E):(c.consume(E),m++,v);if(m<2&&!r)return f(E);const _=c.exit("strikethroughSequenceTemporary"),C=el(E);return _._open=!C||C===2&&!!S,_._close=!S||S===2&&!!C,d(E)}}}class SP{constructor(){this.map=[]}add(t,r,i){_P(this,t,r,i)}consume(t){if(this.map.sort(function(o,c){return o[0]-c[0]}),this.map.length===0)return;let r=this.map.length;const i=[];for(;r>0;)r-=1,i.push(t.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),t.length=this.map[r][0];i.push(t.slice()),t.length=0;let l=i.pop();for(;l;){for(const o of l)t.push(o);l=i.pop()}this.map.length=0}}function _P(e,t,r,i){let l=0;if(!(r===0&&i.length===0)){for(;l<e.map.length;){if(e.map[l][0]===t){e.map[l][1]+=r,e.map[l][2].push(...i);return}l+=1}e.map.push([t,r,i])}}function kP(e,t){let r=!1;const i=[];for(;t<e.length;){const l=e[t];if(r){if(l[0]==="enter")l[1].type==="tableContent"&&i.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=i.length-1;i[o]=i[o]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(r=!0);t+=1}return i}function CP(){return{flow:{null:{name:"table",tokenize:NP,resolveAll:TP}}}}function NP(e,t,r){const i=this;let l=0,o=0,c;return d;function d(R){let q=i.events.length-1;for(;q>-1;){const Y=i.events[q][1].type;if(Y==="lineEnding"||Y==="linePrefix")q--;else break}const Z=q>-1?i.events[q][1].type:null,ne=Z==="tableHead"||Z==="tableRow"?N:f;return ne===N&&i.parser.lazy[i.now().line]?r(R):ne(R)}function f(R){return e.enter("tableHead"),e.enter("tableRow"),h(R)}function h(R){return R===124||(c=!0,o+=1),g(R)}function g(R){return R===null?r(R):qe(R)?o>1?(o=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),v):r(R):ht(R)?xt(e,g,"whitespace")(R):(o+=1,c&&(c=!1,l+=1),R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),c=!0,g):(e.enter("data"),m(R)))}function m(R){return R===null||R===124||Bt(R)?(e.exit("data"),g(R)):(e.consume(R),R===92?x:m)}function x(R){return R===92||R===124?(e.consume(R),m):m(R)}function v(R){return i.interrupt=!1,i.parser.lazy[i.now().line]?r(R):(e.enter("tableDelimiterRow"),c=!1,ht(R)?xt(e,E,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):E(R))}function E(R){return R===45||R===58?_(R):R===124?(c=!0,e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),S):P(R)}function S(R){return ht(R)?xt(e,_,"whitespace")(R):_(R)}function _(R){return R===58?(o+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),C):R===45?(o+=1,C(R)):R===null||qe(R)?M(R):P(R)}function C(R){return R===45?(e.enter("tableDelimiterFiller"),A(R)):P(R)}function A(R){return R===45?(e.consume(R),A):R===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(R))}function T(R){return ht(R)?xt(e,M,"whitespace")(R):M(R)}function M(R){return R===124?E(R):R===null||qe(R)?!c||l!==o?P(R):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(R)):P(R)}function P(R){return r(R)}function N(R){return e.enter("tableRow"),z(R)}function z(R){return R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),z):R===null||qe(R)?(e.exit("tableRow"),t(R)):ht(R)?xt(e,z,"whitespace")(R):(e.enter("data"),G(R))}function G(R){return R===null||R===124||Bt(R)?(e.exit("data"),z(R)):(e.consume(R),R===92?Q:G)}function Q(R){return R===92||R===124?(e.consume(R),G):G(R)}}function TP(e,t){let r=-1,i=!0,l=0,o=[0,0,0,0],c=[0,0,0,0],d=!1,f=0,h,g,m;const x=new SP;for(;++r<e.length;){const v=e[r],E=v[1];v[0]==="enter"?E.type==="tableHead"?(d=!1,f!==0&&(Uv(x,t,f,h,g),g=void 0,f=0),h={type:"table",start:Object.assign({},E.start),end:Object.assign({},E.end)},x.add(r,0,[["enter",h,t]])):E.type==="tableRow"||E.type==="tableDelimiterRow"?(i=!0,m=void 0,o=[0,0,0,0],c=[0,r+1,0,0],d&&(d=!1,g={type:"tableBody",start:Object.assign({},E.start),end:Object.assign({},E.end)},x.add(r,0,[["enter",g,t]])),l=E.type==="tableDelimiterRow"?2:g?3:1):l&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")?(i=!1,c[2]===0&&(o[1]!==0&&(c[0]=c[1],m=fu(x,t,o,l,void 0,m),o=[0,0,0,0]),c[2]=r)):E.type==="tableCellDivider"&&(i?i=!1:(o[1]!==0&&(c[0]=c[1],m=fu(x,t,o,l,void 0,m)),o=c,c=[o[1],r,0,0])):E.type==="tableHead"?(d=!0,f=r):E.type==="tableRow"||E.type==="tableDelimiterRow"?(f=r,o[1]!==0?(c[0]=c[1],m=fu(x,t,o,l,r,m)):c[1]!==0&&(m=fu(x,t,c,l,r,m)),l=0):l&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")&&(c[3]=r)}for(f!==0&&Uv(x,t,f,h,g),x.consume(t.events),r=-1;++r<t.events.length;){const v=t.events[r];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=kP(t.events,r))}return e}function fu(e,t,r,i,l,o){const c=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",d="tableContent";r[0]!==0&&(o.end=Object.assign({},$s(t.events,r[0])),e.add(r[0],0,[["exit",o,t]]));const f=$s(t.events,r[1]);if(o={type:c,start:Object.assign({},f),end:Object.assign({},f)},e.add(r[1],0,[["enter",o,t]]),r[2]!==0){const h=$s(t.events,r[2]),g=$s(t.events,r[3]),m={type:d,start:Object.assign({},h),end:Object.assign({},g)};if(e.add(r[2],0,[["enter",m,t]]),i!==2){const x=t.events[r[2]],v=t.events[r[3]];if(x[1].end=Object.assign({},v[1].end),x[1].type="chunkText",x[1].contentType="text",r[3]>r[2]+1){const E=r[2]+1,S=r[3]-r[2]-1;e.add(E,S,[])}}e.add(r[3]+1,0,[["exit",m,t]])}return l!==void 0&&(o.end=Object.assign({},$s(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function Uv(e,t,r,i,l){const o=[],c=$s(t.events,r);l&&(l.end=Object.assign({},c),o.push(["exit",l,t])),i.end=Object.assign({},c),o.push(["exit",i,t]),e.add(r+1,0,o)}function $s(e,t){const r=e[t],i=r[0]==="enter"?"start":"end";return r[1][i]}const AP={name:"tasklistCheck",tokenize:OP};function RP(){return{text:{91:AP}}}function OP(e,t,r){const i=this;return l;function l(f){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?r(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),o)}function o(f){return Bt(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),c):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),c):r(f)}function c(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),d):r(f)}function d(f){return qe(f)?t(f):ht(f)?e.check({tokenize:MP},t,r)(f):r(f)}}function MP(e,t,r){return xt(e,i,"whitespace");function i(l){return l===null?r(l):t(l)}}function DP(e){return hS([aP(),pP(),EP(e),CP(),RP()])}const jP={};function Fv(e){const t=this,r=e||jP,i=t.data(),l=i.micromarkExtensions||(i.micromarkExtensions=[]),o=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),c=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);l.push(DP(r)),o.push(eP()),c.push(tP(r))}const $v=(function(e,t,r){const i=Bo(r);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(i(e.children[t],t,e))return e.children[t]}),Ji=(function(e){if(e==null)return zP;if(typeof e=="string")return IP(e);if(typeof e=="object")return LP(e);if(typeof e=="function")return hg(e);throw new Error("Expected function, string, or array as `test`")});function LP(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=Ji(e[r]);return hg(i);function i(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function IP(e){return hg(t);function t(r){return r.tagName===e}}function hg(e){return t;function t(r,i,l){return!!(PP(r)&&e.call(this,r,typeof i=="number"?i:void 0,l||void 0))}}function zP(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function PP(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const Hv=/\n/g,Kv=/[\t ]+/g,im=Ji("br"),qv=Ji(GP),BP=Ji("p"),Gv=Ji("tr"),UP=Ji(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",qP,VP]),r_=Ji(["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 FP(e,t){const r=t||{},i="children"in e?e.children:[],l=r_(e),o=s_(e,{whitespace:r.whitespace||"normal"}),c=[];(e.type==="text"||e.type==="comment")&&c.push(...i_(e,{breakBefore:!0,breakAfter:!0}));let d=-1;for(;++d<i.length;)c.push(...a_(i[d],e,{whitespace:o,breakBefore:d?void 0:l,breakAfter:d<i.length-1?im(i[d+1]):l}));const f=[];let h;for(d=-1;++d<c.length;){const g=c[d];typeof g=="number"?h!==void 0&&g>h&&(h=g):g&&(h!==void 0&&h>-1&&f.push(`
468
- `.repeat(h)||" "),h=-1,f.push(g))}return f.join("")}function a_(e,t,r){return e.type==="element"?$P(e,t,r):e.type==="text"?r.whitespace==="normal"?i_(e,r):HP(e):[]}function $P(e,t,r){const i=s_(e,r),l=e.children||[];let o=-1,c=[];if(UP(e))return c;let d,f;for(im(e)||Gv(e)&&$v(t,e,Gv)?f=`
469
- `:BP(e)?(d=2,f=2):r_(e)&&(d=1,f=1);++o<l.length;)c=c.concat(a_(l[o],e,{whitespace:i,breakBefore:o?void 0:d,breakAfter:o<l.length-1?im(l[o+1]):f}));return qv(e)&&$v(t,e,qv)&&c.push(" "),d&&c.unshift(d),f&&c.push(f),c}function i_(e,t){const r=String(e.value),i=[],l=[];let o=0;for(;o<=r.length;){Hv.lastIndex=o;const f=Hv.exec(r),h=f&&"index"in f?f.index:r.length;i.push(KP(r.slice(o,h).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),o===0?t.breakBefore:!0,h===r.length?t.breakAfter:!0)),o=h+1}let c=-1,d;for(;++c<i.length;)i[c].charCodeAt(i[c].length-1)===8203||c<i.length-1&&i[c+1].charCodeAt(0)===8203?(l.push(i[c]),d=void 0):i[c]?(typeof d=="number"&&l.push(d),l.push(i[c]),d=0):(c===0||c===i.length-1)&&l.push(0);return l}function HP(e){return[String(e.value)]}function KP(e,t,r){const i=[];let l=0,o;for(;l<e.length;){Kv.lastIndex=l;const c=Kv.exec(e);o=c?c.index:e.length,!l&&!o&&c&&!t&&i.push(""),l!==o&&i.push(e.slice(l,o)),l=c?o+c[0].length:o}return l!==o&&!r&&i.push(""),i.join(" ")}function s_(e,t){if(e.type==="element"){const r=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return r.wrap?"pre-wrap":"pre";case"td":case"th":return r.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function qP(e){return!!(e.properties||{}).hidden}function GP(e){return e.tagName==="td"||e.tagName==="th"}function VP(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function YP(e){const t=e.regex,r=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",l="[a-zA-Z_]\\w*::",c="(?!struct)("+i+"|"+t.optional(l)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",d={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.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:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},g={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},m={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},e.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},r,e.C_BLOCK_COMMENT_MODE]},x={className:"title",begin:t.optional(l)+e.IDENT_RE,relevance:0},v=t.optional(l)+e.IDENT_RE+"\\s*\\(",E=["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"],S=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],_=["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"],C=["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"],M={type:S,keyword:E,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:_},P={className:"function.dispatch",relevance:0,keywords:{_hint:C},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},N=[P,m,d,r,e.C_BLOCK_COMMENT_MODE,g,h],z={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:M,contains:N.concat([{begin:/\(/,end:/\)/,keywords:M,contains:N.concat(["self"]),relevance:0}]),relevance:0},G={className:"function",begin:"("+c+"[\\*&\\s]+)+"+v,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:M,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:M,relevance:0},{begin:v,returnBegin:!0,contains:[x],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[h,g]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:M,relevance:0,contains:[r,e.C_BLOCK_COMMENT_MODE,h,g,d,{begin:/\(/,end:/\)/,keywords:M,relevance:0,contains:["self",r,e.C_BLOCK_COMMENT_MODE,h,g,d]}]},d,r,e.C_BLOCK_COMMENT_MODE,m]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:M,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(z,G,P,N,[m,{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:M,contains:["self",d]},{begin:e.IDENT_RE+"::",keywords:M},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function XP(e){const t={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"]},r=YP(e),i=r.keywords;return i.type=[...i.type,...t.type],i.literal=[...i.literal,...t.literal],i.built_in=[...i.built_in,...t.built_in],i._hints=t._hints,r.name="Arduino",r.aliases=["ino"],r.supersetOf="cpp",r}function WP(e){const t=e.regex,r={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[r]}]};Object.assign(r,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const l={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},o=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),c={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},d={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,r,l]};l.contains.push(d);const f={match:/\\"/},h={className:"string",begin:/'/,end:/'/},g={match:/\\'/},m={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,r]},x=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],v=e.SHEBANG({binary:`(${x.join("|")})`,relevance:10}),E={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},S=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],_=["true","false"],C={match:/(\/[a-z._-]+)+/},A=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],T=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],M=["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"],P=["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:S,literal:_,built_in:[...A,...T,"set","shopt",...M,...P]},contains:[v,e.SHEBANG(),E,m,o,c,C,d,f,h,g,r]}}function QP(e){const t=e.regex,r=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",l="[a-zA-Z_]\\w*::",c="("+i+"|"+t.optional(l)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",d={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.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:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},g={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},m={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},e.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},r,e.C_BLOCK_COMMENT_MODE]},x={className:"title",begin:t.optional(l)+e.IDENT_RE,relevance:0},v=t.optional(l)+e.IDENT_RE+"\\s*\\(",_={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"},C=[m,d,r,e.C_BLOCK_COMMENT_MODE,g,h],A={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:C.concat([{begin:/\(/,end:/\)/,keywords:_,contains:C.concat(["self"]),relevance:0}]),relevance:0},T={begin:"("+c+"[\\*&\\s]+)+"+v,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:_,relevance:0},{begin:v,returnBegin:!0,contains:[e.inherit(x,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[r,e.C_BLOCK_COMMENT_MODE,h,g,d,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",r,e.C_BLOCK_COMMENT_MODE,h,g,d]}]},d,r,e.C_BLOCK_COMMENT_MODE,m]};return{name:"C",aliases:["h"],keywords:_,disableAutodetect:!0,illegal:"</",contains:[].concat(A,T,C,[m,{begin:e.IDENT_RE+"::",keywords:_},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:m,strings:h,keywords:_}}}function ZP(e){const t=e.regex,r=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",l="[a-zA-Z_]\\w*::",c="(?!struct)("+i+"|"+t.optional(l)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",d={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.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:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},g={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},m={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},e.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},r,e.C_BLOCK_COMMENT_MODE]},x={className:"title",begin:t.optional(l)+e.IDENT_RE,relevance:0},v=t.optional(l)+e.IDENT_RE+"\\s*\\(",E=["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"],S=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],_=["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"],C=["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"],M={type:S,keyword:E,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:_},P={className:"function.dispatch",relevance:0,keywords:{_hint:C},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},N=[P,m,d,r,e.C_BLOCK_COMMENT_MODE,g,h],z={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:M,contains:N.concat([{begin:/\(/,end:/\)/,keywords:M,contains:N.concat(["self"]),relevance:0}]),relevance:0},G={className:"function",begin:"("+c+"[\\*&\\s]+)+"+v,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:M,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:M,relevance:0},{begin:v,returnBegin:!0,contains:[x],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[h,g]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:M,relevance:0,contains:[r,e.C_BLOCK_COMMENT_MODE,h,g,d,{begin:/\(/,end:/\)/,keywords:M,relevance:0,contains:["self",r,e.C_BLOCK_COMMENT_MODE,h,g,d]}]},d,r,e.C_BLOCK_COMMENT_MODE,m]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:M,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(z,G,P,N,[m,{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:M,contains:["self",d]},{begin:e.IDENT_RE+"::",keywords:M},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function JP(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],r=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],i=["default","false","null","true"],l=["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"],o=["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"],c={keyword:l.concat(o),built_in:t,literal:i},d=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),f={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},h={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},g={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},m=e.inherit(g,{illegal:/\n/}),x={className:"subst",begin:/\{/,end:/\}/,keywords:c},v=e.inherit(x,{illegal:/\n/}),E={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,v]},S={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},x]},_=e.inherit(S,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},v]});x.contains=[S,E,g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,e.C_BLOCK_COMMENT_MODE],v.contains=[_,E,m,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const C={variants:[h,S,E,g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},A={begin:"<",end:">",contains:[{beginKeywords:"in out"},d]},T=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",M={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:c,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},C,f,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},d,A,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[d,A,e.C_LINE_COMMENT_MODE,e.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:"("+T+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:c,contains:[{beginKeywords:r.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,A],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,relevance:0,contains:[C,f,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},M]}}const eB=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.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:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.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_-]*/}}),tB=["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"],nB=["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"],rB=[...tB,...nB],aB=["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(),iB=["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(),sB=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),lB=["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 oB(e){const t=e.regex,r=eB(e),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},l="and or not only",o=/@-?\w[\w]*(-\w+)*/,c="[a-zA-Z-][a-zA-Z0-9_-]*",d=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[r.BLOCK_COMMENT,i,r.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+c,relevance:0},r.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+iB.join("|")+")"},{begin:":(:)?("+sB.join("|")+")"}]},r.CSS_VARIABLE,{className:"attribute",begin:"\\b("+lB.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[r.BLOCK_COMMENT,r.HEXCOLOR,r.IMPORTANT,r.CSS_NUMBER_MODE,...d,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...d,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},r.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:o},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:l,attribute:aB.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...d,r.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+rB.join("|")+")\\b"}]}}function cB(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.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 uB(e){const o={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:o,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.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:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:o,illegal:/["']/}]}]}}function dB(e){const t=e.regex,r=/[_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:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.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:t.concat(r,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function fB(e){const t=e.regex,r={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},i=e.COMMENT();i.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const l={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},o={className:"literal",begin:/\bon|off|true|false|yes|no\b/},c={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},d={begin:/\[/,end:/\]/,contains:[i,o,l,c,r,"self"],relevance:0},f=/[A-Za-z0-9_-]+/,h=/"(\\"|[^"])*"/,g=/'[^']*'/,m=t.either(f,h,g),x=t.concat(m,"(\\s*\\.\\s*",m,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[i,{className:"section",begin:/\[+/,end:/\]+/},{begin:x,className:"attr",starts:{end:/$/,contains:[i,d,o,l,c,r]}}]}}var Hs="[0-9](_*[0-9])*",hu=`\\.(${Hs})`,pu="[0-9a-fA-F](_*[0-9a-fA-F])*",Vv={className:"number",variants:[{begin:`(\\b(${Hs})((${hu})|\\.)?|(${hu}))[eE][+-]?(${Hs})[fFdD]?\\b`},{begin:`\\b(${Hs})((${hu})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${hu})[fFdD]?\\b`},{begin:`\\b(${Hs})[fFdD]\\b`},{begin:`\\b0[xX]((${pu})\\.?|(${pu})?\\.(${pu}))[pP][+-]?(${Hs})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${pu})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function l_(e,t,r){return r===-1?"":e.replace(t,i=>l_(e,t,r-1))}function hB(e){const t=e.regex,r="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=r+l_("(?:<"+r+"~~~(?:\\s*,\\s*"+r+"~~~)*>)?",/~~~/g,2),f={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"]},h={className:"meta",begin:"@"+r,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},g={className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:f,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,r),/\s+/,r,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,r],className:{1:"keyword",3:"title.class"},contains:[g,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:f,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[h,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,Vv,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Vv,h]}}const Yv="[A-Za-z$_][0-9A-Za-z$_]*",pB=["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"],mB=["true","false","null","undefined","NaN","Infinity"],o_=["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"],c_=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],u_=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],gB=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],bB=[].concat(u_,o_,c_);function yB(e){const t=e.regex,r=(W,{after:K})=>{const L="</"+W[0].slice(1);return W.input.indexOf(L,K)!==-1},i=Yv,l={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(W,K)=>{const L=W[0].length+W.index,I=W.input[L];if(I==="<"||I===","){K.ignoreMatch();return}I===">"&&(r(W,{after:L})||K.ignoreMatch());let X;const D=W.input.substring(L);if(X=D.match(/^\s*=/)){K.ignoreMatch();return}if((X=D.match(/^\s+extends\s+/))&&X.index===0){K.ignoreMatch();return}}},d={$pattern:Yv,keyword:pB,literal:mB,built_in:bB,"variable.language":gB},f="[0-9](_?[0-9])*",h=`\\.(${f})`,g="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",m={className:"number",variants:[{begin:`(\\b(${g})((${h})|\\.)?|(${h}))[eE][+-]?(${f})\\b`},{begin:`\\b(${g})\\b((${h})\\b|\\.)?|(${h})\\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},x={className:"subst",begin:"\\$\\{",end:"\\}",keywords:d,contains:[]},v={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,x],subLanguage:"xml"}},E={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,x],subLanguage:"css"}},S={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,x],subLanguage:"graphql"}},_={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,x]},A={className:"comment",variants:[e.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}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},T=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,E,S,_,{match:/\$\d+/},m];x.contains=T.concat({begin:/\{/,end:/\}/,keywords:d,contains:["self"].concat(T)});const M=[].concat(A,x.contains),P=M.concat([{begin:/(\s*)\(/,end:/\)/,keywords:d,contains:["self"].concat(M)}]),N={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:P},z={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},G={relevance:0,match:t.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:{_:[...o_,...c_]}},Q={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},R={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},q={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Z(W){return t.concat("(?!",W.join("|"),")")}const ne={match:t.concat(/\b/,Z([...u_,"super","import"].map(W=>`${W}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},Y={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},H={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},j="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",F={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:d,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:G},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),Q,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,E,S,_,A,{match:/\$\d+/},m,G,{scope:"attr",match:i+t.lookahead(":"),relevance:0},F,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[A,e.REGEXP_MODE,{className:"function",begin:j,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:o},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},R,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[N,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},Y,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[N]},ne,q,z,H,{match:/\$[(.]/}]}}function xB(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],l={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[t,r,e.QUOTE_STRING_MODE,l,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Ks="[0-9](_*[0-9])*",mu=`\\.(${Ks})`,gu="[0-9a-fA-F](_*[0-9a-fA-F])*",vB={className:"number",variants:[{begin:`(\\b(${Ks})((${mu})|\\.)?|(${mu}))[eE][+-]?(${Ks})[fFdD]?\\b`},{begin:`\\b(${Ks})((${mu})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${mu})[fFdD]?\\b`},{begin:`\\b(${Ks})[fFdD]\\b`},{begin:`\\b0[xX]((${gu})\\.?|(${gu})?\\.(${gu}))[pP][+-]?(${Ks})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${gu})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function wB(e){const t={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"},r={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},i={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},l={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},o={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},c={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[o,l]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,o,l]}]};l.contains.push(c);const d={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},f={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(c,{className:"string"}),"self"]}]},h=vB,g=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),m={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},x=m;return x.variants[1].contains=[m],m.variants[1].contains=[x],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,g,r,i,d,f,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[m,e.C_LINE_COMMENT_MODE,g],relevance:0},e.C_LINE_COMMENT_MODE,g,d,f,c,e.C_NUMBER_MODE]},g]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},d,f]},c,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
470
- `},h]}}const EB=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.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:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.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_-]*/}}),SB=["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"],_B=["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"],kB=[...SB,..._B],CB=["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(),d_=["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(),f_=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),NB=["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(),TB=d_.concat(f_).sort().reverse();function AB(e){const t=EB(e),r=TB,i="and or not only",l="[\\w-]+",o="("+l+"|@\\{"+l+"\\})",c=[],d=[],f=function(T){return{className:"string",begin:"~?"+T+".*?"+T}},h=function(T,M,P){return{className:T,begin:M,relevance:P}},g={$pattern:/[a-z-]+/,keyword:i,attribute:CB.join(" ")},m={begin:"\\(",end:"\\)",contains:d,keywords:g,relevance:0};d.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,f("'"),f('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,m,h("variable","@@?"+l,10),h("variable","@\\{"+l+"\\}"),h("built_in","~?`[^`]*?`"),{className:"attribute",begin:l+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const x=d.concat({begin:/\{/,end:/\}/,contains:c}),v={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(d)},E={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+NB.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:d}}]},S={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:g,returnEnd:!0,contains:d,relevance:0}},_={className:"variable",variants:[{begin:"@"+l+"\\s*:",relevance:15},{begin:"@"+l}],starts:{end:"[;}]",returnEnd:!0,contains:x}},C={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,v,h("keyword","all\\b"),h("variable","@\\{"+l+"\\}"),{begin:"\\b("+kB.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,h("selector-tag",o,0),h("selector-id","#"+o),h("selector-class","\\."+o,0),h("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+d_.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+f_.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:x},{begin:"!important"},t.FUNCTION_DISPATCH]},A={begin:l+`:(:)?(${r.join("|")})`,returnBegin:!0,contains:[C]};return c.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,S,_,A,E,C,v,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:c}}function RB(e){const t="\\[=*\\[",r="\\]=*\\]",i={begin:t,end:r,contains:["self"]},l=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,r,{contains:[i],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.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:l.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:l}].concat(l)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:r,contains:[i],relevance:5}])}}function OB(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},r={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},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:[t,r]},l={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},o={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},c={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};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:[e.HASH_COMMENT_MODE,t,r,i,l,o,c]}}function MB(e){const t=e.regex,r={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},l={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}]},o={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},c={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},d=/[A-Za-z][A-Za-z0-9+.-]*/,f={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,d,/:\/\/.*?\)/),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}]},h={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},g={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},m=e.inherit(h,{contains:[]}),x=e.inherit(g,{contains:[]});h.contains.push(x),g.contains.push(m);let v=[r,f];return[h,g,m,x].forEach(C=>{C.contains=C.contains.concat(v)}),v=v.concat(h,g),{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}]}]},r,o,h,g,{className:"quote",begin:"^>\\s+",contains:v,end:"$"},l,i,f,c,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function DB(e){const t={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+"},r=/[a-zA-Z@][a-zA-Z0-9_]*/,d={"variable.language":["this","super"],$pattern:r,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"]},f={$pattern:r,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:d,illegal:"</",contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.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},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+f.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:f,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function jB(e){const t=e.regex,r=["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}/,l={$pattern:/[\w.]+/,keyword:r.join(" ")},o={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:l},c={begin:/->\{/,end:/\}/},d={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},f={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[d]},h={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},g=[e.BACKSLASH_ESCAPE,o,f],m=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],x=(S,_,C="\\1")=>{const A=C==="\\1"?C:t.concat(C,_);return t.concat(t.concat("(?:",S,")"),_,/(?:\\.|[^\\\/])*?/,A,/(?:\\.|[^\\\/])*?/,C,i)},v=(S,_,C)=>t.concat(t.concat("(?:",S,")"),_,/(?:\\.|[^\\\/])*?/,C,i),E=[f,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),c,{className:"string",contains:g,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:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},h,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:x("s|tr|y",t.either(...m,{capture:!0}))},{begin:x("s|tr|y","\\(","\\)")},{begin:x("s|tr|y","\\[","\\]")},{begin:x("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:v("(?:m|qr)?",/\//,/\//)},{begin:v("m|qr",t.either(...m,{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:[e.TITLE_MODE,d]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,d,h]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return o.contains=E,c.contains=E,{name:"Perl",aliases:["pl","pm"],keywords:l,contains:E}}function LB(e){const t=e.regex,r=/(?![A-Za-z0-9])(?![$])/,i=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,r),l=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,r),o=t.concat(/[A-Z]+/,r),c={scope:"variable",match:"\\$+"+i},d={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},f={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},h=e.inherit(e.APOS_STRING_MODE,{illegal:null}),g=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(f)}),m={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(f),"on:begin":(Y,H)=>{H.data._beginMatch=Y[1]||Y[2]},"on:end":(Y,H)=>{H.data._beginMatch!==Y[1]&&H.ignoreMatch()}},x=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),v=`[
471
- ]`,E={scope:"string",variants:[g,h,m,x]},S={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},_=["false","null","true"],C=["__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"],A=["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"],M={keyword:C,literal:(Y=>{const H=[];return Y.forEach(j=>{H.push(j),j.toLowerCase()===j?H.push(j.toUpperCase()):H.push(j.toLowerCase())}),H})(_),built_in:A},P=Y=>Y.map(H=>H.replace(/\|\d+$/,"")),N={variants:[{match:[/new/,t.concat(v,"+"),t.concat("(?!",P(A).join("\\b|"),"\\b)"),l],scope:{1:"keyword",4:"title.class"}}]},z=t.concat(i,"\\b(?!\\()"),G={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),z],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[l,t.concat(/::/,t.lookahead(/(?!class\b)/)),z],scope:{1:"title.class",3:"variable.constant"}},{match:[l,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[l,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},Q={scope:"attr",match:t.concat(i,t.lookahead(":"),t.lookahead(/(?!::)/))},R={relevance:0,begin:/\(/,end:/\)/,keywords:M,contains:[Q,c,G,e.C_BLOCK_COMMENT_MODE,E,S,N]},q={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",P(C).join("\\b|"),"|",P(A).join("\\b|"),"\\b)"),i,t.concat(v,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[R]};R.contains.push(q);const Z=[Q,G,e.C_BLOCK_COMMENT_MODE,E,S,N],ne={begin:t.concat(/#\[\s*\\?/,t.either(l,o)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:_,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:_,keyword:["new","array"]},contains:["self",...Z]},...Z,{scope:"meta",variants:[{match:l},{match:o}]}]};return{case_insensitive:!1,keywords:M,contains:[ne,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},d,{scope:"variable.language",match:/\$this\b/},c,q,G,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},N,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:M,contains:["self",ne,c,G,e.C_BLOCK_COMMENT_MODE,E,S]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},E,S]}}function IB(e){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},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function zB(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function PB(e){const t=e.regex,r=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"],d={$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"]},f={className:"meta",begin:/^(>>>|\.\.\.) /},h={className:"subst",begin:/\{/,end:/\}/,keywords:d,illegal:/#/},g={begin:/\{\{/,relevance:0},m={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,f],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,f],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,f,g,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,f,g,h]},{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:[e.BACKSLASH_ESCAPE,g,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,g,h]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},x="[0-9](_?[0-9])*",v=`(\\b(${x}))?\\.(${x})|\\b(${x})\\.`,E=`\\b|${i.join("|")}`,S={className:"number",relevance:0,variants:[{begin:`(\\b(${x})|(${v}))[eE][+-]?(${x})[jJ]?(?=${E})`},{begin:`(${v})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${E})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${E})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${E})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${E})`},{begin:`\\b(${x})[jJ](?=${E})`}]},_={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:d,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},C={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:["self",f,S,m,e.HASH_COMMENT_MODE]}]};return h.contains=[m,S,f],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:d,illegal:/(<\/|\?)|=>/,contains:[f,S,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},m,_,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[C]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[S,C,m]}]}}function BB(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function UB(e){const t=e.regex,r=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,i=t.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]?/),l=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:r,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:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:r},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[l,i]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,i]},{scope:{1:"punctuation",2:"number"},match:[o,i]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,i]}]},{scope:{3:"operator"},match:[r,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:l},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function FB(e){const t=e.regex,r="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),l=t.concat(i,/(::\w+)*/),c={"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"]},d={className:"doctag",begin:"@[A-Za-z]+"},f={begin:"#<",end:">"},h=[e.COMMENT("#","$",{contains:[d]}),e.COMMENT("^=begin","^=end",{contains:[d],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],g={className:"subst",begin:/#\{/,end:/\}/,keywords:c},m={className:"string",contains:[e.BACKSLASH_ESCAPE,g],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:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,g]})]}]},x="[1-9](_?[0-9])*|0",v="[0-9](_?[0-9])*",E={className:"number",relevance:0,variants:[{begin:`\\b(${x})(\\.(${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"}]},S={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:c}]},N=[m,{variants:[{match:[/class\s+/,l,/\s+<\s+/,l]},{match:[/\b(class|module)\s+/,l]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:c},{match:[/(include|extend)\s+/,l],scope:{2:"title.class"},keywords:c},{relevance:0,match:[l,/\.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+/,r],scope:{1:"keyword",3:"title.function"},contains:[S]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[m,{begin:r}],relevance:0},E,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:c},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,g],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(f,h),relevance:0}].concat(f,h);g.contains=N,S.contains=N;const R=[{begin:/^\s*=>/,starts:{end:"$",contains:N}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:c,contains:N}}];return h.unshift(f),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:c,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(R).concat(h).concat(N)}}function $B(e){const t=e.regex,r=/(r#)?/,i=t.concat(r,e.UNDERSCORE_IDENT_RE),l=t.concat(r,e.IDENT_RE),o={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,l,t.lookahead(/\s*\(/))},c="([ui](8|16|32|64|128|size)|f(32|64))?",d=["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"],f=["true","false","Some","None","Ok","Err"],h=["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!"],g=["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:e.IDENT_RE+"!?",type:g,keyword:d,literal:f,built_in:h},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.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_]+)"+c},{begin:"\\b0o([0-7_]+)"+c},{begin:"\\b0x([A-Fa-f0-9_]+)"+c},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+c}],relevance:0},{begin:[/fn/,/\s+/,i],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.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:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:h,type:g}},{className:"punctuation",begin:"->"},o]}}const HB=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.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:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.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_-]*/}}),KB=["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"],qB=["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"],GB=[...KB,...qB],VB=["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(),YB=["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(),XB=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),WB=["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 QB(e){const t=HB(e),r=XB,i=YB,l="@[a-z-]+",o="and or not only",d={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+GB.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+i.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+r.join("|")+")"},d,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+WB.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:[t.BLOCK_COMMENT,d,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:l,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:VB.join(" ")},contains:[{begin:l,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},d,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function ZB(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function JB(e){const t=e.regex,r=e.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},l={begin:/"/,end:/"/,contains:[{match:/""/}]},o=["true","false","unknown"],c=["double precision","large object","with timezone","without timezone"],d=["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"],f=["add","asc","collation","desc","final","first","last","view"],h=["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"],g=["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"],m=["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"],x=["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=g,E=[...h,...f].filter(P=>!g.includes(P)),S={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},_={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},C={match:t.concat(/\b/,t.either(...v),/\s*\(/),relevance:0,keywords:{built_in:v}};function A(P){return t.concat(/\b/,t.either(...P.map(N=>N.replace(/\s+/,"\\s+"))),/\b/)}const T={scope:"keyword",match:A(x),relevance:0};function M(P,{exceptions:N,when:z}={}){const G=z;return N=N||[],P.map(Q=>Q.match(/\|\d+$/)||N.includes(Q)?Q:G(Q)?`${Q}|0`:Q)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:M(E,{when:P=>P.length<3}),literal:o,type:d,built_in:m},contains:[{scope:"type",match:A(c)},T,C,S,i,l,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,r,_]}}function h_(e){return e?typeof e=="string"?e:e.source:null}function co(e){return It("(?=",e,")")}function It(...e){return e.map(r=>h_(r)).join("")}function eU(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function In(...e){return"("+(eU(e).capture?"":"?:")+e.map(i=>h_(i)).join("|")+")"}const pg=e=>It(/\b/,e,/\w$/.test(e)?/\b/:/\B/),tU=["Protocol","Type"].map(pg),Xv=["init","self"].map(pg),nU=["Any","Self"],fp=["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"],Wv=["false","nil","true"],rU=["assignment","associativity","higherThan","left","lowerThan","none","right"],aU=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Qv=["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"],p_=In(/[/=\-+!*%<>&|^~?]/,/[\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]/),m_=In(p_,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),hp=It(p_,m_,"*"),g_=In(/[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]/),$u=In(g_,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Yr=It(g_,$u,"*"),bu=It(/[A-Z]/,$u,"*"),iU=["attached","autoclosure",It(/convention\(/,In("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",It(/objc\(/,Yr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],sU=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function lU(e){const t={match:/\s+/,relevance:0},r=e.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[e.C_LINE_COMMENT_MODE,r],l={match:[/\./,In(...tU,...Xv)],className:{2:"keyword"}},o={match:It(/\./,In(...fp)),relevance:0},c=fp.filter(Ie=>typeof Ie=="string").concat(["_|0"]),d=fp.filter(Ie=>typeof Ie!="string").concat(nU).map(pg),f={variants:[{className:"keyword",match:In(...d,...Xv)}]},h={$pattern:In(/\b\w+/,/#\w+/),keyword:c.concat(aU),literal:Wv},g=[l,o,f],m={match:It(/\./,In(...Qv)),relevance:0},x={className:"built_in",match:It(/\b/,In(...Qv),/(?=\()/)},v=[m,x],E={match:/->/,relevance:0},S={className:"operator",relevance:0,variants:[{match:hp},{match:`\\.(\\.|${m_})+`}]},_=[E,S],C="([0-9]_*)+",A="([0-9a-fA-F]_*)+",T={className:"number",relevance:0,variants:[{match:`\\b(${C})(\\.(${C}))?([eE][+-]?(${C}))?\\b`},{match:`\\b0x(${A})(\\.(${A}))?([pP][+-]?(${C}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},M=(Ie="")=>({className:"subst",variants:[{match:It(/\\/,Ie,/[0\\tnr"']/)},{match:It(/\\/,Ie,/u\{[0-9a-fA-F]{1,8}\}/)}]}),P=(Ie="")=>({className:"subst",match:It(/\\/,Ie,/[\t ]*(?:[\r\n]|\r\n)/)}),N=(Ie="")=>({className:"subst",label:"interpol",begin:It(/\\/,Ie,/\(/),end:/\)/}),z=(Ie="")=>({begin:It(Ie,/"""/),end:It(/"""/,Ie),contains:[M(Ie),P(Ie),N(Ie)]}),G=(Ie="")=>({begin:It(Ie,/"/),end:It(/"/,Ie),contains:[M(Ie),N(Ie)]}),Q={className:"string",variants:[z(),z("#"),z("##"),z("###"),G(),G("#"),G("##"),G("###")]},R=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],q={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:R},Z=Ie=>{const Xe=It(Ie,/\//),te=It(/\//,Ie);return{begin:Xe,end:te,contains:[...R,{scope:"comment",begin:`#(?!.*${te})`,end:/$/}]}},ne={scope:"regexp",variants:[Z("###"),Z("##"),Z("#"),q]},Y={match:It(/`/,Yr,/`/)},H={className:"variable",match:/\$\d+/},j={className:"variable",match:`\\$${$u}+`},F=[Y,H,j],W={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:sU,contains:[..._,T,Q]}]}},K={scope:"keyword",match:It(/@/,In(...iU),co(In(/\(/,/\s+/)))},L={scope:"meta",match:It(/@/,Yr)},I=[W,K,L],X={match:co(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:It(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,$u,"+")},{className:"type",match:bu,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:It(/\s+&\s+/,co(bu)),relevance:0}]},D={begin:/</,end:/>/,keywords:h,contains:[...i,...g,...I,E,X]};X.contains.push(D);const J={match:It(Yr,/\s*:/),keywords:"_|0",relevance:0},be={begin:/\(/,end:/\)/,relevance:0,keywords:h,contains:["self",J,...i,ne,...g,...v,..._,T,Q,...F,...I,X]},pe={begin:/</,end:/>/,keywords:"repeat each",contains:[...i,X]},ue={begin:In(co(It(Yr,/\s*:/)),co(It(Yr,/\s+/,Yr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Yr}]},ve={begin:/\(/,end:/\)/,keywords:h,contains:[ue,...i,...g,..._,T,Q,...I,X,be],endsParent:!0,illegal:/["']/},ge={match:[/(func|macro)/,/\s+/,In(Y.match,Yr,hp)],className:{1:"keyword",3:"title.function"},contains:[pe,ve,t],illegal:[/\[/,/%/]},we={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[pe,ve,t],illegal:/\[|%/},ye={match:[/operator/,/\s+/,hp],className:{1:"keyword",3:"title"}},Oe={begin:[/precedencegroup/,/\s+/,bu],className:{1:"keyword",3:"title"},contains:[X],keywords:[...rU,...Wv],end:/}/},Me={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Te={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},vt={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Yr,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:h,contains:[pe,...g,{begin:/:/,end:/\{/,keywords:h,contains:[{scope:"title.class.inherited",match:bu},...g],relevance:0}]};for(const Ie of Q.variants){const Xe=Ie.contains.find(ce=>ce.label==="interpol");Xe.keywords=h;const te=[...g,...v,..._,T,Q,...F];Xe.contains=[...te,{begin:/\(/,end:/\)/,contains:["self",...te]}]}return{name:"Swift",keywords:h,contains:[...i,ge,we,Me,Te,vt,ye,Oe,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},ne,...g,...v,..._,T,Q,...F,...I,X,be]}}const Hu="[A-Za-z$_][0-9A-Za-z$_]*",b_=["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"],y_=["true","false","null","undefined","NaN","Infinity"],x_=["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"],v_=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],w_=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],E_=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],S_=[].concat(w_,x_,v_);function oU(e){const t=e.regex,r=(W,{after:K})=>{const L="</"+W[0].slice(1);return W.input.indexOf(L,K)!==-1},i=Hu,l={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(W,K)=>{const L=W[0].length+W.index,I=W.input[L];if(I==="<"||I===","){K.ignoreMatch();return}I===">"&&(r(W,{after:L})||K.ignoreMatch());let X;const D=W.input.substring(L);if(X=D.match(/^\s*=/)){K.ignoreMatch();return}if((X=D.match(/^\s+extends\s+/))&&X.index===0){K.ignoreMatch();return}}},d={$pattern:Hu,keyword:b_,literal:y_,built_in:S_,"variable.language":E_},f="[0-9](_?[0-9])*",h=`\\.(${f})`,g="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",m={className:"number",variants:[{begin:`(\\b(${g})((${h})|\\.)?|(${h}))[eE][+-]?(${f})\\b`},{begin:`\\b(${g})\\b((${h})\\b|\\.)?|(${h})\\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},x={className:"subst",begin:"\\$\\{",end:"\\}",keywords:d,contains:[]},v={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,x],subLanguage:"xml"}},E={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,x],subLanguage:"css"}},S={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,x],subLanguage:"graphql"}},_={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,x]},A={className:"comment",variants:[e.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}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},T=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,E,S,_,{match:/\$\d+/},m];x.contains=T.concat({begin:/\{/,end:/\}/,keywords:d,contains:["self"].concat(T)});const M=[].concat(A,x.contains),P=M.concat([{begin:/(\s*)\(/,end:/\)/,keywords:d,contains:["self"].concat(M)}]),N={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:P},z={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},G={relevance:0,match:t.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:{_:[...x_,...v_]}},Q={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},R={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},q={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Z(W){return t.concat("(?!",W.join("|"),")")}const ne={match:t.concat(/\b/,Z([...w_,"super","import"].map(W=>`${W}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},Y={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},H={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},j="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",F={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:d,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:G},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),Q,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,E,S,_,A,{match:/\$\d+/},m,G,{scope:"attr",match:i+t.lookahead(":"),relevance:0},F,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[A,e.REGEXP_MODE,{className:"function",begin:j,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:o},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},R,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[N,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},Y,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[N]},ne,q,z,H,{match:/\$[(.]/}]}}function cU(e){const t=e.regex,r=oU(e),i=Hu,l=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],o={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},c={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:l},contains:[r.exports.CLASS_REFERENCE]},d={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},f=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],h={$pattern:Hu,keyword:b_.concat(f),literal:y_,built_in:S_.concat(l),"variable.language":E_},g={className:"meta",begin:"@"+i},m=(S,_,C)=>{const A=S.contains.findIndex(T=>T.label===_);if(A===-1)throw new Error("can not find mode to replace");S.contains.splice(A,1,C)};Object.assign(r.keywords,h),r.exports.PARAMS_CONTAINS.push(g);const x=r.contains.find(S=>S.scope==="attr"),v=Object.assign({},x,{match:t.concat(i,t.lookahead(/\s*\?:/))});r.exports.PARAMS_CONTAINS.push([r.exports.CLASS_REFERENCE,x,v]),r.contains=r.contains.concat([g,o,c,v]),m(r,"shebang",e.SHEBANG()),m(r,"use_strict",d);const E=r.contains.find(S=>S.label==="func.def");return E.relevance=0,Object.assign(r,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),r}function uU(e){const t=e.regex,r={className:"string",begin:/"(""|[^/n])"C\b/},i={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},l=/\d{1,2}\/\d{1,2}\/\d{4}/,o=/\d{4}-\d{1,2}-\d{1,2}/,c=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,d=/\d{1,2}(:\d{1,2}){1,2}/,f={className:"literal",variants:[{begin:t.concat(/# */,t.either(o,l),/ *#/)},{begin:t.concat(/# */,d,/ *#/)},{begin:t.concat(/# */,c,/ *#/)},{begin:t.concat(/# */,t.either(o,l),/ +/,t.either(c,d),/ *#/)}]},h={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])|[%&])?/}]},g={className:"label",begin:/^\w+:/},m=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),x=e.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:[r,i,f,h,g,m,x,{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:[x]}]}}function dU(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const r=e.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"],l={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},o={className:"variable",begin:/\$[\w_]+/},c={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},d={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/},f={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},h={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:[r,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},o,c,l,e.QUOTE_STRING_MODE,f,h,d]}}function fU(e){const t=e.regex,r=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,l={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},c=e.inherit(o,{begin:/\(/,end:/\)/}),d=e.inherit(e.APOS_STRING_MODE,{className:"string"}),f=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),h={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:[l]},{begin:/'/,end:/'/,contains:[l]},{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:[o,f,d,c,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[o,c,f,d]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},l,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[f]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[h],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[h],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(r,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:r,relevance:0,starts:h}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(r,/>/))),contains:[{className:"name",begin:r,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function hU(e){const t="true false yes no null",r="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},l={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},c={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,l]},d=e.inherit(c,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),x={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:t,relevance:0},E={begin:/\{/,end:/\}/,contains:[v],illegal:"\\n",relevance:0},S={begin:"\\[",end:"\\]",contains:[v],illegal:"\\n",relevance:0},_=[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+!"+r},{className:"type",begin:"!<"+r+">"},{className:"type",begin:"!"+r},{className:"type",begin:"!!"+r},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},x,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},E,S,o,c],C=[..._];return C.pop(),C.push(d),v.contains=C,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:_}}const pU={arduino:XP,bash:WP,c:QP,cpp:ZP,csharp:JP,css:oB,diff:cB,go:uB,graphql:dB,ini:fB,java:hB,javascript:yB,json:xB,kotlin:wB,less:AB,lua:RB,makefile:OB,markdown:MB,objectivec:DB,perl:jB,php:LB,"php-template":IB,plaintext:zB,python:PB,"python-repl":BB,r:UB,ruby:FB,rust:$B,scss:QB,shell:ZB,sql:JB,swift:lU,typescript:cU,vbnet:uU,wasm:dU,xml:fU,yaml:hU};var pp,Zv;function mU(){if(Zv)return pp;Zv=1;function e($){return $ instanceof Map?$.clear=$.delete=$.set=function(){throw new Error("map is read-only")}:$ instanceof Set&&($.add=$.clear=$.delete=function(){throw new Error("set is read-only")}),Object.freeze($),Object.getOwnPropertyNames($).forEach(fe=>{const Ce=$[fe],We=typeof Ce;(We==="object"||We==="function")&&!Object.isFrozen(Ce)&&e(Ce)}),$}class t{constructor(fe){fe.data===void 0&&(fe.data={}),this.data=fe.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function i($,...fe){const Ce=Object.create(null);for(const We in $)Ce[We]=$[We];return fe.forEach(function(We){for(const Mt in We)Ce[Mt]=We[Mt]}),Ce}const l="</span>",o=$=>!!$.scope,c=($,{prefix:fe})=>{if($.startsWith("language:"))return $.replace("language:","language-");if($.includes(".")){const Ce=$.split(".");return[`${fe}${Ce.shift()}`,...Ce.map((We,Mt)=>`${We}${"_".repeat(Mt+1)}`)].join(" ")}return`${fe}${$}`};class d{constructor(fe,Ce){this.buffer="",this.classPrefix=Ce.classPrefix,fe.walk(this)}addText(fe){this.buffer+=r(fe)}openNode(fe){if(!o(fe))return;const Ce=c(fe.scope,{prefix:this.classPrefix});this.span(Ce)}closeNode(fe){o(fe)&&(this.buffer+=l)}value(){return this.buffer}span(fe){this.buffer+=`<span class="${fe}">`}}const f=($={})=>{const fe={children:[]};return Object.assign(fe,$),fe};class h{constructor(){this.rootNode=f(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(fe){this.top.children.push(fe)}openNode(fe){const Ce=f({scope:fe});this.add(Ce),this.stack.push(Ce)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(fe){return this.constructor._walk(fe,this.rootNode)}static _walk(fe,Ce){return typeof Ce=="string"?fe.addText(Ce):Ce.children&&(fe.openNode(Ce),Ce.children.forEach(We=>this._walk(fe,We)),fe.closeNode(Ce)),fe}static _collapse(fe){typeof fe!="string"&&fe.children&&(fe.children.every(Ce=>typeof Ce=="string")?fe.children=[fe.children.join("")]:fe.children.forEach(Ce=>{h._collapse(Ce)}))}}class g extends h{constructor(fe){super(),this.options=fe}addText(fe){fe!==""&&this.add(fe)}startScope(fe){this.openNode(fe)}endScope(){this.closeNode()}__addSublanguage(fe,Ce){const We=fe.root;Ce&&(We.scope=`language:${Ce}`),this.add(We)}toHTML(){return new d(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function m($){return $?typeof $=="string"?$:$.source:null}function x($){return S("(?=",$,")")}function v($){return S("(?:",$,")*")}function E($){return S("(?:",$,")?")}function S(...$){return $.map(Ce=>m(Ce)).join("")}function _($){const fe=$[$.length-1];return typeof fe=="object"&&fe.constructor===Object?($.splice($.length-1,1),fe):{}}function C(...$){return"("+(_($).capture?"":"?:")+$.map(We=>m(We)).join("|")+")"}function A($){return new RegExp($.toString()+"|").exec("").length-1}function T($,fe){const Ce=$&&$.exec(fe);return Ce&&Ce.index===0}const M=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function P($,{joinWith:fe}){let Ce=0;return $.map(We=>{Ce+=1;const Mt=Ce;let Nt=m(We),ze="";for(;Nt.length>0;){const Re=M.exec(Nt);if(!Re){ze+=Nt;break}ze+=Nt.substring(0,Re.index),Nt=Nt.substring(Re.index+Re[0].length),Re[0][0]==="\\"&&Re[1]?ze+="\\"+String(Number(Re[1])+Mt):(ze+=Re[0],Re[0]==="("&&Ce++)}return ze}).map(We=>`(${We})`).join(fe)}const N=/\b\B/,z="[a-zA-Z]\\w*",G="[a-zA-Z_]\\w*",Q="\\b\\d+(\\.\\d+)?",R="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",q="\\b(0b[01]+)",Z="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",ne=($={})=>{const fe=/^#![ ]*\//;return $.binary&&($.begin=S(fe,/.*\b/,$.binary,/\b.*/)),i({scope:"meta",begin:fe,end:/$/,relevance:0,"on:begin":(Ce,We)=>{Ce.index!==0&&We.ignoreMatch()}},$)},Y={begin:"\\\\[\\s\\S]",relevance:0},H={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Y]},j={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Y]},F={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/},W=function($,fe,Ce={}){const We=i({scope:"comment",begin:$,end:fe,contains:[]},Ce);We.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 Mt=C("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 We.contains.push({begin:S(/[ ]+/,"(",Mt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),We},K=W("//","$"),L=W("/\\*","\\*/"),I=W("#","$"),X={scope:"number",begin:Q,relevance:0},D={scope:"number",begin:R,relevance:0},J={scope:"number",begin:q,relevance:0},be={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Y,{begin:/\[/,end:/\]/,relevance:0,contains:[Y]}]},pe={scope:"title",begin:z,relevance:0},ue={scope:"title",begin:G,relevance:0},ve={begin:"\\.\\s*"+G,relevance:0};var we=Object.freeze({__proto__:null,APOS_STRING_MODE:H,BACKSLASH_ESCAPE:Y,BINARY_NUMBER_MODE:J,BINARY_NUMBER_RE:q,COMMENT:W,C_BLOCK_COMMENT_MODE:L,C_LINE_COMMENT_MODE:K,C_NUMBER_MODE:D,C_NUMBER_RE:R,END_SAME_AS_BEGIN:function($){return Object.assign($,{"on:begin":(fe,Ce)=>{Ce.data._beginMatch=fe[1]},"on:end":(fe,Ce)=>{Ce.data._beginMatch!==fe[1]&&Ce.ignoreMatch()}})},HASH_COMMENT_MODE:I,IDENT_RE:z,MATCH_NOTHING_RE:N,METHOD_GUARD:ve,NUMBER_MODE:X,NUMBER_RE:Q,PHRASAL_WORDS_MODE:F,QUOTE_STRING_MODE:j,REGEXP_MODE:be,RE_STARTERS_RE:Z,SHEBANG:ne,TITLE_MODE:pe,UNDERSCORE_IDENT_RE:G,UNDERSCORE_TITLE_MODE:ue});function ye($,fe){$.input[$.index-1]==="."&&fe.ignoreMatch()}function Oe($,fe){$.className!==void 0&&($.scope=$.className,delete $.className)}function Me($,fe){fe&&$.beginKeywords&&($.begin="\\b("+$.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",$.__beforeBegin=ye,$.keywords=$.keywords||$.beginKeywords,delete $.beginKeywords,$.relevance===void 0&&($.relevance=0))}function Te($,fe){Array.isArray($.illegal)&&($.illegal=C(...$.illegal))}function vt($,fe){if($.match){if($.begin||$.end)throw new Error("begin & end are not supported with match");$.begin=$.match,delete $.match}}function Ie($,fe){$.relevance===void 0&&($.relevance=1)}const Xe=($,fe)=>{if(!$.beforeMatch)return;if($.starts)throw new Error("beforeMatch cannot be used with starts");const Ce=Object.assign({},$);Object.keys($).forEach(We=>{delete $[We]}),$.keywords=Ce.keywords,$.begin=S(Ce.beforeMatch,x(Ce.begin)),$.starts={relevance:0,contains:[Object.assign(Ce,{endsParent:!0})]},$.relevance=0,delete Ce.beforeMatch},te=["of","and","for","in","not","or","if","then","parent","list","value"],ce="keyword";function Ne($,fe,Ce=ce){const We=Object.create(null);return typeof $=="string"?Mt(Ce,$.split(" ")):Array.isArray($)?Mt(Ce,$):Object.keys($).forEach(function(Nt){Object.assign(We,Ne($[Nt],fe,Nt))}),We;function Mt(Nt,ze){fe&&(ze=ze.map(Re=>Re.toLowerCase())),ze.forEach(function(Re){const Ge=Re.split("|");We[Ge[0]]=[Nt,De(Ge[0],Ge[1])]})}}function De($,fe){return fe?Number(fe):wt($)?0:1}function wt($){return te.includes($.toLowerCase())}const Xt={},ot=$=>{console.error($)},Zt=($,...fe)=>{console.log(`WARN: ${$}`,...fe)},B=($,fe)=>{Xt[`${$}/${fe}`]||(console.log(`Deprecated as of ${$}. ${fe}`),Xt[`${$}/${fe}`]=!0)},le=new Error;function _e($,fe,{key:Ce}){let We=0;const Mt=$[Ce],Nt={},ze={};for(let Re=1;Re<=fe.length;Re++)ze[Re+We]=Mt[Re],Nt[Re+We]=!0,We+=A(fe[Re-1]);$[Ce]=ze,$[Ce]._emit=Nt,$[Ce]._multi=!0}function re($){if(Array.isArray($.begin)){if($.skip||$.excludeBegin||$.returnBegin)throw ot("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),le;if(typeof $.beginScope!="object"||$.beginScope===null)throw ot("beginScope must be object"),le;_e($,$.begin,{key:"beginScope"}),$.begin=P($.begin,{joinWith:""})}}function xe($){if(Array.isArray($.end)){if($.skip||$.excludeEnd||$.returnEnd)throw ot("skip, excludeEnd, returnEnd not compatible with endScope: {}"),le;if(typeof $.endScope!="object"||$.endScope===null)throw ot("endScope must be object"),le;_e($,$.end,{key:"endScope"}),$.end=P($.end,{joinWith:""})}}function je($){$.scope&&typeof $.scope=="object"&&$.scope!==null&&($.beginScope=$.scope,delete $.scope)}function Fe($){je($),typeof $.beginScope=="string"&&($.beginScope={_wrap:$.beginScope}),typeof $.endScope=="string"&&($.endScope={_wrap:$.endScope}),re($),xe($)}function tt($){function fe(ze,Re){return new RegExp(m(ze),"m"+($.case_insensitive?"i":"")+($.unicodeRegex?"u":"")+(Re?"g":""))}class Ce{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Re,Ge){Ge.position=this.position++,this.matchIndexes[this.matchAt]=Ge,this.regexes.push([Ge,Re]),this.matchAt+=A(Re)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Re=this.regexes.map(Ge=>Ge[1]);this.matcherRe=fe(P(Re,{joinWith:"|"}),!0),this.lastIndex=0}exec(Re){this.matcherRe.lastIndex=this.lastIndex;const Ge=this.matcherRe.exec(Re);if(!Ge)return null;const Jt=Ge.findIndex((Rr,Ma)=>Ma>0&&Rr!==void 0),Ut=this.matchIndexes[Jt];return Ge.splice(0,Jt),Object.assign(Ge,Ut)}}class We{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Re){if(this.multiRegexes[Re])return this.multiRegexes[Re];const Ge=new Ce;return this.rules.slice(Re).forEach(([Jt,Ut])=>Ge.addRule(Jt,Ut)),Ge.compile(),this.multiRegexes[Re]=Ge,Ge}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Re,Ge){this.rules.push([Re,Ge]),Ge.type==="begin"&&this.count++}exec(Re){const Ge=this.getMatcher(this.regexIndex);Ge.lastIndex=this.lastIndex;let Jt=Ge.exec(Re);if(this.resumingScanAtSamePosition()&&!(Jt&&Jt.index===this.lastIndex)){const Ut=this.getMatcher(0);Ut.lastIndex=this.lastIndex+1,Jt=Ut.exec(Re)}return Jt&&(this.regexIndex+=Jt.position+1,this.regexIndex===this.count&&this.considerAll()),Jt}}function Mt(ze){const Re=new We;return ze.contains.forEach(Ge=>Re.addRule(Ge.begin,{rule:Ge,type:"begin"})),ze.terminatorEnd&&Re.addRule(ze.terminatorEnd,{type:"end"}),ze.illegal&&Re.addRule(ze.illegal,{type:"illegal"}),Re}function Nt(ze,Re){const Ge=ze;if(ze.isCompiled)return Ge;[Oe,vt,Fe,Xe].forEach(Ut=>Ut(ze,Re)),$.compilerExtensions.forEach(Ut=>Ut(ze,Re)),ze.__beforeBegin=null,[Me,Te,Ie].forEach(Ut=>Ut(ze,Re)),ze.isCompiled=!0;let Jt=null;return typeof ze.keywords=="object"&&ze.keywords.$pattern&&(ze.keywords=Object.assign({},ze.keywords),Jt=ze.keywords.$pattern,delete ze.keywords.$pattern),Jt=Jt||/\w+/,ze.keywords&&(ze.keywords=Ne(ze.keywords,$.case_insensitive)),Ge.keywordPatternRe=fe(Jt,!0),Re&&(ze.begin||(ze.begin=/\B|\b/),Ge.beginRe=fe(Ge.begin),!ze.end&&!ze.endsWithParent&&(ze.end=/\B|\b/),ze.end&&(Ge.endRe=fe(Ge.end)),Ge.terminatorEnd=m(Ge.end)||"",ze.endsWithParent&&Re.terminatorEnd&&(Ge.terminatorEnd+=(ze.end?"|":"")+Re.terminatorEnd)),ze.illegal&&(Ge.illegalRe=fe(ze.illegal)),ze.contains||(ze.contains=[]),ze.contains=[].concat(...ze.contains.map(function(Ut){return zt(Ut==="self"?ze:Ut)})),ze.contains.forEach(function(Ut){Nt(Ut,Ge)}),ze.starts&&Nt(ze.starts,Re),Ge.matcher=Mt(Ge),Ge}if($.compilerExtensions||($.compilerExtensions=[]),$.contains&&$.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return $.classNameAliases=i($.classNameAliases||{}),Nt($)}function st($){return $?$.endsWithParent||st($.starts):!1}function zt($){return $.variants&&!$.cachedVariants&&($.cachedVariants=$.variants.map(function(fe){return i($,{variants:null},fe)})),$.cachedVariants?$.cachedVariants:st($)?i($,{starts:$.starts?i($.starts):null}):Object.isFrozen($)?i($):$}var Ze="11.11.1";class Dn extends Error{constructor(fe,Ce){super(fe),this.name="HTMLInjectionError",this.html=Ce}}const vn=r,es=i,br=Symbol("nomatch"),Qn=7,Hr=function($){const fe=Object.create(null),Ce=Object.create(null),We=[];let Mt=!0;const Nt="Could not find the language '{}', did you forget to load/include a language module?",ze={disableAutodetect:!0,name:"Plain text",contains:[]};let Re={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:g};function Ge(Ee){return Re.noHighlightRe.test(Ee)}function Jt(Ee){let $e=Ee.className+" ";$e+=Ee.parentNode?Ee.parentNode.className:"";const ct=Re.languageDetectRe.exec($e);if(ct){const Tt=jn(ct[1]);return Tt||(Zt(Nt.replace("{}",ct[1])),Zt("Falling back to no-highlight mode for this block.",Ee)),Tt?ct[1]:"no-highlight"}return $e.split(/\s+/).find(Tt=>Ge(Tt)||jn(Tt))}function Ut(Ee,$e,ct){let Tt="",sn="";typeof $e=="object"?(Tt=Ee,ct=$e.ignoreIllegals,sn=$e.language):(B("10.7.0","highlight(lang, code, ...args) has been deprecated."),B("10.7.0",`Please use highlight(code, options) instead.
472
- https://github.com/highlightjs/highlight.js/issues/2277`),sn=Ee,Tt=$e),ct===void 0&&(ct=!0);const Tn={code:Tt,language:sn};xi("before:highlight",Tn);const Jn=Tn.result?Tn.result:Rr(Tn.language,Tn.code,ct);return Jn.code=Tn.code,xi("after:highlight",Jn),Jn}function Rr(Ee,$e,ct,Tt){const sn=Object.create(null);function Tn(ke,Be){return ke.keywords[Be]}function Jn(){if(!Qe.keywords){dn.addText(At);return}let ke=0;Qe.keywordPatternRe.lastIndex=0;let Be=Qe.keywordPatternRe.exec(At),nt="";for(;Be;){nt+=At.substring(ke,Be.index);const pt=wn.case_insensitive?Be[0].toLowerCase():Be[0],tn=Tn(Qe,pt);if(tn){const[yr,pl]=tn;if(dn.addText(nt),nt="",sn[pt]=(sn[pt]||0)+1,sn[pt]<=Qn&&(Ia+=pl),yr.startsWith("_"))nt+=Be[0];else{const Vo=wn.classNameAliases[yr]||yr;er(Be[0],Vo)}}else nt+=Be[0];ke=Qe.keywordPatternRe.lastIndex,Be=Qe.keywordPatternRe.exec(At)}nt+=At.substring(ke),dn.addText(nt)}function Fn(){if(At==="")return;let ke=null;if(typeof Qe.subLanguage=="string"){if(!fe[Qe.subLanguage]){dn.addText(At);return}ke=Rr(Qe.subLanguage,At,!0,Go[Qe.subLanguage]),Go[Qe.subLanguage]=ke._top}else ke=Zn(At,Qe.subLanguage.length?Qe.subLanguage:null);Qe.relevance>0&&(Ia+=ke.relevance),dn.__addSublanguage(ke._emitter,ke.language)}function Ft(){Qe.subLanguage!=null?Fn():Jn(),At=""}function er(ke,Be){ke!==""&&(dn.startScope(Be),dn.addText(ke),dn.endScope())}function Ko(ke,Be){let nt=1;const pt=Be.length-1;for(;nt<=pt;){if(!ke._emit[nt]){nt++;continue}const tn=wn.classNameAliases[ke[nt]]||ke[nt],yr=Be[nt];tn?er(yr,tn):(At=yr,Jn(),At=""),nt++}}function ns(ke,Be){return ke.scope&&typeof ke.scope=="string"&&dn.openNode(wn.classNameAliases[ke.scope]||ke.scope),ke.beginScope&&(ke.beginScope._wrap?(er(At,wn.classNameAliases[ke.beginScope._wrap]||ke.beginScope._wrap),At=""):ke.beginScope._multi&&(Ko(ke.beginScope,Be),At="")),Qe=Object.create(ke,{parent:{value:Qe}}),Qe}function dl(ke,Be,nt){let pt=T(ke.endRe,nt);if(pt){if(ke["on:end"]){const tn=new t(ke);ke["on:end"](Be,tn),tn.isMatchIgnored&&(pt=!1)}if(pt){for(;ke.endsParent&&ke.parent;)ke=ke.parent;return ke}}if(ke.endsWithParent)return dl(ke.parent,Be,nt)}function rs(ke){return Qe.matcher.regexIndex===0?(At+=ke[0],1):(za=!0,0)}function kd(ke){const Be=ke[0],nt=ke.rule,pt=new t(nt),tn=[nt.__beforeBegin,nt["on:begin"]];for(const yr of tn)if(yr&&(yr(ke,pt),pt.isMatchIgnored))return rs(Be);return nt.skip?At+=Be:(nt.excludeBegin&&(At+=Be),Ft(),!nt.returnBegin&&!nt.excludeBegin&&(At=Be)),ns(nt,ke),nt.returnBegin?0:Be.length}function $n(ke){const Be=ke[0],nt=$e.substring(ke.index),pt=dl(Qe,ke,nt);if(!pt)return br;const tn=Qe;Qe.endScope&&Qe.endScope._wrap?(Ft(),er(Be,Qe.endScope._wrap)):Qe.endScope&&Qe.endScope._multi?(Ft(),Ko(Qe.endScope,ke)):tn.skip?At+=Be:(tn.returnEnd||tn.excludeEnd||(At+=Be),Ft(),tn.excludeEnd&&(At=Be));do Qe.scope&&dn.closeNode(),!Qe.skip&&!Qe.subLanguage&&(Ia+=Qe.relevance),Qe=Qe.parent;while(Qe!==pt.parent);return pt.starts&&ns(pt.starts,ke),tn.returnEnd?0:Be.length}function fl(){const ke=[];for(let Be=Qe;Be!==wn;Be=Be.parent)Be.scope&&ke.unshift(Be.scope);ke.forEach(Be=>dn.openNode(Be))}let vi={};function as(ke,Be){const nt=Be&&Be[0];if(At+=ke,nt==null)return Ft(),0;if(vi.type==="begin"&&Be.type==="end"&&vi.index===Be.index&&nt===""){if(At+=$e.slice(Be.index,Be.index+1),!Mt){const pt=new Error(`0 width match regex (${Ee})`);throw pt.languageName=Ee,pt.badRule=vi.rule,pt}return 1}if(vi=Be,Be.type==="begin")return kd(Be);if(Be.type==="illegal"&&!ct){const pt=new Error('Illegal lexeme "'+nt+'" for mode "'+(Qe.scope||"<unnamed>")+'"');throw pt.mode=Qe,pt}else if(Be.type==="end"){const pt=$n(Be);if(pt!==br)return pt}if(Be.type==="illegal"&&nt==="")return At+=`
473
- `,1;if(hl>1e5&&hl>Be.index*3)throw new Error("potential infinite loop, way more iterations than matches");return At+=nt,nt.length}const wn=jn(Ee);if(!wn)throw ot(Nt.replace("{}",Ee)),new Error('Unknown language: "'+Ee+'"');const qo=tt(wn);let is="",Qe=Tt||qo;const Go={},dn=new Re.__emitter(Re);fl();let At="",Ia=0,la=0,hl=0,za=!1;try{if(wn.__emitTokens)wn.__emitTokens($e,dn);else{for(Qe.matcher.considerAll();;){hl++,za?za=!1:Qe.matcher.considerAll(),Qe.matcher.lastIndex=la;const ke=Qe.matcher.exec($e);if(!ke)break;const Be=$e.substring(la,ke.index),nt=as(Be,ke);la=ke.index+nt}as($e.substring(la))}return dn.finalize(),is=dn.toHTML(),{language:Ee,value:is,relevance:Ia,illegal:!1,_emitter:dn,_top:Qe}}catch(ke){if(ke.message&&ke.message.includes("Illegal"))return{language:Ee,value:vn($e),illegal:!0,relevance:0,_illegalBy:{message:ke.message,index:la,context:$e.slice(la-100,la+100),mode:ke.mode,resultSoFar:is},_emitter:dn};if(Mt)return{language:Ee,value:vn($e),illegal:!1,relevance:0,errorRaised:ke,_emitter:dn,_top:Qe};throw ke}}function Ma(Ee){const $e={value:vn(Ee),illegal:!1,relevance:0,_top:ze,_emitter:new Re.__emitter(Re)};return $e._emitter.addText(Ee),$e}function Zn(Ee,$e){$e=$e||Re.languages||Object.keys(fe);const ct=Ma(Ee),Tt=$e.filter(jn).filter(ja).map(Ft=>Rr(Ft,Ee,!1));Tt.unshift(ct);const sn=Tt.sort((Ft,er)=>{if(Ft.relevance!==er.relevance)return er.relevance-Ft.relevance;if(Ft.language&&er.language){if(jn(Ft.language).supersetOf===er.language)return 1;if(jn(er.language).supersetOf===Ft.language)return-1}return 0}),[Tn,Jn]=sn,Fn=Tn;return Fn.secondBest=Jn,Fn}function Un(Ee,$e,ct){const Tt=$e&&Ce[$e]||ct;Ee.classList.add("hljs"),Ee.classList.add(`language-${Tt}`)}function qt(Ee){let $e=null;const ct=Jt(Ee);if(Ge(ct))return;if(xi("before:highlightElement",{el:Ee,language:ct}),Ee.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Ee);return}if(Ee.children.length>0&&(Re.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(Ee)),Re.throwUnescapedHTML))throw new Dn("One of your code blocks includes unescaped HTML.",Ee.innerHTML);$e=Ee;const Tt=$e.textContent,sn=ct?Ut(Tt,{language:ct,ignoreIllegals:!0}):Zn(Tt);Ee.innerHTML=sn.value,Ee.dataset.highlighted="yes",Un(Ee,ct,sn.language),Ee.result={language:sn.language,re:sn.relevance,relevance:sn.relevance},sn.secondBest&&(Ee.secondBest={language:sn.secondBest.language,relevance:sn.secondBest.relevance}),xi("after:highlightElement",{el:Ee,result:sn,text:Tt})}function en(Ee){Re=es(Re,Ee)}const Da=()=>{ts(),B("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function cl(){ts(),B("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Fo=!1;function ts(){function Ee(){ts()}if(document.readyState==="loading"){Fo||window.addEventListener("DOMContentLoaded",Ee,!1),Fo=!0;return}document.querySelectorAll(Re.cssSelector).forEach(qt)}function $o(Ee,$e){let ct=null;try{ct=$e($)}catch(Tt){if(ot("Language definition for '{}' could not be registered.".replace("{}",Ee)),Mt)ot(Tt);else throw Tt;ct=ze}ct.name||(ct.name=Ee),fe[Ee]=ct,ct.rawDefinition=$e.bind(null,$),ct.aliases&&ia(ct.aliases,{languageName:Ee})}function yi(Ee){delete fe[Ee];for(const $e of Object.keys(Ce))Ce[$e]===Ee&&delete Ce[$e]}function ul(){return Object.keys(fe)}function jn(Ee){return Ee=(Ee||"").toLowerCase(),fe[Ee]||fe[Ce[Ee]]}function ia(Ee,{languageName:$e}){typeof Ee=="string"&&(Ee=[Ee]),Ee.forEach(ct=>{Ce[ct.toLowerCase()]=$e})}function ja(Ee){const $e=jn(Ee);return $e&&!$e.disableAutodetect}function La(Ee){Ee["before:highlightBlock"]&&!Ee["before:highlightElement"]&&(Ee["before:highlightElement"]=$e=>{Ee["before:highlightBlock"](Object.assign({block:$e.el},$e))}),Ee["after:highlightBlock"]&&!Ee["after:highlightElement"]&&(Ee["after:highlightElement"]=$e=>{Ee["after:highlightBlock"](Object.assign({block:$e.el},$e))})}function un(Ee){La(Ee),We.push(Ee)}function Ho(Ee){const $e=We.indexOf(Ee);$e!==-1&&We.splice($e,1)}function xi(Ee,$e){const ct=Ee;We.forEach(function(Tt){Tt[ct]&&Tt[ct]($e)})}function sa(Ee){return B("10.7.0","highlightBlock will be removed entirely in v12.0"),B("10.7.0","Please use highlightElement now."),qt(Ee)}Object.assign($,{highlight:Ut,highlightAuto:Zn,highlightAll:ts,highlightElement:qt,highlightBlock:sa,configure:en,initHighlighting:Da,initHighlightingOnLoad:cl,registerLanguage:$o,unregisterLanguage:yi,listLanguages:ul,getLanguage:jn,registerAliases:ia,autoDetection:ja,inherit:es,addPlugin:un,removePlugin:Ho}),$.debugMode=function(){Mt=!1},$.safeMode=function(){Mt=!0},$.versionString=Ze,$.regex={concat:S,lookahead:x,either:C,optional:E,anyNumberOfTimes:v};for(const Ee in we)typeof we[Ee]=="object"&&e(we[Ee]);return Object.assign($,we),$},Nn=Hr({});return Nn.newInstance=()=>Hr({}),pp=Nn,Nn.HighlightJS=Nn,Nn.default=Nn,pp}var gU=mU();const bU=tl(gU),Jv={},yU="hljs-";function xU(e){const t=bU.newInstance();return e&&o(e),{highlight:r,highlightAuto:i,listLanguages:l,register:o,registerAlias:c,registered:d};function r(f,h,g){const m=g||Jv,x=typeof m.prefix=="string"?m.prefix:yU;if(!t.getLanguage(f))throw new Error("Unknown language: `"+f+"` is not registered");t.configure({__emitter:vU,classPrefix:x});const v=t.highlight(h,{ignoreIllegals:!0,language:f});if(v.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:v.errorRaised});const E=v._emitter.root,S=E.data;return S.language=v.language,S.relevance=v.relevance,E}function i(f,h){const m=(h||Jv).subset||l();let x=-1,v=0,E;for(;++x<m.length;){const S=m[x];if(!t.getLanguage(S))continue;const _=r(S,f,h);_.data&&_.data.relevance!==void 0&&_.data.relevance>v&&(v=_.data.relevance,E=_)}return E||{type:"root",children:[],data:{language:void 0,relevance:v}}}function l(){return t.listLanguages()}function o(f,h){if(typeof f=="string")t.registerLanguage(f,h);else{let g;for(g in f)Object.hasOwn(f,g)&&t.registerLanguage(g,f[g])}}function c(f,h){if(typeof f=="string")t.registerAliases(typeof h=="string"?h:[...h],{languageName:f});else{let g;for(g in f)if(Object.hasOwn(f,g)){const m=f[g];t.registerAliases(typeof m=="string"?m:[...m],{languageName:g})}}}function d(f){return!!t.getLanguage(f)}}class vU{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const r=this.stack[this.stack.length-1],i=r.children[r.children.length-1];i&&i.type==="text"?i.value+=t:r.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,r){const i=this.stack[this.stack.length-1],l=t.root.children;r?i.children.push({type:"element",tagName:"span",properties:{className:[r]},children:l}):i.children.push(...l)}openNode(t){const r=this,i=t.split(".").map(function(c,d){return d?c+"_".repeat(d):r.options.classPrefix+c}),l=this.stack[this.stack.length-1],o={type:"element",tagName:"span",properties:{className:i},children:[]};l.children.push(o),this.stack.push(o)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const wU={};function EU(e){const t=e||wU,r=t.aliases,i=t.detect||!1,l=t.languages||pU,o=t.plainText,c=t.prefix,d=t.subset;let f="hljs";const h=xU(l);if(r&&h.registerAlias(r),c){const g=c.indexOf("-");f=g===-1?c:c.slice(0,g)}return function(g,m){Ed(g,"element",function(x,v,E){if(x.tagName!=="code"||!E||E.type!=="element"||E.tagName!=="pre")return;const S=SU(x);if(S===!1||!S&&!i||S&&o&&o.includes(S))return;Array.isArray(x.properties.className)||(x.properties.className=[]),x.properties.className.includes(f)||x.properties.className.unshift(f);const _=FP(x,{whitespace:"pre"});let C;try{C=S?h.highlight(S,_,{prefix:c}):h.highlightAuto(_,{prefix:c,subset:d})}catch(A){const T=A;if(S&&/Unknown language/.test(T.message)){m.message("Cannot highlight as `"+S+"`, it’s not registered",{ancestors:[E,x],cause:T,place:x.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw T}!S&&C.data&&C.data.language&&x.properties.className.push("language-"+C.data.language),C.children.length>0&&(x.children=C.children)})}}function SU(e){const t=e.properties.className;let r=-1;if(!Array.isArray(t))return;let i;for(;++r<t.length;){const l=String(t[r]);if(l==="no-highlight"||l==="nohighlight")return!1;!i&&l.slice(0,5)==="lang-"&&(i=l.slice(5)),!i&&l.slice(0,9)==="language-"&&(i=l.slice(9))}return i}function _U({code:e}){const[t,r]=w.useState(!1),i=()=>{navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3)};return p.jsx("button",{onClick:i,className:"absolute top-2 right-2 p-1.5 rounded-md bg-gray-200/80 dark:bg-gray-700/80 hover:bg-gray-300 dark:hover:bg-gray-600 text-gray-500 dark:text-gray-400 opacity-0 group-hover:opacity-100 transition-opacity z-10",children:t?p.jsx(vo,{size:12}):p.jsx(ON,{size:12})})}function kU({children:e,...t}){var o;const r=e==null?void 0:e.props,i=((o=r==null?void 0:r.className)==null?void 0:o.replace(/^language-/,""))||"",l=typeof(r==null?void 0:r.children)=="string"?r.children.replace(/\n$/,""):"";return p.jsxs("div",{className:"not-prose relative group my-4",children:[i&&p.jsx("div",{className:"absolute top-0 left-0 px-2.5 py-1 text-[10px] font-medium uppercase tracking-wider text-gray-400 dark:text-gray-500 bg-gray-100 dark:bg-gray-800 rounded-tl-lg rounded-br-lg border-b border-r border-gray-200 dark:border-gray-700 font-mono",children:i}),p.jsx(_U,{code:l}),p.jsx("pre",{className:"overflow-x-auto rounded-lg bg-[#fafafa] dark:bg-[#0d1117] border border-gray-200 dark:border-gray-700/60 p-4 pt-8 text-[13px] leading-[1.6] font-mono",...t,children:e})]})}function CU({children:e,className:t,...r}){return t?p.jsx("code",{className:t,...r,children:e}):p.jsx("code",{className:"px-1.5 py-0.5 rounded-md bg-gray-100 dark:bg-gray-800 text-pink-600 dark:text-pink-400 text-[0.875em] font-mono border border-gray-200/60 dark:border-gray-700/40",...r,children:e})}function mg({content:e,isUser:t}){return t?p.jsx("div",{className:"prose prose-sm max-w-none text-inherit [&_*]:text-inherit [&_a]:underline [&_code]:border [&_code]:border-black/10 [&_code]:bg-black/10 [&_code]:text-inherit dark:[&_code]:border-white/10 dark:[&_code]:bg-white/12 [&>p]:my-0.5 [&_li]:my-0",children:p.jsx(Dv,{remarkPlugins:[Fv],children:e})}):p.jsx("div",{className:Ke("prose max-w-none dark:prose-invert","prose-headings:font-semibold prose-headings:tracking-tight","prose-h1:text-xl prose-h1:mt-5 prose-h1:mb-3 prose-h1:pb-1.5 prose-h1:border-b prose-h1:border-gray-200 dark:prose-h1:border-gray-700","prose-h2:text-lg prose-h2:mt-5 prose-h2:mb-2","prose-h3:text-base prose-h3:mt-4 prose-h3:mb-2","prose-p:my-2.5 prose-p:leading-relaxed","prose-li:my-0.5","prose-ul:my-2 prose-ol:my-2","prose-a:text-accent prose-a:no-underline hover:prose-a:underline","prose-strong:text-gray-900 dark:prose-strong:text-white prose-strong:font-semibold","prose-blockquote:border-l-[3px] prose-blockquote:border-accent/40 prose-blockquote:bg-accent/[0.03] prose-blockquote:rounded-r-lg prose-blockquote:py-0.5 prose-blockquote:px-4 prose-blockquote:my-3 prose-blockquote:not-italic prose-blockquote:text-gray-600 dark:prose-blockquote:text-gray-300","prose-hr:my-5 prose-hr:border-gray-200 dark:prose-hr:border-gray-700","prose-table:text-sm prose-th:bg-gray-50 dark:prose-th:bg-gray-800 prose-th:px-3 prose-th:py-2 prose-td:px-3 prose-td:py-2 prose-th:border-gray-200 dark:prose-th:border-gray-700 prose-td:border-gray-200 dark:prose-td:border-gray-700","prose-img:rounded-lg prose-img:shadow-sm"),children:p.jsx(Dv,{remarkPlugins:[Fv],rehypePlugins:[EU],components:{pre:kU,code:CU},children:e})})}function Xr(e){return e.name||e.user_name||e.chat_name||`Session ${e.id.slice(0,8)}`}function NU(e,t){var i;return t?[Xr(e),e.session_key,((i=e.last_message)==null?void 0:i.content)||"",e.user_name||"",e.chat_name||""].join(" ").toLowerCase().includes(t):!0}function ew(e){return[...e].sort((t,r)=>t.live!==r.live?t.live?-1:1:(r.updated_at||r.created_at||"").localeCompare(t.updated_at||t.created_at||""))}function __(e,t="just now"){if(!e)return"";const r=Date.now()-new Date(e).getTime(),i=Math.floor(r/6e4);if(i<1)return t;if(i<60)return`${i}m`;const l=Math.floor(i/60);return l<24?`${l}h`:`${Math.floor(l/24)}d`}const TU="opencode",k_="opencode/minimax-m2.5-free",AU="",mp=["opencode","codex","claudecode","cursor","gemini","qoder","iflow","localcore-acp"],RU=["telegram","feishu","lark","discord","slack","dingtalk","wecom","weixin","qq","qqbot","line"],OU=["opencode","claudecode","acp","localcore-acp"],MU="localcore-acp",DU=["[Scheduler Tools]","If the user asks to create, view, edit, delete, or manually run a scheduled task for this conversation, use the Bash tool to run the local scheduler CLI.","Use these commands:",'lac scheduler add --cron "<5-field cron>" --message "<exact message to send>" --desc "<short label>" [--execution-mode same-thread|side-thread]',"lac scheduler list","lac scheduler list --thread","lac scheduler info <job-id>",'lac scheduler edit <job-id> [--cron "<5-field cron>"] [--message "<exact message>"] [--desc "<short label>"] [--enabled true|false] [--execution-mode same-thread|side-thread]',"lac scheduler del <job-id>","lac scheduler run <job-id>","Environment variables LOCAL_AI_WORKSPACE_ID, LOCAL_AI_THREAD_ID, LOCAL_AI_PLATFORM, LOCAL_AI_CHAT_ID, and LOCAL_AI_PLATFORM_USER_ID are already set when available.","Prefer relying on those variables instead of inventing your own route or creating session-only cron jobs.","By default, `lac scheduler list` shows all scheduled tasks in the current workspace. Use `lac scheduler list --thread` to show only the current conversation thread.","Use `--execution-mode same-thread` to reuse the current thread, or `--execution-mode side-thread` to run in a dedicated scheduled thread.","Only use the scheduler CLI when the user explicitly asks for scheduled automation.","[/Scheduler Tools]"].join(`
474
- `),jU={allow:"allow",deny:"deny","allow all":"allow all",allowall:"allow all","perm:allow":"allow","perm:deny":"deny","perm:allow_all":"allow all"};function gp(e,t=[]){return[DU,...t.flatMap(r=>r?["",r]:[]),"","[User Message]",e,"[/User Message]"].join(`
475
- `)}function bp(e){switch(String(e||"").trim().toLowerCase()){case"opencode":return k_;case"claudecode":return AU;default:return""}}function C_(e,t){const r=String(e||"").trim().toLowerCase(),i=String(t||"").trim();return r?r==="opencode"?i||k_:r==="claudecode"&&i.startsWith("opencode/")?"":i:i}function Ku(e){return e&&jU[String(e).trim().toLowerCase()]||null}function LU(e){return!!Ku(e==null?void 0:e.data)}function IU(e){if(!e||typeof e!="object")return null;const t=e,r=typeof t.text=="string"?t.text:typeof t.Text=="string"?t.Text:"",i=typeof t.data=="string"?t.data:typeof t.Data=="string"?t.Data:"";if(!r||!i)return null;const l=Ku(i);return l?{text:l,data:l}:{text:r,data:i}}function zU(e){return e?OU.includes(String(e).trim().toLowerCase()):!1}function PU(e){const t=String(e||"").trim().toLowerCase();return t==="acp"||t==="opencode"||t==="claudecode"||t===MU}const tw=9e4;function BU(e){return e?e.startsWith("💭 ")||e.startsWith("🔧 ")||e.startsWith("📤 ")||e.startsWith("⏳ "):!1}function yp(e){if(!e)return!1;const t=e.replace(/\s+/g," ").trim();return/^Agent 提问(?:\s*\(\d+\/\d+\))?/i.test(t)||t.includes("请回复选项编号")||t.includes("直接输入你的回答")||t.includes("等待你的回复")||t.includes("请直接回复")||t.includes("请输入你的回答")}function N_(e){if(!e)return"";const t=e.match(/\[User Message\]\s*([\s\S]*?)\s*\[\/User Message\]/);return t?t[1]||"":e}function nw(e){return e.map((t,r)=>({id:t.id||`${r}-${t.timestamp||t.role}`,role:t.role==="user"?"user":t.role==="system"?"system":"assistant",content:t.role==="user"?N_(t.content):t.content,kind:t.kind==="progress"||t.kind==="system"?"progress":"final",order:r,timestamp:t.timestamp}))}function UU(e,t){const r=new Set(t.map(c=>c.id)),i=new Set(t.map(c=>`${c.role}:${c.kind||"final"}:${c.content}`)),l=new Set(t.filter(c=>c.role==="assistant"&&(c.kind||"final")==="final").map(c=>c.content)),o=e.filter(c=>{if(r.has(c.id)||!c.preview&&c.kind!=="progress")return!1;const d=c.streamTargetContent??c.content;return l.has(d)?!1:c.preview?!0:!i.has(`${c.role}:${c.kind||"final"}:${c.content}`)});return R_([...t,...o])}function T_(e){return{id:e.id,project:e.workspaceId,name:e.title,live:e.live,createdAt:e.createdAt,updatedAt:e.updatedAt,excerpt:N_(e.excerpt),agentType:e.agentType,bridgeSessionKey:e.bridgeSessionKey}}function A_(e){return[...e].sort((t,r)=>t.live!==r.live?t.live?-1:1:(r.updatedAt||r.createdAt||"").localeCompare(t.updatedAt||t.createdAt||""))}function FU(e,t){return t?[e.name,e.excerpt,e.bridgeSessionKey||""].join(" ").toLowerCase().includes(t):!0}function R_(e){return[...e].sort((t,r)=>{const i=t.timestamp?new Date(t.timestamp).getTime():Number.NaN,l=r.timestamp?new Date(r.timestamp).getTime():Number.NaN,o=Number.isFinite(i),c=Number.isFinite(l);return o&&c&&i!==l?i-l:t.order!==r.order?t.order-r.order:t.id.localeCompare(r.id)})}function rw(e){if(!e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(t)}function $U(e){switch(e){case"starting":return"启动中";case"api_ready":return"服务就绪";case"error":return"运行异常";default:return"未启动"}}function HU(e){if(!(e!=null&&e.startsWith("desktop:")))return"";const[,t=""]=e.split(":");return t}function KU(e){return Array.isArray(e)?e.map(t=>Array.isArray(t)?t.map(r=>IU(r)).filter(r=>!!r):[]).filter(t=>t.length>0):[]}function O_(e,t,r){const i=e.filter(l=>l.project!==t);return i.push({project:t,sessions:r}),i.sort((l,o)=>l.project.localeCompare(o.project))}function qU(e,t,r){var o;const i=((o=e.find(c=>c.project===t))==null?void 0:o.sessions)||[],l=A_([r,...i.filter(c=>c.id!==r.id)]);return O_(e,t,l)}function GU(e){return e.some(t=>t.some(r=>LU(r)))}function VU(e,t){return e==="stopping"?"Stopping current task…":e==="error"?"":e==="awaiting_input"?"Agent is waiting for your reply.":e==="permission_submitted"?"Permission sent. Waiting for the agent to continue…":e==="awaiting_permission"?"Waiting for your permission response.":t?"Agent is typing…":e==="running"?"Task is running…":""}function YU(e){return e==="running"||e==="awaiting_permission"||e==="permission_submitted"||e==="stopping"}function XU(e){return e!=="idle"&&e!=="awaiting_input"&&e!=="error"}function WU(e){return e!=="awaiting_input"&&e!=="awaiting_permission"&&e!=="permission_submitted"&&e!=="stopping"}function M_(){return $i()==="local_core"?{chatTitle:"本地对话",chatHeading:"本地对话",chatDescription:"浏览线程、切换工作区,并与本地 AI Core 保持同步。",scopeLabel:"当前工作区",scopeSelectPlaceholder:"选择工作区",searchPlaceholder:"搜索线程、联系人或消息摘要",startRuntimeLabel:"启动运行时",startingRuntimeLabel:"启动中…",newThreadLabel:"新建线程",pendingRestartLabel:"最新配置已经保存,但当前对话仍在使用旧运行时状态。请重启运行时以应用配置。",emptySelectionLabel:"选择工作区后即可开始对话。",emptyThreadsLabel:"当前还没有线程。",emptySearchLabel:"没有匹配的线程。",collectionLabel:"线程",activeScopeLabel:"当前工作区",activeConversationFallback:"新对话",startConversationLabel:"选择工作区后即可开始聊天。",runtimeOnlineLabel:"运行时在线",runtimeOfflineLabel:"运行时离线",emptyConversationLabel:"发送一条消息,即可在当前工作区创建新线程。",startFirstPlaceholder:"请先启动运行时",waitingRuntimePlaceholder:"正在等待运行时通道连接",sendPlaceholder:"输入一条发给当前线程的消息",permissionUnsupportedLabel:"当前代理无法在此对话中继续交互式审批。请切换到支持的代理,或调整运行时权限后重试。",replyTimeoutLabel:"审批回复已发送,但代理没有继续执行。该请求可能暂不支持本地运行时继续处理。"}:{chatTitle:"桌面对话",chatHeading:"桌面对话",chatDescription:"",scopeLabel:"当前项目",scopeSelectPlaceholder:"选择项目",searchPlaceholder:"搜索会话、用户或消息摘要",startRuntimeLabel:"启动服务",startingRuntimeLabel:"启动中…",newThreadLabel:"新建会话",pendingRestartLabel:"最新配置已经保存,但当前对话仍在使用旧服务状态。请重启桌面服务以应用配置。",emptySelectionLabel:"选择项目后即可开始对话。",emptyThreadsLabel:"当前还没有桌面会话。",emptySearchLabel:"没有匹配的会话。",collectionLabel:"会话",activeScopeLabel:"当前项目",activeConversationFallback:"新桌面对话",startConversationLabel:"选择项目后即可开始聊天。",runtimeOnlineLabel:"桥接在线",runtimeOfflineLabel:"桥接离线",emptyConversationLabel:"发送一条消息,即可在当前项目中创建桌面会话。",startFirstPlaceholder:"请先启动服务",waitingRuntimePlaceholder:"正在等待桌面桥接连接",sendPlaceholder:"输入一条发给桌面通道的消息",permissionUnsupportedLabel:"当前代理无法在桌面对话中继续交互式审批。请切换到支持的代理,或调整代理权限与 work_dir 后重试。",replyTimeoutLabel:"审批回复已发送,但代理没有继续执行。当前代理或请求可能暂不支持桌面续接。"}}function QU({requestedProject:e,selectedProject:t,setSelectedProject:r,clearReplyTimeout:i,updateTaskState:l,setTyping:o}){const[c,d]=w.useState(null),[f,h]=w.useState(!0),g=$i(),m=g==="electron",x=(c==null?void 0:c.phase)==="api_ready",v=x,E=w.useCallback(async()=>{const S=await Ym();d(S),!S.roles.conversation.lastError&&!t&&!e&&S.settings.defaultProject&&r(S.settings.defaultProject)},[e,t,r]);return w.useEffect(()=>{E().finally(()=>h(!1));const S=Xm(_=>{d(_),(_.phase==="stopped"||_.phase==="error")&&(o(!1),i(),l("idle"))});return()=>{i(),S()}},[i,E,o,l]),w.useMemo(()=>({loading:f,refreshRuntime:E,runtime:c,runtimeProvider:g,serviceRunning:x,showSessionKey:m,transportReady:v}),[f,E,c,g,x,m,v])}const D_=e=>lt.get(`/projects/${e}/sessions`),j_=(e,t,r)=>lt.get(`/projects/${e}/sessions/${t}`,{history_limit:String(r)}),ZU=(e,t,r)=>lt.patch(`/projects/${e}/sessions/${t}`,r),JU=(e,t)=>lt.delete(`/projects/${e}/sessions/${t}`),e6=(e,t)=>lt.post(`/projects/${e}/sessions/switch`,t),sm=(e,t)=>lt.post(`/projects/${e}/send`,t);function t6({current:e,requested:t,runtimeDefault:r,workspaceIds:i}){return e&&i.includes(e)?e:t&&i.includes(t)?t:r&&i.includes(r)?r:i[0]||""}function n6({activeThreadId:e,requestedWorkspaceId:t,requestedThreadId:r,runtimeDefaultWorkspaceId:i,runtimeProvider:l,searchParams:o,serviceRunning:c,selectedWorkspaceId:d,workspaceIds:f,threadGroups:h,threadSearch:g,setSelectedKnowledgeBaseIds:m,setActiveRunId:x,setActiveSessionAgentType:v,setActiveSessionId:E,setActiveSessionKey:S,setActiveSessionName:_,setBridgeError:C,setMessages:A,setPendingPermissionRequest:T,setProjects:M,setSearchParams:P,setSelectedProject:N,setThreadGroups:z,setTyping:G,applyLocalCoreThreadDetail:Q,clearLocalCorePolling:R,clearReplyTimeout:q,updateTaskState:Z,holdBlankComposerRef:ne,lastSessionByProjectRef:Y,nextMessageOrderRef:H,pendingTurnRef:j,progressSequenceByTurnRef:F}){const K=w.useMemo(()=>{var J;return((J=h.find(be=>be.project===d))==null?void 0:J.sessions)||[]},[d,h]),L=w.useMemo(()=>{const J=g.trim().toLowerCase();return f.map(be=>{var ue;const pe=(((ue=h.find(ve=>ve.project===be))==null?void 0:ue.sessions)||[]).filter(ve=>FU(ve,J));return{project:be,sessions:pe}}).filter(be=>be.sessions.length>0||!J&&be.project===d)},[d,h,g,f]),I=w.useCallback(async J=>{if(!J||!c)return[];const be=A_((await Dj(J)).threads.map(ue=>T_(ue))),pe=be.find(ue=>ue.id===e);return pe!=null&&pe.agentType&&v(pe.agentType),z(ue=>O_(ue,J,be)),be},[e,c,v,z,!0]),X=w.useCallback(async(J,be)=>{if(!(!J||!be||!c)){ne.current=!1,R(),Z("idle"),T(null),G(!1);{const pe=await Vm(be);Q(pe);return}}},[Q,R,ne,Y,H,j,F,c,x,v,E,S,_,m,A,T,N,z,G,Z,!0]),D=w.useCallback(async()=>{if(!c)return M([]),z([]),m([]),[];const J=(await Gm()).workspaces.map(ue=>ue.id);M(J);const be=t6({current:d,requested:t,runtimeDefault:i,workspaceIds:J}),pe=(await Promise.all(J.map(async ue=>({project:ue,sessions:await I(ue)})))).sort((ue,ve)=>ue.project.localeCompare(ve.project));return z(pe),N(be),pe},[I,t,i,d,c,M,m,N,z,!0]);return w.useEffect(()=>{if(!c){z([]),A([]),T(null),m([]),v(""),x(""),C(""),j.current=null,H.current=0,F.current={},Z("idle"),G(!1),R(),q();return}D()},[R,q,H,j,F,D,c,x,v,C,A,T,m,z,G,Z]),w.useEffect(()=>{if(!d||!c||K.find(ve=>ve.id===e))return;const be=t===d?r:"",pe=Y.current[d];if(!e&&ne.current)return;const ue=K.find(ve=>ve.id===be)||K.find(ve=>ve.id===pe)||K[0];if(ue){G(!1),Z("idle"),C(""),R(),q(),X(d,ue.id);return}G(!1),Z("idle"),C(""),q(),E(""),S(""),_(""),v(""),x(""),A([]),j.current=null,H.current=0,F.current={},R()},[e,R,q,ne,Y,X,H,j,F,r,t,d,c,x,v,E,S,_,C,A,G,K,Z]),w.useEffect(()=>{if(!d&&!e)return;const J=new URLSearchParams(o);d?J.set("project",d):J.delete("project"),e?J.set("session",e):J.delete("session"),J.toString()!==o.toString()&&P(J,{replace:!0})},[e,o,d,P]),{filteredThreadGroups:L,loadActiveThread:X,refreshThreadsForWorkspace:I,refreshWorkspacesAndThreads:D}}function r6({activeAgentType:e,activeThreadId:t,armReplyTimeout:r,clearActionStatuses:i,clearReplyTimeout:l,messages:o,reserveNextMessageOrder:c,runtimeProvider:d,selectedWorkspaceId:f,sendAction:h,settlePreviewMessages:g,setActiveRunId:m,setBridgeError:x,setMessages:v,setPendingPermissionRequest:E,setPendingBridgeActionId:S,setTyping:_,startLocalCoreThreadPolling:C,updateTaskState:A}){return{handleBridgeAction:w.useCallback(async(P,N)=>{if(!t)return;const z=o.filter(ne=>ne.role!=="user"&&ne.kind!=="progress").length,G=Ku(N.data)||N.data,Q=Ku(N.data)||N.text||N.data,R=c(),q=`${crypto.randomUUID()}-user-action`;let Z=!1;S(P.id),v(ne=>ne.map(Y=>Y.id===P.id?{...Y,actionPending:!0}:Y)),E(ne=>ne&&ne.id===P.id?{...ne,actionPending:!0}:ne);try{v(Y=>[...Y,{id:q,role:"user",content:Q,order:R,timestamp:new Date().toISOString()}]);const ne=await h(t,G);m(ne.runId),C(t,z),Z=!0,x(""),g(P.actionReplyCtx),_(!0),l(),i(),P.actionMode==="permission"&&P.actionInteractive?(A("permission_submitted","bridge-permission-submitted"),r("permission_continue"),E(null),v(Y=>Y.map(H=>H.id===P.id?{...H,actions:[],actionPending:!1,actionStatus:"Permission sent. Waiting for the agent to continue…"}:H))):(A("running","bridge-action-submitted"),r())}catch(ne){x(ne instanceof Error?ne.message:"Failed to send permission response."),v(Y=>Y.filter(H=>H.id!==q)),A(P.actionMode==="permission"&&P.actionInteractive?"awaiting_permission":"error",P.actionMode==="permission"&&P.actionInteractive?"bridge-permission-submit-failed":"bridge-action-submit-failed"),_(!1),E(Y=>Y&&Y.id===P.id?{...Y,actionPending:!1}:Y)}finally{S(null),v(ne=>ne.map(Y=>Y.id===P.id?{...Y,actionPending:!1,actions:Z?Y.actions||[]:Y.actions}:Y))}},[t,r,i,l,o,c,h,g,m,x,v,E,S,_,C,A,!0])}}function a6(e){var r;if(!e.id||e.role!=="assistant"||e.actionMode!=="permission"||!e.content)return null;const t=((r=e.actions)==null?void 0:r.filter(i=>i.length>0))||[];return t.length===0?null:{id:e.id,content:e.content,actions:t,actionReplyCtx:e.actionReplyCtx,actionPending:e.actionPending,actionStatus:e.actionStatus,actionMode:"permission",actionInteractive:!0}}function i6(e){if(!e)return!1;const t=e.replace(/\s+/g," ").trim();return/^Agent 提问(?:\s*\(\d+\/\d+\))?/i.test(t)||t.includes("请回复选项编号")||t.includes("直接输入你的回答")||t.includes("等待你的回复")||t.includes("请直接回复")||t.includes("请输入你的回答")}function s6(e){return e==="awaiting_permission"?"awaiting_permission":"idle"}function l6(e,t){return t?"awaiting_permission":e?"awaiting_input":"idle"}function o6(e,t){return t?"bridge-buttons-awaiting-permission":e?"bridge-buttons-awaiting-input":"bridge-buttons-idle"}function c6(e,t,r){if(e.pendingPermissionRequest)return{state:"awaiting_permission",reason:"local-core-poll-awaiting-permission"};const i=e.messages.filter(o=>o.role==="assistant"),l=i[i.length-1];return l&&i6(l.content)?{state:"awaiting_input",reason:"local-core-poll-awaiting-input"}:l&&l.kind!=="progress"&&e.messages.filter(o=>o.role!=="user"&&o.kind!=="progress").length>t&&r>=1?{state:"idle",reason:"local-core-poll-complete"}:null}function u6(e){const t=e||"This agent",r=M_();return r.permissionUnsupportedLabel.startsWith("This agent")?r.permissionUnsupportedLabel:`${t} ${r.permissionUnsupportedLabel.replace(/^This agent\s+/i,"")}`}function d6({activeAgentType:e,activeBridgeSessionKey:t,armReplyTimeout:r,clearActionStatuses:i,clearLocalCorePolling:l,clearReplyTimeout:o,finalizeTurnMessages:c,nextProgressMessageId:d,pendingTurnRef:f,progressSequenceByTurnRef:h,refreshThreadsForWorkspace:g,reserveAssistantMessageOrder:m,settlePreviewMessages:x,setBridgeError:v,setMessages:E,setPendingPermissionRequest:S,setTyping:_,taskStateRef:C,updateTaskState:A}){const T=PU(e),M=w.useCallback(N=>{WU(C.current)&&A("running",N)},[C,A]),P=w.useCallback(N=>{console.info("[desktop-chat] bridge_event",{type:N.type,sessionKey:N.sessionKey,replyCtx:N.replyCtx,taskState:C.current});const z=HU(N.sessionKey);if(z&&g(z),!(!N.sessionKey||N.sessionKey!==t))switch(N.type){case"preview_start":if(yp(N.content)){o(),_(!1),f.current=null,i(),A("awaiting_input","bridge-preview-awaiting-input"),S(null),v(""),E(H=>{const j=H.find(K=>N.previewHandle&&K.id===N.previewHandle||K.preview&&N.replyCtx&&K.turnKey===N.replyCtx),F=(j==null?void 0:j.id)||N.previewHandle||`${N.replyCtx||crypto.randomUUID()}-preview`,W=H.filter(K=>K.id!==F);return W.push({id:F,role:"assistant",content:T?(j==null?void 0:j.content)||"":N.content||"",streamTargetContent:T?N.content||"":void 0,kind:"progress",order:(j==null?void 0:j.order)??m(N.sessionKey),timestamp:(j==null?void 0:j.timestamp)||new Date().toISOString(),turnKey:N.replyCtx,preview:!0,previewPlainText:T}),W});break}i(),_(!0),M("bridge-preview-start"),S(null),r(),v(""),E(H=>{const j=H.find(K=>N.previewHandle&&K.id===N.previewHandle||K.preview&&N.replyCtx&&K.turnKey===N.replyCtx),F=(j==null?void 0:j.id)||N.previewHandle||`${N.replyCtx||crypto.randomUUID()}-preview`,W=H.filter(K=>K.id!==F);return W.push({id:F,role:"assistant",content:T?(j==null?void 0:j.content)||"":N.content||"",streamTargetContent:T?N.content||"":void 0,kind:"progress",order:(j==null?void 0:j.order)??m(N.sessionKey),timestamp:(j==null?void 0:j.timestamp)||new Date().toISOString(),turnKey:N.replyCtx,preview:!0,previewPlainText:T}),W});break;case"update_message":if(yp(N.content)){o(),_(!1),f.current=null,i(),A("awaiting_input","bridge-update-awaiting-input"),S(null),v(""),E(H=>{const j=H.find(F=>N.previewHandle&&F.id===N.previewHandle||F.preview&&N.replyCtx&&F.turnKey===N.replyCtx);return j?H.map(F=>F.id===j.id?{...F,content:T?F.content:N.content||"",streamTargetContent:T?N.content||"":void 0,preview:!0,previewPlainText:T}:F):[...H,{id:N.previewHandle||`${N.replyCtx||crypto.randomUUID()}-preview`,role:"assistant",content:T?"":N.content||"",streamTargetContent:T?N.content||"":void 0,kind:"progress",order:m(N.sessionKey),timestamp:new Date().toISOString(),turnKey:N.replyCtx,preview:!0,previewPlainText:T}]});break}i(),_(!0),M("bridge-update-message"),S(null),r(),v(""),E(H=>{const j=H.find(F=>N.previewHandle&&F.id===N.previewHandle||F.preview&&N.replyCtx&&F.turnKey===N.replyCtx);return j?H.map(F=>F.id===j.id?{...F,content:T?F.content:N.content||"",streamTargetContent:T?N.content||"":void 0,preview:!0,previewPlainText:T}:F):[...H,{id:N.previewHandle||`${N.replyCtx||crypto.randomUUID()}-preview`,role:"assistant",content:T?"":N.content||"",streamTargetContent:T?N.content||"":void 0,kind:"progress",order:m(N.sessionKey),timestamp:new Date().toISOString(),turnKey:N.replyCtx,preview:!0,previewPlainText:T}]});break;case"delete_message":E(H=>H.filter(j=>j.id!==N.previewHandle));break;case"typing_start":i(),_(!0),M("bridge-typing-start"),S(null),v(""),r();break;case"typing_stop":_(!1),o(),f.current=null,i(),A(s6(C.current),C.current==="awaiting_permission"?"bridge-typing-stop-preserve-permission":"bridge-typing-stop"),x(N.replyCtx),c(N.replyCtx);break;case"reply":{const H=yp(N.content);i(),_(!H),H?(o(),f.current=null,A("awaiting_input","bridge-reply-awaiting-input")):(M("bridge-reply"),r()),S(null),v("");const j=d(N.replyCtx);!BU(N.content)&&N.replyCtx&&delete h.current[N.replyCtx],v(""),E(F=>[...F.filter(W=>!(W.preview&&W.turnKey===N.replyCtx)&&W.id!==j),{id:j,role:"assistant",content:N.content||"",kind:"progress",order:m(N.sessionKey),timestamp:new Date().toISOString(),turnKey:N.replyCtx}]);break}case"buttons":o(),_(!1),f.current=null,v(""),i(),x(N.replyCtx);const G=`${N.replyCtx||crypto.randomUUID()}-buttons`,Q=KU(N.buttonRows||N.buttons),R=GU(Q),q=R&&zU(e),Z=R&&!q?[]:Q,ne=Z,Y=R&&!q?u6(e):void 0;E(H=>H.find(F=>F.id===G)?H.map(F=>F.id===G?{...F,content:N.content||F.content,actions:ne,actionReplyCtx:N.replyCtx,actionPending:!1,actionMode:R?"permission":"generic",actionInteractive:q,actionStatus:Y}:F):[...H,{id:G,role:"assistant",content:N.content||"Permission required before continuing.",kind:"progress",order:m(N.sessionKey),timestamp:new Date().toISOString(),turnKey:N.replyCtx,actions:ne,actionReplyCtx:N.replyCtx,actionPending:!1,actionMode:R?"permission":"generic",actionInteractive:q,actionStatus:Y}]),S(H=>{if(!R||!q)return null;const j={id:G,role:"assistant",content:N.content||"Permission required before continuing.",actions:Z,actionReplyCtx:N.replyCtx,actionPending:!1,actionMode:"permission",actionStatus:Y};return a6(j)||H}),A(l6(Q.length>0,q),o6(Q.length>0,q));break;case"card":o(),_(!1),f.current=null,i(),A("idle","bridge-card"),S(null),x(N.replyCtx),c(N.replyCtx),v(""),E(H=>[...H,{id:`${N.replyCtx||crypto.randomUUID()}-card`,role:"assistant",content:"Interactive card received. Open the session in the standard Sessions view for full controls.",order:m(N.sessionKey),timestamp:new Date().toISOString()}]);break}},[T,e,t,r,i,o,c,d,f,h,g,m,x,v,E,S,_,M,A]);w.useEffect(()=>{const N=oL(z=>{P(z)});return()=>{l(),o(),N()}},[l,o,P])}function f6(e){d6({activeAgentType:e.activeAgentType,activeBridgeSessionKey:e.activeBridgeSessionKey,armReplyTimeout:e.armReplyTimeout,clearActionStatuses:e.clearActionStatuses,clearLocalCorePolling:e.clearLocalCorePolling,clearReplyTimeout:e.clearReplyTimeout,finalizeTurnMessages:e.finalizeTurnMessages,messages:e.messages,nextProgressMessageId:e.nextProgressMessageId,pendingTurnRef:e.pendingTurnRef,progressSequenceByTurnRef:e.progressSequenceByTurnRef,refreshThreadsForWorkspace:e.refreshThreadsForWorkspace,reserveAssistantMessageOrder:e.reserveAssistantMessageOrder,settlePreviewMessages:e.settlePreviewMessages,setBridgeError:e.setBridgeError,setMessages:e.setMessages,setPendingPermissionRequest:e.setPendingPermissionRequest,setTyping:e.setTyping,taskStateRef:e.taskStateRef,updateTaskState:e.updateTaskState});const{handleBridgeAction:t}=r6({activeAgentType:e.activeAgentType,activeBridgeSessionKey:e.activeBridgeSessionKey,activeRunId:e.activeRunId,activeThreadId:e.activeThreadId,armReplyTimeout:e.armReplyTimeout,clearActionStatuses:e.clearActionStatuses,clearReplyTimeout:e.clearReplyTimeout,messages:e.messages,reserveNextMessageOrder:e.reserveNextMessageOrder,runtimeProvider:e.runtimeProvider,selectedWorkspaceId:e.selectedWorkspaceId,sendAction:e.sendAction,settlePreviewMessages:e.settlePreviewMessages,setActiveRunId:e.setActiveRunId,setBridgeError:e.setBridgeError,setMessages:e.setMessages,setPendingPermissionRequest:e.setPendingPermissionRequest,setPendingBridgeActionId:e.setPendingBridgeActionId,setTyping:e.setTyping,startLocalCoreThreadPolling:e.startLocalCoreThreadPolling,updateTaskState:e.updateTaskState,taskStateRef:e.taskStateRef});return{handleBridgeAction:t}}function h6({activeRunId:e,activeThreadId:t,activeBridgeSessionKey:r,availableKnowledgeBases:i,brandingNewThreadLabel:l,draft:o,loadActiveThread:c,messages:d,selectedKnowledgeBaseIds:f,runtimeProvider:h,selectedProject:g,taskState:m,updateTaskState:x,applyLocalCoreThreadDetail:v,armReplyTimeout:E,clearLocalCorePolling:S,clearReplyTimeout:_,refreshSessionsForProject:C,reserveNextMessageOrder:A,settlePreviewMessages:T,setActiveRunId:M,setActiveSessionId:P,setActiveSessionKey:N,setActiveSessionName:z,setBridgeError:G,setDraft:Q,setMessages:R,setPendingPermissionRequest:q,setSending:Z,setTyping:ne,startLocalCoreThreadPolling:Y,holdBlankComposerRef:H,lastSessionByProjectRef:j,nextMessageOrderRef:F,pendingTurnRef:W,progressSequenceByTurnRef:K,taskStateRef:L}){const X=w.useCallback(pe=>{if(f.length===0)return gp(pe);const ue=f.map(ve=>i.find(ge=>ge.id===ve)).filter(ve=>!!ve);return ue.length===0?gp(pe):gp(pe,[["[Selected Knowledge Bases]",...ue.map(ve=>`- id: ${ve.id} | name: ${ve.name}`),"[/Selected Knowledge Bases]"].join(`
476
- `)])},[i,f]),D=w.useCallback(async()=>{if(!g)throw new Error("Choose a project first");if(t)return{id:t,sessionKey:r};const pe=await KE(g,`${l} ${new Date().toLocaleTimeString()}`);return v(pe),await C(g),{id:pe.id,sessionKey:pe.bridgeSessionKey||""}},[r,t,v,l,C,g,!0]),J=w.useCallback(async()=>{if(!o.trim()||!g)return;const pe=o.trim(),ue=m==="awaiting_input",ve=ue?pe:X(pe),ge=A(),we=d.filter(ye=>ye.role!=="user"&&ye.kind!=="progress").length;Q(""),Z(!0);try{const ye=await D();if(console.info("[desktop-chat] send",{runtimeProvider:h,selectedProject:g,threadId:ye.id,sessionKey:ye.sessionKey,selectedKnowledgeBaseIds:f}),W.current={sessionKey:ye.sessionKey,userOrder:ge},q(null),R(Oe=>[...Oe,{id:`${crypto.randomUUID()}-user`,role:"user",content:pe,order:ge,timestamp:new Date().toISOString()}]),x("running","send-started"),ne(!0),G(""),ye.id&&await No(ye.id,f),E(),ye.id){const Oe=ue?await qE(ye.id,ve):await Ij(ye.id,ve);M(Oe.runId),Y(ye.id,we)}else throw new Error("Managed desktop thread transport is unavailable.")}catch(ye){_(),S(),W.current=null,T(),q(null),ne(!1),x("error","send-failed"),G(ye instanceof Error?ye.message:"Failed to send the message.")}finally{Z(!1)}},[E,X,S,_,o,D,m,W,A,d,f,g,M,G,Q,R,q,Z,T,ne,Y,x,!0]),be=w.useCallback(async()=>{if(!(!g||m==="stopping")){G(""),_(),S(),T(),q(null),ne(!1),x("stopping","stop-requested");try{if(e)await zj(e);else throw new Error("No active run to stop.");window.setTimeout(()=>{L.current==="stopping"&&x("idle","stop-timeout-complete")},1500)}catch(pe){x("error","stop-failed"),G(pe instanceof Error?pe.message:"Failed to stop the current task.")}}},[e,S,_,G,q,T,ne,g,m,L,x,!0]);return{handleSend:J,handleStopTask:be}}function p6({activeThreadId:e,brandingNewThreadLabel:t,deleteTarget:r,renameDraft:i,renameTarget:l,runtimeProvider:o,searchParams:c,selectedKnowledgeBaseIds:d,selectedProject:f,updateTaskState:h,applyLocalCoreThreadDetail:g,clearLocalCorePolling:m,clearReplyTimeout:x,refreshSessionsForProject:v,setActiveRunId:E,setActiveSessionAgentType:S,setActiveSessionId:_,setActiveSessionKey:C,setActiveSessionName:A,setBridgeError:T,setDeleteTarget:M,setMessages:P,setPendingPermissionRequest:N,setPendingSessionAction:z,setRenameDraft:G,setRenameTarget:Q,setSearchParams:R,setTyping:q,holdBlankComposerRef:Z,nextMessageOrderRef:ne,pendingTurnRef:Y,progressSequenceByTurnRef:H}){const F=o==="local_core",W=w.useCallback(()=>{Z.current=!0,_(""),C(""),A(""),S(""),E(""),P([]),N(null),q(!1),h("idle"),T(""),Y.current=null,ne.current=0,H.current={},m(),x()},[m,x,Z,ne,Y,H,E,S,_,C,A,T,P,N,q,h]),K=w.useCallback(async()=>{if(f){if(F){z("rename");try{const D=await KE(f,`${t} ${new Date().toLocaleTimeString()}`);if(d.length>0){const be=(await No(D.id,d)).knowledgeBaseIds;D.selectedKnowledgeBaseIds=be}else D.selectedKnowledgeBaseIds=[];await v(f),g(D);const J=new URLSearchParams(c);J.set("project",f),J.set("session",D.id),R(J,{replace:!0})}finally{z(null)}return}W()}},[g,t,v,W,c,d,f,z,R,F,!0]),L=w.useCallback((D,J)=>{Q({project:D,id:J.id,name:J.name}),G(J.name)},[G,Q]),I=w.useCallback(async()=>{if(l){z("rename");try{const D=i.trim();await jj(l.id,D),l.id===e&&A(D),await v(l.project),Q(null),G("")}finally{z(null)}}},[e,v,i,l,A,z,G,Q,!0]),X=w.useCallback(async()=>{if(r){z("delete");try{await Lj(r.id),r.id===e&&W(),await v(r.project),M(null)}finally{z(null)}}},[e,r,v,W,M,z,!0]);return{handleCreateNew:K,handleDeleteSession:X,handleRenameSession:I,openRenameModal:L}}function m6({activeRunId:e,activeThreadId:t,activeBridgeSessionKey:r,availableKnowledgeBases:i,brandingNewThreadLabel:l,deleteTarget:o,draft:c,loadActiveThread:d,messages:f,renameDraft:h,renameTarget:g,runtimeProvider:m,searchParams:x,selectedKnowledgeBaseIds:v,selectedWorkspaceId:E,taskState:S,updateTaskState:_,applyLocalCoreThreadDetail:C,armReplyTimeout:A,clearLocalCorePolling:T,clearReplyTimeout:M,refreshSessionsForProject:P,reserveNextMessageOrder:N,settlePreviewMessages:z,setActiveRunId:G,setActiveSessionAgentType:Q,setActiveSessionId:R,setActiveSessionKey:q,setActiveSessionName:Z,setBridgeError:ne,setDeleteTarget:Y,setDraft:H,setMessages:j,setPendingPermissionRequest:F,setPendingSessionAction:W,setRenameDraft:K,setRenameTarget:L,setSearchParams:I,setSending:X,setTyping:D,startLocalCoreThreadPolling:J,holdBlankComposerRef:be,lastSessionByProjectRef:pe,nextMessageOrderRef:ue,pendingTurnRef:ve,progressSequenceByTurnRef:ge,taskStateRef:we}){const ye={runtimeProvider:m,selectedProject:E,updateTaskState:_,applyLocalCoreThreadDetail:C,clearLocalCorePolling:T,clearReplyTimeout:M,refreshSessionsForProject:P,setBridgeError:ne,setMessages:j,setPendingPermissionRequest:F,setTyping:D,holdBlankComposerRef:be,nextMessageOrderRef:ue,pendingTurnRef:ve,progressSequenceByTurnRef:ge,taskStateRef:we},Oe={setActiveRunId:G,setActiveSessionAgentType:Q,setActiveSessionId:R,setActiveSessionKey:q,setActiveSessionName:Z},Me={setDeleteTarget:Y,setPendingSessionAction:W,setRenameDraft:K,setRenameTarget:L},Te={holdBlankComposerRef:be,lastSessionByProjectRef:pe,nextMessageOrderRef:ue,pendingTurnRef:ve,progressSequenceByTurnRef:ge,taskStateRef:we},vt={setBridgeError:ne,setMessages:j,setPendingPermissionRequest:F,setTyping:D},{handleSend:Ie,handleStopTask:Xe}=h6({activeRunId:e,activeThreadId:t,activeBridgeSessionKey:r,availableKnowledgeBases:i,brandingNewThreadLabel:l,draft:c,loadActiveThread:d,messages:f,selectedKnowledgeBaseIds:v,taskState:S,armReplyTimeout:A,reserveNextMessageOrder:N,settlePreviewMessages:z,setDraft:H,setSending:X,startLocalCoreThreadPolling:J,...ye,...Oe,...vt,...Te}),{handleCreateNew:te,handleDeleteSession:ce,handleRenameSession:Ne,openRenameModal:De}=p6({activeThreadId:t,brandingNewThreadLabel:l,deleteTarget:o,renameDraft:h,renameTarget:g,searchParams:x,selectedKnowledgeBaseIds:v,setSearchParams:I,...ye,...Oe,...Me,...vt});return{handleCreateNew:te,handleDeleteSession:ce,handleRenameSession:Ne,handleSend:Ie,handleStopTask:Xe,openRenameModal:De}}function g6(e,t){if(!t)return"";if(!e||!t.startsWith(e))return t.slice(0,Math.min(t.length,Math.max(1,Math.ceil(t.length/24))));if(e===t)return t;const r=t.length-e.length,i=r>160?14:r>80?8:r>24?4:2;return t.slice(0,Math.min(t.length,e.length+i))}function b6({activeThreadId:e,brandingReplyTimeoutLabel:t,setSelectedKnowledgeBaseIds:r,setActiveRunId:i,setActiveSessionAgentType:l,setActiveSessionId:o,setActiveSessionKey:c,setActiveSessionName:d,setBridgeError:f,setSelectedProject:h,setThreadGroups:g}){const[m,x]=w.useState([]),[v,E]=w.useState(null),[S,_]=w.useState(!1),[C,A]=w.useState("idle"),T=w.useRef(null),M=w.useRef("reply"),P=w.useRef({}),N=w.useRef(0),z=w.useRef(null),G=w.useRef(!1),Q=w.useRef({}),R=w.useRef("idle"),q=w.useRef(""),Z=w.useRef(0),ne=w.useMemo(()=>R_(m),[m]),Y=YU(C),H=XU(C),j=VU(C,S);w.useEffect(()=>{q.current=e},[e]);const F=w.useCallback((ge,we="unspecified")=>{const ye=R.current;R.current=ge,A(ge),ye!==ge&&console.info("[desktop-chat] task_state",{from:ye,to:ge,reason:we,threadId:q.current})},[]),W=w.useCallback(()=>{T.current&&(window.clearTimeout(T.current),T.current=null)},[]),K=w.useCallback((ge="reply")=>{W(),M.current=ge,T.current=window.setTimeout(()=>{_(!1),z.current=null,E(null),F("idle","reply-timeout"),f(ge==="permission_continue"?t:"Agent did not respond in time. Check AgentDock runtime logs or adjust the model/provider.")},tw)},[t,W,f,F]),L=w.useCallback(()=>{x(ge=>ge.map(we=>we.actionStatus||we.actionPending?{...we,actionPending:!1,actionStatus:void 0}:we))},[]),I=w.useCallback(ge=>{x(we=>{let ye=!1;const Oe=we.map(Me=>!Me.preview||ge&&Me.turnKey!==ge?Me:(ye=!0,{...Me,content:Me.streamTargetContent??Me.content,streamTargetContent:void 0,preview:!1,previewPlainText:!1}));return ye?Oe:we})},[]),X=w.useCallback(()=>{const ge=N.current;return N.current+=1,ge},[]),D=w.useCallback(ge=>{const we=z.current;if(we&&ge&&we.sessionKey===ge){const ye=we.userOrder+1;N.current<ye&&(N.current=ye)}return X()},[X]),J=w.useCallback(ge=>{const we=ge||crypto.randomUUID(),ye=(Q.current[we]||0)+1;return Q.current[we]=ye,`${we}-progress-${ye}`},[]),be=w.useCallback(ge=>{ge&&x(we=>{var Me;const ye=we.filter(Te=>Te.turnKey===ge&&!Te.preview);if(ye.length===0)return we;const Oe=(Me=ye[ye.length-1])==null?void 0:Me.id;return we.map(Te=>Te.turnKey!==ge||Te.preview?Te:{...Te,kind:Te.id===Oe?"final":"progress"})})},[]),pe=w.useCallback(()=>{Z.current+=1},[]),ue=w.useCallback(ge=>{P.current[ge.workspaceId]=ge.id,h(ge.workspaceId),o(ge.id),c(ge.bridgeSessionKey||""),d(ge.title),l(ge.agentType||""),i(ge.runId||""),r(ge.selectedKnowledgeBaseIds||[]),E(ge.pendingPermissionRequest||null),g(ye=>qU(ye,ge.workspaceId,T_(ge))),G.current=!1,Q.current={};const we=nw(ge.messages||[]);z.current=null,x(ye=>{const Oe=UU(ye,we);return N.current=Oe.reduce((Me,Te)=>Math.max(Me,Te.order+1),0),Oe})},[i,l,o,c,d,r,h,g,E]),ve=w.useCallback((ge,we)=>{pe();const ye=Z.current,Oe=Date.now();let Me=0,Te="";const vt=async()=>{if(!(Z.current!==ye||q.current!==ge))try{const Ie=await Vm(ge);if(Z.current!==ye||q.current!==ge)return;ue(Ie);const te=nw(Ie.messages||[]).map(Ne=>`${Ne.id}:${Ne.content}:${Ne.kind||"final"}`).join("|");Me=te===Te?Me+1:0,Te=te;const ce=c6(Ie,we,Me);if((ce==null?void 0:ce.state)==="awaiting_permission"||(ce==null?void 0:ce.state)==="awaiting_input"){W(),_(!1),z.current=null,F(ce.state,ce.reason);return}if((ce==null?void 0:ce.state)==="idle"){_(!1),E(null),F(ce.state,ce.reason);return}if(Date.now()-Oe>=tw){const Ne=Ie.messages.filter(De=>De.role!=="user"&&De.kind!=="progress").length;_(!1),E(null),F("idle","local-core-poll-timeout"),Ne<=we&&f("Agent did not respond in time. Check Local AI Core logs or adapter status.");return}window.setTimeout(()=>{vt()},1500)}catch(Ie){if(Z.current!==ye||q.current!==ge)return;_(!1),E(null),F("error","local-core-poll-error"),f(Ie instanceof Error?Ie.message:"Failed to refresh the current thread.")}};window.setTimeout(()=>{vt()},1500)},[ue,pe,W,z,f,E,F]);return w.useEffect(()=>{if(!m.some(ye=>ye.preview&&ye.previewPlainText&&typeof ye.streamTargetContent=="string"&&ye.streamTargetContent!==ye.content))return;const we=window.setInterval(()=>{x(ye=>{let Oe=!1;const Me=ye.map(Te=>!Te.preview||!Te.previewPlainText||typeof Te.streamTargetContent!="string"||Te.streamTargetContent===Te.content?Te:(Oe=!0,{...Te,content:g6(Te.content,Te.streamTargetContent)}));return Oe?Me:ye})},32);return()=>{window.clearInterval(we)}},[m]),{applyLocalCoreThreadDetail:ue,armReplyTimeout:K,clearActionStatuses:L,clearLocalCorePolling:pe,clearReplyTimeout:W,holdBlankComposerRef:G,lastSessionByProjectRef:P,messages:m,nextMessageOrderRef:N,pendingPermissionRequest:v,finalizeTurnMessages:be,nextProgressMessageId:J,pendingTurnRef:z,progressSequenceByTurnRef:Q,renderedMessages:ne,reserveAssistantMessageOrder:D,reserveNextMessageOrder:X,setMessages:x,setPendingPermissionRequest:E,settlePreviewMessages:I,setTyping:_,startLocalCoreThreadPolling:ve,taskHint:j,taskInputLocked:H,taskRunning:Y,taskState:C,taskStateRef:R,typing:S,updateTaskState:F}}function y6(){const[e,t]=_m(),[r,i]=w.useState([]),[l,o]=w.useState(""),[c,d]=w.useState([]),[f,h]=w.useState(""),[g,m]=w.useState(""),[x,v]=w.useState(""),[E,S]=w.useState(""),[_,C]=w.useState(""),[A,T]=w.useState(""),[M,P]=w.useState(""),[N,z]=w.useState([]),[G,Q]=w.useState([]),[R,q]=w.useState(null),[Z,ne]=w.useState(""),[Y,H]=w.useState(null),[j,F]=w.useState(null),[W,K]=w.useState(null),[L,I]=w.useState(!1),[X,D]=w.useState(""),J=w.useRef(0),be=w.useRef(null),pe=e.get("project")||"",ue=e.get("session")||"",ve=M_(),{applyLocalCoreThreadDetail:ge,armReplyTimeout:we,clearActionStatuses:ye,clearLocalCorePolling:Oe,clearReplyTimeout:Me,finalizeTurnMessages:Te,holdBlankComposerRef:vt,lastSessionByProjectRef:Ie,messages:Xe,nextMessageOrderRef:te,nextProgressMessageId:ce,pendingPermissionRequest:Ne,pendingTurnRef:De,progressSequenceByTurnRef:wt,renderedMessages:Xt,reserveAssistantMessageOrder:ot,reserveNextMessageOrder:Zt,setMessages:B,setPendingPermissionRequest:le,settlePreviewMessages:_e,setTyping:re,startLocalCoreThreadPolling:xe,taskHint:je,taskInputLocked:Fe,taskRunning:tt,taskState:st,taskStateRef:zt,typing:Ze,updateTaskState:Dn}=b6({activeThreadId:f,brandingReplyTimeoutLabel:ve.replyTimeoutLabel,setSelectedKnowledgeBaseIds:Q,setActiveRunId:C,setActiveSessionAgentType:S,setActiveSessionId:h,setActiveSessionKey:m,setActiveSessionName:v,setBridgeError:D,setSelectedProject:o,setThreadGroups:d}),{loading:vn,refreshRuntime:es,runtime:br,runtimeProvider:Qn,serviceRunning:Hr,showSessionKey:Nn,transportReady:$}=QU({requestedProject:pe,selectedProject:l,setSelectedProject:o,clearReplyTimeout:Me,updateTaskState:Dn,setTyping:re}),{filteredThreadGroups:fe,loadActiveThread:Ce,refreshThreadsForWorkspace:We}=n6({activeThreadId:f,requestedWorkspaceId:pe,requestedThreadId:ue,runtimeDefaultWorkspaceId:br==null?void 0:br.settings.defaultProject,runtimeProvider:Qn,searchParams:e,selectedWorkspaceId:l,serviceRunning:Hr,workspaceIds:r,threadGroups:c,threadSearch:M,setSelectedKnowledgeBaseIds:Q,setActiveRunId:C,setActiveSessionAgentType:S,setActiveSessionId:h,setActiveSessionKey:m,setActiveSessionName:v,setBridgeError:D,setMessages:B,setPendingPermissionRequest:le,setProjects:i,setSearchParams:t,setSelectedProject:o,setThreadGroups:d,setTyping:re,applyLocalCoreThreadDetail:ge,clearLocalCorePolling:Oe,clearReplyTimeout:Me,updateTaskState:Dn,holdBlankComposerRef:vt,lastSessionByProjectRef:Ie,nextMessageOrderRef:te,pendingTurnRef:De,progressSequenceByTurnRef:wt});w.useEffect(()=>{var Zn;(Zn=be.current)==null||Zn.scrollIntoView({behavior:"smooth"})},[Xt,Ze]);const Mt=w.useCallback(async()=>{try{const Zn=await VE();z(Zn.bases||[])}catch{z([])}},[Qn]);w.useEffect(()=>{Mt()},[Mt]);const Nt=w.useCallback(async Zn=>{const Un=Array.from(new Set(Zn.map(en=>String(en||"").trim()).filter(Boolean))),qt=J.current+1;if(J.current=qt,Q(Un),!(!l||!f))try{const en=Qn==="local_core"?(await No(f,Un)).knowledgeBaseIds:await rL(l,f,Un);J.current===qt&&Q(en)}catch(en){J.current===qt&&D(en instanceof Error?en.message:"Failed to save selected knowledge bases.")}},[f,Qn,l,D]),{handleBridgeAction:ze}=f6({activeAgentType:E,activeThreadId:f,activeRunId:_,activeBridgeSessionKey:g,messages:Xe,runtimeProvider:Qn,selectedWorkspaceId:l,clearActionStatuses:ye,clearLocalCorePolling:Oe,clearReplyTimeout:Me,finalizeTurnMessages:Te,nextProgressMessageId:ce,refreshThreadsForWorkspace:We,reserveAssistantMessageOrder:ot,reserveNextMessageOrder:Zt,settlePreviewMessages:_e,setActiveRunId:C,setBridgeError:D,setMessages:B,setPendingBridgeActionId:K,setTyping:re,setPendingPermissionRequest:le,startLocalCoreThreadPolling:xe,updateTaskState:Dn,armReplyTimeout:we,pendingTurnRef:De,progressSequenceByTurnRef:wt,sendAction:qE,taskStateRef:zt}),{handleCreateNew:Re,handleDeleteSession:Ge,handleRenameSession:Jt,handleSend:Ut,handleStopTask:Rr,openRenameModal:Ma}=m6({activeRunId:_,activeThreadId:f,activeBridgeSessionKey:g,availableKnowledgeBases:N,brandingNewThreadLabel:ve.newThreadLabel,deleteTarget:Y,draft:A,loadActiveThread:Ce,messages:Xe,renameDraft:Z,renameTarget:R,runtimeProvider:Qn,searchParams:e,selectedKnowledgeBaseIds:G,selectedWorkspaceId:l,taskState:st,updateTaskState:Dn,applyLocalCoreThreadDetail:ge,armReplyTimeout:we,clearLocalCorePolling:Oe,clearReplyTimeout:Me,refreshSessionsForProject:We,reserveNextMessageOrder:Zt,settlePreviewMessages:_e,setActiveRunId:C,setActiveSessionAgentType:S,setActiveSessionId:h,setActiveSessionKey:m,setActiveSessionName:v,setBridgeError:D,setDeleteTarget:H,setDraft:T,setMessages:B,setPendingPermissionRequest:le,setPendingSessionAction:F,setRenameDraft:ne,setRenameTarget:q,setSearchParams:t,setSending:I,setTyping:re,startLocalCoreThreadPolling:xe,holdBlankComposerRef:vt,lastSessionByProjectRef:Ie,nextMessageOrderRef:te,pendingTurnRef:De,progressSequenceByTurnRef:wt,taskStateRef:zt});return{activeRunId:_,activeSessionId:f,activeSessionKey:g,activeSessionName:x,bridgeError:X,branding:ve,deleteTarget:Y,draft:A,endRef:be,filteredSessionGroups:fe,handleBridgeAction:ze,handleCreateNew:Re,handleDeleteSession:Ge,handleRenameSession:Jt,handleSend:Ut,handleStopTask:Rr,availableKnowledgeBases:N,loadActiveSession:Ce,loading:vn,openRenameModal:Ma,pendingBridgeActionId:W,pendingPermissionRequest:Ne,pendingSessionAction:j,projects:r,refreshRuntime:es,renameDraft:Z,renameTarget:R,renderedMessages:Xt,runtime:br,sending:L,selectedKnowledgeBaseIds:G,serviceRunning:Hr,sessionSearch:M,selectedProject:l,setDeleteTarget:H,setDraft:T,setSelectedKnowledgeBaseIds:Nt,setRenameDraft:ne,setRenameTarget:q,setSelectedProject:o,setSessionSearch:P,showSessionKey:Nn,taskHint:je,taskInputLocked:Fe,taskRunning:tt,taskState:st,transportReady:$}}function x6(e){const t=e.match(/^\s*(?:🔧\s*)?(Tool update)\s*-\s*([^-]+?)\s*-\s*([\s\S]+?)\s*$/i);if(t){const[,i,l,o]=t,c=o.trim();if(v6(i,l.trim(),c))return null;try{const d=JSON.parse(c),f=typeof d.output=="string"?d.output:d.output??d.error??d;return{title:i,status:l.trim(),output:typeof f=="string"?f:JSON.stringify(f,null,2),label:"工具结果"}}catch{return{title:i,status:l.trim(),output:c,label:"工具结果"}}}const r=e.match(/^\s*🔧\s*(.+?)\s*$/);if(r){const i=r[1].trim();if(/^Tool update\s*-\s*running(?:\s*-\s*)?$/i.test(i))return null;const[l,...o]=i.split(":"),c=o.join(":").trim();return{title:l.trim()||"Tool call",status:"running",output:c,label:"工具调用"}}return null}function v6(e,t,r){return/^Tool update$/i.test(e.trim())&&/^running$/i.test(t.trim())&&!r.trim()}function w6(e){const t=e.trim();return/^🔧\s*Tool update\s*-\s*running(?:\s*-\s*)?$/i.test(t)}function E6({card:e}){const t=e.status.toLowerCase()==="completed";return p.jsxs("div",{className:"overflow-hidden rounded-[20px] border border-slate-200/80 bg-slate-50/95 shadow-[0_8px_22px_rgba(15,23,42,0.04)] dark:border-white/[0.07] dark:bg-[#111820] dark:shadow-none",children:[p.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-slate-200/80 px-4 py-3 dark:border-white/[0.06]",children:[p.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[p.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary dark:text-primary",children:p.jsx(mm,{size:14})}),p.jsxs("div",{className:"min-w-0",children:[p.jsx("p",{className:"truncate text-sm font-semibold text-slate-800 dark:text-slate-100",children:e.title}),p.jsxs("p",{className:"mt-0.5 flex items-center gap-1.5 text-[11px] text-slate-500 dark:text-slate-400",children:[p.jsx(L2,{size:12}),e.label]})]})]}),p.jsx("span",{className:Ke("shrink-0 rounded-full px-2.5 py-1 text-[10px] font-medium uppercase tracking-[0.12em]",t?"bg-primary/10 text-primary dark:text-primary":"bg-amber-500/10 text-amber-700 dark:text-amber-300"),children:e.status})]}),p.jsx("pre",{className:"max-h-72 overflow-auto whitespace-pre-wrap break-words px-4 py-3 font-mono text-[12px] leading-5 text-slate-700 [scrollbar-gutter:stable] dark:text-slate-200",children:e.output||"无输出"})]})}function S6(e){const t=e.split(`
477
- `).map(c=>c.trim()).filter(Boolean),r=t.findIndex(c=>c.includes("若按钮没有显示")),i=r>=0?t.slice(0,r):t,l=i[0]||"等待工具确认",o=i.slice(1).filter(c=>!c.includes("请选择一个选项继续执行"));return{title:l,bodyLines:o}}function _6(e){return/等待工具确认/.test(e)&&/allow all\s*\/\s*allow\s*\/\s*deny/i.test(e)}function k6({card:e,loading:t,onAction:r}){const i=S6(e.content);return p.jsxs("div",{className:"overflow-hidden rounded-[20px] border border-amber-200 bg-amber-50/90 shadow-[0_10px_26px_rgba(180,83,9,0.08)] dark:border-amber-400/20 dark:bg-amber-500/10 dark:shadow-none",children:[p.jsx("div",{className:"flex items-center justify-between gap-3 border-b border-amber-200/80 px-4 py-3 dark:border-amber-400/15",children:p.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[p.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-xl bg-amber-100 text-amber-700 dark:bg-amber-400/15 dark:text-amber-200",children:p.jsx(M2,{size:14})}),p.jsxs("div",{className:"min-w-0",children:[p.jsx("p",{className:"truncate text-sm font-semibold text-amber-950 dark:text-amber-50",children:i.title}),p.jsx("p",{className:"mt-0.5 text-[11px] text-amber-700/80 dark:text-amber-100/70",children:"权限响应"})]})]})}),i.bodyLines.length>0?p.jsx("div",{className:"space-y-2 px-4 py-3 text-sm leading-6 text-amber-950 dark:text-amber-50",children:i.bodyLines.map((l,o)=>p.jsx("p",{className:"break-words",children:l},`${e.id}-permission-line-${o}`))}):null,e.actionStatus?p.jsx("p",{className:"border-t border-amber-200/80 px-4 py-3 text-xs text-amber-700 dark:border-amber-400/15 dark:text-amber-100",children:e.actionStatus}):null,e.actions.length>0?p.jsx("div",{className:"flex flex-wrap gap-2 border-t border-amber-200/80 px-4 py-3 dark:border-amber-400/15",children:e.actions.flat().map(l=>p.jsx(Ae,{size:"sm",variant:"secondary",onClick:()=>r(l),disabled:!!(e.actionPending||t),loading:t,className:"rounded-full border border-amber-300 bg-white text-amber-900 hover:bg-amber-100 dark:border-amber-400/30 dark:bg-white/[0.08] dark:text-amber-50 dark:hover:bg-white/[0.12]",children:l.text||l.data},`${e.id}-${l.data||l.text}`))}):null]})}function C6(){const[e,t]=w.useState(!1),r=w.useRef(null),[i,l]=w.useState(""),[o,c]=w.useState(!1),{activeRunId:d,activeSessionId:f,activeSessionKey:h,activeSessionName:g,bridgeError:m,branding:x,deleteTarget:v,draft:E,endRef:S,filteredSessionGroups:_,handleBridgeAction:C,handleCreateNew:A,handleDeleteSession:T,handleRenameSession:M,handleSend:P,handleStopTask:N,availableKnowledgeBases:z,loadActiveSession:G,loading:Q,openRenameModal:R,pendingBridgeActionId:q,pendingPermissionRequest:Z,pendingSessionAction:ne,projects:Y,refreshRuntime:H,renameDraft:j,renameTarget:F,renderedMessages:W,runtime:K,sending:L,selectedKnowledgeBaseIds:I,serviceRunning:X,sessionSearch:D,selectedProject:J,setDeleteTarget:be,setDraft:pe,setSelectedKnowledgeBaseIds:ue,setRenameDraft:ve,setRenameTarget:ge,setSelectedProject:we,setSessionSearch:ye,showSessionKey:Oe,taskHint:Me,taskInputLocked:Te,taskRunning:vt,taskState:Ie,transportReady:Xe}=y6(),te=w.useMemo(()=>I.map(B=>{const le=z.find(_e=>_e.id===B);return{id:B,name:(le==null?void 0:le.name)||B,fileCount:(le==null?void 0:le.fileCount)||0}}),[z,I]),ce=w.useMemo(()=>{const B=i.trim().toLowerCase();return B?z.filter(le=>[le.name,le.description,le.id].join(" ").toLowerCase().includes(B)):z},[z,i]),Ne=w.useMemo(()=>{const B=new Set(I);return[...ce].sort((le,_e)=>{const re=B.has(le.id),xe=B.has(_e.id);return re!==xe?re?-1:1:le.name.localeCompare(_e.name,"zh-CN")})},[ce,I]),De=w.useMemo(()=>J?_.filter(B=>B.project===J):_,[_,J]),wt=w.useMemo(()=>J&&!Y.includes(J)?[J,...Y]:Y,[Y,J]),Xt=w.useMemo(()=>De.some(B=>B.sessions.length>0),[De]),ot=(K==null?void 0:K.phase)==="starting",Zt=I.length;return w.useEffect(()=>{const B=le=>{var _e;(_e=r.current)!=null&&_e.contains(le.target)||t(!1)};return e&&document.addEventListener("mousedown",B),()=>{document.removeEventListener("mousedown",B)}},[e]),w.useEffect(()=>{if(!e)return;const B=window.requestAnimationFrame(()=>{var _e;const le=(_e=r.current)==null?void 0:_e.querySelector("input");le instanceof HTMLInputElement&&le.focus()});return()=>window.cancelAnimationFrame(B)},[e]),Q?p.jsx("div",{className:"flex h-64 items-center justify-center text-sm text-slate-500 animate-pulse",children:"正在加载桌面对话…"}):p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"relative h-full min-h-0 overflow-hidden border-slate-200/80 bg-white shadow-[0_16px_40px_rgba(15,23,42,0.06)] animate-fade-in dark:border-white/[0.06] dark:bg-[#0b0f14] dark:shadow-[0_20px_70px_rgba(0,0,0,0.28)] md:rounded-[28px] md:border",children:p.jsxs("div",{className:"grid h-full min-h-0 grid-cols-1 md:grid-cols-[288px_minmax(0,1fr)]",children:[p.jsxs("aside",{className:Ke("min-h-0 flex-col border-r border-slate-200/80 bg-[linear-gradient(180deg,#fbfcfe_0%,#f5f7fb_100%)] dark:border-white/[0.06] dark:bg-[linear-gradient(180deg,#10151c_0%,#0c1016_100%)]",o?"flex":"hidden md:flex","absolute inset-0 z-30 md:static md:z-auto"),children:[p.jsxs("div",{className:"border-b border-slate-200/80 px-4 py-4 dark:border-white/[0.06]",children:[p.jsxs("div",{className:"flex items-start justify-between gap-3",children:[p.jsxs("div",{className:"min-w-0",children:[p.jsx("p",{className:"text-[11px] font-medium tracking-[0.18em] text-slate-400 dark:text-slate-500",children:"会话导航"}),p.jsx("h2",{className:"mt-2 text-[1.7rem] font-semibold leading-tight text-slate-900 dark:text-white",children:x.chatHeading})]}),p.jsx(Ae,{size:"sm",variant:"ghost",onClick:()=>void H(),className:"rounded-full border border-slate-200 bg-white text-slate-500 hover:bg-slate-100 dark:border-white/[0.08] dark:bg-white/[0.04] dark:text-slate-300 dark:hover:bg-white/[0.08]",children:p.jsx(Lw,{size:14})}),p.jsx(Ae,{size:"sm",variant:"ghost",onClick:()=>c(!1),className:"rounded-full border border-slate-200 bg-white text-slate-500 hover:bg-slate-100 dark:border-white/[0.08] dark:bg-white/[0.04] dark:text-slate-300 dark:hover:bg-white/[0.08] md:hidden",children:p.jsx(Np,{size:14})})]}),p.jsxs("div",{className:"mt-4 space-y-3",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx("label",{className:"block text-[11px] font-medium tracking-[0.18em] text-slate-400 dark:text-slate-500",children:x.scopeLabel}),p.jsxs("select",{value:J,onChange:B=>we(B.target.value),"data-testid":"desktop-chat-project-select",className:"w-full rounded-2xl border border-slate-200 bg-white px-3 py-2.5 text-sm text-slate-900 outline-none transition focus:border-primary/50 focus:ring-2 focus:ring-primary/15 dark:border-white/[0.08] dark:bg-[#0b1016] dark:text-white",children:[p.jsx("option",{value:"",children:x.scopeSelectPlaceholder}),wt.map(B=>p.jsx("option",{value:B,children:B},B))]})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs(Ae,{size:"md",variant:"secondary",onClick:()=>void A(),"data-testid":"desktop-chat-new-chat",className:"h-11 flex-1 rounded-2xl border border-slate-200 bg-white text-slate-700 hover:bg-slate-100 dark:border-white/[0.08] dark:bg-white/[0.05] dark:text-slate-100 dark:hover:bg-white/[0.09]",children:[p.jsx(J0,{size:15}),x.newThreadLabel]}),!X||ot?p.jsx(Ae,{size:"md",onClick:()=>void eL().then(H),disabled:ot||X,"data-testid":"desktop-chat-start-service",className:"h-11 shrink-0 rounded-2xl px-3.5",children:ot?x.startingRuntimeLabel:x.startRuntimeLabel}):null]}),p.jsxs("div",{className:"relative",children:[p.jsx(Zu,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-400 dark:text-slate-500"}),p.jsx(yt,{value:D,onChange:B=>ye(B.target.value),placeholder:x.searchPlaceholder,"data-testid":"desktop-chat-session-search",className:"h-11 rounded-2xl border-slate-200 bg-white pl-9 text-slate-900 placeholder:text-slate-400 dark:border-white/[0.08] dark:bg-[#0b1016] dark:text-white dark:placeholder:text-slate-500"})]}),p.jsx("div",{className:"flex items-center justify-between gap-3 rounded-2xl border border-slate-200/80 bg-white/85 px-3 py-2 dark:border-white/[0.06] dark:bg-white/[0.03]",children:p.jsxs("span",{className:"inline-flex items-center gap-2 text-xs font-medium text-slate-600 dark:text-slate-300",children:[p.jsx(qs,{size:7,className:Ke("fill-current",X?"text-primary":"text-slate-300 dark:text-slate-500")}),X?"服务在线":ot?"服务启动中":"服务未启动"]})})]}),K!=null&&K.service.lastError?p.jsx("div",{className:"mt-3 rounded-2xl border border-red-500/20 bg-red-50 px-3 py-2 text-xs text-red-600 dark:bg-red-500/10 dark:text-red-200",children:K.service.lastError}):null,K!=null&&K.pendingRestart?p.jsx("div",{className:"mt-3 rounded-2xl border border-amber-500/20 bg-amber-50 px-3 py-2 text-xs text-amber-700 dark:bg-amber-500/10 dark:text-amber-200",children:x.pendingRestartLabel}):null]}),p.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-3 pb-24 pt-3 [scrollbar-gutter:stable] md:pb-3",children:!J&&!Xt?p.jsxs("div",{className:"rounded-2xl border border-dashed border-slate-200/80 bg-white/70 px-4 py-6 text-center dark:border-white/[0.07] dark:bg-white/[0.02]",children:[p.jsx("p",{className:"text-sm font-medium text-slate-700 dark:text-slate-200",children:"先选择一个项目"}),p.jsx("p",{className:"mt-2 text-xs leading-5 text-slate-500 dark:text-slate-400",children:"选择项目后展示对应会话列表。"})]}):Xt?p.jsx("div",{className:"space-y-4",children:De.map(B=>p.jsxs("section",{className:"space-y-2",children:[!J&&B.sessions.length>0?p.jsxs("div",{"data-testid":"desktop-chat-session-group","data-project":B.project,className:"flex items-center justify-between px-2 pt-1",children:[p.jsx("p",{className:"text-[11px] font-medium tracking-[0.08em] text-slate-400 dark:text-slate-500",children:B.project}),p.jsxs("p",{className:"text-[10px] text-slate-400 dark:text-slate-500",children:[B.sessions.length," ",x.collectionLabel]})]}):null,B.sessions.map(le=>p.jsx("div",{"data-testid":"desktop-chat-session-row","data-session-id":le.id,"data-project":B.project,role:"button",tabIndex:0,onClick:()=>{G(B.project,le.id),c(!1)},onKeyDown:_e=>{(_e.key==="Enter"||_e.key===" ")&&(_e.preventDefault(),G(B.project,le.id),c(!1))},className:Ke("group relative overflow-hidden rounded-2xl border px-4 py-3 text-left transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-primary/20",le.id===f?"border-primary/20 bg-primary/10 shadow-[inset_3px_0_0_0_rgba(0,122,255,0.9)] dark:border-primary/25 dark:bg-primary/10":"border-transparent bg-white/70 hover:border-slate-200 hover:bg-white dark:bg-white/[0.03] dark:hover:border-white/[0.08] dark:hover:bg-white/[0.05]"),children:p.jsxs("div",{className:"flex items-start justify-between gap-3",children:[p.jsxs("div",{"data-testid":"desktop-chat-session-open","data-session-id":le.id,"data-project":B.project,className:"min-w-0 flex-1",children:[p.jsx("div",{className:"flex items-center gap-2",children:p.jsx("span",{className:"truncate text-sm font-medium text-slate-900 dark:text-white",children:le.name})}),p.jsx("p",{className:"mt-1 text-[11px] text-slate-400 dark:text-slate-500",children:__(le.updatedAt||le.createdAt)}),le.excerpt?p.jsx("p",{className:"mt-2 line-clamp-2 text-[11px] leading-5 text-slate-500 dark:text-slate-400",children:le.excerpt.replace(/\n/g," ")}):null,Oe&&le.bridgeSessionKey?p.jsx("p",{className:"mt-2 truncate text-[11px] text-slate-400 dark:text-slate-500",children:le.bridgeSessionKey}):null]}),p.jsxs("div",{className:"flex items-center gap-1 opacity-0 transition-opacity duration-200 group-hover:opacity-100 focus-within:opacity-100",children:[p.jsx(Ae,{size:"sm",variant:"ghost",onClick:_e=>{_e.stopPropagation(),R(B.project,le)},"data-testid":"desktop-chat-session-rename","data-session-id":le.id,"data-project":B.project,className:"text-slate-400 hover:bg-slate-100 hover:text-slate-900 dark:hover:bg-white/[0.08] dark:hover:text-white",children:p.jsx(wo,{size:14})}),p.jsx(Ae,{size:"sm",variant:"ghost",className:"text-red-400 hover:bg-red-50 hover:text-red-600 dark:hover:bg-red-500/10 dark:hover:text-red-200","data-testid":"desktop-chat-session-delete","data-session-id":le.id,"data-project":B.project,onClick:_e=>{_e.stopPropagation(),be({project:B.project,id:le.id,name:le.name})},children:p.jsx(ta,{size:14})})]})]})},le.id))]},B.project))}):p.jsxs("div",{className:"rounded-2xl border border-dashed border-slate-200/80 bg-white/70 px-4 py-6 text-center dark:border-white/[0.07] dark:bg-white/[0.02]",children:[p.jsx("p",{className:"text-sm font-medium text-slate-700 dark:text-slate-200",children:D.trim()?"没有匹配的会话":"当前还没有桌面会话"}),p.jsx("p",{className:"mt-2 text-xs leading-5 text-slate-500 dark:text-slate-400",children:D.trim()?"换个关键词试试。":"发送第一条消息后,这里会出现新的会话记录。"})]})})]}),p.jsxs("section",{className:"flex min-h-0 flex-col bg-[linear-gradient(180deg,#ffffff_0%,#fbfcfe_100%)] dark:bg-[linear-gradient(180deg,#0d1218_0%,#0a0f15_100%)]",children:[p.jsxs("div",{className:"border-b border-slate-200/80 px-4 py-3 dark:border-white/[0.06] sm:px-6 sm:py-4",children:[p.jsxs("div",{className:"flex items-start gap-3",children:[p.jsx(Ae,{size:"sm",variant:"secondary",onClick:()=>c(!0),className:"mt-0.5 h-9 w-9 shrink-0 rounded-xl px-0 md:hidden","aria-label":"Open sessions",children:p.jsx(d2,{size:16})}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsx("p",{className:"text-[11px] font-medium tracking-[0.16em] text-slate-400 dark:text-slate-500",children:"当前会话"}),p.jsx("h2",{className:"mt-1 truncate text-2xl font-semibold leading-tight text-slate-900 dark:text-white sm:mt-2 sm:text-[2rem] sm:leading-none","data-testid":"desktop-chat-active-title",children:g||x.activeConversationFallback})]})]}),p.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2 text-xs text-slate-500 dark:text-slate-400",children:[J?p.jsx("span",{className:"inline-flex items-center rounded-full bg-slate-100 px-2.5 py-1 text-[11px] text-slate-600 dark:bg-white/[0.05] dark:text-slate-300",children:J}):null,p.jsx("span",{className:"inline-flex items-center gap-1 rounded-full bg-slate-100 px-2.5 py-1 text-[10px] uppercase tracking-[0.18em] text-slate-500 dark:bg-white/[0.05] dark:text-slate-400",children:$U(K==null?void 0:K.phase)}),Xe?p.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-primary/10 px-2.5 py-1 text-primary dark:text-primary",children:[p.jsx(qs,{size:6,className:"fill-current"})," ",x.runtimeOnlineLabel]}):p.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-slate-100 px-2.5 py-1 text-slate-500 dark:bg-white/[0.05] dark:text-slate-400",children:[p.jsx(Cp,{size:12})," ",x.runtimeOfflineLabel]}),Oe&&h?p.jsx("span",{className:"truncate text-[11px] text-slate-400 dark:text-slate-500",children:h}):null]})]}),p.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-4 [scrollbar-gutter:stable] sm:px-6 sm:py-5",children:[W.length===0?p.jsx("div",{className:"flex h-full min-h-[18rem] items-center justify-center",children:p.jsxs("div",{className:"w-full max-w-2xl rounded-3xl border border-slate-200/80 bg-white px-5 py-8 text-center shadow-[0_10px_30px_rgba(15,23,42,0.04)] dark:border-white/[0.06] dark:bg-white/[0.03] dark:shadow-none sm:rounded-[28px] sm:px-8 sm:py-10",children:[p.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-2xl bg-primary/10 text-primary",children:p.jsx(J0,{size:22})}),p.jsx("h3",{className:"mt-4 text-lg font-semibold text-slate-900 dark:text-white sm:text-xl",children:"开始一段新的桌面对话"}),p.jsx("p",{className:"mx-auto mt-3 max-w-xl text-sm leading-6 text-slate-500 dark:text-slate-400",children:J?`当前项目是 ${J}。直接提问即可创建会话并开始对话。`:"先在左侧选择项目,然后直接输入你的问题。"}),p.jsx("div",{className:"mt-4 flex flex-wrap justify-center gap-2",children:te.length>0?te.map(B=>p.jsx("span",{className:"rounded-full bg-primary/10 px-3 py-1 text-xs text-primary dark:bg-primary/10 dark:text-primary",children:B.name},B.id)):p.jsx("span",{className:"rounded-full bg-slate-100 px-3 py-1 text-xs text-slate-500 dark:bg-white/[0.05] dark:text-slate-400",children:"当前未限制知识库范围"})})]})}):p.jsx("div",{className:"space-y-5",children:W.map(B=>{if(B.kind==="progress"&&w6(B.content))return null;const le=B.role==="user",_e=B.role==="system",re=!le&&!_e&&B.kind==="progress",xe=(Z==null?void 0:Z.id)===B.id?Z:null,je=!le&&(xe||(B.actionMode==="permission"&&B.actionInteractive||_6(B.content)?{id:B.id,content:B.content,actions:B.actions||[],actionReplyCtx:B.actionReplyCtx,actionPending:B.actionPending,actionStatus:B.actionStatus,actionMode:"permission",actionInteractive:!0}:null)),Fe=!le&&!je?x6(B.content):null,tt=!!Fe;return p.jsxs("div",{className:Ke("flex gap-2 sm:gap-3",le?"justify-end":"justify-start"),children:[le?null:p.jsx("div",{className:Ke("mt-1 flex shrink-0 items-center justify-center rounded-full text-slate-400 dark:text-slate-500",_e?"h-7 w-7 bg-amber-100 text-amber-600 dark:bg-amber-500/12 dark:text-amber-300":re?"h-6 w-6 bg-slate-100 dark:bg-white/[0.04]":"h-8 w-8 bg-slate-100 dark:bg-white/[0.06]"),children:_e?p.jsx(vo,{size:14}):re?p.jsx(qs,{size:7,className:"fill-current"}):p.jsx(Wu,{size:14})}),p.jsx("div",{"data-testid":"desktop-chat-message","data-role":B.role,"data-kind":B.kind||"final","data-order":String(B.order),"data-timestamp":B.timestamp||"",className:Ke("transition-all",le?"max-w-[calc(100%-2.25rem)] sm:max-w-[72%]":tt?"max-w-[calc(100%-2.25rem)] sm:max-w-[86%]":re?"max-w-[calc(100%-2.25rem)] sm:max-w-[76%]":"max-w-[calc(100%-2.25rem)] sm:max-w-[84%]"),children:p.jsxs("div",{className:Ke("rounded-[22px] px-4 py-3 text-sm",le?"chat-user-glass rounded-br-md text-slate-950 dark:text-slate-50":_e?"rounded-bl-md border border-amber-200/80 bg-amber-50 text-amber-900 shadow-[0_6px_18px_rgba(15,23,42,0.03)] dark:border-amber-400/20 dark:bg-amber-500/10 dark:text-amber-100 dark:shadow-none":re?"rounded-bl-lg bg-slate-100/80 text-[13px] leading-6 text-slate-500 dark:bg-white/[0.04] dark:text-slate-400":"rounded-bl-md border border-slate-200/80 bg-white text-slate-800 shadow-[0_6px_18px_rgba(15,23,42,0.04)] dark:border-white/[0.06] dark:bg-white/[0.04] dark:text-slate-100 dark:shadow-none",tt&&"bg-transparent p-0 shadow-none dark:bg-transparent"),children:[p.jsxs("div",{className:Ke("mb-2 flex items-center gap-2 text-[10px]",le?"justify-end text-slate-600 dark:text-white/55":"text-slate-400 dark:text-slate-500"),children:[_e?p.jsx("span",{className:"tracking-[0.16em] text-amber-600 dark:text-amber-300",children:"系统"}):null,re?p.jsx("span",{className:"tracking-[0.16em] text-amber-500 dark:text-amber-300",children:tt?"工具":"过程"}):null,rw(B.timestamp)?p.jsx("span",{"data-testid":"desktop-chat-message-timestamp",children:rw(B.timestamp)}):null]}),je?p.jsx(k6,{card:je,loading:q===je.id,onAction:st=>void C(je,st)}):!le&&B.preview&&B.previewPlainText?p.jsx("div",{className:"whitespace-pre-wrap break-words text-[13px] leading-6 text-inherit",children:B.content}):Fe?p.jsx(E6,{card:Fe}):p.jsx(mg,{content:B.content,isUser:le}),!je&&!le&&B.actions&&B.actions.length>0?p.jsx("div",{className:"mt-4 space-y-2",children:B.actions.map((st,zt)=>p.jsx("div",{className:"flex flex-wrap gap-2",children:st.map(Ze=>p.jsx(Ae,{size:"sm",variant:String(Ze.data||"").includes("deny")?"danger":"secondary",onClick:()=>void C(B,Ze),disabled:!!(B.actionPending||q),loading:q===B.id,"data-testid":"desktop-chat-action-button",className:"rounded-full",children:Ze.text||Ze.data},`${B.id}-${Ze.data||Ze.text}`))},`${B.id}-actions-${zt}`))}):null,!le&&B.actionStatus?p.jsx("p",{className:Ke("mt-3 text-xs",B.actionInteractive?"text-slate-500 dark:text-slate-400":"text-amber-700 dark:text-amber-200"),"data-testid":"desktop-chat-action-status",children:B.actionStatus}):null,B.preview?p.jsx("p",{className:"mt-2 text-[10px] uppercase tracking-[0.18em] text-primary dark:text-primary",children:"实时预览"}):null]})}),le?p.jsx("div",{className:"mt-1 flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-slate-100 dark:bg-white/[0.08] sm:h-8 sm:w-8",children:p.jsx(Ju,{size:14,className:"text-slate-500 dark:text-slate-300"})}):null]},B.id)})}),Me?p.jsxs("div",{className:"mt-5 flex items-center gap-2 text-sm text-slate-400","data-testid":"desktop-chat-task-hint",children:[p.jsx(qs,{size:8,className:"fill-current animate-pulse"})," ",Me]}):null,m?p.jsx("div",{className:"mt-4 rounded-2xl border border-amber-400/20 bg-amber-50 px-3 py-2 text-sm text-amber-800 dark:bg-amber-500/10 dark:text-amber-100","data-testid":"desktop-chat-bridge-error",children:m}):null,p.jsx("div",{ref:S})]}),p.jsx("div",{className:"border-t border-slate-200/80 px-3 py-3 dark:border-white/[0.06] sm:px-6",children:p.jsxs("div",{className:"rounded-3xl border border-slate-200/80 bg-white p-2 shadow-[0_8px_24px_rgba(15,23,42,0.05)] dark:border-white/[0.08] dark:bg-[#0f151c] dark:shadow-[0_12px_28px_rgba(0,0,0,0.20)] sm:rounded-[24px] sm:p-2.5",children:[p.jsxs("div",{className:"relative",ref:r,children:[p.jsx("div",{className:"rounded-2xl border border-slate-200 bg-slate-50/80 px-3 py-1.5 dark:border-white/[0.06] dark:bg-white/[0.03]",children:p.jsxs("div",{className:"flex flex-wrap items-center gap-2 sm:flex-nowrap",children:[p.jsx("p",{className:"shrink-0 text-[11px] font-medium text-slate-500 dark:text-slate-400",children:"知识库范围"}),p.jsxs(Ae,{size:"sm",variant:"secondary",disabled:!J,onClick:()=>t(B=>!B),"data-testid":"desktop-chat-knowledge-base-toggle",className:"shrink-0 rounded-full border border-slate-200 bg-white text-slate-700 hover:bg-slate-100 dark:border-white/[0.08] dark:bg-white/[0.06] dark:text-slate-100 dark:hover:bg-white/[0.1]",children:[p.jsx(DN,{size:13}),Zt>0?"调整知识库":"选择知识库"]}),p.jsx("div",{className:"order-3 flex min-w-full flex-1 items-center gap-2 overflow-x-auto whitespace-nowrap [scrollbar-gutter:stable] sm:order-none sm:min-w-0",children:te.length===0?p.jsx("span",{className:"text-xs text-slate-400",children:J?"当前未限制知识库范围":"选择项目后可设置知识库范围"}):te.map(B=>p.jsxs("span",{className:"inline-flex shrink-0 items-center gap-2 rounded-full border border-slate-200 bg-white px-2.5 py-1 text-xs text-slate-700 dark:border-white/[0.08] dark:bg-white/[0.06] dark:text-slate-100",children:[p.jsx("span",{className:"max-w-[10rem] truncate",children:B.name}),B.fileCount>0?p.jsxs("span",{className:"text-[10px] text-slate-500",children:[B.fileCount," 文档"]}):null,p.jsx("button",{type:"button",onClick:()=>void ue(I.filter(le=>le!==B.id)),className:"text-slate-500 transition-colors hover:text-slate-900 dark:hover:text-white","data-testid":"desktop-chat-knowledge-base-remove",children:p.jsx(Np,{size:12})})]},B.id))}),p.jsx("p",{className:"ml-auto shrink-0 text-[11px] text-slate-400 sm:ml-0",children:J?Zt>0?`已选 ${Zt} 个`:"未限制":"请先选项目"})]})}),e?p.jsxs("div",{className:"animate-float-in absolute bottom-full left-0 right-0 z-20 mb-3 max-h-[70dvh] overflow-hidden rounded-[24px] border border-slate-200 bg-white p-3 shadow-[0_22px_50px_rgba(15,23,42,0.12)] dark:border-white/[0.08] dark:bg-[#0c1117] dark:shadow-[0_28px_80px_rgba(0,0,0,0.40)]",children:[p.jsxs("div",{className:"flex items-center justify-between gap-3",children:[p.jsxs("div",{children:[p.jsx("p",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:"选择知识库"}),p.jsx("p",{className:"text-[11px] text-slate-400",children:"已选项排在前面,方便快速确认范围。"})]}),Zt>0?p.jsx("button",{type:"button",onClick:()=>void ue([]),className:"text-xs text-slate-400 transition-colors hover:text-slate-900 dark:hover:text-white",children:"清空"}):null]}),p.jsx(yt,{value:i,onChange:B=>l(B.target.value),placeholder:"搜索知识库",className:"mt-3 rounded-2xl border-slate-200 bg-white text-slate-900 placeholder:text-slate-400 dark:border-white/[0.08] dark:bg-white/[0.04] dark:text-white dark:placeholder:text-slate-500"}),p.jsx("div",{className:"mt-3 max-h-64 space-y-2 overflow-y-auto pr-2 [scrollbar-gutter:stable]",children:Ne.length===0?p.jsx("div",{className:"rounded-xl border border-dashed border-slate-200 px-3 py-4 text-center text-xs text-slate-500 dark:border-white/[0.08]",children:"没有匹配的知识库"}):Ne.map(B=>{const le=I.includes(B.id);return p.jsxs("button",{type:"button",onClick:()=>void ue(le?I.filter(_e=>_e!==B.id):[...I,B.id]),"data-testid":"desktop-chat-knowledge-base-select",className:Ke("flex w-full items-start gap-3 rounded-xl border px-3 py-3 text-left transition-all duration-200",le?"border-primary/25 bg-primary/10 dark:border-primary/30 dark:bg-primary/10":"border-slate-200 bg-white hover:border-slate-300 hover:bg-slate-50 dark:border-white/[0.06] dark:bg-white/[0.03] dark:hover:border-white/[0.12] dark:hover:bg-white/[0.05]"),children:[p.jsx("span",{className:Ke("mt-0.5 inline-flex h-5 w-5 items-center justify-center rounded-full border text-[10px]",le?"border-primary bg-primary text-white":"border-slate-300 text-transparent dark:border-white/[0.12]"),children:p.jsx(vo,{size:12})}),p.jsxs("span",{className:"min-w-0 flex-1",children:[p.jsx("span",{className:"block truncate text-sm font-medium text-slate-900 dark:text-white",children:B.name}),p.jsxs("span",{className:"mt-1 block text-[11px] text-slate-400",children:[B.fileCount," 文档",B.description?` · ${B.description}`:""]})]})]},B.id)})})]}):null]}),p.jsxs("div",{className:"mt-2.5",children:[p.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-end gap-2 sm:gap-3",children:[p.jsx(gd,{"data-testid":"desktop-chat-input",value:E,onChange:B=>pe(B.target.value),onKeyDown:B=>{B.key==="Enter"&&!B.shiftKey&&!Te&&(B.preventDefault(),P())},rows:3,placeholder:X?Xe?Ie==="awaiting_input"?"Agent 正在等待你的回复,可直接继续输入。":Te?"任务正在运行,点击停止可中断当前执行。":x.sendPlaceholder:x.waitingRuntimePlaceholder:x.startFirstPlaceholder,disabled:!X||!Xe||L||!J||Te,className:"min-h-[76px] rounded-[20px] border-slate-200 bg-white px-3 py-2.5 text-[15px] leading-6 text-slate-900 placeholder:text-slate-400 dark:border-white/[0.08] dark:bg-[#090d12] dark:text-white dark:placeholder:text-slate-500 sm:min-h-[94px] sm:px-4 sm:py-3"}),vt?p.jsxs(Ae,{variant:"danger",onClick:()=>void N(),disabled:!h&&!d||Ie==="stopping","data-testid":"desktop-chat-stop-task",className:"h-12 min-w-12 rounded-[20px] bg-red-50 px-3 text-red-600 hover:bg-red-100 dark:bg-red-500/12 dark:text-red-200 dark:hover:bg-red-500/18 sm:h-14 sm:min-w-[124px] sm:px-5",children:[p.jsx(Fs,{size:16,className:"animate-spin"}),p.jsx("span",{className:"hidden sm:inline",children:Ie==="stopping"?"停止中":"停止任务"})]}):p.jsx(Ae,{onClick:()=>void P(),disabled:!E.trim()||!X||!Xe||L||!J,"data-testid":"desktop-chat-send",className:"h-12 w-12 rounded-full px-0 shadow-none sm:h-14 sm:w-14",children:p.jsx(pm,{size:18})})]}),p.jsxs("div",{className:"mt-1.5 hidden items-center justify-between px-1 pr-[4.5rem] text-[11px] text-slate-500 dark:text-slate-400 sm:flex",children:[p.jsx("span",{children:"Enter 发送,Shift + Enter 换行"}),p.jsx("span",{children:J?"范围会随当前线程保存":"请先选择项目"})]})]})]})})]})]})}),p.jsx(Pr,{open:!!F,onClose:()=>ge(null),title:"重命名会话",children:p.jsxs("div",{className:"space-y-4",children:[p.jsx(yt,{value:j,onChange:B=>ve(B.target.value),onInput:B=>ve(B.target.value),placeholder:"输入会话名称","data-testid":"desktop-chat-rename-input"}),p.jsxs("div",{className:"flex justify-end gap-2",children:[p.jsx(Ae,{variant:"secondary",onClick:()=>ge(null),"data-testid":"desktop-chat-rename-cancel",children:"取消"}),p.jsx(Ae,{onClick:()=>void M(),loading:ne==="rename",disabled:!j.trim(),"data-testid":"desktop-chat-rename-save",children:"保存名称"})]})]})}),p.jsx(Pr,{open:!!v,onClose:()=>be(null),title:"删除会话",children:p.jsxs("div",{className:"space-y-4",children:[p.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:["确定删除 ",p.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:v==null?void 0:v.name})," 吗?这会移除该会话的本地保存记录。"]}),p.jsxs("div",{className:"flex justify-end gap-2",children:[p.jsx(Ae,{variant:"secondary",onClick:()=>be(null),"data-testid":"desktop-chat-delete-cancel",children:"取消"}),p.jsx(Ae,{variant:"danger",onClick:()=>void T(),loading:ne==="delete","data-testid":"desktop-chat-delete-confirm",children:"删除会话"})]})]})})]})}const N6=1500,T6=9e4;function A6(e){return String(e||"").startsWith("web:")}function R6(e){return(e||[]).map((t,r)=>({id:`${t.timestamp||r}-${t.role}-${r}`,role:t.role==="user"?"user":"assistant",content:t.content,timestamp:t.timestamp,kind:t.kind}))}function O6(e){return e.map(t=>`${t.role}:${t.kind||"final"}:${t.timestamp||""}:${t.content}`).join(`
478
- `)}function M6(e){return e.filter(t=>t.role!=="user").length}function D6(e,t){var r;return(r=e.last_message)!=null&&r.content?e.last_message.content.replace(/\n/g," "):t("sessions.noMessages")}function L_(e){return(e instanceof Error?e.message:String(e||"")).trim().toLowerCase().includes("no active session found")}function j6(e,t){return(e instanceof Error?e.message:String(e||"")).trim().toLowerCase()?L_(e)?t("sessions.sessionUnavailable"):e instanceof Error?e.message:t("sessions.sendFailed"):t("sessions.sendFailed")}function L6(){const{t:e}=Fr(),[t,r]=_m(),[i,l]=w.useState([]),[o,c]=w.useState({}),[d,f]=w.useState(t.get("project")||""),[h,g]=w.useState([]),[m,x]=w.useState(null),[v,E]=w.useState([]),[S,_]=w.useState(""),[C,A]=w.useState(""),[T,M]=w.useState(!0),[P,N]=w.useState(!1),[z,G]=w.useState(!1),[Q,R]=w.useState(!1),[q,Z]=w.useState("idle"),[ne,Y]=w.useState(""),[H,j]=w.useState(null),[F,W]=w.useState(""),[K,L]=w.useState(null),[I,X]=w.useState(null),D=w.useRef(null),J=w.useRef({project:"",sessionId:""}),be=w.useRef(null),pe=w.useRef(null),ue=t.get("project")||"",ve=t.get("session")||"",ge=w.useMemo(()=>new Set(Object.values(o)),[o]),we=w.useMemo(()=>{const re=S.trim().toLowerCase();return re?h.filter(xe=>NU(xe,re)):h},[S,h]),ye=!!(m&&(m.live||ge.has(m.id))),Oe=!!(d&&ye&&C.trim()&&!Q&&q!=="sending"&&q!=="activating"&&q!=="polling"),Me=w.useCallback((re,xe)=>{const je=new URLSearchParams;re&&je.set("project",re),xe&&je.set("session",xe),r(je,{replace:!0})},[r]),Te=w.useCallback((re="idle")=>{be.current&&(window.clearTimeout(be.current),be.current=null),pe.current=null,Z(re)},[]),vt=w.useCallback(re=>{g(xe=>{const je=xe.some(Fe=>Fe.id===re.id)?xe.map(Fe=>Fe.id===re.id?{...Fe,...re}:Fe):[...xe,re];return ew(je)})},[]),Ie=w.useCallback(async()=>{M(!0);try{const{projects:re}=await bd();l(re||[])}finally{M(!1)}},[]),Xe=w.useCallback(async re=>{if(!re)return g([]),c({}),[];N(!0);try{const{sessions:xe,active_keys:je}=await D_(re),Fe=ew((xe||[]).filter(tt=>!A6(tt.session_key)));return c(je||{}),J.current.project===re&&g(Fe),Fe}finally{N(!1)}},[]),te=w.useCallback(async(re,xe,je)=>{if(!re||!xe)return x(null),E([]),null;je!=null&&je.silent||G(!0);try{const Fe=await j_(re,xe,200);return J.current.project!==re||J.current.sessionId!==xe||(vt(Fe),x({id:Fe.id,project:re,sessionKey:Fe.session_key,name:Fe.name||Xr(Fe),live:Fe.live,isDraft:!1,detail:Fe}),E(R6(Fe.history)),Y("")),Fe}catch(Fe){return J.current.project===re&&J.current.sessionId===xe&&Y(Fe instanceof Error?Fe.message:e("sessions.loadFailed")),null}finally{je!=null&&je.silent||G(!1)}},[vt,e]),ce=w.useCallback(re=>{pe.current=re,be.current=window.setTimeout(async()=>{const xe=pe.current;if(!xe)return;if(Date.now()-xe.startedAt>=T6){Te("timed_out"),Y(e("sessions.pollTimeout")),await Xe(xe.project);return}const je=await te(xe.project,xe.sessionId,{silent:!0});if(!je||!pe.current){Te(),await Xe(xe.project);return}if(J.current.project!==xe.project||J.current.sessionId!==xe.sessionId){Te();return}const Fe=O6(je.history),tt=M6(je.history)>xe.assistantCountBefore,st=tt&&Fe===xe.lastSignature?xe.stableCount+1:0,zt={...xe,lastSignature:Fe,stableCount:st};if(tt&&st>=2){Te(),await Xe(xe.project);return}Z("polling"),ce(zt)},N6)},[te,Xe,Te,e]),Ne=w.useCallback((re,xe,je)=>{Te(),Z("polling"),ce({project:re,sessionId:xe,assistantCountBefore:je,stableCount:0,lastSignature:"",startedAt:Date.now()})},[ce,Te]),De=w.useCallback(async re=>{if(Te(),f(re),_(""),Y(""),A(""),!re){J.current={project:"",sessionId:""},x(null),E([]),g([]),Me("");return}J.current={project:re,sessionId:""},x(null),E([]),Me(re),await Xe(re)},[Xe,Te,Me]),wt=w.useCallback(async re=>{if(re.isDraft||re.live||!re.id)return re;Z("activating");try{await e6(re.project,{session_key:re.sessionKey,session_id:re.id}),await Xe(re.project);const xe=await te(re.project,re.id,{silent:!0}),je={...re,live:(xe==null?void 0:xe.live)??!0,isDraft:!1,detail:xe??re.detail,name:(xe==null?void 0:xe.name)||re.name};return x(je),je}finally{Z("idle")}},[te,Xe]),Xt=w.useCallback(async(re,xe)=>{Te(),Y(""),J.current={project:re,sessionId:xe.id},f(re),Me(re,xe.id),x({id:xe.id,project:re,sessionKey:xe.session_key,name:Xr(xe),live:xe.live,isDraft:!1,detail:null});const je=await te(re,xe.id);je&&!je.live&&await wt({id:je.id,project:re,sessionKey:je.session_key,name:je.name||Xr(je),live:je.live,isDraft:!1,detail:je})},[wt,te,Te,Me]),ot=w.useCallback(async()=>{Te(),d&&(await Xe(d),m!=null&&m.id&&(J.current={project:d,sessionId:m.id},await te(d,m.id)))},[m==null?void 0:m.id,te,Xe,d,Te]),Zt=w.useCallback(async()=>{if(!C.trim()||!d)return;if(!ye){Y(e("sessions.sessionUnavailable"));return}const re=C.trim(),xe=`${crypto.randomUUID()}-user`,je={id:xe,role:"user",content:re,timestamp:new Date().toISOString()};A(""),R(!0),Z("sending"),Y("");try{const Fe=m||we[0];if(!Fe)throw new Error(e("sessions.noAvailableChatTarget"));let tt=m&&m.id===Fe.id?m:{id:Fe.id,project:d,sessionKey:"session_key"in Fe?Fe.session_key:Fe.sessionKey,name:"session_key"in Fe?Xr(Fe):Fe.name,live:Fe.live,isDraft:!1,detail:null};(!m||m.id!==tt.id)&&(J.current={project:d,sessionId:tt.id},Me(d,tt.id),x(tt)),tt=await wt(tt),E(Ze=>[...Ze,je]);try{await sm(d,{session_key:tt.sessionKey,message:re})}catch(Ze){if(!L_(Ze)||!tt.id)throw Ze;tt=await wt({...tt,live:!1}),await sm(d,{session_key:tt.sessionKey,message:re})}const st=tt.id;if(!st)throw new Error(e("sessions.createFailed"));const zt=v.filter(Ze=>Ze.role!=="user").length;J.current={project:d,sessionId:st},x(Ze=>Ze&&{...Ze,id:st,isDraft:!1}),Me(d,st),Ne(d,st,zt),await Xe(d)}catch(Fe){Te(),E(st=>st.filter(zt=>zt.id!==xe));const tt=j6(Fe,e);Y(tt)}finally{R(!1)}},[m,ye,wt,C,we,v,Xe,d,Ne,Te,e,Me]),B=w.useCallback(async()=>{if(!(!H||!d||!F.trim())){X("rename");try{await ZU(d,H.id,{name:F.trim()});const xe=(await Xe(d)).find(je=>je.id===H.id);xe&&(m==null?void 0:m.id)===xe.id&&x(je=>je&&{...je,name:Xr(xe)}),j(null),W("")}finally{X(null)}}},[m==null?void 0:m.id,Xe,F,H,d]),le=w.useCallback(async()=>{if(!(!K||!d)){X("delete");try{await JU(d,K.id);const re=await Xe(d);(m==null?void 0:m.id)===K.id&&(Te(),J.current={project:d,sessionId:""},x(null),E([]),Me(d)),re.length===0&&E([]),L(null)}finally{X(null)}}},[m==null?void 0:m.id,K,Xe,d,Te,Me]);w.useEffect(()=>{Ie()},[Ie]),w.useEffect(()=>{ue&&(d&&d===ue||f(ue))},[ue,d]),w.useEffect(()=>{if(!d){g([]);return}J.current.project=d,Xe(d)},[Xe,d]),w.useEffect(()=>{!d||ve||m!=null&&m.id||we.length===0||Xt(d,we[0])},[m==null?void 0:m.id,we,Xt,ve,d]),w.useEffect(()=>{if(!ue||!ve||d!==ue)return;const re=h.find(xe=>xe.id===ve);if(!re){h.length>0&&Me(ue,h[0].id);return}(m==null?void 0:m.id)!==re.id&&Xt(ue,re)},[m==null?void 0:m.id,Xt,ue,ve,d,h,Me]),w.useEffect(()=>{var re;(re=D.current)==null||re.scrollIntoView({behavior:"smooth"})},[v]),w.useEffect(()=>()=>Te(),[Te]);const _e=(m==null?void 0:m.name)||e("sessions.activeChat");return p.jsxs("div",{className:"grid min-h-[calc(100vh-8rem)] grid-cols-1 gap-4 xl:grid-cols-[22rem_minmax(0,1fr)] animate-fade-in",children:[p.jsxs(Ht,{className:"flex flex-col gap-4 p-4 xl:h-[calc(100vh-8rem)] xl:overflow-hidden",children:[p.jsx("div",{className:"flex items-center gap-3",children:p.jsxs("div",{className:"flex-1",children:[p.jsx("p",{className:"text-xs font-medium uppercase tracking-[0.2em] text-gray-400",children:e("sessions.selectProject")}),p.jsxs("select",{value:d,onChange:re=>void De(re.target.value),className:"mt-2 w-full rounded-xl border border-gray-300/90 bg-white/90 px-3 py-2 text-sm text-gray-900 transition-all focus:border-accent focus:outline-none focus:ring-2 focus:ring-accent/45 dark:border-white/[0.1] dark:bg-[rgba(0,0,0,0.45)] dark:text-white",children:[p.jsx("option",{value:"",children:e("sessions.allProjects")}),i.map(re=>p.jsx("option",{value:re.name,children:re.name},re.name))]})]})}),p.jsxs("div",{className:"relative",children:[p.jsx(yt,{value:S,onChange:re=>_(re.target.value),placeholder:e("common.search"),className:"pl-9","aria-label":e("common.search")}),p.jsx(Zu,{size:16,className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"})]}),p.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[p.jsxs("div",{className:"mb-3 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400",children:[p.jsx("span",{children:e("sessions.historyTitle")}),p.jsx("span",{children:we.length})]}),p.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto space-y-2 pr-1",children:T?p.jsx("div",{className:"flex h-32 items-center justify-center text-gray-400",children:p.jsx(Fs,{className:"animate-spin",size:18})}):d?P&&h.length===0?p.jsx("div",{className:"flex h-32 items-center justify-center text-gray-400",children:p.jsx(Fs,{className:"animate-spin",size:18})}):h.length===0?p.jsx(xn,{message:e("sessions.noSessions"),icon:_a}):we.length===0?p.jsx(xn,{message:e("sessions.noSessions"),icon:_a}):we.map(re=>{const xe=re.id===(m==null?void 0:m.id);return p.jsxs("div",{className:Ke("rounded-2xl border p-3 transition-all",xe?"border-accent/45 bg-accent/10 shadow-[0_0_20px_-12px_rgba(139,92,246,0.55)]":"border-gray-200/80 bg-white/70 hover:border-accent/30 dark:border-white/[0.08] dark:bg-white/[0.03]"),children:[p.jsxs("button",{type:"button",onClick:()=>void Xt(d,re),className:"w-full text-left","data-testid":"web-chat-session-open",children:[p.jsxs("div",{className:"flex items-start justify-between gap-2",children:[p.jsxs("div",{className:"min-w-0",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"truncate text-sm font-medium text-gray-900 dark:text-white",children:Xr(re)}),re.live||ge.has(re.id)?p.jsx("span",{className:"rounded-full bg-violet-50 px-2 py-0.5 text-[10px] text-violet-600 dark:bg-violet-950/20 dark:text-violet-300",children:"live"}):p.jsx("span",{className:"rounded-full bg-gray-100 px-2 py-0.5 text-[10px] text-gray-400 dark:bg-white/[0.06] dark:text-gray-500",children:"history"})]}),p.jsx("p",{className:"mt-1 truncate text-xs text-gray-500 dark:text-gray-400",children:__(re.updated_at||re.created_at,e("sessions.justNow"))})]}),p.jsx("span",{className:"shrink-0 text-[10px] text-gray-400",children:re.history_count})]}),p.jsx("p",{className:"mt-2 line-clamp-2 text-xs text-gray-500 dark:text-gray-400",children:D6(re,e)})]}),p.jsxs("div",{className:"mt-3 flex items-center justify-end gap-1",children:[p.jsx(Ae,{size:"sm",variant:"ghost",onClick:()=>{j({id:re.id,name:Xr(re)}),W(Xr(re))},"data-testid":"web-chat-session-rename",children:p.jsx(wo,{size:14})}),p.jsx(Ae,{size:"sm",variant:"ghost",onClick:()=>L({id:re.id,name:Xr(re)}),"data-testid":"web-chat-session-delete",children:p.jsx(ta,{size:14})})]})]},re.id)}):p.jsx(xn,{message:e("sessions.projectRequired"),icon:_a})})]})]}),p.jsxs(Ht,{className:"flex min-h-[32rem] flex-col p-0 xl:h-[calc(100vh-8rem)]",children:[p.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-gray-200/80 px-5 py-4 dark:border-white/[0.08]",children:[p.jsxs("div",{className:"min-w-0",children:[p.jsx("div",{className:"flex items-center gap-2",children:p.jsx("h2",{className:"truncate text-lg font-semibold text-gray-900 dark:text-white",children:_e})}),p.jsx("p",{className:"mt-1 truncate text-sm text-gray-500 dark:text-gray-400",children:m?m.project:e("sessions.sendHint")})]}),p.jsxs(Ae,{size:"sm",variant:"secondary",onClick:()=>void ot(),"data-testid":"web-chat-refresh",children:[p.jsx(Qu,{size:14})," ",e("common.refresh")]})]}),p.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-5",children:d?z?p.jsx("div",{className:"flex h-full items-center justify-center text-gray-400",children:p.jsx(Fs,{className:"animate-spin",size:22})}):v.length===0?p.jsx("div",{className:"flex h-full items-center justify-center",children:p.jsx(xn,{message:e(m?"sessions.noMessages":"sessions.sendHint"),icon:_a})}):p.jsxs("div",{className:"space-y-5",children:[v.map(re=>{const xe=re.role==="user";return p.jsxs("div",{className:Ke("flex gap-3",xe?"justify-end":"justify-start"),children:[!xe&&p.jsx("div",{className:"mt-1 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-accent/10",children:p.jsx(Wu,{size:16,className:"text-accent"})}),p.jsx("div",{className:Ke("max-w-[85%] rounded-2xl px-5 py-3.5 text-sm",xe?"bg-accent text-white rounded-br-md":"border border-gray-200 bg-white text-gray-900 shadow-sm dark:border-white/[0.08] dark:bg-[rgba(0,0,0,0.42)] dark:text-gray-100 rounded-bl-md"),children:p.jsx(mg,{content:re.content,isUser:xe})}),xe&&p.jsx("div",{className:"mt-1 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-gray-200 dark:bg-white/[0.08]",children:p.jsx(Ju,{size:16,className:"text-gray-500 dark:text-gray-300"})})]},re.id)}),p.jsx("div",{ref:D})]}):p.jsx("div",{className:"flex h-full items-center justify-center",children:p.jsx(xn,{message:e("sessions.emptySelection"),icon:_a})})}),p.jsxs("div",{className:"border-t border-gray-200/80 px-5 py-4 dark:border-white/[0.08]",children:[ne&&p.jsx("div",{className:"mb-3 rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-600 dark:border-red-900/40 dark:bg-red-950/20 dark:text-red-300",children:ne}),q==="polling"&&p.jsxs("div",{className:"mb-3 flex items-center gap-2 text-sm text-gray-500 dark:text-gray-400",children:[p.jsx(Fs,{size:14,className:"animate-spin"}),p.jsx("span",{children:e("sessions.waitingForReply")})]}),q==="activating"&&p.jsxs("div",{className:"mb-3 flex items-center gap-2 text-sm text-gray-500 dark:text-gray-400",children:[p.jsx(Fs,{size:14,className:"animate-spin"}),p.jsx("span",{children:e("sessions.preparingChat")})]}),p.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end",children:[p.jsx("div",{className:"flex-1",children:p.jsx(gd,{value:C,onChange:re=>A(re.target.value),onKeyDown:re=>{re.key==="Enter"&&!re.shiftKey&&(re.preventDefault(),Zt())},rows:3,placeholder:e(d?"sessions.messageInput":"sessions.projectRequired"),disabled:!d||!ye||Q||q==="polling"||q==="activating","data-testid":"web-chat-input"})}),p.jsxs(Ae,{onClick:()=>void Zt(),disabled:!Oe,loading:Q,size:"lg",className:"sm:self-stretch","data-testid":"web-chat-send",children:[p.jsx(pm,{size:16})," ",e("sessions.send")]})]}),!ye&&m&&p.jsx("div",{className:"mt-3 rounded-xl border border-gray-200 bg-gray-50 px-4 py-3 text-sm text-gray-500 dark:border-white/[0.08] dark:bg-white/[0.03] dark:text-gray-400",children:e("sessions.notLiveHint")})]})]}),p.jsx(Pr,{open:!!H,onClose:()=>j(null),title:e("sessions.renameTitle"),children:p.jsxs("div",{className:"space-y-4",children:[p.jsx(yt,{value:F,onChange:re=>W(re.target.value),placeholder:e("sessions.renamePlaceholder"),"data-testid":"web-chat-rename-input"}),p.jsxs("div",{className:"flex justify-end gap-2",children:[p.jsx(Ae,{variant:"secondary",onClick:()=>j(null),children:e("common.cancel")}),p.jsx(Ae,{onClick:()=>void B(),loading:I==="rename","data-testid":"web-chat-rename-save",children:e("common.save")})]})]})}),p.jsx(Pr,{open:!!K,onClose:()=>L(null),title:e("sessions.deleteConfirmTitle"),children:p.jsxs("div",{className:"space-y-4",children:[p.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:e("sessions.deleteConfirmBody")}),p.jsxs("div",{className:"flex justify-end gap-2",children:[p.jsx(Ae,{variant:"secondary",onClick:()=>L(null),children:e("common.cancel")}),p.jsx(Ae,{variant:"danger",onClick:()=>void le(),loading:I==="delete","data-testid":"web-chat-delete-confirm",children:e("common.delete")})]})]})})]})}var I6=Object.defineProperty,qu=Object.getOwnPropertySymbols,I_=Object.prototype.hasOwnProperty,z_=Object.prototype.propertyIsEnumerable,aw=(e,t,r)=>t in e?I6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,lm=(e,t)=>{for(var r in t||(t={}))I_.call(t,r)&&aw(e,r,t[r]);if(qu)for(var r of qu(t))z_.call(t,r)&&aw(e,r,t[r]);return e},om=(e,t)=>{var r={};for(var i in e)I_.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&qu)for(var i of qu(e))t.indexOf(i)<0&&z_.call(e,i)&&(r[i]=e[i]);return r};/**
479
- * @license QR Code generator library (TypeScript)
480
- * Copyright (c) Project Nayuki.
481
- * SPDX-License-Identifier: MIT
482
- */var Xi;(e=>{const t=class ft{constructor(f,h,g,m){if(this.version=f,this.errorCorrectionLevel=h,this.modules=[],this.isFunction=[],f<ft.MIN_VERSION||f>ft.MAX_VERSION)throw new RangeError("Version value out of range");if(m<-1||m>7)throw new RangeError("Mask value out of range");this.size=f*4+17;let x=[];for(let E=0;E<this.size;E++)x.push(!1);for(let E=0;E<this.size;E++)this.modules.push(x.slice()),this.isFunction.push(x.slice());this.drawFunctionPatterns();const v=this.addEccAndInterleave(g);if(this.drawCodewords(v),m==-1){let E=1e9;for(let S=0;S<8;S++){this.applyMask(S),this.drawFormatBits(S);const _=this.getPenaltyScore();_<E&&(m=S,E=_),this.applyMask(S)}}l(0<=m&&m<=7),this.mask=m,this.applyMask(m),this.drawFormatBits(m),this.isFunction=[]}static encodeText(f,h){const g=e.QrSegment.makeSegments(f);return ft.encodeSegments(g,h)}static encodeBinary(f,h){const g=e.QrSegment.makeBytes(f);return ft.encodeSegments([g],h)}static encodeSegments(f,h,g=1,m=40,x=-1,v=!0){if(!(ft.MIN_VERSION<=g&&g<=m&&m<=ft.MAX_VERSION)||x<-1||x>7)throw new RangeError("Invalid value");let E,S;for(E=g;;E++){const T=ft.getNumDataCodewords(E,h)*8,M=c.getTotalBits(f,E);if(M<=T){S=M;break}if(E>=m)throw new RangeError("Data too long")}for(const T of[ft.Ecc.MEDIUM,ft.Ecc.QUARTILE,ft.Ecc.HIGH])v&&S<=ft.getNumDataCodewords(E,T)*8&&(h=T);let _=[];for(const T of f){r(T.mode.modeBits,4,_),r(T.numChars,T.mode.numCharCountBits(E),_);for(const M of T.getData())_.push(M)}l(_.length==S);const C=ft.getNumDataCodewords(E,h)*8;l(_.length<=C),r(0,Math.min(4,C-_.length),_),r(0,(8-_.length%8)%8,_),l(_.length%8==0);for(let T=236;_.length<C;T^=253)r(T,8,_);let A=[];for(;A.length*8<_.length;)A.push(0);return _.forEach((T,M)=>A[M>>>3]|=T<<7-(M&7)),new ft(E,h,A,x)}getModule(f,h){return 0<=f&&f<this.size&&0<=h&&h<this.size&&this.modules[h][f]}getModules(){return this.modules}drawFunctionPatterns(){for(let g=0;g<this.size;g++)this.setFunctionModule(6,g,g%2==0),this.setFunctionModule(g,6,g%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const f=this.getAlignmentPatternPositions(),h=f.length;for(let g=0;g<h;g++)for(let m=0;m<h;m++)g==0&&m==0||g==0&&m==h-1||g==h-1&&m==0||this.drawAlignmentPattern(f[g],f[m]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(f){const h=this.errorCorrectionLevel.formatBits<<3|f;let g=h;for(let x=0;x<10;x++)g=g<<1^(g>>>9)*1335;const m=(h<<10|g)^21522;l(m>>>15==0);for(let x=0;x<=5;x++)this.setFunctionModule(8,x,i(m,x));this.setFunctionModule(8,7,i(m,6)),this.setFunctionModule(8,8,i(m,7)),this.setFunctionModule(7,8,i(m,8));for(let x=9;x<15;x++)this.setFunctionModule(14-x,8,i(m,x));for(let x=0;x<8;x++)this.setFunctionModule(this.size-1-x,8,i(m,x));for(let x=8;x<15;x++)this.setFunctionModule(8,this.size-15+x,i(m,x));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let f=this.version;for(let g=0;g<12;g++)f=f<<1^(f>>>11)*7973;const h=this.version<<12|f;l(h>>>18==0);for(let g=0;g<18;g++){const m=i(h,g),x=this.size-11+g%3,v=Math.floor(g/3);this.setFunctionModule(x,v,m),this.setFunctionModule(v,x,m)}}drawFinderPattern(f,h){for(let g=-4;g<=4;g++)for(let m=-4;m<=4;m++){const x=Math.max(Math.abs(m),Math.abs(g)),v=f+m,E=h+g;0<=v&&v<this.size&&0<=E&&E<this.size&&this.setFunctionModule(v,E,x!=2&&x!=4)}}drawAlignmentPattern(f,h){for(let g=-2;g<=2;g++)for(let m=-2;m<=2;m++)this.setFunctionModule(f+m,h+g,Math.max(Math.abs(m),Math.abs(g))!=1)}setFunctionModule(f,h,g){this.modules[h][f]=g,this.isFunction[h][f]=!0}addEccAndInterleave(f){const h=this.version,g=this.errorCorrectionLevel;if(f.length!=ft.getNumDataCodewords(h,g))throw new RangeError("Invalid argument");const m=ft.NUM_ERROR_CORRECTION_BLOCKS[g.ordinal][h],x=ft.ECC_CODEWORDS_PER_BLOCK[g.ordinal][h],v=Math.floor(ft.getNumRawDataModules(h)/8),E=m-v%m,S=Math.floor(v/m);let _=[];const C=ft.reedSolomonComputeDivisor(x);for(let T=0,M=0;T<m;T++){let P=f.slice(M,M+S-x+(T<E?0:1));M+=P.length;const N=ft.reedSolomonComputeRemainder(P,C);T<E&&P.push(0),_.push(P.concat(N))}let A=[];for(let T=0;T<_[0].length;T++)_.forEach((M,P)=>{(T!=S-x||P>=E)&&A.push(M[T])});return l(A.length==v),A}drawCodewords(f){if(f.length!=Math.floor(ft.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let h=0;for(let g=this.size-1;g>=1;g-=2){g==6&&(g=5);for(let m=0;m<this.size;m++)for(let x=0;x<2;x++){const v=g-x,S=(g+1&2)==0?this.size-1-m:m;!this.isFunction[S][v]&&h<f.length*8&&(this.modules[S][v]=i(f[h>>>3],7-(h&7)),h++)}}l(h==f.length*8)}applyMask(f){if(f<0||f>7)throw new RangeError("Mask value out of range");for(let h=0;h<this.size;h++)for(let g=0;g<this.size;g++){let m;switch(f){case 0:m=(g+h)%2==0;break;case 1:m=h%2==0;break;case 2:m=g%3==0;break;case 3:m=(g+h)%3==0;break;case 4:m=(Math.floor(g/3)+Math.floor(h/2))%2==0;break;case 5:m=g*h%2+g*h%3==0;break;case 6:m=(g*h%2+g*h%3)%2==0;break;case 7:m=((g+h)%2+g*h%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[h][g]&&m&&(this.modules[h][g]=!this.modules[h][g])}}getPenaltyScore(){let f=0;for(let x=0;x<this.size;x++){let v=!1,E=0,S=[0,0,0,0,0,0,0];for(let _=0;_<this.size;_++)this.modules[x][_]==v?(E++,E==5?f+=ft.PENALTY_N1:E>5&&f++):(this.finderPenaltyAddHistory(E,S),v||(f+=this.finderPenaltyCountPatterns(S)*ft.PENALTY_N3),v=this.modules[x][_],E=1);f+=this.finderPenaltyTerminateAndCount(v,E,S)*ft.PENALTY_N3}for(let x=0;x<this.size;x++){let v=!1,E=0,S=[0,0,0,0,0,0,0];for(let _=0;_<this.size;_++)this.modules[_][x]==v?(E++,E==5?f+=ft.PENALTY_N1:E>5&&f++):(this.finderPenaltyAddHistory(E,S),v||(f+=this.finderPenaltyCountPatterns(S)*ft.PENALTY_N3),v=this.modules[_][x],E=1);f+=this.finderPenaltyTerminateAndCount(v,E,S)*ft.PENALTY_N3}for(let x=0;x<this.size-1;x++)for(let v=0;v<this.size-1;v++){const E=this.modules[x][v];E==this.modules[x][v+1]&&E==this.modules[x+1][v]&&E==this.modules[x+1][v+1]&&(f+=ft.PENALTY_N2)}let h=0;for(const x of this.modules)h=x.reduce((v,E)=>v+(E?1:0),h);const g=this.size*this.size,m=Math.ceil(Math.abs(h*20-g*10)/g)-1;return l(0<=m&&m<=9),f+=m*ft.PENALTY_N4,l(0<=f&&f<=2568888),f}getAlignmentPatternPositions(){if(this.version==1)return[];{const f=Math.floor(this.version/7)+2,h=this.version==32?26:Math.ceil((this.version*4+4)/(f*2-2))*2;let g=[6];for(let m=this.size-7;g.length<f;m-=h)g.splice(1,0,m);return g}}static getNumRawDataModules(f){if(f<ft.MIN_VERSION||f>ft.MAX_VERSION)throw new RangeError("Version number out of range");let h=(16*f+128)*f+64;if(f>=2){const g=Math.floor(f/7)+2;h-=(25*g-10)*g-55,f>=7&&(h-=36)}return l(208<=h&&h<=29648),h}static getNumDataCodewords(f,h){return Math.floor(ft.getNumRawDataModules(f)/8)-ft.ECC_CODEWORDS_PER_BLOCK[h.ordinal][f]*ft.NUM_ERROR_CORRECTION_BLOCKS[h.ordinal][f]}static reedSolomonComputeDivisor(f){if(f<1||f>255)throw new RangeError("Degree out of range");let h=[];for(let m=0;m<f-1;m++)h.push(0);h.push(1);let g=1;for(let m=0;m<f;m++){for(let x=0;x<h.length;x++)h[x]=ft.reedSolomonMultiply(h[x],g),x+1<h.length&&(h[x]^=h[x+1]);g=ft.reedSolomonMultiply(g,2)}return h}static reedSolomonComputeRemainder(f,h){let g=h.map(m=>0);for(const m of f){const x=m^g.shift();g.push(0),h.forEach((v,E)=>g[E]^=ft.reedSolomonMultiply(v,x))}return g}static reedSolomonMultiply(f,h){if(f>>>8||h>>>8)throw new RangeError("Byte out of range");let g=0;for(let m=7;m>=0;m--)g=g<<1^(g>>>7)*285,g^=(h>>>m&1)*f;return l(g>>>8==0),g}finderPenaltyCountPatterns(f){const h=f[1];l(h<=this.size*3);const g=h>0&&f[2]==h&&f[3]==h*3&&f[4]==h&&f[5]==h;return(g&&f[0]>=h*4&&f[6]>=h?1:0)+(g&&f[6]>=h*4&&f[0]>=h?1:0)}finderPenaltyTerminateAndCount(f,h,g){return f&&(this.finderPenaltyAddHistory(h,g),h=0),h+=this.size,this.finderPenaltyAddHistory(h,g),this.finderPenaltyCountPatterns(g)}finderPenaltyAddHistory(f,h){h[0]==0&&(f+=this.size),h.pop(),h.unshift(f)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function r(d,f,h){if(f<0||f>31||d>>>f)throw new RangeError("Value out of range");for(let g=f-1;g>=0;g--)h.push(d>>>g&1)}function i(d,f){return(d>>>f&1)!=0}function l(d){if(!d)throw new Error("Assertion error")}const o=class an{constructor(f,h,g){if(this.mode=f,this.numChars=h,this.bitData=g,h<0)throw new RangeError("Invalid argument");this.bitData=g.slice()}static makeBytes(f){let h=[];for(const g of f)r(g,8,h);return new an(an.Mode.BYTE,f.length,h)}static makeNumeric(f){if(!an.isNumeric(f))throw new RangeError("String contains non-numeric characters");let h=[];for(let g=0;g<f.length;){const m=Math.min(f.length-g,3);r(parseInt(f.substring(g,g+m),10),m*3+1,h),g+=m}return new an(an.Mode.NUMERIC,f.length,h)}static makeAlphanumeric(f){if(!an.isAlphanumeric(f))throw new RangeError("String contains unencodable characters in alphanumeric mode");let h=[],g;for(g=0;g+2<=f.length;g+=2){let m=an.ALPHANUMERIC_CHARSET.indexOf(f.charAt(g))*45;m+=an.ALPHANUMERIC_CHARSET.indexOf(f.charAt(g+1)),r(m,11,h)}return g<f.length&&r(an.ALPHANUMERIC_CHARSET.indexOf(f.charAt(g)),6,h),new an(an.Mode.ALPHANUMERIC,f.length,h)}static makeSegments(f){return f==""?[]:an.isNumeric(f)?[an.makeNumeric(f)]:an.isAlphanumeric(f)?[an.makeAlphanumeric(f)]:[an.makeBytes(an.toUtf8ByteArray(f))]}static makeEci(f){let h=[];if(f<0)throw new RangeError("ECI assignment value out of range");if(f<128)r(f,8,h);else if(f<16384)r(2,2,h),r(f,14,h);else if(f<1e6)r(6,3,h),r(f,21,h);else throw new RangeError("ECI assignment value out of range");return new an(an.Mode.ECI,0,h)}static isNumeric(f){return an.NUMERIC_REGEX.test(f)}static isAlphanumeric(f){return an.ALPHANUMERIC_REGEX.test(f)}getData(){return this.bitData.slice()}static getTotalBits(f,h){let g=0;for(const m of f){const x=m.mode.numCharCountBits(h);if(m.numChars>=1<<x)return 1/0;g+=4+x+m.bitData.length}return g}static toUtf8ByteArray(f){f=encodeURI(f);let h=[];for(let g=0;g<f.length;g++)f.charAt(g)!="%"?h.push(f.charCodeAt(g)):(h.push(parseInt(f.substring(g+1,g+3),16)),g+=2);return h}};o.NUMERIC_REGEX=/^[0-9]*$/,o.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,o.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let c=o;e.QrSegment=o})(Xi||(Xi={}));(e=>{(t=>{const r=class{constructor(l,o){this.ordinal=l,this.formatBits=o}};r.LOW=new r(0,1),r.MEDIUM=new r(1,0),r.QUARTILE=new r(2,3),r.HIGH=new r(3,2),t.Ecc=r})(e.QrCode||(e.QrCode={}))})(Xi||(Xi={}));(e=>{(t=>{const r=class{constructor(l,o){this.modeBits=l,this.numBitsCharCount=o}numCharCountBits(l){return this.numBitsCharCount[Math.floor((l+7)/17)]}};r.NUMERIC=new r(1,[10,12,14]),r.ALPHANUMERIC=new r(2,[9,11,13]),r.BYTE=new r(4,[8,16,16]),r.KANJI=new r(8,[8,10,12]),r.ECI=new r(7,[0,0,0]),t.Mode=r})(e.QrSegment||(e.QrSegment={}))})(Xi||(Xi={}));var Gs=Xi;/**
483
- * @license qrcode.react
484
- * Copyright (c) Paul O'Shannessy
485
- * SPDX-License-Identifier: ISC
486
- */var z6={L:Gs.QrCode.Ecc.LOW,M:Gs.QrCode.Ecc.MEDIUM,Q:Gs.QrCode.Ecc.QUARTILE,H:Gs.QrCode.Ecc.HIGH},P_=128,B_="L",U_="#FFFFFF",F_="#000000",$_=!1,H_=1,P6=4,B6=0,U6=.1;function K_(e,t=0){const r=[];return e.forEach(function(i,l){let o=null;i.forEach(function(c,d){if(!c&&o!==null){r.push(`M${o+t} ${l+t}h${d-o}v1H${o+t}z`),o=null;return}if(d===i.length-1){if(!c)return;o===null?r.push(`M${d+t},${l+t} h1v1H${d+t}z`):r.push(`M${o+t},${l+t} h${d+1-o}v1H${o+t}z`);return}c&&o===null&&(o=d)})}),r.join("")}function q_(e,t){return e.slice().map((r,i)=>i<t.y||i>=t.y+t.h?r:r.map((l,o)=>o<t.x||o>=t.x+t.w?l:!1))}function F6(e,t,r,i){if(i==null)return null;const l=e.length+r*2,o=Math.floor(t*U6),c=l/t,d=(i.width||o)*c,f=(i.height||o)*c,h=i.x==null?e.length/2-d/2:i.x*c,g=i.y==null?e.length/2-f/2:i.y*c,m=i.opacity==null?1:i.opacity;let x=null;if(i.excavate){let E=Math.floor(h),S=Math.floor(g),_=Math.ceil(d+h-E),C=Math.ceil(f+g-S);x={x:E,y:S,w:_,h:C}}const v=i.crossOrigin;return{x:h,y:g,h:f,w:d,excavation:x,opacity:m,crossOrigin:v}}function $6(e,t){return t!=null?Math.max(Math.floor(t),0):e?P6:B6}function G_({value:e,level:t,minVersion:r,includeMargin:i,marginSize:l,imageSettings:o,size:c,boostLevel:d}){let f=kt.useMemo(()=>{const E=(Array.isArray(e)?e:[e]).reduce((S,_)=>(S.push(...Gs.QrSegment.makeSegments(_)),S),[]);return Gs.QrCode.encodeSegments(E,z6[t],r,void 0,void 0,d)},[e,t,r,d]);const{cells:h,margin:g,numCells:m,calculatedImageSettings:x}=kt.useMemo(()=>{let v=f.getModules();const E=$6(i,l),S=v.length+E*2,_=F6(v,c,E,o);return{cells:v,margin:E,numCells:S,calculatedImageSettings:_}},[f,c,o,i,l]);return{qrcode:f,margin:g,cells:h,numCells:m,calculatedImageSettings:x}}var H6=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),K6=kt.forwardRef(function(t,r){const i=t,{value:l,size:o=P_,level:c=B_,bgColor:d=U_,fgColor:f=F_,includeMargin:h=$_,minVersion:g=H_,boostLevel:m,marginSize:x,imageSettings:v}=i,S=om(i,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:_}=S,C=om(S,["style"]),A=v==null?void 0:v.src,T=kt.useRef(null),M=kt.useRef(null),P=kt.useCallback(Y=>{T.current=Y,typeof r=="function"?r(Y):r&&(r.current=Y)},[r]),[N,z]=kt.useState(!1),{margin:G,cells:Q,numCells:R,calculatedImageSettings:q}=G_({value:l,level:c,minVersion:g,boostLevel:m,includeMargin:h,marginSize:x,imageSettings:v,size:o});kt.useEffect(()=>{if(T.current!=null){const Y=T.current,H=Y.getContext("2d");if(!H)return;let j=Q;const F=M.current,W=q!=null&&F!==null&&F.complete&&F.naturalHeight!==0&&F.naturalWidth!==0;W&&q.excavation!=null&&(j=q_(Q,q.excavation));const K=window.devicePixelRatio||1;Y.height=Y.width=o*K;const L=o/R*K;H.scale(L,L),H.fillStyle=d,H.fillRect(0,0,R,R),H.fillStyle=f,H6?H.fill(new Path2D(K_(j,G))):Q.forEach(function(I,X){I.forEach(function(D,J){D&&H.fillRect(J+G,X+G,1,1)})}),q&&(H.globalAlpha=q.opacity),W&&H.drawImage(F,q.x+G,q.y+G,q.w,q.h)}}),kt.useEffect(()=>{z(!1)},[A]);const Z=lm({height:o,width:o},_);let ne=null;return A!=null&&(ne=kt.createElement("img",{src:A,key:A,style:{display:"none"},onLoad:()=>{z(!0)},ref:M,crossOrigin:q==null?void 0:q.crossOrigin})),kt.createElement(kt.Fragment,null,kt.createElement("canvas",lm({style:Z,height:o,width:o,ref:P,role:"img"},C)),ne)});K6.displayName="QRCodeCanvas";var V_=kt.forwardRef(function(t,r){const i=t,{value:l,size:o=P_,level:c=B_,bgColor:d=U_,fgColor:f=F_,includeMargin:h=$_,minVersion:g=H_,boostLevel:m,title:x,marginSize:v,imageSettings:E}=i,S=om(i,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:_,cells:C,numCells:A,calculatedImageSettings:T}=G_({value:l,level:c,minVersion:g,boostLevel:m,includeMargin:h,marginSize:v,imageSettings:E,size:o});let M=C,P=null;E!=null&&T!=null&&(T.excavation!=null&&(M=q_(C,T.excavation)),P=kt.createElement("image",{href:E.src,height:T.h,width:T.w,x:T.x+_,y:T.y+_,preserveAspectRatio:"none",opacity:T.opacity,crossOrigin:T.crossOrigin}));const N=K_(M,_);return kt.createElement("svg",lm({height:o,width:o,viewBox:`0 0 ${A} ${A}`,ref:r,role:"img"},S),!!x&&kt.createElement("title",null,x),kt.createElement("path",{fill:d,d:`M0,0 h${A}v${A}H0z`,shapeRendering:"crispEdges"}),kt.createElement("path",{fill:f,d:N,shapeRendering:"crispEdges"}),P)});V_.displayName="QRCodeSVG";const ui="__custom__",xp=["weixin","lark"],gg=[{id:"openai",label:"OpenAI",name:"openai",base_url:"https://api.openai.com/v1",model:"gpt-4.1-mini"},{id:"openrouter",label:"OpenRouter",name:"openrouter",base_url:"https://openrouter.ai/api/v1",model:"openai/gpt-4.1-mini"},{id:"anthropic",label:"Anthropic",name:"anthropic",base_url:"https://api.anthropic.com/v1",model:"claude-3-5-haiku-latest"},{id:"minimax",label:"Minimax",name:"minimax",base_url:"https://api.minimax.chat/v1",model:"MiniMax-M2.5"},{id:"ollama",label:"Ollama",name:"ollama",base_url:"http://127.0.0.1:11434/v1",model:"qwen2.5-coder:7b"}];function jr(e){return JSON.parse(JSON.stringify(e))}function uo(e){return Array.isArray(e.projects)||(e.projects=[]),e.projects}function q6(e){const t=new Set(e.map(i=>i.name).filter(Boolean));let r=e.length+1;for(;t.has(`project-${r}`);)r+=1;return{name:`project-${r}`,agentType:TU,workDir:"",model:""}}function yu(e){var t,r,i,l,o;return{...e,agent:{...e.agent,options:{...((t=e.agent)==null?void 0:t.options)||{},model:C_((r=e.agent)==null?void 0:r.type,String(((l=(i=e.agent)==null?void 0:i.options)==null?void 0:l.model)||""))},providers:((o=e.agent)==null?void 0:o.providers)||[]},platforms:e.platforms||[]}}function iw(e,t){return t.includes(e)?e:ui}function G6(e){var t;return((t=gg.find(r=>e.name===r.name||r.base_url&&e.base_url===r.base_url||r.model&&e.model===r.model&&e.name===r.name))==null?void 0:t.id)||ui}function V6(e,t){const r=gg.find(i=>i.id===t);return r?{...e,name:r.name,base_url:r.base_url,model:r.model}:e}function sw(e="weixin"){return{type:e,options:{}}}function lw(e){const t=e.type==="feishu"?"lark":e.type,r=e.options&&typeof e.options=="object"?{...e.options}:{};return t==="weixin"?{type:t,options:{...r}}:t==="lark"?{type:t,options:{...r,app_id:String(r.app_id||"").trim(),app_secret:String(r.app_secret||"").trim()}}:{type:t,options:r}}function Y6(e){var t;if(e.type==="weixin")return"WeChat QR login";if(e.type==="lark"){const r=String(((t=e.options)==null?void 0:t.app_id)||"").trim();return r?`App ID ${r}`:"App ID and secret required"}return"Custom platform"}function X6(e){var i,l;const t=String(((l=(i=e.agent)==null?void 0:i.options)==null?void 0:l.work_dir)||"").trim();return t?t.replace(/\/+$/,"").split("/").filter(Boolean).pop()||t:"No work directory"}function W6(e){return e==="success"?"border-primary/20 bg-primary/10 text-primary dark:border-primary/25 dark:bg-primary/10 dark:text-blue-200":e==="warning"?"border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-400/20 dark:bg-amber-500/10 dark:text-amber-200":"border-red-200 bg-red-50 text-red-700 dark:border-red-400/20 dark:bg-red-500/10 dark:text-red-200"}function Q6(){var J,be,pe,ue,ve,ge,we,ye,Oe,Me,Te,vt,Ie,Xe;const[e,t]=_m(),[r,i]=w.useState(null),[l,o]=w.useState(null),[c,d]=w.useState(0),[f,h]=w.useState("basic"),[g,m]=w.useState(null),[x,v]=w.useState(null),[E,S]=w.useState(null),[_,C]=w.useState(!1),[A,T]=w.useState(!0),[M,P]=w.useState(""),[N,z]=w.useState(null),G=w.useCallback(async()=>{T(!0);try{const te=await nL(),ce=jr(te.parsed||{});ce.projects=uo(ce).map(De=>yu(De)),i(ce),o(jr(ce));const Ne=e.get("project");if(Ne){const De=(ce.projects||[]).findIndex(wt=>wt.name===Ne);d(De>=0?De:0)}}catch(te){z({tone:"error",message:te instanceof Error?te.message:String(te)})}finally{T(!1)}},[e]);w.useEffect(()=>{G()},[G]);const Q=(r==null?void 0:r.projects)||[],R=Q[c]||null,q=JSON.stringify(r||{})!==JSON.stringify(l||{}),Z=w.useCallback(te=>{i(ce=>{if(!ce)return ce;const Ne=jr(ce),De=uo(Ne),wt=De[c];return wt?(De[c]=yu(te(wt)),Ne):ce})},[c]),ne=w.useCallback((te,ce)=>{Z(Ne=>{const De=[...Ne.agent.providers||[]],wt=De[te];return wt?(De[te]=ce(wt),{...Ne,agent:{...Ne.agent,providers:De}}):Ne})},[Z]),Y=()=>{m(q6(Q))},H=te=>{m(ce=>ce&&{...ce,...te})},j=()=>{if(!g)return;const te=g.name.trim(),ce=g.agentType.trim(),Ne=g.workDir.trim(),De=g.model.trim();if(!te||!ce||!Ne){z({tone:"warning",message:"Project name, agent type, and work directory are required."});return}if(Q.some(ot=>ot.name===te)){z({tone:"warning",message:`Project "${te}" already exists.`});return}const wt=yu({name:te,agent:{type:ce,options:{model:De||bp(ce),work_dir:Ne},providers:[]},platforms:[],admin_from:"",disabled_commands:[]}),Xt=Q.length;i(ot=>{const Zt=jr(ot||{});return uo(Zt).push(wt),Zt}),d(Xt),t({project:te}),m(null),z(null)},F=te=>{i(ce=>{if(!ce)return ce;const Ne=jr(ce),De=uo(Ne);return De.splice(te,1),d(Math.max(0,Math.min(te,De.length-1))),Ne})},W=te=>{var Ne;if(S(null),te===null){v({index:te,draft:sw()});return}const ce=(Ne=R==null?void 0:R.platforms)==null?void 0:Ne[te];ce&&v({index:te,draft:jr(ce)})},K=te=>{v(ce=>ce&&{...ce,draft:te(ce.draft)})},L=()=>{if(!x)return;const te=lw(x.draft);Z(ce=>{const Ne=[...ce.platforms||[]];return x.index===null?Ne.push(te):Ne[x.index]=te,{...ce,platforms:Ne}}),v(null),S(null)},I=async()=>{if(!(!(R!=null&&R.name)||!r)){C(!0);try{if(x){const ce=jr(r),Ne=uo(ce),De=Ne[c];if(De){const wt=[...De.platforms||[]],Xt=lw(x.draft);x.index===null?wt.push(Xt):wt[x.index]=Xt,Ne[c]=yu({...De,platforms:wt});const ot=await Xx(ce),Zt=jr(ot.parsed||ce);o(Zt),i(jr(Zt)),v(B=>B&&{index:B.index??wt.length-1,draft:Xt})}}const te=await sL(R.name);S({...te,status:"wait"}),z(null)}catch(te){z({tone:"error",message:te instanceof Error?te.message:String(te)})}finally{C(!1)}}},X=async()=>{if(!(!(R!=null&&R.name)||!(E!=null&&E.ticket))){C(!0);try{const te=await lL(R.name,E.ticket);S(ce=>ce&&{...ce,status:te.status}),te.status==="confirmed"&&z({tone:"success",message:"WeChat QR code confirmed."})}catch(te){z({tone:"error",message:te instanceof Error?te.message:String(te)})}finally{C(!1)}}},D=async()=>{if(r){P("config");try{const te=await Xx(r);o(jr(te.parsed||r)),i(jr(te.parsed||r)),z({tone:"success",message:"Project changes saved."}),await G()}catch(te){z({tone:"error",message:te instanceof Error?te.message:String(te)})}finally{P("")}}};return A&&!r?p.jsx("div",{className:"flex h-64 items-center justify-center text-sm text-slate-400 animate-pulse",children:"Loading workspace..."}):p.jsxs("div",{className:"space-y-6 animate-fade-in",children:[p.jsx(Qi,{title:"工作区",description:"创建项目,配置 Agent、工作目录、Provider 和平台接入。"}),N?p.jsx("div",{role:"status",className:`rounded-xl border px-4 py-3 text-sm ${W6(N.tone)}`,children:N.message}):null,q?p.jsx("div",{className:"rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-700 dark:border-amber-400/20 dark:bg-amber-500/10 dark:text-amber-200",children:"You have unsaved project changes."}):null,p.jsxs("div",{className:"grid min-w-0 grid-cols-1 gap-4 lg:grid-cols-[340px_minmax(0,1fr)]",children:[p.jsx(ka,{title:"项目",actions:p.jsxs(Ae,{size:"sm",onClick:Y,children:[p.jsx(di,{size:14})," 新建项目"]}),className:"lg:self-start",children:Q.length===0?p.jsx(xn,{message:"还没有项目。"}):p.jsx("div",{className:"space-y-2",children:Q.map((te,ce)=>{var Ne,De;return p.jsxs("div",{className:`flex items-center justify-between gap-2 rounded-xl border px-3 py-2 transition-colors ${ce===c?"border-accent/30 bg-accent/10":"border-black/10 hover:bg-black/[0.04] dark:border-white/[0.08] dark:hover:bg-white/[0.06]"}`,children:[p.jsxs("button",{type:"button",onClick:()=>{d(ce),t(te.name?{project:te.name}:{})},className:"min-w-0 flex-1 text-left",children:[p.jsx("p",{className:"truncate text-sm font-medium text-slate-950 dark:text-white",children:te.name||`Project ${ce+1}`}),p.jsxs("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:[((Ne=te.agent)==null?void 0:Ne.type)||"unknown"," · ",X6(te)," · ",((De=te.platforms)==null?void 0:De.length)||0," platforms"]})]}),p.jsx(Ae,{variant:"ghost",size:"sm",onClick:()=>F(ce),"aria-label":`Remove ${te.name}`,children:p.jsx(ta,{size:14})})]},`${te.name}-${ce}`)})})}),p.jsx(ka,{title:(R==null?void 0:R.name)||"Project details",description:R?p.jsxs("span",{className:"break-all",children:[((J=R.agent)==null?void 0:J.type)||"unknown"," · ",String(((pe=(be=R.agent)==null?void 0:be.options)==null?void 0:pe.work_dir)||"No work directory")]}):void 0,children:R?p.jsxs("div",{className:"space-y-6",children:[p.jsx("div",{className:"flex gap-2 overflow-x-auto border-b border-black/10 pb-4 [scrollbar-width:none] dark:border-white/[0.08] [&::-webkit-scrollbar]:hidden sm:flex-wrap",children:[["basic","基本信息"],["providers","Provider"],["platforms","平台接入"]].map(([te,ce])=>p.jsx("button",{type:"button",onClick:()=>h(te),className:`shrink-0 rounded-lg px-3 py-1.5 text-sm font-medium transition-colors ${f===te?"bg-accent text-white":"bg-black/[0.04] text-muted-foreground hover:bg-black/[0.07] hover:text-foreground dark:bg-white/[0.05] dark:hover:bg-white/[0.08]"}`,children:ce},te))}),f==="basic"?p.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[p.jsx(yt,{label:"Project name",value:R.name,onChange:te=>Z(ce=>({...ce,name:te.target.value}))}),p.jsxs(Ca,{label:"Agent type",value:iw(((ue=R.agent)==null?void 0:ue.type)||"",mp),onChange:te=>Z(ce=>{var De;const Ne=te.target.value===ui?ce.agent.type:te.target.value;return{...ce,agent:{...ce.agent,type:Ne,options:{...ce.agent.options||{},model:C_(Ne,String(((De=ce.agent.options)==null?void 0:De.model)||""))}}}}),children:[mp.map(te=>p.jsx("option",{value:te,children:te},te)),p.jsx("option",{value:ui,children:"custom"})]}),p.jsx(yt,{label:"Work directory",value:String(((ge=(ve=R.agent)==null?void 0:ve.options)==null?void 0:ge.work_dir)||""),onChange:te=>Z(ce=>({...ce,agent:{...ce.agent,options:{...ce.agent.options||{},work_dir:te.target.value}}}))}),p.jsx(yt,{label:"Default model",value:String(((ye=(we=R.agent)==null?void 0:we.options)==null?void 0:ye.model)||""),onChange:te=>Z(ce=>({...ce,agent:{...ce.agent,options:{...ce.agent.options||{},model:te.target.value}}})),placeholder:bp((Oe=R.agent)==null?void 0:Oe.type)||"Use agent default model"})]}):null,f==="providers"?p.jsxs("section",{className:"space-y-3",children:[p.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-semibold text-slate-950 dark:text-white",children:"Providers"}),p.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Basic endpoint and default model only."})]}),p.jsxs(Ae,{size:"sm",variant:"secondary",onClick:()=>Z(te=>({...te,agent:{...te.agent,providers:[...te.agent.providers||[],{name:`provider-${(te.agent.providers||[]).length+1}`}]}})),children:[p.jsx(di,{size:14})," Provider"]})]}),(R.agent.providers||[]).length===0?p.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-black/10 px-4 py-4 dark:border-white/[0.08] sm:flex-row sm:items-center sm:justify-between",children:[p.jsx("p",{className:"text-sm text-muted-foreground",children:"No providers configured."}),p.jsxs(Ae,{size:"sm",variant:"secondary",onClick:()=>Z(te=>({...te,agent:{...te.agent,providers:[...te.agent.providers||[],{name:`provider-${(te.agent.providers||[]).length+1}`}]}})),children:[p.jsx(di,{size:14})," Add provider"]})]}):p.jsx("div",{className:"space-y-3",children:(R.agent.providers||[]).map((te,ce)=>p.jsx("div",{className:"rounded-xl border border-black/10 p-4 dark:border-white/[0.08]",children:p.jsxs("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:[p.jsxs(Ca,{label:"Preset",value:G6(te),onChange:Ne=>{Ne.target.value!==ui&&ne(ce,De=>V6(De,Ne.target.value))},children:[gg.map(Ne=>p.jsx("option",{value:Ne.id,children:Ne.label},Ne.id)),p.jsx("option",{value:ui,children:"custom"})]}),p.jsx(yt,{label:"Name",value:te.name||"",onChange:Ne=>ne(ce,De=>({...De,name:Ne.target.value}))}),p.jsx(yt,{label:"API key",type:"password",value:te.api_key||"",onChange:Ne=>ne(ce,De=>({...De,api_key:Ne.target.value}))}),p.jsx(yt,{label:"Base URL",value:te.base_url||"",onChange:Ne=>ne(ce,De=>({...De,base_url:Ne.target.value}))}),p.jsx(yt,{label:"Default model",value:te.model||"",onChange:Ne=>ne(ce,De=>({...De,model:Ne.target.value}))}),p.jsx("div",{className:"flex items-end",children:p.jsxs(Ae,{variant:"danger",size:"sm",onClick:()=>Z(Ne=>{const De=[...Ne.agent.providers||[]];return De.splice(ce,1),{...Ne,agent:{...Ne.agent,providers:De}}}),children:[p.jsx(ta,{size:14})," Remove"]})})]})},`${te.name}-${ce}`))})]}):null,f==="platforms"?p.jsxs("section",{className:"space-y-3",children:[p.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[p.jsxs("div",{children:[p.jsx("h3",{className:"text-sm font-semibold text-slate-950 dark:text-white",children:"Platforms"}),p.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Configure each platform with its own required connection fields."})]}),p.jsxs(Ae,{size:"sm",variant:"secondary",onClick:()=>W(null),children:[p.jsx(di,{size:14})," Platform"]})]}),(R.platforms||[]).length===0?p.jsx(xn,{message:"No platforms configured."}):p.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:(R.platforms||[]).map((te,ce)=>p.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-xl border border-black/10 p-3 dark:border-white/[0.08]",children:[p.jsxs("div",{className:"min-w-0",children:[p.jsx("p",{className:"truncate text-sm font-medium text-slate-950 dark:text-white",children:te.type}),p.jsx("p",{className:"mt-1 truncate text-xs text-muted-foreground",children:Y6(te)})]}),p.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[p.jsx(Ae,{variant:"secondary",size:"sm",onClick:()=>W(ce),"aria-label":`Configure ${te.type}`,children:p.jsx(Oo,{size:14})}),p.jsx(Ae,{variant:"danger",size:"sm",onClick:()=>Z(Ne=>{const De=[...Ne.platforms||[]];return De.splice(ce,1),{...Ne,platforms:De}}),children:p.jsx(ta,{size:14})})]})]},`${te.type}-${ce}`))})]}):null,p.jsx("div",{className:"flex flex-wrap gap-2 border-t border-black/10 pt-5 dark:border-white/[0.08]",children:p.jsxs(Ae,{className:"w-full sm:w-auto",onClick:()=>void D(),loading:M==="config",disabled:!q&&M!=="config",children:[p.jsx(kp,{size:14})," 保存更改"]})})]}):p.jsx(xn,{message:"选择或新建项目后开始配置。"})})]}),p.jsx(Pr,{open:!!g,onClose:()=>m(null),title:"新建项目",children:g?p.jsxs("div",{className:"space-y-4",children:[p.jsx(yt,{label:"Project name",value:g.name,onChange:te=>H({name:te.target.value}),autoFocus:!0}),p.jsx(Ca,{label:"Agent type",value:g.agentType,onChange:te=>{const ce=te.target.value;H({agentType:ce})},children:mp.map(te=>p.jsx("option",{value:te,children:te},te))}),p.jsx(yt,{label:"Work directory",value:g.workDir,onChange:te=>H({workDir:te.target.value}),placeholder:"/Users/yinyin/code/my-project"}),p.jsx(yt,{label:"Default model",value:g.model,onChange:te=>H({model:te.target.value}),placeholder:bp(g.agentType)||"Use agent default model"}),p.jsxs("div",{className:"flex flex-col-reverse gap-2 pt-2 sm:flex-row sm:justify-end",children:[p.jsx(Ae,{className:"w-full sm:w-auto",variant:"secondary",onClick:()=>m(null),children:"Cancel"}),p.jsxs(Ae,{className:"w-full sm:w-auto",onClick:j,children:[p.jsx(di,{size:14})," 新建项目"]})]})]}):null}),p.jsx(Pr,{open:!!x,onClose:()=>{v(null),S(null)},title:(x==null?void 0:x.index)===null?"Add platform":"Configure platform",children:x?p.jsxs("div",{className:"space-y-4",children:[p.jsxs(Ca,{label:"Platform",value:iw(x.draft.type,[...xp]),onChange:te=>{const ce=te.target.value===ui?x.draft.type:te.target.value;K(()=>sw(ce)),S(null)},children:[xp.map(te=>p.jsx("option",{value:te,children:te},te)),RU.filter(te=>!xp.includes(te)).map(te=>p.jsx("option",{value:te,children:te},te)),p.jsx("option",{value:ui,children:"custom"})]}),x.draft.type==="lark"?p.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[p.jsx(yt,{label:"App ID",value:String(((Me=x.draft.options)==null?void 0:Me.app_id)||""),onChange:te=>K(ce=>({...ce,options:{...ce.options||{},app_id:te.target.value}})),placeholder:"cli_xxx"}),p.jsx(yt,{label:"App Secret",type:"password",value:String(((Te=x.draft.options)==null?void 0:Te.app_secret)||""),onChange:te=>K(ce=>({...ce,options:{...ce.options||{},app_secret:te.target.value}}))}),p.jsx(yt,{label:"Verification token",value:String(((vt=x.draft.options)==null?void 0:vt.verification_token)||""),onChange:te=>K(ce=>({...ce,options:{...ce.options||{},verification_token:te.target.value}}))}),p.jsx(yt,{label:"Encrypt key",value:String(((Ie=x.draft.options)==null?void 0:Ie.encrypt_key)||""),onChange:te=>K(ce=>({...ce,options:{...ce.options||{},encrypt_key:te.target.value}}))}),p.jsxs("label",{className:"flex items-center gap-3 text-sm text-foreground",children:[p.jsx("input",{type:"checkbox",checked:((Xe=x.draft.options)==null?void 0:Xe.auto_approve)===!0,onChange:te=>K(ce=>({...ce,options:{...ce.options||{},auto_approve:te.target.checked}}))}),"Auto-approve Lark users"]})]}):null,x.draft.type==="weixin"?p.jsxs("div",{className:"space-y-3",children:[p.jsx("div",{className:"rounded-lg border border-black/10 bg-black/[0.03] px-3 py-3 text-sm text-muted-foreground dark:border-white/[0.08] dark:bg-white/[0.04]",children:"WeChat does not need an App ID or secret. Save this platform, then generate a QR code and scan it to finish login."}),E!=null&&E.qrCodeUrl?p.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-lg border border-black/10 p-4 dark:border-white/[0.08]",children:[p.jsx("div",{className:"rounded-lg border border-black/10 bg-white p-3",children:p.jsx(V_,{value:E.qrCodeUrl,size:176,includeMargin:!0})}),p.jsx(ZE,{tone:E.status==="confirmed"?"success":E.status==="expired"?"danger":"warning",children:E.status||"wait"})]}):null,p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap",children:[p.jsxs(Ae,{className:"w-full sm:w-auto",variant:"secondary",onClick:()=>void I(),loading:_,children:[p.jsx(x2,{size:14})," Generate QR"]}),p.jsx(Ae,{className:"w-full sm:w-auto",variant:"secondary",onClick:()=>void X(),loading:_,disabled:!(E!=null&&E.ticket),children:"Check status"})]})]}):null,x.draft.type!=="lark"&&x.draft.type!=="weixin"?p.jsx("div",{className:"rounded-lg border border-black/10 bg-black/[0.03] px-3 py-3 text-sm text-muted-foreground dark:border-white/[0.08] dark:bg-white/[0.04]",children:"This platform has no daily UI fields yet. Existing advanced options are preserved in config."}):null,p.jsxs("div",{className:"flex flex-col-reverse gap-2 border-t border-black/10 pt-4 dark:border-white/[0.08] sm:flex-row sm:justify-end",children:[p.jsx(Ae,{className:"w-full sm:w-auto",variant:"secondary",onClick:()=>v(null),children:"Cancel"}),p.jsxs(Ae,{className:"w-full sm:w-auto",onClick:L,children:[p.jsx(kp,{size:14})," Apply"]})]})]}):null})]})}function Z6(){const{t:e}=Fr(),[t,r]=w.useState([]),[i,l]=w.useState(!0),o=w.useCallback(async()=>{try{l(!0);const c=await bd();r(c.projects||[])}finally{l(!1)}},[]);return w.useEffect(()=>{o();const c=()=>o();return window.addEventListener("cc:refresh",c),()=>window.removeEventListener("cc:refresh",c)},[o]),i&&t.length===0?p.jsx("div",{className:"flex items-center justify-center h-64 text-muted-foreground animate-pulse",children:"Loading..."}):t.length===0?p.jsx(xn,{message:e("projects.noProjects"),icon:Nu}):p.jsxs("div",{className:"space-y-6 animate-fade-in",children:[p.jsx(Qi,{title:e("nav.projects"),description:"Project summaries with provider, platform, and session status."}),p.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4",children:t.map(c=>{var d;return p.jsx(Pn,{to:`/projects/${c.name}`,children:p.jsxs(Ht,{hover:!0,className:"h-full",children:[p.jsxs("div",{className:"flex items-start justify-between mb-3",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Iw,{size:18,className:"text-primary"}),p.jsx("h3",{className:"font-semibold text-foreground",children:c.name})]}),p.jsx(fm,{size:16,className:"text-muted-foreground/45"})]}),p.jsxs("div",{className:"flex flex-wrap gap-1.5 mb-3",children:[p.jsx(Cn,{variant:"info",children:c.agent_type}),(d=c.platforms)==null?void 0:d.map(f=>p.jsx(Cn,{children:f},f))]}),p.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[p.jsxs("span",{children:[c.sessions_count," ",e("nav.sessions").toLowerCase()]}),c.heartbeat_enabled&&p.jsxs("span",{className:"flex items-center gap-1 text-primary",children:[p.jsx(_p,{size:12})," ",e("heartbeat.title")]})]})]})},c.name)})})]})}const J6=e=>lt.get(`/projects/${e}/providers`),e8=(e,t)=>lt.post(`/projects/${e}/providers`,t),t8=(e,t)=>lt.delete(`/projects/${e}/providers/${t}`),n8=(e,t)=>lt.post(`/projects/${e}/providers/${t}/activate`),r8=e=>lt.get(`/projects/${e}/models`),a8=(e,t)=>lt.post(`/projects/${e}/model`,{model:t}),i8=e=>lt.get(`/projects/${e}/heartbeat`),s8=e=>lt.post(`/projects/${e}/heartbeat/pause`),l8=e=>lt.post(`/projects/${e}/heartbeat/resume`),o8=e=>lt.post(`/projects/${e}/heartbeat/run`),c8=(e,t)=>lt.post(`/projects/${e}/heartbeat/interval`,{minutes:t});function u8(){var Y,H;const{t:e}=Fr(),{name:t}=Do(),[r,i]=w.useState("overview"),[l,o]=w.useState(null),[c,d]=w.useState([]),[f,h]=w.useState(""),[g,m]=w.useState(null),[x,v]=w.useState([]),[E,S]=w.useState(""),[_,C]=w.useState(!0),[A,T]=w.useState(!1),[M,P]=w.useState({name:"",api_key:"",base_url:"",model:""}),[N,z]=w.useState(!1),[G,Q]=w.useState("30"),R=w.useCallback(async()=>{if(t)try{C(!0);const[j,F,W,K]=await Promise.allSettled([uL(t),J6(t),i8(t),r8(t)]);j.status==="fulfilled"&&o(j.value),F.status==="fulfilled"&&(d(F.value.providers||[]),h(F.value.active_provider||"")),W.status==="fulfilled"&&m(W.value),K.status==="fulfilled"&&(v(K.value.models||[]),S(K.value.current||""))}finally{C(!1)}},[t]);w.useEffect(()=>{R();const j=()=>R();return window.addEventListener("cc:refresh",j),()=>window.removeEventListener("cc:refresh",j)},[R]);const q=async()=>{!t||!M.name||(await e8(t,M),T(!1),P({name:"",api_key:"",base_url:"",model:""}),R())},Z=async()=>{t&&(await c8(t,parseInt(G)),z(!1),R())},ne=[{key:"overview",icon:QN},{key:"providers",icon:Pw},{key:"heartbeat",icon:_p}];return _&&!l?p.jsx("div",{className:"flex items-center justify-center h-64 text-muted-foreground animate-pulse",children:"Loading..."}):p.jsxs("div",{className:"space-y-6 animate-fade-in",children:[p.jsx(Qi,{title:t,description:"Project overview, providers, and heartbeat status. Low-frequency settings are no longer editable in the daily UI.",actions:p.jsx(Pn,{to:"/projects",children:p.jsxs(Ae,{variant:"secondary",size:"sm",children:[p.jsx(Xu,{size:14})," Back"]})})}),l&&p.jsx(Cn,{variant:"info",children:l.agent_type}),p.jsx("div",{className:"flex gap-2",children:ne.map(({key:j,icon:F})=>p.jsxs("button",{onClick:()=>i(j),className:Ke("flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-all",r===j?"bg-primary text-primary-foreground shadow-md":"bg-secondary text-secondary-foreground hover:bg-secondary/80"),children:[p.jsx(F,{size:16}),e(`projects.tabs.${j}`)]},j))}),r==="overview"&&l&&p.jsxs("div",{className:"space-y-4",children:[p.jsx(ka,{title:e("projects.platforms"),children:p.jsx("div",{className:"flex flex-wrap gap-2",children:(Y=l.platforms)==null?void 0:Y.map(j=>p.jsxs(Cn,{variant:j.connected?"success":"danger",children:[p.jsx(jw,{size:12,className:"mr-1"})," ",j.type," ",j.connected?"✓":"✗"]},j.type))})}),p.jsxs(ka,{title:e("sessions.title"),children:[p.jsxs("p",{className:"text-sm text-muted-foreground",children:[l.sessions_count," ",e("nav.sessions").toLowerCase()]}),((H=l.active_session_keys)==null?void 0:H.length)>0&&p.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:l.active_session_keys.map(j=>p.jsx(Cn,{variant:"default",children:j},j))})]})]}),r==="providers"&&p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"flex justify-between items-center",children:[p.jsx("h3",{className:"text-sm font-semibold text-foreground",children:e("providers.title")}),p.jsxs(Ae,{size:"sm",onClick:()=>T(!0),children:[p.jsx(di,{size:14})," ",e("providers.add")]})]}),c.length===0?p.jsx(xn,{message:e("common.noData")}):p.jsx("div",{className:"space-y-2",children:c.map(j=>p.jsx(Ht,{children:p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"font-medium text-foreground",children:j.name}),j.active&&p.jsx(Cn,{variant:"success",children:e("providers.active")})]}),p.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[j.model," ",j.base_url?`· ${j.base_url}`:""]})]}),p.jsxs("div",{className:"flex gap-2",children:[!j.active&&p.jsxs(Ae,{size:"sm",variant:"secondary",onClick:()=>{n8(t,j.name).then(R)},children:[p.jsx(vo,{size:14})," ",e("providers.activate")]}),!j.active&&p.jsx(Ae,{size:"sm",variant:"danger",onClick:()=>{t8(t,j.name).then(R)},children:p.jsx(ta,{size:14})})]})]})},j.name))}),x.length>0&&p.jsxs(Ht,{children:[p.jsx("h3",{className:"text-sm font-semibold text-foreground mb-3",children:e("providers.models")}),p.jsx("div",{className:"flex flex-wrap gap-2",children:x.map(j=>p.jsx("button",{onClick:()=>{a8(t,j).then(R)},className:Ke("px-3 py-1.5 rounded-lg text-xs font-medium transition-all",j===E?"bg-primary/15 text-primary border border-primary/30":"bg-secondary text-secondary-foreground hover:bg-secondary/80"),children:j},j))})]}),p.jsx(Pr,{open:A,onClose:()=>T(!1),title:e("providers.add"),children:p.jsxs("div",{className:"space-y-3",children:[p.jsx(yt,{label:e("providers.name"),value:M.name,onChange:j=>P({...M,name:j.target.value})}),p.jsx(yt,{label:"API Key",type:"password",value:M.api_key,onChange:j=>P({...M,api_key:j.target.value})}),p.jsx(yt,{label:e("providers.baseUrl"),value:M.base_url,onChange:j=>P({...M,base_url:j.target.value}),placeholder:"https://api.example.com"}),p.jsx(yt,{label:e("providers.model"),value:M.model,onChange:j=>P({...M,model:j.target.value})}),p.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[p.jsx(Ae,{variant:"secondary",onClick:()=>T(!1),children:e("common.cancel")}),p.jsx(Ae,{onClick:q,children:e("providers.add")})]})]})})]}),r==="heartbeat"&&p.jsxs("div",{className:"space-y-4",children:[g?p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[p.jsxs(Ht,{children:[p.jsx("p",{className:"text-xs text-muted-foreground",children:e("heartbeat.status")}),p.jsx("p",{className:"text-lg font-bold text-foreground mt-1",children:g.paused?e("heartbeat.paused"):e("heartbeat.running")})]}),p.jsxs(Ht,{children:[p.jsx("p",{className:"text-xs text-muted-foreground",children:e("heartbeat.interval")}),p.jsxs("p",{className:"text-lg font-bold text-foreground mt-1",children:[g.interval_mins,"m"]})]}),p.jsxs(Ht,{children:[p.jsx("p",{className:"text-xs text-muted-foreground",children:e("heartbeat.runCount")}),p.jsx("p",{className:"text-lg font-bold text-foreground mt-1",children:g.run_count})]}),p.jsxs(Ht,{children:[p.jsx("p",{className:"text-xs text-muted-foreground",children:e("heartbeat.errorCount")}),p.jsx("p",{className:"text-lg font-bold text-foreground mt-1",children:g.error_count})]})]}),p.jsx(Ht,{children:p.jsxs("div",{className:"space-y-2 text-sm",children:[p.jsxs("p",{className:"text-muted-foreground",children:[e("heartbeat.lastRun"),": ",p.jsx("span",{className:"text-foreground",children:Zs(g.last_run)})]}),p.jsxs("p",{className:"text-muted-foreground",children:[e("heartbeat.skippedBusy"),": ",p.jsx("span",{className:"text-foreground",children:g.skipped_busy})]}),g.last_error&&p.jsx("p",{className:"text-destructive",children:g.last_error})]})}),p.jsxs("div",{className:"flex gap-2",children:[g.paused?p.jsxs(Ae,{onClick:()=>{l8(t).then(R)},children:[p.jsx(Dw,{size:14})," ",e("heartbeat.resume")]}):p.jsxs(Ae,{variant:"secondary",onClick:()=>{s8(t).then(R)},children:[p.jsx(h2,{size:14})," ",e("heartbeat.pause")]}),p.jsxs(Ae,{variant:"secondary",onClick:()=>{o8(t).then(R)},children:[p.jsx(_p,{size:14})," ",e("heartbeat.trigger")]}),p.jsxs(Ae,{variant:"secondary",onClick:()=>z(!0),children:[p.jsx(hm,{size:14})," ",e("heartbeat.setInterval")]})]})]}):p.jsx(xn,{message:e("common.noData")}),p.jsx(Pr,{open:N,onClose:()=>z(!1),title:e("heartbeat.setInterval"),children:p.jsxs("div",{className:"space-y-3",children:[p.jsx(yt,{label:`${e("heartbeat.interval")} (min)`,type:"number",value:G,onChange:j=>Q(j.target.value)}),p.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[p.jsx(Ae,{variant:"secondary",onClick:()=>z(!1),children:e("common.cancel")}),p.jsx(Ae,{onClick:Z,children:e("common.save")})]})]})})]})]})}function d8(e,t){if(!e)return"";const r=Date.now()-new Date(e).getTime(),i=Math.floor(r/6e4);if(i<1)return t("sessions.justNow");if(i<60)return`${i}m`;const l=Math.floor(i/60);return l<24?`${l}h`:`${Math.floor(l/24)}d`}function f8(){const{t:e}=Fr(),[t,r]=w.useState([]),[i,l]=w.useState([]),[o,c]=w.useState(""),[d,f]=w.useState(!0),h=w.useCallback(async()=>{f(!0);try{const{projects:m}=await bd();l(m||[]);const x=await Promise.all((m||[]).map(async v=>{try{const{sessions:E}=await D_(v.name);return{project:v.name,sessions:E||[]}}catch{return{project:v.name,sessions:[]}}}));r(x)}finally{f(!1)}},[]);w.useEffect(()=>{h();const m=()=>h();return window.addEventListener("cc:refresh",m),()=>window.removeEventListener("cc:refresh",m)},[h]);const g=w.useMemo(()=>(o?t.filter(x=>x.project===o):t).flatMap(x=>x.sessions.map(v=>({...v,_project:x.project}))).sort((x,v)=>(v.updated_at||v.created_at||"").localeCompare(x.updated_at||x.created_at||"")),[t,o]);return d&&t.length===0?p.jsx("div",{className:"flex items-center justify-center h-64 text-muted-foreground animate-pulse",children:"Loading..."}):p.jsxs("div",{className:"space-y-4 animate-fade-in",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(Aw,{size:16,className:"text-muted-foreground"}),p.jsxs(Ca,{value:o,onChange:m=>c(m.target.value),className:"w-auto min-w-48",children:[p.jsx("option",{value:"",children:e("sessions.allProjects")}),i.map(m=>p.jsx("option",{value:m.name,children:m.name},m.name))]}),p.jsxs("span",{className:"text-xs text-muted-foreground",children:[g.length," ",e("nav.sessions").toLowerCase()]})]}),g.length===0?p.jsx(xn,{message:e("sessions.noSessions"),icon:_a}):p.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-3",children:g.map(m=>p.jsx(Pn,{to:`/sessions/${encodeURIComponent(m._project)}/${encodeURIComponent(m.id)}`,children:p.jsxs(Ht,{hover:!0,className:"group relative h-full p-4",children:[p.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[p.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[p.jsx(_a,{size:14,className:m.live?"text-primary shrink-0":"text-muted-foreground shrink-0"}),p.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:m.name||m.user_name||m.id.slice(0,8)}),m.live&&p.jsx(qs,{size:5,className:"fill-primary text-primary shrink-0"})]}),p.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0 mt-0.5",children:d8(m.updated_at||m.created_at,e)})]}),p.jsx("div",{className:"mb-2.5 min-h-[2.5rem]",children:m.last_message?p.jsxs("p",{className:"text-xs text-muted-foreground line-clamp-2 leading-relaxed",children:[m.last_message.role==="user"?p.jsx(Ju,{size:10,className:"inline mr-1 -mt-0.5 opacity-60"}):p.jsx(Wu,{size:10,className:"inline mr-1 -mt-0.5 opacity-60"}),m.last_message.content.replace(/\n/g," ").slice(0,100)]}):p.jsx("p",{className:"text-xs text-muted-foreground italic",children:e("sessions.noMessages")})}),p.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[p.jsx(Cn,{children:m._project}),m.platform&&p.jsx(Cn,{variant:"info",children:m.platform}),p.jsxs("span",{className:"text-[10px] text-muted-foreground ml-auto",children:[m.history_count," msgs"]})]})]})},`${m._project}-${m.id}`))})]})}function h8(){var S;const{t:e}=Fr(),{project:t,id:r}=Do(),[i,l]=w.useState(null),[o,c]=w.useState(""),[d,f]=w.useState(!1),[h,g]=w.useState(!0),m=w.useRef(null),x=w.useCallback(async()=>{if(!(!t||!r))try{g(!0);const _=await j_(t,r,200);l(_)}finally{g(!1)}},[t,r]);w.useEffect(()=>{x()},[x]),w.useEffect(()=>{var _;(_=m.current)==null||_.scrollIntoView({behavior:"smooth"})},[i==null?void 0:i.history]);const v=async()=>{if(!o.trim()||!t||!i)return;const _=o.trim();c(""),f(!0);try{await sm(t,{session_key:i.session_key,message:_}),setTimeout(x,1500)}finally{f(!1)}},E=_=>{_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),v())};return h&&!i?p.jsx("div",{className:"flex items-center justify-center h-64 text-muted-foreground animate-pulse",children:"Loading..."}):p.jsxs("div",{className:"flex flex-col h-[calc(100vh-8rem)] animate-fade-in",children:[p.jsxs("div",{className:"flex items-center justify-between pb-4 border-b",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(Pn,{to:"/sessions",className:"p-2 rounded-md hover:bg-accent/10 transition-colors",children:p.jsx(Xu,{size:18,className:"text-muted-foreground"})}),p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("h2",{className:"text-lg font-semibold text-foreground",children:(i==null?void 0:i.name)||r}),i!=null&&i.live?p.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-primary bg-primary/10 px-1.5 py-0.5 rounded-full",children:[p.jsx(qs,{size:5,className:"fill-current"})," live"]}):p.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded-full",children:[p.jsx(Cp,{size:9})," ",e("sessions.offline")]})]}),p.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[p.jsx(Cn,{children:t}),(i==null?void 0:i.platform)&&p.jsx(Cn,{variant:"info",children:i.platform}),p.jsx("span",{className:"text-xs text-muted-foreground",children:i==null?void 0:i.session_key})]})]})]}),p.jsxs(Ae,{size:"sm",variant:"ghost",onClick:x,children:[p.jsx(Lw,{size:14})," ",e("common.refresh")]})]}),p.jsxs("div",{className:"flex-1 overflow-y-auto py-6 space-y-5",children:[(!(i!=null&&i.history)||i.history.length===0)&&p.jsx("p",{className:"text-center text-sm text-muted-foreground py-12",children:e("sessions.noMessages")}),(S=i==null?void 0:i.history)==null?void 0:S.map((_,C)=>{const A=_.role==="user";return p.jsxs("div",{className:Ke("flex gap-3",A?"justify-end":"justify-start"),children:[!A&&p.jsx("div",{className:"w-8 h-8 rounded-md bg-primary/10 flex items-center justify-center shrink-0 mt-1",children:p.jsx(Wu,{size:16,className:"text-primary"})}),p.jsx("div",{className:Ke("rounded-lg px-5 py-3.5 text-sm",A?"max-w-[70%] bg-primary text-primary-foreground rounded-br-md":"max-w-[85%] bg-card border text-card-foreground rounded-bl-md shadow-sm"),children:p.jsx(mg,{content:_.content,isUser:A})}),A&&p.jsx("div",{className:"w-8 h-8 rounded-md bg-muted flex items-center justify-center shrink-0 mt-1",children:p.jsx(Ju,{size:16,className:"text-muted-foreground"})})]},C)}),p.jsx("div",{ref:m})]}),p.jsx("div",{className:"border-t pt-4",children:i!=null&&i.live?p.jsxs("div",{className:"flex gap-3",children:[p.jsx(yt,{value:o,onChange:_=>c(_.target.value),onKeyDown:E,placeholder:e("sessions.messageInput"),className:"flex-1",disabled:d}),p.jsx(Ae,{onClick:v,disabled:d||!o.trim(),size:"icon","aria-label":e("sessions.messageInput"),children:d?p.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[p.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),p.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):p.jsx(pm,{size:18})})]}):p.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 text-sm text-muted-foreground bg-muted rounded-lg",children:[p.jsx(Cp,{size:14}),p.jsx("span",{children:e("sessions.notLiveHint")})]})})]})}const p8=e=>Tj(),m8=e=>Aj(e),g8=(e,t)=>Rj(e,t),b8=e=>Oj(e),y8=e=>Mj(e),x8=()=>Gm().then(e=>e.workspaces),Cu={workspaceId:"",executionMode:"same-thread",triggerType:"cron",cronExpr:"0 9 * * *",runAt:"",promptTemplate:"",description:"",chatId:"",platformUserId:"",threadId:"",enabled:!0};function v8(e){return e?{workspaceId:e.workspaceId,executionMode:e.executionMode,triggerType:e.triggerType,cronExpr:e.cronExpr||"0 9 * * *",runAt:e.runAt?String(e.runAt).slice(0,16):"",promptTemplate:e.promptTemplate,description:e.description,chatId:e.route.channelId,platformUserId:e.route.participantId||"",threadId:e.route.threadId||"",enabled:e.enabled}:Cu}function w8(e){return{workspaceId:e.workspaceId,platform:"lark",route:{type:"channel.chat",channelId:e.chatId||e.workspaceId||"default",participantId:e.platformUserId||"default",...e.threadId?{threadId:e.threadId}:{}},executionMode:e.executionMode||"same-thread",triggerType:e.triggerType,...e.triggerType==="cron"?{cronExpr:e.cronExpr,runAt:void 0}:{runAt:new Date(e.runAt).toISOString(),cronExpr:void 0},promptTemplate:e.promptTemplate,description:e.description,enabled:e.enabled}}function E8(){const{t:e}=Fr(),[t,r]=w.useState([]),[i,l]=w.useState([]),[o,c]=w.useState(!0),[d,f]=w.useState(!1),[h,g]=w.useState(!1),[m,x]=w.useState(null),[v,E]=w.useState(Cu),S=w.useMemo(()=>i.map(N=>p.jsx("option",{value:N.id,children:N.name},N.id)),[i]),_=w.useCallback(async()=>{c(!0);try{const[N,z]=await Promise.all([p8(),x8()]);r(N.jobs||[]),l(z),E(G=>G.workspaceId||z.length===0?G:{...G,workspaceId:z[0].id})}finally{c(!1)}},[]);w.useEffect(()=>{_();const N=qm(z=>{(z.type==="scheduler.job.updated"||z.type==="scheduler.run.updated")&&_()});return()=>N()},[_]);const C=()=>{var N;x(null),E({...Cu,workspaceId:((N=i[0])==null?void 0:N.id)||""}),f(!0)},A=N=>{x(N),E(v8(N)),f(!0)},T=async()=>{if(!(!v.workspaceId||!v.promptTemplate.trim())&&!(v.triggerType==="once"&&!v.runAt)){g(!0);try{const N=w8(v);m?await g8(m.id,N):await m8(N),f(!1),x(null),E(Cu),await _()}finally{g(!1)}}},M=async N=>{confirm(e("common.confirmDelete"))&&(await b8(N),await _())},P=async N=>{await y8(N),await _()};return o&&t.length===0?p.jsx("div",{className:"flex items-center justify-center h-64 text-gray-400 animate-pulse",children:e("common.loading")}):p.jsxs("div",{className:"space-y-4 animate-fade-in",children:[p.jsx(Qi,{title:e("cron.title"),description:"Create simple scheduled prompts for a workspace.",actions:p.jsxs(Ae,{onClick:C,children:[p.jsx(di,{size:16})," ",e("cron.add")]})}),t.length===0?p.jsx(xn,{message:e("cron.noJobs"),icon:hm}):p.jsx("div",{className:"space-y-3",children:t.map(N=>p.jsx(Ht,{children:p.jsxs("div",{className:"flex items-start justify-between gap-3",children:[p.jsxs("div",{className:"flex-1",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[p.jsx("span",{className:"font-medium text-gray-900 dark:text-white text-sm",children:N.description||N.id}),p.jsx(Cn,{variant:N.enabled?"success":"default",children:N.enabled?e("cron.enabled"):"disabled"}),p.jsx(Cn,{variant:"default",children:N.triggerType}),p.jsx(Cn,{variant:"default",children:N.platform}),N.lastStatus&&p.jsx(Cn,{variant:N.lastStatus==="failed"?"danger":"default",children:N.lastStatus})]}),p.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-gray-500 dark:text-gray-400 mt-2",children:[p.jsxs("span",{children:[p.jsx("strong",{children:"Workspace:"})," ",N.workspaceId]}),p.jsxs("span",{children:[p.jsx("strong",{children:"Execution:"})," ",N.executionMode]}),p.jsxs("span",{children:[p.jsx("strong",{children:"Route:"})," ",N.route.channelId," / ",N.route.participantId]}),p.jsxs("span",{children:[p.jsxs("strong",{children:[N.triggerType==="cron"?e("cron.expression"):"Run at",":"]})," ",N.triggerType==="cron"?N.cronExpr:Zs(N.runAt||"")]}),N.route.threadId&&p.jsxs("span",{children:[p.jsx("strong",{children:"Thread:"})," ",N.route.threadId]}),N.lastRunAt&&p.jsxs("span",{children:[p.jsxs("strong",{children:[e("cron.lastRun"),":"]})," ",Zs(N.lastRunAt)]})]}),p.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-300 mt-2 whitespace-pre-wrap",children:N.promptTemplate}),N.lastError&&p.jsx("p",{className:"text-xs text-red-500 mt-2",children:N.lastError})]}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(Ae,{size:"sm",variant:"secondary",onClick:()=>void P(N.id),children:p.jsx(Dw,{size:14})}),p.jsx(Ae,{size:"sm",variant:"secondary",onClick:()=>A(N),children:p.jsx(wo,{size:14})}),p.jsx(Ae,{size:"sm",variant:"danger",onClick:()=>void M(N.id),children:p.jsx(ta,{size:14})})]})]})},N.id))}),p.jsx(Pr,{open:d,onClose:()=>f(!1),title:m?"Edit scheduler job":e("cron.add"),children:p.jsxs("div",{className:"space-y-3",children:[p.jsxs(Ca,{label:"Workspace",value:v.workspaceId,onChange:N=>E({...v,workspaceId:N.target.value}),children:[p.jsx("option",{value:"",children:"Select workspace"}),S]}),p.jsxs(Ca,{label:"Schedule type",value:v.triggerType,onChange:N=>E({...v,triggerType:N.target.value}),children:[p.jsx("option",{value:"cron",children:"Repeating"}),p.jsx("option",{value:"once",children:"One time"})]}),v.triggerType==="cron"?p.jsx(yt,{label:e("cron.expression"),value:v.cronExpr,onChange:N=>E({...v,cronExpr:N.target.value}),placeholder:"0 9 * * *"}):p.jsx(yt,{label:"Run at",type:"datetime-local",value:v.runAt,onChange:N=>E({...v,runAt:N.target.value})}),p.jsx(yt,{label:e("cron.description"),value:v.description,onChange:N=>E({...v,description:N.target.value})}),p.jsx(gd,{label:e("cron.prompt"),value:v.promptTemplate,onChange:N=>E({...v,promptTemplate:N.target.value}),rows:4,placeholder:"Summarize today's blockers and post a status update."}),p.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-700 dark:text-gray-300",children:[p.jsx("input",{type:"checkbox",checked:v.enabled,onChange:N=>E({...v,enabled:N.target.checked})}),e("cron.enabled")]}),p.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[p.jsx(Ae,{variant:"secondary",onClick:()=>f(!1),children:e("common.cancel")}),p.jsx(Ae,{onClick:()=>void T(),disabled:h,children:e(m?"common.save":"cron.add")})]})]})})]})}const S8=()=>lt.get("/status"),_8=e=>lt.post("/restart",e),k8=()=>lt.post("/reload"),C8=e=>lt.get("/logs",e);function N8(e){return e==="api_ready"?"success":e==="error"?"danger":e==="starting"?"warning":"neutral"}function T8(){const{t:e}=Fr(),[t,r]=w.useState(null),[i,l]=w.useState(null),[o,c]=w.useState(""),[d,f]=w.useState(""),[h,g]=w.useState(!0),[m,x]=w.useState(!1),[v,E]=w.useState(""),S=w.useCallback(async()=>{g(!0);try{const[M,P]=await Promise.allSettled([Ym(),iL()]);M.status==="fulfilled"&&(r(M.value),c(M.value.settings.knowledge.baseUrl||""),f(M.value.settings.knowledge.baseUrl||"")),P.status==="fulfilled"&&l(P.value)}finally{g(!1)}},[]);w.useEffect(()=>{S()},[S]);const _=async()=>{if(confirm(e("system.restartConfirm")))try{await _8(),E(e("common.success")),await S()}catch(M){E(M.message)}},C=async()=>{if(confirm(e("system.reloadConfirm")))try{await k8(),E(e("common.success")),await S()}catch(M){E(M.message)}},A=async()=>{x(!0);try{const M=await aL({knowledge:{baseUrl:o,authMode:(t==null?void 0:t.settings.knowledge.authMode)||"none",token:(t==null?void 0:t.settings.knowledge.token)||"",headerName:(t==null?void 0:t.settings.knowledge.headerName)||"X-API-Key",defaultCollection:(t==null?void 0:t.settings.knowledge.defaultCollection)||"personal_knowledge"}});r(P=>P&&{...P,settings:M}),f(M.knowledge.baseUrl||""),E(e("common.success"))}catch(M){E(M.message)}finally{x(!1)}},T=o!==d;return p.jsxs("div",{className:"space-y-6 animate-fade-in",children:[p.jsx(Qi,{title:e("nav.system"),description:"Runtime health, logs, and plugin diagnostics. Advanced config is available read-only from the diagnostics drawer.",actions:p.jsxs(p.Fragment,{children:[p.jsxs(Ae,{variant:"secondary",onClick:C,children:[p.jsx(Qu,{size:16})," ",e("system.reload")]}),p.jsxs(Ae,{variant:"danger",onClick:_,children:[p.jsx(E2,{size:16})," ",e("system.restart")]}),p.jsx(Pn,{to:"/system/logs",children:p.jsxs(Ae,{variant:"secondary",children:[p.jsx(C2,{size:16})," ",e("system.logs")]})})]})}),v?p.jsx("div",{role:"status",className:"rounded-lg border border-primary/20 bg-primary/10 px-4 py-3 text-sm text-primary",children:v}):null,p.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-3",children:[p.jsxs(ka,{title:"Runtime",description:h?"Loading...":"Local service status.",children:[p.jsx(ZE,{tone:N8(t==null?void 0:t.phase),children:(t==null?void 0:t.phase)||"unknown"}),p.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:t!=null&&t.pendingRestart?"Restart required to apply saved changes.":"No pending restart."})]}),p.jsx(ka,{title:"Config",description:"Active config file location.",children:p.jsxs("div",{className:"flex items-start gap-3",children:[p.jsx(LN,{size:18,className:"mt-0.5 text-primary"}),p.jsx("p",{className:"break-all font-mono text-xs leading-5 text-muted-foreground",children:(t==null?void 0:t.settings.configPath)||(t==null?void 0:t.configFile.path)||"-"})]})}),p.jsxs(ka,{title:"Plugins",description:"Health summary only.",children:[p.jsx("p",{className:"text-2xl font-semibold text-foreground",children:i?`${i.enabledPluginCount}/${i.pluginCount}`:"-"}),p.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"enabled plugins"})]})]}),p.jsx(ka,{title:"Knowledge",description:"System-wide knowledge API connection.",actions:p.jsxs(Ae,{size:"sm",onClick:()=>void A(),loading:m,disabled:!T&&!m,children:[p.jsx(kp,{size:14})," Save"]}),children:p.jsx(yt,{label:"Knowledge base URL",value:o,onChange:M=>c(M.target.value),placeholder:"http://127.0.0.1:16007"})}),p.jsx(ka,{title:e("system.plugins"),description:"Plugin state is read-only in the daily UI. Use backend config for advanced changes.",children:i?i.plugins.length===0?p.jsx("div",{className:"py-8 text-sm text-muted-foreground",children:"No plugins registered."}):p.jsx("div",{className:"divide-y divide-border",children:i.plugins.map(M=>p.jsxs("div",{className:"flex items-start justify-between gap-4 py-3",children:[p.jsxs("div",{className:"min-w-0",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(jw,{size:15,className:"text-muted-foreground"}),p.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:M.pluginId})]}),p.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:M.health.summary||M.manifest.provides.join(", ")||"No declared capabilities"})]}),p.jsx(Cn,{variant:M.health.status==="healthy"?"success":M.health.status==="failed"?"danger":"warning",children:M.health.status})]},M.pluginId))}):p.jsx("div",{className:"py-8 text-sm text-muted-foreground",children:"Loading..."})})]})}const A8={debug:"text-gray-400",info:"text-blue-400",warn:"text-amber-400",error:"text-red-400"},R8={debug:"default",info:"info",warn:"warning",error:"danger"};function O8(){const{t:e}=Fr(),[t,r]=w.useState([]),[i,l]=w.useState("info"),[o,c]=w.useState("100"),[d,f]=w.useState(!0),h=w.useCallback(async()=>{f(!0);try{const g=await C8({level:i,limit:o});r(g.entries||[])}finally{f(!1)}},[i,o]);return w.useEffect(()=>{h()},[h]),p.jsxs("div",{className:"space-y-4 animate-fade-in",children:[p.jsx(Qi,{title:e("system.logs"),description:"Filtered runtime logs for troubleshooting.",actions:p.jsx(Pn,{to:"/system",children:p.jsxs(Ae,{variant:"secondary",size:"sm",children:[p.jsx(Xu,{size:14})," ",e("nav.system")]})})}),p.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Aw,{size:14,className:"text-muted-foreground"}),p.jsxs(Ca,{value:i,onChange:g=>l(g.target.value),className:"w-auto",children:[p.jsx("option",{value:"debug",children:"Debug"}),p.jsx("option",{value:"info",children:"Info"}),p.jsx("option",{value:"warn",children:"Warn"}),p.jsx("option",{value:"error",children:"Error"})]})]}),p.jsxs(Ca,{value:o,onChange:g=>c(g.target.value),className:"w-auto",children:[p.jsx("option",{value:"50",children:"50"}),p.jsx("option",{value:"100",children:"100"}),p.jsx("option",{value:"500",children:"500"}),p.jsx("option",{value:"1000",children:"1000"})]}),p.jsx(Ae,{size:"sm",variant:"secondary",onClick:h,children:e("common.refresh")})]}),p.jsx(Ht,{children:d?p.jsx("div",{className:"text-muted-foreground animate-pulse text-sm",children:"Loading..."}):t.length===0?p.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:e("common.noData")}):p.jsx("div",{className:"space-y-1 max-h-[65vh] overflow-y-auto font-mono text-xs",children:t.map((g,m)=>{var x;return p.jsxs("div",{className:"flex items-start gap-3 py-1.5 border-b last:border-0",children:[p.jsx("span",{className:"text-muted-foreground shrink-0 w-36",children:(x=g.time)==null?void 0:x.slice(0,19)}),p.jsx(Cn,{variant:R8[g.level]||"default",children:g.level}),p.jsx("span",{className:`${A8[g.level]||"text-gray-500"} flex-1`,children:g.message})]},m)})})})]})}function ow(e){return e==="success"?"border-violet-200 bg-violet-50 text-violet-700 dark:border-violet-900/30 dark:bg-violet-950/20 dark:text-violet-300":e==="warning"?"border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-900/30 dark:bg-amber-950/20 dark:text-amber-300":"border-red-200 bg-red-50 text-red-700 dark:border-red-900/30 dark:bg-red-950/20 dark:text-red-300"}function M8(e){switch(e){case"file":return"bg-blue-500";case"spark":return"bg-amber-500";case"screen":return"bg-fuchsia-500";default:return"bg-indigo-500"}}function D8(e){return e.split("/").length-1}function j8(){const[e,t]=w.useState(!0),[r,i]=w.useState([]),[l,o]=w.useState([]),[c,d]=w.useState(null),[f,h]=w.useState(""),[g,m]=w.useState(!1),[x,v]=w.useState(!1),[E,S]=w.useState(!1),[_,C]=w.useState(""),[A,T]=w.useState(""),[M,P]=w.useState(""),[N,z]=w.useState(null),[G,Q]=w.useState(null),R=w.useCallback(async()=>{t(!0);try{const[K,L,I]=await Promise.all([Vp(),GE(),VE()]);m(!!K.baseUrl),i(L.folders||[]),o(I.bases||[])}catch(K){z({tone:"error",message:K instanceof Error?K.message:String(K)})}finally{t(!1)}},[]);w.useEffect(()=>{R()},[R]);const q=w.useMemo(()=>{if(!c)return null;const K=r.find(I=>I.id===c);if(!K)return null;const L=new Set([K.id]);return r.forEach(I=>{I.path.startsWith(`${K.path}/`)&&L.add(I.id)}),L},[r,c]),Z=w.useMemo(()=>{const K=f.trim().toLowerCase();return l.filter(L=>(q?q.has(L.folderId||""):!0)?K?[L.name,L.description,L.creatorName].join(" ").toLowerCase().includes(K):!0:!1)},[l,q,f]),ne=w.useCallback(async()=>{if(!_.trim()){z({tone:"warning",message:"Folder name is required."});return}Q("folder");try{await Pj({name:_.trim(),parentId:c}),C(""),v(!1),z({tone:"success",message:"Folder created."}),await R()}catch(K){z({tone:"error",message:K instanceof Error?K.message:String(K)})}finally{Q(null)}},[_,R,c]),Y=w.useCallback(async()=>{if(!A.trim()){z({tone:"warning",message:"Knowledge base name is required."});return}Q("base");try{await Fj({name:A.trim(),description:M.trim(),folderId:c}),T(""),P(""),S(!1),z({tone:"success",message:"Knowledge base created."}),await R()}catch(K){z({tone:"error",message:K instanceof Error?K.message:String(K)})}finally{Q(null)}},[M,A,R,c]),H=w.useCallback(async K=>{var I;const L=(I=window.prompt("Rename folder",K.name))==null?void 0:I.trim();if(!(!L||L===K.name))try{await Bj(K.id,{name:L}),z({tone:"success",message:"Folder updated."}),await R()}catch(X){z({tone:"error",message:X instanceof Error?X.message:String(X)})}},[R]),j=w.useCallback(async K=>{if(window.confirm(`Delete folder "${K.name}"?`))try{await Uj(K.id),c===K.id&&d(null),z({tone:"success",message:"Folder deleted."}),await R()}catch(L){z({tone:"error",message:L instanceof Error?L.message:String(L)})}},[R,c]),F=w.useCallback(async K=>{var X,D;const L=(X=window.prompt("Knowledge base name",K.name))==null?void 0:X.trim();if(!L)return;const I=((D=window.prompt("Description",K.description))==null?void 0:D.trim())??K.description;try{await Hj(K.id,{name:L,description:I}),z({tone:"success",message:"Knowledge base updated."}),await R()}catch(J){z({tone:"error",message:J instanceof Error?J.message:String(J)})}},[R]),W=w.useCallback(async K=>{if(window.confirm(`Delete knowledge base "${K.name}"?`))try{await Kj(K.id),z({tone:"success",message:"Knowledge base deleted."}),await R()}catch(L){z({tone:"error",message:L instanceof Error?L.message:String(L)})}},[R]);return p.jsxs("div",{className:"space-y-6 animate-fade-in",children:[N&&p.jsx("div",{className:`rounded-xl border px-4 py-3 text-sm ${ow(N.tone)}`,children:N.message}),!g&&!e&&p.jsx("div",{className:`rounded-2xl border px-5 py-4 ${ow("warning")}`,children:p.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[p.jsxs("div",{children:[p.jsx("p",{className:"font-medium",children:"Knowledge search is not configured yet."}),p.jsx("p",{className:"mt-1 text-sm opacity-90",children:"Add the ai_vector base URL in System settings before uploading files or running retrieval."})]}),p.jsx(Pn,{to:"/system",children:p.jsxs(Ae,{variant:"secondary",children:[p.jsx(Oo,{size:14})," Open System Settings"]})})]})}),p.jsxs("div",{className:"grid grid-cols-1 gap-6 xl:grid-cols-[300px_minmax(0,1fr)]",children:[p.jsxs(Ht,{className:"p-0 overflow-hidden",children:[p.jsx("div",{className:"border-b border-gray-200/80 px-5 py-4 dark:border-white/[0.08]",children:p.jsxs("div",{className:"flex items-center justify-between gap-3",children:[p.jsxs("div",{children:[p.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"知识库"}),p.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:"创建目录并管理知识库分类。"})]}),p.jsxs(Ae,{size:"sm",variant:"secondary",onClick:()=>v(!0),children:[p.jsx(UN,{size:14})," 文件夹"]})]})}),p.jsx("div",{className:"px-5 py-4",children:p.jsxs("button",{type:"button",onClick:()=>d(null),className:Ke("flex w-full items-center justify-between rounded-xl px-3 py-2.5 text-left text-sm transition-colors",c?"hover:bg-gray-100/80 text-gray-600 dark:text-gray-300 dark:hover:bg-white/[0.06]":"bg-accent/10 text-gray-900 ring-1 ring-accent/30 dark:text-white"),children:[p.jsxs("span",{className:"flex items-center gap-2",children:[p.jsx(Ah,{size:16}),"全部知识库"]}),p.jsx("span",{className:"text-xs opacity-70",children:l.length})]})}),p.jsx("div",{className:"max-h-[70vh] overflow-y-auto px-3 pb-4",children:r.length===0?p.jsx(xn,{message:"还没有目录,先创建一个文件夹吧。",icon:Ah}):p.jsx("div",{className:"space-y-1",children:r.map(K=>{const L=K.id===c;return p.jsx("div",{className:Ke("group rounded-xl px-2 py-1",L?"bg-accent/10 ring-1 ring-accent/25":"hover:bg-gray-100/80 dark:hover:bg-white/[0.04]"),children:p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs("button",{type:"button",onClick:()=>d(K.id),className:"flex min-w-0 flex-1 items-center gap-2 rounded-lg px-2 py-2 text-left",style:{paddingLeft:`${8+D8(K.path)*18}px`},children:[p.jsx(Tw,{size:14,className:"text-gray-400"}),p.jsx(Ah,{size:15,className:"text-amber-500"}),p.jsx("span",{className:"truncate text-sm text-gray-800 dark:text-gray-100",children:K.name})]}),p.jsx("button",{type:"button",onClick:()=>void H(K),className:"rounded-md p-1 text-gray-400 transition hover:bg-gray-200/70 hover:text-gray-700 dark:hover:bg-white/[0.08] dark:hover:text-white","aria-label":`Rename ${K.name}`,children:p.jsx(wo,{size:14})}),p.jsx("button",{type:"button",onClick:()=>void j(K),className:"rounded-md p-1 text-gray-400 transition hover:bg-red-500/10 hover:text-red-500","aria-label":`Delete ${K.name}`,children:p.jsx(ta,{size:14})})]})},K.id)})})})]}),p.jsxs("div",{className:"space-y-5",children:[p.jsx(Ht,{children:p.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between",children:[p.jsxs("div",{children:[p.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"知识库列表"}),p.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:"目录筛选、本地搜索,以及知识库卡片概览都在这里。"})]}),p.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row",children:[p.jsxs("div",{className:"relative min-w-[260px]",children:[p.jsx(Zu,{size:16,className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),p.jsx(yt,{value:f,onChange:K=>h(K.target.value),placeholder:"搜索名称、描述或创建者",className:"pl-9"})]}),p.jsxs(Ae,{variant:"secondary",onClick:()=>S(!0),children:[p.jsx(di,{size:14})," 创建知识库"]})]})]})}),e?p.jsx(Ht,{children:p.jsx("div",{className:"py-16 text-center text-sm text-gray-400",children:"正在加载知识库…"})}):Z.length===0?p.jsx(Ht,{children:p.jsx(xn,{message:f?"没有匹配的知识库。":"还没有知识库,先创建一个开始上传文档。",icon:Rw})}):p.jsx("div",{className:"grid grid-cols-1 gap-5 md:grid-cols-2 2xl:grid-cols-3",children:Z.map(K=>p.jsxs(Ht,{className:"group relative overflow-hidden border border-gray-200/90 bg-white/90 p-6 shadow-sm hover:border-accent/30 hover:shadow-xl hover:shadow-black/5 dark:border-white/[0.08] dark:bg-[rgba(0,0,0,0.55)]",children:[p.jsxs("div",{className:"absolute right-4 top-4 flex gap-1",children:[p.jsx("button",{type:"button",onClick:()=>void F(K),className:"rounded-lg p-2 text-gray-400 hover:bg-gray-100/90 hover:text-gray-700 dark:hover:bg-white/[0.08] dark:hover:text-white",children:p.jsx(wo,{size:15})}),p.jsx("button",{type:"button",onClick:()=>void W(K),className:"rounded-lg p-2 text-gray-400 hover:bg-red-500/10 hover:text-red-500",children:p.jsx(ta,{size:15})})]}),p.jsxs(Pn,{to:`/knowledge/${encodeURIComponent(K.id)}`,className:"block space-y-5",children:[p.jsxs("div",{className:"flex items-start gap-4",children:[p.jsx("div",{className:`mt-1 flex h-12 w-12 items-center justify-center rounded-2xl text-white shadow-lg ${M8(K.icon)}`,children:p.jsx(Nw,{size:22})}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsx("h3",{className:"truncate pr-8 text-xl font-semibold text-gray-900 dark:text-white",children:K.name}),p.jsxs("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:["创建者: ",K.creatorName||"系统管理员"]})]})]}),p.jsx("div",{className:"min-h-[72px] text-base leading-7 text-gray-600 dark:text-gray-300",children:K.description||"这个知识库还没有描述,点击进入后可以上传文件并开始检索。"}),p.jsxs("div",{className:"flex items-center gap-6 text-sm font-medium text-gray-700 dark:text-gray-200",children:[p.jsxs("span",{children:[K.fileCount," 文档数"]}),p.jsxs("span",{children:[(K.wordCount/1e3).toFixed(K.wordCount>0?1:0),"k 字符"]})]}),p.jsxs("div",{className:"text-xs text-gray-400 dark:text-gray-500",children:["更新于 ",Zs(K.updatedAt)]})]})]},K.id))})]})]}),p.jsx(Pr,{open:x,onClose:()=>v(!1),title:"创建文件夹",children:p.jsxs("div",{className:"space-y-4",children:[p.jsx(yt,{label:"文件夹名称",value:_,onChange:K=>C(K.target.value),placeholder:"例如:产品文档"}),p.jsxs("div",{className:"flex justify-end gap-2",children:[p.jsx(Ae,{variant:"secondary",onClick:()=>v(!1),children:"取消"}),p.jsx(Ae,{onClick:()=>void ne(),loading:G==="folder",children:"创建"})]})]})}),p.jsx(Pr,{open:E,onClose:()=>S(!1),title:"创建知识库",children:p.jsxs("div",{className:"space-y-4",children:[p.jsx(yt,{label:"名称",value:A,onChange:K=>T(K.target.value),placeholder:"例如:运营文档库"}),p.jsx(gd,{label:"描述",rows:4,value:M,onChange:K=>P(K.target.value),placeholder:"一句话说明这个知识库主要收录什么内容"}),p.jsxs("div",{className:"flex justify-end gap-2",children:[p.jsx(Ae,{variant:"secondary",onClick:()=>S(!1),children:"取消"}),p.jsx(Ae,{onClick:()=>void Y(),loading:G==="base",children:"创建"})]})]})})]})}function cw(e){return e==="success"?"border-violet-200 bg-violet-50 text-violet-700 dark:border-violet-900/30 dark:bg-violet-950/20 dark:text-violet-300":e==="warning"?"border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-900/30 dark:bg-amber-950/20 dark:text-amber-300":"border-red-200 bg-red-50 text-red-700 dark:border-red-900/30 dark:bg-red-950/20 dark:text-red-300"}function L8(){const{knowledgebaseId:e=""}=Do(),[t,r]=w.useState(!0),[i,l]=w.useState(!1),[o,c]=w.useState(!1),[d,f]=w.useState(!1),[h,g]=w.useState(null),[m,x]=w.useState([]),[v,E]=w.useState([]),[S,_]=w.useState([]),[C,A]=w.useState(""),[T,M]=w.useState(null),P=w.useCallback(async()=>{if(e){r(!0);try{const[R,q,Z,ne]=await Promise.all([Vp(),$j(e),GE(),qj(e).catch(()=>({files:[]}))]);f(!!R.baseUrl),g(q),x(Z.folders||[]),E(ne.files||[])}catch(R){M({tone:"error",message:R instanceof Error?R.message:String(R)})}finally{r(!1)}}},[e]);w.useEffect(()=>{P()},[P]);const N=w.useMemo(()=>m.find(R=>R.id===(h==null?void 0:h.folderId))||null,[h==null?void 0:h.folderId,m]),z=w.useCallback(async R=>{const q=Array.from(R.target.files||[]);if(!(!e||q.length===0)){l(!0);try{const Z=await Vp();await Gj(e,{files:q,collection:Z.defaultCollection,folder:N==null?void 0:N.path}),M({tone:"success",message:"Files uploaded and indexed."}),await P(),R.target.value=""}catch(Z){M({tone:"error",message:Z instanceof Error?Z.message:String(Z)})}finally{l(!1)}}},[N==null?void 0:N.path,e,P]),G=w.useCallback(async R=>{if(!(!e||!window.confirm(`Delete file "${R.fileName}"?`)))try{await Vj(e,R.fileId),M({tone:"success",message:"File deleted."}),await P()}catch(q){M({tone:"error",message:q instanceof Error?q.message:String(q)})}},[e,P]),Q=w.useCallback(async()=>{if(!e||!C.trim()){_([]);return}c(!0);try{const R=await Yj(e,{query:C.trim(),limit:8});_(R.results||[])}catch(R){M({tone:"error",message:R instanceof Error?R.message:String(R)})}finally{c(!1)}},[e,C]);return p.jsxs("div",{className:"space-y-6 animate-fade-in",children:[p.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[p.jsx(Pn,{to:"/knowledge",children:p.jsxs(Ae,{variant:"secondary",children:[p.jsx(Xu,{size:14})," 返回知识库"]})}),h&&p.jsxs("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:[p.jsx("span",{className:"text-gray-900 dark:text-white",children:h.name}),N?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"mx-2",children:"/"}),p.jsx("span",{children:N.path})]}):null]})]}),T&&p.jsx("div",{className:`rounded-xl border px-4 py-3 text-sm ${cw(T.tone)}`,children:T.message}),!d&&!t&&p.jsx("div",{className:`rounded-2xl border px-5 py-4 ${cw("warning")}`,children:p.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[p.jsxs("div",{children:[p.jsx("p",{className:"font-medium",children:"Knowledge retrieval is not configured."}),p.jsx("p",{className:"mt-1 text-sm opacity-90",children:"Add the ai_vector connection in System settings to upload files and search this knowledge base."})]}),p.jsx(Pn,{to:"/system",children:p.jsxs(Ae,{variant:"secondary",children:[p.jsx(Oo,{size:14})," Open System Settings"]})})]})}),t?p.jsx(Ht,{children:p.jsx("div",{className:"py-16 text-center text-sm text-gray-400",children:"正在加载知识库详情…"})}):h?p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"grid grid-cols-1 gap-6 xl:grid-cols-[minmax(0,1.05fr)_minmax(0,0.95fr)]",children:[p.jsxs(Ht,{className:"space-y-4",children:[p.jsxs("div",{className:"flex items-start justify-between gap-4",children:[p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-semibold text-gray-900 dark:text-white",children:h.name}),p.jsx("p",{className:"mt-2 text-sm text-gray-500 dark:text-gray-400",children:h.description||"上传文档后,这个知识库会变成你当前项目的专属 RAG 索引。"})]}),p.jsxs("label",{className:Ke("inline-flex cursor-pointer items-center gap-2 rounded-xl px-4 py-2 text-sm font-medium",d?"bg-accent text-white hover:bg-accent-dim":"bg-gray-200 text-gray-500 dark:bg-white/[0.08] dark:text-gray-500"),children:[p.jsx(ex,{size:14}),i?"上传中…":"上传文件",p.jsx("input",{type:"file",multiple:!0,className:"hidden",disabled:!d||i,onChange:R=>void z(R)})]})]}),p.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[p.jsxs("div",{className:"rounded-2xl border border-gray-200/80 px-4 py-4 dark:border-white/[0.08]",children:[p.jsx("p",{className:"text-xs uppercase tracking-wide text-gray-400",children:"文档数"}),p.jsx("p",{className:"mt-2 text-2xl font-semibold text-gray-900 dark:text-white",children:v.length})]}),p.jsxs("div",{className:"rounded-2xl border border-gray-200/80 px-4 py-4 dark:border-white/[0.08]",children:[p.jsx("p",{className:"text-xs uppercase tracking-wide text-gray-400",children:"字符统计"}),p.jsx("p",{className:"mt-2 text-2xl font-semibold text-gray-900 dark:text-white",children:v.reduce((R,q)=>R+Number(q.wordCount||0),0)})]}),p.jsxs("div",{className:"rounded-2xl border border-gray-200/80 px-4 py-4 dark:border-white/[0.08]",children:[p.jsx("p",{className:"text-xs uppercase tracking-wide text-gray-400",children:"最近更新"}),p.jsx("p",{className:"mt-2 text-sm font-medium text-gray-900 dark:text-white",children:Zs(h.updatedAt)})]})]})]}),p.jsxs(Ht,{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"内容搜索"}),p.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:"在当前知识库内检索已解析内容,快速确认切块与召回效果。"})]}),p.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row",children:[p.jsxs("div",{className:"relative flex-1",children:[p.jsx(Zu,{size:16,className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),p.jsx(yt,{value:C,onChange:R=>A(R.target.value),placeholder:"例如:升级流程、性能测试结论",className:"pl-9",onKeyDown:R=>{R.key==="Enter"&&Q()}})]}),p.jsxs(Ae,{onClick:()=>void Q(),disabled:!d||!C.trim(),loading:o,children:[p.jsx(zN,{size:14})," 搜索"]})]}),S.length===0?p.jsx("div",{className:"rounded-2xl border border-dashed border-gray-200/80 px-4 py-8 text-center text-sm text-gray-400 dark:border-white/[0.08]",children:C?"还没有搜索结果。":"输入关键词后可以查看召回片段。"}):p.jsx("div",{className:"space-y-3",children:S.map(R=>p.jsxs("div",{className:"rounded-2xl border border-gray-200/80 px-4 py-4 dark:border-white/[0.08]",children:[p.jsxs("div",{className:"flex items-start justify-between gap-4",children:[p.jsxs("div",{children:[p.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:R.title}),p.jsxs("p",{className:"mt-1 text-xs text-gray-400",children:["chunk #",R.chunkOffset," · score ",R.score.toFixed(4)]})]}),p.jsx("span",{className:"rounded-full bg-gray-100 px-2.5 py-1 text-xs text-gray-500 dark:bg-white/[0.06] dark:text-gray-400",children:R.fileName})]}),p.jsx("p",{className:"mt-3 whitespace-pre-wrap text-sm leading-7 text-gray-600 dark:text-gray-300",children:R.snippet})]},R.id))})]})]}),p.jsxs(Ht,{className:"space-y-4",children:[p.jsx("div",{className:"flex items-center justify-between gap-4",children:p.jsxs("div",{children:[p.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"文件列表"}),p.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:"当前知识库内已完成解析并入库的文件。"})]})}),v.length===0?p.jsx(xn,{message:"还没有文件,上传文档后会出现在这里。",icon:ex}):p.jsxs("div",{className:"overflow-hidden rounded-2xl border border-gray-200/80 dark:border-white/[0.08]",children:[p.jsxs("div",{className:"grid grid-cols-[minmax(0,1.8fr)_120px_120px_160px_60px] gap-3 border-b border-gray-200/80 bg-gray-50/80 px-4 py-3 text-xs font-medium uppercase tracking-wide text-gray-500 dark:border-white/[0.08] dark:bg-white/[0.03]",children:[p.jsx("span",{children:"文件"}),p.jsx("span",{children:"类型"}),p.jsx("span",{children:"字符数"}),p.jsx("span",{children:"创建时间"}),p.jsx("span",{})]}),v.map(R=>p.jsxs("div",{className:"grid grid-cols-[minmax(0,1.8fr)_120px_120px_160px_60px] gap-3 border-b border-gray-200/70 px-4 py-3 text-sm last:border-b-0 dark:border-white/[0.06]",children:[p.jsxs("div",{className:"min-w-0",children:[p.jsx("p",{className:"truncate font-medium text-gray-900 dark:text-white",children:R.fileName}),p.jsx("p",{className:"mt-1 truncate text-xs text-gray-400",children:R.fileId})]}),p.jsx("span",{className:"text-gray-600 dark:text-gray-300",children:R.fileType}),p.jsx("span",{className:"text-gray-600 dark:text-gray-300",children:R.wordCount||0}),p.jsx("span",{className:"text-gray-600 dark:text-gray-300",children:Zs(R.createTime)}),p.jsx("button",{type:"button",onClick:()=>void G(R),className:"rounded-lg p-2 text-gray-400 hover:bg-red-500/10 hover:text-red-500","aria-label":`Delete ${R.fileName}`,children:p.jsx(ta,{size:15})})]},R.fileId))]})]})]}):p.jsx(Ht,{children:p.jsx(xn,{message:"没有找到这个知识库。",icon:$N})})]})}class I8{constructor(){Ls(this,"routes",new Map);Ls(this,"navItems",new Map)}registerRoute(t){this.routes.set(t.id,t)}registerNavItem(t){this.navItems.set(t.id,t)}listRoutes(){return[...this.routes.values()].sort((t,r)=>t.order-r.order)}listNavItems(){return[...this.navItems.values()].sort((t,r)=>t.order-r.order)}}function fo(e,t,r="/"){return e?t:p.jsx(fi,{to:r,replace:!0})}function z8(){const{name:e}=Do();return pr(r=>r.desktopManaged)?p.jsx(fi,{to:e?`/workspace?project=${encodeURIComponent(e)}`:"/workspace",replace:!0}):p.jsx(u8,{})}function uw(){const{project:e,id:t}=Do();if(!pr(l=>l.desktopManaged))return t&&e?p.jsx(h8,{}):p.jsx(f8,{});const i=new URLSearchParams;return e&&i.set("project",e),t&&i.set("session",t),p.jsx(fi,{to:`/chat${i.toString()?`?${i.toString()}`:""}`,replace:!0})}function P8(e){[{id:"dashboard",index:!0,titleKey:"nav.dashboard",order:10,element:()=>p.jsx(fL,{})},{id:"chat",path:"chat",titleKey:"nav.chat",order:20,element:({features:r})=>fo(r.chatRoute,r.desktopChat?p.jsx(C6,{}):p.jsx(L6,{}))},{id:"workspace",path:"workspace",titleKey:"nav.workspace",order:30,element:({features:r})=>fo(r.desktopWorkspace,p.jsx(Q6,{}))},{id:"knowledge",path:"knowledge",titleKey:"nav.knowledge",order:40,element:({features:r})=>fo(r.knowledgeModule,p.jsx(j8,{}))},{id:"knowledge-detail",path:"knowledge/:knowledgebaseId",titleKey:"nav.knowledge",order:41,element:({features:r})=>fo(r.knowledgeModule,p.jsx(L8,{}))},{id:"projects",path:"projects",titleKey:"nav.projects",order:50,element:({desktopManaged:r,features:i})=>r&&i.desktopWorkspace?p.jsx(fi,{to:"/workspace",replace:!0}):p.jsx(Z6,{})},{id:"project-detail",path:"projects/:name",titleKey:"nav.projects",order:51,element:()=>p.jsx(z8,{})},{id:"sessions",path:"sessions",titleKey:"nav.sessions",order:60,element:()=>p.jsx(uw,{})},{id:"session-detail",path:"sessions/:project/:id",titleKey:"nav.sessions",order:61,element:()=>p.jsx(uw,{})},{id:"cron",path:"cron",titleKey:"nav.cron",order:70,element:({features:r})=>fo(r.schedulerModule,p.jsx(E8,{}))},{id:"system",path:"system",titleKey:"nav.system",order:80,element:()=>p.jsx(T8,{})},{id:"system-logs",path:"system/logs",titleKey:"nav.system",order:81,element:()=>p.jsx(O8,{})}].forEach(r=>e.registerRoute(r))}function B8(e){[{id:"dashboard",path:"/",labelKey:"nav.dashboard",icon:JN,order:10,end:!0},{id:"chat",path:"/chat",labelKey:"nav.chat",icon:l2,order:20,visible:({features:r})=>r.chatRoute,resolveLabelKey:({features:r,runtimeProvider:i})=>r.desktopChat?i==="electron"?"nav.chatDesktop":"nav.chat":"nav.chatWeb"},{id:"workspace",path:"/workspace",labelKey:"nav.workspace",icon:mm,order:30,visible:({features:r})=>r.desktopWorkspace},{id:"knowledge",path:"/knowledge",labelKey:"nav.knowledge",icon:Rw,order:40,visible:({features:r})=>r.knowledgeModule},{id:"projects",path:"/projects",labelKey:"nav.projects",icon:Nu,order:50,visible:({desktopManaged:r})=>!r},{id:"sessions",path:"/sessions",labelKey:"nav.sessions",icon:_a,order:60,visible:({desktopManaged:r})=>!r},{id:"cron",path:"/cron",labelKey:"nav.cron",icon:hm,order:70,visible:({features:r})=>r.schedulerModule},{id:"system",path:"/system",labelKey:"nav.system",icon:Oo,order:80}].forEach(r=>e.registerNavItem(r))}const Sd=new I8;P8(Sd);B8(Sd);function Y_({className:e,markClassName:t,showWordmark:r=!1}){const i=w.useId(),l=`${i}-bg`,o=`${i}-stroke`;return p.jsxs("div",{className:Ke("inline-flex items-center gap-3",e),children:[p.jsxs("svg",{className:Ke("h-8 w-8 shrink-0",t),viewBox:"0 0 64 64",role:"img","aria-label":"AgentDock",fill:"none",children:[p.jsxs("defs",{children:[p.jsxs("linearGradient",{id:l,x1:"7",y1:"5",x2:"57",y2:"59",gradientUnits:"userSpaceOnUse",children:[p.jsx("stop",{className:"[stop-color:#FFFFFF] dark:[stop-color:#3A3A3C]"}),p.jsx("stop",{offset:"0.52",className:"[stop-color:#F5F5F7] dark:[stop-color:#2C2C2E]"}),p.jsx("stop",{offset:"1",className:"[stop-color:#E5E5EA] dark:[stop-color:#1C1C1E]"})]}),p.jsxs("linearGradient",{id:o,x1:"18",y1:"16",x2:"47",y2:"48",gradientUnits:"userSpaceOnUse",children:[p.jsx("stop",{stopColor:"#5AC8FA"}),p.jsx("stop",{offset:"0.44",stopColor:"#0A84FF"}),p.jsx("stop",{offset:"1",stopColor:"#007AFF"})]})]}),p.jsx("rect",{x:"4",y:"4",width:"56",height:"56",rx:"16",fill:`url(#${l})`,className:"stroke-black/10 dark:stroke-white/10",strokeWidth:"1.5"}),p.jsx("path",{d:"M14.5 45L25.3 20.1C26.1 18.1 28.9 18.1 29.8 20.1L40.8 45",stroke:`url(#${o})`,strokeWidth:"7.5",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M20.8 37.5H34.7",className:"stroke-white dark:stroke-white",strokeWidth:"5.25",strokeLinecap:"round"}),p.jsx("path",{d:"M33.8 20.2H37.4C45.1 20.2 50 25.6 50 32.5C50 39.4 45.1 44.8 37.4 44.8H33.8",stroke:`url(#${o})`,strokeWidth:"7",strokeLinecap:"round",strokeLinejoin:"round",opacity:"0.82"}),p.jsx("path",{d:"M34 25.5V39.5",className:"stroke-black/70 dark:stroke-black/80",strokeWidth:"3",strokeLinecap:"round",opacity:"0.18"})]}),r&&p.jsx("span",{className:"text-sm font-semibold tracking-tight text-foreground",children:"AgentDock"})]})}const dw=[{code:"en",label:"English"},{code:"zh",label:"中文"},{code:"zh-TW",label:"繁體中文"},{code:"ja",label:"日本語"},{code:"es",label:"Español"}],U8=[{label:"Core",ids:["dashboard","chat","workspace","projects","sessions"]},{label:"Knowledge",ids:["knowledge","cron"]},{label:"System",ids:["system"]}];function F8(){var A;const{t:e,i18n:t}=Fr(),{theme:r,setTheme:i}=Nm(),l=pr(T=>T.logout),o=pr(T=>T.desktopManaged),c=ad(),d=$i(),[f,h]=w.useState(!1),[g,m]=w.useState(!1),x=T=>{t.changeLanguage(T),localStorage.setItem("cc_lang",T),m(!1)},v={light:zw,dark:Mw,system:Ow},E={light:"dark",dark:"system",system:"light"},S=v[r],_=Sd.listNavItems().filter(T=>{var M;return((M=T.visible)==null?void 0:M.call(T,{desktopManaged:o,features:c}))??!0}),C=_.map(T=>{var N;const M=T.icon,P=((N=T.resolveLabelKey)==null?void 0:N.call(T,{desktopManaged:o,features:c,runtimeProvider:d}))||T.labelKey;return{...T,Icon:M,labelKey:P}});return p.jsxs(p.Fragment,{children:[p.jsxs("aside",{className:Ke("relative hidden h-[100dvh] flex-col overflow-hidden border-r transition-all duration-300 ease-out md:flex","border-white/55 bg-white/24 shadow-[inset_-1px_0_0_rgba(255,255,255,0.36)] backdrop-blur-[34px] supports-[backdrop-filter]:bg-white/18","dark:border-white/[0.10] dark:bg-[#1c1c1e]/34 dark:shadow-[inset_-1px_0_0_rgba(255,255,255,0.08)] dark:supports-[backdrop-filter]:bg-[#1c1c1e]/26",f?"w-16":"w-56"),children:[p.jsx("div",{className:"pointer-events-none absolute inset-0 bg-[linear-gradient(180deg,rgba(255,255,255,0.55),rgba(255,255,255,0.18)_48%,rgba(255,255,255,0.08))] dark:bg-[linear-gradient(180deg,rgba(255,255,255,0.08),rgba(255,255,255,0.025)_52%,rgba(255,255,255,0.015))]","aria-hidden":"true"}),p.jsx("div",{className:Ke("relative flex h-[5.25rem] items-center gap-3 px-4 pt-7 transition-colors"),children:p.jsx(Y_,{showWordmark:!f})}),p.jsx("nav",{className:"relative flex-1 py-3 space-y-4 px-2 overflow-y-auto",children:U8.map(T=>{const M=_.filter(P=>T.ids.includes(P.id));return M.length===0?null:p.jsxs("div",{className:"space-y-1",children:[!f&&p.jsx("p",{className:"px-3 pb-1 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground/80",children:T.label}),M.map(P=>{var G;const N=P.icon,z=((G=P.resolveLabelKey)==null?void 0:G.call(P,{desktopManaged:o,features:c,runtimeProvider:d}))||P.labelKey;return p.jsxs(Op,{to:P.path,end:P.end,className:({isActive:Q})=>Ke("flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors duration-200","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",Q?"bg-black/[0.07] text-foreground dark:bg-white/[0.10]":"text-muted-foreground hover:bg-black/[0.05] hover:text-foreground dark:hover:bg-white/[0.07]"),children:[p.jsx(N,{size:18,className:"shrink-0"}),!f&&p.jsx("span",{children:e(z)})]},P.id)})]},T.label)})}),p.jsxs("div",{className:Ke("relative border-t p-2 space-y-1","border-black/10 dark:border-white/[0.08]"),children:[p.jsxs("div",{className:"relative",children:[p.jsxs("button",{type:"button",onClick:()=>m(!g),className:Ke("flex items-center gap-3 w-full px-3 py-2 rounded-lg text-sm transition-colors duration-200","text-muted-foreground hover:bg-black/[0.05] hover:text-foreground dark:hover:bg-white/[0.07]","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:[p.jsx(XN,{size:18,className:"shrink-0"}),!f&&p.jsx("span",{children:((A=dw.find(T=>T.code===t.language))==null?void 0:A.label)||"English"})]}),g&&p.jsx("div",{className:Ke("absolute bottom-full left-0 mb-1 w-48 rounded-xl py-1 z-50 overflow-hidden","border border-black/10 bg-white/90 text-popover-foreground shadow-[0_18px_40px_rgba(0,0,0,0.12)] backdrop-blur-2xl","dark:border-white/[0.08] dark:bg-[#2c2c2e]/90"),children:dw.map(T=>p.jsx("button",{type:"button",onClick:()=>x(T.code),className:Ke("w-full text-left px-3 py-2 text-sm transition-colors duration-150",t.language===T.code?"text-primary font-medium bg-primary/10":"text-muted-foreground hover:bg-black/[0.05] hover:text-foreground dark:hover:bg-white/[0.07]"),children:T.label},T.code))})]}),p.jsxs("button",{type:"button",onClick:()=>i(E[r]),className:Ke("flex items-center gap-3 w-full px-3 py-2 rounded-lg text-sm transition-colors duration-200","text-muted-foreground hover:bg-black/[0.05] hover:text-foreground dark:hover:bg-white/[0.07]","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:[p.jsx(S,{size:18,className:"shrink-0"}),!f&&p.jsx("span",{children:e(`theme.${r}`)})]}),!o&&p.jsxs("button",{type:"button",onClick:l,className:Ke("flex items-center gap-3 w-full px-3 py-2 rounded-lg text-sm transition-colors duration-200","text-muted-foreground hover:bg-destructive/10 hover:text-destructive","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:[p.jsx(r2,{size:18,className:"shrink-0"}),!f&&p.jsx("span",{children:e("login.logout")})]}),p.jsx("button",{type:"button",onClick:()=>h(!f),className:Ke("flex items-center justify-center w-full px-3 py-2 rounded-lg transition-colors duration-200","text-muted-foreground hover:bg-black/[0.05] hover:text-foreground dark:hover:bg-white/[0.07]","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:f?p.jsx(Tw,{size:18}):p.jsx(EN,{size:18})})]})]}),p.jsx("nav",{className:Ke("fixed inset-x-0 bottom-0 z-50 border-t px-2 pb-[max(env(safe-area-inset-bottom),0.5rem)] pt-2 md:hidden","border-black/10 bg-white/88 shadow-[0_-12px_32px_rgba(15,23,42,0.10)] backdrop-blur-2xl","dark:border-white/[0.08] dark:bg-[#111113]/88 dark:shadow-[0_-16px_42px_rgba(0,0,0,0.34)]"),"aria-label":"Primary navigation",children:p.jsx("div",{className:"flex items-stretch gap-1 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:C.map(({id:T,path:M,end:P,Icon:N,labelKey:z})=>p.jsxs(Op,{to:M,end:P,className:({isActive:G})=>Ke("flex min-w-[4.5rem] flex-1 flex-col items-center justify-center gap-1 rounded-xl px-2 py-2 text-[11px] font-medium transition-colors","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",G?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-black/[0.05] hover:text-foreground dark:hover:bg-white/[0.07]"),children:[p.jsx(N,{size:18,className:"shrink-0"}),p.jsx("span",{className:"max-w-[4.25rem] truncate",children:e(z)})]},T))})})]})}function $8(){const{pathname:e}=Ar(),{desktopChat:t}=ad(),r=e.startsWith("/chat")&&t,i=r&&$i()==="electron";return p.jsxs("div",{className:Ke("flex h-[100dvh] overflow-hidden","bg-background/60 backdrop-blur-2xl"),children:[p.jsx("div",{className:"fixed left-0 right-0 top-0 z-50 hidden h-8 [-webkit-app-region:drag] md:block","aria-hidden":"true"}),p.jsx(F8,{}),p.jsx("div",{className:"flex-1 flex flex-col overflow-hidden min-w-0 bg-background/45 backdrop-blur-2xl",children:p.jsx("main",{className:Ke("flex-1 min-h-0",r?"overflow-hidden":"overflow-y-auto",i?"p-0":"p-4 pb-24 sm:p-6 sm:pb-6"),children:p.jsx("div",{className:Ke(r&&"h-full min-h-0",!i&&"mx-auto w-full max-w-7xl"),children:p.jsx(XT,{})})})})]})}const H8=[{code:"en",label:"EN"},{code:"zh",label:"中"},{code:"zh-TW",label:"繁"},{code:"ja",label:"日"},{code:"es",label:"ES"}];function K8(){const{t:e,i18n:t}=Fr(),r=nd(),i=pr(M=>M.login),{theme:l,setTheme:o}=Nm(),[c,d]=w.useState(""),[f,h]=w.useState(""),[g,m]=w.useState(""),[x,v]=w.useState(!1),E=eR(),S=tR(),_=async M=>{if(M.preventDefault(),!(!c.trim()||S)){v(!0),m("");try{f.trim()&&lt.setBaseUrl(f.trim()),lt.setToken(c.trim()),await S8(),i(c.trim(),f.trim()),E?window.location.hash="#/":r("/",{replace:!0})}catch{m(e("login.invalidToken")),lt.setToken(""),lt.setBaseUrl("")}finally{v(!1)}}},C={light:zw,dark:Mw,system:Ow},A={light:"dark",dark:"system",system:"light"},T=C[l];return p.jsxs("div",{className:"min-h-screen flex items-center justify-center bg-[radial-gradient(circle_at_top,hsl(var(--secondary))_0,hsl(var(--background))_42%,hsl(var(--background))_78%)] p-4",children:[p.jsxs("div",{className:"fixed top-4 right-4 flex items-center gap-2",children:[p.jsx("div",{className:"flex overflow-hidden rounded-md border bg-card/80 backdrop-blur",children:H8.map(M=>p.jsx("button",{onClick:()=>{t.changeLanguage(M.code),localStorage.setItem("cc_lang",M.code)},className:Ke("px-2.5 py-1.5 text-xs font-medium transition-colors",t.language===M.code?"bg-primary/15 text-primary":"text-muted-foreground hover:bg-accent/10 hover:text-foreground"),children:M.label},M.code))}),p.jsx(Ae,{variant:"outline",size:"icon",onClick:()=>o(A[l]),"aria-label":e(`theme.${l}`),children:p.jsx(T,{size:16})})]}),p.jsx("div",{className:"w-full max-w-md animate-fade-in",children:p.jsxs(Ht,{className:"p-8 shadow-2xl shadow-primary/10",children:[p.jsx("div",{className:"flex justify-center mb-6",children:p.jsx(Y_,{markClassName:"h-14 w-14 drop-shadow-[0_14px_28px_rgba(0,122,255,0.22)]"})}),p.jsx("h1",{className:"text-2xl font-bold text-center text-foreground mb-1",children:e("login.title")}),p.jsx("p",{className:"text-sm text-center text-muted-foreground mb-3",children:e("login.subtitle")}),p.jsx("div",{className:"mb-8 rounded-lg border bg-muted px-4 py-3 text-xs text-muted-foreground",children:E?"AgentDock 桌面模式会自动连接到本地托管运行时。":"Browser mode requires a reachable API endpoint. Enter the server URL and access token."}),g&&p.jsxs("div",{className:"mb-4 flex items-center gap-2 rounded-lg border border-destructive/20 bg-destructive/10 px-4 py-3 text-sm text-destructive dark:text-red-200",children:[p.jsx(NN,{size:16}),g]}),p.jsxs("form",{onSubmit:_,className:"space-y-4",children:[p.jsx(yt,{label:e("login.token"),type:"password",value:c,onChange:M=>d(M.target.value),placeholder:"mgmt-secret-xxx",autoFocus:!0}),p.jsx(yt,{label:`${e("login.serverUrl")} (${e("common.optional")})`,type:"text",value:f,onChange:M=>h(M.target.value),placeholder:"http://localhost:9820"}),p.jsxs(Ae,{type:"submit",disabled:x||!c.trim()||S,className:"w-full shadow-[0_0_20px_-6px_hsl(var(--primary)/0.55)]",children:[x?p.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[p.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),p.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):p.jsx(Pw,{size:16}),e("login.connect")]})]})]})})]})}function q8({children:e}){return pr(r=>r.isAuthenticated)?p.jsx(p.Fragment,{children:e}):p.jsx(fi,{to:"/login",replace:!0})}function G8(){const e=pr(i=>i.isAuthenticated),t=pr(i=>i.desktopManaged),r=ad();return p.jsxs(QT,{children:[p.jsx(Ui,{path:"/login",element:e?p.jsx(fi,{to:"/",replace:!0}):p.jsx(K8,{})}),p.jsxs(Ui,{element:p.jsx(q8,{children:p.jsx($8,{})}),children:[Sd.listRoutes().map(i=>i.index?p.jsx(Ui,{index:!0,element:i.element({desktopManaged:t,features:r})},i.id):p.jsx(Ui,{path:i.path,element:i.element({desktopManaged:t,features:r})},i.id)),p.jsx(Ui,{path:"*",element:p.jsx(fi,{to:"/",replace:!0})})]}),p.jsx(Ui,{path:"*",element:p.jsx(fi,{to:e?"/":"/login",replace:!0})})]})}class V8 extends kt.Component{constructor(){super(...arguments);Ls(this,"state",{hasError:!1,errorMessage:""})}static getDerivedStateFromError(r){return{hasError:!0,errorMessage:r instanceof Error?r.message:String(r)}}componentDidCatch(r,i){console.error("App render failed",r,i)}render(){return this.state.hasError?p.jsx("div",{className:"min-h-screen flex items-center justify-center bg-white dark:bg-gray-950 p-6",children:p.jsxs("div",{className:"max-w-lg w-full rounded-2xl border border-red-200 dark:border-red-900/40 bg-red-50 dark:bg-red-950/20 px-6 py-5",children:[p.jsx("h1",{className:"text-lg font-semibold text-red-700 dark:text-red-300",children:"页面渲染失败"}),p.jsx("p",{className:"mt-2 text-sm text-red-600 dark:text-red-400 break-words",children:this.state.errorMessage||"Unknown renderer error"}),p.jsx("button",{type:"button",onClick:()=>window.location.reload(),className:"mt-4 inline-flex items-center rounded-lg bg-red-600 px-4 py-2 text-sm font-medium text-white hover:bg-red-700",children:"Reload"})]})}):this.props.children}}var vp={};const Je=e=>typeof e=="string",ho=()=>{let e,t;const r=new Promise((i,l)=>{e=i,t=l});return r.resolve=e,r.reject=t,r},fw=e=>e==null?"":""+e,Y8=(e,t,r)=>{e.forEach(i=>{t[i]&&(r[i]=t[i])})},X8=/###/g,hw=e=>e&&e.indexOf("###")>-1?e.replace(X8,"."):e,pw=e=>!e||Je(e),yo=(e,t,r)=>{const i=Je(t)?t.split("."):t;let l=0;for(;l<i.length-1;){if(pw(e))return{};const o=hw(i[l]);!e[o]&&r&&(e[o]=new r),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={},++l}return pw(e)?{}:{obj:e,k:hw(i[l])}},mw=(e,t,r)=>{const{obj:i,k:l}=yo(e,t,Object);if(i!==void 0||t.length===1){i[l]=r;return}let o=t[t.length-1],c=t.slice(0,t.length-1),d=yo(e,c,Object);for(;d.obj===void 0&&c.length;)o=`${c[c.length-1]}.${o}`,c=c.slice(0,c.length-1),d=yo(e,c,Object),d!=null&&d.obj&&typeof d.obj[`${d.k}.${o}`]<"u"&&(d.obj=void 0);d.obj[`${d.k}.${o}`]=r},W8=(e,t,r,i)=>{const{obj:l,k:o}=yo(e,t,Object);l[o]=l[o]||[],l[o].push(r)},Gu=(e,t)=>{const{obj:r,k:i}=yo(e,t);if(r&&Object.prototype.hasOwnProperty.call(r,i))return r[i]},Q8=(e,t,r)=>{const i=Gu(e,r);return i!==void 0?i:Gu(t,r)},X_=(e,t,r)=>{for(const i in t)i!=="__proto__"&&i!=="constructor"&&(i in e?Je(e[i])||e[i]instanceof String||Je(t[i])||t[i]instanceof String?r&&(e[i]=t[i]):X_(e[i],t[i],r):e[i]=t[i]);return e},Bi=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Z8={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const J8=e=>Je(e)?e.replace(/[&<>"'\/]/g,t=>Z8[t]):e;class e9{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const r=this.regExpMap.get(t);if(r!==void 0)return r;const i=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,i),this.regExpQueue.push(t),i}}const t9=[" ",",","?","!",";"],n9=new e9(20),r9=(e,t,r)=>{t=t||"",r=r||"";const i=t9.filter(c=>t.indexOf(c)<0&&r.indexOf(c)<0);if(i.length===0)return!0;const l=n9.getRegExp(`(${i.map(c=>c==="?"?"\\?":c).join("|")})`);let o=!l.test(e);if(!o){const c=e.indexOf(r);c>0&&!l.test(e.substring(0,c))&&(o=!0)}return o},cm=(e,t,r=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const i=t.split(r);let l=e;for(let o=0;o<i.length;){if(!l||typeof l!="object")return;let c,d="";for(let f=o;f<i.length;++f)if(f!==o&&(d+=r),d+=i[f],c=l[d],c!==void 0){if(["string","number","boolean"].indexOf(typeof c)>-1&&f<i.length-1)continue;o+=f-o+1;break}l=c}return l},Ro=e=>e==null?void 0:e.replace(/_/g,"-"),a9={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var r,i;(i=(r=console==null?void 0:console[e])==null?void 0:r.apply)==null||i.call(r,console,t)}};class Vu{constructor(t,r={}){this.init(t,r)}init(t,r={}){this.prefix=r.prefix||"i18next:",this.logger=t||a9,this.options=r,this.debug=r.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,r,i,l){return l&&!this.debug?null:(Je(t[0])&&(t[0]=`${i}${this.prefix} ${t[0]}`),this.logger[r](t))}create(t){return new Vu(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Vu(this.logger,t)}}var ea=new Vu;class _d{constructor(){this.observers={}}on(t,r){return t.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const l=this.observers[i].get(r)||0;this.observers[i].set(r,l+1)}),this}off(t,r){if(this.observers[t]){if(!r){delete this.observers[t];return}this.observers[t].delete(r)}}emit(t,...r){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([l,o])=>{for(let c=0;c<o;c++)l(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([l,o])=>{for(let c=0;c<o;c++)l.apply(l,[t,...r])})}}class gw extends _d{constructor(t,r={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const r=this.options.ns.indexOf(t);r>-1&&this.options.ns.splice(r,1)}getResource(t,r,i,l={}){var h,g;const o=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator,c=l.ignoreJSONStructure!==void 0?l.ignoreJSONStructure:this.options.ignoreJSONStructure;let d;t.indexOf(".")>-1?d=t.split("."):(d=[t,r],i&&(Array.isArray(i)?d.push(...i):Je(i)&&o?d.push(...i.split(o)):d.push(i)));const f=Gu(this.data,d);return!f&&!r&&!i&&t.indexOf(".")>-1&&(t=d[0],r=d[1],i=d.slice(2).join(".")),f||!c||!Je(i)?f:cm((g=(h=this.data)==null?void 0:h[t])==null?void 0:g[r],i,o)}addResource(t,r,i,l,o={silent:!1}){const c=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let d=[t,r];i&&(d=d.concat(c?i.split(c):i)),t.indexOf(".")>-1&&(d=t.split("."),l=r,r=d[1]),this.addNamespaces(r),mw(this.data,d,l),o.silent||this.emit("added",t,r,i,l)}addResources(t,r,i,l={silent:!1}){for(const o in i)(Je(i[o])||Array.isArray(i[o]))&&this.addResource(t,r,o,i[o],{silent:!0});l.silent||this.emit("added",t,r,i)}addResourceBundle(t,r,i,l,o,c={silent:!1,skipCopy:!1}){let d=[t,r];t.indexOf(".")>-1&&(d=t.split("."),l=i,i=r,r=d[1]),this.addNamespaces(r);let f=Gu(this.data,d)||{};c.skipCopy||(i=JSON.parse(JSON.stringify(i))),l?X_(f,i,o):f={...f,...i},mw(this.data,d,f),c.silent||this.emit("added",t,r,i)}removeResourceBundle(t,r){this.hasResourceBundle(t,r)&&delete this.data[t][r],this.removeNamespaces(r),this.emit("removed",t,r)}hasResourceBundle(t,r){return this.getResource(t,r)!==void 0}getResourceBundle(t,r){return r||(r=this.options.defaultNS),this.getResource(t,r)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const r=this.getDataByLanguage(t);return!!(r&&Object.keys(r)||[]).find(l=>r[l]&&Object.keys(r[l]).length>0)}toJSON(){return this.data}}var W_={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,r,i,l){return e.forEach(o=>{var c;t=((c=this.processors[o])==null?void 0:c.process(t,r,i,l))??t}),t}};const Q_=Symbol("i18next/PATH_KEY");function i9(){const e=[],t=Object.create(null);let r;return t.get=(i,l)=>{var o;return(o=r==null?void 0:r.revoke)==null||o.call(r),l===Q_?e:(e.push(l),r=Proxy.revocable(i,t),r.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Qs(e,t){const{[Q_]:r}=e(i9()),i=(t==null?void 0:t.keySeparator)??".",l=(t==null?void 0:t.nsSeparator)??":";if(r.length>1&&l){const o=t==null?void 0:t.ns,c=Array.isArray(o)?o:null;if(c&&c.length>1&&c.slice(1).includes(r[0]))return`${r[0]}${l}${r.slice(1).join(i)}`}return r.join(i)}const bw={},wp=e=>!Je(e)&&typeof e!="boolean"&&typeof e!="number";class Yu extends _d{constructor(t,r={}){super(),Y8(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ea.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,r={interpolation:{}}){const i={...r};if(t==null)return!1;const l=this.resolve(t,i);if((l==null?void 0:l.res)===void 0)return!1;const o=wp(l.res);return!(i.returnObjects===!1&&o)}extractFromKey(t,r){let i=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const l=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let o=r.ns||this.options.defaultNS||[];const c=i&&t.indexOf(i)>-1,d=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!r9(t,i,l);if(c&&!d){const f=t.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:t,namespaces:Je(o)?[o]:o};const h=t.split(i);(i!==l||i===l&&this.options.ns.indexOf(h[0])>-1)&&(o=h.shift()),t=h.join(l)}return{key:t,namespaces:Je(o)?[o]:o}}translate(t,r,i){let l=typeof r=="object"?{...r}:r;if(typeof l!="object"&&this.options.overloadTranslationOptionHandler&&(l=this.options.overloadTranslationOptionHandler(arguments)),typeof l=="object"&&(l={...l}),l||(l={}),t==null)return"";typeof t=="function"&&(t=Qs(t,{...this.options,...l})),Array.isArray(t)||(t=[String(t)]),t=t.map(ne=>typeof ne=="function"?Qs(ne,{...this.options,...l}):String(ne));const o=l.returnDetails!==void 0?l.returnDetails:this.options.returnDetails,c=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator,{key:d,namespaces:f}=this.extractFromKey(t[t.length-1],l),h=f[f.length-1];let g=l.nsSeparator!==void 0?l.nsSeparator:this.options.nsSeparator;g===void 0&&(g=":");const m=l.lng||this.language,x=l.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((m==null?void 0:m.toLowerCase())==="cimode")return x?o?{res:`${h}${g}${d}`,usedKey:d,exactUsedKey:d,usedLng:m,usedNS:h,usedParams:this.getUsedParamsDetails(l)}:`${h}${g}${d}`:o?{res:d,usedKey:d,exactUsedKey:d,usedLng:m,usedNS:h,usedParams:this.getUsedParamsDetails(l)}:d;const v=this.resolve(t,l);let E=v==null?void 0:v.res;const S=(v==null?void 0:v.usedKey)||d,_=(v==null?void 0:v.exactUsedKey)||d,C=["[object Number]","[object Function]","[object RegExp]"],A=l.joinArrays!==void 0?l.joinArrays:this.options.joinArrays,T=!this.i18nFormat||this.i18nFormat.handleAsObject,M=l.count!==void 0&&!Je(l.count),P=Yu.hasDefaultValue(l),N=M?this.pluralResolver.getSuffix(m,l.count,l):"",z=l.ordinal&&M?this.pluralResolver.getSuffix(m,l.count,{ordinal:!1}):"",G=M&&!l.ordinal&&l.count===0,Q=G&&l[`defaultValue${this.options.pluralSeparator}zero`]||l[`defaultValue${N}`]||l[`defaultValue${z}`]||l.defaultValue;let R=E;T&&!E&&P&&(R=Q);const q=wp(R),Z=Object.prototype.toString.apply(R);if(T&&R&&q&&C.indexOf(Z)<0&&!(Je(A)&&Array.isArray(R))){if(!l.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const ne=this.options.returnedObjectHandler?this.options.returnedObjectHandler(S,R,{...l,ns:f}):`key '${d} (${this.language})' returned an object instead of string.`;return o?(v.res=ne,v.usedParams=this.getUsedParamsDetails(l),v):ne}if(c){const ne=Array.isArray(R),Y=ne?[]:{},H=ne?_:S;for(const j in R)if(Object.prototype.hasOwnProperty.call(R,j)){const F=`${H}${c}${j}`;P&&!E?Y[j]=this.translate(F,{...l,defaultValue:wp(Q)?Q[j]:void 0,joinArrays:!1,ns:f}):Y[j]=this.translate(F,{...l,joinArrays:!1,ns:f}),Y[j]===F&&(Y[j]=R[j])}E=Y}}else if(T&&Je(A)&&Array.isArray(E))E=E.join(A),E&&(E=this.extendTranslation(E,t,l,i));else{let ne=!1,Y=!1;!this.isValidLookup(E)&&P&&(ne=!0,E=Q),this.isValidLookup(E)||(Y=!0,E=d);const j=(l.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&Y?void 0:E,F=P&&Q!==E&&this.options.updateMissing;if(Y||ne||F){if(this.logger.log(F?"updateKey":"missingKey",m,h,d,F?Q:E),c){const I=this.resolve(d,{...l,keySeparator:!1});I&&I.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let W=[];const K=this.languageUtils.getFallbackCodes(this.options.fallbackLng,l.lng||this.language);if(this.options.saveMissingTo==="fallback"&&K&&K[0])for(let I=0;I<K.length;I++)W.push(K[I]);else this.options.saveMissingTo==="all"?W=this.languageUtils.toResolveHierarchy(l.lng||this.language):W.push(l.lng||this.language);const L=(I,X,D)=>{var be;const J=P&&D!==E?D:j;this.options.missingKeyHandler?this.options.missingKeyHandler(I,h,X,J,F,l):(be=this.backendConnector)!=null&&be.saveMissing&&this.backendConnector.saveMissing(I,h,X,J,F,l),this.emit("missingKey",I,h,X,E)};this.options.saveMissing&&(this.options.saveMissingPlurals&&M?W.forEach(I=>{const X=this.pluralResolver.getSuffixes(I,l);G&&l[`defaultValue${this.options.pluralSeparator}zero`]&&X.indexOf(`${this.options.pluralSeparator}zero`)<0&&X.push(`${this.options.pluralSeparator}zero`),X.forEach(D=>{L([I],d+D,l[`defaultValue${D}`]||Q)})}):L(W,d,Q))}E=this.extendTranslation(E,t,l,v,i),Y&&E===d&&this.options.appendNamespaceToMissingKey&&(E=`${h}${g}${d}`),(Y||ne)&&this.options.parseMissingKeyHandler&&(E=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}${g}${d}`:d,ne?E:void 0,l))}return o?(v.res=E,v.usedParams=this.getUsedParamsDetails(l),v):E}extendTranslation(t,r,i,l,o){var f,h;if((f=this.i18nFormat)!=null&&f.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||l.usedLng,l.usedNS,l.usedKey,{resolved:l});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const g=Je(t)&&(((h=i==null?void 0:i.interpolation)==null?void 0:h.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let m;if(g){const v=t.match(this.interpolator.nestingRegexp);m=v&&v.length}let x=i.replace&&!Je(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(x={...this.options.interpolation.defaultVariables,...x}),t=this.interpolator.interpolate(t,x,i.lng||this.language||l.usedLng,i),g){const v=t.match(this.interpolator.nestingRegexp),E=v&&v.length;m<E&&(i.nest=!1)}!i.lng&&l&&l.res&&(i.lng=this.language||l.usedLng),i.nest!==!1&&(t=this.interpolator.nest(t,(...v)=>(o==null?void 0:o[0])===v[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${v[0]} in key: ${r[0]}`),null):this.translate(...v,r),i)),i.interpolation&&this.interpolator.reset()}const c=i.postProcess||this.options.postProcess,d=Je(c)?[c]:c;return t!=null&&(d!=null&&d.length)&&i.applyPostProcessor!==!1&&(t=W_.handle(d,t,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...l,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),t}resolve(t,r={}){let i,l,o,c,d;return Je(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(f=>typeof f=="function"?Qs(f,{...this.options,...r}):f)),t.forEach(f=>{if(this.isValidLookup(i))return;const h=this.extractFromKey(f,r),g=h.key;l=g;let m=h.namespaces;this.options.fallbackNS&&(m=m.concat(this.options.fallbackNS));const x=r.count!==void 0&&!Je(r.count),v=x&&!r.ordinal&&r.count===0,E=r.context!==void 0&&(Je(r.context)||typeof r.context=="number")&&r.context!=="",S=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);m.forEach(_=>{var C,A;this.isValidLookup(i)||(d=_,!bw[`${S[0]}-${_}`]&&((C=this.utils)!=null&&C.hasLoadedNamespace)&&!((A=this.utils)!=null&&A.hasLoadedNamespace(d))&&(bw[`${S[0]}-${_}`]=!0,this.logger.warn(`key "${l}" for languages "${S.join(", ")}" won't get resolved as namespace "${d}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),S.forEach(T=>{var N;if(this.isValidLookup(i))return;c=T;const M=[g];if((N=this.i18nFormat)!=null&&N.addLookupKeys)this.i18nFormat.addLookupKeys(M,g,T,_,r);else{let z;x&&(z=this.pluralResolver.getSuffix(T,r.count,r));const G=`${this.options.pluralSeparator}zero`,Q=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(x&&(r.ordinal&&z.indexOf(Q)===0&&M.push(g+z.replace(Q,this.options.pluralSeparator)),M.push(g+z),v&&M.push(g+G)),E){const R=`${g}${this.options.contextSeparator||"_"}${r.context}`;M.push(R),x&&(r.ordinal&&z.indexOf(Q)===0&&M.push(R+z.replace(Q,this.options.pluralSeparator)),M.push(R+z),v&&M.push(R+G))}}let P;for(;P=M.pop();)this.isValidLookup(i)||(o=P,i=this.getResource(T,_,P,r))}))})}),{res:i,usedKey:l,exactUsedKey:o,usedLng:c,usedNS:d}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,r,i,l={}){var o;return(o=this.i18nFormat)!=null&&o.getResource?this.i18nFormat.getResource(t,r,i,l):this.resourceStore.getResource(t,r,i,l)}getUsedParamsDetails(t={}){const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=t.replace&&!Je(t.replace);let l=i?t.replace:t;if(i&&typeof t.count<"u"&&(l.count=t.count),this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),!i){l={...l};for(const o of r)delete l[o]}return l}static hasDefaultValue(t){const r="defaultValue";for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&r===i.substring(0,r.length)&&t[i]!==void 0)return!0;return!1}}class yw{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ea.create("languageUtils")}getScriptPartFromCode(t){if(t=Ro(t),!t||t.indexOf("-")<0)return null;const r=t.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(t){if(t=Ro(t),!t||t.indexOf("-")<0)return t;const r=t.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(t){if(Je(t)&&t.indexOf("-")>-1){let r;try{r=Intl.getCanonicalLocales(t)[0]}catch{}return r&&this.options.lowerCaseLng&&(r=r.toLowerCase()),r||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let r;return t.forEach(i=>{if(r)return;const l=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(l))&&(r=l)}),!r&&this.options.supportedLngs&&t.forEach(i=>{if(r)return;const l=this.getScriptPartFromCode(i);if(this.isSupportedCode(l))return r=l;const o=this.getLanguagePartFromCode(i);if(this.isSupportedCode(o))return r=o;r=this.options.supportedLngs.find(c=>{if(c===o)return c;if(!(c.indexOf("-")<0&&o.indexOf("-")<0)&&(c.indexOf("-")>0&&o.indexOf("-")<0&&c.substring(0,c.indexOf("-"))===o||c.indexOf(o)===0&&o.length>1))return c})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(t,r){if(!t)return[];if(typeof t=="function"&&(t=t(r)),Je(t)&&(t=[t]),Array.isArray(t))return t;if(!r)return t.default||[];let i=t[r];return i||(i=t[this.getScriptPartFromCode(r)]),i||(i=t[this.formatLanguageCode(r)]),i||(i=t[this.getLanguagePartFromCode(r)]),i||(i=t.default),i||[]}toResolveHierarchy(t,r){const i=this.getFallbackCodes((r===!1?[]:r)||this.options.fallbackLng||[],t),l=[],o=c=>{c&&(this.isSupportedCode(c)?l.push(c):this.logger.warn(`rejecting language code not found in supportedLngs: ${c}`))};return Je(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):Je(t)&&o(this.formatLanguageCode(t)),i.forEach(c=>{l.indexOf(c)<0&&o(this.formatLanguageCode(c))}),l}}const xw={zero:0,one:1,two:2,few:3,many:4,other:5},vw={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class s9{constructor(t,r={}){this.languageUtils=t,this.options=r,this.logger=ea.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,r={}){const i=Ro(t==="dev"?"en":t),l=r.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:i,type:l});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let c;try{c=new Intl.PluralRules(i,{type:l})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),vw;if(!t.match(/-|_/))return vw;const f=this.languageUtils.getLanguagePartFromCode(t);c=this.getRule(f,r)}return this.pluralRulesCache[o]=c,c}needsPlural(t,r={}){let i=this.getRule(t,r);return i||(i=this.getRule("dev",r)),(i==null?void 0:i.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,r,i={}){return this.getSuffixes(t,i).map(l=>`${r}${l}`)}getSuffixes(t,r={}){let i=this.getRule(t,r);return i||(i=this.getRule("dev",r)),i?i.resolvedOptions().pluralCategories.sort((l,o)=>xw[l]-xw[o]).map(l=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${l}`):[]}getSuffix(t,r,i={}){const l=this.getRule(t,i);return l?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${l.select(r)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",r,i))}}const ww=(e,t,r,i=".",l=!0)=>{let o=Q8(e,t,r);return!o&&l&&Je(r)&&(o=cm(e,r,i),o===void 0&&(o=cm(t,r,i))),o},Ep=e=>e.replace(/\$/g,"$$$$");class Ew{constructor(t={}){var r;this.logger=ea.create("interpolator"),this.options=t,this.format=((r=t==null?void 0:t.interpolation)==null?void 0:r.format)||(i=>i),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:r,escapeValue:i,useRawValueToEscape:l,prefix:o,prefixEscaped:c,suffix:d,suffixEscaped:f,formatSeparator:h,unescapeSuffix:g,unescapePrefix:m,nestingPrefix:x,nestingPrefixEscaped:v,nestingSuffix:E,nestingSuffixEscaped:S,nestingOptionsSeparator:_,maxReplaces:C,alwaysFormat:A}=t.interpolation;this.escape=r!==void 0?r:J8,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=l!==void 0?l:!1,this.prefix=o?Bi(o):c||"{{",this.suffix=d?Bi(d):f||"}}",this.formatSeparator=h||",",this.unescapePrefix=g?"":m||"-",this.unescapeSuffix=this.unescapePrefix?"":g||"",this.nestingPrefix=x?Bi(x):v||Bi("$t("),this.nestingSuffix=E?Bi(E):S||Bi(")"),this.nestingOptionsSeparator=_||",",this.maxReplaces=C||1e3,this.alwaysFormat=A!==void 0?A:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(r,i)=>(r==null?void 0:r.source)===i?(r.lastIndex=0,r):new RegExp(i,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,r,i,l){var v;let o,c,d;const f=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=E=>{if(E.indexOf(this.formatSeparator)<0){const A=ww(r,f,E,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(A,void 0,i,{...l,...r,interpolationkey:E}):A}const S=E.split(this.formatSeparator),_=S.shift().trim(),C=S.join(this.formatSeparator).trim();return this.format(ww(r,f,_,this.options.keySeparator,this.options.ignoreJSONStructure),C,i,{...l,...r,interpolationkey:_})};this.resetRegExp();const g=(l==null?void 0:l.missingInterpolationHandler)||this.options.missingInterpolationHandler,m=((v=l==null?void 0:l.interpolation)==null?void 0:v.skipOnVariables)!==void 0?l.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:E=>Ep(E)},{regex:this.regexp,safeValue:E=>this.escapeValue?Ep(this.escape(E)):Ep(E)}].forEach(E=>{for(d=0;o=E.regex.exec(t);){const S=o[1].trim();if(c=h(S),c===void 0)if(typeof g=="function"){const C=g(t,o,l);c=Je(C)?C:""}else if(l&&Object.prototype.hasOwnProperty.call(l,S))c="";else if(m){c=o[0];continue}else this.logger.warn(`missed to pass in variable ${S} for interpolating ${t}`),c="";else!Je(c)&&!this.useRawValueToEscape&&(c=fw(c));const _=E.safeValue(c);if(t=t.replace(o[0],_),m?(E.regex.lastIndex+=c.length,E.regex.lastIndex-=o[0].length):E.regex.lastIndex=0,d++,d>=this.maxReplaces)break}}),t}nest(t,r,i={}){let l,o,c;const d=(f,h)=>{const g=this.nestingOptionsSeparator;if(f.indexOf(g)<0)return f;const m=f.split(new RegExp(`${Bi(g)}[ ]*{`));let x=`{${m[1]}`;f=m[0],x=this.interpolate(x,c);const v=x.match(/'/g),E=x.match(/"/g);(((v==null?void 0:v.length)??0)%2===0&&!E||((E==null?void 0:E.length)??0)%2!==0)&&(x=x.replace(/'/g,'"'));try{c=JSON.parse(x),h&&(c={...h,...c})}catch(S){return this.logger.warn(`failed parsing options string in nesting for key ${f}`,S),`${f}${g}${x}`}return c.defaultValue&&c.defaultValue.indexOf(this.prefix)>-1&&delete c.defaultValue,f};for(;l=this.nestingRegexp.exec(t);){let f=[];c={...i},c=c.replace&&!Je(c.replace)?c.replace:c,c.applyPostProcessor=!1,delete c.defaultValue;const h=/{.*}/.test(l[1])?l[1].lastIndexOf("}")+1:l[1].indexOf(this.formatSeparator);if(h!==-1&&(f=l[1].slice(h).split(this.formatSeparator).map(g=>g.trim()).filter(Boolean),l[1]=l[1].slice(0,h)),o=r(d.call(this,l[1].trim(),c),c),o&&l[0]===t&&!Je(o))return o;Je(o)||(o=fw(o)),o||(this.logger.warn(`missed to resolve ${l[1]} for nesting ${t}`),o=""),f.length&&(o=f.reduce((g,m)=>this.format(g,m,i.lng,{...i,interpolationkey:l[1].trim()}),o.trim())),t=t.replace(l[0],o),this.regexp.lastIndex=0}return t}}const l9=e=>{let t=e.toLowerCase().trim();const r={};if(e.indexOf("(")>-1){const i=e.split("(");t=i[0].toLowerCase().trim();const l=i[1].substring(0,i[1].length-1);t==="currency"&&l.indexOf(":")<0?r.currency||(r.currency=l.trim()):t==="relativetime"&&l.indexOf(":")<0?r.range||(r.range=l.trim()):l.split(";").forEach(c=>{if(c){const[d,...f]=c.split(":"),h=f.join(":").trim().replace(/^'+|'+$/g,""),g=d.trim();r[g]||(r[g]=h),h==="false"&&(r[g]=!1),h==="true"&&(r[g]=!0),isNaN(h)||(r[g]=parseInt(h,10))}})}return{formatName:t,formatOptions:r}},Sw=e=>{const t={};return(r,i,l)=>{let o=l;l&&l.interpolationkey&&l.formatParams&&l.formatParams[l.interpolationkey]&&l[l.interpolationkey]&&(o={...o,[l.interpolationkey]:void 0});const c=i+JSON.stringify(o);let d=t[c];return d||(d=e(Ro(i),l),t[c]=d),d(r)}},o9=e=>(t,r,i)=>e(Ro(r),i)(t);class c9{constructor(t={}){this.logger=ea.create("formatter"),this.options=t,this.init(t)}init(t,r={interpolation:{}}){this.formatSeparator=r.interpolation.formatSeparator||",";const i=r.cacheInBuiltFormats?Sw:o9;this.formats={number:i((l,o)=>{const c=new Intl.NumberFormat(l,{...o});return d=>c.format(d)}),currency:i((l,o)=>{const c=new Intl.NumberFormat(l,{...o,style:"currency"});return d=>c.format(d)}),datetime:i((l,o)=>{const c=new Intl.DateTimeFormat(l,{...o});return d=>c.format(d)}),relativetime:i((l,o)=>{const c=new Intl.RelativeTimeFormat(l,{...o});return d=>c.format(d,o.range||"day")}),list:i((l,o)=>{const c=new Intl.ListFormat(l,{...o});return d=>c.format(d)})}}add(t,r){this.formats[t.toLowerCase().trim()]=r}addCached(t,r){this.formats[t.toLowerCase().trim()]=Sw(r)}format(t,r,i,l={}){const o=r.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(d=>d.indexOf(")")>-1)){const d=o.findIndex(f=>f.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,d)].join(this.formatSeparator)}return o.reduce((d,f)=>{var m;const{formatName:h,formatOptions:g}=l9(f);if(this.formats[h]){let x=d;try{const v=((m=l==null?void 0:l.formatParams)==null?void 0:m[l.interpolationkey])||{},E=v.locale||v.lng||l.locale||l.lng||i;x=this.formats[h](d,E,{...g,...l,...v})}catch(v){this.logger.warn(v)}return x}else this.logger.warn(`there was no format function for ${h}`);return d},t)}}const u9=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class d9 extends _d{constructor(t,r,i,l={}){var o,c;super(),this.backend=t,this.store=r,this.services=i,this.languageUtils=i.languageUtils,this.options=l,this.logger=ea.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=l.maxParallelReads||10,this.readingCalls=0,this.maxRetries=l.maxRetries>=0?l.maxRetries:5,this.retryTimeout=l.retryTimeout>=1?l.retryTimeout:350,this.state={},this.queue=[],(c=(o=this.backend)==null?void 0:o.init)==null||c.call(o,i,l.backend,l)}queueLoad(t,r,i,l){const o={},c={},d={},f={};return t.forEach(h=>{let g=!0;r.forEach(m=>{const x=`${h}|${m}`;!i.reload&&this.store.hasResourceBundle(h,m)?this.state[x]=2:this.state[x]<0||(this.state[x]===1?c[x]===void 0&&(c[x]=!0):(this.state[x]=1,g=!1,c[x]===void 0&&(c[x]=!0),o[x]===void 0&&(o[x]=!0),f[m]===void 0&&(f[m]=!0)))}),g||(d[h]=!0)}),(Object.keys(o).length||Object.keys(c).length)&&this.queue.push({pending:c,pendingCount:Object.keys(c).length,loaded:{},errors:[],callback:l}),{toLoad:Object.keys(o),pending:Object.keys(c),toLoadLanguages:Object.keys(d),toLoadNamespaces:Object.keys(f)}}loaded(t,r,i){const l=t.split("|"),o=l[0],c=l[1];r&&this.emit("failedLoading",o,c,r),!r&&i&&this.store.addResourceBundle(o,c,i,void 0,void 0,{skipCopy:!0}),this.state[t]=r?-1:2,r&&i&&(this.state[t]=0);const d={};this.queue.forEach(f=>{W8(f.loaded,[o],c),u9(f,t),r&&f.errors.push(r),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(h=>{d[h]||(d[h]={});const g=f.loaded[h];g.length&&g.forEach(m=>{d[h][m]===void 0&&(d[h][m]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(f=>!f.done)}read(t,r,i,l=0,o=this.retryTimeout,c){if(!t.length)return c(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:r,fcName:i,tried:l,wait:o,callback:c});return}this.readingCalls++;const d=(h,g)=>{if(this.readingCalls--,this.waitingReads.length>0){const m=this.waitingReads.shift();this.read(m.lng,m.ns,m.fcName,m.tried,m.wait,m.callback)}if(h&&g&&l<this.maxRetries){setTimeout(()=>{this.read.call(this,t,r,i,l+1,o*2,c)},o);return}c(h,g)},f=this.backend[i].bind(this.backend);if(f.length===2){try{const h=f(t,r);h&&typeof h.then=="function"?h.then(g=>d(null,g)).catch(d):d(null,h)}catch(h){d(h)}return}return f(t,r,d)}prepareLoading(t,r,i={},l){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();Je(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Je(r)&&(r=[r]);const o=this.queueLoad(t,r,i,l);if(!o.toLoad.length)return o.pending.length||l(),null;o.toLoad.forEach(c=>{this.loadOne(c)})}load(t,r,i){this.prepareLoading(t,r,{},i)}reload(t,r,i){this.prepareLoading(t,r,{reload:!0},i)}loadOne(t,r=""){const i=t.split("|"),l=i[0],o=i[1];this.read(l,o,"read",void 0,void 0,(c,d)=>{c&&this.logger.warn(`${r}loading namespace ${o} for language ${l} failed`,c),!c&&d&&this.logger.log(`${r}loaded namespace ${o} for language ${l}`,d),this.loaded(t,c,d)})}saveMissing(t,r,i,l,o,c={},d=()=>{}){var f,h,g,m,x;if((h=(f=this.services)==null?void 0:f.utils)!=null&&h.hasLoadedNamespace&&!((m=(g=this.services)==null?void 0:g.utils)!=null&&m.hasLoadedNamespace(r))){this.logger.warn(`did not save key "${i}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if((x=this.backend)!=null&&x.create){const v={...c,isUpdate:o},E=this.backend.create.bind(this.backend);if(E.length<6)try{let S;E.length===5?S=E(t,r,i,l,v):S=E(t,r,i,l),S&&typeof S.then=="function"?S.then(_=>d(null,_)).catch(d):d(null,S)}catch(S){d(S)}else E(t,r,i,l,d,v)}!t||!t[0]||this.store.addResource(t[0],r,i,l)}}}const Sp=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Je(e[1])&&(t.defaultValue=e[1]),Je(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const r=e[3]||e[2];Object.keys(r).forEach(i=>{t[i]=r[i]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),_w=e=>{var t,r;return Je(e.ns)&&(e.ns=[e.ns]),Je(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Je(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),((r=(t=e.supportedLngs)==null?void 0:t.indexOf)==null?void 0:r.call(t,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e},xu=()=>{},f9=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(r=>{typeof e[r]=="function"&&(e[r]=e[r].bind(e))})},Z_="__i18next_supportNoticeShown",h9=()=>!!(typeof globalThis<"u"&&globalThis[Z_]||typeof process<"u"&&vp&&vp.I18NEXT_NO_SUPPORT_NOTICE||typeof process<"u"&&vp),p9=()=>{typeof globalThis<"u"&&(globalThis[Z_]=!0)},m9=e=>{var t,r,i,l,o,c,d,f,h,g,m,x,v;return!!(((i=(r=(t=e==null?void 0:e.modules)==null?void 0:t.backend)==null?void 0:r.name)==null?void 0:i.indexOf("Locize"))>0||((d=(c=(o=(l=e==null?void 0:e.modules)==null?void 0:l.backend)==null?void 0:o.constructor)==null?void 0:c.name)==null?void 0:d.indexOf("Locize"))>0||(h=(f=e==null?void 0:e.options)==null?void 0:f.backend)!=null&&h.backends&&e.options.backend.backends.some(E=>{var S,_,C;return((S=E==null?void 0:E.name)==null?void 0:S.indexOf("Locize"))>0||((C=(_=E==null?void 0:E.constructor)==null?void 0:_.name)==null?void 0:C.indexOf("Locize"))>0})||(m=(g=e==null?void 0:e.options)==null?void 0:g.backend)!=null&&m.projectId||(v=(x=e==null?void 0:e.options)==null?void 0:x.backend)!=null&&v.backendOptions&&e.options.backend.backendOptions.some(E=>E==null?void 0:E.projectId))};class xo extends _d{constructor(t={},r){if(super(),this.options=_w(t),this.services={},this.logger=ea,this.modules={external:[]},f9(this),r&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,r),this;setTimeout(()=>{this.init(t,r)},0)}}init(t={},r){this.isInitializing=!0,typeof t=="function"&&(r=t,t={}),t.defaultNS==null&&t.ns&&(Je(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const i=Sp();this.options={...i,...this.options,..._w(t)},this.options.interpolation={...i.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!m9(this)&&!h9()&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),p9());const l=h=>h?typeof h=="function"?new h:h:null;if(!this.options.isClone){this.modules.logger?ea.init(l(this.modules.logger),this.options):ea.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:h=c9;const g=new yw(this.options);this.store=new gw(this.options.resources,this.options);const m=this.services;m.logger=ea,m.resourceStore=this.store,m.languageUtils=g,m.pluralResolver=new s9(g,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==i.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),h&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(m.formatter=l(h),m.formatter.init&&m.formatter.init(m,this.options),this.options.interpolation.format=m.formatter.format.bind(m.formatter)),m.interpolator=new Ew(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new d9(l(this.modules.backend),m.resourceStore,m,this.options),m.backendConnector.on("*",(v,...E)=>{this.emit(v,...E)}),this.modules.languageDetector&&(m.languageDetector=l(this.modules.languageDetector),m.languageDetector.init&&m.languageDetector.init(m,this.options.detection,this.options)),this.modules.i18nFormat&&(m.i18nFormat=l(this.modules.i18nFormat),m.i18nFormat.init&&m.i18nFormat.init(this)),this.translator=new Yu(this.services,this.options),this.translator.on("*",(v,...E)=>{this.emit(v,...E)}),this.modules.external.forEach(v=>{v.init&&v.init(this)})}if(this.format=this.options.interpolation.format,r||(r=xu),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(h=>{this[h]=(...g)=>this.store[h](...g)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=(...g)=>(this.store[h](...g),this)});const d=ho(),f=()=>{const h=(g,m)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),d.resolve(m),r(g,m)};if(this.languages&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initAsync?f():setTimeout(f,0),d}loadResources(t,r=xu){var o,c;let i=r;const l=Je(t)?t:this.language;if(typeof t=="function"&&(i=t),!this.options.resources||this.options.partialBundledLanguages){if((l==null?void 0:l.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const d=[],f=h=>{if(!h||h==="cimode")return;this.services.languageUtils.toResolveHierarchy(h).forEach(m=>{m!=="cimode"&&d.indexOf(m)<0&&d.push(m)})};l?f(l):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(g=>f(g)),(c=(o=this.options.preload)==null?void 0:o.forEach)==null||c.call(o,h=>f(h)),this.services.backendConnector.load(d,this.options.ns,h=>{!h&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(h)})}else i(null)}reloadResources(t,r,i){const l=ho();return typeof t=="function"&&(i=t,t=void 0),typeof r=="function"&&(i=r,r=void 0),t||(t=this.languages),r||(r=this.options.ns),i||(i=xu),this.services.backendConnector.reload(t,r,o=>{l.resolve(),i(o)}),l}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&W_.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let r=0;r<this.languages.length;r++){const i=this.languages[r];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,r){this.isLanguageChangingTo=t;const i=ho();this.emit("languageChanging",t);const l=d=>{this.language=d,this.languages=this.services.languageUtils.toResolveHierarchy(d),this.resolvedLanguage=void 0,this.setResolvedLanguage(d)},o=(d,f)=>{f?this.isLanguageChangingTo===t&&(l(f),this.translator.changeLanguage(f),this.isLanguageChangingTo=void 0,this.emit("languageChanged",f),this.logger.log("languageChanged",f)):this.isLanguageChangingTo=void 0,i.resolve((...h)=>this.t(...h)),r&&r(d,(...h)=>this.t(...h))},c=d=>{var g,m;!t&&!d&&this.services.languageDetector&&(d=[]);const f=Je(d)?d:d&&d[0],h=this.store.hasLanguageSomeTranslations(f)?f:this.services.languageUtils.getBestMatchFromCodes(Je(d)?[d]:d);h&&(this.language||l(h),this.translator.language||this.translator.changeLanguage(h),(m=(g=this.services.languageDetector)==null?void 0:g.cacheUserLanguage)==null||m.call(g,h)),this.loadResources(h,x=>{o(x,h)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(c):this.services.languageDetector.detect(c):c(t),i}getFixedT(t,r,i){const l=(o,c,...d)=>{let f;typeof c!="object"?f=this.options.overloadTranslationOptionHandler([o,c].concat(d)):f={...c},f.lng=f.lng||l.lng,f.lngs=f.lngs||l.lngs,f.ns=f.ns||l.ns,f.keyPrefix!==""&&(f.keyPrefix=f.keyPrefix||i||l.keyPrefix);const h={...this.options,...f};typeof f.keyPrefix=="function"&&(f.keyPrefix=Qs(f.keyPrefix,h));const g=this.options.keySeparator||".";let m;return f.keyPrefix&&Array.isArray(o)?m=o.map(x=>(typeof x=="function"&&(x=Qs(x,h)),`${f.keyPrefix}${g}${x}`)):(typeof o=="function"&&(o=Qs(o,h)),m=f.keyPrefix?`${f.keyPrefix}${g}${o}`:o),this.t(m,f)};return Je(t)?l.lng=t:l.lngs=t,l.ns=r,l.keyPrefix=i,l}t(...t){var r;return(r=this.translator)==null?void 0:r.translate(...t)}exists(...t){var r;return(r=this.translator)==null?void 0:r.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,r={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=r.lng||this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const c=(d,f)=>{const h=this.services.backendConnector.state[`${d}|${f}`];return h===-1||h===0||h===2};if(r.precheck){const d=r.precheck(this,c);if(d!==void 0)return d}return!!(this.hasResourceBundle(i,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||c(i,t)&&(!l||c(o,t)))}loadNamespaces(t,r){const i=ho();return this.options.ns?(Je(t)&&(t=[t]),t.forEach(l=>{this.options.ns.indexOf(l)<0&&this.options.ns.push(l)}),this.loadResources(l=>{i.resolve(),r&&r(l)}),i):(r&&r(),Promise.resolve())}loadLanguages(t,r){const i=ho();Je(t)&&(t=[t]);const l=this.options.preload||[],o=t.filter(c=>l.indexOf(c)<0&&this.services.languageUtils.isSupportedCode(c));return o.length?(this.options.preload=l.concat(o),this.loadResources(c=>{i.resolve(),r&&r(c)}),i):(r&&r(),Promise.resolve())}dir(t){var l,o;if(t||(t=this.resolvedLanguage||(((l=this.languages)==null?void 0:l.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const c=new Intl.Locale(t);if(c&&c.getTextInfo){const d=c.getTextInfo();if(d&&d.direction)return d.direction}}catch{}const r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=((o=this.services)==null?void 0:o.languageUtils)||new yw(Sp());return t.toLowerCase().indexOf("-latn")>1?"ltr":r.indexOf(i.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},r){const i=new xo(t,r);return i.createInstance=xo.createInstance,i}cloneInstance(t={},r=xu){const i=t.forkResourceStore;i&&delete t.forkResourceStore;const l={...this.options,...t,isClone:!0},o=new xo(l);if((t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(d=>{o[d]=this[d]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},i){const d=Object.keys(this.store.data).reduce((f,h)=>(f[h]={...this.store.data[h]},f[h]=Object.keys(f[h]).reduce((g,m)=>(g[m]={...f[h][m]},g),f[h]),f),{});o.store=new gw(d,l),o.services.resourceStore=o.store}if(t.interpolation){const f={...Sp().interpolation,...this.options.interpolation,...t.interpolation},h={...l,interpolation:f};o.services.interpolator=new Ew(h)}return o.translator=new Yu(o.services,l),o.translator.on("*",(d,...f)=>{o.emit(d,...f)}),o.init(l,r),o.translator.options=l,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Bn=xo.createInstance();Bn.createInstance;Bn.dir;Bn.init;Bn.loadResources;Bn.reloadResources;Bn.use;Bn.changeLanguage;Bn.getFixedT;Bn.t;Bn.exists;Bn.setDefaultNamespace;Bn.hasLoadedNamespace;Bn.loadNamespaces;Bn.loadLanguages;const g9={dashboard:"Dashboard",chat:"Chat",chatDesktop:"Desktop Chat",chatWeb:"Chat",workspace:"Workspace",knowledge:"Knowledge",projects:"Projects",sessions:"Sessions",cron:"Cron",bridge:"Bridge",system:"System"},b9={title:"Dashboard",version:"Version",uptime:"Uptime",platforms:"Platforms",projects:"Projects",bridgeAdapters:"Bridge adapters",noData:"No data available"},y9={title:"Projects",name:"Name",agent:"Agent",platforms:"Platforms",sessions:"Sessions",heartbeat:"Heartbeat",settings:"Settings",quiet:"Quiet mode",language:"Language",adminFrom:"Admin from",disabledCommands:"Disabled commands",save:"Save",detail:"Details",noProjects:"No projects configured",tabs:{overview:"Overview",providers:"Providers",heartbeat:"Heartbeat",settings:"Settings"}},x9={title:"Sessions",id:"ID",sessionKey:"Session key",name:"Name",platform:"Platform",active:"Active",createdAt:"Created at",history:"History",send:"Send",messageInput:"Message",delete:"Delete",noSessions:"No sessions",noMessages:"No messages yet",notLiveHint:"This chat target is offline right now, so replies are temporarily unavailable. When new activity arrives, sending will become available again.",offline:"offline",justNow:"just now",allProjects:"All projects",chat:"Chat",enterSession:"Open session",newChat:"New chat",selectProject:"Select a project",projectRequired:"Choose a project before starting a chat.",noAvailableChatTarget:"There is no conversation ready to chat in this project yet. Open an available session from the sessions view first.",noReadyChats:"There are no chat-ready sessions right now. Use the Sessions page to review history.",emptyProject:"This project does not have any sessions yet.",emptySelection:"Pick a project and start a new chat to begin.",activeChat:"Active chat",sendHint:"Messages will be sent to the selected project.",waitingForReply:"Waiting for the assistant reply…",preparingChat:"Preparing the chat…",pollTimeout:"The assistant did not finish responding before the refresh timeout.",createFailed:"Failed to create a new chat session.",loadFailed:"Failed to load the selected session.",sendFailed:"Failed to send the message.",sessionUnavailable:"This chat target is offline right now, so replies are temporarily unavailable. Try again after new activity arrives.",deleteConfirmTitle:"Delete session",deleteConfirmBody:"This removes the saved conversation history for the selected session.",renameTitle:"Rename session",renamePlaceholder:"Session name",loadSession:"Open",historyTitle:"Conversation history",availableNow:"Ready to chat",waitingActivation:"Waiting to become available"},v9={title:"Providers",name:"Name",model:"Model",baseUrl:"Base URL",active:"Active",add:"Add provider",remove:"Remove",activate:"Activate",setModel:"Set model",models:"Models"},w9={title:"Scheduled jobs",expression:"Cron expression",prompt:"Prompt",exec:"Execute",description:"Description",enabled:"Enabled",silent:"Silent",lastRun:"Last run",lastError:"Last error",add:"Add job",delete:"Delete",noJobs:"No scheduled jobs",workDir:"Working directory",sessionKey:"Session key",project:"Project"},E9={title:"Heartbeat",status:"Status",interval:"Interval",paused:"Paused",running:"Running",pause:"Pause",resume:"Resume",trigger:"Run now",setInterval:"Set interval",runCount:"Run count",errorCount:"Error count",skippedBusy:"Skipped (busy)",lastRun:"Last run"},S9={title:"Bridge",platform:"Platform",capabilities:"Capabilities",connectedAt:"Connected at",noAdapters:"No bridge adapters"},_9={title:"System",config:"Configuration",logs:"Logs",restart:"Restart",reload:"Reload config",restartConfirm:"Restart the service? Active sessions may be interrupted.",reloadConfirm:"Reload configuration from disk?",level:"Log level",limit:"Line limit"},k9={title:"AgentDock",subtitle:"Connect to your AgentDock instance",token:"API token",serverUrl:"Server URL",connect:"Connect",invalidToken:"Invalid or expired token",logout:"Log out"},C9={loading:"Loading…",error:"Error",success:"Success",confirm:"Confirm",cancel:"Cancel",save:"Save",delete:"Delete",back:"Back",refresh:"Refresh",search:"Search",noData:"No data",actions:"Actions",viewAll:"View all",optional:"optional",confirmDelete:"Are you sure you want to delete this?"},N9={light:"Light",dark:"Dark",system:"System"},T9={nav:g9,dashboard:b9,projects:y9,sessions:x9,providers:v9,cron:w9,heartbeat:E9,bridge:S9,system:_9,login:k9,common:C9,theme:N9},A9={dashboard:"概览",chat:"聊天",chatDesktop:"桌面聊天",chatWeb:"聊天",workspace:"工作区",knowledge:"知识库",projects:"项目",sessions:"会话",cron:"定时任务",bridge:"桥接",system:"系统"},R9={title:"概览",version:"版本",uptime:"运行时间",platforms:"平台",projects:"项目",bridgeAdapters:"桥接适配器",noData:"暂无数据"},O9={title:"项目",name:"名称",agent:"智能体",platforms:"平台",sessions:"会话",heartbeat:"心跳",settings:"设置",quiet:"静默模式",language:"语言",adminFrom:"管理来源",disabledCommands:"已禁用命令",save:"保存",detail:"详情",noProjects:"尚未配置项目",tabs:{overview:"概览",providers:"服务商",heartbeat:"心跳",settings:"设置"}},M9={title:"会话",id:"编号",sessionKey:"会话键",name:"名称",platform:"平台",active:"活跃",createdAt:"创建时间",history:"历史",send:"发送",messageInput:"消息",delete:"删除",noSessions:"暂无会话",noMessages:"暂无消息",notLiveHint:"当前聊天对象现在不在线,暂时不能继续回复。等有新消息进来后,这里会自动恢复可发送。",offline:"离线",justNow:"刚刚",allProjects:"全部项目",chat:"对话",enterSession:"进入会话",newChat:"新建聊天",selectProject:"选择项目",projectRequired:"开始聊天前请先选择一个项目。",noAvailableChatTarget:"当前项目还没有可直接聊天的会话,请先从会话列表打开一个可用会话。",noReadyChats:"当前没有可立即聊天的会话,请到“会话”页查看历史记录。",emptyProject:"这个项目下还没有任何会话。",emptySelection:"选择一个项目,然后开始新的聊天。",activeChat:"当前聊天",sendHint:"消息会发送到当前选中的项目。",waitingForReply:"正在等待助手回复…",preparingChat:"正在准备聊天…",pollTimeout:"刷新超时前未收到完整回复。",createFailed:"创建新聊天会话失败。",loadFailed:"加载所选会话失败。",sendFailed:"发送消息失败。",sessionUnavailable:"当前聊天对象现在不在线,暂时不能继续回复。等有新消息进来后再试。",deleteConfirmTitle:"删除会话",deleteConfirmBody:"这会移除该会话保存的历史对话。",renameTitle:"重命名会话",renamePlaceholder:"会话名称",loadSession:"打开",historyTitle:"历史会话",availableNow:"可发送消息",waitingActivation:"等待激活"},D9={title:"模型提供方",name:"名称",model:"模型",baseUrl:"基础 URL",active:"当前使用",add:"添加提供方",remove:"移除",activate:"启用",setModel:"设置模型",models:"可用模型"},j9={title:"定时任务",expression:"Cron 表达式",prompt:"提示词",exec:"执行",description:"描述",enabled:"已启用",silent:"静默",lastRun:"上次运行",lastError:"上次错误",add:"添加任务",delete:"删除",noJobs:"暂无定时任务",workDir:"工作目录",sessionKey:"会话键",project:"项目"},L9={title:"心跳",status:"状态",interval:"间隔",paused:"已暂停",running:"运行中",pause:"暂停",resume:"恢复",trigger:"立即执行",setInterval:"设置间隔",runCount:"执行次数",errorCount:"错误次数",skippedBusy:"跳过(忙碌)",lastRun:"上次运行"},I9={title:"桥接",platform:"平台",capabilities:"能力",connectedAt:"连接时间",noAdapters:"暂无桥接适配器"},z9={title:"系统",config:"配置",logs:"日志",restart:"重启",reload:"重载配置",restartConfirm:"确定要重启服务吗?进行中的会话可能会中断。",reloadConfirm:"从磁盘重新加载配置?",level:"日志级别",limit:"行数限制"},P9={title:"AgentDock",subtitle:"连接到您的 AgentDock 实例",token:"API 令牌",serverUrl:"服务器地址",connect:"连接",invalidToken:"令牌无效或已过期",logout:"退出登录"},B9={loading:"加载中…",error:"错误",success:"成功",confirm:"确认",cancel:"取消",save:"保存",delete:"删除",back:"返回",refresh:"刷新",search:"搜索",noData:"无数据",actions:"操作",viewAll:"查看全部",optional:"可选",confirmDelete:"确定要删除吗?"},U9={light:"浅色",dark:"深色",system:"跟随系统"},F9={nav:A9,dashboard:R9,projects:O9,sessions:M9,providers:D9,cron:j9,heartbeat:L9,bridge:I9,system:z9,login:P9,common:B9,theme:U9},$9={dashboard:"總覽",chat:"聊天",chatDesktop:"桌面聊天",chatWeb:"聊天",workspace:"工作區",knowledge:"知識庫",projects:"專案",sessions:"工作階段",cron:"排程工作",bridge:"橋接",system:"系統"},H9={title:"總覽",version:"版本",uptime:"運作時間",platforms:"平台",projects:"專案",bridgeAdapters:"橋接介接器",noData:"尚無資料"},K9={title:"專案",name:"名稱",agent:"智慧代理",platforms:"平台",sessions:"工作階段",heartbeat:"心跳",settings:"設定",quiet:"靜音模式",language:"語言",adminFrom:"管理來源",disabledCommands:"已停用指令",save:"儲存",detail:"詳細資料",noProjects:"尚未設定專案",tabs:{overview:"總覽",providers:"供應商",heartbeat:"心跳",settings:"設定"}},q9={title:"工作階段",id:"編號",sessionKey:"工作階段金鑰",name:"名稱",platform:"平台",active:"使用中",createdAt:"建立時間",history:"歷程",send:"傳送",messageInput:"訊息",delete:"刪除",noSessions:"尚無工作階段",noMessages:"暫無訊息",notLiveHint:"目前這個聊天對象不在線上,暫時無法繼續回覆。等有新訊息進來後,這裡會自動恢復可傳送。",offline:"離線",justNow:"剛剛",allProjects:"全部專案",chat:"對話",enterSession:"進入工作階段",newChat:"新增聊天",selectProject:"選擇專案",projectRequired:"開始聊天前請先選擇一個專案。",noAvailableChatTarget:"這個專案目前還沒有可直接聊天的對話,請先從工作階段頁面開啟一個可用對話。",noReadyChats:"目前沒有可立即聊天的對話,請到「工作階段」頁面查看歷史記錄。",emptyProject:"這個專案下還沒有任何工作階段。",emptySelection:"選擇一個專案,然後開始新的聊天。",activeChat:"目前聊天",sendHint:"訊息會傳送到目前選取的專案。",waitingForReply:"正在等待助手回覆…",preparingChat:"正在準備聊天…",pollTimeout:"在重新整理逾時前尚未收到完整回覆。",createFailed:"建立新聊天工作階段失敗。",loadFailed:"載入所選工作階段失敗。",sendFailed:"傳送訊息失敗。",sessionUnavailable:"目前這個聊天對象不在線上,暫時無法繼續回覆。等有新訊息進來後再試一次。",deleteConfirmTitle:"刪除工作階段",deleteConfirmBody:"這會移除該工作階段儲存的歷史對話。",renameTitle:"重新命名工作階段",renamePlaceholder:"工作階段名稱",loadSession:"開啟",historyTitle:"歷史工作階段",availableNow:"可傳送訊息",waitingActivation:"等待啟用"},G9={title:"模型供應商",name:"名稱",model:"模型",baseUrl:"基礎 URL",active:"使用中",add:"新增供應商",remove:"移除",activate:"啟用",setModel:"設定模型",models:"可用模型"},V9={title:"排程工作",expression:"Cron 運算式",prompt:"提示詞",exec:"執行",description:"說明",enabled:"已啟用",silent:"靜音",lastRun:"上次執行",lastError:"上次錯誤",add:"新增工作",delete:"刪除",noJobs:"尚無排程工作",workDir:"工作目錄",sessionKey:"工作階段金鑰",project:"專案"},Y9={title:"心跳",status:"狀態",interval:"間隔",paused:"已暫停",running:"執行中",pause:"暫停",resume:"繼續",trigger:"立即執行",setInterval:"設定間隔",runCount:"執行次數",errorCount:"錯誤次數",skippedBusy:"略過(忙碌)",lastRun:"上次執行"},X9={title:"橋接",platform:"平台",capabilities:"能力",connectedAt:"連線時間",noAdapters:"尚無橋接介接器"},W9={title:"系統",config:"設定",logs:"記錄",restart:"重新啟動",reload:"重新載入設定",restartConfirm:"確定要重新啟動服務嗎?進行中的工作階段可能會中斷。",reloadConfirm:"從磁碟重新載入設定?",level:"記錄層級",limit:"筆數上限"},Q9={title:"AgentDock",subtitle:"連線至您的 AgentDock 執行個體",token:"API 權杖",serverUrl:"伺服器位址",connect:"連線",invalidToken:"權杖無效或已過期",logout:"登出"},Z9={loading:"載入中…",error:"錯誤",success:"成功",confirm:"確認",cancel:"取消",save:"儲存",delete:"刪除",back:"返回",refresh:"重新整理",search:"搜尋",noData:"無資料",actions:"操作",viewAll:"檢視全部",optional:"選填",confirmDelete:"確定要刪除嗎?"},J9={light:"淺色",dark:"深色",system:"跟隨系統"},eF={nav:$9,dashboard:H9,projects:K9,sessions:q9,providers:G9,cron:V9,heartbeat:Y9,bridge:X9,system:W9,login:Q9,common:Z9,theme:J9},tF={dashboard:"ダッシュボード",chat:"チャット",chatDesktop:"デスクトップチャット",chatWeb:"チャット",workspace:"ワークスペース",knowledge:"ナレッジ",projects:"プロジェクト",sessions:"セッション",cron:"Cron",bridge:"ブリッジ",system:"システム"},nF={title:"ダッシュボード",version:"バージョン",uptime:"稼働時間",platforms:"プラットフォーム",projects:"プロジェクト",bridgeAdapters:"ブリッジアダプター",noData:"データがありません"},rF={title:"プロジェクト",name:"名前",agent:"エージェント",platforms:"プラットフォーム",sessions:"セッション",heartbeat:"ハートビート",settings:"設定",quiet:"サイレントモード",language:"言語",adminFrom:"管理元",disabledCommands:"無効化したコマンド",save:"保存",detail:"詳細",noProjects:"プロジェクトが設定されていません",tabs:{overview:"概要",providers:"プロバイダー",heartbeat:"ハートビート",settings:"設定"}},aF={title:"セッション",id:"ID",sessionKey:"セッションキー",name:"名前",platform:"プラットフォーム",active:"アクティブ",createdAt:"作成日時",history:"履歴",send:"送信",messageInput:"メッセージ",delete:"削除",noSessions:"セッションがありません",noMessages:"メッセージはまだありません",notLiveHint:"この相手は現在オフラインのため、今は返信できません。新しいアクティビティが届くと送信可能に戻ります。",offline:"オフライン",justNow:"たった今",allProjects:"すべてのプロジェクト",chat:"チャット",enterSession:"セッションを開く",newChat:"新しいチャット",selectProject:"プロジェクトを選択",projectRequired:"チャットを開始する前にプロジェクトを選択してください。",noAvailableChatTarget:"このプロジェクトにはまだすぐ使える会話がありません。先にセッション一覧から利用可能な会話を開いてください。",noReadyChats:"すぐに使える会話はありません。履歴はセッション一覧で確認してください。",emptyProject:"このプロジェクトにはまだセッションがありません。",emptySelection:"プロジェクトを選び、新しいチャットを開始してください。",activeChat:"現在のチャット",sendHint:"メッセージは選択中のプロジェクトに送信されます。",waitingForReply:"アシスタントの返信を待っています…",preparingChat:"チャットを準備しています…",pollTimeout:"更新のタイムアウト前に応答が完了しませんでした。",createFailed:"新しいチャットセッションの作成に失敗しました。",loadFailed:"選択したセッションの読み込みに失敗しました。",sendFailed:"メッセージの送信に失敗しました。",sessionUnavailable:"この相手は現在オフラインのため、今は返信できません。新しいアクティビティが届いてから再試行してください。",deleteConfirmTitle:"セッションを削除",deleteConfirmBody:"選択したセッションの保存済み会話履歴を削除します。",renameTitle:"セッション名を変更",renamePlaceholder:"セッション名",loadSession:"開く",historyTitle:"会話履歴",availableNow:"送信可能",waitingActivation:"利用可能になるのを待機中"},iF={title:"プロバイダー",name:"名前",model:"モデル",baseUrl:"ベース URL",active:"有効",add:"プロバイダーを追加",remove:"削除",activate:"有効化",setModel:"モデルを設定",models:"利用可能なモデル"},sF={title:"スケジュールジョブ",expression:"Cron 式",prompt:"プロンプト",exec:"実行",description:"説明",enabled:"有効",silent:"サイレント",lastRun:"最終実行",lastError:"最後のエラー",add:"ジョブを追加",delete:"削除",noJobs:"スケジュールジョブがありません",workDir:"作業ディレクトリ",sessionKey:"セッションキー",project:"プロジェクト"},lF={title:"ハートビート",status:"状態",interval:"間隔",paused:"一時停止",running:"実行中",pause:"一時停止",resume:"再開",trigger:"今すぐ実行",setInterval:"間隔を設定",runCount:"実行回数",errorCount:"エラー回数",skippedBusy:"スキップ(ビジー)",lastRun:"最終実行"},oF={title:"ブリッジ",platform:"プラットフォーム",capabilities:"機能",connectedAt:"接続日時",noAdapters:"ブリッジアダプターがありません"},cF={title:"システム",config:"設定",logs:"ログ",restart:"再起動",reload:"設定の再読み込み",restartConfirm:"サービスを再起動しますか?アクティブなセッションが中断される場合があります。",reloadConfirm:"ディスクから設定を再読み込みしますか?",level:"ログレベル",limit:"行数の上限"},uF={title:"AgentDock",subtitle:"AgentDock インスタンスに接続",token:"API トークン",serverUrl:"サーバー URL",connect:"接続",invalidToken:"トークンが無効または期限切れです",logout:"ログアウト"},dF={loading:"読み込み中…",error:"エラー",success:"成功",confirm:"確認",cancel:"キャンセル",save:"保存",delete:"削除",back:"戻る",refresh:"更新",search:"検索",noData:"データなし",actions:"操作",viewAll:"すべて表示",optional:"任意",confirmDelete:"本当に削除しますか?"},fF={light:"ライト",dark:"ダーク",system:"システムに合わせる"},hF={nav:tF,dashboard:nF,projects:rF,sessions:aF,providers:iF,cron:sF,heartbeat:lF,bridge:oF,system:cF,login:uF,common:dF,theme:fF},pF={dashboard:"Panel",chat:"Chat",chatDesktop:"Chat de escritorio",chatWeb:"Chat",workspace:"Espacio de trabajo",knowledge:"Conocimiento",projects:"Proyectos",sessions:"Sesiones",cron:"Cron",bridge:"Puente",system:"Sistema"},mF={title:"Panel",version:"Versión",uptime:"Tiempo activo",platforms:"Plataformas",projects:"Proyectos",bridgeAdapters:"Adaptadores de puente",noData:"No hay datos disponibles"},gF={title:"Proyectos",name:"Nombre",agent:"Agente",platforms:"Plataformas",sessions:"Sesiones",heartbeat:"Latido",settings:"Ajustes",quiet:"Modo silencioso",language:"Idioma",adminFrom:"Administración desde",disabledCommands:"Comandos deshabilitados",save:"Guardar",detail:"Detalles",noProjects:"No hay proyectos configurados",tabs:{overview:"Resumen",providers:"Proveedores",heartbeat:"Latido",settings:"Ajustes"}},bF={title:"Sesiones",id:"ID",sessionKey:"Clave de sesión",name:"Nombre",platform:"Plataforma",active:"Activa",createdAt:"Creada el",history:"Historial",send:"Enviar",messageInput:"Mensaje",delete:"Eliminar",noSessions:"No hay sesiones",noMessages:"Sin mensajes aún",notLiveHint:"Este destino de chat está desconectado en este momento, por lo que las respuestas están temporalmente deshabilitadas. Cuando llegue nueva actividad, el envío volverá a estar disponible.",offline:"sin conexión",justNow:"ahora",allProjects:"Todos los proyectos",chat:"Chat",enterSession:"Abrir sesión",newChat:"Nuevo chat",selectProject:"Seleccionar proyecto",projectRequired:"Elija un proyecto antes de iniciar un chat.",noAvailableChatTarget:"Este proyecto todavía no tiene una conversación lista para chatear. Abra primero una sesión disponible desde la vista de sesiones.",noReadyChats:"No hay sesiones listas para chatear en este momento. Use la página de sesiones para revisar el historial.",emptyProject:"Este proyecto todavía no tiene sesiones.",emptySelection:"Seleccione un proyecto y empiece un chat nuevo.",activeChat:"Chat activo",sendHint:"Los mensajes se enviarán al proyecto seleccionado.",waitingForReply:"Esperando la respuesta del asistente…",preparingChat:"Preparando el chat…",pollTimeout:"El asistente no terminó de responder antes del tiempo límite.",createFailed:"No se pudo crear una nueva sesión de chat.",loadFailed:"No se pudo cargar la sesión seleccionada.",sendFailed:"No se pudo enviar el mensaje.",sessionUnavailable:"Este destino de chat está desconectado en este momento, por lo que las respuestas están temporalmente deshabilitadas. Inténtelo de nuevo cuando llegue nueva actividad.",deleteConfirmTitle:"Eliminar sesión",deleteConfirmBody:"Esto elimina el historial guardado de la conversación de la sesión seleccionada.",renameTitle:"Renombrar sesión",renamePlaceholder:"Nombre de la sesión",loadSession:"Abrir",historyTitle:"Historial de conversación",availableNow:"Disponible para chatear",waitingActivation:"Esperando disponibilidad"},yF={title:"Proveedores",name:"Nombre",model:"Modelo",baseUrl:"URL base",active:"Activo",add:"Añadir proveedor",remove:"Quitar",activate:"Activar",setModel:"Establecer modelo",models:"Modelos disponibles"},xF={title:"Tareas programadas",expression:"Expresión cron",prompt:"Indicación",exec:"Ejecutar",description:"Descripción",enabled:"Habilitada",silent:"Silenciosa",lastRun:"Última ejecución",lastError:"Último error",add:"Añadir tarea",delete:"Eliminar",noJobs:"No hay tareas programadas",workDir:"Directorio de trabajo",sessionKey:"Clave de sesión",project:"Proyecto"},vF={title:"Latido",status:"Estado",interval:"Intervalo",paused:"En pausa",running:"En ejecución",pause:"Pausar",resume:"Reanudar",trigger:"Ejecutar ahora",setInterval:"Establecer intervalo",runCount:"Ejecuciones",errorCount:"Errores",skippedBusy:"Omitida (ocupado)",lastRun:"Última ejecución"},wF={title:"Puente",platform:"Plataforma",capabilities:"Capacidades",connectedAt:"Conectada el",noAdapters:"No hay adaptadores de puente"},EF={title:"Sistema",config:"Configuración",logs:"Registros",restart:"Reiniciar",reload:"Recargar configuración",restartConfirm:"¿Reiniciar el servicio? Las sesiones activas pueden interrumpirse.",reloadConfirm:"¿Recargar la configuración desde el disco?",level:"Nivel de registro",limit:"Límite de líneas"},SF={title:"AgentDock",subtitle:"Conéctese a su instancia de AgentDock",token:"Token de API",serverUrl:"URL del servidor",connect:"Conectar",invalidToken:"Token no válido o caducado",logout:"Cerrar sesión"},_F={loading:"Cargando…",error:"Error",success:"Correcto",confirm:"Confirmar",cancel:"Cancelar",save:"Guardar",delete:"Eliminar",back:"Volver",refresh:"Actualizar",search:"Buscar",noData:"Sin datos",actions:"Acciones",viewAll:"Ver todo",optional:"opcional",confirmDelete:"¿Seguro que desea eliminar esto?"},kF={light:"Claro",dark:"Oscuro",system:"Sistema"},CF={nav:pF,dashboard:mF,projects:gF,sessions:bF,providers:yF,cron:xF,heartbeat:vF,bridge:wF,system:EF,login:SF,common:_F,theme:kF},NF=localStorage.getItem("cc_lang")||navigator.language.split("-")[0]||"en";Bn.use(YA).init({resources:{en:{translation:T9},zh:{translation:F9},"zh-TW":{translation:eF},ja:{translation:hF},es:{translation:CF}},lng:NF,fallbackLng:"en",interpolation:{escapeValue:!1}});pr.getState().init();Nm.getState().init();const kw=20,TF=500;function AF(e){return new Promise(t=>window.setTimeout(t,e))}function RF(){return p.jsx("div",{className:"min-h-screen flex items-center justify-center bg-white dark:bg-gray-950 p-6",children:p.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-gray-200 dark:border-white/[0.08] bg-white dark:bg-gray-900 px-5 py-4 text-sm text-gray-600 dark:text-gray-300 shadow-sm",children:[p.jsx(Qu,{size:16,className:"animate-spin"}),"正在初始化 AgentDock 运行时…"]})})}function OF({message:e,logs:t,onRetry:r}){return p.jsx("div",{className:"min-h-screen flex items-center justify-center bg-white dark:bg-gray-950 p-6",children:p.jsxs("div",{className:"max-w-2xl w-full rounded-3xl border border-red-200 dark:border-red-900/40 bg-white dark:bg-gray-900 shadow-sm overflow-hidden",children:[p.jsx("div",{className:"px-6 py-5 border-b border-red-100 dark:border-red-900/30 bg-red-50/80 dark:bg-red-950/20",children:p.jsxs("div",{className:"flex items-start gap-3",children:[p.jsx("div",{className:"w-10 h-10 rounded-2xl bg-red-100 dark:bg-red-950/40 text-red-600 dark:text-red-300 flex items-center justify-center shrink-0",children:p.jsx(P2,{size:18})}),p.jsxs("div",{children:[p.jsx("h1",{className:"text-lg font-semibold text-red-700 dark:text-red-300",children:"AgentDock 运行时初始化失败"}),p.jsx("p",{className:"mt-1 text-sm text-red-600 dark:text-red-400 break-words",children:e})]})]})}),p.jsxs("div",{className:"px-6 py-5 space-y-4",children:[p.jsxs("div",{className:"rounded-2xl border border-gray-200 dark:border-white/[0.08] px-4 py-3 text-sm text-gray-600 dark:text-gray-300",children:[p.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:"What we can do next"}),p.jsx("p",{className:"mt-1",children:"请先重试本地运行时初始化。如果仍然失败,请检查下方运行时日志,并确认 Local AI Core 配置文件路径与运行环境是否正确。"})]}),t.length>0&&p.jsxs("div",{className:"rounded-2xl border border-gray-200 dark:border-white/[0.08] bg-gray-50 dark:bg-gray-950/40 px-4 py-3",children:[p.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"最近的桌面日志"}),p.jsx("pre",{className:"mt-2 max-h-64 overflow-auto whitespace-pre-wrap break-words text-xs text-gray-600 dark:text-gray-300 font-mono",children:t.join(`
487
- `)})]}),p.jsxs("div",{className:"flex gap-3",children:[p.jsxs(Ae,{onClick:r,children:[p.jsx(Qu,{size:14})," 重试初始化"]}),p.jsx(Ae,{variant:"secondary",onClick:()=>window.location.reload(),children:"重新加载应用"})]})]})]})})}function MF(){const[e,t]=w.useState({status:"loading"}),[r,i]=w.useState(!1),l=w.useCallback(async()=>{t({status:"loading"});const c=!!await Jj();if(i(c),c)try{let d=null;for(let f=0;f<kw;f+=1)try{await Ym(),d=null;break}catch(h){d=h,f<kw-1&&await AF(TF)}if(d)throw d;Ph(await Wx()),lt.setBaseUrl(Jr),lt.setToken(""),pr.getState().setManagedSession("",Jr,$i()==="local_core"?"local_core":"electron")}catch(d){let f=[];try{f=await tL(80)}catch{f=[]}t({status:"error",message:d instanceof Error?d.message:String(d),logs:f});return}c||Ph(null),t({status:"ready"})},[]);return w.useEffect(()=>{l()},[l]),w.useEffect(()=>{if(r)return Xm(o=>{lt.setBaseUrl(Jr),lt.setToken(""),Wx().then(c=>Ph(c)).catch(()=>{}),pr.getState().setManagedSession("",Jr,$i()==="local_core"?"local_core":"electron")})},[r]),e.status==="loading"?p.jsx(RF,{}):e.status==="error"?p.jsx(OF,{message:e.message,logs:e.logs,onRetry:()=>void l()}):p.jsx(EA,{children:p.jsx(G8,{})})}Q2.createRoot(document.getElementById("root")).render(p.jsx(V8,{children:p.jsx(MF,{})}));