@coralai/sps-cli 0.58.28 → 0.58.30

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.
@@ -0,0 +1,681 @@
1
+ var YM=Object.defineProperty;var O1=e=>{throw TypeError(e)};var QM=(e,t,n)=>t in e?YM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var R1=(e,t,n)=>QM(e,typeof t!="symbol"?t+"":t,n),kg=(e,t,n)=>t.has(e)||O1("Cannot "+n);var X=(e,t,n)=>(kg(e,t,"read from private field"),n?n.call(e):t.get(e)),Qe=(e,t,n)=>t.has(e)?O1("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ie=(e,t,n,i)=>(kg(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n),ut=(e,t,n)=>(kg(e,t,"access private method"),n);var xf=(e,t,n,i)=>({set _(a){Ie(e,t,a,n)},get _(){return X(e,t,i)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))i(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(a){if(a.ep)return;a.ep=!0;const l=n(a);fetch(a.href,l)}})();function qu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Eg={exports:{}},Xc={};/**
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 L1;function WM(){if(L1)return Xc;L1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(i,a,l){var o=null;if(l!==void 0&&(o=""+l),a.key!==void 0&&(o=""+a.key),"key"in a){l={};for(var d in a)d!=="key"&&(l[d]=a[d])}else l=a;return a=l.ref,{$$typeof:e,type:i,key:o,ref:a!==void 0?a:null,props:l}}return Xc.Fragment=t,Xc.jsx=n,Xc.jsxs=n,Xc}var I1;function XM(){return I1||(I1=1,Eg.exports=WM()),Eg.exports}var c=XM(),Sg={exports:{}},at={};/**
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 z1;function ZM(){if(z1)return at;z1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),o=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"),y=Symbol.iterator;function b(z){return z===null||typeof z!="object"?null:(z=y&&z[y]||z["@@iterator"],typeof z=="function"?z:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,N={};function E(z,V,B){this.props=z,this.context=V,this.refs=N,this.updater=B||k}E.prototype.isReactComponent={},E.prototype.setState=function(z,V){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,V,"setState")},E.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function C(){}C.prototype=E.prototype;function S(z,V,B){this.props=z,this.context=V,this.refs=N,this.updater=B||k}var _=S.prototype=new C;_.constructor=S,v(_,E.prototype),_.isPureReactComponent=!0;var M=Array.isArray;function T(){}var R={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function $(z,V,B){var le=B.ref;return{$$typeof:e,type:z,key:V,ref:le!==void 0?le:null,props:B}}function I(z,V){return $(z.type,V,z.props)}function q(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function F(z){var V={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(B){return V[B]})}var Y=/\/+/g;function D(z,V){return typeof z=="object"&&z!==null&&z.key!=null?F(""+z.key):V.toString(36)}function K(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(T,T):(z.status="pending",z.then(function(V){z.status==="pending"&&(z.status="fulfilled",z.value=V)},function(V){z.status==="pending"&&(z.status="rejected",z.reason=V)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function P(z,V,B,le,ve){var ke=typeof z;(ke==="undefined"||ke==="boolean")&&(z=null);var Se=!1;if(z===null)Se=!0;else switch(ke){case"bigint":case"string":case"number":Se=!0;break;case"object":switch(z.$$typeof){case e:case t:Se=!0;break;case g:return Se=z._init,P(Se(z._payload),V,B,le,ve)}}if(Se)return ve=ve(z),Se=le===""?"."+D(z,0):le,M(ve)?(B="",Se!=null&&(B=Se.replace(Y,"$&/")+"/"),P(ve,V,B,"",function(Te){return Te})):ve!=null&&(q(ve)&&(ve=I(ve,B+(ve.key==null||z&&z.key===ve.key?"":(""+ve.key).replace(Y,"$&/")+"/")+Se)),V.push(ve)),1;Se=0;var J=le===""?".":le+":";if(M(z))for(var ue=0;ue<z.length;ue++)le=z[ue],ke=J+D(le,ue),Se+=P(le,V,B,ke,ve);else if(ue=b(z),typeof ue=="function")for(z=ue.call(z),ue=0;!(le=z.next()).done;)le=le.value,ke=J+D(le,ue++),Se+=P(le,V,B,ke,ve);else if(ke==="object"){if(typeof z.then=="function")return P(K(z),V,B,le,ve);throw V=String(z),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return Se}function H(z,V,B){if(z==null)return z;var le=[],ve=0;return P(z,le,"","",function(ke){return V.call(B,ke,ve++)}),le}function Q(z){if(z._status===-1){var V=z._result;V=V(),V.then(function(B){(z._status===0||z._status===-1)&&(z._status=1,z._result=B)},function(B){(z._status===0||z._status===-1)&&(z._status=2,z._result=B)}),z._status===-1&&(z._status=0,z._result=V)}if(z._status===1)return z._result.default;throw z._result}var G=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},L={map:H,forEach:function(z,V,B){H(z,function(){V.apply(this,arguments)},B)},count:function(z){var V=0;return H(z,function(){V++}),V},toArray:function(z){return H(z,function(V){return V})||[]},only:function(z){if(!q(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return at.Activity=m,at.Children=L,at.Component=E,at.Fragment=n,at.Profiler=a,at.PureComponent=S,at.StrictMode=i,at.Suspense=f,at.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,at.__COMPILER_RUNTIME={__proto__:null,c:function(z){return R.H.useMemoCache(z)}},at.cache=function(z){return function(){return z.apply(null,arguments)}},at.cacheSignal=function(){return null},at.cloneElement=function(z,V,B){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var le=v({},z.props),ve=z.key;if(V!=null)for(ke in V.key!==void 0&&(ve=""+V.key),V)!O.call(V,ke)||ke==="key"||ke==="__self"||ke==="__source"||ke==="ref"&&V.ref===void 0||(le[ke]=V[ke]);var ke=arguments.length-2;if(ke===1)le.children=B;else if(1<ke){for(var Se=Array(ke),J=0;J<ke;J++)Se[J]=arguments[J+2];le.children=Se}return $(z.type,ve,le)},at.createContext=function(z){return z={$$typeof:o,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:l,_context:z},z},at.createElement=function(z,V,B){var le,ve={},ke=null;if(V!=null)for(le in V.key!==void 0&&(ke=""+V.key),V)O.call(V,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(ve[le]=V[le]);var Se=arguments.length-2;if(Se===1)ve.children=B;else if(1<Se){for(var J=Array(Se),ue=0;ue<Se;ue++)J[ue]=arguments[ue+2];ve.children=J}if(z&&z.defaultProps)for(le in Se=z.defaultProps,Se)ve[le]===void 0&&(ve[le]=Se[le]);return $(z,ke,ve)},at.createRef=function(){return{current:null}},at.forwardRef=function(z){return{$$typeof:d,render:z}},at.isValidElement=q,at.lazy=function(z){return{$$typeof:g,_payload:{_status:-1,_result:z},_init:Q}},at.memo=function(z,V){return{$$typeof:h,type:z,compare:V===void 0?null:V}},at.startTransition=function(z){var V=R.T,B={};R.T=B;try{var le=z(),ve=R.S;ve!==null&&ve(B,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(T,G)}catch(ke){G(ke)}finally{V!==null&&B.types!==null&&(V.types=B.types),R.T=V}},at.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},at.use=function(z){return R.H.use(z)},at.useActionState=function(z,V,B){return R.H.useActionState(z,V,B)},at.useCallback=function(z,V){return R.H.useCallback(z,V)},at.useContext=function(z){return R.H.useContext(z)},at.useDebugValue=function(){},at.useDeferredValue=function(z,V){return R.H.useDeferredValue(z,V)},at.useEffect=function(z,V){return R.H.useEffect(z,V)},at.useEffectEvent=function(z){return R.H.useEffectEvent(z)},at.useId=function(){return R.H.useId()},at.useImperativeHandle=function(z,V,B){return R.H.useImperativeHandle(z,V,B)},at.useInsertionEffect=function(z,V){return R.H.useInsertionEffect(z,V)},at.useLayoutEffect=function(z,V){return R.H.useLayoutEffect(z,V)},at.useMemo=function(z,V){return R.H.useMemo(z,V)},at.useOptimistic=function(z,V){return R.H.useOptimistic(z,V)},at.useReducer=function(z,V,B){return R.H.useReducer(z,V,B)},at.useRef=function(z){return R.H.useRef(z)},at.useState=function(z){return R.H.useState(z)},at.useSyncExternalStore=function(z,V,B){return R.H.useSyncExternalStore(z,V,B)},at.useTransition=function(){return R.H.useTransition()},at.version="19.2.5",at}var P1;function Hu(){return P1||(P1=1,Sg.exports=ZM()),Sg.exports}var j=Hu();const JM=qu(j);var Ng={exports:{}},Zc={},_g={exports:{}},jg={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var B1;function eD(){return B1||(B1=1,(function(e){function t(P,H){var Q=P.length;P.push(H);e:for(;0<Q;){var G=Q-1>>>1,L=P[G];if(0<a(L,H))P[G]=H,P[Q]=L,Q=G;else break e}}function n(P){return P.length===0?null:P[0]}function i(P){if(P.length===0)return null;var H=P[0],Q=P.pop();if(Q!==H){P[0]=Q;e:for(var G=0,L=P.length,z=L>>>1;G<z;){var V=2*(G+1)-1,B=P[V],le=V+1,ve=P[le];if(0>a(B,Q))le<L&&0>a(ve,B)?(P[G]=ve,P[le]=Q,G=le):(P[G]=B,P[V]=Q,G=V);else if(le<L&&0>a(ve,Q))P[G]=ve,P[le]=Q,G=le;else break e}}return H}function a(P,H){var Q=P.sortIndex-H.sortIndex;return Q!==0?Q:P.id-H.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var o=Date,d=o.now();e.unstable_now=function(){return o.now()-d}}var f=[],h=[],g=1,m=null,y=3,b=!1,k=!1,v=!1,N=!1,E=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function _(P){for(var H=n(h);H!==null;){if(H.callback===null)i(h);else if(H.startTime<=P)i(h),H.sortIndex=H.expirationTime,t(f,H);else break;H=n(h)}}function M(P){if(v=!1,_(P),!k)if(n(f)!==null)k=!0,T||(T=!0,F());else{var H=n(h);H!==null&&K(M,H.startTime-P)}}var T=!1,R=-1,O=5,$=-1;function I(){return N?!0:!(e.unstable_now()-$<O)}function q(){if(N=!1,T){var P=e.unstable_now();$=P;var H=!0;try{e:{k=!1,v&&(v=!1,C(R),R=-1),b=!0;var Q=y;try{t:{for(_(P),m=n(f);m!==null&&!(m.expirationTime>P&&I());){var G=m.callback;if(typeof G=="function"){m.callback=null,y=m.priorityLevel;var L=G(m.expirationTime<=P);if(P=e.unstable_now(),typeof L=="function"){m.callback=L,_(P),H=!0;break t}m===n(f)&&i(f),_(P)}else i(f);m=n(f)}if(m!==null)H=!0;else{var z=n(h);z!==null&&K(M,z.startTime-P),H=!1}}break e}finally{m=null,y=Q,b=!1}H=void 0}}finally{H?F():T=!1}}}var F;if(typeof S=="function")F=function(){S(q)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,D=Y.port2;Y.port1.onmessage=q,F=function(){D.postMessage(null)}}else F=function(){E(q,0)};function K(P,H){R=E(function(){P(e.unstable_now())},H)}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(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(P){switch(y){case 1:case 2:case 3:var H=3;break;default:H=y}var Q=y;y=H;try{return P()}finally{y=Q}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(P,H){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var Q=y;y=P;try{return H()}finally{y=Q}},e.unstable_scheduleCallback=function(P,H,Q){var G=e.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?G+Q:G):Q=G,P){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=Q+L,P={id:g++,callback:H,priorityLevel:P,startTime:Q,expirationTime:L,sortIndex:-1},Q>G?(P.sortIndex=Q,t(h,P),n(f)===null&&P===n(h)&&(v?(C(R),R=-1):v=!0,K(M,Q-G))):(P.sortIndex=L,t(f,P),k||b||(k=!0,T||(T=!0,F()))),P},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(P){var H=y;return function(){var Q=y;y=H;try{return P.apply(this,arguments)}finally{y=Q}}}})(jg)),jg}var $1;function tD(){return $1||($1=1,_g.exports=eD()),_g.exports}var Cg={exports:{}},Hn={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var U1;function nD(){if(U1)return Hn;U1=1;var e=Hu();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 n(){}var i={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function l(f,h,g){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:m==null?null:""+m,children:f,containerInfo:h,implementation:g}}var o=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 Hn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Hn.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 l(f,h,null,g)},Hn.flushSync=function(f){var h=o.T,g=i.p;try{if(o.T=null,i.p=2,f)return f()}finally{o.T=h,i.p=g,i.d.f()}},Hn.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))},Hn.prefetchDNS=function(f){typeof f=="string"&&i.d.D(f)},Hn.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var g=h.as,m=d(g,h.crossOrigin),y=typeof h.integrity=="string"?h.integrity:void 0,b=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:y,fetchPriority:b}):g==="script"&&i.d.X(f,{crossOrigin:m,integrity:y,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Hn.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)},Hn.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})}},Hn.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)},Hn.requestFormReset=function(f){i.d.r(f)},Hn.unstable_batchedUpdates=function(f,h){return f(h)},Hn.useFormState=function(f,h,g){return o.H.useFormState(f,h,g)},Hn.useFormStatus=function(){return o.H.useHostTransitionStatus()},Hn.version="19.2.5",Hn}var F1;function cN(){if(F1)return Cg.exports;F1=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(),Cg.exports=nD(),Cg.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var q1;function iD(){if(q1)return Zc;q1=1;var e=tD(),t=Hu(),n=cN();function i(r){var s="https://react.dev/errors/"+r;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)s+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+r+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function l(r){var s=r,u=r;if(r.alternate)for(;s.return;)s=s.return;else{r=s;do s=r,(s.flags&4098)!==0&&(u=s.return),r=s.return;while(r)}return s.tag===3?u:null}function o(r){if(r.tag===13){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function d(r){if(r.tag===31){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function f(r){if(l(r)!==r)throw Error(i(188))}function h(r){var s=r.alternate;if(!s){if(s=l(r),s===null)throw Error(i(188));return s!==r?null:r}for(var u=r,p=s;;){var x=u.return;if(x===null)break;var w=x.alternate;if(w===null){if(p=x.return,p!==null){u=p;continue}break}if(x.child===w.child){for(w=x.child;w;){if(w===u)return f(x),r;if(w===p)return f(x),s;w=w.sibling}throw Error(i(188))}if(u.return!==p.return)u=x,p=w;else{for(var A=!1,U=x.child;U;){if(U===u){A=!0,u=x,p=w;break}if(U===p){A=!0,p=x,u=w;break}U=U.sibling}if(!A){for(U=w.child;U;){if(U===u){A=!0,u=w,p=x;break}if(U===p){A=!0,p=w,u=x;break}U=U.sibling}if(!A)throw Error(i(189))}}if(u.alternate!==p)throw Error(i(190))}if(u.tag!==3)throw Error(i(188));return u.stateNode.current===u?r:s}function g(r){var s=r.tag;if(s===5||s===26||s===27||s===6)return r;for(r=r.child;r!==null;){if(s=g(r),s!==null)return s;r=r.sibling}return null}var m=Object.assign,y=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),S=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function F(r){return r===null||typeof r!="object"?null:(r=q&&r[q]||r["@@iterator"],typeof r=="function"?r:null)}var Y=Symbol.for("react.client.reference");function D(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===Y?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case v:return"Fragment";case E:return"Profiler";case N:return"StrictMode";case M:return"Suspense";case T:return"SuspenseList";case $:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case k:return"Portal";case S:return r.displayName||"Context";case C:return(r._context.displayName||"Context")+".Consumer";case _:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case R:return s=r.displayName||null,s!==null?s:D(r.type)||"Memo";case O:s=r._payload,r=r._init;try{return D(r(s))}catch{}}return null}var K=Array.isArray,P=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q={pending:!1,data:null,method:null,action:null},G=[],L=-1;function z(r){return{current:r}}function V(r){0>L||(r.current=G[L],G[L]=null,L--)}function B(r,s){L++,G[L]=r.current,r.current=s}var le=z(null),ve=z(null),ke=z(null),Se=z(null);function J(r,s){switch(B(ke,s),B(ve,r),B(le,null),s.nodeType){case 9:case 11:r=(r=s.documentElement)&&(r=r.namespaceURI)?n1(r):0;break;default:if(r=s.tagName,s=s.namespaceURI)s=n1(s),r=i1(s,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}V(le),B(le,r)}function ue(){V(le),V(ve),V(ke)}function Te(r){r.memoizedState!==null&&B(Se,r);var s=le.current,u=i1(s,r.type);s!==u&&(B(ve,r),B(le,u))}function Re(r){ve.current===r&&(V(le),V(ve)),Se.current===r&&(V(Se),Vc._currentValue=Q)}var De,ce;function Ce(r){if(De===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);De=s&&s[1]||"",ce=-1<u.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+De+r+ce}var te=!1;function pe(r,s){if(!r||te)return"";te=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(s){var we=function(){throw Error()};if(Object.defineProperty(we.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(we,[])}catch(fe){var oe=fe}Reflect.construct(r,[],we)}else{try{we.call()}catch(fe){oe=fe}r.call(we.prototype)}}else{try{throw Error()}catch(fe){oe=fe}(we=r())&&typeof we.catch=="function"&&we.catch(function(){})}}catch(fe){if(fe&&oe&&typeof fe.stack=="string")return[fe.stack,oe.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var x=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");x&&x.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=p.DetermineComponentFrameRoot(),A=w[0],U=w[1];if(A&&U){var W=A.split(`
44
+ `),se=U.split(`
45
+ `);for(x=p=0;p<W.length&&!W[p].includes("DetermineComponentFrameRoot");)p++;for(;x<se.length&&!se[x].includes("DetermineComponentFrameRoot");)x++;if(p===W.length||x===se.length)for(p=W.length-1,x=se.length-1;1<=p&&0<=x&&W[p]!==se[x];)x--;for(;1<=p&&0<=x;p--,x--)if(W[p]!==se[x]){if(p!==1||x!==1)do if(p--,x--,0>x||W[p]!==se[x]){var me=`
46
+ `+W[p].replace(" at new "," at ");return r.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",r.displayName)),me}while(1<=p&&0<=x);break}}}finally{te=!1,Error.prepareStackTrace=u}return(u=r?r.displayName||r.name:"")?Ce(u):""}function Fe(r,s){switch(r.tag){case 26:case 27:case 5:return Ce(r.type);case 16:return Ce("Lazy");case 13:return r.child!==s&&s!==null?Ce("Suspense Fallback"):Ce("Suspense");case 19:return Ce("SuspenseList");case 0:case 15:return pe(r.type,!1);case 11:return pe(r.type.render,!1);case 1:return pe(r.type,!0);case 31:return Ce("Activity");default:return""}}function ze(r){try{var s="",u=null;do s+=Fe(r,u),u=r,r=r.return;while(r);return s}catch(p){return`
47
+ Error generating stack: `+p.message+`
48
+ `+p.stack}}var ae=Object.prototype.hasOwnProperty,be=e.unstable_scheduleCallback,ye=e.unstable_cancelCallback,he=e.unstable_shouldYield,Ee=e.unstable_requestPaint,Ne=e.unstable_now,Ke=e.unstable_getCurrentPriorityLevel,ne=e.unstable_ImmediatePriority,de=e.unstable_UserBlockingPriority,Le=e.unstable_NormalPriority,Ze=e.unstable_LowPriority,rt=e.unstable_IdlePriority,At=e.log,$n=e.unstable_setDisableYieldValue,dn=null,Mt=null;function Qt(r){if(typeof At=="function"&&$n(r),Mt&&typeof Mt.setStrictMode=="function")try{Mt.setStrictMode(dn,r)}catch{}}var yt=Math.clz32?Math.clz32:Nl,Ti=Math.log,Rn=Math.LN2;function Nl(r){return r>>>=0,r===0?32:31-(Ti(r)/Rn|0)|0}var Pr=256,wa=262144,Br=4194304;function Un(r){var s=r&42;if(s!==0)return s;switch(r&-r){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 r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Z(r,s,u){var p=r.pendingLanes;if(p===0)return 0;var x=0,w=r.suspendedLanes,A=r.pingedLanes;r=r.warmLanes;var U=p&134217727;return U!==0?(p=U&~w,p!==0?x=Un(p):(A&=U,A!==0?x=Un(A):u||(u=U&~r,u!==0&&(x=Un(u))))):(U=p&~w,U!==0?x=Un(U):A!==0?x=Un(A):u||(u=p&~r,u!==0&&(x=Un(u)))),x===0?0:s!==0&&s!==x&&(s&w)===0&&(w=x&-x,u=s&-s,w>=u||w===32&&(u&4194048)!==0)?s:x}function ge(r,s){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&s)===0}function Me(r,s){switch(r){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 it(){var r=Br;return Br<<=1,(Br&62914560)===0&&(Br=4194304),r}function Ft(r){for(var s=[],u=0;31>u;u++)s.push(r);return s}function Ot(r,s){r.pendingLanes|=s,s!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Ue(r,s,u,p,x,w){var A=r.pendingLanes;r.pendingLanes=u,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=u,r.entangledLanes&=u,r.errorRecoveryDisabledLanes&=u,r.shellSuspendCounter=0;var U=r.entanglements,W=r.expirationTimes,se=r.hiddenUpdates;for(u=A&~u;0<u;){var me=31-yt(u),we=1<<me;U[me]=0,W[me]=-1;var oe=se[me];if(oe!==null)for(se[me]=null,me=0;me<oe.length;me++){var fe=oe[me];fe!==null&&(fe.lane&=-536870913)}u&=~we}p!==0&&Pe(r,p,0),w!==0&&x===0&&r.tag!==0&&(r.suspendedLanes|=w&~(A&~s))}function Pe(r,s,u){r.pendingLanes|=s,r.suspendedLanes&=~s;var p=31-yt(s);r.entangledLanes|=s,r.entanglements[p]=r.entanglements[p]|1073741824|u&261930}function et(r,s){var u=r.entangledLanes|=s;for(r=r.entanglements;u;){var p=31-yt(u),x=1<<p;x&s|r[p]&s&&(r[p]|=s),u&=~x}}function rn(r,s){var u=s&-s;return u=(u&42)!==0?1:Vt(u),(u&(r.suspendedLanes|s))!==0?0:u}function Vt(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=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:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Qi(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function ka(){var r=H.p;return r!==0?r:(r=window.event,r===void 0?32:_1(r.type))}function Ea(r,s){var u=H.p;try{return H.p=r,s()}finally{H.p=u}}var Mi=Math.random().toString(36).slice(2),an="__reactFiber$"+Mi,Tn="__reactProps$"+Mi,Wi="__reactContainer$"+Mi,Sa="__reactEvents$"+Mi,_s="__reactListeners$"+Mi,Na="__reactHandles$"+Mi,_l="__reactResources$"+Mi,$r="__reactMarker$"+Mi;function js(r){delete r[an],delete r[Tn],delete r[Sa],delete r[_s],delete r[Na]}function Ln(r){var s=r[an];if(s)return s;for(var u=r.parentNode;u;){if(s=u[Wi]||u[an]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(r=u1(r);r!==null;){if(u=r[an])return u;r=u1(r)}return s}r=u,u=r.parentNode}return null}function Xi(r){if(r=r[an]||r[Wi]){var s=r.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return r}return null}function Zi(r){var s=r.tag;if(s===5||s===26||s===27||s===6)return r.stateNode;throw Error(i(33))}function yr(r){var s=r[_l];return s||(s=r[_l]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function fn(r){r[$r]=!0}var jl=new Set,Ur={};function Ji(r,s){_e(r,s),_e(r+"Capture",s)}function _e(r,s){for(Ur[r]=s,r=0;r<s.length;r++)jl.add(s[r])}var Ve=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]*$"),ht={},Nt={};function sn(r){return ae.call(Nt,r)?!0:ae.call(ht,r)?!1:Ve.test(r)?Nt[r]=!0:(ht[r]=!0,!1)}function Mn(r,s,u){if(sn(s))if(u===null)r.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":r.removeAttribute(s);return;case"boolean":var p=s.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){r.removeAttribute(s);return}}r.setAttribute(s,""+u)}}function Qn(r,s,u){if(u===null)r.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttribute(s,""+u)}}function Fn(r,s,u,p){if(p===null)r.removeAttribute(u);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(u);return}r.setAttributeNS(s,u,""+p)}}function zt(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Wn(r){var s=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Cl(r,s,u){var p=Object.getOwnPropertyDescriptor(r.constructor.prototype,s);if(!r.hasOwnProperty(s)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var x=p.get,w=p.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return x.call(this)},set:function(A){u=""+A,w.call(this,A)}}),Object.defineProperty(r,s,{enumerable:p.enumerable}),{getValue:function(){return u},setValue:function(A){u=""+A},stopTracking:function(){r._valueTracker=null,delete r[s]}}}}function _a(r){if(!r._valueTracker){var s=Wn(r)?"checked":"value";r._valueTracker=Cl(r,s,""+r[s])}}function br(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var u=s.getValue(),p="";return r&&(p=Wn(r)?r.checked?"true":"false":r.value),r=p,r!==u?(s.setValue(r),!0):!1}function ja(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var Al=/[\n"\\]/g;function qn(r){return r.replace(Al,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Cs(r,s,u,p,x,w,A,U){r.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?r.type=A:r.removeAttribute("type"),s!=null?A==="number"?(s===0&&r.value===""||r.value!=s)&&(r.value=""+zt(s)):r.value!==""+zt(s)&&(r.value=""+zt(s)):A!=="submit"&&A!=="reset"||r.removeAttribute("value"),s!=null?Ca(r,A,zt(s)):u!=null?Ca(r,A,zt(u)):p!=null&&r.removeAttribute("value"),x==null&&w!=null&&(r.defaultChecked=!!w),x!=null&&(r.checked=x&&typeof x!="function"&&typeof x!="symbol"),U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?r.name=""+zt(U):r.removeAttribute("name")}function er(r,s,u,p,x,w,A,U){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(r.type=w),s!=null||u!=null){if(!(w!=="submit"&&w!=="reset"||s!=null)){_a(r);return}u=u!=null?""+zt(u):"",s=s!=null?""+zt(s):u,U||s===r.value||(r.value=s),r.defaultValue=s}p=p??x,p=typeof p!="function"&&typeof p!="symbol"&&!!p,r.checked=U?r.checked:!!p,r.defaultChecked=!!p,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(r.name=A),_a(r)}function Ca(r,s,u){s==="number"&&ja(r.ownerDocument)===r||r.defaultValue===""+u||(r.defaultValue=""+u)}function _n(r,s,u,p){if(r=r.options,s){s={};for(var x=0;x<u.length;x++)s["$"+u[x]]=!0;for(u=0;u<r.length;u++)x=s.hasOwnProperty("$"+r[u].value),r[u].selected!==x&&(r[u].selected=x),x&&p&&(r[u].defaultSelected=!0)}else{for(u=""+zt(u),s=null,x=0;x<r.length;x++){if(r[x].value===u){r[x].selected=!0,p&&(r[x].defaultSelected=!0);return}s!==null||r[x].disabled||(s=r[x])}s!==null&&(s.selected=!0)}}function As(r,s,u){if(s!=null&&(s=""+zt(s),s!==r.value&&(r.value=s),u==null)){r.defaultValue!==s&&(r.defaultValue=s);return}r.defaultValue=u!=null?""+zt(u):""}function Tl(r,s,u,p){if(s==null){if(p!=null){if(u!=null)throw Error(i(92));if(K(p)){if(1<p.length)throw Error(i(93));p=p[0]}u=p}u==null&&(u=""),s=u}u=zt(s),r.defaultValue=u,p=r.textContent,p===u&&p!==""&&p!==null&&(r.value=p),_a(r)}function nt(r,s){if(s){var u=r.firstChild;if(u&&u===r.lastChild&&u.nodeType===3){u.nodeValue=s;return}}r.textContent=s}var od=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 xn(r,s,u){var p=s.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?p?r.setProperty(s,""):s==="float"?r.cssFloat="":r[s]="":p?r.setProperty(s,u):typeof u!="number"||u===0||od.has(s)?s==="float"?r.cssFloat=u:r[s]=(""+u).trim():r[s]=u+"px"}function Rt(r,s,u){if(s!=null&&typeof s!="object")throw Error(i(62));if(r=r.style,u!=null){for(var p in u)!u.hasOwnProperty(p)||s!=null&&s.hasOwnProperty(p)||(p.indexOf("--")===0?r.setProperty(p,""):p==="float"?r.cssFloat="":r[p]="");for(var x in s)p=s[x],s.hasOwnProperty(x)&&u[x]!==p&&xn(r,x,p)}else for(var w in s)s.hasOwnProperty(w)&&xn(r,w,s[w])}function Aa(r){if(r.indexOf("-")===-1)return!1;switch(r){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 Fr=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"]]),oc=/^[\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 Ta(r){return oc.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Ae(){}var qe=null;function lt(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var bt=null,ln=null;function Di(r){var s=Xi(r);if(s&&(r=s.stateNode)){var u=r[Tn]||null;e:switch(r=s.stateNode,s.type){case"input":if(Cs(r,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),s=u.name,u.type==="radio"&&s!=null){for(u=r;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+qn(""+s)+'"][type="radio"]'),s=0;s<u.length;s++){var p=u[s];if(p!==r&&p.form===r.form){var x=p[Tn]||null;if(!x)throw Error(i(90));Cs(p,x.value,x.defaultValue,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name)}}for(s=0;s<u.length;s++)p=u[s],p.form===r.form&&br(p)}break e;case"textarea":As(r,u.value,u.defaultValue);break e;case"select":s=u.value,s!=null&&_n(r,!!u.multiple,s,!1)}}}var cc=!1;function cd(r,s,u){if(cc)return r(s,u);cc=!0;try{var p=r(s);return p}finally{if(cc=!1,(bt!==null||ln!==null)&&(Wd(),bt&&(s=bt,r=ln,ln=bt=null,Di(s),r)))for(s=0;s<r.length;s++)Di(r[s])}}function uc(r,s){var u=r.stateNode;if(u===null)return null;var p=u[Tn]||null;if(p===null)return null;u=p[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(r=r.type,p=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!p;break e;default:r=!1}if(r)return null;if(u&&typeof u!="function")throw Error(i(231,s,typeof u));return u}var qr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),kp=!1;if(qr)try{var dc={};Object.defineProperty(dc,"passive",{get:function(){kp=!0}}),window.addEventListener("test",dc,dc),window.removeEventListener("test",dc,dc)}catch{kp=!1}var Ma=null,Ep=null,ud=null;function iv(){if(ud)return ud;var r,s=Ep,u=s.length,p,x="value"in Ma?Ma.value:Ma.textContent,w=x.length;for(r=0;r<u&&s[r]===x[r];r++);var A=u-r;for(p=1;p<=A&&s[u-p]===x[w-p];p++);return ud=x.slice(r,1<p?1-p:void 0)}function dd(r){var s=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&s===13&&(r=13)):r=s,r===10&&(r=13),32<=r||r===13?r:0}function fd(){return!0}function rv(){return!1}function ii(r){function s(u,p,x,w,A){this._reactName=u,this._targetInst=x,this.type=p,this.nativeEvent=w,this.target=A,this.currentTarget=null;for(var U in r)r.hasOwnProperty(U)&&(u=r[U],this[U]=u?u(w):w[U]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?fd:rv,this.isPropagationStopped=rv,this}return m(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=fd)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=fd)},persist:function(){},isPersistent:fd}),s}var Ts={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hd=ii(Ts),fc=m({},Ts,{view:0,detail:0}),GA=ii(fc),Sp,Np,hc,pd=m({},fc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jp,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==hc&&(hc&&r.type==="mousemove"?(Sp=r.screenX-hc.screenX,Np=r.screenY-hc.screenY):Np=Sp=0,hc=r),Sp)},movementY:function(r){return"movementY"in r?r.movementY:Np}}),av=ii(pd),VA=m({},pd,{dataTransfer:0}),YA=ii(VA),QA=m({},fc,{relatedTarget:0}),_p=ii(QA),WA=m({},Ts,{animationName:0,elapsedTime:0,pseudoElement:0}),XA=ii(WA),ZA=m({},Ts,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),JA=ii(ZA),eT=m({},Ts,{data:0}),sv=ii(eT),tT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},nT={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"},iT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function rT(r){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(r):(r=iT[r])?!!s[r]:!1}function jp(){return rT}var aT=m({},fc,{key:function(r){if(r.key){var s=tT[r.key]||r.key;if(s!=="Unidentified")return s}return r.type==="keypress"?(r=dd(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?nT[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jp,charCode:function(r){return r.type==="keypress"?dd(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?dd(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),sT=ii(aT),lT=m({},pd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lv=ii(lT),oT=m({},fc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jp}),cT=ii(oT),uT=m({},Ts,{propertyName:0,elapsedTime:0,pseudoElement:0}),dT=ii(uT),fT=m({},pd,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),hT=ii(fT),pT=m({},Ts,{newState:0,oldState:0}),mT=ii(pT),gT=[9,13,27,32],Cp=qr&&"CompositionEvent"in window,pc=null;qr&&"documentMode"in document&&(pc=document.documentMode);var yT=qr&&"TextEvent"in window&&!pc,ov=qr&&(!Cp||pc&&8<pc&&11>=pc),cv=" ",uv=!1;function dv(r,s){switch(r){case"keyup":return gT.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function fv(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ml=!1;function bT(r,s){switch(r){case"compositionend":return fv(s);case"keypress":return s.which!==32?null:(uv=!0,cv);case"textInput":return r=s.data,r===cv&&uv?null:r;default:return null}}function xT(r,s){if(Ml)return r==="compositionend"||!Cp&&dv(r,s)?(r=iv(),ud=Ep=Ma=null,Ml=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return ov&&s.locale!=="ko"?null:s.data;default:return null}}var vT={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 hv(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s==="input"?!!vT[r.type]:s==="textarea"}function pv(r,s,u,p){bt?ln?ln.push(p):ln=[p]:bt=p,s=rf(s,"onChange"),0<s.length&&(u=new hd("onChange","change",null,u,p),r.push({event:u,listeners:s}))}var mc=null,gc=null;function wT(r){Ww(r,0)}function md(r){var s=Zi(r);if(br(s))return r}function mv(r,s){if(r==="change")return s}var gv=!1;if(qr){var Ap;if(qr){var Tp="oninput"in document;if(!Tp){var yv=document.createElement("div");yv.setAttribute("oninput","return;"),Tp=typeof yv.oninput=="function"}Ap=Tp}else Ap=!1;gv=Ap&&(!document.documentMode||9<document.documentMode)}function bv(){mc&&(mc.detachEvent("onpropertychange",xv),gc=mc=null)}function xv(r){if(r.propertyName==="value"&&md(gc)){var s=[];pv(s,gc,r,lt(r)),cd(wT,s)}}function kT(r,s,u){r==="focusin"?(bv(),mc=s,gc=u,mc.attachEvent("onpropertychange",xv)):r==="focusout"&&bv()}function ET(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return md(gc)}function ST(r,s){if(r==="click")return md(s)}function NT(r,s){if(r==="input"||r==="change")return md(s)}function _T(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var gi=typeof Object.is=="function"?Object.is:_T;function yc(r,s){if(gi(r,s))return!0;if(typeof r!="object"||r===null||typeof s!="object"||s===null)return!1;var u=Object.keys(r),p=Object.keys(s);if(u.length!==p.length)return!1;for(p=0;p<u.length;p++){var x=u[p];if(!ae.call(s,x)||!gi(r[x],s[x]))return!1}return!0}function vv(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function wv(r,s){var u=vv(r);r=0;for(var p;u;){if(u.nodeType===3){if(p=r+u.textContent.length,r<=s&&p>=s)return{node:u,offset:s-r};r=p}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=vv(u)}}function kv(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?kv(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function Ev(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var s=ja(r.document);s instanceof r.HTMLIFrameElement;){try{var u=typeof s.contentWindow.location.href=="string"}catch{u=!1}if(u)r=s.contentWindow;else break;s=ja(r.document)}return s}function Mp(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s&&(s==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||s==="textarea"||r.contentEditable==="true")}var jT=qr&&"documentMode"in document&&11>=document.documentMode,Dl=null,Dp=null,bc=null,Op=!1;function Sv(r,s,u){var p=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Op||Dl==null||Dl!==ja(p)||(p=Dl,"selectionStart"in p&&Mp(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),bc&&yc(bc,p)||(bc=p,p=rf(Dp,"onSelect"),0<p.length&&(s=new hd("onSelect","select",null,s,u),r.push({event:s,listeners:p}),s.target=Dl)))}function Ms(r,s){var u={};return u[r.toLowerCase()]=s.toLowerCase(),u["Webkit"+r]="webkit"+s,u["Moz"+r]="moz"+s,u}var Ol={animationend:Ms("Animation","AnimationEnd"),animationiteration:Ms("Animation","AnimationIteration"),animationstart:Ms("Animation","AnimationStart"),transitionrun:Ms("Transition","TransitionRun"),transitionstart:Ms("Transition","TransitionStart"),transitioncancel:Ms("Transition","TransitionCancel"),transitionend:Ms("Transition","TransitionEnd")},Rp={},Nv={};qr&&(Nv=document.createElement("div").style,"AnimationEvent"in window||(delete Ol.animationend.animation,delete Ol.animationiteration.animation,delete Ol.animationstart.animation),"TransitionEvent"in window||delete Ol.transitionend.transition);function Ds(r){if(Rp[r])return Rp[r];if(!Ol[r])return r;var s=Ol[r],u;for(u in s)if(s.hasOwnProperty(u)&&u in Nv)return Rp[r]=s[u];return r}var _v=Ds("animationend"),jv=Ds("animationiteration"),Cv=Ds("animationstart"),CT=Ds("transitionrun"),AT=Ds("transitionstart"),TT=Ds("transitioncancel"),Av=Ds("transitionend"),Tv=new Map,Lp="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(" ");Lp.push("scrollEnd");function tr(r,s){Tv.set(r,s),Ji(s,[r])}var gd=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},Oi=[],Rl=0,Ip=0;function yd(){for(var r=Rl,s=Ip=Rl=0;s<r;){var u=Oi[s];Oi[s++]=null;var p=Oi[s];Oi[s++]=null;var x=Oi[s];Oi[s++]=null;var w=Oi[s];if(Oi[s++]=null,p!==null&&x!==null){var A=p.pending;A===null?x.next=x:(x.next=A.next,A.next=x),p.pending=x}w!==0&&Mv(u,x,w)}}function bd(r,s,u,p){Oi[Rl++]=r,Oi[Rl++]=s,Oi[Rl++]=u,Oi[Rl++]=p,Ip|=p,r.lanes|=p,r=r.alternate,r!==null&&(r.lanes|=p)}function zp(r,s,u,p){return bd(r,s,u,p),xd(r)}function Os(r,s){return bd(r,null,null,s),xd(r)}function Mv(r,s,u){r.lanes|=u;var p=r.alternate;p!==null&&(p.lanes|=u);for(var x=!1,w=r.return;w!==null;)w.childLanes|=u,p=w.alternate,p!==null&&(p.childLanes|=u),w.tag===22&&(r=w.stateNode,r===null||r._visibility&1||(x=!0)),r=w,w=w.return;return r.tag===3?(w=r.stateNode,x&&s!==null&&(x=31-yt(u),r=w.hiddenUpdates,p=r[x],p===null?r[x]=[s]:p.push(s),s.lane=u|536870912),w):null}function xd(r){if(50<$c)throw $c=0,Gm=null,Error(i(185));for(var s=r.return;s!==null;)r=s,s=r.return;return r.tag===3?r.stateNode:null}var Ll={};function MT(r,s,u,p){this.tag=r,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yi(r,s,u,p){return new MT(r,s,u,p)}function Pp(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Hr(r,s){var u=r.alternate;return u===null?(u=yi(r.tag,s,r.key,r.mode),u.elementType=r.elementType,u.type=r.type,u.stateNode=r.stateNode,u.alternate=r,r.alternate=u):(u.pendingProps=s,u.type=r.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=r.flags&65011712,u.childLanes=r.childLanes,u.lanes=r.lanes,u.child=r.child,u.memoizedProps=r.memoizedProps,u.memoizedState=r.memoizedState,u.updateQueue=r.updateQueue,s=r.dependencies,u.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},u.sibling=r.sibling,u.index=r.index,u.ref=r.ref,u.refCleanup=r.refCleanup,u}function Dv(r,s){r.flags&=65011714;var u=r.alternate;return u===null?(r.childLanes=0,r.lanes=s,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=u.childLanes,r.lanes=u.lanes,r.child=u.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=u.memoizedProps,r.memoizedState=u.memoizedState,r.updateQueue=u.updateQueue,r.type=u.type,s=u.dependencies,r.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),r}function vd(r,s,u,p,x,w){var A=0;if(p=r,typeof r=="function")Pp(r)&&(A=1);else if(typeof r=="string")A=IM(r,u,le.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case $:return r=yi(31,u,s,x),r.elementType=$,r.lanes=w,r;case v:return Rs(u.children,x,w,s);case N:A=8,x|=24;break;case E:return r=yi(12,u,s,x|2),r.elementType=E,r.lanes=w,r;case M:return r=yi(13,u,s,x),r.elementType=M,r.lanes=w,r;case T:return r=yi(19,u,s,x),r.elementType=T,r.lanes=w,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case S:A=10;break e;case C:A=9;break e;case _:A=11;break e;case R:A=14;break e;case O:A=16,p=null;break e}A=29,u=Error(i(130,r===null?"null":typeof r,"")),p=null}return s=yi(A,u,s,x),s.elementType=r,s.type=p,s.lanes=w,s}function Rs(r,s,u,p){return r=yi(7,r,p,s),r.lanes=u,r}function Bp(r,s,u){return r=yi(6,r,null,s),r.lanes=u,r}function Ov(r){var s=yi(18,null,null,0);return s.stateNode=r,s}function $p(r,s,u){return s=yi(4,r.children!==null?r.children:[],r.key,s),s.lanes=u,s.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},s}var Rv=new WeakMap;function Ri(r,s){if(typeof r=="object"&&r!==null){var u=Rv.get(r);return u!==void 0?u:(s={value:r,source:s,stack:ze(s)},Rv.set(r,s),s)}return{value:r,source:s,stack:ze(s)}}var Il=[],zl=0,wd=null,xc=0,Li=[],Ii=0,Da=null,xr=1,vr="";function Kr(r,s){Il[zl++]=xc,Il[zl++]=wd,wd=r,xc=s}function Lv(r,s,u){Li[Ii++]=xr,Li[Ii++]=vr,Li[Ii++]=Da,Da=r;var p=xr;r=vr;var x=32-yt(p)-1;p&=~(1<<x),u+=1;var w=32-yt(s)+x;if(30<w){var A=x-x%5;w=(p&(1<<A)-1).toString(32),p>>=A,x-=A,xr=1<<32-yt(s)+x|u<<x|p,vr=w+r}else xr=1<<w|u<<x|p,vr=r}function Up(r){r.return!==null&&(Kr(r,1),Lv(r,1,0))}function Fp(r){for(;r===wd;)wd=Il[--zl],Il[zl]=null,xc=Il[--zl],Il[zl]=null;for(;r===Da;)Da=Li[--Ii],Li[Ii]=null,vr=Li[--Ii],Li[Ii]=null,xr=Li[--Ii],Li[Ii]=null}function Iv(r,s){Li[Ii++]=xr,Li[Ii++]=vr,Li[Ii++]=Da,xr=s.id,vr=s.overflow,Da=r}var In=null,Wt=null,wt=!1,Oa=null,zi=!1,qp=Error(i(519));function Ra(r){var s=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw vc(Ri(s,r)),qp}function zv(r){var s=r.stateNode,u=r.type,p=r.memoizedProps;switch(s[an]=r,s[Tn]=p,u){case"dialog":mt("cancel",s),mt("close",s);break;case"iframe":case"object":case"embed":mt("load",s);break;case"video":case"audio":for(u=0;u<Fc.length;u++)mt(Fc[u],s);break;case"source":mt("error",s);break;case"img":case"image":case"link":mt("error",s),mt("load",s);break;case"details":mt("toggle",s);break;case"input":mt("invalid",s),er(s,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":mt("invalid",s);break;case"textarea":mt("invalid",s),Tl(s,p.value,p.defaultValue,p.children)}u=p.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||s.textContent===""+u||p.suppressHydrationWarning===!0||e1(s.textContent,u)?(p.popover!=null&&(mt("beforetoggle",s),mt("toggle",s)),p.onScroll!=null&&mt("scroll",s),p.onScrollEnd!=null&&mt("scrollend",s),p.onClick!=null&&(s.onclick=Ae),s=!0):s=!1,s||Ra(r,!0)}function Pv(r){for(In=r.return;In;)switch(In.tag){case 5:case 31:case 13:zi=!1;return;case 27:case 3:zi=!0;return;default:In=In.return}}function Pl(r){if(r!==In)return!1;if(!wt)return Pv(r),wt=!0,!1;var s=r.tag,u;if((u=s!==3&&s!==27)&&((u=s===5)&&(u=r.type,u=!(u!=="form"&&u!=="button")||lg(r.type,r.memoizedProps)),u=!u),u&&Wt&&Ra(r),Pv(r),s===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));Wt=c1(r)}else if(s===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));Wt=c1(r)}else s===27?(s=Wt,Ya(r.type)?(r=fg,fg=null,Wt=r):Wt=s):Wt=In?Bi(r.stateNode.nextSibling):null;return!0}function Ls(){Wt=In=null,wt=!1}function Hp(){var r=Oa;return r!==null&&(li===null?li=r:li.push.apply(li,r),Oa=null),r}function vc(r){Oa===null?Oa=[r]:Oa.push(r)}var Kp=z(null),Is=null,Gr=null;function La(r,s,u){B(Kp,s._currentValue),s._currentValue=u}function Vr(r){r._currentValue=Kp.current,V(Kp)}function Gp(r,s,u){for(;r!==null;){var p=r.alternate;if((r.childLanes&s)!==s?(r.childLanes|=s,p!==null&&(p.childLanes|=s)):p!==null&&(p.childLanes&s)!==s&&(p.childLanes|=s),r===u)break;r=r.return}}function Vp(r,s,u,p){var x=r.child;for(x!==null&&(x.return=r);x!==null;){var w=x.dependencies;if(w!==null){var A=x.child;w=w.firstContext;e:for(;w!==null;){var U=w;w=x;for(var W=0;W<s.length;W++)if(U.context===s[W]){w.lanes|=u,U=w.alternate,U!==null&&(U.lanes|=u),Gp(w.return,u,r),p||(A=null);break e}w=U.next}}else if(x.tag===18){if(A=x.return,A===null)throw Error(i(341));A.lanes|=u,w=A.alternate,w!==null&&(w.lanes|=u),Gp(A,u,r),A=null}else A=x.child;if(A!==null)A.return=x;else for(A=x;A!==null;){if(A===r){A=null;break}if(x=A.sibling,x!==null){x.return=A.return,A=x;break}A=A.return}x=A}}function Bl(r,s,u,p){r=null;for(var x=s,w=!1;x!==null;){if(!w){if((x.flags&524288)!==0)w=!0;else if((x.flags&262144)!==0)break}if(x.tag===10){var A=x.alternate;if(A===null)throw Error(i(387));if(A=A.memoizedProps,A!==null){var U=x.type;gi(x.pendingProps.value,A.value)||(r!==null?r.push(U):r=[U])}}else if(x===Se.current){if(A=x.alternate,A===null)throw Error(i(387));A.memoizedState.memoizedState!==x.memoizedState.memoizedState&&(r!==null?r.push(Vc):r=[Vc])}x=x.return}r!==null&&Vp(s,r,u,p),s.flags|=262144}function kd(r){for(r=r.firstContext;r!==null;){if(!gi(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function zs(r){Is=r,Gr=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function zn(r){return Bv(Is,r)}function Ed(r,s){return Is===null&&zs(r),Bv(r,s)}function Bv(r,s){var u=s._currentValue;if(s={context:s,memoizedValue:u,next:null},Gr===null){if(r===null)throw Error(i(308));Gr=s,r.dependencies={lanes:0,firstContext:s},r.flags|=524288}else Gr=Gr.next=s;return u}var DT=typeof AbortController<"u"?AbortController:function(){var r=[],s=this.signal={aborted:!1,addEventListener:function(u,p){r.push(p)}};this.abort=function(){s.aborted=!0,r.forEach(function(u){return u()})}},OT=e.unstable_scheduleCallback,RT=e.unstable_NormalPriority,vn={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Yp(){return{controller:new DT,data:new Map,refCount:0}}function wc(r){r.refCount--,r.refCount===0&&OT(RT,function(){r.controller.abort()})}var kc=null,Qp=0,$l=0,Ul=null;function LT(r,s){if(kc===null){var u=kc=[];Qp=0,$l=Zm(),Ul={status:"pending",value:void 0,then:function(p){u.push(p)}}}return Qp++,s.then($v,$v),s}function $v(){if(--Qp===0&&kc!==null){Ul!==null&&(Ul.status="fulfilled");var r=kc;kc=null,$l=0,Ul=null;for(var s=0;s<r.length;s++)(0,r[s])()}}function IT(r,s){var u=[],p={status:"pending",value:null,reason:null,then:function(x){u.push(x)}};return r.then(function(){p.status="fulfilled",p.value=s;for(var x=0;x<u.length;x++)(0,u[x])(s)},function(x){for(p.status="rejected",p.reason=x,x=0;x<u.length;x++)(0,u[x])(void 0)}),p}var Uv=P.S;P.S=function(r,s){Sw=Ne(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&LT(r,s),Uv!==null&&Uv(r,s)};var Ps=z(null);function Wp(){var r=Ps.current;return r!==null?r:qt.pooledCache}function Sd(r,s){s===null?B(Ps,Ps.current):B(Ps,s.pool)}function Fv(){var r=Wp();return r===null?null:{parent:vn._currentValue,pool:r}}var Fl=Error(i(460)),Xp=Error(i(474)),Nd=Error(i(542)),_d={then:function(){}};function qv(r){return r=r.status,r==="fulfilled"||r==="rejected"}function Hv(r,s,u){switch(u=r[u],u===void 0?r.push(s):u!==s&&(s.then(Ae,Ae),s=u),s.status){case"fulfilled":return s.value;case"rejected":throw r=s.reason,Gv(r),r;default:if(typeof s.status=="string")s.then(Ae,Ae);else{if(r=qt,r!==null&&100<r.shellSuspendCounter)throw Error(i(482));r=s,r.status="pending",r.then(function(p){if(s.status==="pending"){var x=s;x.status="fulfilled",x.value=p}},function(p){if(s.status==="pending"){var x=s;x.status="rejected",x.reason=p}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw r=s.reason,Gv(r),r}throw $s=s,Fl}}function Bs(r){try{var s=r._init;return s(r._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?($s=u,Fl):u}}var $s=null;function Kv(){if($s===null)throw Error(i(459));var r=$s;return $s=null,r}function Gv(r){if(r===Fl||r===Nd)throw Error(i(483))}var ql=null,Ec=0;function jd(r){var s=Ec;return Ec+=1,ql===null&&(ql=[]),Hv(ql,r,s)}function Sc(r,s){s=s.props.ref,r.ref=s!==void 0?s:null}function Cd(r,s){throw s.$$typeof===y?Error(i(525)):(r=Object.prototype.toString.call(s),Error(i(31,r==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":r)))}function Vv(r){function s(ie,ee){if(r){var re=ie.deletions;re===null?(ie.deletions=[ee],ie.flags|=16):re.push(ee)}}function u(ie,ee){if(!r)return null;for(;ee!==null;)s(ie,ee),ee=ee.sibling;return null}function p(ie){for(var ee=new Map;ie!==null;)ie.key!==null?ee.set(ie.key,ie):ee.set(ie.index,ie),ie=ie.sibling;return ee}function x(ie,ee){return ie=Hr(ie,ee),ie.index=0,ie.sibling=null,ie}function w(ie,ee,re){return ie.index=re,r?(re=ie.alternate,re!==null?(re=re.index,re<ee?(ie.flags|=67108866,ee):re):(ie.flags|=67108866,ee)):(ie.flags|=1048576,ee)}function A(ie){return r&&ie.alternate===null&&(ie.flags|=67108866),ie}function U(ie,ee,re,xe){return ee===null||ee.tag!==6?(ee=Bp(re,ie.mode,xe),ee.return=ie,ee):(ee=x(ee,re),ee.return=ie,ee)}function W(ie,ee,re,xe){var We=re.type;return We===v?me(ie,ee,re.props.children,xe,re.key):ee!==null&&(ee.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===O&&Bs(We)===ee.type)?(ee=x(ee,re.props),Sc(ee,re),ee.return=ie,ee):(ee=vd(re.type,re.key,re.props,null,ie.mode,xe),Sc(ee,re),ee.return=ie,ee)}function se(ie,ee,re,xe){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==re.containerInfo||ee.stateNode.implementation!==re.implementation?(ee=$p(re,ie.mode,xe),ee.return=ie,ee):(ee=x(ee,re.children||[]),ee.return=ie,ee)}function me(ie,ee,re,xe,We){return ee===null||ee.tag!==7?(ee=Rs(re,ie.mode,xe,We),ee.return=ie,ee):(ee=x(ee,re),ee.return=ie,ee)}function we(ie,ee,re){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ee=Bp(""+ee,ie.mode,re),ee.return=ie,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:return re=vd(ee.type,ee.key,ee.props,null,ie.mode,re),Sc(re,ee),re.return=ie,re;case k:return ee=$p(ee,ie.mode,re),ee.return=ie,ee;case O:return ee=Bs(ee),we(ie,ee,re)}if(K(ee)||F(ee))return ee=Rs(ee,ie.mode,re,null),ee.return=ie,ee;if(typeof ee.then=="function")return we(ie,jd(ee),re);if(ee.$$typeof===S)return we(ie,Ed(ie,ee),re);Cd(ie,ee)}return null}function oe(ie,ee,re,xe){var We=ee!==null?ee.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return We!==null?null:U(ie,ee,""+re,xe);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case b:return re.key===We?W(ie,ee,re,xe):null;case k:return re.key===We?se(ie,ee,re,xe):null;case O:return re=Bs(re),oe(ie,ee,re,xe)}if(K(re)||F(re))return We!==null?null:me(ie,ee,re,xe,null);if(typeof re.then=="function")return oe(ie,ee,jd(re),xe);if(re.$$typeof===S)return oe(ie,ee,Ed(ie,re),xe);Cd(ie,re)}return null}function fe(ie,ee,re,xe,We){if(typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint")return ie=ie.get(re)||null,U(ee,ie,""+xe,We);if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case b:return ie=ie.get(xe.key===null?re:xe.key)||null,W(ee,ie,xe,We);case k:return ie=ie.get(xe.key===null?re:xe.key)||null,se(ee,ie,xe,We);case O:return xe=Bs(xe),fe(ie,ee,re,xe,We)}if(K(xe)||F(xe))return ie=ie.get(re)||null,me(ee,ie,xe,We,null);if(typeof xe.then=="function")return fe(ie,ee,re,jd(xe),We);if(xe.$$typeof===S)return fe(ie,ee,re,Ed(ee,xe),We);Cd(ee,xe)}return null}function $e(ie,ee,re,xe){for(var We=null,_t=null,He=ee,ct=ee=0,vt=null;He!==null&&ct<re.length;ct++){He.index>ct?(vt=He,He=null):vt=He.sibling;var jt=oe(ie,He,re[ct],xe);if(jt===null){He===null&&(He=vt);break}r&&He&&jt.alternate===null&&s(ie,He),ee=w(jt,ee,ct),_t===null?We=jt:_t.sibling=jt,_t=jt,He=vt}if(ct===re.length)return u(ie,He),wt&&Kr(ie,ct),We;if(He===null){for(;ct<re.length;ct++)He=we(ie,re[ct],xe),He!==null&&(ee=w(He,ee,ct),_t===null?We=He:_t.sibling=He,_t=He);return wt&&Kr(ie,ct),We}for(He=p(He);ct<re.length;ct++)vt=fe(He,ie,ct,re[ct],xe),vt!==null&&(r&&vt.alternate!==null&&He.delete(vt.key===null?ct:vt.key),ee=w(vt,ee,ct),_t===null?We=vt:_t.sibling=vt,_t=vt);return r&&He.forEach(function(Ja){return s(ie,Ja)}),wt&&Kr(ie,ct),We}function tt(ie,ee,re,xe){if(re==null)throw Error(i(151));for(var We=null,_t=null,He=ee,ct=ee=0,vt=null,jt=re.next();He!==null&&!jt.done;ct++,jt=re.next()){He.index>ct?(vt=He,He=null):vt=He.sibling;var Ja=oe(ie,He,jt.value,xe);if(Ja===null){He===null&&(He=vt);break}r&&He&&Ja.alternate===null&&s(ie,He),ee=w(Ja,ee,ct),_t===null?We=Ja:_t.sibling=Ja,_t=Ja,He=vt}if(jt.done)return u(ie,He),wt&&Kr(ie,ct),We;if(He===null){for(;!jt.done;ct++,jt=re.next())jt=we(ie,jt.value,xe),jt!==null&&(ee=w(jt,ee,ct),_t===null?We=jt:_t.sibling=jt,_t=jt);return wt&&Kr(ie,ct),We}for(He=p(He);!jt.done;ct++,jt=re.next())jt=fe(He,ie,ct,jt.value,xe),jt!==null&&(r&&jt.alternate!==null&&He.delete(jt.key===null?ct:jt.key),ee=w(jt,ee,ct),_t===null?We=jt:_t.sibling=jt,_t=jt);return r&&He.forEach(function(VM){return s(ie,VM)}),wt&&Kr(ie,ct),We}function $t(ie,ee,re,xe){if(typeof re=="object"&&re!==null&&re.type===v&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case b:e:{for(var We=re.key;ee!==null;){if(ee.key===We){if(We=re.type,We===v){if(ee.tag===7){u(ie,ee.sibling),xe=x(ee,re.props.children),xe.return=ie,ie=xe;break e}}else if(ee.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===O&&Bs(We)===ee.type){u(ie,ee.sibling),xe=x(ee,re.props),Sc(xe,re),xe.return=ie,ie=xe;break e}u(ie,ee);break}else s(ie,ee);ee=ee.sibling}re.type===v?(xe=Rs(re.props.children,ie.mode,xe,re.key),xe.return=ie,ie=xe):(xe=vd(re.type,re.key,re.props,null,ie.mode,xe),Sc(xe,re),xe.return=ie,ie=xe)}return A(ie);case k:e:{for(We=re.key;ee!==null;){if(ee.key===We)if(ee.tag===4&&ee.stateNode.containerInfo===re.containerInfo&&ee.stateNode.implementation===re.implementation){u(ie,ee.sibling),xe=x(ee,re.children||[]),xe.return=ie,ie=xe;break e}else{u(ie,ee);break}else s(ie,ee);ee=ee.sibling}xe=$p(re,ie.mode,xe),xe.return=ie,ie=xe}return A(ie);case O:return re=Bs(re),$t(ie,ee,re,xe)}if(K(re))return $e(ie,ee,re,xe);if(F(re)){if(We=F(re),typeof We!="function")throw Error(i(150));return re=We.call(re),tt(ie,ee,re,xe)}if(typeof re.then=="function")return $t(ie,ee,jd(re),xe);if(re.$$typeof===S)return $t(ie,ee,Ed(ie,re),xe);Cd(ie,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,ee!==null&&ee.tag===6?(u(ie,ee.sibling),xe=x(ee,re),xe.return=ie,ie=xe):(u(ie,ee),xe=Bp(re,ie.mode,xe),xe.return=ie,ie=xe),A(ie)):u(ie,ee)}return function(ie,ee,re,xe){try{Ec=0;var We=$t(ie,ee,re,xe);return ql=null,We}catch(He){if(He===Fl||He===Nd)throw He;var _t=yi(29,He,null,ie.mode);return _t.lanes=xe,_t.return=ie,_t}finally{}}}var Us=Vv(!0),Yv=Vv(!1),Ia=!1;function Zp(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Jp(r,s){r=r.updateQueue,s.updateQueue===r&&(s.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function za(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Pa(r,s,u){var p=r.updateQueue;if(p===null)return null;if(p=p.shared,(Tt&2)!==0){var x=p.pending;return x===null?s.next=s:(s.next=x.next,x.next=s),p.pending=s,s=xd(r),Mv(r,null,u),s}return bd(r,p,s,u),xd(r)}function Nc(r,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194048)!==0)){var p=s.lanes;p&=r.pendingLanes,u|=p,s.lanes=u,et(r,u)}}function em(r,s){var u=r.updateQueue,p=r.alternate;if(p!==null&&(p=p.updateQueue,u===p)){var x=null,w=null;if(u=u.firstBaseUpdate,u!==null){do{var A={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};w===null?x=w=A:w=w.next=A,u=u.next}while(u!==null);w===null?x=w=s:w=w.next=s}else x=w=s;u={baseState:p.baseState,firstBaseUpdate:x,lastBaseUpdate:w,shared:p.shared,callbacks:p.callbacks},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=s:r.next=s,u.lastBaseUpdate=s}var tm=!1;function _c(){if(tm){var r=Ul;if(r!==null)throw r}}function jc(r,s,u,p){tm=!1;var x=r.updateQueue;Ia=!1;var w=x.firstBaseUpdate,A=x.lastBaseUpdate,U=x.shared.pending;if(U!==null){x.shared.pending=null;var W=U,se=W.next;W.next=null,A===null?w=se:A.next=se,A=W;var me=r.alternate;me!==null&&(me=me.updateQueue,U=me.lastBaseUpdate,U!==A&&(U===null?me.firstBaseUpdate=se:U.next=se,me.lastBaseUpdate=W))}if(w!==null){var we=x.baseState;A=0,me=se=W=null,U=w;do{var oe=U.lane&-536870913,fe=oe!==U.lane;if(fe?(xt&oe)===oe:(p&oe)===oe){oe!==0&&oe===$l&&(tm=!0),me!==null&&(me=me.next={lane:0,tag:U.tag,payload:U.payload,callback:null,next:null});e:{var $e=r,tt=U;oe=s;var $t=u;switch(tt.tag){case 1:if($e=tt.payload,typeof $e=="function"){we=$e.call($t,we,oe);break e}we=$e;break e;case 3:$e.flags=$e.flags&-65537|128;case 0:if($e=tt.payload,oe=typeof $e=="function"?$e.call($t,we,oe):$e,oe==null)break e;we=m({},we,oe);break e;case 2:Ia=!0}}oe=U.callback,oe!==null&&(r.flags|=64,fe&&(r.flags|=8192),fe=x.callbacks,fe===null?x.callbacks=[oe]:fe.push(oe))}else fe={lane:oe,tag:U.tag,payload:U.payload,callback:U.callback,next:null},me===null?(se=me=fe,W=we):me=me.next=fe,A|=oe;if(U=U.next,U===null){if(U=x.shared.pending,U===null)break;fe=U,U=fe.next,fe.next=null,x.lastBaseUpdate=fe,x.shared.pending=null}}while(!0);me===null&&(W=we),x.baseState=W,x.firstBaseUpdate=se,x.lastBaseUpdate=me,w===null&&(x.shared.lanes=0),qa|=A,r.lanes=A,r.memoizedState=we}}function Qv(r,s){if(typeof r!="function")throw Error(i(191,r));r.call(s)}function Wv(r,s){var u=r.callbacks;if(u!==null)for(r.callbacks=null,r=0;r<u.length;r++)Qv(u[r],s)}var Hl=z(null),Ad=z(0);function Xv(r,s){r=na,B(Ad,r),B(Hl,s),na=r|s.baseLanes}function nm(){B(Ad,na),B(Hl,Hl.current)}function im(){na=Ad.current,V(Hl),V(Ad)}var bi=z(null),Pi=null;function Ba(r){var s=r.alternate;B(gn,gn.current&1),B(bi,r),Pi===null&&(s===null||Hl.current!==null||s.memoizedState!==null)&&(Pi=r)}function rm(r){B(gn,gn.current),B(bi,r),Pi===null&&(Pi=r)}function Zv(r){r.tag===22?(B(gn,gn.current),B(bi,r),Pi===null&&(Pi=r)):$a()}function $a(){B(gn,gn.current),B(bi,bi.current)}function xi(r){V(bi),Pi===r&&(Pi=null),V(gn)}var gn=z(0);function Td(r){for(var s=r;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||ug(u)||dg(u)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Yr=0,ot=null,Pt=null,wn=null,Md=!1,Kl=!1,Fs=!1,Dd=0,Cc=0,Gl=null,zT=0;function hn(){throw Error(i(321))}function am(r,s){if(s===null)return!1;for(var u=0;u<s.length&&u<r.length;u++)if(!gi(r[u],s[u]))return!1;return!0}function sm(r,s,u,p,x,w){return Yr=w,ot=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,P.H=r===null||r.memoizedState===null?L0:wm,Fs=!1,w=u(p,x),Fs=!1,Kl&&(w=e0(s,u,p,x)),Jv(r),w}function Jv(r){P.H=Mc;var s=Pt!==null&&Pt.next!==null;if(Yr=0,wn=Pt=ot=null,Md=!1,Cc=0,Gl=null,s)throw Error(i(300));r===null||kn||(r=r.dependencies,r!==null&&kd(r)&&(kn=!0))}function e0(r,s,u,p){ot=r;var x=0;do{if(Kl&&(Gl=null),Cc=0,Kl=!1,25<=x)throw Error(i(301));if(x+=1,wn=Pt=null,r.updateQueue!=null){var w=r.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}P.H=I0,w=s(u,p)}while(Kl);return w}function PT(){var r=P.H,s=r.useState()[0];return s=typeof s.then=="function"?Ac(s):s,r=r.useState()[0],(Pt!==null?Pt.memoizedState:null)!==r&&(ot.flags|=1024),s}function lm(){var r=Dd!==0;return Dd=0,r}function om(r,s,u){s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~u}function cm(r){if(Md){for(r=r.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Md=!1}Yr=0,wn=Pt=ot=null,Kl=!1,Cc=Dd=0,Gl=null}function Xn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wn===null?ot.memoizedState=wn=r:wn=wn.next=r,wn}function yn(){if(Pt===null){var r=ot.alternate;r=r!==null?r.memoizedState:null}else r=Pt.next;var s=wn===null?ot.memoizedState:wn.next;if(s!==null)wn=s,Pt=r;else{if(r===null)throw ot.alternate===null?Error(i(467)):Error(i(310));Pt=r,r={memoizedState:Pt.memoizedState,baseState:Pt.baseState,baseQueue:Pt.baseQueue,queue:Pt.queue,next:null},wn===null?ot.memoizedState=wn=r:wn=wn.next=r}return wn}function Od(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ac(r){var s=Cc;return Cc+=1,Gl===null&&(Gl=[]),r=Hv(Gl,r,s),s=ot,(wn===null?s.memoizedState:wn.next)===null&&(s=s.alternate,P.H=s===null||s.memoizedState===null?L0:wm),r}function Rd(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Ac(r);if(r.$$typeof===S)return zn(r)}throw Error(i(438,String(r)))}function um(r){var s=null,u=ot.updateQueue;if(u!==null&&(s=u.memoCache),s==null){var p=ot.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(s={data:p.data.map(function(x){return x.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),u===null&&(u=Od(),ot.updateQueue=u),u.memoCache=s,u=s.data[s.index],u===void 0)for(u=s.data[s.index]=Array(r),p=0;p<r;p++)u[p]=I;return s.index++,u}function Qr(r,s){return typeof s=="function"?s(r):s}function Ld(r){var s=yn();return dm(s,Pt,r)}function dm(r,s,u){var p=r.queue;if(p===null)throw Error(i(311));p.lastRenderedReducer=u;var x=r.baseQueue,w=p.pending;if(w!==null){if(x!==null){var A=x.next;x.next=w.next,w.next=A}s.baseQueue=x=w,p.pending=null}if(w=r.baseState,x===null)r.memoizedState=w;else{s=x.next;var U=A=null,W=null,se=s,me=!1;do{var we=se.lane&-536870913;if(we!==se.lane?(xt&we)===we:(Yr&we)===we){var oe=se.revertLane;if(oe===0)W!==null&&(W=W.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),we===$l&&(me=!0);else if((Yr&oe)===oe){se=se.next,oe===$l&&(me=!0);continue}else we={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},W===null?(U=W=we,A=w):W=W.next=we,ot.lanes|=oe,qa|=oe;we=se.action,Fs&&u(w,we),w=se.hasEagerState?se.eagerState:u(w,we)}else oe={lane:we,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},W===null?(U=W=oe,A=w):W=W.next=oe,ot.lanes|=we,qa|=we;se=se.next}while(se!==null&&se!==s);if(W===null?A=w:W.next=U,!gi(w,r.memoizedState)&&(kn=!0,me&&(u=Ul,u!==null)))throw u;r.memoizedState=w,r.baseState=A,r.baseQueue=W,p.lastRenderedState=w}return x===null&&(p.lanes=0),[r.memoizedState,p.dispatch]}function fm(r){var s=yn(),u=s.queue;if(u===null)throw Error(i(311));u.lastRenderedReducer=r;var p=u.dispatch,x=u.pending,w=s.memoizedState;if(x!==null){u.pending=null;var A=x=x.next;do w=r(w,A.action),A=A.next;while(A!==x);gi(w,s.memoizedState)||(kn=!0),s.memoizedState=w,s.baseQueue===null&&(s.baseState=w),u.lastRenderedState=w}return[w,p]}function t0(r,s,u){var p=ot,x=yn(),w=wt;if(w){if(u===void 0)throw Error(i(407));u=u()}else u=s();var A=!gi((Pt||x).memoizedState,u);if(A&&(x.memoizedState=u,kn=!0),x=x.queue,mm(r0.bind(null,p,x,r),[r]),x.getSnapshot!==s||A||wn!==null&&wn.memoizedState.tag&1){if(p.flags|=2048,Vl(9,{destroy:void 0},i0.bind(null,p,x,u,s),null),qt===null)throw Error(i(349));w||(Yr&127)!==0||n0(p,s,u)}return u}function n0(r,s,u){r.flags|=16384,r={getSnapshot:s,value:u},s=ot.updateQueue,s===null?(s=Od(),ot.updateQueue=s,s.stores=[r]):(u=s.stores,u===null?s.stores=[r]:u.push(r))}function i0(r,s,u,p){s.value=u,s.getSnapshot=p,a0(s)&&s0(r)}function r0(r,s,u){return u(function(){a0(s)&&s0(r)})}function a0(r){var s=r.getSnapshot;r=r.value;try{var u=s();return!gi(r,u)}catch{return!0}}function s0(r){var s=Os(r,2);s!==null&&oi(s,r,2)}function hm(r){var s=Xn();if(typeof r=="function"){var u=r;if(r=u(),Fs){Qt(!0);try{u()}finally{Qt(!1)}}}return s.memoizedState=s.baseState=r,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qr,lastRenderedState:r},s}function l0(r,s,u,p){return r.baseState=u,dm(r,Pt,typeof p=="function"?p:Qr)}function BT(r,s,u,p,x){if(Pd(r))throw Error(i(485));if(r=s.action,r!==null){var w={payload:x,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){w.listeners.push(A)}};P.T!==null?u(!0):w.isTransition=!1,p(w),u=s.pending,u===null?(w.next=s.pending=w,o0(s,w)):(w.next=u.next,s.pending=u.next=w)}}function o0(r,s){var u=s.action,p=s.payload,x=r.state;if(s.isTransition){var w=P.T,A={};P.T=A;try{var U=u(x,p),W=P.S;W!==null&&W(A,U),c0(r,s,U)}catch(se){pm(r,s,se)}finally{w!==null&&A.types!==null&&(w.types=A.types),P.T=w}}else try{w=u(x,p),c0(r,s,w)}catch(se){pm(r,s,se)}}function c0(r,s,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(p){u0(r,s,p)},function(p){return pm(r,s,p)}):u0(r,s,u)}function u0(r,s,u){s.status="fulfilled",s.value=u,d0(s),r.state=u,s=r.pending,s!==null&&(u=s.next,u===s?r.pending=null:(u=u.next,s.next=u,o0(r,u)))}function pm(r,s,u){var p=r.pending;if(r.pending=null,p!==null){p=p.next;do s.status="rejected",s.reason=u,d0(s),s=s.next;while(s!==p)}r.action=null}function d0(r){r=r.listeners;for(var s=0;s<r.length;s++)(0,r[s])()}function f0(r,s){return s}function h0(r,s){if(wt){var u=qt.formState;if(u!==null){e:{var p=ot;if(wt){if(Wt){t:{for(var x=Wt,w=zi;x.nodeType!==8;){if(!w){x=null;break t}if(x=Bi(x.nextSibling),x===null){x=null;break t}}w=x.data,x=w==="F!"||w==="F"?x:null}if(x){Wt=Bi(x.nextSibling),p=x.data==="F!";break e}}Ra(p)}p=!1}p&&(s=u[0])}}return u=Xn(),u.memoizedState=u.baseState=s,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:f0,lastRenderedState:s},u.queue=p,u=D0.bind(null,ot,p),p.dispatch=u,p=hm(!1),w=vm.bind(null,ot,!1,p.queue),p=Xn(),x={state:s,dispatch:null,action:r,pending:null},p.queue=x,u=BT.bind(null,ot,x,w,u),x.dispatch=u,p.memoizedState=r,[s,u,!1]}function p0(r){var s=yn();return m0(s,Pt,r)}function m0(r,s,u){if(s=dm(r,s,f0)[0],r=Ld(Qr)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var p=Ac(s)}catch(A){throw A===Fl?Nd:A}else p=s;s=yn();var x=s.queue,w=x.dispatch;return u!==s.memoizedState&&(ot.flags|=2048,Vl(9,{destroy:void 0},$T.bind(null,x,u),null)),[p,w,r]}function $T(r,s){r.action=s}function g0(r){var s=yn(),u=Pt;if(u!==null)return m0(s,u,r);yn(),s=s.memoizedState,u=yn();var p=u.queue.dispatch;return u.memoizedState=r,[s,p,!1]}function Vl(r,s,u,p){return r={tag:r,create:u,deps:p,inst:s,next:null},s=ot.updateQueue,s===null&&(s=Od(),ot.updateQueue=s),u=s.lastEffect,u===null?s.lastEffect=r.next=r:(p=u.next,u.next=r,r.next=p,s.lastEffect=r),r}function y0(){return yn().memoizedState}function Id(r,s,u,p){var x=Xn();ot.flags|=r,x.memoizedState=Vl(1|s,{destroy:void 0},u,p===void 0?null:p)}function zd(r,s,u,p){var x=yn();p=p===void 0?null:p;var w=x.memoizedState.inst;Pt!==null&&p!==null&&am(p,Pt.memoizedState.deps)?x.memoizedState=Vl(s,w,u,p):(ot.flags|=r,x.memoizedState=Vl(1|s,w,u,p))}function b0(r,s){Id(8390656,8,r,s)}function mm(r,s){zd(2048,8,r,s)}function UT(r){ot.flags|=4;var s=ot.updateQueue;if(s===null)s=Od(),ot.updateQueue=s,s.events=[r];else{var u=s.events;u===null?s.events=[r]:u.push(r)}}function x0(r){var s=yn().memoizedState;return UT({ref:s,nextImpl:r}),function(){if((Tt&2)!==0)throw Error(i(440));return s.impl.apply(void 0,arguments)}}function v0(r,s){return zd(4,2,r,s)}function w0(r,s){return zd(4,4,r,s)}function k0(r,s){if(typeof s=="function"){r=r();var u=s(r);return function(){typeof u=="function"?u():s(null)}}if(s!=null)return r=r(),s.current=r,function(){s.current=null}}function E0(r,s,u){u=u!=null?u.concat([r]):null,zd(4,4,k0.bind(null,s,r),u)}function gm(){}function S0(r,s){var u=yn();s=s===void 0?null:s;var p=u.memoizedState;return s!==null&&am(s,p[1])?p[0]:(u.memoizedState=[r,s],r)}function N0(r,s){var u=yn();s=s===void 0?null:s;var p=u.memoizedState;if(s!==null&&am(s,p[1]))return p[0];if(p=r(),Fs){Qt(!0);try{r()}finally{Qt(!1)}}return u.memoizedState=[p,s],p}function ym(r,s,u){return u===void 0||(Yr&1073741824)!==0&&(xt&261930)===0?r.memoizedState=s:(r.memoizedState=u,r=_w(),ot.lanes|=r,qa|=r,u)}function _0(r,s,u,p){return gi(u,s)?u:Hl.current!==null?(r=ym(r,u,p),gi(r,s)||(kn=!0),r):(Yr&42)===0||(Yr&1073741824)!==0&&(xt&261930)===0?(kn=!0,r.memoizedState=u):(r=_w(),ot.lanes|=r,qa|=r,s)}function j0(r,s,u,p,x){var w=H.p;H.p=w!==0&&8>w?w:8;var A=P.T,U={};P.T=U,vm(r,!1,s,u);try{var W=x(),se=P.S;if(se!==null&&se(U,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var me=IT(W,p);Tc(r,s,me,ki(r))}else Tc(r,s,p,ki(r))}catch(we){Tc(r,s,{then:function(){},status:"rejected",reason:we},ki())}finally{H.p=w,A!==null&&U.types!==null&&(A.types=U.types),P.T=A}}function FT(){}function bm(r,s,u,p){if(r.tag!==5)throw Error(i(476));var x=C0(r).queue;j0(r,x,s,Q,u===null?FT:function(){return A0(r),u(p)})}function C0(r){var s=r.memoizedState;if(s!==null)return s;s={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qr,lastRenderedState:Q},next:null};var u={};return s.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qr,lastRenderedState:u},next:null},r.memoizedState=s,r=r.alternate,r!==null&&(r.memoizedState=s),s}function A0(r){var s=C0(r);s.next===null&&(s=r.alternate.memoizedState),Tc(r,s.next.queue,{},ki())}function xm(){return zn(Vc)}function T0(){return yn().memoizedState}function M0(){return yn().memoizedState}function qT(r){for(var s=r.return;s!==null;){switch(s.tag){case 24:case 3:var u=ki();r=za(u);var p=Pa(s,r,u);p!==null&&(oi(p,s,u),Nc(p,s,u)),s={cache:Yp()},r.payload=s;return}s=s.return}}function HT(r,s,u){var p=ki();u={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Pd(r)?O0(s,u):(u=zp(r,s,u,p),u!==null&&(oi(u,r,p),R0(u,s,p)))}function D0(r,s,u){var p=ki();Tc(r,s,u,p)}function Tc(r,s,u,p){var x={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Pd(r))O0(s,x);else{var w=r.alternate;if(r.lanes===0&&(w===null||w.lanes===0)&&(w=s.lastRenderedReducer,w!==null))try{var A=s.lastRenderedState,U=w(A,u);if(x.hasEagerState=!0,x.eagerState=U,gi(U,A))return bd(r,s,x,0),qt===null&&yd(),!1}catch{}finally{}if(u=zp(r,s,x,p),u!==null)return oi(u,r,p),R0(u,s,p),!0}return!1}function vm(r,s,u,p){if(p={lane:2,revertLane:Zm(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Pd(r)){if(s)throw Error(i(479))}else s=zp(r,u,p,2),s!==null&&oi(s,r,2)}function Pd(r){var s=r.alternate;return r===ot||s!==null&&s===ot}function O0(r,s){Kl=Md=!0;var u=r.pending;u===null?s.next=s:(s.next=u.next,u.next=s),r.pending=s}function R0(r,s,u){if((u&4194048)!==0){var p=s.lanes;p&=r.pendingLanes,u|=p,s.lanes=u,et(r,u)}}var Mc={readContext:zn,use:Rd,useCallback:hn,useContext:hn,useEffect:hn,useImperativeHandle:hn,useLayoutEffect:hn,useInsertionEffect:hn,useMemo:hn,useReducer:hn,useRef:hn,useState:hn,useDebugValue:hn,useDeferredValue:hn,useTransition:hn,useSyncExternalStore:hn,useId:hn,useHostTransitionStatus:hn,useFormState:hn,useActionState:hn,useOptimistic:hn,useMemoCache:hn,useCacheRefresh:hn};Mc.useEffectEvent=hn;var L0={readContext:zn,use:Rd,useCallback:function(r,s){return Xn().memoizedState=[r,s===void 0?null:s],r},useContext:zn,useEffect:b0,useImperativeHandle:function(r,s,u){u=u!=null?u.concat([r]):null,Id(4194308,4,k0.bind(null,s,r),u)},useLayoutEffect:function(r,s){return Id(4194308,4,r,s)},useInsertionEffect:function(r,s){Id(4,2,r,s)},useMemo:function(r,s){var u=Xn();s=s===void 0?null:s;var p=r();if(Fs){Qt(!0);try{r()}finally{Qt(!1)}}return u.memoizedState=[p,s],p},useReducer:function(r,s,u){var p=Xn();if(u!==void 0){var x=u(s);if(Fs){Qt(!0);try{u(s)}finally{Qt(!1)}}}else x=s;return p.memoizedState=p.baseState=x,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:x},p.queue=r,r=r.dispatch=HT.bind(null,ot,r),[p.memoizedState,r]},useRef:function(r){var s=Xn();return r={current:r},s.memoizedState=r},useState:function(r){r=hm(r);var s=r.queue,u=D0.bind(null,ot,s);return s.dispatch=u,[r.memoizedState,u]},useDebugValue:gm,useDeferredValue:function(r,s){var u=Xn();return ym(u,r,s)},useTransition:function(){var r=hm(!1);return r=j0.bind(null,ot,r.queue,!0,!1),Xn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,s,u){var p=ot,x=Xn();if(wt){if(u===void 0)throw Error(i(407));u=u()}else{if(u=s(),qt===null)throw Error(i(349));(xt&127)!==0||n0(p,s,u)}x.memoizedState=u;var w={value:u,getSnapshot:s};return x.queue=w,b0(r0.bind(null,p,w,r),[r]),p.flags|=2048,Vl(9,{destroy:void 0},i0.bind(null,p,w,u,s),null),u},useId:function(){var r=Xn(),s=qt.identifierPrefix;if(wt){var u=vr,p=xr;u=(p&~(1<<32-yt(p)-1)).toString(32)+u,s="_"+s+"R_"+u,u=Dd++,0<u&&(s+="H"+u.toString(32)),s+="_"}else u=zT++,s="_"+s+"r_"+u.toString(32)+"_";return r.memoizedState=s},useHostTransitionStatus:xm,useFormState:h0,useActionState:h0,useOptimistic:function(r){var s=Xn();s.memoizedState=s.baseState=r;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=u,s=vm.bind(null,ot,!0,u),u.dispatch=s,[r,s]},useMemoCache:um,useCacheRefresh:function(){return Xn().memoizedState=qT.bind(null,ot)},useEffectEvent:function(r){var s=Xn(),u={impl:r};return s.memoizedState=u,function(){if((Tt&2)!==0)throw Error(i(440));return u.impl.apply(void 0,arguments)}}},wm={readContext:zn,use:Rd,useCallback:S0,useContext:zn,useEffect:mm,useImperativeHandle:E0,useInsertionEffect:v0,useLayoutEffect:w0,useMemo:N0,useReducer:Ld,useRef:y0,useState:function(){return Ld(Qr)},useDebugValue:gm,useDeferredValue:function(r,s){var u=yn();return _0(u,Pt.memoizedState,r,s)},useTransition:function(){var r=Ld(Qr)[0],s=yn().memoizedState;return[typeof r=="boolean"?r:Ac(r),s]},useSyncExternalStore:t0,useId:T0,useHostTransitionStatus:xm,useFormState:p0,useActionState:p0,useOptimistic:function(r,s){var u=yn();return l0(u,Pt,r,s)},useMemoCache:um,useCacheRefresh:M0};wm.useEffectEvent=x0;var I0={readContext:zn,use:Rd,useCallback:S0,useContext:zn,useEffect:mm,useImperativeHandle:E0,useInsertionEffect:v0,useLayoutEffect:w0,useMemo:N0,useReducer:fm,useRef:y0,useState:function(){return fm(Qr)},useDebugValue:gm,useDeferredValue:function(r,s){var u=yn();return Pt===null?ym(u,r,s):_0(u,Pt.memoizedState,r,s)},useTransition:function(){var r=fm(Qr)[0],s=yn().memoizedState;return[typeof r=="boolean"?r:Ac(r),s]},useSyncExternalStore:t0,useId:T0,useHostTransitionStatus:xm,useFormState:g0,useActionState:g0,useOptimistic:function(r,s){var u=yn();return Pt!==null?l0(u,Pt,r,s):(u.baseState=r,[r,u.queue.dispatch])},useMemoCache:um,useCacheRefresh:M0};I0.useEffectEvent=x0;function km(r,s,u,p){s=r.memoizedState,u=u(p,s),u=u==null?s:m({},s,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}var Em={enqueueSetState:function(r,s,u){r=r._reactInternals;var p=ki(),x=za(p);x.payload=s,u!=null&&(x.callback=u),s=Pa(r,x,p),s!==null&&(oi(s,r,p),Nc(s,r,p))},enqueueReplaceState:function(r,s,u){r=r._reactInternals;var p=ki(),x=za(p);x.tag=1,x.payload=s,u!=null&&(x.callback=u),s=Pa(r,x,p),s!==null&&(oi(s,r,p),Nc(s,r,p))},enqueueForceUpdate:function(r,s){r=r._reactInternals;var u=ki(),p=za(u);p.tag=2,s!=null&&(p.callback=s),s=Pa(r,p,u),s!==null&&(oi(s,r,u),Nc(s,r,u))}};function z0(r,s,u,p,x,w,A){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(p,w,A):s.prototype&&s.prototype.isPureReactComponent?!yc(u,p)||!yc(x,w):!0}function P0(r,s,u,p){r=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,p),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,p),s.state!==r&&Em.enqueueReplaceState(s,s.state,null)}function qs(r,s){var u=s;if("ref"in s){u={};for(var p in s)p!=="ref"&&(u[p]=s[p])}if(r=r.defaultProps){u===s&&(u=m({},u));for(var x in r)u[x]===void 0&&(u[x]=r[x])}return u}function B0(r){gd(r)}function $0(r){console.error(r)}function U0(r){gd(r)}function Bd(r,s){try{var u=r.onUncaughtError;u(s.value,{componentStack:s.stack})}catch(p){setTimeout(function(){throw p})}}function F0(r,s,u){try{var p=r.onCaughtError;p(u.value,{componentStack:u.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function Sm(r,s,u){return u=za(u),u.tag=3,u.payload={element:null},u.callback=function(){Bd(r,s)},u}function q0(r){return r=za(r),r.tag=3,r}function H0(r,s,u,p){var x=u.type.getDerivedStateFromError;if(typeof x=="function"){var w=p.value;r.payload=function(){return x(w)},r.callback=function(){F0(s,u,p)}}var A=u.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(r.callback=function(){F0(s,u,p),typeof x!="function"&&(Ha===null?Ha=new Set([this]):Ha.add(this));var U=p.stack;this.componentDidCatch(p.value,{componentStack:U!==null?U:""})})}function KT(r,s,u,p,x){if(u.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(s=u.alternate,s!==null&&Bl(s,u,x,!0),u=bi.current,u!==null){switch(u.tag){case 31:case 13:return Pi===null?Xd():u.alternate===null&&pn===0&&(pn=3),u.flags&=-257,u.flags|=65536,u.lanes=x,p===_d?u.flags|=16384:(s=u.updateQueue,s===null?u.updateQueue=new Set([p]):s.add(p),Qm(r,p,x)),!1;case 22:return u.flags|=65536,p===_d?u.flags|=16384:(s=u.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([p])},u.updateQueue=s):(u=s.retryQueue,u===null?s.retryQueue=new Set([p]):u.add(p)),Qm(r,p,x)),!1}throw Error(i(435,u.tag))}return Qm(r,p,x),Xd(),!1}if(wt)return s=bi.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=x,p!==qp&&(r=Error(i(422),{cause:p}),vc(Ri(r,u)))):(p!==qp&&(s=Error(i(423),{cause:p}),vc(Ri(s,u))),r=r.current.alternate,r.flags|=65536,x&=-x,r.lanes|=x,p=Ri(p,u),x=Sm(r.stateNode,p,x),em(r,x),pn!==4&&(pn=2)),!1;var w=Error(i(520),{cause:p});if(w=Ri(w,u),Bc===null?Bc=[w]:Bc.push(w),pn!==4&&(pn=2),s===null)return!0;p=Ri(p,u),u=s;do{switch(u.tag){case 3:return u.flags|=65536,r=x&-x,u.lanes|=r,r=Sm(u.stateNode,p,r),em(u,r),!1;case 1:if(s=u.type,w=u.stateNode,(u.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Ha===null||!Ha.has(w))))return u.flags|=65536,x&=-x,u.lanes|=x,x=q0(x),H0(x,r,u,p),em(u,x),!1}u=u.return}while(u!==null);return!1}var Nm=Error(i(461)),kn=!1;function Pn(r,s,u,p){s.child=r===null?Yv(s,null,u,p):Us(s,r.child,u,p)}function K0(r,s,u,p,x){u=u.render;var w=s.ref;if("ref"in p){var A={};for(var U in p)U!=="ref"&&(A[U]=p[U])}else A=p;return zs(s),p=sm(r,s,u,A,w,x),U=lm(),r!==null&&!kn?(om(r,s,x),Wr(r,s,x)):(wt&&U&&Up(s),s.flags|=1,Pn(r,s,p,x),s.child)}function G0(r,s,u,p,x){if(r===null){var w=u.type;return typeof w=="function"&&!Pp(w)&&w.defaultProps===void 0&&u.compare===null?(s.tag=15,s.type=w,V0(r,s,w,p,x)):(r=vd(u.type,null,p,s,s.mode,x),r.ref=s.ref,r.return=s,s.child=r)}if(w=r.child,!Om(r,x)){var A=w.memoizedProps;if(u=u.compare,u=u!==null?u:yc,u(A,p)&&r.ref===s.ref)return Wr(r,s,x)}return s.flags|=1,r=Hr(w,p),r.ref=s.ref,r.return=s,s.child=r}function V0(r,s,u,p,x){if(r!==null){var w=r.memoizedProps;if(yc(w,p)&&r.ref===s.ref)if(kn=!1,s.pendingProps=p=w,Om(r,x))(r.flags&131072)!==0&&(kn=!0);else return s.lanes=r.lanes,Wr(r,s,x)}return _m(r,s,u,p,x)}function Y0(r,s,u,p){var x=p.children,w=r!==null?r.memoizedState:null;if(r===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((s.flags&128)!==0){if(w=w!==null?w.baseLanes|u:u,r!==null){for(p=s.child=r.child,x=0;p!==null;)x=x|p.lanes|p.childLanes,p=p.sibling;p=x&~w}else p=0,s.child=null;return Q0(r,s,w,u,p)}if((u&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},r!==null&&Sd(s,w!==null?w.cachePool:null),w!==null?Xv(s,w):nm(),Zv(s);else return p=s.lanes=536870912,Q0(r,s,w!==null?w.baseLanes|u:u,u,p)}else w!==null?(Sd(s,w.cachePool),Xv(s,w),$a(),s.memoizedState=null):(r!==null&&Sd(s,null),nm(),$a());return Pn(r,s,x,u),s.child}function Dc(r,s){return r!==null&&r.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function Q0(r,s,u,p,x){var w=Wp();return w=w===null?null:{parent:vn._currentValue,pool:w},s.memoizedState={baseLanes:u,cachePool:w},r!==null&&Sd(s,null),nm(),Zv(s),r!==null&&Bl(r,s,p,!0),s.childLanes=x,null}function $d(r,s){return s=Fd({mode:s.mode,children:s.children},r.mode),s.ref=r.ref,r.child=s,s.return=r,s}function W0(r,s,u){return Us(s,r.child,null,u),r=$d(s,s.pendingProps),r.flags|=2,xi(s),s.memoizedState=null,r}function GT(r,s,u){var p=s.pendingProps,x=(s.flags&128)!==0;if(s.flags&=-129,r===null){if(wt){if(p.mode==="hidden")return r=$d(s,p),s.lanes=536870912,Dc(null,r);if(rm(s),(r=Wt)?(r=o1(r,zi),r=r!==null&&r.data==="&"?r:null,r!==null&&(s.memoizedState={dehydrated:r,treeContext:Da!==null?{id:xr,overflow:vr}:null,retryLane:536870912,hydrationErrors:null},u=Ov(r),u.return=s,s.child=u,In=s,Wt=null)):r=null,r===null)throw Ra(s);return s.lanes=536870912,null}return $d(s,p)}var w=r.memoizedState;if(w!==null){var A=w.dehydrated;if(rm(s),x)if(s.flags&256)s.flags&=-257,s=W0(r,s,u);else if(s.memoizedState!==null)s.child=r.child,s.flags|=128,s=null;else throw Error(i(558));else if(kn||Bl(r,s,u,!1),x=(u&r.childLanes)!==0,kn||x){if(p=qt,p!==null&&(A=rn(p,u),A!==0&&A!==w.retryLane))throw w.retryLane=A,Os(r,A),oi(p,r,A),Nm;Xd(),s=W0(r,s,u)}else r=w.treeContext,Wt=Bi(A.nextSibling),In=s,wt=!0,Oa=null,zi=!1,r!==null&&Iv(s,r),s=$d(s,p),s.flags|=4096;return s}return r=Hr(r.child,{mode:p.mode,children:p.children}),r.ref=s.ref,s.child=r,r.return=s,r}function Ud(r,s){var u=s.ref;if(u===null)r!==null&&r.ref!==null&&(s.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(i(284));(r===null||r.ref!==u)&&(s.flags|=4194816)}}function _m(r,s,u,p,x){return zs(s),u=sm(r,s,u,p,void 0,x),p=lm(),r!==null&&!kn?(om(r,s,x),Wr(r,s,x)):(wt&&p&&Up(s),s.flags|=1,Pn(r,s,u,x),s.child)}function X0(r,s,u,p,x,w){return zs(s),s.updateQueue=null,u=e0(s,p,u,x),Jv(r),p=lm(),r!==null&&!kn?(om(r,s,w),Wr(r,s,w)):(wt&&p&&Up(s),s.flags|=1,Pn(r,s,u,w),s.child)}function Z0(r,s,u,p,x){if(zs(s),s.stateNode===null){var w=Ll,A=u.contextType;typeof A=="object"&&A!==null&&(w=zn(A)),w=new u(p,w),s.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=Em,s.stateNode=w,w._reactInternals=s,w=s.stateNode,w.props=p,w.state=s.memoizedState,w.refs={},Zp(s),A=u.contextType,w.context=typeof A=="object"&&A!==null?zn(A):Ll,w.state=s.memoizedState,A=u.getDerivedStateFromProps,typeof A=="function"&&(km(s,u,A,p),w.state=s.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(A=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),A!==w.state&&Em.enqueueReplaceState(w,w.state,null),jc(s,p,w,x),_c(),w.state=s.memoizedState),typeof w.componentDidMount=="function"&&(s.flags|=4194308),p=!0}else if(r===null){w=s.stateNode;var U=s.memoizedProps,W=qs(u,U);w.props=W;var se=w.context,me=u.contextType;A=Ll,typeof me=="object"&&me!==null&&(A=zn(me));var we=u.getDerivedStateFromProps;me=typeof we=="function"||typeof w.getSnapshotBeforeUpdate=="function",U=s.pendingProps!==U,me||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(U||se!==A)&&P0(s,w,p,A),Ia=!1;var oe=s.memoizedState;w.state=oe,jc(s,p,w,x),_c(),se=s.memoizedState,U||oe!==se||Ia?(typeof we=="function"&&(km(s,u,we,p),se=s.memoizedState),(W=Ia||z0(s,u,W,p,oe,se,A))?(me||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(s.flags|=4194308)):(typeof w.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=p,s.memoizedState=se),w.props=p,w.state=se,w.context=A,p=W):(typeof w.componentDidMount=="function"&&(s.flags|=4194308),p=!1)}else{w=s.stateNode,Jp(r,s),A=s.memoizedProps,me=qs(u,A),w.props=me,we=s.pendingProps,oe=w.context,se=u.contextType,W=Ll,typeof se=="object"&&se!==null&&(W=zn(se)),U=u.getDerivedStateFromProps,(se=typeof U=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(A!==we||oe!==W)&&P0(s,w,p,W),Ia=!1,oe=s.memoizedState,w.state=oe,jc(s,p,w,x),_c();var fe=s.memoizedState;A!==we||oe!==fe||Ia||r!==null&&r.dependencies!==null&&kd(r.dependencies)?(typeof U=="function"&&(km(s,u,U,p),fe=s.memoizedState),(me=Ia||z0(s,u,me,p,oe,fe,W)||r!==null&&r.dependencies!==null&&kd(r.dependencies))?(se||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(p,fe,W),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(p,fe,W)),typeof w.componentDidUpdate=="function"&&(s.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof w.componentDidUpdate!="function"||A===r.memoizedProps&&oe===r.memoizedState||(s.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||A===r.memoizedProps&&oe===r.memoizedState||(s.flags|=1024),s.memoizedProps=p,s.memoizedState=fe),w.props=p,w.state=fe,w.context=W,p=me):(typeof w.componentDidUpdate!="function"||A===r.memoizedProps&&oe===r.memoizedState||(s.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||A===r.memoizedProps&&oe===r.memoizedState||(s.flags|=1024),p=!1)}return w=p,Ud(r,s),p=(s.flags&128)!==0,w||p?(w=s.stateNode,u=p&&typeof u.getDerivedStateFromError!="function"?null:w.render(),s.flags|=1,r!==null&&p?(s.child=Us(s,r.child,null,x),s.child=Us(s,null,u,x)):Pn(r,s,u,x),s.memoizedState=w.state,r=s.child):r=Wr(r,s,x),r}function J0(r,s,u,p){return Ls(),s.flags|=256,Pn(r,s,u,p),s.child}var jm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cm(r){return{baseLanes:r,cachePool:Fv()}}function Am(r,s,u){return r=r!==null?r.childLanes&~u:0,s&&(r|=wi),r}function ew(r,s,u){var p=s.pendingProps,x=!1,w=(s.flags&128)!==0,A;if((A=w)||(A=r!==null&&r.memoizedState===null?!1:(gn.current&2)!==0),A&&(x=!0,s.flags&=-129),A=(s.flags&32)!==0,s.flags&=-33,r===null){if(wt){if(x?Ba(s):$a(),(r=Wt)?(r=o1(r,zi),r=r!==null&&r.data!=="&"?r:null,r!==null&&(s.memoizedState={dehydrated:r,treeContext:Da!==null?{id:xr,overflow:vr}:null,retryLane:536870912,hydrationErrors:null},u=Ov(r),u.return=s,s.child=u,In=s,Wt=null)):r=null,r===null)throw Ra(s);return dg(r)?s.lanes=32:s.lanes=536870912,null}var U=p.children;return p=p.fallback,x?($a(),x=s.mode,U=Fd({mode:"hidden",children:U},x),p=Rs(p,x,u,null),U.return=s,p.return=s,U.sibling=p,s.child=U,p=s.child,p.memoizedState=Cm(u),p.childLanes=Am(r,A,u),s.memoizedState=jm,Dc(null,p)):(Ba(s),Tm(s,U))}var W=r.memoizedState;if(W!==null&&(U=W.dehydrated,U!==null)){if(w)s.flags&256?(Ba(s),s.flags&=-257,s=Mm(r,s,u)):s.memoizedState!==null?($a(),s.child=r.child,s.flags|=128,s=null):($a(),U=p.fallback,x=s.mode,p=Fd({mode:"visible",children:p.children},x),U=Rs(U,x,u,null),U.flags|=2,p.return=s,U.return=s,p.sibling=U,s.child=p,Us(s,r.child,null,u),p=s.child,p.memoizedState=Cm(u),p.childLanes=Am(r,A,u),s.memoizedState=jm,s=Dc(null,p));else if(Ba(s),dg(U)){if(A=U.nextSibling&&U.nextSibling.dataset,A)var se=A.dgst;A=se,p=Error(i(419)),p.stack="",p.digest=A,vc({value:p,source:null,stack:null}),s=Mm(r,s,u)}else if(kn||Bl(r,s,u,!1),A=(u&r.childLanes)!==0,kn||A){if(A=qt,A!==null&&(p=rn(A,u),p!==0&&p!==W.retryLane))throw W.retryLane=p,Os(r,p),oi(A,r,p),Nm;ug(U)||Xd(),s=Mm(r,s,u)}else ug(U)?(s.flags|=192,s.child=r.child,s=null):(r=W.treeContext,Wt=Bi(U.nextSibling),In=s,wt=!0,Oa=null,zi=!1,r!==null&&Iv(s,r),s=Tm(s,p.children),s.flags|=4096);return s}return x?($a(),U=p.fallback,x=s.mode,W=r.child,se=W.sibling,p=Hr(W,{mode:"hidden",children:p.children}),p.subtreeFlags=W.subtreeFlags&65011712,se!==null?U=Hr(se,U):(U=Rs(U,x,u,null),U.flags|=2),U.return=s,p.return=s,p.sibling=U,s.child=p,Dc(null,p),p=s.child,U=r.child.memoizedState,U===null?U=Cm(u):(x=U.cachePool,x!==null?(W=vn._currentValue,x=x.parent!==W?{parent:W,pool:W}:x):x=Fv(),U={baseLanes:U.baseLanes|u,cachePool:x}),p.memoizedState=U,p.childLanes=Am(r,A,u),s.memoizedState=jm,Dc(r.child,p)):(Ba(s),u=r.child,r=u.sibling,u=Hr(u,{mode:"visible",children:p.children}),u.return=s,u.sibling=null,r!==null&&(A=s.deletions,A===null?(s.deletions=[r],s.flags|=16):A.push(r)),s.child=u,s.memoizedState=null,u)}function Tm(r,s){return s=Fd({mode:"visible",children:s},r.mode),s.return=r,r.child=s}function Fd(r,s){return r=yi(22,r,null,s),r.lanes=0,r}function Mm(r,s,u){return Us(s,r.child,null,u),r=Tm(s,s.pendingProps.children),r.flags|=2,s.memoizedState=null,r}function tw(r,s,u){r.lanes|=s;var p=r.alternate;p!==null&&(p.lanes|=s),Gp(r.return,s,u)}function Dm(r,s,u,p,x,w){var A=r.memoizedState;A===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:p,tail:u,tailMode:x,treeForkCount:w}:(A.isBackwards=s,A.rendering=null,A.renderingStartTime=0,A.last=p,A.tail=u,A.tailMode=x,A.treeForkCount=w)}function nw(r,s,u){var p=s.pendingProps,x=p.revealOrder,w=p.tail;p=p.children;var A=gn.current,U=(A&2)!==0;if(U?(A=A&1|2,s.flags|=128):A&=1,B(gn,A),Pn(r,s,p,u),p=wt?xc:0,!U&&r!==null&&(r.flags&128)!==0)e:for(r=s.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&tw(r,u,s);else if(r.tag===19)tw(r,u,s);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break e;for(;r.sibling===null;){if(r.return===null||r.return===s)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(x){case"forwards":for(u=s.child,x=null;u!==null;)r=u.alternate,r!==null&&Td(r)===null&&(x=u),u=u.sibling;u=x,u===null?(x=s.child,s.child=null):(x=u.sibling,u.sibling=null),Dm(s,!1,x,u,w,p);break;case"backwards":case"unstable_legacy-backwards":for(u=null,x=s.child,s.child=null;x!==null;){if(r=x.alternate,r!==null&&Td(r)===null){s.child=x;break}r=x.sibling,x.sibling=u,u=x,x=r}Dm(s,!0,u,null,w,p);break;case"together":Dm(s,!1,null,null,void 0,p);break;default:s.memoizedState=null}return s.child}function Wr(r,s,u){if(r!==null&&(s.dependencies=r.dependencies),qa|=s.lanes,(u&s.childLanes)===0)if(r!==null){if(Bl(r,s,u,!1),(u&s.childLanes)===0)return null}else return null;if(r!==null&&s.child!==r.child)throw Error(i(153));if(s.child!==null){for(r=s.child,u=Hr(r,r.pendingProps),s.child=u,u.return=s;r.sibling!==null;)r=r.sibling,u=u.sibling=Hr(r,r.pendingProps),u.return=s;u.sibling=null}return s.child}function Om(r,s){return(r.lanes&s)!==0?!0:(r=r.dependencies,!!(r!==null&&kd(r)))}function VT(r,s,u){switch(s.tag){case 3:J(s,s.stateNode.containerInfo),La(s,vn,r.memoizedState.cache),Ls();break;case 27:case 5:Te(s);break;case 4:J(s,s.stateNode.containerInfo);break;case 10:La(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,rm(s),null;break;case 13:var p=s.memoizedState;if(p!==null)return p.dehydrated!==null?(Ba(s),s.flags|=128,null):(u&s.child.childLanes)!==0?ew(r,s,u):(Ba(s),r=Wr(r,s,u),r!==null?r.sibling:null);Ba(s);break;case 19:var x=(r.flags&128)!==0;if(p=(u&s.childLanes)!==0,p||(Bl(r,s,u,!1),p=(u&s.childLanes)!==0),x){if(p)return nw(r,s,u);s.flags|=128}if(x=s.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),B(gn,gn.current),p)break;return null;case 22:return s.lanes=0,Y0(r,s,u,s.pendingProps);case 24:La(s,vn,r.memoizedState.cache)}return Wr(r,s,u)}function iw(r,s,u){if(r!==null)if(r.memoizedProps!==s.pendingProps)kn=!0;else{if(!Om(r,u)&&(s.flags&128)===0)return kn=!1,VT(r,s,u);kn=(r.flags&131072)!==0}else kn=!1,wt&&(s.flags&1048576)!==0&&Lv(s,xc,s.index);switch(s.lanes=0,s.tag){case 16:e:{var p=s.pendingProps;if(r=Bs(s.elementType),s.type=r,typeof r=="function")Pp(r)?(p=qs(r,p),s.tag=1,s=Z0(null,s,r,p,u)):(s.tag=0,s=_m(null,s,r,p,u));else{if(r!=null){var x=r.$$typeof;if(x===_){s.tag=11,s=K0(null,s,r,p,u);break e}else if(x===R){s.tag=14,s=G0(null,s,r,p,u);break e}}throw s=D(r)||r,Error(i(306,s,""))}}return s;case 0:return _m(r,s,s.type,s.pendingProps,u);case 1:return p=s.type,x=qs(p,s.pendingProps),Z0(r,s,p,x,u);case 3:e:{if(J(s,s.stateNode.containerInfo),r===null)throw Error(i(387));p=s.pendingProps;var w=s.memoizedState;x=w.element,Jp(r,s),jc(s,p,null,u);var A=s.memoizedState;if(p=A.cache,La(s,vn,p),p!==w.cache&&Vp(s,[vn],u,!0),_c(),p=A.element,w.isDehydrated)if(w={element:p,isDehydrated:!1,cache:A.cache},s.updateQueue.baseState=w,s.memoizedState=w,s.flags&256){s=J0(r,s,p,u);break e}else if(p!==x){x=Ri(Error(i(424)),s),vc(x),s=J0(r,s,p,u);break e}else{switch(r=s.stateNode.containerInfo,r.nodeType){case 9:r=r.body;break;default:r=r.nodeName==="HTML"?r.ownerDocument.body:r}for(Wt=Bi(r.firstChild),In=s,wt=!0,Oa=null,zi=!0,u=Yv(s,null,p,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Ls(),p===x){s=Wr(r,s,u);break e}Pn(r,s,p,u)}s=s.child}return s;case 26:return Ud(r,s),r===null?(u=p1(s.type,null,s.pendingProps,null))?s.memoizedState=u:wt||(u=s.type,r=s.pendingProps,p=af(ke.current).createElement(u),p[an]=s,p[Tn]=r,Bn(p,u,r),fn(p),s.stateNode=p):s.memoizedState=p1(s.type,r.memoizedProps,s.pendingProps,r.memoizedState),null;case 27:return Te(s),r===null&&wt&&(p=s.stateNode=d1(s.type,s.pendingProps,ke.current),In=s,zi=!0,x=Wt,Ya(s.type)?(fg=x,Wt=Bi(p.firstChild)):Wt=x),Pn(r,s,s.pendingProps.children,u),Ud(r,s),r===null&&(s.flags|=4194304),s.child;case 5:return r===null&&wt&&((x=p=Wt)&&(p=EM(p,s.type,s.pendingProps,zi),p!==null?(s.stateNode=p,In=s,Wt=Bi(p.firstChild),zi=!1,x=!0):x=!1),x||Ra(s)),Te(s),x=s.type,w=s.pendingProps,A=r!==null?r.memoizedProps:null,p=w.children,lg(x,w)?p=null:A!==null&&lg(x,A)&&(s.flags|=32),s.memoizedState!==null&&(x=sm(r,s,PT,null,null,u),Vc._currentValue=x),Ud(r,s),Pn(r,s,p,u),s.child;case 6:return r===null&&wt&&((r=u=Wt)&&(u=SM(u,s.pendingProps,zi),u!==null?(s.stateNode=u,In=s,Wt=null,r=!0):r=!1),r||Ra(s)),null;case 13:return ew(r,s,u);case 4:return J(s,s.stateNode.containerInfo),p=s.pendingProps,r===null?s.child=Us(s,null,p,u):Pn(r,s,p,u),s.child;case 11:return K0(r,s,s.type,s.pendingProps,u);case 7:return Pn(r,s,s.pendingProps,u),s.child;case 8:return Pn(r,s,s.pendingProps.children,u),s.child;case 12:return Pn(r,s,s.pendingProps.children,u),s.child;case 10:return p=s.pendingProps,La(s,s.type,p.value),Pn(r,s,p.children,u),s.child;case 9:return x=s.type._context,p=s.pendingProps.children,zs(s),x=zn(x),p=p(x),s.flags|=1,Pn(r,s,p,u),s.child;case 14:return G0(r,s,s.type,s.pendingProps,u);case 15:return V0(r,s,s.type,s.pendingProps,u);case 19:return nw(r,s,u);case 31:return GT(r,s,u);case 22:return Y0(r,s,u,s.pendingProps);case 24:return zs(s),p=zn(vn),r===null?(x=Wp(),x===null&&(x=qt,w=Yp(),x.pooledCache=w,w.refCount++,w!==null&&(x.pooledCacheLanes|=u),x=w),s.memoizedState={parent:p,cache:x},Zp(s),La(s,vn,x)):((r.lanes&u)!==0&&(Jp(r,s),jc(s,null,null,u),_c()),x=r.memoizedState,w=s.memoizedState,x.parent!==p?(x={parent:p,cache:p},s.memoizedState=x,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=x),La(s,vn,p)):(p=w.cache,La(s,vn,p),p!==x.cache&&Vp(s,[vn],u,!0))),Pn(r,s,s.pendingProps.children,u),s.child;case 29:throw s.pendingProps}throw Error(i(156,s.tag))}function Xr(r){r.flags|=4}function Rm(r,s,u,p,x){if((s=(r.mode&32)!==0)&&(s=!1),s){if(r.flags|=16777216,(x&335544128)===x)if(r.stateNode.complete)r.flags|=8192;else if(Tw())r.flags|=8192;else throw $s=_d,Xp}else r.flags&=-16777217}function rw(r,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!x1(s))if(Tw())r.flags|=8192;else throw $s=_d,Xp}function qd(r,s){s!==null&&(r.flags|=4),r.flags&16384&&(s=r.tag!==22?it():536870912,r.lanes|=s,Xl|=s)}function Oc(r,s){if(!wt)switch(r.tailMode){case"hidden":s=r.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?r.tail=null:u.sibling=null;break;case"collapsed":u=r.tail;for(var p=null;u!==null;)u.alternate!==null&&(p=u),u=u.sibling;p===null?s||r.tail===null?r.tail=null:r.tail.sibling=null:p.sibling=null}}function Xt(r){var s=r.alternate!==null&&r.alternate.child===r.child,u=0,p=0;if(s)for(var x=r.child;x!==null;)u|=x.lanes|x.childLanes,p|=x.subtreeFlags&65011712,p|=x.flags&65011712,x.return=r,x=x.sibling;else for(x=r.child;x!==null;)u|=x.lanes|x.childLanes,p|=x.subtreeFlags,p|=x.flags,x.return=r,x=x.sibling;return r.subtreeFlags|=p,r.childLanes=u,s}function YT(r,s,u){var p=s.pendingProps;switch(Fp(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xt(s),null;case 1:return Xt(s),null;case 3:return u=s.stateNode,p=null,r!==null&&(p=r.memoizedState.cache),s.memoizedState.cache!==p&&(s.flags|=2048),Vr(vn),ue(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(r===null||r.child===null)&&(Pl(s)?Xr(s):r===null||r.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Hp())),Xt(s),null;case 26:var x=s.type,w=s.memoizedState;return r===null?(Xr(s),w!==null?(Xt(s),rw(s,w)):(Xt(s),Rm(s,x,null,p,u))):w?w!==r.memoizedState?(Xr(s),Xt(s),rw(s,w)):(Xt(s),s.flags&=-16777217):(r=r.memoizedProps,r!==p&&Xr(s),Xt(s),Rm(s,x,r,p,u)),null;case 27:if(Re(s),u=ke.current,x=s.type,r!==null&&s.stateNode!=null)r.memoizedProps!==p&&Xr(s);else{if(!p){if(s.stateNode===null)throw Error(i(166));return Xt(s),null}r=le.current,Pl(s)?zv(s):(r=d1(x,p,u),s.stateNode=r,Xr(s))}return Xt(s),null;case 5:if(Re(s),x=s.type,r!==null&&s.stateNode!=null)r.memoizedProps!==p&&Xr(s);else{if(!p){if(s.stateNode===null)throw Error(i(166));return Xt(s),null}if(w=le.current,Pl(s))zv(s);else{var A=af(ke.current);switch(w){case 1:w=A.createElementNS("http://www.w3.org/2000/svg",x);break;case 2:w=A.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;default:switch(x){case"svg":w=A.createElementNS("http://www.w3.org/2000/svg",x);break;case"math":w=A.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;case"script":w=A.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof p.is=="string"?A.createElement("select",{is:p.is}):A.createElement("select"),p.multiple?w.multiple=!0:p.size&&(w.size=p.size);break;default:w=typeof p.is=="string"?A.createElement(x,{is:p.is}):A.createElement(x)}}w[an]=s,w[Tn]=p;e:for(A=s.child;A!==null;){if(A.tag===5||A.tag===6)w.appendChild(A.stateNode);else if(A.tag!==4&&A.tag!==27&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===s)break e;for(;A.sibling===null;){if(A.return===null||A.return===s)break e;A=A.return}A.sibling.return=A.return,A=A.sibling}s.stateNode=w;e:switch(Bn(w,x,p),x){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&Xr(s)}}return Xt(s),Rm(s,s.type,r===null?null:r.memoizedProps,s.pendingProps,u),null;case 6:if(r&&s.stateNode!=null)r.memoizedProps!==p&&Xr(s);else{if(typeof p!="string"&&s.stateNode===null)throw Error(i(166));if(r=ke.current,Pl(s)){if(r=s.stateNode,u=s.memoizedProps,p=null,x=In,x!==null)switch(x.tag){case 27:case 5:p=x.memoizedProps}r[an]=s,r=!!(r.nodeValue===u||p!==null&&p.suppressHydrationWarning===!0||e1(r.nodeValue,u)),r||Ra(s,!0)}else r=af(r).createTextNode(p),r[an]=s,s.stateNode=r}return Xt(s),null;case 31:if(u=s.memoizedState,r===null||r.memoizedState!==null){if(p=Pl(s),u!==null){if(r===null){if(!p)throw Error(i(318));if(r=s.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(557));r[an]=s}else Ls(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Xt(s),r=!1}else u=Hp(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=u),r=!0;if(!r)return s.flags&256?(xi(s),s):(xi(s),null);if((s.flags&128)!==0)throw Error(i(558))}return Xt(s),null;case 13:if(p=s.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(x=Pl(s),p!==null&&p.dehydrated!==null){if(r===null){if(!x)throw Error(i(318));if(x=s.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(i(317));x[an]=s}else Ls(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Xt(s),x=!1}else x=Hp(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=x),x=!0;if(!x)return s.flags&256?(xi(s),s):(xi(s),null)}return xi(s),(s.flags&128)!==0?(s.lanes=u,s):(u=p!==null,r=r!==null&&r.memoizedState!==null,u&&(p=s.child,x=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(x=p.alternate.memoizedState.cachePool.pool),w=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(w=p.memoizedState.cachePool.pool),w!==x&&(p.flags|=2048)),u!==r&&u&&(s.child.flags|=8192),qd(s,s.updateQueue),Xt(s),null);case 4:return ue(),r===null&&ng(s.stateNode.containerInfo),Xt(s),null;case 10:return Vr(s.type),Xt(s),null;case 19:if(V(gn),p=s.memoizedState,p===null)return Xt(s),null;if(x=(s.flags&128)!==0,w=p.rendering,w===null)if(x)Oc(p,!1);else{if(pn!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(w=Td(r),w!==null){for(s.flags|=128,Oc(p,!1),r=w.updateQueue,s.updateQueue=r,qd(s,r),s.subtreeFlags=0,r=u,u=s.child;u!==null;)Dv(u,r),u=u.sibling;return B(gn,gn.current&1|2),wt&&Kr(s,p.treeForkCount),s.child}r=r.sibling}p.tail!==null&&Ne()>Yd&&(s.flags|=128,x=!0,Oc(p,!1),s.lanes=4194304)}else{if(!x)if(r=Td(w),r!==null){if(s.flags|=128,x=!0,r=r.updateQueue,s.updateQueue=r,qd(s,r),Oc(p,!0),p.tail===null&&p.tailMode==="hidden"&&!w.alternate&&!wt)return Xt(s),null}else 2*Ne()-p.renderingStartTime>Yd&&u!==536870912&&(s.flags|=128,x=!0,Oc(p,!1),s.lanes=4194304);p.isBackwards?(w.sibling=s.child,s.child=w):(r=p.last,r!==null?r.sibling=w:s.child=w,p.last=w)}return p.tail!==null?(r=p.tail,p.rendering=r,p.tail=r.sibling,p.renderingStartTime=Ne(),r.sibling=null,u=gn.current,B(gn,x?u&1|2:u&1),wt&&Kr(s,p.treeForkCount),r):(Xt(s),null);case 22:case 23:return xi(s),im(),p=s.memoizedState!==null,r!==null?r.memoizedState!==null!==p&&(s.flags|=8192):p&&(s.flags|=8192),p?(u&536870912)!==0&&(s.flags&128)===0&&(Xt(s),s.subtreeFlags&6&&(s.flags|=8192)):Xt(s),u=s.updateQueue,u!==null&&qd(s,u.retryQueue),u=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),p=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),p!==u&&(s.flags|=2048),r!==null&&V(Ps),null;case 24:return u=null,r!==null&&(u=r.memoizedState.cache),s.memoizedState.cache!==u&&(s.flags|=2048),Vr(vn),Xt(s),null;case 25:return null;case 30:return null}throw Error(i(156,s.tag))}function QT(r,s){switch(Fp(s),s.tag){case 1:return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return Vr(vn),ue(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 26:case 27:case 5:return Re(s),null;case 31:if(s.memoizedState!==null){if(xi(s),s.alternate===null)throw Error(i(340));Ls()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 13:if(xi(s),r=s.memoizedState,r!==null&&r.dehydrated!==null){if(s.alternate===null)throw Error(i(340));Ls()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 19:return V(gn),null;case 4:return ue(),null;case 10:return Vr(s.type),null;case 22:case 23:return xi(s),im(),r!==null&&V(Ps),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 24:return Vr(vn),null;case 25:return null;default:return null}}function aw(r,s){switch(Fp(s),s.tag){case 3:Vr(vn),ue();break;case 26:case 27:case 5:Re(s);break;case 4:ue();break;case 31:s.memoizedState!==null&&xi(s);break;case 13:xi(s);break;case 19:V(gn);break;case 10:Vr(s.type);break;case 22:case 23:xi(s),im(),r!==null&&V(Ps);break;case 24:Vr(vn)}}function Rc(r,s){try{var u=s.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var x=p.next;u=x;do{if((u.tag&r)===r){p=void 0;var w=u.create,A=u.inst;p=w(),A.destroy=p}u=u.next}while(u!==x)}}catch(U){It(s,s.return,U)}}function Ua(r,s,u){try{var p=s.updateQueue,x=p!==null?p.lastEffect:null;if(x!==null){var w=x.next;p=w;do{if((p.tag&r)===r){var A=p.inst,U=A.destroy;if(U!==void 0){A.destroy=void 0,x=s;var W=u,se=U;try{se()}catch(me){It(x,W,me)}}}p=p.next}while(p!==w)}}catch(me){It(s,s.return,me)}}function sw(r){var s=r.updateQueue;if(s!==null){var u=r.stateNode;try{Wv(s,u)}catch(p){It(r,r.return,p)}}}function lw(r,s,u){u.props=qs(r.type,r.memoizedProps),u.state=r.memoizedState;try{u.componentWillUnmount()}catch(p){It(r,s,p)}}function Lc(r,s){try{var u=r.ref;if(u!==null){switch(r.tag){case 26:case 27:case 5:var p=r.stateNode;break;case 30:p=r.stateNode;break;default:p=r.stateNode}typeof u=="function"?r.refCleanup=u(p):u.current=p}}catch(x){It(r,s,x)}}function wr(r,s){var u=r.ref,p=r.refCleanup;if(u!==null)if(typeof p=="function")try{p()}catch(x){It(r,s,x)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(x){It(r,s,x)}else u.current=null}function ow(r){var s=r.type,u=r.memoizedProps,p=r.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":u.autoFocus&&p.focus();break e;case"img":u.src?p.src=u.src:u.srcSet&&(p.srcset=u.srcSet)}}catch(x){It(r,r.return,x)}}function Lm(r,s,u){try{var p=r.stateNode;yM(p,r.type,u,s),p[Tn]=s}catch(x){It(r,r.return,x)}}function cw(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Ya(r.type)||r.tag===4}function Im(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||cw(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Ya(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function zm(r,s,u){var p=r.tag;if(p===5||p===6)r=r.stateNode,s?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(r,s):(s=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,s.appendChild(r),u=u._reactRootContainer,u!=null||s.onclick!==null||(s.onclick=Ae));else if(p!==4&&(p===27&&Ya(r.type)&&(u=r.stateNode,s=null),r=r.child,r!==null))for(zm(r,s,u),r=r.sibling;r!==null;)zm(r,s,u),r=r.sibling}function Hd(r,s,u){var p=r.tag;if(p===5||p===6)r=r.stateNode,s?u.insertBefore(r,s):u.appendChild(r);else if(p!==4&&(p===27&&Ya(r.type)&&(u=r.stateNode),r=r.child,r!==null))for(Hd(r,s,u),r=r.sibling;r!==null;)Hd(r,s,u),r=r.sibling}function uw(r){var s=r.stateNode,u=r.memoizedProps;try{for(var p=r.type,x=s.attributes;x.length;)s.removeAttributeNode(x[0]);Bn(s,p,u),s[an]=r,s[Tn]=u}catch(w){It(r,r.return,w)}}var Zr=!1,En=!1,Pm=!1,dw=typeof WeakSet=="function"?WeakSet:Set,Dn=null;function WT(r,s){if(r=r.containerInfo,ag=ff,r=Ev(r),Mp(r)){if("selectionStart"in r)var u={start:r.selectionStart,end:r.selectionEnd};else e:{u=(u=r.ownerDocument)&&u.defaultView||window;var p=u.getSelection&&u.getSelection();if(p&&p.rangeCount!==0){u=p.anchorNode;var x=p.anchorOffset,w=p.focusNode;p=p.focusOffset;try{u.nodeType,w.nodeType}catch{u=null;break e}var A=0,U=-1,W=-1,se=0,me=0,we=r,oe=null;t:for(;;){for(var fe;we!==u||x!==0&&we.nodeType!==3||(U=A+x),we!==w||p!==0&&we.nodeType!==3||(W=A+p),we.nodeType===3&&(A+=we.nodeValue.length),(fe=we.firstChild)!==null;)oe=we,we=fe;for(;;){if(we===r)break t;if(oe===u&&++se===x&&(U=A),oe===w&&++me===p&&(W=A),(fe=we.nextSibling)!==null)break;we=oe,oe=we.parentNode}we=fe}u=U===-1||W===-1?null:{start:U,end:W}}else u=null}u=u||{start:0,end:0}}else u=null;for(sg={focusedElem:r,selectionRange:u},ff=!1,Dn=s;Dn!==null;)if(s=Dn,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,Dn=r;else for(;Dn!==null;){switch(s=Dn,w=s.alternate,r=s.flags,s.tag){case 0:if((r&4)!==0&&(r=s.updateQueue,r=r!==null?r.events:null,r!==null))for(u=0;u<r.length;u++)x=r[u],x.ref.impl=x.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&w!==null){r=void 0,u=s,x=w.memoizedProps,w=w.memoizedState,p=u.stateNode;try{var $e=qs(u.type,x);r=p.getSnapshotBeforeUpdate($e,w),p.__reactInternalSnapshotBeforeUpdate=r}catch(tt){It(u,u.return,tt)}}break;case 3:if((r&1024)!==0){if(r=s.stateNode.containerInfo,u=r.nodeType,u===9)cg(r);else if(u===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":cg(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(i(163))}if(r=s.sibling,r!==null){r.return=s.return,Dn=r;break}Dn=s.return}}function fw(r,s,u){var p=u.flags;switch(u.tag){case 0:case 11:case 15:ea(r,u),p&4&&Rc(5,u);break;case 1:if(ea(r,u),p&4)if(r=u.stateNode,s===null)try{r.componentDidMount()}catch(A){It(u,u.return,A)}else{var x=qs(u.type,s.memoizedProps);s=s.memoizedState;try{r.componentDidUpdate(x,s,r.__reactInternalSnapshotBeforeUpdate)}catch(A){It(u,u.return,A)}}p&64&&sw(u),p&512&&Lc(u,u.return);break;case 3:if(ea(r,u),p&64&&(r=u.updateQueue,r!==null)){if(s=null,u.child!==null)switch(u.child.tag){case 27:case 5:s=u.child.stateNode;break;case 1:s=u.child.stateNode}try{Wv(r,s)}catch(A){It(u,u.return,A)}}break;case 27:s===null&&p&4&&uw(u);case 26:case 5:ea(r,u),s===null&&p&4&&ow(u),p&512&&Lc(u,u.return);break;case 12:ea(r,u);break;case 31:ea(r,u),p&4&&mw(r,u);break;case 13:ea(r,u),p&4&&gw(r,u),p&64&&(r=u.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(u=aM.bind(null,u),NM(r,u))));break;case 22:if(p=u.memoizedState!==null||Zr,!p){s=s!==null&&s.memoizedState!==null||En,x=Zr;var w=En;Zr=p,(En=s)&&!w?ta(r,u,(u.subtreeFlags&8772)!==0):ea(r,u),Zr=x,En=w}break;case 30:break;default:ea(r,u)}}function hw(r){var s=r.alternate;s!==null&&(r.alternate=null,hw(s)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(s=r.stateNode,s!==null&&js(s)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var Zt=null,ri=!1;function Jr(r,s,u){for(u=u.child;u!==null;)pw(r,s,u),u=u.sibling}function pw(r,s,u){if(Mt&&typeof Mt.onCommitFiberUnmount=="function")try{Mt.onCommitFiberUnmount(dn,u)}catch{}switch(u.tag){case 26:En||wr(u,s),Jr(r,s,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:En||wr(u,s);var p=Zt,x=ri;Ya(u.type)&&(Zt=u.stateNode,ri=!1),Jr(r,s,u),Hc(u.stateNode),Zt=p,ri=x;break;case 5:En||wr(u,s);case 6:if(p=Zt,x=ri,Zt=null,Jr(r,s,u),Zt=p,ri=x,Zt!==null)if(ri)try{(Zt.nodeType===9?Zt.body:Zt.nodeName==="HTML"?Zt.ownerDocument.body:Zt).removeChild(u.stateNode)}catch(w){It(u,s,w)}else try{Zt.removeChild(u.stateNode)}catch(w){It(u,s,w)}break;case 18:Zt!==null&&(ri?(r=Zt,s1(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,u.stateNode),ao(r)):s1(Zt,u.stateNode));break;case 4:p=Zt,x=ri,Zt=u.stateNode.containerInfo,ri=!0,Jr(r,s,u),Zt=p,ri=x;break;case 0:case 11:case 14:case 15:Ua(2,u,s),En||Ua(4,u,s),Jr(r,s,u);break;case 1:En||(wr(u,s),p=u.stateNode,typeof p.componentWillUnmount=="function"&&lw(u,s,p)),Jr(r,s,u);break;case 21:Jr(r,s,u);break;case 22:En=(p=En)||u.memoizedState!==null,Jr(r,s,u),En=p;break;default:Jr(r,s,u)}}function mw(r,s){if(s.memoizedState===null&&(r=s.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{ao(r)}catch(u){It(s,s.return,u)}}}function gw(r,s){if(s.memoizedState===null&&(r=s.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{ao(r)}catch(u){It(s,s.return,u)}}function XT(r){switch(r.tag){case 31:case 13:case 19:var s=r.stateNode;return s===null&&(s=r.stateNode=new dw),s;case 22:return r=r.stateNode,s=r._retryCache,s===null&&(s=r._retryCache=new dw),s;default:throw Error(i(435,r.tag))}}function Kd(r,s){var u=XT(r);s.forEach(function(p){if(!u.has(p)){u.add(p);var x=sM.bind(null,r,p);p.then(x,x)}})}function ai(r,s){var u=s.deletions;if(u!==null)for(var p=0;p<u.length;p++){var x=u[p],w=r,A=s,U=A;e:for(;U!==null;){switch(U.tag){case 27:if(Ya(U.type)){Zt=U.stateNode,ri=!1;break e}break;case 5:Zt=U.stateNode,ri=!1;break e;case 3:case 4:Zt=U.stateNode.containerInfo,ri=!0;break e}U=U.return}if(Zt===null)throw Error(i(160));pw(w,A,x),Zt=null,ri=!1,w=x.alternate,w!==null&&(w.return=null),x.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)yw(s,r),s=s.sibling}var nr=null;function yw(r,s){var u=r.alternate,p=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:ai(s,r),si(r),p&4&&(Ua(3,r,r.return),Rc(3,r),Ua(5,r,r.return));break;case 1:ai(s,r),si(r),p&512&&(En||u===null||wr(u,u.return)),p&64&&Zr&&(r=r.updateQueue,r!==null&&(p=r.callbacks,p!==null&&(u=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=u===null?p:u.concat(p))));break;case 26:var x=nr;if(ai(s,r),si(r),p&512&&(En||u===null||wr(u,u.return)),p&4){var w=u!==null?u.memoizedState:null;if(p=r.memoizedState,u===null)if(p===null)if(r.stateNode===null){e:{p=r.type,u=r.memoizedProps,x=x.ownerDocument||x;t:switch(p){case"title":w=x.getElementsByTagName("title")[0],(!w||w[$r]||w[an]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=x.createElement(p),x.head.insertBefore(w,x.querySelector("head > title"))),Bn(w,p,u),w[an]=r,fn(w),p=w;break e;case"link":var A=y1("link","href",x).get(p+(u.href||""));if(A){for(var U=0;U<A.length;U++)if(w=A[U],w.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&w.getAttribute("rel")===(u.rel==null?null:u.rel)&&w.getAttribute("title")===(u.title==null?null:u.title)&&w.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){A.splice(U,1);break t}}w=x.createElement(p),Bn(w,p,u),x.head.appendChild(w);break;case"meta":if(A=y1("meta","content",x).get(p+(u.content||""))){for(U=0;U<A.length;U++)if(w=A[U],w.getAttribute("content")===(u.content==null?null:""+u.content)&&w.getAttribute("name")===(u.name==null?null:u.name)&&w.getAttribute("property")===(u.property==null?null:u.property)&&w.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&w.getAttribute("charset")===(u.charSet==null?null:u.charSet)){A.splice(U,1);break t}}w=x.createElement(p),Bn(w,p,u),x.head.appendChild(w);break;default:throw Error(i(468,p))}w[an]=r,fn(w),p=w}r.stateNode=p}else b1(x,r.type,r.stateNode);else r.stateNode=g1(x,p,r.memoizedProps);else w!==p?(w===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):w.count--,p===null?b1(x,r.type,r.stateNode):g1(x,p,r.memoizedProps)):p===null&&r.stateNode!==null&&Lm(r,r.memoizedProps,u.memoizedProps)}break;case 27:ai(s,r),si(r),p&512&&(En||u===null||wr(u,u.return)),u!==null&&p&4&&Lm(r,r.memoizedProps,u.memoizedProps);break;case 5:if(ai(s,r),si(r),p&512&&(En||u===null||wr(u,u.return)),r.flags&32){x=r.stateNode;try{nt(x,"")}catch($e){It(r,r.return,$e)}}p&4&&r.stateNode!=null&&(x=r.memoizedProps,Lm(r,x,u!==null?u.memoizedProps:x)),p&1024&&(Pm=!0);break;case 6:if(ai(s,r),si(r),p&4){if(r.stateNode===null)throw Error(i(162));p=r.memoizedProps,u=r.stateNode;try{u.nodeValue=p}catch($e){It(r,r.return,$e)}}break;case 3:if(of=null,x=nr,nr=sf(s.containerInfo),ai(s,r),nr=x,si(r),p&4&&u!==null&&u.memoizedState.isDehydrated)try{ao(s.containerInfo)}catch($e){It(r,r.return,$e)}Pm&&(Pm=!1,bw(r));break;case 4:p=nr,nr=sf(r.stateNode.containerInfo),ai(s,r),si(r),nr=p;break;case 12:ai(s,r),si(r);break;case 31:ai(s,r),si(r),p&4&&(p=r.updateQueue,p!==null&&(r.updateQueue=null,Kd(r,p)));break;case 13:ai(s,r),si(r),r.child.flags&8192&&r.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Vd=Ne()),p&4&&(p=r.updateQueue,p!==null&&(r.updateQueue=null,Kd(r,p)));break;case 22:x=r.memoizedState!==null;var W=u!==null&&u.memoizedState!==null,se=Zr,me=En;if(Zr=se||x,En=me||W,ai(s,r),En=me,Zr=se,si(r),p&8192)e:for(s=r.stateNode,s._visibility=x?s._visibility&-2:s._visibility|1,x&&(u===null||W||Zr||En||Hs(r)),u=null,s=r;;){if(s.tag===5||s.tag===26){if(u===null){W=u=s;try{if(w=W.stateNode,x)A=w.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{U=W.stateNode;var we=W.memoizedProps.style,oe=we!=null&&we.hasOwnProperty("display")?we.display:null;U.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch($e){It(W,W.return,$e)}}}else if(s.tag===6){if(u===null){W=s;try{W.stateNode.nodeValue=x?"":W.memoizedProps}catch($e){It(W,W.return,$e)}}}else if(s.tag===18){if(u===null){W=s;try{var fe=W.stateNode;x?l1(fe,!0):l1(W.stateNode,!1)}catch($e){It(W,W.return,$e)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===r)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break e;for(;s.sibling===null;){if(s.return===null||s.return===r)break e;u===s&&(u=null),s=s.return}u===s&&(u=null),s.sibling.return=s.return,s=s.sibling}p&4&&(p=r.updateQueue,p!==null&&(u=p.retryQueue,u!==null&&(p.retryQueue=null,Kd(r,u))));break;case 19:ai(s,r),si(r),p&4&&(p=r.updateQueue,p!==null&&(r.updateQueue=null,Kd(r,p)));break;case 30:break;case 21:break;default:ai(s,r),si(r)}}function si(r){var s=r.flags;if(s&2){try{for(var u,p=r.return;p!==null;){if(cw(p)){u=p;break}p=p.return}if(u==null)throw Error(i(160));switch(u.tag){case 27:var x=u.stateNode,w=Im(r);Hd(r,w,x);break;case 5:var A=u.stateNode;u.flags&32&&(nt(A,""),u.flags&=-33);var U=Im(r);Hd(r,U,A);break;case 3:case 4:var W=u.stateNode.containerInfo,se=Im(r);zm(r,se,W);break;default:throw Error(i(161))}}catch(me){It(r,r.return,me)}r.flags&=-3}s&4096&&(r.flags&=-4097)}function bw(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var s=r;bw(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),r=r.sibling}}function ea(r,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)fw(r,s.alternate,s),s=s.sibling}function Hs(r){for(r=r.child;r!==null;){var s=r;switch(s.tag){case 0:case 11:case 14:case 15:Ua(4,s,s.return),Hs(s);break;case 1:wr(s,s.return);var u=s.stateNode;typeof u.componentWillUnmount=="function"&&lw(s,s.return,u),Hs(s);break;case 27:Hc(s.stateNode);case 26:case 5:wr(s,s.return),Hs(s);break;case 22:s.memoizedState===null&&Hs(s);break;case 30:Hs(s);break;default:Hs(s)}r=r.sibling}}function ta(r,s,u){for(u=u&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var p=s.alternate,x=r,w=s,A=w.flags;switch(w.tag){case 0:case 11:case 15:ta(x,w,u),Rc(4,w);break;case 1:if(ta(x,w,u),p=w,x=p.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(se){It(p,p.return,se)}if(p=w,x=p.updateQueue,x!==null){var U=p.stateNode;try{var W=x.shared.hiddenCallbacks;if(W!==null)for(x.shared.hiddenCallbacks=null,x=0;x<W.length;x++)Qv(W[x],U)}catch(se){It(p,p.return,se)}}u&&A&64&&sw(w),Lc(w,w.return);break;case 27:uw(w);case 26:case 5:ta(x,w,u),u&&p===null&&A&4&&ow(w),Lc(w,w.return);break;case 12:ta(x,w,u);break;case 31:ta(x,w,u),u&&A&4&&mw(x,w);break;case 13:ta(x,w,u),u&&A&4&&gw(x,w);break;case 22:w.memoizedState===null&&ta(x,w,u),Lc(w,w.return);break;case 30:break;default:ta(x,w,u)}s=s.sibling}}function Bm(r,s){var u=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),r=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(r=s.memoizedState.cachePool.pool),r!==u&&(r!=null&&r.refCount++,u!=null&&wc(u))}function $m(r,s){r=null,s.alternate!==null&&(r=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==r&&(s.refCount++,r!=null&&wc(r))}function ir(r,s,u,p){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)xw(r,s,u,p),s=s.sibling}function xw(r,s,u,p){var x=s.flags;switch(s.tag){case 0:case 11:case 15:ir(r,s,u,p),x&2048&&Rc(9,s);break;case 1:ir(r,s,u,p);break;case 3:ir(r,s,u,p),x&2048&&(r=null,s.alternate!==null&&(r=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==r&&(s.refCount++,r!=null&&wc(r)));break;case 12:if(x&2048){ir(r,s,u,p),r=s.stateNode;try{var w=s.memoizedProps,A=w.id,U=w.onPostCommit;typeof U=="function"&&U(A,s.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(W){It(s,s.return,W)}}else ir(r,s,u,p);break;case 31:ir(r,s,u,p);break;case 13:ir(r,s,u,p);break;case 23:break;case 22:w=s.stateNode,A=s.alternate,s.memoizedState!==null?w._visibility&2?ir(r,s,u,p):Ic(r,s):w._visibility&2?ir(r,s,u,p):(w._visibility|=2,Yl(r,s,u,p,(s.subtreeFlags&10256)!==0||!1)),x&2048&&Bm(A,s);break;case 24:ir(r,s,u,p),x&2048&&$m(s.alternate,s);break;default:ir(r,s,u,p)}}function Yl(r,s,u,p,x){for(x=x&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var w=r,A=s,U=u,W=p,se=A.flags;switch(A.tag){case 0:case 11:case 15:Yl(w,A,U,W,x),Rc(8,A);break;case 23:break;case 22:var me=A.stateNode;A.memoizedState!==null?me._visibility&2?Yl(w,A,U,W,x):Ic(w,A):(me._visibility|=2,Yl(w,A,U,W,x)),x&&se&2048&&Bm(A.alternate,A);break;case 24:Yl(w,A,U,W,x),x&&se&2048&&$m(A.alternate,A);break;default:Yl(w,A,U,W,x)}s=s.sibling}}function Ic(r,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var u=r,p=s,x=p.flags;switch(p.tag){case 22:Ic(u,p),x&2048&&Bm(p.alternate,p);break;case 24:Ic(u,p),x&2048&&$m(p.alternate,p);break;default:Ic(u,p)}s=s.sibling}}var zc=8192;function Ql(r,s,u){if(r.subtreeFlags&zc)for(r=r.child;r!==null;)vw(r,s,u),r=r.sibling}function vw(r,s,u){switch(r.tag){case 26:Ql(r,s,u),r.flags&zc&&r.memoizedState!==null&&zM(u,nr,r.memoizedState,r.memoizedProps);break;case 5:Ql(r,s,u);break;case 3:case 4:var p=nr;nr=sf(r.stateNode.containerInfo),Ql(r,s,u),nr=p;break;case 22:r.memoizedState===null&&(p=r.alternate,p!==null&&p.memoizedState!==null?(p=zc,zc=16777216,Ql(r,s,u),zc=p):Ql(r,s,u));break;default:Ql(r,s,u)}}function ww(r){var s=r.alternate;if(s!==null&&(r=s.child,r!==null)){s.child=null;do s=r.sibling,r.sibling=null,r=s;while(r!==null)}}function Pc(r){var s=r.deletions;if((r.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var p=s[u];Dn=p,Ew(p,r)}ww(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)kw(r),r=r.sibling}function kw(r){switch(r.tag){case 0:case 11:case 15:Pc(r),r.flags&2048&&Ua(9,r,r.return);break;case 3:Pc(r);break;case 12:Pc(r);break;case 22:var s=r.stateNode;r.memoizedState!==null&&s._visibility&2&&(r.return===null||r.return.tag!==13)?(s._visibility&=-3,Gd(r)):Pc(r);break;default:Pc(r)}}function Gd(r){var s=r.deletions;if((r.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var p=s[u];Dn=p,Ew(p,r)}ww(r)}for(r=r.child;r!==null;){switch(s=r,s.tag){case 0:case 11:case 15:Ua(8,s,s.return),Gd(s);break;case 22:u=s.stateNode,u._visibility&2&&(u._visibility&=-3,Gd(s));break;default:Gd(s)}r=r.sibling}}function Ew(r,s){for(;Dn!==null;){var u=Dn;switch(u.tag){case 0:case 11:case 15:Ua(8,u,s);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var p=u.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:wc(u.memoizedState.cache)}if(p=u.child,p!==null)p.return=u,Dn=p;else e:for(u=r;Dn!==null;){p=Dn;var x=p.sibling,w=p.return;if(hw(p),p===u){Dn=null;break e}if(x!==null){x.return=w,Dn=x;break e}Dn=w}}}var ZT={getCacheForType:function(r){var s=zn(vn),u=s.data.get(r);return u===void 0&&(u=r(),s.data.set(r,u)),u},cacheSignal:function(){return zn(vn).controller.signal}},JT=typeof WeakMap=="function"?WeakMap:Map,Tt=0,qt=null,pt=null,xt=0,Lt=0,vi=null,Fa=!1,Wl=!1,Um=!1,na=0,pn=0,qa=0,Ks=0,Fm=0,wi=0,Xl=0,Bc=null,li=null,qm=!1,Vd=0,Sw=0,Yd=1/0,Qd=null,Ha=null,jn=0,Ka=null,Zl=null,ia=0,Hm=0,Km=null,Nw=null,$c=0,Gm=null;function ki(){return(Tt&2)!==0&&xt!==0?xt&-xt:P.T!==null?Zm():ka()}function _w(){if(wi===0)if((xt&536870912)===0||wt){var r=wa;wa<<=1,(wa&3932160)===0&&(wa=262144),wi=r}else wi=536870912;return r=bi.current,r!==null&&(r.flags|=32),wi}function oi(r,s,u){(r===qt&&(Lt===2||Lt===9)||r.cancelPendingCommit!==null)&&(Jl(r,0),Ga(r,xt,wi,!1)),Ot(r,u),((Tt&2)===0||r!==qt)&&(r===qt&&((Tt&2)===0&&(Ks|=u),pn===4&&Ga(r,xt,wi,!1)),kr(r))}function jw(r,s,u){if((Tt&6)!==0)throw Error(i(327));var p=!u&&(s&127)===0&&(s&r.expiredLanes)===0||ge(r,s),x=p?nM(r,s):Ym(r,s,!0),w=p;do{if(x===0){Wl&&!p&&Ga(r,s,0,!1);break}else{if(u=r.current.alternate,w&&!eM(u)){x=Ym(r,s,!1),w=!1;continue}if(x===2){if(w=s,r.errorRecoveryDisabledLanes&w)var A=0;else A=r.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){s=A;e:{var U=r;x=Bc;var W=U.current.memoizedState.isDehydrated;if(W&&(Jl(U,A).flags|=256),A=Ym(U,A,!1),A!==2){if(Um&&!W){U.errorRecoveryDisabledLanes|=w,Ks|=w,x=4;break e}w=li,li=x,w!==null&&(li===null?li=w:li.push.apply(li,w))}x=A}if(w=!1,x!==2)continue}}if(x===1){Jl(r,0),Ga(r,s,0,!0);break}e:{switch(p=r,w=x,w){case 0:case 1:throw Error(i(345));case 4:if((s&4194048)!==s)break;case 6:Ga(p,s,wi,!Fa);break e;case 2:li=null;break;case 3:case 5:break;default:throw Error(i(329))}if((s&62914560)===s&&(x=Vd+300-Ne(),10<x)){if(Ga(p,s,wi,!Fa),Z(p,0,!0)!==0)break e;ia=s,p.timeoutHandle=r1(Cw.bind(null,p,u,li,Qd,qm,s,wi,Ks,Xl,Fa,w,"Throttled",-0,0),x);break e}Cw(p,u,li,Qd,qm,s,wi,Ks,Xl,Fa,w,null,-0,0)}}break}while(!0);kr(r)}function Cw(r,s,u,p,x,w,A,U,W,se,me,we,oe,fe){if(r.timeoutHandle=-1,we=s.subtreeFlags,we&8192||(we&16785408)===16785408){we={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ae},vw(s,w,we);var $e=(w&62914560)===w?Vd-Ne():(w&4194048)===w?Sw-Ne():0;if($e=PM(we,$e),$e!==null){ia=w,r.cancelPendingCommit=$e(Iw.bind(null,r,s,w,u,p,x,A,U,W,me,we,null,oe,fe)),Ga(r,w,A,!se);return}}Iw(r,s,w,u,p,x,A,U,W)}function eM(r){for(var s=r;;){var u=s.tag;if((u===0||u===11||u===15)&&s.flags&16384&&(u=s.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var p=0;p<u.length;p++){var x=u[p],w=x.getSnapshot;x=x.value;try{if(!gi(w(),x))return!1}catch{return!1}}if(u=s.child,s.subtreeFlags&16384&&u!==null)u.return=s,s=u;else{if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Ga(r,s,u,p){s&=~Fm,s&=~Ks,r.suspendedLanes|=s,r.pingedLanes&=~s,p&&(r.warmLanes|=s),p=r.expirationTimes;for(var x=s;0<x;){var w=31-yt(x),A=1<<w;p[w]=-1,x&=~A}u!==0&&Pe(r,u,s)}function Wd(){return(Tt&6)===0?(Uc(0),!1):!0}function Vm(){if(pt!==null){if(Lt===0)var r=pt.return;else r=pt,Gr=Is=null,cm(r),ql=null,Ec=0,r=pt;for(;r!==null;)aw(r.alternate,r),r=r.return;pt=null}}function Jl(r,s){var u=r.timeoutHandle;u!==-1&&(r.timeoutHandle=-1,vM(u)),u=r.cancelPendingCommit,u!==null&&(r.cancelPendingCommit=null,u()),ia=0,Vm(),qt=r,pt=u=Hr(r.current,null),xt=s,Lt=0,vi=null,Fa=!1,Wl=ge(r,s),Um=!1,Xl=wi=Fm=Ks=qa=pn=0,li=Bc=null,qm=!1,(s&8)!==0&&(s|=s&32);var p=r.entangledLanes;if(p!==0)for(r=r.entanglements,p&=s;0<p;){var x=31-yt(p),w=1<<x;s|=r[x],p&=~w}return na=s,yd(),u}function Aw(r,s){ot=null,P.H=Mc,s===Fl||s===Nd?(s=Kv(),Lt=3):s===Xp?(s=Kv(),Lt=4):Lt=s===Nm?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,vi=s,pt===null&&(pn=1,Bd(r,Ri(s,r.current)))}function Tw(){var r=bi.current;return r===null?!0:(xt&4194048)===xt?Pi===null:(xt&62914560)===xt||(xt&536870912)!==0?r===Pi:!1}function Mw(){var r=P.H;return P.H=Mc,r===null?Mc:r}function Dw(){var r=P.A;return P.A=ZT,r}function Xd(){pn=4,Fa||(xt&4194048)!==xt&&bi.current!==null||(Wl=!0),(qa&134217727)===0&&(Ks&134217727)===0||qt===null||Ga(qt,xt,wi,!1)}function Ym(r,s,u){var p=Tt;Tt|=2;var x=Mw(),w=Dw();(qt!==r||xt!==s)&&(Qd=null,Jl(r,s)),s=!1;var A=pn;e:do try{if(Lt!==0&&pt!==null){var U=pt,W=vi;switch(Lt){case 8:Vm(),A=6;break e;case 3:case 2:case 9:case 6:bi.current===null&&(s=!0);var se=Lt;if(Lt=0,vi=null,eo(r,U,W,se),u&&Wl){A=0;break e}break;default:se=Lt,Lt=0,vi=null,eo(r,U,W,se)}}tM(),A=pn;break}catch(me){Aw(r,me)}while(!0);return s&&r.shellSuspendCounter++,Gr=Is=null,Tt=p,P.H=x,P.A=w,pt===null&&(qt=null,xt=0,yd()),A}function tM(){for(;pt!==null;)Ow(pt)}function nM(r,s){var u=Tt;Tt|=2;var p=Mw(),x=Dw();qt!==r||xt!==s?(Qd=null,Yd=Ne()+500,Jl(r,s)):Wl=ge(r,s);e:do try{if(Lt!==0&&pt!==null){s=pt;var w=vi;t:switch(Lt){case 1:Lt=0,vi=null,eo(r,s,w,1);break;case 2:case 9:if(qv(w)){Lt=0,vi=null,Rw(s);break}s=function(){Lt!==2&&Lt!==9||qt!==r||(Lt=7),kr(r)},w.then(s,s);break e;case 3:Lt=7;break e;case 4:Lt=5;break e;case 7:qv(w)?(Lt=0,vi=null,Rw(s)):(Lt=0,vi=null,eo(r,s,w,7));break;case 5:var A=null;switch(pt.tag){case 26:A=pt.memoizedState;case 5:case 27:var U=pt;if(A?x1(A):U.stateNode.complete){Lt=0,vi=null;var W=U.sibling;if(W!==null)pt=W;else{var se=U.return;se!==null?(pt=se,Zd(se)):pt=null}break t}}Lt=0,vi=null,eo(r,s,w,5);break;case 6:Lt=0,vi=null,eo(r,s,w,6);break;case 8:Vm(),pn=6;break e;default:throw Error(i(462))}}iM();break}catch(me){Aw(r,me)}while(!0);return Gr=Is=null,P.H=p,P.A=x,Tt=u,pt!==null?0:(qt=null,xt=0,yd(),pn)}function iM(){for(;pt!==null&&!he();)Ow(pt)}function Ow(r){var s=iw(r.alternate,r,na);r.memoizedProps=r.pendingProps,s===null?Zd(r):pt=s}function Rw(r){var s=r,u=s.alternate;switch(s.tag){case 15:case 0:s=X0(u,s,s.pendingProps,s.type,void 0,xt);break;case 11:s=X0(u,s,s.pendingProps,s.type.render,s.ref,xt);break;case 5:cm(s);default:aw(u,s),s=pt=Dv(s,na),s=iw(u,s,na)}r.memoizedProps=r.pendingProps,s===null?Zd(r):pt=s}function eo(r,s,u,p){Gr=Is=null,cm(s),ql=null,Ec=0;var x=s.return;try{if(KT(r,x,s,u,xt)){pn=1,Bd(r,Ri(u,r.current)),pt=null;return}}catch(w){if(x!==null)throw pt=x,w;pn=1,Bd(r,Ri(u,r.current)),pt=null;return}s.flags&32768?(wt||p===1?r=!0:Wl||(xt&536870912)!==0?r=!1:(Fa=r=!0,(p===2||p===9||p===3||p===6)&&(p=bi.current,p!==null&&p.tag===13&&(p.flags|=16384))),Lw(s,r)):Zd(s)}function Zd(r){var s=r;do{if((s.flags&32768)!==0){Lw(s,Fa);return}r=s.return;var u=YT(s.alternate,s,na);if(u!==null){pt=u;return}if(s=s.sibling,s!==null){pt=s;return}pt=s=r}while(s!==null);pn===0&&(pn=5)}function Lw(r,s){do{var u=QT(r.alternate,r);if(u!==null){u.flags&=32767,pt=u;return}if(u=r.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!s&&(r=r.sibling,r!==null)){pt=r;return}pt=r=u}while(r!==null);pn=6,pt=null}function Iw(r,s,u,p,x,w,A,U,W){r.cancelPendingCommit=null;do Jd();while(jn!==0);if((Tt&6)!==0)throw Error(i(327));if(s!==null){if(s===r.current)throw Error(i(177));if(w=s.lanes|s.childLanes,w|=Ip,Ue(r,u,w,A,U,W),r===qt&&(pt=qt=null,xt=0),Zl=s,Ka=r,ia=u,Hm=w,Km=x,Nw=p,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,lM(Le,function(){return Uw(),null})):(r.callbackNode=null,r.callbackPriority=0),p=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||p){p=P.T,P.T=null,x=H.p,H.p=2,A=Tt,Tt|=4;try{WT(r,s,u)}finally{Tt=A,H.p=x,P.T=p}}jn=1,zw(),Pw(),Bw()}}function zw(){if(jn===1){jn=0;var r=Ka,s=Zl,u=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||u){u=P.T,P.T=null;var p=H.p;H.p=2;var x=Tt;Tt|=4;try{yw(s,r);var w=sg,A=Ev(r.containerInfo),U=w.focusedElem,W=w.selectionRange;if(A!==U&&U&&U.ownerDocument&&kv(U.ownerDocument.documentElement,U)){if(W!==null&&Mp(U)){var se=W.start,me=W.end;if(me===void 0&&(me=se),"selectionStart"in U)U.selectionStart=se,U.selectionEnd=Math.min(me,U.value.length);else{var we=U.ownerDocument||document,oe=we&&we.defaultView||window;if(oe.getSelection){var fe=oe.getSelection(),$e=U.textContent.length,tt=Math.min(W.start,$e),$t=W.end===void 0?tt:Math.min(W.end,$e);!fe.extend&&tt>$t&&(A=$t,$t=tt,tt=A);var ie=wv(U,tt),ee=wv(U,$t);if(ie&&ee&&(fe.rangeCount!==1||fe.anchorNode!==ie.node||fe.anchorOffset!==ie.offset||fe.focusNode!==ee.node||fe.focusOffset!==ee.offset)){var re=we.createRange();re.setStart(ie.node,ie.offset),fe.removeAllRanges(),tt>$t?(fe.addRange(re),fe.extend(ee.node,ee.offset)):(re.setEnd(ee.node,ee.offset),fe.addRange(re))}}}}for(we=[],fe=U;fe=fe.parentNode;)fe.nodeType===1&&we.push({element:fe,left:fe.scrollLeft,top:fe.scrollTop});for(typeof U.focus=="function"&&U.focus(),U=0;U<we.length;U++){var xe=we[U];xe.element.scrollLeft=xe.left,xe.element.scrollTop=xe.top}}ff=!!ag,sg=ag=null}finally{Tt=x,H.p=p,P.T=u}}r.current=s,jn=2}}function Pw(){if(jn===2){jn=0;var r=Ka,s=Zl,u=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||u){u=P.T,P.T=null;var p=H.p;H.p=2;var x=Tt;Tt|=4;try{fw(r,s.alternate,s)}finally{Tt=x,H.p=p,P.T=u}}jn=3}}function Bw(){if(jn===4||jn===3){jn=0,Ee();var r=Ka,s=Zl,u=ia,p=Nw;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?jn=5:(jn=0,Zl=Ka=null,$w(r,r.pendingLanes));var x=r.pendingLanes;if(x===0&&(Ha=null),Qi(u),s=s.stateNode,Mt&&typeof Mt.onCommitFiberRoot=="function")try{Mt.onCommitFiberRoot(dn,s,void 0,(s.current.flags&128)===128)}catch{}if(p!==null){s=P.T,x=H.p,H.p=2,P.T=null;try{for(var w=r.onRecoverableError,A=0;A<p.length;A++){var U=p[A];w(U.value,{componentStack:U.stack})}}finally{P.T=s,H.p=x}}(ia&3)!==0&&Jd(),kr(r),x=r.pendingLanes,(u&261930)!==0&&(x&42)!==0?r===Gm?$c++:($c=0,Gm=r):$c=0,Uc(0)}}function $w(r,s){(r.pooledCacheLanes&=s)===0&&(s=r.pooledCache,s!=null&&(r.pooledCache=null,wc(s)))}function Jd(){return zw(),Pw(),Bw(),Uw()}function Uw(){if(jn!==5)return!1;var r=Ka,s=Hm;Hm=0;var u=Qi(ia),p=P.T,x=H.p;try{H.p=32>u?32:u,P.T=null,u=Km,Km=null;var w=Ka,A=ia;if(jn=0,Zl=Ka=null,ia=0,(Tt&6)!==0)throw Error(i(331));var U=Tt;if(Tt|=4,kw(w.current),xw(w,w.current,A,u),Tt=U,Uc(0,!1),Mt&&typeof Mt.onPostCommitFiberRoot=="function")try{Mt.onPostCommitFiberRoot(dn,w)}catch{}return!0}finally{H.p=x,P.T=p,$w(r,s)}}function Fw(r,s,u){s=Ri(u,s),s=Sm(r.stateNode,s,2),r=Pa(r,s,2),r!==null&&(Ot(r,2),kr(r))}function It(r,s,u){if(r.tag===3)Fw(r,r,u);else for(;s!==null;){if(s.tag===3){Fw(s,r,u);break}else if(s.tag===1){var p=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Ha===null||!Ha.has(p))){r=Ri(u,r),u=q0(2),p=Pa(s,u,2),p!==null&&(H0(u,p,s,r),Ot(p,2),kr(p));break}}s=s.return}}function Qm(r,s,u){var p=r.pingCache;if(p===null){p=r.pingCache=new JT;var x=new Set;p.set(s,x)}else x=p.get(s),x===void 0&&(x=new Set,p.set(s,x));x.has(u)||(Um=!0,x.add(u),r=rM.bind(null,r,s,u),s.then(r,r))}function rM(r,s,u){var p=r.pingCache;p!==null&&p.delete(s),r.pingedLanes|=r.suspendedLanes&u,r.warmLanes&=~u,qt===r&&(xt&u)===u&&(pn===4||pn===3&&(xt&62914560)===xt&&300>Ne()-Vd?(Tt&2)===0&&Jl(r,0):Fm|=u,Xl===xt&&(Xl=0)),kr(r)}function qw(r,s){s===0&&(s=it()),r=Os(r,s),r!==null&&(Ot(r,s),kr(r))}function aM(r){var s=r.memoizedState,u=0;s!==null&&(u=s.retryLane),qw(r,u)}function sM(r,s){var u=0;switch(r.tag){case 31:case 13:var p=r.stateNode,x=r.memoizedState;x!==null&&(u=x.retryLane);break;case 19:p=r.stateNode;break;case 22:p=r.stateNode._retryCache;break;default:throw Error(i(314))}p!==null&&p.delete(s),qw(r,u)}function lM(r,s){return be(r,s)}var ef=null,to=null,Wm=!1,tf=!1,Xm=!1,Va=0;function kr(r){r!==to&&r.next===null&&(to===null?ef=to=r:to=to.next=r),tf=!0,Wm||(Wm=!0,cM())}function Uc(r,s){if(!Xm&&tf){Xm=!0;do for(var u=!1,p=ef;p!==null;){if(r!==0){var x=p.pendingLanes;if(x===0)var w=0;else{var A=p.suspendedLanes,U=p.pingedLanes;w=(1<<31-yt(42|r)+1)-1,w&=x&~(A&~U),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(u=!0,Vw(p,w))}else w=xt,w=Z(p,p===qt?w:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(w&3)===0||ge(p,w)||(u=!0,Vw(p,w));p=p.next}while(u);Xm=!1}}function oM(){Hw()}function Hw(){tf=Wm=!1;var r=0;Va!==0&&xM()&&(r=Va);for(var s=Ne(),u=null,p=ef;p!==null;){var x=p.next,w=Kw(p,s);w===0?(p.next=null,u===null?ef=x:u.next=x,x===null&&(to=u)):(u=p,(r!==0||(w&3)!==0)&&(tf=!0)),p=x}jn!==0&&jn!==5||Uc(r),Va!==0&&(Va=0)}function Kw(r,s){for(var u=r.suspendedLanes,p=r.pingedLanes,x=r.expirationTimes,w=r.pendingLanes&-62914561;0<w;){var A=31-yt(w),U=1<<A,W=x[A];W===-1?((U&u)===0||(U&p)!==0)&&(x[A]=Me(U,s)):W<=s&&(r.expiredLanes|=U),w&=~U}if(s=qt,u=xt,u=Z(r,r===s?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),p=r.callbackNode,u===0||r===s&&(Lt===2||Lt===9)||r.cancelPendingCommit!==null)return p!==null&&p!==null&&ye(p),r.callbackNode=null,r.callbackPriority=0;if((u&3)===0||ge(r,u)){if(s=u&-u,s===r.callbackPriority)return s;switch(p!==null&&ye(p),Qi(u)){case 2:case 8:u=de;break;case 32:u=Le;break;case 268435456:u=rt;break;default:u=Le}return p=Gw.bind(null,r),u=be(u,p),r.callbackPriority=s,r.callbackNode=u,s}return p!==null&&p!==null&&ye(p),r.callbackPriority=2,r.callbackNode=null,2}function Gw(r,s){if(jn!==0&&jn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var u=r.callbackNode;if(Jd()&&r.callbackNode!==u)return null;var p=xt;return p=Z(r,r===qt?p:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),p===0?null:(jw(r,p,s),Kw(r,Ne()),r.callbackNode!=null&&r.callbackNode===u?Gw.bind(null,r):null)}function Vw(r,s){if(Jd())return null;jw(r,s,!0)}function cM(){wM(function(){(Tt&6)!==0?be(ne,oM):Hw()})}function Zm(){if(Va===0){var r=$l;r===0&&(r=Pr,Pr<<=1,(Pr&261888)===0&&(Pr=256)),Va=r}return Va}function Yw(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Ta(""+r)}function Qw(r,s){var u=s.ownerDocument.createElement("input");return u.name=s.name,u.value=s.value,r.id&&u.setAttribute("form",r.id),s.parentNode.insertBefore(u,s),r=new FormData(r),u.parentNode.removeChild(u),r}function uM(r,s,u,p,x){if(s==="submit"&&u&&u.stateNode===x){var w=Yw((x[Tn]||null).action),A=p.submitter;A&&(s=(s=A[Tn]||null)?Yw(s.formAction):A.getAttribute("formAction"),s!==null&&(w=s,A=null));var U=new hd("action","action",null,p,x);r.push({event:U,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(Va!==0){var W=A?Qw(x,A):new FormData(x);bm(u,{pending:!0,data:W,method:x.method,action:w},null,W)}}else typeof w=="function"&&(U.preventDefault(),W=A?Qw(x,A):new FormData(x),bm(u,{pending:!0,data:W,method:x.method,action:w},w,W))},currentTarget:x}]})}}for(var Jm=0;Jm<Lp.length;Jm++){var eg=Lp[Jm],dM=eg.toLowerCase(),fM=eg[0].toUpperCase()+eg.slice(1);tr(dM,"on"+fM)}tr(_v,"onAnimationEnd"),tr(jv,"onAnimationIteration"),tr(Cv,"onAnimationStart"),tr("dblclick","onDoubleClick"),tr("focusin","onFocus"),tr("focusout","onBlur"),tr(CT,"onTransitionRun"),tr(AT,"onTransitionStart"),tr(TT,"onTransitionCancel"),tr(Av,"onTransitionEnd"),_e("onMouseEnter",["mouseout","mouseover"]),_e("onMouseLeave",["mouseout","mouseover"]),_e("onPointerEnter",["pointerout","pointerover"]),_e("onPointerLeave",["pointerout","pointerover"]),Ji("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ji("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ji("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ji("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ji("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ji("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fc="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(" "),hM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Fc));function Ww(r,s){s=(s&4)!==0;for(var u=0;u<r.length;u++){var p=r[u],x=p.event;p=p.listeners;e:{var w=void 0;if(s)for(var A=p.length-1;0<=A;A--){var U=p[A],W=U.instance,se=U.currentTarget;if(U=U.listener,W!==w&&x.isPropagationStopped())break e;w=U,x.currentTarget=se;try{w(x)}catch(me){gd(me)}x.currentTarget=null,w=W}else for(A=0;A<p.length;A++){if(U=p[A],W=U.instance,se=U.currentTarget,U=U.listener,W!==w&&x.isPropagationStopped())break e;w=U,x.currentTarget=se;try{w(x)}catch(me){gd(me)}x.currentTarget=null,w=W}}}}function mt(r,s){var u=s[Sa];u===void 0&&(u=s[Sa]=new Set);var p=r+"__bubble";u.has(p)||(Xw(s,r,2,!1),u.add(p))}function tg(r,s,u){var p=0;s&&(p|=4),Xw(u,r,p,s)}var nf="_reactListening"+Math.random().toString(36).slice(2);function ng(r){if(!r[nf]){r[nf]=!0,jl.forEach(function(u){u!=="selectionchange"&&(hM.has(u)||tg(u,!1,r),tg(u,!0,r))});var s=r.nodeType===9?r:r.ownerDocument;s===null||s[nf]||(s[nf]=!0,tg("selectionchange",!1,s))}}function Xw(r,s,u,p){switch(_1(s)){case 2:var x=UM;break;case 8:x=FM;break;default:x=yg}u=x.bind(null,s,u,r),x=void 0,!kp||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(x=!0),p?x!==void 0?r.addEventListener(s,u,{capture:!0,passive:x}):r.addEventListener(s,u,!0):x!==void 0?r.addEventListener(s,u,{passive:x}):r.addEventListener(s,u,!1)}function ig(r,s,u,p,x){var w=p;if((s&1)===0&&(s&2)===0&&p!==null)e:for(;;){if(p===null)return;var A=p.tag;if(A===3||A===4){var U=p.stateNode.containerInfo;if(U===x)break;if(A===4)for(A=p.return;A!==null;){var W=A.tag;if((W===3||W===4)&&A.stateNode.containerInfo===x)return;A=A.return}for(;U!==null;){if(A=Ln(U),A===null)return;if(W=A.tag,W===5||W===6||W===26||W===27){p=w=A;continue e}U=U.parentNode}}p=p.return}cd(function(){var se=w,me=lt(u),we=[];e:{var oe=Tv.get(r);if(oe!==void 0){var fe=hd,$e=r;switch(r){case"keypress":if(dd(u)===0)break e;case"keydown":case"keyup":fe=sT;break;case"focusin":$e="focus",fe=_p;break;case"focusout":$e="blur",fe=_p;break;case"beforeblur":case"afterblur":fe=_p;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":fe=av;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=YA;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=cT;break;case _v:case jv:case Cv:fe=XA;break;case Av:fe=dT;break;case"scroll":case"scrollend":fe=GA;break;case"wheel":fe=hT;break;case"copy":case"cut":case"paste":fe=JA;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=lv;break;case"toggle":case"beforetoggle":fe=mT}var tt=(s&4)!==0,$t=!tt&&(r==="scroll"||r==="scrollend"),ie=tt?oe!==null?oe+"Capture":null:oe;tt=[];for(var ee=se,re;ee!==null;){var xe=ee;if(re=xe.stateNode,xe=xe.tag,xe!==5&&xe!==26&&xe!==27||re===null||ie===null||(xe=uc(ee,ie),xe!=null&&tt.push(qc(ee,xe,re))),$t)break;ee=ee.return}0<tt.length&&(oe=new fe(oe,$e,null,u,me),we.push({event:oe,listeners:tt}))}}if((s&7)===0){e:{if(oe=r==="mouseover"||r==="pointerover",fe=r==="mouseout"||r==="pointerout",oe&&u!==qe&&($e=u.relatedTarget||u.fromElement)&&(Ln($e)||$e[Wi]))break e;if((fe||oe)&&(oe=me.window===me?me:(oe=me.ownerDocument)?oe.defaultView||oe.parentWindow:window,fe?($e=u.relatedTarget||u.toElement,fe=se,$e=$e?Ln($e):null,$e!==null&&($t=l($e),tt=$e.tag,$e!==$t||tt!==5&&tt!==27&&tt!==6)&&($e=null)):(fe=null,$e=se),fe!==$e)){if(tt=av,xe="onMouseLeave",ie="onMouseEnter",ee="mouse",(r==="pointerout"||r==="pointerover")&&(tt=lv,xe="onPointerLeave",ie="onPointerEnter",ee="pointer"),$t=fe==null?oe:Zi(fe),re=$e==null?oe:Zi($e),oe=new tt(xe,ee+"leave",fe,u,me),oe.target=$t,oe.relatedTarget=re,xe=null,Ln(me)===se&&(tt=new tt(ie,ee+"enter",$e,u,me),tt.target=re,tt.relatedTarget=$t,xe=tt),$t=xe,fe&&$e)t:{for(tt=pM,ie=fe,ee=$e,re=0,xe=ie;xe;xe=tt(xe))re++;xe=0;for(var We=ee;We;We=tt(We))xe++;for(;0<re-xe;)ie=tt(ie),re--;for(;0<xe-re;)ee=tt(ee),xe--;for(;re--;){if(ie===ee||ee!==null&&ie===ee.alternate){tt=ie;break t}ie=tt(ie),ee=tt(ee)}tt=null}else tt=null;fe!==null&&Zw(we,oe,fe,tt,!1),$e!==null&&$t!==null&&Zw(we,$t,$e,tt,!0)}}e:{if(oe=se?Zi(se):window,fe=oe.nodeName&&oe.nodeName.toLowerCase(),fe==="select"||fe==="input"&&oe.type==="file")var _t=mv;else if(hv(oe))if(gv)_t=NT;else{_t=ET;var He=kT}else fe=oe.nodeName,!fe||fe.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?se&&Aa(se.elementType)&&(_t=mv):_t=ST;if(_t&&(_t=_t(r,se))){pv(we,_t,u,me);break e}He&&He(r,oe,se),r==="focusout"&&se&&oe.type==="number"&&se.memoizedProps.value!=null&&Ca(oe,"number",oe.value)}switch(He=se?Zi(se):window,r){case"focusin":(hv(He)||He.contentEditable==="true")&&(Dl=He,Dp=se,bc=null);break;case"focusout":bc=Dp=Dl=null;break;case"mousedown":Op=!0;break;case"contextmenu":case"mouseup":case"dragend":Op=!1,Sv(we,u,me);break;case"selectionchange":if(jT)break;case"keydown":case"keyup":Sv(we,u,me)}var ct;if(Cp)e:{switch(r){case"compositionstart":var vt="onCompositionStart";break e;case"compositionend":vt="onCompositionEnd";break e;case"compositionupdate":vt="onCompositionUpdate";break e}vt=void 0}else Ml?dv(r,u)&&(vt="onCompositionEnd"):r==="keydown"&&u.keyCode===229&&(vt="onCompositionStart");vt&&(ov&&u.locale!=="ko"&&(Ml||vt!=="onCompositionStart"?vt==="onCompositionEnd"&&Ml&&(ct=iv()):(Ma=me,Ep="value"in Ma?Ma.value:Ma.textContent,Ml=!0)),He=rf(se,vt),0<He.length&&(vt=new sv(vt,r,null,u,me),we.push({event:vt,listeners:He}),ct?vt.data=ct:(ct=fv(u),ct!==null&&(vt.data=ct)))),(ct=yT?bT(r,u):xT(r,u))&&(vt=rf(se,"onBeforeInput"),0<vt.length&&(He=new sv("onBeforeInput","beforeinput",null,u,me),we.push({event:He,listeners:vt}),He.data=ct)),uM(we,r,se,u,me)}Ww(we,s)})}function qc(r,s,u){return{instance:r,listener:s,currentTarget:u}}function rf(r,s){for(var u=s+"Capture",p=[];r!==null;){var x=r,w=x.stateNode;if(x=x.tag,x!==5&&x!==26&&x!==27||w===null||(x=uc(r,u),x!=null&&p.unshift(qc(r,x,w)),x=uc(r,s),x!=null&&p.push(qc(r,x,w))),r.tag===3)return p;r=r.return}return[]}function pM(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function Zw(r,s,u,p,x){for(var w=s._reactName,A=[];u!==null&&u!==p;){var U=u,W=U.alternate,se=U.stateNode;if(U=U.tag,W!==null&&W===p)break;U!==5&&U!==26&&U!==27||se===null||(W=se,x?(se=uc(u,w),se!=null&&A.unshift(qc(u,se,W))):x||(se=uc(u,w),se!=null&&A.push(qc(u,se,W)))),u=u.return}A.length!==0&&r.push({event:s,listeners:A})}var mM=/\r\n?/g,gM=/\u0000|\uFFFD/g;function Jw(r){return(typeof r=="string"?r:""+r).replace(mM,`
49
+ `).replace(gM,"")}function e1(r,s){return s=Jw(s),Jw(r)===s}function Bt(r,s,u,p,x,w){switch(u){case"children":typeof p=="string"?s==="body"||s==="textarea"&&p===""||nt(r,p):(typeof p=="number"||typeof p=="bigint")&&s!=="body"&&nt(r,""+p);break;case"className":Qn(r,"class",p);break;case"tabIndex":Qn(r,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":Qn(r,u,p);break;case"style":Rt(r,p,w);break;case"data":if(s!=="object"){Qn(r,"data",p);break}case"src":case"href":if(p===""&&(s!=="a"||u!=="href")){r.removeAttribute(u);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){r.removeAttribute(u);break}p=Ta(""+p),r.setAttribute(u,p);break;case"action":case"formAction":if(typeof p=="function"){r.setAttribute(u,"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 w=="function"&&(u==="formAction"?(s!=="input"&&Bt(r,s,"name",x.name,x,null),Bt(r,s,"formEncType",x.formEncType,x,null),Bt(r,s,"formMethod",x.formMethod,x,null),Bt(r,s,"formTarget",x.formTarget,x,null)):(Bt(r,s,"encType",x.encType,x,null),Bt(r,s,"method",x.method,x,null),Bt(r,s,"target",x.target,x,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){r.removeAttribute(u);break}p=Ta(""+p),r.setAttribute(u,p);break;case"onClick":p!=null&&(r.onclick=Ae);break;case"onScroll":p!=null&&mt("scroll",r);break;case"onScrollEnd":p!=null&&mt("scrollend",r);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(i(61));if(u=p.__html,u!=null){if(x.children!=null)throw Error(i(60));r.innerHTML=u}}break;case"multiple":r.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":r.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){r.removeAttribute("xlink:href");break}u=Ta(""+p),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?r.setAttribute(u,""+p):r.removeAttribute(u);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":p&&typeof p!="function"&&typeof p!="symbol"?r.setAttribute(u,""):r.removeAttribute(u);break;case"capture":case"download":p===!0?r.setAttribute(u,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?r.setAttribute(u,p):r.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?r.setAttribute(u,p):r.removeAttribute(u);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?r.removeAttribute(u):r.setAttribute(u,p);break;case"popover":mt("beforetoggle",r),mt("toggle",r),Mn(r,"popover",p);break;case"xlinkActuate":Fn(r,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":Fn(r,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":Fn(r,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":Fn(r,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":Fn(r,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":Fn(r,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":Fn(r,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":Fn(r,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":Fn(r,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":Mn(r,"is",p);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=Fr.get(u)||u,Mn(r,u,p))}}function rg(r,s,u,p,x,w){switch(u){case"style":Rt(r,p,w);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(i(61));if(u=p.__html,u!=null){if(x.children!=null)throw Error(i(60));r.innerHTML=u}}break;case"children":typeof p=="string"?nt(r,p):(typeof p=="number"||typeof p=="bigint")&&nt(r,""+p);break;case"onScroll":p!=null&&mt("scroll",r);break;case"onScrollEnd":p!=null&&mt("scrollend",r);break;case"onClick":p!=null&&(r.onclick=Ae);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ur.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(x=u.endsWith("Capture"),s=u.slice(2,x?u.length-7:void 0),w=r[Tn]||null,w=w!=null?w[u]:null,typeof w=="function"&&r.removeEventListener(s,w,x),typeof p=="function")){typeof w!="function"&&w!==null&&(u in r?r[u]=null:r.hasAttribute(u)&&r.removeAttribute(u)),r.addEventListener(s,p,x);break e}u in r?r[u]=p:p===!0?r.setAttribute(u,""):Mn(r,u,p)}}}function Bn(r,s,u){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":mt("error",r),mt("load",r);var p=!1,x=!1,w;for(w in u)if(u.hasOwnProperty(w)){var A=u[w];if(A!=null)switch(w){case"src":p=!0;break;case"srcSet":x=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,s));default:Bt(r,s,w,A,u,null)}}x&&Bt(r,s,"srcSet",u.srcSet,u,null),p&&Bt(r,s,"src",u.src,u,null);return;case"input":mt("invalid",r);var U=w=A=x=null,W=null,se=null;for(p in u)if(u.hasOwnProperty(p)){var me=u[p];if(me!=null)switch(p){case"name":x=me;break;case"type":A=me;break;case"checked":W=me;break;case"defaultChecked":se=me;break;case"value":w=me;break;case"defaultValue":U=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(i(137,s));break;default:Bt(r,s,p,me,u,null)}}er(r,w,U,W,se,A,x,!1);return;case"select":mt("invalid",r),p=A=w=null;for(x in u)if(u.hasOwnProperty(x)&&(U=u[x],U!=null))switch(x){case"value":w=U;break;case"defaultValue":A=U;break;case"multiple":p=U;default:Bt(r,s,x,U,u,null)}s=w,u=A,r.multiple=!!p,s!=null?_n(r,!!p,s,!1):u!=null&&_n(r,!!p,u,!0);return;case"textarea":mt("invalid",r),w=x=p=null;for(A in u)if(u.hasOwnProperty(A)&&(U=u[A],U!=null))switch(A){case"value":p=U;break;case"defaultValue":x=U;break;case"children":w=U;break;case"dangerouslySetInnerHTML":if(U!=null)throw Error(i(91));break;default:Bt(r,s,A,U,u,null)}Tl(r,p,x,w);return;case"option":for(W in u)if(u.hasOwnProperty(W)&&(p=u[W],p!=null))switch(W){case"selected":r.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:Bt(r,s,W,p,u,null)}return;case"dialog":mt("beforetoggle",r),mt("toggle",r),mt("cancel",r),mt("close",r);break;case"iframe":case"object":mt("load",r);break;case"video":case"audio":for(p=0;p<Fc.length;p++)mt(Fc[p],r);break;case"image":mt("error",r),mt("load",r);break;case"details":mt("toggle",r);break;case"embed":case"source":case"link":mt("error",r),mt("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(se in u)if(u.hasOwnProperty(se)&&(p=u[se],p!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,s));default:Bt(r,s,se,p,u,null)}return;default:if(Aa(s)){for(me in u)u.hasOwnProperty(me)&&(p=u[me],p!==void 0&&rg(r,s,me,p,u,void 0));return}}for(U in u)u.hasOwnProperty(U)&&(p=u[U],p!=null&&Bt(r,s,U,p,u,null))}function yM(r,s,u,p){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var x=null,w=null,A=null,U=null,W=null,se=null,me=null;for(fe in u){var we=u[fe];if(u.hasOwnProperty(fe)&&we!=null)switch(fe){case"checked":break;case"value":break;case"defaultValue":W=we;default:p.hasOwnProperty(fe)||Bt(r,s,fe,null,p,we)}}for(var oe in p){var fe=p[oe];if(we=u[oe],p.hasOwnProperty(oe)&&(fe!=null||we!=null))switch(oe){case"type":w=fe;break;case"name":x=fe;break;case"checked":se=fe;break;case"defaultChecked":me=fe;break;case"value":A=fe;break;case"defaultValue":U=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(i(137,s));break;default:fe!==we&&Bt(r,s,oe,fe,p,we)}}Cs(r,A,U,W,se,me,w,x);return;case"select":fe=A=U=oe=null;for(w in u)if(W=u[w],u.hasOwnProperty(w)&&W!=null)switch(w){case"value":break;case"multiple":fe=W;default:p.hasOwnProperty(w)||Bt(r,s,w,null,p,W)}for(x in p)if(w=p[x],W=u[x],p.hasOwnProperty(x)&&(w!=null||W!=null))switch(x){case"value":oe=w;break;case"defaultValue":U=w;break;case"multiple":A=w;default:w!==W&&Bt(r,s,x,w,p,W)}s=U,u=A,p=fe,oe!=null?_n(r,!!u,oe,!1):!!p!=!!u&&(s!=null?_n(r,!!u,s,!0):_n(r,!!u,u?[]:"",!1));return;case"textarea":fe=oe=null;for(U in u)if(x=u[U],u.hasOwnProperty(U)&&x!=null&&!p.hasOwnProperty(U))switch(U){case"value":break;case"children":break;default:Bt(r,s,U,null,p,x)}for(A in p)if(x=p[A],w=u[A],p.hasOwnProperty(A)&&(x!=null||w!=null))switch(A){case"value":oe=x;break;case"defaultValue":fe=x;break;case"children":break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(i(91));break;default:x!==w&&Bt(r,s,A,x,p,w)}As(r,oe,fe);return;case"option":for(var $e in u)if(oe=u[$e],u.hasOwnProperty($e)&&oe!=null&&!p.hasOwnProperty($e))switch($e){case"selected":r.selected=!1;break;default:Bt(r,s,$e,null,p,oe)}for(W in p)if(oe=p[W],fe=u[W],p.hasOwnProperty(W)&&oe!==fe&&(oe!=null||fe!=null))switch(W){case"selected":r.selected=oe&&typeof oe!="function"&&typeof oe!="symbol";break;default:Bt(r,s,W,oe,p,fe)}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 tt in u)oe=u[tt],u.hasOwnProperty(tt)&&oe!=null&&!p.hasOwnProperty(tt)&&Bt(r,s,tt,null,p,oe);for(se in p)if(oe=p[se],fe=u[se],p.hasOwnProperty(se)&&oe!==fe&&(oe!=null||fe!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(i(137,s));break;default:Bt(r,s,se,oe,p,fe)}return;default:if(Aa(s)){for(var $t in u)oe=u[$t],u.hasOwnProperty($t)&&oe!==void 0&&!p.hasOwnProperty($t)&&rg(r,s,$t,void 0,p,oe);for(me in p)oe=p[me],fe=u[me],!p.hasOwnProperty(me)||oe===fe||oe===void 0&&fe===void 0||rg(r,s,me,oe,p,fe);return}}for(var ie in u)oe=u[ie],u.hasOwnProperty(ie)&&oe!=null&&!p.hasOwnProperty(ie)&&Bt(r,s,ie,null,p,oe);for(we in p)oe=p[we],fe=u[we],!p.hasOwnProperty(we)||oe===fe||oe==null&&fe==null||Bt(r,s,we,oe,p,fe)}function t1(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function bM(){if(typeof performance.getEntriesByType=="function"){for(var r=0,s=0,u=performance.getEntriesByType("resource"),p=0;p<u.length;p++){var x=u[p],w=x.transferSize,A=x.initiatorType,U=x.duration;if(w&&U&&t1(A)){for(A=0,U=x.responseEnd,p+=1;p<u.length;p++){var W=u[p],se=W.startTime;if(se>U)break;var me=W.transferSize,we=W.initiatorType;me&&t1(we)&&(W=W.responseEnd,A+=me*(W<U?1:(U-se)/(W-se)))}if(--p,s+=8*(w+A)/(x.duration/1e3),r++,10<r)break}}if(0<r)return s/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var ag=null,sg=null;function af(r){return r.nodeType===9?r:r.ownerDocument}function n1(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function i1(r,s){if(r===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&s==="foreignObject"?0:r}function lg(r,s){return r==="textarea"||r==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var og=null;function xM(){var r=window.event;return r&&r.type==="popstate"?r===og?!1:(og=r,!0):(og=null,!1)}var r1=typeof setTimeout=="function"?setTimeout:void 0,vM=typeof clearTimeout=="function"?clearTimeout:void 0,a1=typeof Promise=="function"?Promise:void 0,wM=typeof queueMicrotask=="function"?queueMicrotask:typeof a1<"u"?function(r){return a1.resolve(null).then(r).catch(kM)}:r1;function kM(r){setTimeout(function(){throw r})}function Ya(r){return r==="head"}function s1(r,s){var u=s,p=0;do{var x=u.nextSibling;if(r.removeChild(u),x&&x.nodeType===8)if(u=x.data,u==="/$"||u==="/&"){if(p===0){r.removeChild(x),ao(s);return}p--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")p++;else if(u==="html")Hc(r.ownerDocument.documentElement);else if(u==="head"){u=r.ownerDocument.head,Hc(u);for(var w=u.firstChild;w;){var A=w.nextSibling,U=w.nodeName;w[$r]||U==="SCRIPT"||U==="STYLE"||U==="LINK"&&w.rel.toLowerCase()==="stylesheet"||u.removeChild(w),w=A}}else u==="body"&&Hc(r.ownerDocument.body);u=x}while(u);ao(s)}function l1(r,s){var u=r;r=0;do{var p=u.nextSibling;if(u.nodeType===1?s?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(s?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),p&&p.nodeType===8)if(u=p.data,u==="/$"){if(r===0)break;r--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||r++;u=p}while(u)}function cg(r){var s=r.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var u=s;switch(s=s.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":cg(u),js(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}r.removeChild(u)}}function EM(r,s,u,p){for(;r.nodeType===1;){var x=u;if(r.nodeName.toLowerCase()!==s.toLowerCase()){if(!p&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(p){if(!r[$r])switch(s){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(w=r.getAttribute("rel"),w==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(w!==x.rel||r.getAttribute("href")!==(x.href==null||x.href===""?null:x.href)||r.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin)||r.getAttribute("title")!==(x.title==null?null:x.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(w=r.getAttribute("src"),(w!==(x.src==null?null:x.src)||r.getAttribute("type")!==(x.type==null?null:x.type)||r.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin))&&w&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(s==="input"&&r.type==="hidden"){var w=x.name==null?null:""+x.name;if(x.type==="hidden"&&r.getAttribute("name")===w)return r}else return r;if(r=Bi(r.nextSibling),r===null)break}return null}function SM(r,s,u){if(s==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!u||(r=Bi(r.nextSibling),r===null))return null;return r}function o1(r,s){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=Bi(r.nextSibling),r===null))return null;return r}function ug(r){return r.data==="$?"||r.data==="$~"}function dg(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function NM(r,s){var u=r.ownerDocument;if(r.data==="$~")r._reactRetry=s;else if(r.data!=="$?"||u.readyState!=="loading")s();else{var p=function(){s(),u.removeEventListener("DOMContentLoaded",p)};u.addEventListener("DOMContentLoaded",p),r._reactRetry=p}}function Bi(r){for(;r!=null;r=r.nextSibling){var s=r.nodeType;if(s===1||s===3)break;if(s===8){if(s=r.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return r}var fg=null;function c1(r){r=r.nextSibling;for(var s=0;r;){if(r.nodeType===8){var u=r.data;if(u==="/$"||u==="/&"){if(s===0)return Bi(r.nextSibling);s--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||s++}r=r.nextSibling}return null}function u1(r){r=r.previousSibling;for(var s=0;r;){if(r.nodeType===8){var u=r.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(s===0)return r;s--}else u!=="/$"&&u!=="/&"||s++}r=r.previousSibling}return null}function d1(r,s,u){switch(s=af(u),r){case"html":if(r=s.documentElement,!r)throw Error(i(452));return r;case"head":if(r=s.head,!r)throw Error(i(453));return r;case"body":if(r=s.body,!r)throw Error(i(454));return r;default:throw Error(i(451))}}function Hc(r){for(var s=r.attributes;s.length;)r.removeAttributeNode(s[0]);js(r)}var $i=new Map,f1=new Set;function sf(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var ra=H.d;H.d={f:_M,r:jM,D:CM,C:AM,L:TM,m:MM,X:OM,S:DM,M:RM};function _M(){var r=ra.f(),s=Wd();return r||s}function jM(r){var s=Xi(r);s!==null&&s.tag===5&&s.type==="form"?A0(s):ra.r(r)}var no=typeof document>"u"?null:document;function h1(r,s,u){var p=no;if(p&&typeof s=="string"&&s){var x=qn(s);x='link[rel="'+r+'"][href="'+x+'"]',typeof u=="string"&&(x+='[crossorigin="'+u+'"]'),f1.has(x)||(f1.add(x),r={rel:r,crossOrigin:u,href:s},p.querySelector(x)===null&&(s=p.createElement("link"),Bn(s,"link",r),fn(s),p.head.appendChild(s)))}}function CM(r){ra.D(r),h1("dns-prefetch",r,null)}function AM(r,s){ra.C(r,s),h1("preconnect",r,s)}function TM(r,s,u){ra.L(r,s,u);var p=no;if(p&&r&&s){var x='link[rel="preload"][as="'+qn(s)+'"]';s==="image"&&u&&u.imageSrcSet?(x+='[imagesrcset="'+qn(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(x+='[imagesizes="'+qn(u.imageSizes)+'"]')):x+='[href="'+qn(r)+'"]';var w=x;switch(s){case"style":w=io(r);break;case"script":w=ro(r)}$i.has(w)||(r=m({rel:"preload",href:s==="image"&&u&&u.imageSrcSet?void 0:r,as:s},u),$i.set(w,r),p.querySelector(x)!==null||s==="style"&&p.querySelector(Kc(w))||s==="script"&&p.querySelector(Gc(w))||(s=p.createElement("link"),Bn(s,"link",r),fn(s),p.head.appendChild(s)))}}function MM(r,s){ra.m(r,s);var u=no;if(u&&r){var p=s&&typeof s.as=="string"?s.as:"script",x='link[rel="modulepreload"][as="'+qn(p)+'"][href="'+qn(r)+'"]',w=x;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=ro(r)}if(!$i.has(w)&&(r=m({rel:"modulepreload",href:r},s),$i.set(w,r),u.querySelector(x)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Gc(w)))return}p=u.createElement("link"),Bn(p,"link",r),fn(p),u.head.appendChild(p)}}}function DM(r,s,u){ra.S(r,s,u);var p=no;if(p&&r){var x=yr(p).hoistableStyles,w=io(r);s=s||"default";var A=x.get(w);if(!A){var U={loading:0,preload:null};if(A=p.querySelector(Kc(w)))U.loading=5;else{r=m({rel:"stylesheet",href:r,"data-precedence":s},u),(u=$i.get(w))&&hg(r,u);var W=A=p.createElement("link");fn(W),Bn(W,"link",r),W._p=new Promise(function(se,me){W.onload=se,W.onerror=me}),W.addEventListener("load",function(){U.loading|=1}),W.addEventListener("error",function(){U.loading|=2}),U.loading|=4,lf(A,s,p)}A={type:"stylesheet",instance:A,count:1,state:U},x.set(w,A)}}}function OM(r,s){ra.X(r,s);var u=no;if(u&&r){var p=yr(u).hoistableScripts,x=ro(r),w=p.get(x);w||(w=u.querySelector(Gc(x)),w||(r=m({src:r,async:!0},s),(s=$i.get(x))&&pg(r,s),w=u.createElement("script"),fn(w),Bn(w,"link",r),u.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},p.set(x,w))}}function RM(r,s){ra.M(r,s);var u=no;if(u&&r){var p=yr(u).hoistableScripts,x=ro(r),w=p.get(x);w||(w=u.querySelector(Gc(x)),w||(r=m({src:r,async:!0,type:"module"},s),(s=$i.get(x))&&pg(r,s),w=u.createElement("script"),fn(w),Bn(w,"link",r),u.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},p.set(x,w))}}function p1(r,s,u,p){var x=(x=ke.current)?sf(x):null;if(!x)throw Error(i(446));switch(r){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(s=io(u.href),u=yr(x).hoistableStyles,p=u.get(s),p||(p={type:"style",instance:null,count:0,state:null},u.set(s,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){r=io(u.href);var w=yr(x).hoistableStyles,A=w.get(r);if(A||(x=x.ownerDocument||x,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(r,A),(w=x.querySelector(Kc(r)))&&!w._p&&(A.instance=w,A.state.loading=5),$i.has(r)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},$i.set(r,u),w||LM(x,r,u,A.state))),s&&p===null)throw Error(i(528,""));return A}if(s&&p!==null)throw Error(i(529,""));return null;case"script":return s=u.async,u=u.src,typeof u=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=ro(u),u=yr(x).hoistableScripts,p=u.get(s),p||(p={type:"script",instance:null,count:0,state:null},u.set(s,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,r))}}function io(r){return'href="'+qn(r)+'"'}function Kc(r){return'link[rel="stylesheet"]['+r+"]"}function m1(r){return m({},r,{"data-precedence":r.precedence,precedence:null})}function LM(r,s,u,p){r.querySelector('link[rel="preload"][as="style"]['+s+"]")?p.loading=1:(s=r.createElement("link"),p.preload=s,s.addEventListener("load",function(){return p.loading|=1}),s.addEventListener("error",function(){return p.loading|=2}),Bn(s,"link",u),fn(s),r.head.appendChild(s))}function ro(r){return'[src="'+qn(r)+'"]'}function Gc(r){return"script[async]"+r}function g1(r,s,u){if(s.count++,s.instance===null)switch(s.type){case"style":var p=r.querySelector('style[data-href~="'+qn(u.href)+'"]');if(p)return s.instance=p,fn(p),p;var x=m({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return p=(r.ownerDocument||r).createElement("style"),fn(p),Bn(p,"style",x),lf(p,u.precedence,r),s.instance=p;case"stylesheet":x=io(u.href);var w=r.querySelector(Kc(x));if(w)return s.state.loading|=4,s.instance=w,fn(w),w;p=m1(u),(x=$i.get(x))&&hg(p,x),w=(r.ownerDocument||r).createElement("link"),fn(w);var A=w;return A._p=new Promise(function(U,W){A.onload=U,A.onerror=W}),Bn(w,"link",p),s.state.loading|=4,lf(w,u.precedence,r),s.instance=w;case"script":return w=ro(u.src),(x=r.querySelector(Gc(w)))?(s.instance=x,fn(x),x):(p=u,(x=$i.get(w))&&(p=m({},u),pg(p,x)),r=r.ownerDocument||r,x=r.createElement("script"),fn(x),Bn(x,"link",p),r.head.appendChild(x),s.instance=x);case"void":return null;default:throw Error(i(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(p=s.instance,s.state.loading|=4,lf(p,u.precedence,r));return s.instance}function lf(r,s,u){for(var p=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=p.length?p[p.length-1]:null,w=x,A=0;A<p.length;A++){var U=p[A];if(U.dataset.precedence===s)w=U;else if(w!==x)break}w?w.parentNode.insertBefore(r,w.nextSibling):(s=u.nodeType===9?u.head:u,s.insertBefore(r,s.firstChild))}function hg(r,s){r.crossOrigin==null&&(r.crossOrigin=s.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=s.referrerPolicy),r.title==null&&(r.title=s.title)}function pg(r,s){r.crossOrigin==null&&(r.crossOrigin=s.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=s.referrerPolicy),r.integrity==null&&(r.integrity=s.integrity)}var of=null;function y1(r,s,u){if(of===null){var p=new Map,x=of=new Map;x.set(u,p)}else x=of,p=x.get(u),p||(p=new Map,x.set(u,p));if(p.has(r))return p;for(p.set(r,null),u=u.getElementsByTagName(r),x=0;x<u.length;x++){var w=u[x];if(!(w[$r]||w[an]||r==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var A=w.getAttribute(s)||"";A=r+A;var U=p.get(A);U?U.push(w):p.set(A,[w])}}return p}function b1(r,s,u){r=r.ownerDocument||r,r.head.insertBefore(u,s==="title"?r.querySelector("head > title"):null)}function IM(r,s,u){if(u===1||s.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return r=s.disabled,typeof s.precedence=="string"&&r==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function x1(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function zM(r,s,u,p){if(u.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var x=io(p.href),w=s.querySelector(Kc(x));if(w){s=w._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(r.count++,r=cf.bind(r),s.then(r,r)),u.state.loading|=4,u.instance=w,fn(w);return}w=s.ownerDocument||s,p=m1(p),(x=$i.get(x))&&hg(p,x),w=w.createElement("link"),fn(w);var A=w;A._p=new Promise(function(U,W){A.onload=U,A.onerror=W}),Bn(w,"link",p),u.instance=w}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(u,s),(s=u.state.preload)&&(u.state.loading&3)===0&&(r.count++,u=cf.bind(r),s.addEventListener("load",u),s.addEventListener("error",u))}}var mg=0;function PM(r,s){return r.stylesheets&&r.count===0&&df(r,r.stylesheets),0<r.count||0<r.imgCount?function(u){var p=setTimeout(function(){if(r.stylesheets&&df(r,r.stylesheets),r.unsuspend){var w=r.unsuspend;r.unsuspend=null,w()}},6e4+s);0<r.imgBytes&&mg===0&&(mg=62500*bM());var x=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&df(r,r.stylesheets),r.unsuspend)){var w=r.unsuspend;r.unsuspend=null,w()}},(r.imgBytes>mg?50:800)+s);return r.unsuspend=u,function(){r.unsuspend=null,clearTimeout(p),clearTimeout(x)}}:null}function cf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)df(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var uf=null;function df(r,s){r.stylesheets=null,r.unsuspend!==null&&(r.count++,uf=new Map,s.forEach(BM,r),uf=null,cf.call(r))}function BM(r,s){if(!(s.state.loading&4)){var u=uf.get(r);if(u)var p=u.get(null);else{u=new Map,uf.set(r,u);for(var x=r.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<x.length;w++){var A=x[w];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(u.set(A.dataset.precedence,A),p=A)}p&&u.set(null,p)}x=s.instance,A=x.getAttribute("data-precedence"),w=u.get(A)||p,w===p&&u.set(null,x),u.set(A,x),this.count++,p=cf.bind(this),x.addEventListener("load",p),x.addEventListener("error",p),w?w.parentNode.insertBefore(x,w.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(x,r.firstChild)),s.state.loading|=4}}var Vc={$$typeof:S,Provider:null,Consumer:null,_currentValue:Q,_currentValue2:Q,_threadCount:0};function $M(r,s,u,p,x,w,A,U,W){this.tag=1,this.containerInfo=r,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=Ft(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ft(0),this.hiddenUpdates=Ft(null),this.identifierPrefix=p,this.onUncaughtError=x,this.onCaughtError=w,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=W,this.incompleteTransitions=new Map}function v1(r,s,u,p,x,w,A,U,W,se,me,we){return r=new $M(r,s,u,A,W,se,me,we,U),s=1,w===!0&&(s|=24),w=yi(3,null,null,s),r.current=w,w.stateNode=r,s=Yp(),s.refCount++,r.pooledCache=s,s.refCount++,w.memoizedState={element:p,isDehydrated:u,cache:s},Zp(w),r}function w1(r){return r?(r=Ll,r):Ll}function k1(r,s,u,p,x,w){x=w1(x),p.context===null?p.context=x:p.pendingContext=x,p=za(s),p.payload={element:u},w=w===void 0?null:w,w!==null&&(p.callback=w),u=Pa(r,p,s),u!==null&&(oi(u,r,s),Nc(u,r,s))}function E1(r,s){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var u=r.retryLane;r.retryLane=u!==0&&u<s?u:s}}function gg(r,s){E1(r,s),(r=r.alternate)&&E1(r,s)}function S1(r){if(r.tag===13||r.tag===31){var s=Os(r,67108864);s!==null&&oi(s,r,67108864),gg(r,67108864)}}function N1(r){if(r.tag===13||r.tag===31){var s=ki();s=Vt(s);var u=Os(r,s);u!==null&&oi(u,r,s),gg(r,s)}}var ff=!0;function UM(r,s,u,p){var x=P.T;P.T=null;var w=H.p;try{H.p=2,yg(r,s,u,p)}finally{H.p=w,P.T=x}}function FM(r,s,u,p){var x=P.T;P.T=null;var w=H.p;try{H.p=8,yg(r,s,u,p)}finally{H.p=w,P.T=x}}function yg(r,s,u,p){if(ff){var x=bg(p);if(x===null)ig(r,s,p,hf,u),j1(r,p);else if(HM(x,r,s,u,p))p.stopPropagation();else if(j1(r,p),s&4&&-1<qM.indexOf(r)){for(;x!==null;){var w=Xi(x);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var A=Un(w.pendingLanes);if(A!==0){var U=w;for(U.pendingLanes|=2,U.entangledLanes|=2;A;){var W=1<<31-yt(A);U.entanglements[1]|=W,A&=~W}kr(w),(Tt&6)===0&&(Yd=Ne()+500,Uc(0))}}break;case 31:case 13:U=Os(w,2),U!==null&&oi(U,w,2),Wd(),gg(w,2)}if(w=bg(p),w===null&&ig(r,s,p,hf,u),w===x)break;x=w}x!==null&&p.stopPropagation()}else ig(r,s,p,null,u)}}function bg(r){return r=lt(r),xg(r)}var hf=null;function xg(r){if(hf=null,r=Ln(r),r!==null){var s=l(r);if(s===null)r=null;else{var u=s.tag;if(u===13){if(r=o(s),r!==null)return r;r=null}else if(u===31){if(r=d(s),r!==null)return r;r=null}else if(u===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;r=null}else s!==r&&(r=null)}}return hf=r,null}function _1(r){switch(r){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(Ke()){case ne:return 2;case de:return 8;case Le:case Ze:return 32;case rt:return 268435456;default:return 32}default:return 32}}var vg=!1,Qa=null,Wa=null,Xa=null,Yc=new Map,Qc=new Map,Za=[],qM="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 j1(r,s){switch(r){case"focusin":case"focusout":Qa=null;break;case"dragenter":case"dragleave":Wa=null;break;case"mouseover":case"mouseout":Xa=null;break;case"pointerover":case"pointerout":Yc.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qc.delete(s.pointerId)}}function Wc(r,s,u,p,x,w){return r===null||r.nativeEvent!==w?(r={blockedOn:s,domEventName:u,eventSystemFlags:p,nativeEvent:w,targetContainers:[x]},s!==null&&(s=Xi(s),s!==null&&S1(s)),r):(r.eventSystemFlags|=p,s=r.targetContainers,x!==null&&s.indexOf(x)===-1&&s.push(x),r)}function HM(r,s,u,p,x){switch(s){case"focusin":return Qa=Wc(Qa,r,s,u,p,x),!0;case"dragenter":return Wa=Wc(Wa,r,s,u,p,x),!0;case"mouseover":return Xa=Wc(Xa,r,s,u,p,x),!0;case"pointerover":var w=x.pointerId;return Yc.set(w,Wc(Yc.get(w)||null,r,s,u,p,x)),!0;case"gotpointercapture":return w=x.pointerId,Qc.set(w,Wc(Qc.get(w)||null,r,s,u,p,x)),!0}return!1}function C1(r){var s=Ln(r.target);if(s!==null){var u=l(s);if(u!==null){if(s=u.tag,s===13){if(s=o(u),s!==null){r.blockedOn=s,Ea(r.priority,function(){N1(u)});return}}else if(s===31){if(s=d(u),s!==null){r.blockedOn=s,Ea(r.priority,function(){N1(u)});return}}else if(s===3&&u.stateNode.current.memoizedState.isDehydrated){r.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}r.blockedOn=null}function pf(r){if(r.blockedOn!==null)return!1;for(var s=r.targetContainers;0<s.length;){var u=bg(r.nativeEvent);if(u===null){u=r.nativeEvent;var p=new u.constructor(u.type,u);qe=p,u.target.dispatchEvent(p),qe=null}else return s=Xi(u),s!==null&&S1(s),r.blockedOn=u,!1;s.shift()}return!0}function A1(r,s,u){pf(r)&&u.delete(s)}function KM(){vg=!1,Qa!==null&&pf(Qa)&&(Qa=null),Wa!==null&&pf(Wa)&&(Wa=null),Xa!==null&&pf(Xa)&&(Xa=null),Yc.forEach(A1),Qc.forEach(A1)}function mf(r,s){r.blockedOn===s&&(r.blockedOn=null,vg||(vg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,KM)))}var gf=null;function T1(r){gf!==r&&(gf=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){gf===r&&(gf=null);for(var s=0;s<r.length;s+=3){var u=r[s],p=r[s+1],x=r[s+2];if(typeof p!="function"){if(xg(p||u)===null)continue;break}var w=Xi(u);w!==null&&(r.splice(s,3),s-=3,bm(w,{pending:!0,data:x,method:u.method,action:p},p,x))}}))}function ao(r){function s(W){return mf(W,r)}Qa!==null&&mf(Qa,r),Wa!==null&&mf(Wa,r),Xa!==null&&mf(Xa,r),Yc.forEach(s),Qc.forEach(s);for(var u=0;u<Za.length;u++){var p=Za[u];p.blockedOn===r&&(p.blockedOn=null)}for(;0<Za.length&&(u=Za[0],u.blockedOn===null);)C1(u),u.blockedOn===null&&Za.shift();if(u=(r.ownerDocument||r).$$reactFormReplay,u!=null)for(p=0;p<u.length;p+=3){var x=u[p],w=u[p+1],A=x[Tn]||null;if(typeof w=="function")A||T1(u);else if(A){var U=null;if(w&&w.hasAttribute("formAction")){if(x=w,A=w[Tn]||null)U=A.formAction;else if(xg(x)!==null)continue}else U=A.action;typeof U=="function"?u[p+1]=U:(u.splice(p,3),p-=3),T1(u)}}}function M1(){function r(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(A){return x=A})},focusReset:"manual",scroll:"manual"})}function s(){x!==null&&(x(),x=null),p||setTimeout(u,20)}function u(){if(!p&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,x=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(u,100),function(){p=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),x!==null&&(x(),x=null)}}}function wg(r){this._internalRoot=r}yf.prototype.render=wg.prototype.render=function(r){var s=this._internalRoot;if(s===null)throw Error(i(409));var u=s.current,p=ki();k1(u,p,r,s,null,null)},yf.prototype.unmount=wg.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var s=r.containerInfo;k1(r.current,2,null,r,null,null),Wd(),s[Wi]=null}};function yf(r){this._internalRoot=r}yf.prototype.unstable_scheduleHydration=function(r){if(r){var s=ka();r={blockedOn:null,target:r,priority:s};for(var u=0;u<Za.length&&s!==0&&s<Za[u].priority;u++);Za.splice(u,0,r),u===0&&C1(r)}};var D1=t.version;if(D1!=="19.2.5")throw Error(i(527,D1,"19.2.5"));H.findDOMNode=function(r){var s=r._reactInternals;if(s===void 0)throw typeof r.render=="function"?Error(i(188)):(r=Object.keys(r).join(","),Error(i(268,r)));return r=h(s),r=r!==null?g(r):null,r=r===null?null:r.stateNode,r};var GM={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var bf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bf.isDisabled&&bf.supportsFiber)try{dn=bf.inject(GM),Mt=bf}catch{}}return Zc.createRoot=function(r,s){if(!a(r))throw Error(i(299));var u=!1,p="",x=B0,w=$0,A=U0;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(x=s.onUncaughtError),s.onCaughtError!==void 0&&(w=s.onCaughtError),s.onRecoverableError!==void 0&&(A=s.onRecoverableError)),s=v1(r,1,!1,null,null,u,p,null,x,w,A,M1),r[Wi]=s.current,ng(r),new wg(s)},Zc.hydrateRoot=function(r,s,u){if(!a(r))throw Error(i(299));var p=!1,x="",w=B0,A=$0,U=U0,W=null;return u!=null&&(u.unstable_strictMode===!0&&(p=!0),u.identifierPrefix!==void 0&&(x=u.identifierPrefix),u.onUncaughtError!==void 0&&(w=u.onUncaughtError),u.onCaughtError!==void 0&&(A=u.onCaughtError),u.onRecoverableError!==void 0&&(U=u.onRecoverableError),u.formState!==void 0&&(W=u.formState)),s=v1(r,1,!0,s,u??null,p,x,W,w,A,U,M1),s.context=w1(null),u=s.current,p=ki(),p=Vt(p),x=za(p),x.callback=null,Pa(u,x,p),u=p,s.current.lanes=u,Ot(s,u),kr(s),r[Wi]=s.current,ng(r),new yf(s)},Zc.version="19.2.5",Zc}var H1;function rD(){if(H1)return Ng.exports;H1=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(),Ng.exports=iD(),Ng.exports}var aD=rD(),Yo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},el,cs,jo,ZS,sD=(ZS=class extends Yo{constructor(){super();Qe(this,el);Qe(this,cs);Qe(this,jo);Ie(this,jo,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){X(this,cs)||this.setEventListener(X(this,jo))}onUnsubscribe(){var t;this.hasListeners()||((t=X(this,cs))==null||t.call(this),Ie(this,cs,void 0))}setEventListener(t){var n;Ie(this,jo,t),(n=X(this,cs))==null||n.call(this),Ie(this,cs,t(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(t){X(this,el)!==t&&(Ie(this,el,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof X(this,el)=="boolean"?X(this,el):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},el=new WeakMap,cs=new WeakMap,jo=new WeakMap,ZS),Nb=new sD,lD={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},us,Sb,JS,oD=(JS=class{constructor(){Qe(this,us,lD);Qe(this,Sb,!1)}setTimeoutProvider(e){Ie(this,us,e)}setTimeout(e,t){return X(this,us).setTimeout(e,t)}clearTimeout(e){X(this,us).clearTimeout(e)}setInterval(e,t){return X(this,us).setInterval(e,t)}clearInterval(e){X(this,us).clearInterval(e)}},us=new WeakMap,Sb=new WeakMap,JS),Qs=new oD;function cD(e){setTimeout(e,0)}var uD=typeof window>"u"||"Deno"in globalThis;function ei(){}function dD(e,t){return typeof e=="function"?e(t):e}function Sy(e){return typeof e=="number"&&e>=0&&e!==1/0}function uN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function bs(e,t){return typeof e=="function"?e(t):e}function qi(e,t){return typeof e=="function"?e(t):e}function K1(e,t){const{type:n="all",exact:i,fetchStatus:a,predicate:l,queryKey:o,stale:d}=e;if(o){if(i){if(t.queryHash!==_b(o,t.options))return!1}else if(!xu(t.queryKey,o))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof d=="boolean"&&t.isStale()!==d||a&&a!==t.state.fetchStatus||l&&!l(t))}function G1(e,t){const{exact:n,status:i,predicate:a,mutationKey:l}=e;if(l){if(!t.options.mutationKey)return!1;if(n){if(dl(t.options.mutationKey)!==dl(l))return!1}else if(!xu(t.options.mutationKey,l))return!1}return!(i&&t.state.status!==i||a&&!a(t))}function _b(e,t){return((t==null?void 0:t.queryKeyHashFn)||dl)(e)}function dl(e){return JSON.stringify(e,(t,n)=>Ny(n)?Object.keys(n).sort().reduce((i,a)=>(i[a]=n[a],i),{}):n)}function xu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>xu(e[n],t[n])):!1}var fD=Object.prototype.hasOwnProperty;function dN(e,t,n=0){if(e===t)return e;if(n>500)return t;const i=V1(e)&&V1(t);if(!i&&!(Ny(e)&&Ny(t)))return t;const l=(i?e:Object.keys(e)).length,o=i?t:Object.keys(t),d=o.length,f=i?new Array(d):{};let h=0;for(let g=0;g<d;g++){const m=i?g:o[g],y=e[m],b=t[m];if(y===b){f[m]=y,(i?g<l:fD.call(e,m))&&h++;continue}if(y===null||b===null||typeof y!="object"||typeof b!="object"){f[m]=b;continue}const k=dN(y,b,n+1);f[m]=k,k===y&&h++}return l===d&&h===l?e:f}function oh(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function V1(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ny(e){if(!Y1(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Y1(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Y1(e){return Object.prototype.toString.call(e)==="[object Object]"}function hD(e){return new Promise(t=>{Qs.setTimeout(t,e)})}function _y(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?dN(e,t):t}function pD(e,t,n=0){const i=[...e,t];return n&&i.length>n?i.slice(1):i}function mD(e,t,n=0){const i=[t,...e];return n&&i.length>n?i.slice(0,-1):i}var jb=Symbol();function fN(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===jb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Cb(e,t){return typeof e=="function"?e(...t):!!e}function gD(e,t,n){let i=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??(a=t()),i||(i=!0,a.aborted?n():a.addEventListener("abort",n,{once:!0})),a)}),e}var vu=(()=>{let e=()=>uD;return{isServer(){return e()},setIsServer(t){e=t}}})();function jy(){let e,t;const n=new Promise((a,l)=>{e=a,t=l});n.status="pending",n.catch(()=>{});function i(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{i({status:"fulfilled",value:a}),e(a)},n.reject=a=>{i({status:"rejected",reason:a}),t(a)},n}var yD=cD;function bD(){let e=[],t=0,n=d=>{d()},i=d=>{d()},a=yD;const l=d=>{t?e.push(d):a(()=>{n(d)})},o=()=>{const d=e;e=[],d.length&&a(()=>{i(()=>{d.forEach(f=>{n(f)})})})};return{batch:d=>{let f;t++;try{f=d()}finally{t--,t||o()}return f},batchCalls:d=>(...f)=>{l(()=>{d(...f)})},schedule:l,setNotifyFunction:d=>{n=d},setBatchNotifyFunction:d=>{i=d},setScheduler:d=>{a=d}}}var An=bD(),Co,ds,Ao,eN,xD=(eN=class extends Yo{constructor(){super();Qe(this,Co,!0);Qe(this,ds);Qe(this,Ao);Ie(this,Ao,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),i=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",i)}}})}onSubscribe(){X(this,ds)||this.setEventListener(X(this,Ao))}onUnsubscribe(){var t;this.hasListeners()||((t=X(this,ds))==null||t.call(this),Ie(this,ds,void 0))}setEventListener(t){var n;Ie(this,Ao,t),(n=X(this,ds))==null||n.call(this),Ie(this,ds,t(this.setOnline.bind(this)))}setOnline(t){X(this,Co)!==t&&(Ie(this,Co,t),this.listeners.forEach(i=>{i(t)}))}isOnline(){return X(this,Co)}},Co=new WeakMap,ds=new WeakMap,Ao=new WeakMap,eN),ch=new xD;function vD(e){return Math.min(1e3*2**e,3e4)}function hN(e){return(e??"online")==="online"?ch.isOnline():!0}var Cy=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function pN(e){let t=!1,n=0,i;const a=jy(),l=()=>a.status!=="pending",o=v=>{var N;if(!l()){const E=new Cy(v);y(E),(N=e.onCancel)==null||N.call(e,E)}},d=()=>{t=!0},f=()=>{t=!1},h=()=>Nb.isFocused()&&(e.networkMode==="always"||ch.isOnline())&&e.canRun(),g=()=>hN(e.networkMode)&&e.canRun(),m=v=>{l()||(i==null||i(),a.resolve(v))},y=v=>{l()||(i==null||i(),a.reject(v))},b=()=>new Promise(v=>{var N;i=E=>{(l()||h())&&v(E)},(N=e.onPause)==null||N.call(e)}).then(()=>{var v;i=void 0,l()||(v=e.onContinue)==null||v.call(e)}),k=()=>{if(l())return;let v;const N=n===0?e.initialPromise:void 0;try{v=N??e.fn()}catch(E){v=Promise.reject(E)}Promise.resolve(v).then(m).catch(E=>{var T;if(l())return;const C=e.retry??(vu.isServer()?0:3),S=e.retryDelay??vD,_=typeof S=="function"?S(n,E):S,M=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,E);if(t||!M){y(E);return}n++,(T=e.onFail)==null||T.call(e,n,E),hD(_).then(()=>h()?void 0:b()).then(()=>{t?y(E):k()})})};return{promise:a,status:()=>a.status,cancel:o,continue:()=>(i==null||i(),a),cancelRetry:d,continueRetry:f,canStart:g,start:()=>(g()?k():b().then(k),a)}}var tl,tN,mN=(tN=class{constructor(){Qe(this,tl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Sy(this.gcTime)&&Ie(this,tl,Qs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(vu.isServer()?1/0:300*1e3))}clearGcTimeout(){X(this,tl)!==void 0&&(Qs.clearTimeout(X(this,tl)),Ie(this,tl,void 0))}},tl=new WeakMap,tN),nl,To,Fi,il,On,Pu,rl,Si,gN,sa,nN,wD=(nN=class extends mN{constructor(t){super();Qe(this,Si);Qe(this,nl);Qe(this,To);Qe(this,Fi);Qe(this,il);Qe(this,On);Qe(this,Pu);Qe(this,rl);Ie(this,rl,!1),Ie(this,Pu,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ie(this,il,t.client),Ie(this,Fi,X(this,il).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ie(this,nl,W1(this.options)),this.state=t.state??X(this,nl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=X(this,On))==null?void 0:t.promise}setOptions(t){if(this.options={...X(this,Pu),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=W1(this.options);n.data!==void 0&&(this.setState(Q1(n.data,n.dataUpdatedAt)),Ie(this,nl,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&X(this,Fi).remove(this)}setData(t,n){const i=_y(this.state.data,t,this.options);return ut(this,Si,sa).call(this,{data:i,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),i}setState(t,n){ut(this,Si,sa).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var i,a;const n=(i=X(this,On))==null?void 0:i.promise;return(a=X(this,On))==null||a.cancel(t),n?n.then(ei).catch(ei):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return X(this,nl)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>qi(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===jb||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>bs(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!uN(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(i=>i.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=X(this,On))==null||n.continue()}onOnline(){var n;const t=this.observers.find(i=>i.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=X(this,On))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),X(this,Fi).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(X(this,On)&&(X(this,rl)||ut(this,Si,gN).call(this)?X(this,On).cancel({revert:!0}):X(this,On).cancelRetry()),this.scheduleGc()),X(this,Fi).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ut(this,Si,sa).call(this,{type:"invalidate"})}async fetch(t,n){var f,h,g,m,y,b,k,v,N,E,C,S;if(this.state.fetchStatus!=="idle"&&((f=X(this,On))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(X(this,On))return X(this,On).continueRetry(),X(this,On).promise}if(t&&this.setOptions(t),!this.options.queryFn){const _=this.observers.find(M=>M.options.queryFn);_&&this.setOptions(_.options)}const i=new AbortController,a=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(Ie(this,rl,!0),i.signal)})},l=()=>{const _=fN(this.options,n),T=(()=>{const R={client:X(this,il),queryKey:this.queryKey,meta:this.meta};return a(R),R})();return Ie(this,rl,!1),this.options.persister?this.options.persister(_,T,this):_(T)},d=(()=>{const _={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:X(this,il),state:this.state,fetchFn:l};return a(_),_})();(h=this.options.behavior)==null||h.onFetch(d,this),Ie(this,To,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=d.fetchOptions)==null?void 0:g.meta))&&ut(this,Si,sa).call(this,{type:"fetch",meta:(m=d.fetchOptions)==null?void 0:m.meta}),Ie(this,On,pN({initialPromise:n==null?void 0:n.initialPromise,fn:d.fetchFn,onCancel:_=>{_ instanceof Cy&&_.revert&&this.setState({...X(this,To),fetchStatus:"idle"}),i.abort()},onFail:(_,M)=>{ut(this,Si,sa).call(this,{type:"failed",failureCount:_,error:M})},onPause:()=>{ut(this,Si,sa).call(this,{type:"pause"})},onContinue:()=>{ut(this,Si,sa).call(this,{type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0}));try{const _=await X(this,On).start();if(_===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(_),(b=(y=X(this,Fi).config).onSuccess)==null||b.call(y,_,this),(v=(k=X(this,Fi).config).onSettled)==null||v.call(k,_,this.state.error,this),_}catch(_){if(_ instanceof Cy){if(_.silent)return X(this,On).promise;if(_.revert){if(this.state.data===void 0)throw _;return this.state.data}}throw ut(this,Si,sa).call(this,{type:"error",error:_}),(E=(N=X(this,Fi).config).onError)==null||E.call(N,_,this),(S=(C=X(this,Fi).config).onSettled)==null||S.call(C,this.state.data,_,this),_}finally{this.scheduleGc()}}},nl=new WeakMap,To=new WeakMap,Fi=new WeakMap,il=new WeakMap,On=new WeakMap,Pu=new WeakMap,rl=new WeakMap,Si=new WeakSet,gN=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},sa=function(t){const n=i=>{switch(t.type){case"failed":return{...i,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...yN(i.data,this.options),fetchMeta:t.meta??null};case"success":const a={...i,...Q1(t.data,t.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ie(this,To,t.manual?a:void 0),a;case"error":const l=t.error;return{...i,error:l,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:l,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...t.state}}};this.state=n(this.state),An.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),X(this,Fi).notify({query:this,type:"updated",action:t})})},nN);function yN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:hN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Q1(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function W1(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,i=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var ui,kt,Bu,Zn,al,Mo,la,fs,$u,Do,Oo,sl,ll,hs,Ro,Dt,ou,Ay,Ty,My,Dy,Oy,Ry,Ly,bN,iN,kD=(iN=class extends Yo{constructor(t,n){super();Qe(this,Dt);Qe(this,ui);Qe(this,kt);Qe(this,Bu);Qe(this,Zn);Qe(this,al);Qe(this,Mo);Qe(this,la);Qe(this,fs);Qe(this,$u);Qe(this,Do);Qe(this,Oo);Qe(this,sl);Qe(this,ll);Qe(this,hs);Qe(this,Ro,new Set);this.options=n,Ie(this,ui,t),Ie(this,fs,null),Ie(this,la,jy()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(X(this,kt).addObserver(this),X1(X(this,kt),this.options)?ut(this,Dt,ou).call(this):this.updateResult(),ut(this,Dt,Dy).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Iy(X(this,kt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Iy(X(this,kt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ut(this,Dt,Oy).call(this),ut(this,Dt,Ry).call(this),X(this,kt).removeObserver(this)}setOptions(t){const n=this.options,i=X(this,kt);if(this.options=X(this,ui).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof qi(this.options.enabled,X(this,kt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ut(this,Dt,Ly).call(this),X(this,kt).setOptions(this.options),n._defaulted&&!oh(this.options,n)&&X(this,ui).getQueryCache().notify({type:"observerOptionsUpdated",query:X(this,kt),observer:this});const a=this.hasListeners();a&&Z1(X(this,kt),i,this.options,n)&&ut(this,Dt,ou).call(this),this.updateResult(),a&&(X(this,kt)!==i||qi(this.options.enabled,X(this,kt))!==qi(n.enabled,X(this,kt))||bs(this.options.staleTime,X(this,kt))!==bs(n.staleTime,X(this,kt)))&&ut(this,Dt,Ay).call(this);const l=ut(this,Dt,Ty).call(this);a&&(X(this,kt)!==i||qi(this.options.enabled,X(this,kt))!==qi(n.enabled,X(this,kt))||l!==X(this,hs))&&ut(this,Dt,My).call(this,l)}getOptimisticResult(t){const n=X(this,ui).getQueryCache().build(X(this,ui),t),i=this.createResult(n,t);return SD(this,i)&&(Ie(this,Zn,i),Ie(this,Mo,this.options),Ie(this,al,X(this,kt).state)),i}getCurrentResult(){return X(this,Zn)}trackResult(t,n){return new Proxy(t,{get:(i,a)=>(this.trackProp(a),n==null||n(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&X(this,la).status==="pending"&&X(this,la).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,a))})}trackProp(t){X(this,Ro).add(t)}getCurrentQuery(){return X(this,kt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=X(this,ui).defaultQueryOptions(t),i=X(this,ui).getQueryCache().build(X(this,ui),n);return i.fetch().then(()=>this.createResult(i,n))}fetch(t){return ut(this,Dt,ou).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),X(this,Zn)))}createResult(t,n){var $;const i=X(this,kt),a=this.options,l=X(this,Zn),o=X(this,al),d=X(this,Mo),h=t!==i?t.state:X(this,Bu),{state:g}=t;let m={...g},y=!1,b;if(n._optimisticResults){const I=this.hasListeners(),q=!I&&X1(t,n),F=I&&Z1(t,i,n,a);(q||F)&&(m={...m,...yN(g.data,t.options)}),n._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:k,errorUpdatedAt:v,status:N}=m;b=m.data;let E=!1;if(n.placeholderData!==void 0&&b===void 0&&N==="pending"){let I;l!=null&&l.isPlaceholderData&&n.placeholderData===(d==null?void 0:d.placeholderData)?(I=l.data,E=!0):I=typeof n.placeholderData=="function"?n.placeholderData(($=X(this,Oo))==null?void 0:$.state.data,X(this,Oo)):n.placeholderData,I!==void 0&&(N="success",b=_y(l==null?void 0:l.data,I,n),y=!0)}if(n.select&&b!==void 0&&!E)if(l&&b===(o==null?void 0:o.data)&&n.select===X(this,$u))b=X(this,Do);else try{Ie(this,$u,n.select),b=n.select(b),b=_y(l==null?void 0:l.data,b,n),Ie(this,Do,b),Ie(this,fs,null)}catch(I){Ie(this,fs,I)}X(this,fs)&&(k=X(this,fs),b=X(this,Do),v=Date.now(),N="error");const C=m.fetchStatus==="fetching",S=N==="pending",_=N==="error",M=S&&C,T=b!==void 0,O={status:N,fetchStatus:m.fetchStatus,isPending:S,isSuccess:N==="success",isError:_,isInitialLoading:M,isLoading:M,data:b,dataUpdatedAt:m.dataUpdatedAt,error:k,errorUpdatedAt:v,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:m.dataUpdateCount>h.dataUpdateCount||m.errorUpdateCount>h.errorUpdateCount,isFetching:C,isRefetching:C&&!S,isLoadingError:_&&!T,isPaused:m.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:_&&T,isStale:Ab(t,n),refetch:this.refetch,promise:X(this,la),isEnabled:qi(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const I=O.data!==void 0,q=O.status==="error"&&!I,F=K=>{q?K.reject(O.error):I&&K.resolve(O.data)},Y=()=>{const K=Ie(this,la,O.promise=jy());F(K)},D=X(this,la);switch(D.status){case"pending":t.queryHash===i.queryHash&&F(D);break;case"fulfilled":(q||O.data!==D.value)&&Y();break;case"rejected":(!q||O.error!==D.reason)&&Y();break}}return O}updateResult(){const t=X(this,Zn),n=this.createResult(X(this,kt),this.options);if(Ie(this,al,X(this,kt).state),Ie(this,Mo,this.options),X(this,al).data!==void 0&&Ie(this,Oo,X(this,kt)),oh(n,t))return;Ie(this,Zn,n);const i=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,l=typeof a=="function"?a():a;if(l==="all"||!l&&!X(this,Ro).size)return!0;const o=new Set(l??X(this,Ro));return this.options.throwOnError&&o.add("error"),Object.keys(X(this,Zn)).some(d=>{const f=d;return X(this,Zn)[f]!==t[f]&&o.has(f)})};ut(this,Dt,bN).call(this,{listeners:i()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ut(this,Dt,Dy).call(this)}},ui=new WeakMap,kt=new WeakMap,Bu=new WeakMap,Zn=new WeakMap,al=new WeakMap,Mo=new WeakMap,la=new WeakMap,fs=new WeakMap,$u=new WeakMap,Do=new WeakMap,Oo=new WeakMap,sl=new WeakMap,ll=new WeakMap,hs=new WeakMap,Ro=new WeakMap,Dt=new WeakSet,ou=function(t){ut(this,Dt,Ly).call(this);let n=X(this,kt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(ei)),n},Ay=function(){ut(this,Dt,Oy).call(this);const t=bs(this.options.staleTime,X(this,kt));if(vu.isServer()||X(this,Zn).isStale||!Sy(t))return;const i=uN(X(this,Zn).dataUpdatedAt,t)+1;Ie(this,sl,Qs.setTimeout(()=>{X(this,Zn).isStale||this.updateResult()},i))},Ty=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(X(this,kt)):this.options.refetchInterval)??!1},My=function(t){ut(this,Dt,Ry).call(this),Ie(this,hs,t),!(vu.isServer()||qi(this.options.enabled,X(this,kt))===!1||!Sy(X(this,hs))||X(this,hs)===0)&&Ie(this,ll,Qs.setInterval(()=>{(this.options.refetchIntervalInBackground||Nb.isFocused())&&ut(this,Dt,ou).call(this)},X(this,hs)))},Dy=function(){ut(this,Dt,Ay).call(this),ut(this,Dt,My).call(this,ut(this,Dt,Ty).call(this))},Oy=function(){X(this,sl)!==void 0&&(Qs.clearTimeout(X(this,sl)),Ie(this,sl,void 0))},Ry=function(){X(this,ll)!==void 0&&(Qs.clearInterval(X(this,ll)),Ie(this,ll,void 0))},Ly=function(){const t=X(this,ui).getQueryCache().build(X(this,ui),this.options);if(t===X(this,kt))return;const n=X(this,kt);Ie(this,kt,t),Ie(this,Bu,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},bN=function(t){An.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(X(this,Zn))}),X(this,ui).getQueryCache().notify({query:X(this,kt),type:"observerResultsUpdated"})})},iN);function ED(e,t){return qi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function X1(e,t){return ED(e,t)||e.state.data!==void 0&&Iy(e,t,t.refetchOnMount)}function Iy(e,t,n){if(qi(t.enabled,e)!==!1&&bs(t.staleTime,e)!=="static"){const i=typeof n=="function"?n(e):n;return i==="always"||i!==!1&&Ab(e,t)}return!1}function Z1(e,t,n,i){return(e!==t||qi(i.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Ab(e,n)}function Ab(e,t){return qi(t.enabled,e)!==!1&&e.isStaleByTime(bs(t.staleTime,e))}function SD(e,t){return!oh(e.getCurrentResult(),t)}function J1(e){return{onFetch:(t,n)=>{var g,m,y,b,k;const i=t.options,a=(y=(m=(g=t.fetchOptions)==null?void 0:g.meta)==null?void 0:m.fetchMore)==null?void 0:y.direction,l=((b=t.state.data)==null?void 0:b.pages)||[],o=((k=t.state.data)==null?void 0:k.pageParams)||[];let d={pages:[],pageParams:[]},f=0;const h=async()=>{let v=!1;const N=S=>{gD(S,()=>t.signal,()=>v=!0)},E=fN(t.options,t.fetchOptions),C=async(S,_,M)=>{if(v)return Promise.reject();if(_==null&&S.pages.length)return Promise.resolve(S);const R=(()=>{const q={client:t.client,queryKey:t.queryKey,pageParam:_,direction:M?"backward":"forward",meta:t.options.meta};return N(q),q})(),O=await E(R),{maxPages:$}=t.options,I=M?mD:pD;return{pages:I(S.pages,O,$),pageParams:I(S.pageParams,_,$)}};if(a&&l.length){const S=a==="backward",_=S?ND:ek,M={pages:l,pageParams:o},T=_(i,M);d=await C(M,T,S)}else{const S=e??l.length;do{const _=f===0?o[0]??i.initialPageParam:ek(i,d);if(f>0&&_==null)break;d=await C(d,_),f++}while(f<S)}return d};t.options.persister?t.fetchFn=()=>{var v,N;return(N=(v=t.options).persister)==null?void 0:N.call(v,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=h}}}function ek(e,{pages:t,pageParams:n}){const i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,n[i],n):void 0}function ND(e,{pages:t,pageParams:n}){var i;return t.length>0?(i=e.getPreviousPageParam)==null?void 0:i.call(e,t[0],t,n[0],n):void 0}var Uu,_r,Kn,ol,jr,ss,rN,_D=(rN=class extends mN{constructor(t){super();Qe(this,jr);Qe(this,Uu);Qe(this,_r);Qe(this,Kn);Qe(this,ol);Ie(this,Uu,t.client),this.mutationId=t.mutationId,Ie(this,Kn,t.mutationCache),Ie(this,_r,[]),this.state=t.state||xN(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){X(this,_r).includes(t)||(X(this,_r).push(t),this.clearGcTimeout(),X(this,Kn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ie(this,_r,X(this,_r).filter(n=>n!==t)),this.scheduleGc(),X(this,Kn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){X(this,_r).length||(this.state.status==="pending"?this.scheduleGc():X(this,Kn).remove(this))}continue(){var t;return((t=X(this,ol))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,d,f,h,g,m,y,b,k,v,N,E,C,S,_,M,T,R;const n=()=>{ut(this,jr,ss).call(this,{type:"continue"})},i={client:X(this,Uu),meta:this.options.meta,mutationKey:this.options.mutationKey};Ie(this,ol,pN({fn:()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(new Error("No mutationFn found")),onFail:(O,$)=>{ut(this,jr,ss).call(this,{type:"failed",failureCount:O,error:$})},onPause:()=>{ut(this,jr,ss).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>X(this,Kn).canRun(this)}));const a=this.state.status==="pending",l=!X(this,ol).canStart();try{if(a)n();else{ut(this,jr,ss).call(this,{type:"pending",variables:t,isPaused:l}),X(this,Kn).config.onMutate&&await X(this,Kn).config.onMutate(t,this,i);const $=await((d=(o=this.options).onMutate)==null?void 0:d.call(o,t,i));$!==this.state.context&&ut(this,jr,ss).call(this,{type:"pending",context:$,variables:t,isPaused:l})}const O=await X(this,ol).start();return await((h=(f=X(this,Kn).config).onSuccess)==null?void 0:h.call(f,O,t,this.state.context,this,i)),await((m=(g=this.options).onSuccess)==null?void 0:m.call(g,O,t,this.state.context,i)),await((b=(y=X(this,Kn).config).onSettled)==null?void 0:b.call(y,O,null,this.state.variables,this.state.context,this,i)),await((v=(k=this.options).onSettled)==null?void 0:v.call(k,O,null,t,this.state.context,i)),ut(this,jr,ss).call(this,{type:"success",data:O}),O}catch(O){try{await((E=(N=X(this,Kn).config).onError)==null?void 0:E.call(N,O,t,this.state.context,this,i))}catch($){Promise.reject($)}try{await((S=(C=this.options).onError)==null?void 0:S.call(C,O,t,this.state.context,i))}catch($){Promise.reject($)}try{await((M=(_=X(this,Kn).config).onSettled)==null?void 0:M.call(_,void 0,O,this.state.variables,this.state.context,this,i))}catch($){Promise.reject($)}try{await((R=(T=this.options).onSettled)==null?void 0:R.call(T,void 0,O,t,this.state.context,i))}catch($){Promise.reject($)}throw ut(this,jr,ss).call(this,{type:"error",error:O}),O}finally{X(this,Kn).runNext(this)}}},Uu=new WeakMap,_r=new WeakMap,Kn=new WeakMap,ol=new WeakMap,jr=new WeakSet,ss=function(t){const n=i=>{switch(t.type){case"failed":return{...i,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...i,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:t.error,failureCount:i.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),An.batch(()=>{X(this,_r).forEach(i=>{i.onMutationUpdate(t)}),X(this,Kn).notify({mutation:this,type:"updated",action:t})})},rN);function xN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var oa,ar,Fu,aN,jD=(aN=class extends Yo{constructor(t={}){super();Qe(this,oa);Qe(this,ar);Qe(this,Fu);this.config=t,Ie(this,oa,new Set),Ie(this,ar,new Map),Ie(this,Fu,0)}build(t,n,i){const a=new _D({client:t,mutationCache:this,mutationId:++xf(this,Fu)._,options:t.defaultMutationOptions(n),state:i});return this.add(a),a}add(t){X(this,oa).add(t);const n=vf(t);if(typeof n=="string"){const i=X(this,ar).get(n);i?i.push(t):X(this,ar).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(X(this,oa).delete(t)){const n=vf(t);if(typeof n=="string"){const i=X(this,ar).get(n);if(i)if(i.length>1){const a=i.indexOf(t);a!==-1&&i.splice(a,1)}else i[0]===t&&X(this,ar).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=vf(t);if(typeof n=="string"){const i=X(this,ar).get(n),a=i==null?void 0:i.find(l=>l.state.status==="pending");return!a||a===t}else return!0}runNext(t){var i;const n=vf(t);if(typeof n=="string"){const a=(i=X(this,ar).get(n))==null?void 0:i.find(l=>l!==t&&l.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){An.batch(()=>{X(this,oa).forEach(t=>{this.notify({type:"removed",mutation:t})}),X(this,oa).clear(),X(this,ar).clear()})}getAll(){return Array.from(X(this,oa))}find(t){const n={exact:!0,...t};return this.getAll().find(i=>G1(n,i))}findAll(t={}){return this.getAll().filter(n=>G1(t,n))}notify(t){An.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return An.batch(()=>Promise.all(t.map(n=>n.continue().catch(ei))))}},oa=new WeakMap,ar=new WeakMap,Fu=new WeakMap,aN);function vf(e){var t;return(t=e.options.scope)==null?void 0:t.id}var ca,ps,di,ua,ma,Qf,zy,sN,CD=(sN=class extends Yo{constructor(n,i){super();Qe(this,ma);Qe(this,ca);Qe(this,ps);Qe(this,di);Qe(this,ua);Ie(this,ca,n),this.setOptions(i),this.bindMethods(),ut(this,ma,Qf).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var a;const i=this.options;this.options=X(this,ca).defaultMutationOptions(n),oh(this.options,i)||X(this,ca).getMutationCache().notify({type:"observerOptionsUpdated",mutation:X(this,di),observer:this}),i!=null&&i.mutationKey&&this.options.mutationKey&&dl(i.mutationKey)!==dl(this.options.mutationKey)?this.reset():((a=X(this,di))==null?void 0:a.state.status)==="pending"&&X(this,di).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=X(this,di))==null||n.removeObserver(this)}onMutationUpdate(n){ut(this,ma,Qf).call(this),ut(this,ma,zy).call(this,n)}getCurrentResult(){return X(this,ps)}reset(){var n;(n=X(this,di))==null||n.removeObserver(this),Ie(this,di,void 0),ut(this,ma,Qf).call(this),ut(this,ma,zy).call(this)}mutate(n,i){var a;return Ie(this,ua,i),(a=X(this,di))==null||a.removeObserver(this),Ie(this,di,X(this,ca).getMutationCache().build(X(this,ca),this.options)),X(this,di).addObserver(this),X(this,di).execute(n)}},ca=new WeakMap,ps=new WeakMap,di=new WeakMap,ua=new WeakMap,ma=new WeakSet,Qf=function(){var i;const n=((i=X(this,di))==null?void 0:i.state)??xN();Ie(this,ps,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},zy=function(n){An.batch(()=>{var i,a,l,o,d,f,h,g;if(X(this,ua)&&this.hasListeners()){const m=X(this,ps).variables,y=X(this,ps).context,b={client:X(this,ca),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(a=(i=X(this,ua)).onSuccess)==null||a.call(i,n.data,m,y,b)}catch(k){Promise.reject(k)}try{(o=(l=X(this,ua)).onSettled)==null||o.call(l,n.data,null,m,y,b)}catch(k){Promise.reject(k)}}else if((n==null?void 0:n.type)==="error"){try{(f=(d=X(this,ua)).onError)==null||f.call(d,n.error,m,y,b)}catch(k){Promise.reject(k)}try{(g=(h=X(this,ua)).onSettled)==null||g.call(h,void 0,n.error,m,y,b)}catch(k){Promise.reject(k)}}}this.listeners.forEach(m=>{m(X(this,ps))})})},sN),Cr,lN,AD=(lN=class extends Yo{constructor(t={}){super();Qe(this,Cr);this.config=t,Ie(this,Cr,new Map)}build(t,n,i){const a=n.queryKey,l=n.queryHash??_b(a,n);let o=this.get(l);return o||(o=new wD({client:t,queryKey:a,queryHash:l,options:t.defaultQueryOptions(n),state:i,defaultOptions:t.getQueryDefaults(a)}),this.add(o)),o}add(t){X(this,Cr).has(t.queryHash)||(X(this,Cr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=X(this,Cr).get(t.queryHash);n&&(t.destroy(),n===t&&X(this,Cr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){An.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return X(this,Cr).get(t)}getAll(){return[...X(this,Cr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(i=>K1(n,i))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(i=>K1(t,i)):n}notify(t){An.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){An.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){An.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Cr=new WeakMap,lN),mn,ms,gs,Lo,Io,ys,zo,Po,oN,TD=(oN=class{constructor(e={}){Qe(this,mn);Qe(this,ms);Qe(this,gs);Qe(this,Lo);Qe(this,Io);Qe(this,ys);Qe(this,zo);Qe(this,Po);Ie(this,mn,e.queryCache||new AD),Ie(this,ms,e.mutationCache||new jD),Ie(this,gs,e.defaultOptions||{}),Ie(this,Lo,new Map),Ie(this,Io,new Map),Ie(this,ys,0)}mount(){xf(this,ys)._++,X(this,ys)===1&&(Ie(this,zo,Nb.subscribe(async e=>{e&&(await this.resumePausedMutations(),X(this,mn).onFocus())})),Ie(this,Po,ch.subscribe(async e=>{e&&(await this.resumePausedMutations(),X(this,mn).onOnline())})))}unmount(){var e,t;xf(this,ys)._--,X(this,ys)===0&&((e=X(this,zo))==null||e.call(this),Ie(this,zo,void 0),(t=X(this,Po))==null||t.call(this),Ie(this,Po,void 0))}isFetching(e){return X(this,mn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return X(this,ms).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=X(this,mn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=X(this,mn).build(this,t),i=n.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(bs(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return X(this,mn).findAll(e).map(({queryKey:t,state:n})=>{const i=n.data;return[t,i]})}setQueryData(e,t,n){const i=this.defaultQueryOptions({queryKey:e}),a=X(this,mn).get(i.queryHash),l=a==null?void 0:a.state.data,o=dD(t,l);if(o!==void 0)return X(this,mn).build(this,i).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return An.batch(()=>X(this,mn).findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=X(this,mn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=X(this,mn);An.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=X(this,mn);return An.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},i=An.batch(()=>X(this,mn).findAll(e).map(a=>a.cancel(n)));return Promise.all(i).then(ei).catch(ei)}invalidateQueries(e,t={}){return An.batch(()=>(X(this,mn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},i=An.batch(()=>X(this,mn).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let l=a.fetch(void 0,n);return n.throwOnError||(l=l.catch(ei)),a.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(i).then(ei)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=X(this,mn).build(this,t);return n.isStaleByTime(bs(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ei).catch(ei)}fetchInfiniteQuery(e){return e.behavior=J1(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ei).catch(ei)}ensureInfiniteQueryData(e){return e.behavior=J1(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ch.isOnline()?X(this,ms).resumePausedMutations():Promise.resolve()}getQueryCache(){return X(this,mn)}getMutationCache(){return X(this,ms)}getDefaultOptions(){return X(this,gs)}setDefaultOptions(e){Ie(this,gs,e)}setQueryDefaults(e,t){X(this,Lo).set(dl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...X(this,Lo).values()],n={};return t.forEach(i=>{xu(e,i.queryKey)&&Object.assign(n,i.defaultOptions)}),n}setMutationDefaults(e,t){X(this,Io).set(dl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...X(this,Io).values()],n={};return t.forEach(i=>{xu(e,i.mutationKey)&&Object.assign(n,i.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...X(this,gs).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=_b(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===jb&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...X(this,gs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){X(this,mn).clear(),X(this,ms).clear()}},mn=new WeakMap,ms=new WeakMap,gs=new WeakMap,Lo=new WeakMap,Io=new WeakMap,ys=new WeakMap,zo=new WeakMap,Po=new WeakMap,oN),vN=j.createContext(void 0),Gt=e=>{const t=j.useContext(vN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},MD=({client:e,children:t})=>(j.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(vN.Provider,{value:e,children:t})),wN=j.createContext(!1),DD=()=>j.useContext(wN);wN.Provider;function OD(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var RD=j.createContext(OD()),LD=()=>j.useContext(RD),ID=(e,t,n)=>{const i=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Cb(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||i)&&(t.isReset()||(e.retryOnMount=!1))},zD=e=>{j.useEffect(()=>{e.clearReset()},[e])},PD=({result:e,errorResetBoundary:t,throwOnError:n,query:i,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(a&&e.data===void 0||Cb(n,[e.error,i])),BD=e=>{if(e.suspense){const n=a=>a==="static"?a:Math.max(a??1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...a)=>n(i(...a)):n(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},$D=(e,t)=>e.isLoading&&e.isFetching&&!t,UD=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,tk=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function FD(e,t,n){var y,b,k,v;const i=DD(),a=LD(),l=Gt(),o=l.defaultQueryOptions(e);(b=(y=l.getDefaultOptions().queries)==null?void 0:y._experimental_beforeQuery)==null||b.call(y,o);const d=l.getQueryCache().get(o.queryHash);o._optimisticResults=i?"isRestoring":"optimistic",BD(o),ID(o,a,d),zD(a);const f=!l.getQueryCache().get(o.queryHash),[h]=j.useState(()=>new t(l,o)),g=h.getOptimisticResult(o),m=!i&&e.subscribed!==!1;if(j.useSyncExternalStore(j.useCallback(N=>{const E=m?h.subscribe(An.batchCalls(N)):ei;return h.updateResult(),E},[h,m]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),j.useEffect(()=>{h.setOptions(o)},[o,h]),UD(o,g))throw tk(o,h,a);if(PD({result:g,errorResetBoundary:a,throwOnError:o.throwOnError,query:d,suspense:o.suspense}))throw g.error;if((v=(k=l.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||v.call(k,o,g),o.experimental_prefetchInRender&&!vu.isServer()&&$D(g,i)){const N=f?tk(o,h,a):d==null?void 0:d.promise;N==null||N.catch(ei).finally(()=>{h.updateResult()})}return o.notifyOnChangeProps?g:h.trackResult(g)}function Ye(e,t){return FD(e,kD)}function Ct(e,t){const n=Gt(),[i]=j.useState(()=>new CD(n,e));j.useEffect(()=>{i.setOptions(e)},[i,e]);const a=j.useSyncExternalStore(j.useCallback(o=>i.subscribe(An.batchCalls(o)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),l=j.useCallback((o,d)=>{i.mutate(o,d).catch(ei)},[i]);if(a.error&&Cb(i.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:l,mutateAsync:a.mutate}}/**
50
+ * react-router v7.14.2
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */var nk="popstate";function ik(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function qD(e={}){function t(i,a){var h;let l=(h=a.state)==null?void 0:h.masked,{pathname:o,search:d,hash:f}=l||i.location;return Py("",{pathname:o,search:d,hash:f},a.state&&a.state.usr||null,a.state&&a.state.key||"default",l?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function n(i,a){return typeof a=="string"?a:wu(a)}return KD(t,n,null,e)}function Jt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Gi(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function HD(){return Math.random().toString(36).substring(2,10)}function rk(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 Py(e,t,n=null,i,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Qo(t):t,state:n,key:t&&t.key||i||HD(),unstable_mask:a}}function wu({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Qo(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let i=e.indexOf("?");i>=0&&(t.search=e.substring(i),e=e.substring(0,i)),e&&(t.pathname=e)}return t}function KD(e,t,n,i={}){let{window:a=document.defaultView,v5Compat:l=!1}=i,o=a.history,d="POP",f=null,h=g();h==null&&(h=0,o.replaceState({...o.state,idx:h},""));function g(){return(o.state||{idx:null}).idx}function m(){d="POP";let N=g(),E=N==null?null:N-h;h=N,f&&f({action:d,location:v.location,delta:E})}function y(N,E){d="PUSH";let C=ik(N)?N:Py(v.location,N,E);h=g()+1;let S=rk(C,h),_=v.createHref(C.unstable_mask||C);try{o.pushState(S,"",_)}catch(M){if(M instanceof DOMException&&M.name==="DataCloneError")throw M;a.location.assign(_)}l&&f&&f({action:d,location:v.location,delta:1})}function b(N,E){d="REPLACE";let C=ik(N)?N:Py(v.location,N,E);h=g();let S=rk(C,h),_=v.createHref(C.unstable_mask||C);o.replaceState(S,"",_),l&&f&&f({action:d,location:v.location,delta:0})}function k(N){return GD(N)}let v={get action(){return d},get location(){return e(a,o)},listen(N){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(nk,m),f=N,()=>{a.removeEventListener(nk,m),f=null}},createHref(N){return t(a,N)},createURL:k,encodeLocation(N){let E=k(N);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:y,replace:b,go(N){return o.go(N)}};return v}function GD(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Jt(n,"No window.location.(origin|href) available to create URL");let i=typeof e=="string"?e:wu(e);return i=i.replace(/ $/,"%20"),!t&&i.startsWith("//")&&(i=n+i),new URL(i,n)}function kN(e,t,n="/"){return VD(e,t,n,!1)}function VD(e,t,n,i){let a=typeof t=="string"?Qo(t):t,l=ga(a.pathname||"/",n);if(l==null)return null;let o=EN(e);YD(o);let d=null;for(let f=0;d==null&&f<o.length;++f){let h=aO(l);d=iO(o[f],h,i)}return d}function EN(e,t=[],n=[],i="",a=!1){let l=(o,d,f=a,h)=>{let g={relativePath:h===void 0?o.path||"":h,caseSensitive:o.caseSensitive===!0,childrenIndex:d,route:o};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(i)&&f)return;Jt(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=ur([i,g.relativePath]),y=n.concat(g);o.children&&o.children.length>0&&(Jt(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),EN(o.children,t,y,m,f)),!(o.path==null&&!o.index)&&t.push({path:m,score:tO(m,o.index),routesMeta:y})};return e.forEach((o,d)=>{var f;if(o.path===""||!((f=o.path)!=null&&f.includes("?")))l(o,d);else for(let h of SN(o.path))l(o,d,!0,h)}),t}function SN(e){let t=e.split("/");if(t.length===0)return[];let[n,...i]=t,a=n.endsWith("?"),l=n.replace(/\?$/,"");if(i.length===0)return a?[l,""]:[l];let o=SN(i.join("/")),d=[];return d.push(...o.map(f=>f===""?l:[l,f].join("/"))),a&&d.push(...o),d.map(f=>e.startsWith("/")&&f===""?"/":f)}function YD(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:nO(t.routesMeta.map(i=>i.childrenIndex),n.routesMeta.map(i=>i.childrenIndex)))}var QD=/^:[\w-]+$/,WD=3,XD=2,ZD=1,JD=10,eO=-2,ak=e=>e==="*";function tO(e,t){let n=e.split("/"),i=n.length;return n.some(ak)&&(i+=eO),t&&(i+=XD),n.filter(a=>!ak(a)).reduce((a,l)=>a+(QD.test(l)?WD:l===""?ZD:JD),i)}function nO(e,t){return e.length===t.length&&e.slice(0,-1).every((i,a)=>i===t[a])?e[e.length-1]-t[t.length-1]:0}function iO(e,t,n=!1){let{routesMeta:i}=e,a={},l="/",o=[];for(let d=0;d<i.length;++d){let f=i[d],h=d===i.length-1,g=l==="/"?t:t.slice(l.length)||"/",m=uh({path:f.relativePath,caseSensitive:f.caseSensitive,end:h},g),y=f.route;if(!m&&h&&n&&!i[i.length-1].route.index&&(m=uh({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},g)),!m)return null;Object.assign(a,m.params),o.push({params:a,pathname:ur([l,m.pathname]),pathnameBase:cO(ur([l,m.pathnameBase])),route:y}),m.pathnameBase!=="/"&&(l=ur([l,m.pathnameBase]))}return o}function uh(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,i]=rO(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let l=a[0],o=l.replace(/(.)\/+$/,"$1"),d=a.slice(1);return{params:i.reduce((h,{paramName:g,isOptional:m},y)=>{if(g==="*"){let k=d[y]||"";o=l.slice(0,l.length-k.length).replace(/(.)\/+$/,"$1")}const b=d[y];return m&&!b?h[g]=void 0:h[g]=(b||"").replace(/%2F/g,"/"),h},{}),pathname:l,pathnameBase:o,pattern:e}}function rO(e,t=!1,n=!0){Gi(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=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,d,f,h,g)=>{if(i.push({paramName:d,isOptional:f!=null}),f){let m=g.charAt(h+o.length);return m&&m!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(i.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),i]}function aO(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Gi(!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 ga(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,i=e.charAt(n);return i&&i!=="/"?null:e.slice(n)||"/"}var sO=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function lO(e,t="/"){let{pathname:n,search:i="",hash:a=""}=typeof e=="string"?Qo(e):e,l;return n?(n=NN(n),n.startsWith("/")?l=sk(n.substring(1),"/"):l=sk(n,t)):l=t,{pathname:l,search:uO(i),hash:dO(a)}}function sk(e,t){let n=dh(t).split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Ag(e,t,n,i){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function oO(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Tb(e){let t=oO(e);return t.map((n,i)=>i===t.length-1?n.pathname:n.pathnameBase)}function zh(e,t,n,i=!1){let a;typeof e=="string"?a=Qo(e):(a={...e},Jt(!a.pathname||!a.pathname.includes("?"),Ag("?","pathname","search",a)),Jt(!a.pathname||!a.pathname.includes("#"),Ag("#","pathname","hash",a)),Jt(!a.search||!a.search.includes("#"),Ag("#","search","hash",a)));let l=e===""||a.pathname==="",o=l?"/":a.pathname,d;if(o==null)d=n;else{let m=t.length-1;if(!i&&o.startsWith("..")){let y=o.split("/");for(;y[0]==="..";)y.shift(),m-=1;a.pathname=y.join("/")}d=m>=0?t[m]:"/"}let f=lO(a,d),h=o&&o!=="/"&&o.endsWith("/"),g=(l||o===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(h||g)&&(f.pathname+="/"),f}var NN=e=>e.replace(/\/\/+/g,"/"),ur=e=>NN(e.join("/")),dh=e=>e.replace(/\/+$/,""),cO=e=>dh(e).replace(/^\/*/,"/"),uO=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,dO=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,fO=class{constructor(e,t,n,i=!1){this.status=e,this.statusText=t||"",this.internal=i,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function hO(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function pO(e){let t=e.map(n=>n.route.path).filter(Boolean);return ur(t)||"/"}var _N=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function jN(e,t){let n=e;if(typeof n!="string"||!sO.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let i=n,a=!1;if(_N)try{let l=new URL(window.location.href),o=n.startsWith("//")?new URL(l.protocol+n):new URL(n),d=ga(o.pathname,t);o.origin===l.origin&&d!=null?n=d+o.search+o.hash:a=!0}catch{Gi(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:a,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var CN=["POST","PUT","PATCH","DELETE"];new Set(CN);var mO=["GET",...CN];new Set(mO);var Wo=j.createContext(null);Wo.displayName="DataRouter";var Ph=j.createContext(null);Ph.displayName="DataRouterState";var AN=j.createContext(!1);function gO(){return j.useContext(AN)}var TN=j.createContext({isTransitioning:!1});TN.displayName="ViewTransition";var yO=j.createContext(new Map);yO.displayName="Fetchers";var bO=j.createContext(null);bO.displayName="Await";var Ai=j.createContext(null);Ai.displayName="Navigation";var Ku=j.createContext(null);Ku.displayName="Location";var Yi=j.createContext({outlet:null,matches:[],isDataRoute:!1});Yi.displayName="Route";var Mb=j.createContext(null);Mb.displayName="RouteError";var MN="REACT_ROUTER_ERROR",xO="REDIRECT",vO="ROUTE_ERROR_RESPONSE";function wO(e){if(e.startsWith(`${MN}:${xO}:{`))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 kO(e){if(e.startsWith(`${MN}:${vO}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new fO(t.status,t.statusText,t.data)}catch{}}function EO(e,{relative:t}={}){Jt(Xo(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:i}=j.useContext(Ai),{hash:a,pathname:l,search:o}=Gu(e,{relative:t}),d=l;return n!=="/"&&(d=l==="/"?n:ur([n,l])),i.createHref({pathname:d,search:o,hash:a})}function Xo(){return j.useContext(Ku)!=null}function pr(){return Jt(Xo(),"useLocation() may be used only in the context of a <Router> component."),j.useContext(Ku).location}var DN="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ON(e){j.useContext(Ai).static||j.useLayoutEffect(e)}function ks(){let{isDataRoute:e}=j.useContext(Yi);return e?PO():SO()}function SO(){Jt(Xo(),"useNavigate() may be used only in the context of a <Router> component.");let e=j.useContext(Wo),{basename:t,navigator:n}=j.useContext(Ai),{matches:i}=j.useContext(Yi),{pathname:a}=pr(),l=JSON.stringify(Tb(i)),o=j.useRef(!1);return ON(()=>{o.current=!0}),j.useCallback((f,h={})=>{if(Gi(o.current,DN),!o.current)return;if(typeof f=="number"){n.go(f);return}let g=zh(f,JSON.parse(l),a,h.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:ur([t,g.pathname])),(h.replace?n.replace:n.push)(g,h.state,h)},[t,n,l,a,e])}var NO=j.createContext(null);function _O(e){let t=j.useContext(Yi).outlet;return j.useMemo(()=>t&&j.createElement(NO.Provider,{value:e},t),[t,e])}function Db(){let{matches:e}=j.useContext(Yi),t=e[e.length-1];return(t==null?void 0:t.params)??{}}function Gu(e,{relative:t}={}){let{matches:n}=j.useContext(Yi),{pathname:i}=pr(),a=JSON.stringify(Tb(n));return j.useMemo(()=>zh(e,JSON.parse(a),i,t==="path"),[e,a,i,t])}function jO(e,t){return RN(e,t)}function RN(e,t,n){var N;Jt(Xo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=j.useContext(Ai),{matches:a}=j.useContext(Yi),l=a[a.length-1],o=l?l.params:{},d=l?l.pathname:"/",f=l?l.pathnameBase:"/",h=l&&l.route;{let E=h&&h.path||"";IN(d,!h||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${E}">) 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.
59
+
60
+ Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let g=pr(),m;if(t){let E=typeof t=="string"?Qo(t):t;Jt(f==="/"||((N=E.pathname)==null?void 0:N.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 "${E.pathname}" was given in the \`location\` prop.`),m=E}else m=g;let y=m.pathname||"/",b=y;if(f!=="/"){let E=f.replace(/^\//,"").split("/");b="/"+y.replace(/^\//,"").split("/").slice(E.length).join("/")}let k=kN(e,{pathname:b});Gi(h||k!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),Gi(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.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 v=DO(k&&k.map(E=>Object.assign({},E,{params:Object.assign({},o,E.params),pathname:ur([f,i.encodeLocation?i.encodeLocation(E.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?f:ur([f,i.encodeLocation?i.encodeLocation(E.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),a,n);return t&&v?j.createElement(Ku.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...m},navigationType:"POP"}},v):v}function CO(){let e=zO(),t=hO(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:i},l={padding:"2px 4px",backgroundColor:i},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=j.createElement(j.Fragment,null,j.createElement("p",null,"💿 Hey developer 👋"),j.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",j.createElement("code",{style:l},"ErrorBoundary")," or"," ",j.createElement("code",{style:l},"errorElement")," prop on your route.")),j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},t),n?j.createElement("pre",{style:a},n):null,o)}var AO=j.createElement(CO,null),LN=class extends j.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 n=kO(e.digest);n&&(e=n)}let t=e!==void 0?j.createElement(Yi.Provider,{value:this.props.routeContext},j.createElement(Mb.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?j.createElement(TO,{error:e},t):t}};LN.contextType=AN;var Tg=new WeakMap;function TO({children:e,error:t}){let{basename:n}=j.useContext(Ai);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let i=wO(t.digest);if(i){let a=Tg.get(t);if(a)throw a;let l=jN(i.location,n);if(_N&&!Tg.get(t))if(l.isExternal||i.reloadDocument)window.location.href=l.absoluteURL||l.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:i.replace}));throw Tg.set(t,o),o}return j.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function MO({routeContext:e,match:t,children:n}){let i=j.useContext(Wo);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),j.createElement(Yi.Provider,{value:e},n)}function DO(e,t=[],n){let i=n==null?void 0:n.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 a=e,l=i==null?void 0:i.errors;if(l!=null){let g=a.findIndex(m=>m.route.id&&(l==null?void 0:l[m.route.id])!==void 0);Jt(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),a=a.slice(0,Math.min(a.length,g+1))}let o=!1,d=-1;if(n&&i){o=i.renderFallback;for(let g=0;g<a.length;g++){let m=a[g];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(d=g),m.route.id){let{loaderData:y,errors:b}=i,k=m.route.loader&&!y.hasOwnProperty(m.route.id)&&(!b||b[m.route.id]===void 0);if(m.route.lazy||k){n.isStatic&&(o=!0),d>=0?a=a.slice(0,d+1):a=[a[0]];break}}}}let f=n==null?void 0:n.onError,h=i&&f?(g,m)=>{var y,b;f(g,{location:i.location,params:((b=(y=i.matches)==null?void 0:y[0])==null?void 0:b.params)??{},unstable_pattern:pO(i.matches),errorInfo:m})}:void 0;return a.reduceRight((g,m,y)=>{let b,k=!1,v=null,N=null;i&&(b=l&&m.route.id?l[m.route.id]:void 0,v=m.route.errorElement||AO,o&&(d<0&&y===0?(IN("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,N=null):d===y&&(k=!0,N=m.route.hydrateFallbackElement||null)));let E=t.concat(a.slice(0,y+1)),C=()=>{let S;return b?S=v:k?S=N:m.route.Component?S=j.createElement(m.route.Component,null):m.route.element?S=m.route.element:S=g,j.createElement(MO,{match:m,routeContext:{outlet:g,matches:E,isDataRoute:i!=null},children:S})};return i&&(m.route.ErrorBoundary||m.route.errorElement||y===0)?j.createElement(LN,{location:i.location,revalidation:i.revalidation,component:v,error:b,children:C(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:h}):C()},null)}function Ob(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function OO(e){let t=j.useContext(Wo);return Jt(t,Ob(e)),t}function RO(e){let t=j.useContext(Ph);return Jt(t,Ob(e)),t}function LO(e){let t=j.useContext(Yi);return Jt(t,Ob(e)),t}function Rb(e){let t=LO(e),n=t.matches[t.matches.length-1];return Jt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function IO(){return Rb("useRouteId")}function zO(){var i;let e=j.useContext(Mb),t=RO("useRouteError"),n=Rb("useRouteError");return e!==void 0?e:(i=t.errors)==null?void 0:i[n]}function PO(){let{router:e}=OO("useNavigate"),t=Rb("useNavigate"),n=j.useRef(!1);return ON(()=>{n.current=!0}),j.useCallback(async(a,l={})=>{Gi(n.current,DN),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...l}))},[e,t])}var lk={};function IN(e,t,n){!t&&!lk[e]&&(lk[e]=!0,Gi(!1,n))}j.memo(BO);function BO({routes:e,future:t,state:n,isStatic:i,onError:a}){return RN(e,void 0,{state:n,isStatic:i,onError:a})}function $O({to:e,replace:t,state:n,relative:i}){Jt(Xo(),"<Navigate> may be used only in the context of a <Router> component.");let{static:a}=j.useContext(Ai);Gi(!a,"<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:l}=j.useContext(Yi),{pathname:o}=pr(),d=ks(),f=zh(e,Tb(l),o,i==="path"),h=JSON.stringify(f);return j.useEffect(()=>{d(JSON.parse(h),{replace:t,state:n,relative:i})},[d,h,i,t,n]),null}function UO(e){return _O(e.context)}function Cn(e){Jt(!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 FO({basename:e="/",children:t=null,location:n,navigationType:i="POP",navigator:a,static:l=!1,unstable_useTransitions:o}){Jt(!Xo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),f=j.useMemo(()=>({basename:d,navigator:a,static:l,unstable_useTransitions:o,future:{}}),[d,a,l,o]);typeof n=="string"&&(n=Qo(n));let{pathname:h="/",search:g="",hash:m="",state:y=null,key:b="default",unstable_mask:k}=n,v=j.useMemo(()=>{let N=ga(h,d);return N==null?null:{location:{pathname:N,search:g,hash:m,state:y,key:b,unstable_mask:k},navigationType:i}},[d,h,g,m,y,b,i,k]);return Gi(v!=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.`),v==null?null:j.createElement(Ai.Provider,{value:f},j.createElement(Ku.Provider,{children:t,value:v}))}function qO({children:e,location:t}){return jO(By(e),t)}function By(e,t=[]){let n=[];return j.Children.forEach(e,(i,a)=>{if(!j.isValidElement(i))return;let l=[...t,a];if(i.type===j.Fragment){n.push.apply(n,By(i.props.children,l));return}Jt(i.type===Cn,`[${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>`),Jt(!i.props.index||!i.props.children,"An index route cannot have child routes.");let o={id:i.props.id||l.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&&(o.children=By(i.props.children,l)),n.push(o)}),n}var Wf="get",Xf="application/x-www-form-urlencoded";function Bh(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function HO(e){return Bh(e)&&e.tagName.toLowerCase()==="button"}function KO(e){return Bh(e)&&e.tagName.toLowerCase()==="form"}function GO(e){return Bh(e)&&e.tagName.toLowerCase()==="input"}function VO(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function YO(e,t){return e.button===0&&(!t||t==="_self")&&!VO(e)}function $y(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let i=e[n];return t.concat(Array.isArray(i)?i.map(a=>[n,a]):[[n,i]])},[]))}function QO(e,t){let n=$y(e);return t&&t.forEach((i,a)=>{n.has(a)||t.getAll(a).forEach(l=>{n.append(a,l)})}),n}var wf=null;function WO(){if(wf===null)try{new FormData(document.createElement("form"),0),wf=!1}catch{wf=!0}return wf}var XO=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Mg(e){return e!=null&&!XO.has(e)?(Gi(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Xf}"`),null):e}function ZO(e,t){let n,i,a,l,o;if(KO(e)){let d=e.getAttribute("action");i=d?ga(d,t):null,n=e.getAttribute("method")||Wf,a=Mg(e.getAttribute("enctype"))||Xf,l=new FormData(e)}else if(HO(e)||GO(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?ga(f,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||Wf,a=Mg(e.getAttribute("formenctype"))||Mg(d.getAttribute("enctype"))||Xf,l=new FormData(d,e),!WO()){let{name:h,type:g,value:m}=e;if(g==="image"){let y=h?`${h}.`:"";l.append(`${y}x`,"0"),l.append(`${y}y`,"0")}else h&&l.append(h,m)}}else{if(Bh(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Wf,i=null,a=Xf,o=e}return l&&a==="text/plain"&&(o=l,l=void 0),{action:i,method:n.toLowerCase(),encType:a,formData:l,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Lb(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function zN(e,t,n,i){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${i}`:a.pathname=`${a.pathname}.${i}`:a.pathname==="/"?a.pathname=`_root.${i}`:t&&ga(a.pathname,t)==="/"?a.pathname=`${dh(t)}/_root.${i}`:a.pathname=`${dh(a.pathname)}.${i}`,a}async function JO(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function eR(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 tR(e,t,n){let i=await Promise.all(e.map(async a=>{let l=t.routes[a.route.id];if(l){let o=await JO(l,n);return o.links?o.links():[]}return[]}));return aR(i.flat(1).filter(eR).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function ok(e,t,n,i,a,l){let o=(f,h)=>n[h]?f.route.id!==n[h].route.id:!0,d=(f,h)=>{var g;return n[h].pathname!==f.pathname||((g=n[h].route.path)==null?void 0:g.endsWith("*"))&&n[h].params["*"]!==f.params["*"]};return l==="assets"?t.filter((f,h)=>o(f,h)||d(f,h)):l==="data"?t.filter((f,h)=>{var m;let g=i.routes[f.route.id];if(!g||!g.hasLoader)return!1;if(o(f,h)||d(f,h))return!0;if(f.route.shouldRevalidate){let y=f.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((m=n[0])==null?void 0:m.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function nR(e,t,{includeHydrateFallback:n}={}){return iR(e.map(i=>{let a=t.routes[i.route.id];if(!a)return[];let l=[a.module];return a.clientActionModule&&(l=l.concat(a.clientActionModule)),a.clientLoaderModule&&(l=l.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(l=l.concat(a.hydrateFallbackModule)),a.imports&&(l=l.concat(a.imports)),l}).flat(1))}function iR(e){return[...new Set(e)]}function rR(e){let t={},n=Object.keys(e).sort();for(let i of n)t[i]=e[i];return t}function aR(e,t){let n=new Set;return new Set(t),e.reduce((i,a)=>{let l=JSON.stringify(rR(a));return n.has(l)||(n.add(l),i.push({key:l,link:a})),i},[])}function Ib(){let e=j.useContext(Wo);return Lb(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function sR(){let e=j.useContext(Ph);return Lb(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var zb=j.createContext(void 0);zb.displayName="FrameworkContext";function Pb(){let e=j.useContext(zb);return Lb(e,"You must render this element inside a <HydratedRouter> element"),e}function lR(e,t){let n=j.useContext(zb),[i,a]=j.useState(!1),[l,o]=j.useState(!1),{onFocus:d,onBlur:f,onMouseEnter:h,onMouseLeave:g,onTouchStart:m}=t,y=j.useRef(null);j.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let v=E=>{E.forEach(C=>{o(C.isIntersecting)})},N=new IntersectionObserver(v,{threshold:.5});return y.current&&N.observe(y.current),()=>{N.disconnect()}}},[e]),j.useEffect(()=>{if(i){let v=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(v)}}},[i]);let b=()=>{a(!0)},k=()=>{a(!1),o(!1)};return n?e!=="intent"?[l,y,{}]:[l,y,{onFocus:Jc(d,b),onBlur:Jc(f,k),onMouseEnter:Jc(h,b),onMouseLeave:Jc(g,k),onTouchStart:Jc(m,b)}]:[!1,y,{}]}function Jc(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function oR({page:e,...t}){let n=gO(),{router:i}=Ib(),a=j.useMemo(()=>kN(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?n?j.createElement(uR,{page:e,matches:a,...t}):j.createElement(dR,{page:e,matches:a,...t}):null}function cR(e){let{manifest:t,routeModules:n}=Pb(),[i,a]=j.useState([]);return j.useEffect(()=>{let l=!1;return tR(e,t,n).then(o=>{l||a(o)}),()=>{l=!0}},[e,t,n]),i}function uR({page:e,matches:t,...n}){let i=pr(),{future:a}=Pb(),{basename:l}=Ib(),o=j.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let d=zN(e,l,a.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]},[l,a.unstable_trailingSlashAwareDataRequests,e,i,t]);return j.createElement(j.Fragment,null,o.map(d=>j.createElement("link",{key:d,rel:"prefetch",as:"fetch",href:d,...n})))}function dR({page:e,matches:t,...n}){let i=pr(),{future:a,manifest:l,routeModules:o}=Pb(),{basename:d}=Ib(),{loaderData:f,matches:h}=sR(),g=j.useMemo(()=>ok(e,t,h,l,i,"data"),[e,t,h,l,i]),m=j.useMemo(()=>ok(e,t,h,l,i,"assets"),[e,t,h,l,i]),y=j.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let v=new Set,N=!1;if(t.forEach(C=>{var _;let S=l.routes[C.route.id];!S||!S.hasLoader||(!g.some(M=>M.route.id===C.route.id)&&C.route.id in f&&((_=o[C.route.id])!=null&&_.shouldRevalidate)||S.hasClientLoader?N=!0:v.add(C.route.id))}),v.size===0)return[];let E=zN(e,d,a.unstable_trailingSlashAwareDataRequests,"data");return N&&v.size>0&&E.searchParams.set("_routes",t.filter(C=>v.has(C.route.id)).map(C=>C.route.id).join(",")),[E.pathname+E.search]},[d,a.unstable_trailingSlashAwareDataRequests,f,i,l,g,t,e,o]),b=j.useMemo(()=>nR(m,l),[m,l]),k=cR(m);return j.createElement(j.Fragment,null,y.map(v=>j.createElement("link",{key:v,rel:"prefetch",as:"fetch",href:v,...n})),b.map(v=>j.createElement("link",{key:v,rel:"modulepreload",href:v,...n})),k.map(({key:v,link:N})=>j.createElement("link",{key:v,nonce:n.nonce,...N,crossOrigin:N.crossOrigin??n.crossOrigin})))}function fR(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var hR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{hR&&(window.__reactRouterVersion="7.14.2")}catch{}function pR({basename:e,children:t,unstable_useTransitions:n,window:i}){let a=j.useRef();a.current==null&&(a.current=qD({window:i,v5Compat:!0}));let l=a.current,[o,d]=j.useState({action:l.action,location:l.location}),f=j.useCallback(h=>{n===!1?d(h):j.startTransition(()=>d(h))},[n]);return j.useLayoutEffect(()=>l.listen(f),[l,f]),j.createElement(FO,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:l,unstable_useTransitions:n})}var PN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vs=j.forwardRef(function({onClick:t,discover:n="render",prefetch:i="none",relative:a,reloadDocument:l,replace:o,unstable_mask:d,state:f,target:h,to:g,preventScrollReset:m,viewTransition:y,unstable_defaultShouldRevalidate:b,...k},v){let{basename:N,navigator:E,unstable_useTransitions:C}=j.useContext(Ai),S=typeof g=="string"&&PN.test(g),_=jN(g,N);g=_.to;let M=EO(g,{relative:a}),T=pr(),R=null;if(d){let K=zh(d,[],T.unstable_mask?T.unstable_mask.pathname:"/",!0);N!=="/"&&(K.pathname=K.pathname==="/"?N:ur([N,K.pathname])),R=E.createHref(K)}let[O,$,I]=lR(i,k),q=yR(g,{replace:o,unstable_mask:d,state:f,target:h,preventScrollReset:m,relative:a,viewTransition:y,unstable_defaultShouldRevalidate:b,unstable_useTransitions:C});function F(K){t&&t(K),K.defaultPrevented||q(K)}let Y=!(_.isExternal||l),D=j.createElement("a",{...k,...I,href:(Y?R:void 0)||_.absoluteURL||M,onClick:Y?F:t,ref:fR(v,$),target:h,"data-discover":!S&&n==="render"?"true":void 0});return O&&!S?j.createElement(j.Fragment,null,D,j.createElement(oR,{page:M})):D});vs.displayName="Link";var BN=j.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:i="",end:a=!1,style:l,to:o,viewTransition:d,children:f,...h},g){let m=Gu(o,{relative:h.relative}),y=pr(),b=j.useContext(Ph),{navigator:k,basename:v}=j.useContext(Ai),N=b!=null&&kR(m)&&d===!0,E=k.encodeLocation?k.encodeLocation(m).pathname:m.pathname,C=y.pathname,S=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(C=C.toLowerCase(),S=S?S.toLowerCase():null,E=E.toLowerCase()),S&&v&&(S=ga(S,v)||S);const _=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let M=C===E||!a&&C.startsWith(E)&&C.charAt(_)==="/",T=S!=null&&(S===E||!a&&S.startsWith(E)&&S.charAt(E.length)==="/"),R={isActive:M,isPending:T,isTransitioning:N},O=M?t:void 0,$;typeof i=="function"?$=i(R):$=[i,M?"active":null,T?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let I=typeof l=="function"?l(R):l;return j.createElement(vs,{...h,"aria-current":O,className:$,ref:g,style:I,to:o,viewTransition:d},typeof f=="function"?f(R):f)});BN.displayName="NavLink";var mR=j.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:i,replace:a,state:l,method:o=Wf,action:d,onSubmit:f,relative:h,preventScrollReset:g,viewTransition:m,unstable_defaultShouldRevalidate:y,...b},k)=>{let{unstable_useTransitions:v}=j.useContext(Ai),N=vR(),E=wR(d,{relative:h}),C=o.toLowerCase()==="get"?"get":"post",S=typeof d=="string"&&PN.test(d),_=M=>{if(f&&f(M),M.defaultPrevented)return;M.preventDefault();let T=M.nativeEvent.submitter,R=(T==null?void 0:T.getAttribute("formmethod"))||o,O=()=>N(T||M.currentTarget,{fetcherKey:t,method:R,navigate:n,replace:a,state:l,relative:h,preventScrollReset:g,viewTransition:m,unstable_defaultShouldRevalidate:y});v&&n!==!1?j.startTransition(()=>O()):O()};return j.createElement("form",{ref:k,method:C,action:E,onSubmit:i?f:_,...b,"data-discover":!S&&e==="render"?"true":void 0})});mR.displayName="Form";function gR(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function $N(e){let t=j.useContext(Wo);return Jt(t,gR(e)),t}function yR(e,{target:t,replace:n,unstable_mask:i,state:a,preventScrollReset:l,relative:o,viewTransition:d,unstable_defaultShouldRevalidate:f,unstable_useTransitions:h}={}){let g=ks(),m=pr(),y=Gu(e,{relative:o});return j.useCallback(b=>{if(YO(b,t)){b.preventDefault();let k=n!==void 0?n:wu(m)===wu(y),v=()=>g(e,{replace:k,unstable_mask:i,state:a,preventScrollReset:l,relative:o,viewTransition:d,unstable_defaultShouldRevalidate:f});h?j.startTransition(()=>v()):v()}},[m,g,y,n,i,a,t,e,l,o,d,f,h])}function UN(e){Gi(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=j.useRef($y(e)),n=j.useRef(!1),i=pr(),a=j.useMemo(()=>QO(i.search,n.current?null:t.current),[i.search]),l=ks(),o=j.useCallback((d,f)=>{const h=$y(typeof d=="function"?d(new URLSearchParams(a)):d);n.current=!0,l("?"+h,f)},[l,a]);return[a,o]}var bR=0,xR=()=>`__${String(++bR)}__`;function vR(){let{router:e}=$N("useSubmit"),{basename:t}=j.useContext(Ai),n=IO(),i=e.fetch,a=e.navigate;return j.useCallback(async(l,o={})=>{let{action:d,method:f,encType:h,formData:g,body:m}=ZO(l,t);if(o.navigate===!1){let y=o.fetcherKey||xR();await i(y,n,o.action||d,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:g,body:m,formMethod:o.method||f,formEncType:o.encType||h,flushSync:o.flushSync})}else await a(o.action||d,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:g,body:m,formMethod:o.method||f,formEncType:o.encType||h,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[i,a,t,n])}function wR(e,{relative:t}={}){let{basename:n}=j.useContext(Ai),i=j.useContext(Yi);Jt(i,"useFormAction must be used inside a RouteContext");let[a]=i.matches.slice(-1),l={...Gu(e||".",{relative:t})},o=pr();if(e==null){l.search=o.search;let d=new URLSearchParams(l.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();l.search=g?`?${g}`:""}}return(!e||e===".")&&a.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:ur([n,l.pathname])),wu(l)}function kR(e,{relative:t}={}){let n=j.useContext(TN);Jt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=$N("useViewTransitionState"),a=Gu(e,{relative:t});if(!n.isTransitioning)return!1;let l=ga(n.currentLocation.pathname,i)||n.currentLocation.pathname,o=ga(n.nextLocation.pathname,i)||n.nextLocation.pathname;return uh(a.pathname,o)!=null||uh(a.pathname,l)!=null}cN();/**
61
+ * @license lucide-react v0.544.0 - ISC
62
+ *
63
+ * This source code is licensed under the ISC license.
64
+ * See the LICENSE file in the root directory of this source tree.
65
+ */const ER=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),SR=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,i)=>i?i.toUpperCase():n.toLowerCase()),ck=e=>{const t=SR(e);return t.charAt(0).toUpperCase()+t.slice(1)},FN=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim(),NR=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
66
+ * @license lucide-react v0.544.0 - ISC
67
+ *
68
+ * This source code is licensed under the ISC license.
69
+ * See the LICENSE file in the root directory of this source tree.
70
+ */var _R={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"};/**
71
+ * @license lucide-react v0.544.0 - ISC
72
+ *
73
+ * This source code is licensed under the ISC license.
74
+ * See the LICENSE file in the root directory of this source tree.
75
+ */const jR=j.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:a="",children:l,iconNode:o,...d},f)=>j.createElement("svg",{ref:f,..._R,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:FN("lucide",a),...!l&&!NR(d)&&{"aria-hidden":"true"},...d},[...o.map(([h,g])=>j.createElement(h,g)),...Array.isArray(l)?l:[l]]));/**
76
+ * @license lucide-react v0.544.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */const Oe=(e,t)=>{const n=j.forwardRef(({className:i,...a},l)=>j.createElement(jR,{ref:l,iconNode:t,className:FN(`lucide-${ER(ck(e))}`,`lucide-${e}`,i),...a}));return n.displayName=ck(e),n};/**
81
+ * @license lucide-react v0.544.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */const CR=[["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"}]],$h=Oe("activity",CR);/**
86
+ * @license lucide-react v0.544.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const AR=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],TR=Oe("arrow-down",AR);/**
91
+ * @license lucide-react v0.544.0 - ISC
92
+ *
93
+ * This source code is licensed under the ISC license.
94
+ * See the LICENSE file in the root directory of this source tree.
95
+ */const MR=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],qN=Oe("arrow-left",MR);/**
96
+ * @license lucide-react v0.544.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const DR=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],HN=Oe("arrow-up",DR);/**
101
+ * @license lucide-react v0.544.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const OR=[["path",{d:"M18 6V4a2 2 0 1 0-4 0v2",key:"1aquzs"}],["path",{d:"M20 15v6a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"1rkj32"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H10",key:"18wgow"}],["rect",{x:"12",y:"6",width:"8",height:"5",rx:"1",key:"73l30o"}]],RR=Oe("book-lock",OR);/**
106
+ * @license lucide-react v0.544.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const LR=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],IR=Oe("brain",LR);/**
111
+ * @license lucide-react v0.544.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const zR=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],PR=Oe("check",zR);/**
116
+ * @license lucide-react v0.544.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const BR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Vu=Oe("chevron-down",BR);/**
121
+ * @license lucide-react v0.544.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const $R=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Zo=Oe("chevron-right",$R);/**
126
+ * @license lucide-react v0.544.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const UR=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],FR=Oe("chevron-up",UR);/**
131
+ * @license lucide-react v0.544.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const qR=[["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"}]],ku=Oe("circle-alert",qR);/**
136
+ * @license lucide-react v0.544.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const HR=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],fh=Oe("circle-check-big",HR);/**
141
+ * @license lucide-react v0.544.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const KR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Eu=Oe("circle-check",KR);/**
146
+ * @license lucide-react v0.544.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const GR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],KN=Oe("circle-x",GR);/**
151
+ * @license lucide-react v0.544.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const VR=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],GN=Oe("clock",VR);/**
156
+ * @license lucide-react v0.544.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const YR=[["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"}]],QR=Oe("copy",YR);/**
161
+ * @license lucide-react v0.544.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const WR=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],hh=Oe("cpu",WR);/**
166
+ * @license lucide-react v0.544.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const XR=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Uh=Oe("download",XR);/**
171
+ * @license lucide-react v0.544.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const ZR=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],JR=Oe("external-link",ZR);/**
176
+ * @license lucide-react v0.544.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const eL=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],tL=Oe("eye",eL);/**
181
+ * @license lucide-react v0.544.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const nL=[["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"}]],uk=Oe("file-code",nL);/**
186
+ * @license lucide-react v0.544.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const iL=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Fh=Oe("file-text",iL);/**
191
+ * @license lucide-react v0.544.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const rL=[["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["path",{d:"M18 19c-2.8 0-5-2.2-5-5v8",key:"pkpw2h"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],aL=Oe("folder-git-2",rL);/**
196
+ * @license lucide-react v0.544.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const sL=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],VN=Oe("folder-open",sL);/**
201
+ * @license lucide-react v0.544.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const lL=[["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"}]],oL=Oe("folder-plus",lL);/**
206
+ * @license lucide-react v0.544.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const cL=[["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"}]],ph=Oe("folder",cL);/**
211
+ * @license lucide-react v0.544.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const uL=[["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"}]],dL=Oe("funnel",uL);/**
216
+ * @license lucide-react v0.544.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */const fL=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],hL=Oe("git-branch",fL);/**
221
+ * @license lucide-react v0.544.0 - ISC
222
+ *
223
+ * This source code is licensed under the ISC license.
224
+ * See the LICENSE file in the root directory of this source tree.
225
+ */const pL=[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M5 9v12",key:"ih889a"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}]],mL=Oe("git-pull-request-arrow",pL);/**
226
+ * @license lucide-react v0.544.0 - ISC
227
+ *
228
+ * This source code is licensed under the ISC license.
229
+ * See the LICENSE file in the root directory of this source tree.
230
+ */const gL=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],yL=Oe("globe",gL);/**
231
+ * @license lucide-react v0.544.0 - ISC
232
+ *
233
+ * This source code is licensed under the ISC license.
234
+ * See the LICENSE file in the root directory of this source tree.
235
+ */const bL=[["path",{d:"m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9",key:"1hayfq"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"15ts47"}]],xL=Oe("hammer",bL);/**
236
+ * @license lucide-react v0.544.0 - ISC
237
+ *
238
+ * This source code is licensed under the ISC license.
239
+ * See the LICENSE file in the root directory of this source tree.
240
+ */const vL=[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],wL=Oe("history",vL);/**
241
+ * @license lucide-react v0.544.0 - ISC
242
+ *
243
+ * This source code is licensed under the ISC license.
244
+ * See the LICENSE file in the root directory of this source tree.
245
+ */const kL=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],EL=Oe("house",kL);/**
246
+ * @license lucide-react v0.544.0 - ISC
247
+ *
248
+ * This source code is licensed under the ISC license.
249
+ * See the LICENSE file in the root directory of this source tree.
250
+ */const SL=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],NL=Oe("image",SL);/**
251
+ * @license lucide-react v0.544.0 - ISC
252
+ *
253
+ * This source code is licensed under the ISC license.
254
+ * See the LICENSE file in the root directory of this source tree.
255
+ */const _L=[["path",{d:"M5 3v14",key:"9nsxs2"}],["path",{d:"M12 3v8",key:"1h2ygw"}],["path",{d:"M19 3v18",key:"1sk56x"}]],jL=Oe("kanban",_L);/**
256
+ * @license lucide-react v0.544.0 - ISC
257
+ *
258
+ * This source code is licensed under the ISC license.
259
+ * See the LICENSE file in the root directory of this source tree.
260
+ */const CL=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],AL=Oe("key-round",CL);/**
261
+ * @license lucide-react v0.544.0 - ISC
262
+ *
263
+ * This source code is licensed under the ISC license.
264
+ * See the LICENSE file in the root directory of this source tree.
265
+ */const TL=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],YN=Oe("layout-grid",TL);/**
266
+ * @license lucide-react v0.544.0 - ISC
267
+ *
268
+ * This source code is licensed under the ISC license.
269
+ * See the LICENSE file in the root directory of this source tree.
270
+ */const ML=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Xe=Oe("loader-circle",ML);/**
271
+ * @license lucide-react v0.544.0 - ISC
272
+ *
273
+ * This source code is licensed under the ISC license.
274
+ * See the LICENSE file in the root directory of this source tree.
275
+ */const DL=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],dk=Oe("message-circle",DL);/**
276
+ * @license lucide-react v0.544.0 - ISC
277
+ *
278
+ * This source code is licensed under the ISC license.
279
+ * See the LICENSE file in the root directory of this source tree.
280
+ */const OL=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],QN=Oe("message-square",OL);/**
281
+ * @license lucide-react v0.544.0 - ISC
282
+ *
283
+ * This source code is licensed under the ISC license.
284
+ * See the LICENSE file in the root directory of this source tree.
285
+ */const RL=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],LL=Oe("moon",RL);/**
286
+ * @license lucide-react v0.544.0 - ISC
287
+ *
288
+ * This source code is licensed under the ISC license.
289
+ * See the LICENSE file in the root directory of this source tree.
290
+ */const IL=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],WN=Oe("network",IL);/**
291
+ * @license lucide-react v0.544.0 - ISC
292
+ *
293
+ * This source code is licensed under the ISC license.
294
+ * See the LICENSE file in the root directory of this source tree.
295
+ */const zL=[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]],XN=Oe("notebook-pen",zL);/**
296
+ * @license lucide-react v0.544.0 - ISC
297
+ *
298
+ * This source code is licensed under the ISC license.
299
+ * See the LICENSE file in the root directory of this source tree.
300
+ */const PL=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]],BL=Oe("panel-right-close",PL);/**
301
+ * @license lucide-react v0.544.0 - ISC
302
+ *
303
+ * This source code is licensed under the ISC license.
304
+ * See the LICENSE file in the root directory of this source tree.
305
+ */const $L=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],UL=Oe("paperclip",$L);/**
306
+ * @license lucide-react v0.544.0 - ISC
307
+ *
308
+ * This source code is licensed under the ISC license.
309
+ * See the LICENSE file in the root directory of this source tree.
310
+ */const FL=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],qL=Oe("pause",FL);/**
311
+ * @license lucide-react v0.544.0 - ISC
312
+ *
313
+ * This source code is licensed under the ISC license.
314
+ * See the LICENSE file in the root directory of this source tree.
315
+ */const HL=[["path",{d:"M13 21h8",key:"1jsn5i"}],["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"}]],qh=Oe("pen-line",HL);/**
316
+ * @license lucide-react v0.544.0 - ISC
317
+ *
318
+ * This source code is licensed under the ISC license.
319
+ * See the LICENSE file in the root directory of this source tree.
320
+ */const KL=[["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"}]],GL=Oe("pencil",KL);/**
321
+ * @license lucide-react v0.544.0 - ISC
322
+ *
323
+ * This source code is licensed under the ISC license.
324
+ * See the LICENSE file in the root directory of this source tree.
325
+ */const VL=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Yu=Oe("play",VL);/**
326
+ * @license lucide-react v0.544.0 - ISC
327
+ *
328
+ * This source code is licensed under the ISC license.
329
+ * See the LICENSE file in the root directory of this source tree.
330
+ */const YL=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],pi=Oe("plus",YL);/**
331
+ * @license lucide-react v0.544.0 - ISC
332
+ *
333
+ * This source code is licensed under the ISC license.
334
+ * See the LICENSE file in the root directory of this source tree.
335
+ */const QL=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],WL=Oe("puzzle",QL);/**
336
+ * @license lucide-react v0.544.0 - ISC
337
+ *
338
+ * This source code is licensed under the ISC license.
339
+ * See the LICENSE file in the root directory of this source tree.
340
+ */const XL=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],ZN=Oe("radio",XL);/**
341
+ * @license lucide-react v0.544.0 - ISC
342
+ *
343
+ * This source code is licensed under the ISC license.
344
+ * See the LICENSE file in the root directory of this source tree.
345
+ */const ZL=[["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"}]],ya=Oe("refresh-cw",ZL);/**
346
+ * @license lucide-react v0.544.0 - ISC
347
+ *
348
+ * This source code is licensed under the ISC license.
349
+ * See the LICENSE file in the root directory of this source tree.
350
+ */const JL=[["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"}]],Bb=Oe("rotate-ccw",JL);/**
351
+ * @license lucide-react v0.544.0 - ISC
352
+ *
353
+ * This source code is licensed under the ISC license.
354
+ * See the LICENSE file in the root directory of this source tree.
355
+ */const e3=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]],t3=Oe("rows-3",e3);/**
356
+ * @license lucide-react v0.544.0 - ISC
357
+ *
358
+ * This source code is licensed under the ISC license.
359
+ * See the LICENSE file in the root directory of this source tree.
360
+ */const n3=[["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"}]],Rr=Oe("save",n3);/**
361
+ * @license lucide-react v0.544.0 - ISC
362
+ *
363
+ * This source code is licensed under the ISC license.
364
+ * See the LICENSE file in the root directory of this source tree.
365
+ */const i3=[["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"}]],$b=Oe("scroll-text",i3);/**
366
+ * @license lucide-react v0.544.0 - ISC
367
+ *
368
+ * This source code is licensed under the ISC license.
369
+ * See the LICENSE file in the root directory of this source tree.
370
+ */const r3=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],fl=Oe("search",r3);/**
371
+ * @license lucide-react v0.544.0 - ISC
372
+ *
373
+ * This source code is licensed under the ISC license.
374
+ * See the LICENSE file in the root directory of this source tree.
375
+ */const a3=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],JN=Oe("settings",a3);/**
376
+ * @license lucide-react v0.544.0 - ISC
377
+ *
378
+ * This source code is licensed under the ISC license.
379
+ * See the LICENSE file in the root directory of this source tree.
380
+ */const s3=[["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"}]],e_=Oe("shield-check",s3);/**
381
+ * @license lucide-react v0.544.0 - ISC
382
+ *
383
+ * This source code is licensed under the ISC license.
384
+ * See the LICENSE file in the root directory of this source tree.
385
+ */const l3=[["path",{d:"m12.5 17-.5-1-.5 1h1z",key:"3me087"}],["path",{d:"M15 22a1 1 0 0 0 1-1v-1a2 2 0 0 0 1.56-3.25 8 8 0 1 0-11.12 0A2 2 0 0 0 8 20v1a1 1 0 0 0 1 1z",key:"1o5pge"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}]],o3=Oe("skull",l3);/**
386
+ * @license lucide-react v0.544.0 - ISC
387
+ *
388
+ * This source code is licensed under the ISC license.
389
+ * See the LICENSE file in the root directory of this source tree.
390
+ */const c3=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],hl=Oe("sparkles",c3);/**
391
+ * @license lucide-react v0.544.0 - ISC
392
+ *
393
+ * This source code is licensed under the ISC license.
394
+ * See the LICENSE file in the root directory of this source tree.
395
+ */const u3=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Ub=Oe("square",u3);/**
396
+ * @license lucide-react v0.544.0 - ISC
397
+ *
398
+ * This source code is licensed under the ISC license.
399
+ * See the LICENSE file in the root directory of this source tree.
400
+ */const d3=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],t_=Oe("star",d3);/**
401
+ * @license lucide-react v0.544.0 - ISC
402
+ *
403
+ * This source code is licensed under the ISC license.
404
+ * See the LICENSE file in the root directory of this source tree.
405
+ */const f3=[["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"}]],h3=Oe("sun",f3);/**
406
+ * @license lucide-react v0.544.0 - ISC
407
+ *
408
+ * This source code is licensed under the ISC license.
409
+ * See the LICENSE file in the root directory of this source tree.
410
+ */const p3=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],n_=Oe("terminal",p3);/**
411
+ * @license lucide-react v0.544.0 - ISC
412
+ *
413
+ * This source code is licensed under the ISC license.
414
+ * See the LICENSE file in the root directory of this source tree.
415
+ */const m3=[["path",{d:"M10 2h4",key:"n1abiw"}],["path",{d:"M12 14v-4",key:"1evpnu"}],["path",{d:"M4 13a8 8 0 0 1 8-7 8 8 0 1 1-5.3 14L4 17.6",key:"1ts96g"}],["path",{d:"M9 17H4v5",key:"8t5av"}]],g3=Oe("timer-reset",m3);/**
416
+ * @license lucide-react v0.544.0 - ISC
417
+ *
418
+ * This source code is licensed under the ISC license.
419
+ * See the LICENSE file in the root directory of this source tree.
420
+ */const y3=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],b3=Oe("timer",y3);/**
421
+ * @license lucide-react v0.544.0 - ISC
422
+ *
423
+ * This source code is licensed under the ISC license.
424
+ * See the LICENSE file in the root directory of this source tree.
425
+ */const x3=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],fr=Oe("trash-2",x3);/**
426
+ * @license lucide-react v0.544.0 - ISC
427
+ *
428
+ * This source code is licensed under the ISC license.
429
+ * See the LICENSE file in the root directory of this source tree.
430
+ */const v3=[["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"}]],w3=Oe("triangle-alert",v3);/**
431
+ * @license lucide-react v0.544.0 - ISC
432
+ *
433
+ * This source code is licensed under the ISC license.
434
+ * See the LICENSE file in the root directory of this source tree.
435
+ */const k3=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],i_=Oe("upload",k3);/**
436
+ * @license lucide-react v0.544.0 - ISC
437
+ *
438
+ * This source code is licensed under the ISC license.
439
+ * See the LICENSE file in the root directory of this source tree.
440
+ */const E3=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],r_=Oe("users",E3);/**
441
+ * @license lucide-react v0.544.0 - ISC
442
+ *
443
+ * This source code is licensed under the ISC license.
444
+ * See the LICENSE file in the root directory of this source tree.
445
+ */const S3=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],Fb=Oe("workflow",S3);/**
446
+ * @license lucide-react v0.544.0 - ISC
447
+ *
448
+ * This source code is licensed under the ISC license.
449
+ * See the LICENSE file in the root directory of this source tree.
450
+ */const N3=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],a_=Oe("wrench",N3);/**
451
+ * @license lucide-react v0.544.0 - ISC
452
+ *
453
+ * This source code is licensed under the ISC license.
454
+ * See the LICENSE file in the root directory of this source tree.
455
+ */const _3=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],bn=Oe("x",_3);/**
456
+ * @license lucide-react v0.544.0 - ISC
457
+ *
458
+ * This source code is licensed under the ISC license.
459
+ * See the LICENSE file in the root directory of this source tree.
460
+ */const j3=[["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"}]],C3=Oe("zap",j3),A3={"app.title":"SPS Console","nav.chat":"Chat","nav.projects":"Projects","nav.board":"Board","nav.workers":"Workers","nav.logs":"Logs","nav.skills":"Skills","nav.system":"System","nav.processes":"Processes","nav.audit":"Audit Log","nav.memory":"Memory","nav.plugins":"Plugins","plugins.h1":"Plugins","plugins.desc":"Global plugin toggles. Applies to newly dispatched cards.","plugins.tab.memory":"Memory","plugins.tab.channel":"Channel","plugins.tab.model":"Model","plugins.tab.tool":"Tool","plugins.comingSoon":"Coming soon","plugins.model.title":"Agent models","plugins.model.desc":"Configure both agents (global). worker=claude executes, review·designer=openai supervises+orchestrates.","plugins.model.worker":"Worker (executes / claude)","plugins.model.reviewer":"Review·Designer (supervisor / openai)","plugins.model.provider":"Provider","plugins.model.model":"Model","plugins.model.official":"Official claude (default)","plugins.model.save":"Save","plugins.model.saved":"Saved","plugins.model.error":"Save failed","nav.arrange":"Arrange","arrange.h1":"SmartArrange","arrange.project":"Project","arrange.none":'Not started — click "Start" above to launch (task list appears in seconds; approve to run). If the dropdown is empty, create a project in SmartArrange mode first.',"arrange.start":"Start","arrange.stop":"Stop","arrange.startErr":"Start/stop failed","arrange.view":"Toggle canvas view","arrange.viewFree":"Free","arrange.viewLane":"Lanes","arrange.starting":"Starting — breaking down the task list…","arrange.planning":"Breaking down the task list…","arrange.orchestrating":"Orchestrating…","arrange.status":"Status","arrange.goal":"Goal","arrange.plan":"Task list + card chain","arrange.approve":"Approve plan","arrange.approveErr":"Approve failed","arrange.tasks":"Task list","arrange.collapse":"Collapse","arrange.expand":"Expand task list","arrange.noCards":"No cards yet — waiting for the orchestrator to dispatch (starts after approval).","arrange.cardPrompt":"Card prompt","arrange.cardSkills":"Skills","arrange.cardTask":"Task","arrange.cardLog":"Log","arrange.close":"Close","arrange.cardsCount":"cards","nav.aria":"Main navigation","memory.sub":"Cross-project memory · agentmemory proxied behind console auth","memory.searchPlaceholder":"Search memory… (e.g. how to fix the art race)","memory.search":"Search","memory.results":"Results","memory.rawHint":"(raw observation · distilled lessons appear after live capture + compression)","memory.sessions":"Recent sessions","memory.empty":"No memory yet · accumulates after live capture (P1)","processes.title":"Processes","processes.subtitle":"Claude processes launched by SPS ACP (others, e.g. your own session, are not shown)","processes.refresh":"Refresh","processes.aliveCount":"{n} running","processes.col.kind":"Type","processes.col.slot":"Slot","processes.col.project":"Project","processes.col.state":"State","processes.col.memory":"Memory","processes.col.action":"Action","processes.empty":"No SPS processes","processes.filter.all":"All","processes.filter.alive":"Running","processes.filter.offline":"Offline","processes.kind.all":"All types","processes.kind.worker":"Worker","processes.kind.chat":"Chat","processes.kill":"Kill","processes.killConfirm":"Kill process {slot}?","audit.title":"Audit Log","audit.subtitle":"Project lifecycle: create / modify / delete","audit.refresh":"Refresh","audit.filter.all":"All","audit.action.create":"Create","audit.action.modify":"Modify","audit.action.delete":"Delete","audit.action.daemon":"Daemon","audit.col.time":"Time","audit.col.action":"Action","audit.col.project":"Project","audit.col.detail":"Detail","audit.empty":"No audit records","lang.toggle.aria":"Switch interface language","lang.en":"EN","lang.zh":"中","theme.toggle.aria":"Switch theme","theme.dark":"Dark theme","theme.light":"Light theme","status.server":"server","status.offline":"offline","status.sse.open":"SSE","status.sse.connecting":"SSE·connect","status.sse.down":"SSE·down","status.pipelines.tooltip":"Active pipelines","status.workers.tooltip":"Active workers","status.pipeline.unit":"pipeline","status.worker.unit":"worker","common.save":"Save","common.cancel":"Cancel","common.delete":"Delete","common.confirm":"Confirm","common.create":"Create","common.edit":"Edit","common.close":"Close","common.loading":"Loading…","common.error":"Error","common.retry":"Retry","common.empty":"Nothing here yet","common.search":"Search","common.refresh":"Refresh","common.copy":"Copy","common.copied":"Copied","common.yes":"Yes","common.no":"No","common.required":"Required","common.optional":"Optional","common.ok":"OK","projects.title":"Projects","projects.count":"{count} local project(s)","projects.refresh.hint":"Click refresh to retry","projects.new":"New project","projects.selectHint":"Select a project on the left to see its details.","projects.sort.label":"Sort by","projects.sort.activity":"Activity","projects.sort.date":"Modified","projects.sort.name":"Name","projects.load.failed":"Failed to load","projects.empty.title":"No projects yet","projects.empty.hint":"Run {cmd} to create your first project.","newProject.title":"New project","newProject.subtitle":"Set up a project; the worker will run automatically","newProject.field.mode":"Execution mode","newProject.field.mode.pipeline":"Auto pipeline","newProject.field.mode.pipelineDesc":"Fixed-stage pipeline, claude worker runs cards","newProject.field.mode.smart":"SmartArrange","newProject.field.mode.smartDesc":"OpenAI monitor dispatches cards + claude worker","newProject.field.mode.pipelineHint":"Classic mode: you create cards, worker runs them by stage.","newProject.field.mode.smartHint":"Give one goal; the OpenAI monitor probes output each round, dispatches task cards dynamically, drives claude to finish.","newProject.field.goal":"Goal (GOAL.md)","newProject.field.goal.hint":"Written to docs/GOAL.md; SmartArrange derives the task list from it. Missing → tick skips the project.","newProject.field.goal.placeholder":"e.g. Build a pure-frontend, single-file Snake browser game…","newProject.field.name":"Project name","newProject.field.name.help":"Lowercase letters, digits, _ and - only","newProject.field.dir":"Project directory","newProject.field.dir.preview":"Project will be created at →","newProject.field.dir.help":"Absolute path; will be created if missing","newProject.field.branch":"Merge target branch","newProject.field.branch.help":"Default: main","newProject.field.maxWorkers":"Max concurrent workers","newProject.field.maxWorkers.help":"Per-project worker count (1 recommended)","newProject.field.ackTimeout":"ACK timeout (seconds)","newProject.field.ackTimeout.help":"How long to wait for the worker to ACK (default 300)","newProject.field.gitlabProject":"GitLab/GitHub remote","newProject.field.gitlabProject.help":"Format: user/repo (optional)","newProject.field.matrixRoom":"Matrix room ID","newProject.field.matrixRoom.help":"Optional, falls back to global default","newProject.field.git":"Enable git","newProject.field.git.help":"Off → non-code project, no commit/push/MR steps","newProject.submit":"Create project","newProject.creating":"Creating…","newProject.created":"Project created","newProject.error.dirRequired":"Project directory is required","newProject.dir.browse":"Browse","newProject.dir.browseAria":"Pick directory","newProject.back":"Back","newProject.back.aria":"Back to projects","newProject.field.name.placeholder":"e.g. acme-web","newProject.field.name.example":"Letters, digits, underscore, hyphen. e.g. acme-web","newProject.field.name.invalid":"Name only allows a-z A-Z 0-9 _ -","newProject.field.dir.long":"Absolute path of the PROJECT directory. The selected directory is the project root; project name defaults to the directory name. Has code → adopt (only adds .claude/ config, never touches source); empty → create new.","newProject.field.dir.placeholder":"/home/you/projects/my-app","newProject.field.dir.createIfMissing":"Auto-create if missing (recommended — otherwise .claude/ install gets skipped)","newProject.field.dir.pickerTitle":"Pick project directory","newProject.field.dir.adopt":"Existing content detected → will adopt (config only, source untouched)","newProject.field.dir.fresh":"Empty directory → create new project","newProject.field.name.derived":"Project name (defaults to directory name, editable)","newProject.field.maxWorkers.short":"Max workers","newProject.field.ackTimeout.minutes":"ACK timeout (min)","newProject.field.ackTimeout.minutes.help":"How long after dispatch before the worker is considered failed if no ACK","newProject.field.git.label":"Enable Git (worker auto commit + push)","newProject.field.git.detail":"When off, the worker only does the task, no version control — fits docs / data-processing non-code projects.","newProject.field.review.label":"Enable checklist review (independent agent verifies each finished card)","newProject.field.review.detail":"When on: cards carrying a checklist are verified item-by-item against the real output by an independent reviewer after the worker finishes; all-pass stays Done, any fail auto-inserts a priority fix card. Cards without a checklist are not reviewed. Write acceptance points with --checklist when creating cards.","newProject.field.git.branch":"Merge branch","newProject.field.gitlabProject.label":"Git remote project path","newProject.field.gitlabProject.help2":"Like user/repo. Empty = skip remote API (commit/push local only)","newProject.field.gitlabProject.placeholder":"user/repo","newProject.field.gitlabProjectId":"GitLab project ID","newProject.field.gitlabProjectId.help":"Number; leave blank for GitHub","newProject.field.gitlabProjectId.placeholder":"42","newProject.section.notifications":"Notifications","newProject.field.matrixRoom.label":"Matrix room ID","newProject.field.matrixRoom.help2":"Empty = use global config; blank = no notifications","newProject.field.matrixRoom.placeholder":"!abc:matrix.example.com","newProject.error.create.title":"Create failed","projectDetail.tab.pipeline":"Pipeline","projectDetail.tab.conf":"Conf","projectDetail.tab.delete":"Delete project","projectDetail.delete.title":"Delete this project","projectDetail.delete.warn":"This will remove the project conf, runtime, and worktrees. The repository under {repoDir} is untouched.","projectDetail.delete.confirmLabel":"Type the project name to confirm","projectDetail.delete.button":"Delete project","projectDetail.delete.deleting":"Deleting…","projectDetail.lastActivity":"Last activity","projectDetail.notFound":"Project not found","projectDetail.notFoundHint":"It may have been deleted or renamed.","projectDetail.backToList":"Back to projects","pipeline.editor.title":"Pipeline YAML","pipeline.editor.savedAt":"Saved {time}","pipeline.editor.unsaved":"Unsaved changes","pipeline.editor.save":"Save","pipeline.editor.saving":"Saving…","pipeline.editor.reload":"Reload from disk","pipeline.editor.discard.title":"Discard unsaved changes?","pipeline.editor.discard.body":"Your edits will be lost.","pipeline.editor.errors":"YAML parse errors","pipeline.editor.list":"Pipelines","pipeline.editor.list.add":"New pipeline","pipeline.editor.list.delete":"Delete pipeline","pipeline.editor.list.use":"Use as active","pipeline.editor.list.activeBadge":"active","pipeline.editor.list.sample":"sample","pipeline.editor.delete.confirm.title":"Delete pipeline {name}?","pipeline.editor.delete.confirm.body":"This action cannot be undone.","pipeline.newDialog.title":"New pipeline","pipeline.newDialog.field.filename":"Filename","pipeline.newDialog.field.filename.help":"Letters, digits, _ and - only; .yaml will be appended","pipeline.newDialog.field.copyFrom":"Copy from","pipeline.newDialog.copyFrom.sample":"sample template","pipeline.newDialog.copyFrom.active":"current active","pipeline.newDialog.create":"Create","projectDetail.tab.overview":"Overview","projectDetail.tab.config":"Config","projectDetail.tab.pipelines":"Pipelines","projectDetail.tab.danger":"Danger zone","projectDetail.openBoard":"Board","projectDetail.overview.repoDir":"Repo path","projectDetail.overview.pmBackend":"PM backend","projectDetail.overview.agent":"Agent","projectDetail.overview.cards":"Cards","projectDetail.overview.cards.value":"{total} total · {inprogress} in progress · {done} done","projectDetail.overview.workers":"Workers","projectDetail.overview.workers.value":"{total} total ({active} active)","projectDetail.overview.pipeline":"Pipeline","projectDetail.overview.lastActivity":"Last activity","projectDetail.overview.notFound":"Project {name} not found or unreadable.","projectDetail.config.confDirty":"● Unsaved changes","projectDetail.config.reload":"Reload","projectDetail.config.save":"Save","projectDetail.config.saveAria":"Save config","projectDetail.config.editorAria":"conf file editor","projectDetail.config.error.conflict.title":"Config was modified elsewhere","projectDetail.config.error.conflict.body":"The conf file was changed while you were editing. Click Reload, then re-edit.","projectDetail.config.error.save.title":"Save failed","projectDetail.config.error.load":"Load failed: {detail}","projectDetail.pipelines.title":"Pipelines","projectDetail.pipelines.add":"New pipeline","projectDetail.pipelines.empty":'No pipeline files yet. Click "New pipeline" to start.',"projectDetail.pipelines.activeBadge":"active","projectDetail.pipelines.edit":"Edit","projectDetail.pipelines.editAria":"Edit {name}","projectDetail.pipelines.switch":"Switch","projectDetail.pipelines.switchAria":"Switch to {name}","projectDetail.pipelines.switch.confirm.title":"Switch to {name}","projectDetail.pipelines.switch.confirm.body":"The current project.yaml will be overwritten with the contents of {name}. Continue?","projectDetail.pipelines.switch.confirm.button":"Switch","projectDetail.pipelines.switch.error":"Switch failed","projectDetail.pipelines.delete.confirm.title":"Delete {name}","projectDetail.pipelines.delete.confirm.body":"This pipeline file will be permanently deleted.","projectDetail.pipelines.delete.error":"Delete failed","projectDetail.pipelines.deleteAria":"Delete {name}","projectDetail.pipelines.create.error":"Create failed","projectDetail.danger.title":"Delete project","projectDetail.danger.body":"This clears {path} (all cards, runtime, logs).","projectDetail.danger.includeClaude.label":"Also clear repo's .claude/","projectDetail.danger.includeClaude.note":"The repo itself is untouched; only this directory is cleaned.","projectDetail.danger.confirmPrompt":"Type the project name {name} to confirm:","projectDetail.danger.deleteAria":"Permanently delete project","projectDetail.danger.deleteButton":"Permanently delete","projectDetail.danger.deleted.title":"Deleted","projectDetail.danger.deleted.bodyWithList":`Project deleted. Also cleaned up:
461
+ {paths}`,"projectDetail.danger.deleted.body":"Project deleted.","projectDetail.danger.error":"Delete failed","pipelineEditor.close":"Close","pipelineEditor.error.conflict.title":"File was modified elsewhere","pipelineEditor.error.yaml.title":"YAML syntax error","pipelineEditor.error.save.title":"Save failed","pipelineEditor.error.serialize.title":"YAML serialize failed","pipelineEditor.error.load":"Load failed: {detail}","pipelineEditor.mode.structured":"Structured","pipelineEditor.mode.yaml":"Raw YAML","pipelineEditor.parseError.prefix":"YAML parse: {detail}","pipelineEditor.activeWarning":"⚠ This is the active pipeline — saving will take effect on the next tick","pipelineEditor.yamlAria":"pipeline YAML editor","pipelineEditor.status.unsaved":"● Unsaved","pipelineEditor.status.saved":"Saved","pipelineEditor.status.noChanges":"No changes","pipelineEditor.reload":"Reload","pipelineEditor.save":"Save","pipelineEditor.saveAria":"Save pipeline","pipelineEditor.activeBadge":"active","pipelineEditor.modeHint":"project = event-driven pipeline (default) · steps = sequential script","pipelineEditor.stages.heading":"Stages ({count})","pipelineEditor.stages.add":"Add stage","pipelineEditor.stages.empty":'No stages yet. Click "Add stage" to start.',"pipelineEditor.stage.name.hint":"Unique stage name","pipelineEditor.stage.profile.hint":"skill profile, may be empty","pipelineEditor.stage.cardState.hint":"Card state during this stage","pipelineEditor.stage.timeout.hint":"Optional, e.g. 30m 2h","pipelineEditor.stage.trigger.hint":"Trigger condition, blank uses default","pipelineEditor.stage.onComplete.hint":"Action on success","pipelineEditor.stage.onFail.action.hint":"Action on failure, e.g. label NEEDS-FIX","pipelineEditor.stage.onFail.comment.hint":"Comment written on the card","pipelineEditor.stage.halt.note":"(stops pipeline on failure; uncheck to continue with next card)","pipelineEditor.stage.moveUp":"Move up","pipelineEditor.stage.moveDown":"Move down","pipelineEditor.stage.remove":"Remove stage","newPipelineDialog.title":"New pipeline","newPipelineDialog.field.filename.label":"Filename","newPipelineDialog.field.filename.placeholder":"e.g. ci","newPipelineDialog.field.filename.help":"Will be saved as {filename}. Only a-z A-Z 0-9 _ - allowed; an existing file errors 409.","newPipelineDialog.section.template":"Initial content","newPipelineDialog.template.blank.label":"Blank template","newPipelineDialog.template.blank.desc":"Minimal 1-stage pipeline (develop → Done)","newPipelineDialog.template.sample.label":"Tutorial template","newPipelineDialog.template.sample.desc":"Copied from sample.yaml.example (annotated, every field explained)","newPipelineDialog.template.sample.unavailable":"sample.yaml.example does not exist","newPipelineDialog.template.active.label":"Copy current active","newPipelineDialog.template.active.desc":"Copied from project.yaml (build on the current config)","newPipelineDialog.template.active.unavailable":"project.yaml does not exist","newPipelineDialog.create.aria":"Create pipeline","newPipelineDialog.cancel":"Cancel","board.title":"Board","board.title.bare":"Board","board.subtitle":"{name} · {cards} cards · {workers} workers active","board.pickPrompt.title":"Pick a project","board.pickPrompt.body":"The board is per-project. Pick one to start:","board.action.start":"Start","board.action.stop":"Stop","board.action.startAria":"Start pipeline","board.action.stopAria":"Stop pipeline","board.action.startError":"Failed to start pipeline","board.action.stopError":"Failed to stop pipeline","board.action.reset":"Reset","board.action.resetError":"Reset failed","board.action.reset.confirm.title":"Reset the entire pipeline","board.action.reset.confirm.body":"This clears all cards’ run state, worker markers, and branches. Cannot be undone.","board.action.reset.confirm.button":"Reset all","board.action.newCard":"New card","board.action.newCard.error":"Failed to create card","board.action.moveCard.error":"Failed to move card","board.search.placeholder":"Search title / skill / label…","board.search.aria":"Search cards","board.filter.clear":"Clear","board.filter.clearAria":"Clear filters","board.filter.aria":"Filter by {label}","board.filter.clearSelection":"Clear selection","board.error.loadCards":"Failed to load cards","board.col.planning":"Planning","board.col.backlog":"Backlog","board.col.todo":"Todo","board.col.inprogress":"Inprogress","board.col.qa":"QA / Review","board.col.done":"Done","kanban.checklist.label":"Checklist {done}/{total}","kanban.checklist.more":"… {count} more","kanban.column.empty":"— empty —","kanban.time.justNow":"just now","kanban.time.minutes":"{n}m ago","kanban.time.hours":"{n}h ago","kanban.time.days":"{n}d ago","newCard.title":"New card","newCard.field.title":"Title *","newCard.field.title.placeholder":"e.g. Add GitHub OAuth login","newCard.field.title.help":"Short, clear goal (<200 chars)","newCard.field.description":"Description","newCard.field.description.placeholder":"User story, requirements, acceptance criteria, references… Claude reads this when starting","newCard.field.description.help":"Markdown supported. If empty, Claude only sees the title.","newCard.field.skills":"Skills","newCard.field.skills.help":"Pick which skills get loaded (via frontmatter `skills:`). Optional — worker falls back to project-level skills.","newCard.field.skills.loading":"Loading skills…","newCard.field.skills.error":"Failed to load skills (creation still works): {detail}","newCard.field.skills.selected":"{count} selected: {names}","newCard.field.dispatch":"Dispatch","newCard.field.dispatch.label":"Dispatch immediately (go straight to Backlog)","newCard.field.dispatch.help":"Default off: card lands in Planning to wait; drag to Backlog when ready. On: skip Planning, the next tick assigns a worker.","newCard.create.aria":"Create card","cardDetail.loading":"Loading…","cardDetail.error.load":"Failed to load card","cardDetail.tabs.overview":"Overview","cardDetail.tabs.body":"Description","cardDetail.tabs.checklist":"Checklist","cardDetail.tabs.history":"History","cardDetail.tabs.actions":"Actions","cardDetail.field.state":"State","cardDetail.field.skills":"Skills","cardDetail.field.labels":"Labels","cardDetail.field.branch":"Branch","cardDetail.field.assignee":"Assignee","cardDetail.field.created":"Created","cardDetail.field.updated":"Updated","cardDetail.field.empty":"—","cardDetail.actions.delete":"Delete card","cardDetail.actions.delete.confirm.title":"Delete card #{seq}","cardDetail.actions.delete.confirm.body":"This card will be permanently deleted.","cardDetail.actions.delete.error":"Delete failed","cardDetail.actions.update.error":"Update failed","cardDetail.body.empty":"No description","cardDetail.checklist.empty":"No checklist","cardDetail.checklist.progress":"Progress {done}/{total}","cardDetail.history.empty":"No history","cardDetail.notFound":"Card #{seq} not found","cardDetail.copy.aria":"Copy seq","cardDetail.close.aria":"Close","cardDetail.save":"Save","cardDetail.saving":"Saving…","workers.title":"Workers","workers.summary":"Across {projects} projects · {running} running · {starting} starting · {stuck} stuck · {crashed} crashed · {idle} idle","workers.summary.stuck":"{n} stuck","workers.summary.crashed":"{n} crashed","workers.refresh.aria":"Refresh","workers.refresh":"Refresh","workers.error.load":"Load failed: {detail}","workers.empty.hint":"Click a project / worker to see details","logs.title":"Logs 📜","logs.subtitle.allProjects":"All projects","logs.subtitle.project":"{name} live tail","logs.filter.errors":"Errors only","logs.filter.errors.aria":"Show errors only","logs.filter.search.placeholder":"Filter messages…","logs.empty":"No logs yet — waiting for events","logs.error.load":"Failed to load logs","logs.refresh":"Refresh","logs.refresh.aria":"Refresh logs","logs.scroll.bottom.aria":"Scroll to bottom","logs.scroll.pause":"Paused (autoscroll off)","logs.scroll.resume":"Resume autoscroll","logs.subtitle.allProjectsCount":"All projects ({count})","logs.poll.5s":"5s polling","logs.paused":"⏸ PAUSED","logs.mode.live":"Live","logs.mode.history":"History","logs.history.startAria":"Query start time","logs.history.queryAria":"Query","logs.history.query":"Query","logs.filter.project.aria":"Filter project","logs.filter.project.all":"All projects","logs.filter.keyword.placeholder":"Filter keyword…","logs.filter.keyword.aria":"Filter logs","logs.empty.match":"No matching logs","skills.title":"Skills 🧠","skills.subtitle":"Skills shared across projects (managed via `sps skill ...`)","skills.empty.title":"No skills yet","skills.empty.hint":"Run {cmd} to sync the bundled skills.","skills.linked.tooltip":"linked into this project","skills.frozen.tooltip":"frozen (per-project copy)","skills.category.all":"All","skills.category.language":"language","skills.category.end":"end","skills.category.persona":"persona","skills.category.workflow":"workflow","skills.category.other":"other","skills.subtitleCount":"{count} user-level skill(s)","skills.search.placeholder":"Search skill…","skills.search.aria":"Search skill","skillDetail.actionFailed":"{label} failed","skillDetail.unfreezeAction":"Unfreeze","skillDetail.freezeAction":"Freeze","skillDetail.removeAction":"Remove","skillDetail.removeConfirm.title":"Remove {name} from {project}","skillDetail.removeConfirm.body":"The skill link will be removed; the project will not see this skill on next run.","skillDetail.removeConfirm.button":"Remove","skillDetail.unfreezeConfirm.title":"Unfreeze {name} @ {project}","skillDetail.unfreezeConfirm.body":"Local changes to this skill will be overwritten with the latest shared version.","skillDetail.unfreezeConfirm.button":"Unfreeze","skillDetail.close.aria":"Close","skillDetail.loading":"Loading…","skillDetail.error.load":"Load failed: {detail}","skillDetail.section.projects":"Per-project link status","skillDetail.section.empty":"No projects yet. Create one first.","skillDetail.section.preview":"SKILL.md preview","skillDetail.toggleSection.aria":"{action} {file}","skillDetail.expand":"Expand","skillDetail.collapse":"Collapse","system.title":"System 🛠","system.subtitle":"Global config + diagnostics + upgrades","system.section.env":"Global env","system.section.env.help":"Stored in ~/.coral/env (mode 600). Used by all projects.","system.section.env.save":"Save env","system.section.env.error.conflict":"env was modified elsewhere","system.section.env.error.save":"Failed to save env","system.section.env.error.load":"Failed to load env","system.section.env.dirtyDot":"● Unsaved","system.section.env.aria":"env editor","system.section.env.reload":"Reload","system.section.upgrade":"Upgrade","system.section.upgrade.current":"Current: v{version}","system.section.upgrade.latest":"Latest on npm: v{version}","system.section.upgrade.uptodate":"Up to date","system.section.upgrade.update":"Upgrade now","system.section.upgrade.upgrading":"Upgrading…","system.section.upgrade.checking":"Checking npm…","system.section.upgrade.checkError":"Check failed: {detail}","system.section.upgrade.upgradeError":"Upgrade failed: {detail}","system.section.upgrade.upgradeError.title":"Upgrade failed","system.section.upgrade.command":"Or run in terminal: {cmd}","system.section.upgrade.runningPipelines":"Pipelines running — stop them first: {projects}","system.section.diagnostics":"Diagnostics","system.section.diagnostics.help":"Run sps doctor across all projects, see failures at a glance","system.section.diagnostics.run":"Run diagnostics","system.section.diagnostics.running":"Running…","system.section.diagnostics.empty":"No projects","system.section.diagnostics.checkAria":"Check {project}","system.section.diagnostics.statusOk":"OK","system.section.diagnostics.statusFail":"Issues","system.section.diagnostics.error":"Diagnostic failed: {detail}","system.h1":"System","system.runtime":"Runtime","system.memory.title":"Memory backend","system.memory.desc":"Global setting: which backend workers read/write memory through. Applies to newly dispatched cards.","system.memory.provider":"Backend","system.memory.url":"Custom URL","system.memory.url.placeholder":"http://127.0.0.1:3111","system.memory.save":"Save","system.memory.save.aria":"Save memory backend setting","system.memory.saved":"Saved","system.memory.error":"Save failed","system.memory.opt.none":"Off (none)","system.memory.opt.builtin":"Local file memory (builtin)","system.memory.opt.agentmemory":"agentmemory (semantic)","system.memory.opt.custom":"Custom REST (custom)","system.env.title.code":"~/.coral/env","system.env.title.prefix":"Global config ","system.env.edit.aria":"Edit env file","system.env.edit.button":"Edit","system.env.editing.label":"⚠ Editing","system.env.empty.before":'env file does not exist. Click "Edit" or run ',"system.env.empty.after":" in the terminal.","system.env.warning":"⚠ This file contains plaintext credentials. Keep mode 0600 on save.","system.env.aria":"env editor","system.env.dirtyMark":" · ● Unsaved","system.env.cancel":"Cancel","system.env.save":"Save","system.env.save.aria":"Save env","system.env.error.conflict.title":"env was modified elsewhere","system.env.error.save.title":"Save failed","system.env.error.conflict.body":"Cancel and reopen the editor.","system.upgrade.title":"Version","system.upgrade.checkLatest.aria":"Check latest version","system.upgrade.checkUpdate":"Check update","system.upgrade.label.current":"sps-cli (current)","system.upgrade.label.latest":"npm (latest)","system.upgrade.latestPill":"latest","system.upgrade.button.upgradeAria":"Upgrade to latest","system.upgrade.button.upgrade":"Upgrade","system.upgrade.button.copyAria":"Copy upgrade command","system.upgrade.button.copyTitle":"Copy command (run manually if auto upgrade fails)","system.upgrade.button.copy":"Copy command","system.upgrade.label.installed":"Installed","system.upgrade.installed.ok":"Active (restart console to see)","system.upgrade.installed.fail":"Upgrade not effective","system.upgrade.label.check":"Check","system.upgrade.confirm.title":"Upgrade sps-cli","system.upgrade.confirm.body":"Current {current}, upgrade to {latest}. Requires all pipelines stopped. Restart sps console after upgrade.","system.upgrade.confirm.button":"Upgrade","system.upgrade.success.title":"Upgrade complete","system.upgrade.success.body":'Installed v{version}. Run `pkill -f "sps console"` and restart to see it.',"system.upgrade.notEffective.title":"Upgrade not effective","system.upgrade.notEffective.same":"npm finished but the version did not change (still {version}) — likely a permissions or registry issue. Copy the command below to run manually.","system.upgrade.notEffective.notInstalled":"npm did not install a new version. Copy the command to run manually, or check the log below.","system.upgrade.error.title":"Upgrade failed","system.upgrade.copy.success.title":"Command copied","system.upgrade.copy.success.body":`Paste it into a terminal:
462
+ {cmd}`,"system.upgrade.copy.fail.title":"Copy failed","system.upgrade.copy.fail.body":`Copy manually:
463
+ {cmd}`,"system.diagnostics.title":"Project health check","system.diagnostics.checkAll":"Check all","system.diagnostics.empty":"No projects yet.","system.diagnostics.expandAria":"Expand","system.diagnostics.collapseAria":"Collapse","system.diagnostics.never":'Click "Check" to run sps doctor',"system.diagnostics.checkAria":"Check","system.diagnostics.check":"Check","system.diagnostics.noFixesNeeded":"Nothing to fix","system.diagnostics.fix.tip":"Run sps doctor <proj> --fix: auto-create .claude/hooks/stop.sh, state.json, etc.","system.diagnostics.fixAria":"Auto fix","system.diagnostics.fix":"Fix","system.diagnostics.fixed":"Fixed","system.diagnostics.error.fix":"doctor fix failed","system.diagnostics.error.check":"doctor check failed","chat.title":"Chat 💬","chat.empty.title":"Chat 💬","chat.empty.hint":'Click "New chat" on the left to start a session, or just type below — a session will be auto-created.',"chat.empty.shortcuts":"Enter to send · Shift+Enter for newline · streamed reply","chat.list.heading":"History {count}","chat.list.new":"New chat","chat.list.empty":"No chats yet. Click above to start.","chat.list.delete.aria":"Delete chat","chat.list.deleteCli.aria":"Remove this CLI session from the Console (does not affect Claude jsonl history)","chat.list.openAria":"Open chat {title}{cwd}","chat.list.cwdSuffix":" (cwd: {cwd})","chat.list.msgs":"{count} msg · {time}","chat.list.olderToggle":"Earlier · {count}","chat.detail.model.tooltip":"Current model in use","chat.detail.claudeSession.tooltip":"Underlying claude session id — the anchor for resuming session & memory","chat.delete.confirm.title":"Delete chat","chat.delete.confirm.body.cli":"Will be removed from the Console list (the daemon session is stopped). The Claude CLI history under ~/.claude/projects is preserved — to continue, run `sps agent --chat --name <name>` in a terminal.","chat.delete.confirm.body.console":"Chat history will be permanently deleted.","chat.delete.confirm.button":"Delete","chat.cli.banner.bold":"CLI session","chat.cli.banner":"This session was created by sps agent. The Console only shows history. To continue, run in a terminal:","chat.input.placeholder":"Say something… (Enter to send, Shift+Enter for newline, drag files / paste images)","chat.input.dragOver":"Drop to attach…","chat.input.aria":"Message input","chat.input.attach.aria":"Attach a local file","chat.input.attach.title":"Attach a local file (also drag / paste images)","chat.input.send":"Send","chat.input.send.aria":"Send","chat.input.interrupt":"Stop","chat.input.interrupt.aria":"Stop generation","chat.input.uploading":"Uploading…","chat.input.removeAttachment":"Remove {name}","chat.error.interrupt.title":"Interrupt failed","chat.cliBadge":"CLI","chat.cliBadge.tooltip":"Created by sps agent CLI; history is read live from Claude jsonl (read-only).","chat.session.title":"{title}","chat.session.id":"{id}","chat.session.empty":"Type a question below to start · Enter to send · Shift+Enter for newline","notFound.title":"404","notFound.body":"This page does not exist.","notFound.home":"Back to home","workers.active.empty":"No workers running.","workers.alerts.allHealthy":"All workers healthy","workers.alerts.pidDead":"PID dead.","workers.alerts.markerStale":"marker stale {ago}.","workers.capacity.col.project":"Project","workers.capacity.col.usage":"Usage","workers.capacity.col.other":"Other","workers.capacity.detailHint":"details →","workers.panel.boardLink":"Board →","workers.panel.loading":"Loading workers…","workers.panel.empty.slots":"This project has no worker slots.","workers.panel.empty.noWorker":"No workers","workers.panel.empty.pickOne":"Pick a worker","workers.panel.idle.short":"idle","workers.panel.section.currentCard":"Current card","workers.panel.idle.full":"Slot idle, no current card.","workers.panel.section.claudeOutput":"Claude output · last {n} lines","workers.panel.output.loading":"Loading…","workers.panel.output.empty":"No session output yet. The worker needs a few seconds to start.","workers.panel.section.heartbeat":"Supervisor heartbeat · last {n} lines","workers.panel.heartbeat.fullLog":"View full log →","workers.panel.action.restart":"Restart","workers.panel.action.restart.confirm.title":"Restart worker-{slot}","workers.panel.action.restart.confirm.body":"Kill the process, then re-launch onto #{seq}","workers.panel.action.restart.confirm.button":"Restart","workers.panel.action.restart.error":"Restart failed","workers.panel.action.kill":"Kill","workers.panel.action.kill.confirm.title":"Kill worker-{slot}","workers.panel.action.kill.confirm.body":"The current task will be force-aborted.","workers.panel.action.kill.confirm.button":"Kill","workers.panel.action.kill.error":"Kill failed","dialog.confirm.default":"OK","dialog.alert.default":"Got it","dialog.cancel.default":"Cancel","dirPicker.title.default":"Pick a directory","dirPicker.close.aria":"Close","dirPicker.up.aria":"Parent directory","dirPicker.up.title":"Parent directory","dirPicker.home.aria":"Back to home","dirPicker.home.title":"Back to home","dirPicker.loading":"Loading…","dirPicker.error.title":"Read failed","dirPicker.empty":"— empty —","dirPicker.enter.aria":"Enter {name}/","dirPicker.pickFile.aria":"Pick {name} (double-click to confirm)","dirPicker.fileLocked":"File not selectable","dirPicker.cancel":"Cancel","dirPicker.useFile":"Use this file","dirPicker.useFile.tooltip.empty":"Click a file first","dirPicker.useDir":"Use this directory","dirPicker.newDir":"New folder","dirPicker.newDir.aria":"Create a subdirectory in the current directory","dirPicker.newDir.prompt":"New folder name (letters, digits, _ . - only)","dirPicker.newDir.placeholder":"Folder name","dirPicker.newDir.create":"Create","dirPicker.newDir.error.title":"Failed to create folder","errorBoundary.title":"💥 UI crashed","errorBoundary.refresh":"Refresh page","chat.error.create.title":"Failed to create chat","chat.error.send.title":"Send failed","chat.error.fileTooBig.title":"File too large","chat.error.fileTooBig.body":"Per-file limit is 50 MB; this is {size} MB ({name})","chat.error.uploadAttachment.title":"Attachment upload failed","chat.placeholder.attachment":"(attachment)","chat.placeholder.viewAttachment":"(see attachment)","chat.placeholder.attachmentTitle":"Attachment","chat.attachment.previewTooltip":`{name}
464
+ {path}
465
+ Click to preview`,"chat.attachment.previewSimpleTooltip":`{name}
466
+ Click to zoom`,"chat.attachment.preview.aria":"Preview {name}","chat.attachment.close.aria":"Close","chat.attachment.readErr":"Read failed: {detail}","chat.attachment.loading":"Loading…","chat.attachment.unsupported":"This file type cannot be previewed inline.","chat.attachment.download":"Download","chat.message.role.you":"You","chat.message.role.error":"Error","chat.message.role.assistant":"assistant","chat.message.truncated":"⚠ Output exceeded 10MB and was truncated","chat.filePicker.title":"Pick attachment file","chat.newSession.title":"New chat","chat.newSession.title.aria":"New chat","chat.newSession.close.aria":"Close","chat.newSession.field.agent":"Agent","chat.newSession.field.model":"Model (optional)","chat.newSession.field.model.default":"Use global default model","chat.newSession.field.title":"Title (optional)","chat.newSession.field.title.placeholder":"Empty = auto-generate from first message","chat.newSession.field.cwd":"Working directory (optional)","chat.newSession.field.cwd.browse":"Browse","chat.newSession.field.cwd.browseAria":"Pick directory","chat.newSession.field.cwd.title":"Pick directory","chat.newSession.field.cwd.help1":"The agent reads/writes files here. Absolute path; must exist.","chat.newSession.field.cwd.help2":"Empty = use the daemon’s startup cwd.","chat.newSession.cancel":"Cancel","chat.newSession.create":"Create","cardModal.editing":"⚠ Editing","cardModal.title.aria":"Card title","cardModal.editAria":"Edit card","cardModal.edit":"Edit","cardModal.close.aria":"Close","cardModal.error.save.title":"Save failed","cardModal.error.load":"Load failed: {detail}","cardModal.skills.loading":"Loading skill list…","cardModal.label.removeAria":"Remove {label}","cardModal.label.addPlaceholder":"+ Add label","cardModal.label.addAria":"Add label","cardModal.label.note":"Note: AI-PIPELINE / STARTED-* / COMPLETED-* / NEEDS-FIX are managed by the pipeline; manual changes may be overwritten","cardModal.section.description":"Description","cardModal.section.empty":"(empty)","cardModal.section.checklist":"Checklist","cardModal.checklist.empty":"No checklist items. Add `- [ ] item` syntax in the description.","cardModal.section.log":"Log","cardModal.body.aria":"Card description","cardModal.body.replaceNote":'Only replaces the "## Description" section; checklist and log sections are untouched.',"cardModal.action.launch":"Launch worker","cardModal.action.launch.disabledDone":"Card is done; drag back to Todo to launch","cardModal.action.launch.disabledRunning":"Pipeline is running — supervisor dispatches automatically, no manual launch needed","cardModal.action.launch.error":"Launch worker failed","cardModal.action.reset":"Reset card","cardModal.action.reset.confirm.title":"Reset card #{seq}","cardModal.action.reset.confirm.body":"Card state goes back to initial; checklist progress is cleared.","cardModal.action.reset.confirm.button":"Reset","cardModal.action.reset.error":"Reset failed","cardModal.action.delete":"Delete card","cardModal.action.delete.confirm1.title":"Delete card #{seq}","cardModal.action.delete.confirm1.body":'About to delete "{title}". This cannot be undone (the md file is physically removed). Continue?',"cardModal.action.delete.confirm1.button":"Continue","cardModal.action.delete.confirm2.title":"Final confirmation","cardModal.action.delete.confirm2.body":"Please re-confirm deleting card #{seq}.","projectDetail.tab.skills":"Skills","projectDetail.tab.rules":"Rules","projectDetail.skills.title":"Skill whitelist","projectDetail.skills.desc":"Pick which skills this project loads. Narrows what workers, subagents and chat see — cuts token cost.","projectDetail.skills.noPolicy":"No whitelist — all skills are available (subagents load the full set from disk).","projectDetail.skills.hasPolicy":"Whitelist active — {count} skill(s) eligible.","projectDetail.skills.save":"Save whitelist","projectDetail.skills.clear":"Clear (load all)","projectDetail.skills.saveError":"Failed to save whitelist","projectDetail.skills.applied":"Saved. Projected {linked} linked, {pruned} pruned.","projectDetail.skills.unknown":"Unknown skill name(s), ignored: {names}","projectDetail.skills.empty":"No skills installed. Run `sps skill sync` first.","projectDetail.skills.selectAll":"Select all","projectDetail.skills.selectNone":"Select none","projectDetail.rules.title":"Project rules (read-only)","projectDetail.rules.readonly":"sps-cli only reads these. Editing is done at project creation or by an agent later.","projectDetail.rules.missing":"Not present","nav.prompts":"Prompts","prompts.title":"Prompt library","prompts.desc":"Reusable prompts with {{variable}} templates. Insert them into chat.","prompts.new":"New prompt","prompts.search":"Search prompts…","prompts.empty":"No prompts yet. Create one.","prompts.name":"Name","prompts.namePlaceholder":"kebab-case, e.g. code-review","prompts.nameError":"Name must be kebab-case (a-z, 0-9, dashes).","prompts.description":"Description","prompts.tags":"Tags","prompts.tagsPlaceholder":"comma,separated","prompts.body":"Body","prompts.bodyPlaceholder":"Write your prompt. Use {{variable}} for fill-ins.","prompts.favorite":"Favorite","prompts.save":"Save","prompts.delete":"Delete","prompts.deleteConfirm":'Delete prompt "{name}"? This removes the file.',"prompts.saveError":"Failed to save prompt","prompts.vars":"Variables: {names}","prompts.noVars":"No variables","prompts.insert":"Insert a prompt","prompts.selectHint":"Select a prompt on the left, or create a new one.","prompts.tagAdd":"Type a tag, press Enter","prompts.ai":"AI generate","prompts.ai.title":"AI generate a prompt","prompts.ai.intent":"Describe what you want","prompts.ai.placeholder":"e.g. a prompt for reviewing TypeScript code for security issues","prompts.ai.submit":"Generate","prompts.ai.wait":"The agent is writing… this can take a while.","prompts.ai.error":"Generation failed","skills.import":"Import","skills.import.title":"Import a skill","skills.import.name":"Name (kebab-case)","skills.import.body":"SKILL.md content","skills.import.submit":"Import","skills.import.error":"Import failed","skills.export":"Export SKILL.md","skills.updates.badge":"{count} update(s) available","skills.updates.none":"Up to date","skills.ai":"AI create","skills.ai.title":"AI create a skill","skills.ai.name":"Name (kebab-case)","skills.ai.intent":"What is this skill for?","skills.ai.placeholder":"e.g. how to write idiomatic Rust error handling","skills.ai.submit":"Create","skills.ai.wait":"The agent is writing the skill… this can take a while.","skills.ai.error":"Create failed","projectDetail.tab.graph":"Code Graph","projectDetail.tab.logs":"Logs","graph.title":"Code Graph","graph.desc":"A symbol-level dependency graph of this project (tree-sitter, zero-token). Gives agents surgical context so they explore fewer files.","graph.build":"Build graph","graph.rebuild":"Rebuild","graph.building":"Building…","graph.sync":"Sync","graph.syncing":"Syncing…","graph.sync.desc":"Incremental — only re-index changed files (fast)","graph.empty":"No graph yet — build one to enable agent navigation and the dependency view.","graph.buildFailed":"Build failed","graph.stat.files":"Files","graph.stat.nodes":"Nodes","graph.stat.edges":"Edges","graph.stat.db":"DB size","graph.stat.lastBuilt":"Last built","graph.viz.title":"File dependency graph","graph.viz.loading":"Loading graph…","graph.viz.empty":"Build the graph to see the dependency view.","graph.viz.hint":"Node = file · edge = import · drag to explore · search to highlight","graph.viz.search":"Highlight files…"},T3={"app.title":"SPS 控制台","nav.chat":"对话","nav.projects":"项目","nav.board":"看板","nav.workers":"Workers","nav.logs":"日志","nav.skills":"技能","nav.system":"系统","nav.processes":"进程","nav.audit":"审计日志","nav.memory":"记忆","nav.plugins":"插件","plugins.h1":"插件","plugins.desc":"全局插件开关。改动对之后新派发的卡生效。","plugins.tab.memory":"记忆","plugins.tab.channel":"频道","plugins.tab.model":"模型","plugins.tab.tool":"工具","plugins.comingSoon":"即将上线","plugins.model.title":"智能体模型","plugins.model.desc":"配置两个智能体的模型(全局)。worker=claude 执行、review·designer=openai 监工+编排。","plugins.model.worker":"Worker(执行 / claude)","plugins.model.reviewer":"Review·Designer(监工 / openai)","plugins.model.provider":"Provider","plugins.model.model":"模型","plugins.model.official":"官方 claude(默认)","plugins.model.save":"保存","plugins.model.saved":"已保存","plugins.model.error":"保存失败","nav.arrange":"编排","arrange.h1":"智能编排","arrange.project":"项目","arrange.none":"尚未开始 — 点上方「启动」拉起编排(几秒后出任务清单,确认即跑)。若下拉无项目,先在「新建项目」选智能编排模式。","arrange.start":"启动","arrange.stop":"停止","arrange.startErr":"启动/停止失败","arrange.view":"切换画板视图","arrange.viewFree":"自由","arrange.viewLane":"泳道","arrange.starting":"启动中,正在拆解任务清单…","arrange.planning":"正在拆解任务清单…","arrange.orchestrating":"正在编排中…","arrange.status":"状态","arrange.goal":"目标","arrange.plan":"任务清单 + 卡链路","arrange.approve":"确认任务清单","arrange.approveErr":"确认失败","arrange.tasks":"任务清单","arrange.collapse":"收起","arrange.expand":"展开任务清单","arrange.noCards":"暂无卡片 — 等待 orchestrator 派卡(确认清单后开始)。","arrange.cardPrompt":"卡片提示词","arrange.cardSkills":"技能","arrange.cardTask":"所属任务","arrange.cardLog":"日志","arrange.close":"关闭","arrange.cardsCount":"张卡","nav.aria":"主导航","memory.sub":"跨项目记忆 · 经 console 鉴权代理 agentmemory","memory.searchPlaceholder":"搜索记忆…(如:三消美术竞态怎么修)","memory.search":"搜索","memory.results":"召回结果","memory.rawHint":"(原始观察 · 接入实时捕获+压缩后这里会显示提炼的教训)","memory.sessions":"最近会话","memory.empty":"暂无记忆 · 接入实时捕获(P1)后自动累积","processes.title":"进程监控","processes.subtitle":"SPS ACP 启动的 claude 进程(其它途径启动的,如你自己的会话,不显示)","processes.refresh":"刷新","processes.aliveCount":"运行中 {n}","processes.col.kind":"类型","processes.col.slot":"会话槽","processes.col.project":"项目","processes.col.state":"状态","processes.col.memory":"内存","processes.col.action":"操作","processes.empty":"没有 SPS 进程","processes.filter.all":"全部","processes.filter.alive":"运行中","processes.filter.offline":"离线","processes.kind.all":"全部类型","processes.kind.worker":"构建 Worker","processes.kind.chat":"对话","processes.kill":"关闭","processes.killConfirm":"确定关闭进程 {slot}?","audit.title":"审计日志","audit.subtitle":"项目生命周期:创建 / 修改 / 删除","audit.refresh":"刷新","audit.filter.all":"全部","audit.action.create":"创建","audit.action.modify":"修改","audit.action.delete":"删除","audit.action.daemon":"Daemon","audit.col.time":"时间","audit.col.action":"动作","audit.col.project":"项目","audit.col.detail":"详情","audit.empty":"暂无审计记录","lang.toggle.aria":"切换界面语言","lang.en":"EN","lang.zh":"中","theme.toggle.aria":"切换主题","theme.dark":"暗色主题","theme.light":"亮色主题","status.server":"服务","status.offline":"离线","status.sse.open":"SSE","status.sse.connecting":"SSE·连接中","status.sse.down":"SSE·断开","status.pipelines.tooltip":"活跃流水线数","status.workers.tooltip":"活跃 Worker 数","status.pipeline.unit":"流水线","status.worker.unit":"Worker","common.save":"保存","common.cancel":"取消","common.delete":"删除","common.confirm":"确认","common.create":"创建","common.edit":"编辑","common.close":"关闭","common.loading":"加载中…","common.error":"出错","common.retry":"重试","common.empty":"暂无内容","common.search":"搜索","common.refresh":"刷新","common.copy":"复制","common.copied":"已复制","common.yes":"是","common.no":"否","common.required":"必填","common.optional":"可选","common.ok":"好","projects.title":"项目","projects.count":"本机有 {count} 个项目","projects.refresh.hint":"点击刷新重试","projects.new":"新建项目","projects.selectHint":"在左侧选择一个项目查看详情。","projects.sort.label":"排序方式","projects.sort.activity":"活跃度","projects.sort.date":"修改日期","projects.sort.name":"名字","projects.load.failed":"加载失败","projects.empty.title":"还没有项目","projects.empty.hint":"运行 {cmd} 创建第一个项目。","newProject.title":"新建项目","newProject.subtitle":"配置一个项目,worker 自动开跑","newProject.field.mode":"执行模式","newProject.field.mode.pipeline":"自动工作流","newProject.field.mode.pipelineDesc":"固定阶段流水线,claude worker 按卡执行","newProject.field.mode.smart":"智能编排","newProject.field.mode.smartDesc":"OpenAI 监工动态派卡 + claude worker 执行","newProject.field.mode.pipelineHint":"传统模式:你建卡片,worker 按阶段跑。","newProject.field.mode.smartHint":"给一个总目标,OpenAI 监工每轮探查产物、动态生成任务卡、驱动 claude 完成。","newProject.field.goal":"总目标 (GOAL.md)","newProject.field.goal.hint":"写入 docs/GOAL.md;智能编排据此拆任务清单。缺失则 tick 跳过该项目。","newProject.field.goal.placeholder":"例:做一个纯前端、单文件可运行的贪吃蛇网页小游戏…","newProject.field.name":"项目名","newProject.field.name.help":"只允许小写字母、数字、_ 和 -","newProject.field.dir":"项目目录","newProject.field.dir.preview":"项目将创建在 →","newProject.field.dir.help":"绝对路径;不存在会自动创建","newProject.field.branch":"合并目标分支","newProject.field.branch.help":"默认 main","newProject.field.maxWorkers":"最大并发 Worker 数","newProject.field.maxWorkers.help":"单项目并发数(推荐 1)","newProject.field.ackTimeout":"ACK 超时(秒)","newProject.field.ackTimeout.help":"Worker 响应等待秒数(默认 300)","newProject.field.gitlabProject":"GitLab/GitHub 远程","newProject.field.gitlabProject.help":"格式:用户名/仓库(可选)","newProject.field.matrixRoom":"Matrix 房间 ID","newProject.field.matrixRoom.help":"可选;不填则用全局默认","newProject.field.git":"启用 git","newProject.field.git.help":"关闭 → 非代码项目,跳过 commit/push/MR","newProject.submit":"创建项目","newProject.creating":"创建中…","newProject.created":"项目已创建","newProject.error.dirRequired":"项目目录必填","newProject.dir.browse":"浏览","newProject.dir.browseAria":"选择目录","newProject.back":"返回","newProject.back.aria":"返回项目列表","newProject.field.name.placeholder":"例如:acme-web","newProject.field.name.example":"只能用字母、数字、下划线、连字符。例如 acme-web","newProject.field.name.invalid":"名称只能包含 a-z A-Z 0-9 _ -","newProject.field.dir.long":"本机绝对路径的【项目目录】。选中的目录本身就是项目根;项目名默认取目录名。已有代码 → 收编(只加 .claude/ 配置,不动源码);空目录 → 新建。","newProject.field.dir.placeholder":"/home/you/projects/my-app","newProject.field.dir.createIfMissing":"目录不存在时自动创建(推荐 —— 否则 .claude/ 安装会被跳过)","newProject.field.dir.pickerTitle":"选择项目目录","newProject.field.dir.adopt":"检测到已有内容 → 将收编(只加配置,不动源码)","newProject.field.dir.fresh":"空目录 → 新建项目","newProject.field.name.derived":"项目名(默认取目录名,可微调)","newProject.field.maxWorkers.short":"最大 Worker 数","newProject.field.ackTimeout.minutes":"ACK 超时(分钟)","newProject.field.ackTimeout.minutes.help":"Worker 启动后多久没 ACK 视为失败","newProject.field.git.label":"启用 Git(Worker 自动 commit + push)","newProject.field.git.detail":"关闭后 Worker 只做任务、不做版本控制;适合文档/数据处理等非代码项目。","newProject.field.review.label":"启用清单验收(每卡完成后独立 agent 审核)","newProject.field.review.detail":"开启后:卡带「检查清单」的,Worker 完成后由独立 reviewer 逐条对着真实产物验收;全过留 Done,有不过自动插一张修正卡(优先跑)。无清单的卡不审。建卡时用 --checklist 写验收点。","newProject.field.git.branch":"合并分支","newProject.field.gitlabProject.label":"Git 远程项目路径","newProject.field.gitlabProject.help2":"如 user/repo,空则跳过远程 API(只本地 commit/push)","newProject.field.gitlabProject.placeholder":"user/repo","newProject.field.gitlabProjectId":"GitLab 项目 ID","newProject.field.gitlabProjectId.help":"数字;GitHub 用户留空","newProject.field.gitlabProjectId.placeholder":"42","newProject.section.notifications":"通知","newProject.field.matrixRoom.label":"Matrix 房间 ID","newProject.field.matrixRoom.help2":"空则使用全局配置;不填 = 不通知","newProject.field.matrixRoom.placeholder":"!abc:matrix.example.com","newProject.error.create.title":"创建失败","projectDetail.tab.pipeline":"流水线","projectDetail.tab.conf":"配置","projectDetail.tab.delete":"删除项目","projectDetail.delete.title":"删除该项目","projectDetail.delete.warn":"会删除项目配置、运行时和 worktree。{repoDir} 下的代码仓库不动。","projectDetail.delete.confirmLabel":"输入项目名以确认","projectDetail.delete.button":"删除项目","projectDetail.delete.deleting":"删除中…","projectDetail.lastActivity":"最后活跃","projectDetail.notFound":"项目不存在","projectDetail.notFoundHint":"可能已被删除或重命名。","projectDetail.backToList":"返回项目列表","pipeline.editor.title":"流水线 YAML","pipeline.editor.savedAt":"{time} 已保存","pipeline.editor.unsaved":"有未保存的修改","pipeline.editor.save":"保存","pipeline.editor.saving":"保存中…","pipeline.editor.reload":"从磁盘重新加载","pipeline.editor.discard.title":"放弃未保存的修改?","pipeline.editor.discard.body":"你的编辑会丢失。","pipeline.editor.errors":"YAML 解析错误","pipeline.editor.list":"流水线","pipeline.editor.list.add":"新建流水线","pipeline.editor.list.delete":"删除流水线","pipeline.editor.list.use":"设为当前","pipeline.editor.list.activeBadge":"当前","pipeline.editor.list.sample":"示例","pipeline.editor.delete.confirm.title":"删除流水线 {name}?","pipeline.editor.delete.confirm.body":"此操作不可撤销。","pipeline.newDialog.title":"新建流水线","pipeline.newDialog.field.filename":"文件名","pipeline.newDialog.field.filename.help":"只允许字母、数字、_ 和 -;自动追加 .yaml","pipeline.newDialog.field.copyFrom":"复制自","pipeline.newDialog.copyFrom.sample":"示例模板","pipeline.newDialog.copyFrom.active":"当前活动","pipeline.newDialog.create":"创建","projectDetail.tab.overview":"概览","projectDetail.tab.config":"配置","projectDetail.tab.pipelines":"流水线","projectDetail.tab.danger":"危险操作","projectDetail.openBoard":"看板","projectDetail.overview.repoDir":"仓库路径","projectDetail.overview.pmBackend":"PM 后端","projectDetail.overview.agent":"Agent","projectDetail.overview.cards":"卡片","projectDetail.overview.cards.value":"共 {total} 张 · {inprogress} 进行中 · {done} 完成","projectDetail.overview.workers":"Worker","projectDetail.overview.workers.value":"共 {total} 个({active} 活跃)","projectDetail.overview.pipeline":"Pipeline","projectDetail.overview.lastActivity":"最近活动","projectDetail.overview.notFound":"项目 {name} 不存在或无法读取。","projectDetail.config.confDirty":"● 未保存的修改","projectDetail.config.reload":"重新加载","projectDetail.config.save":"保存","projectDetail.config.saveAria":"保存配置","projectDetail.config.editorAria":"conf 文件编辑器","projectDetail.config.error.conflict.title":"配置已被其他地方修改","projectDetail.config.error.conflict.body":'conf 文件在你编辑期间被改过。点"重新加载"后再编辑。',"projectDetail.config.error.save.title":"保存失败","projectDetail.config.error.load":"加载失败:{detail}","projectDetail.pipelines.title":"流水线","projectDetail.pipelines.add":"新建流水线","projectDetail.pipelines.empty":'还没有流水线文件。点"新建流水线"开始。',"projectDetail.pipelines.activeBadge":"当前","projectDetail.pipelines.edit":"编辑","projectDetail.pipelines.editAria":"编辑 {name}","projectDetail.pipelines.switch":"切换","projectDetail.pipelines.switchAria":"切换到 {name}","projectDetail.pipelines.switch.confirm.title":"切换到 {name}","projectDetail.pipelines.switch.confirm.body":"当前 project.yaml 会被 {name} 的内容覆盖。继续?","projectDetail.pipelines.switch.confirm.button":"切换","projectDetail.pipelines.switch.error":"切换失败","projectDetail.pipelines.delete.confirm.title":"删除 {name}","projectDetail.pipelines.delete.confirm.body":"这个流水线文件会被永久删除。","projectDetail.pipelines.delete.error":"删除失败","projectDetail.pipelines.deleteAria":"删除 {name}","projectDetail.pipelines.create.error":"创建失败","projectDetail.danger.title":"删除项目","projectDetail.danger.body":"这会清理 {path}(包括所有卡片、runtime、logs)。","projectDetail.danger.includeClaude.label":"同时清理 repo 的 .claude/","projectDetail.danger.includeClaude.note":"repo 本身不动,只清这个目录。","projectDetail.danger.confirmPrompt":"输入项目名 {name} 确认:","projectDetail.danger.deleteAria":"永久删除项目","projectDetail.danger.deleteButton":"永久删除","projectDetail.danger.deleted.title":"已删除","projectDetail.danger.deleted.bodyWithList":`项目已删除。同时清理了:
467
+ {paths}`,"projectDetail.danger.deleted.body":"项目已删除。","projectDetail.danger.error":"删除失败","pipelineEditor.close":"关闭","pipelineEditor.error.conflict.title":"文件已被其他地方修改","pipelineEditor.error.yaml.title":"YAML 语法错误","pipelineEditor.error.save.title":"保存失败","pipelineEditor.error.serialize.title":"YAML 序列化失败","pipelineEditor.error.load":"加载失败:{detail}","pipelineEditor.mode.structured":"结构化","pipelineEditor.mode.yaml":"原始 YAML","pipelineEditor.parseError.prefix":"YAML 解析:{detail}","pipelineEditor.activeWarning":"⚠ 这是当前激活的流水线,保存后下一轮 tick 生效","pipelineEditor.yamlAria":"pipeline YAML 编辑器","pipelineEditor.status.unsaved":"● 未保存","pipelineEditor.status.saved":"已保存","pipelineEditor.status.noChanges":"无变化","pipelineEditor.reload":"重新加载","pipelineEditor.save":"保存","pipelineEditor.saveAria":"保存 pipeline","pipelineEditor.activeBadge":"当前","pipelineEditor.modeHint":"project = 事件驱动流水线(默认) · steps = 顺序脚本","pipelineEditor.stages.heading":"Stages({count})","pipelineEditor.stages.add":"添加 stage","pipelineEditor.stages.empty":'还没 stage。点"添加 stage"开始。',"pipelineEditor.stage.name.hint":"stage 唯一名","pipelineEditor.stage.profile.hint":"skill 画像,可空","pipelineEditor.stage.cardState.hint":"本 stage 期间卡片状态","pipelineEditor.stage.timeout.hint":"可选,如 30m 2h","pipelineEditor.stage.trigger.hint":"触发条件,可空走默认","pipelineEditor.stage.onComplete.hint":"成功后动作","pipelineEditor.stage.onFail.action.hint":"失败时动作,如 label NEEDS-FIX","pipelineEditor.stage.onFail.comment.hint":"写进卡片的注释","pipelineEditor.stage.halt.note":"(失败后停流水线;去掉则继续下一张卡)","pipelineEditor.stage.moveUp":"上移","pipelineEditor.stage.moveDown":"下移","pipelineEditor.stage.remove":"删除 stage","newPipelineDialog.title":"新建流水线","newPipelineDialog.field.filename.label":"文件名","newPipelineDialog.field.filename.placeholder":"例如 ci","newPipelineDialog.field.filename.help":"实际会保存为 {filename}。只允许 a-z A-Z 0-9 _ -;已有同名文件会 409 报错。","newPipelineDialog.section.template":"初始内容","newPipelineDialog.template.blank.label":"空白模板","newPipelineDialog.template.blank.desc":"最简 1 stage(develop → Done)","newPipelineDialog.template.sample.label":"教学模板","newPipelineDialog.template.sample.desc":"从 sample.yaml.example 复制(带注释,讲解所有字段)","newPipelineDialog.template.sample.unavailable":"sample.yaml.example 不存在","newPipelineDialog.template.active.label":"复制当前活动的","newPipelineDialog.template.active.desc":"从 project.yaml 复制(基于目前的配置改)","newPipelineDialog.template.active.unavailable":"project.yaml 不存在","newPipelineDialog.create.aria":"创建 pipeline","newPipelineDialog.cancel":"取消","board.title":"看板","board.title.bare":"看板","board.subtitle":"{name} · {cards} 张卡片 · {workers} workers 活跃","board.pickPrompt.title":"选择一个项目 🎯","board.pickPrompt.body":"看板按项目分。挑一个开始:","board.action.start":"启动","board.action.stop":"停止","board.action.startAria":"启动 pipeline","board.action.stopAria":"停止 pipeline","board.action.startError":"启动 pipeline 失败","board.action.stopError":"停止 pipeline 失败","board.action.reset":"重置","board.action.resetError":"重置失败","board.action.reset.confirm.title":"重置整个流水线","board.action.reset.confirm.body":"这会清空所有卡片的运行状态、worker marker、分支。不可撤销。","board.action.reset.confirm.button":"重置全部","board.action.newCard":"新卡片","board.action.newCard.error":"新建卡片失败","board.action.moveCard.error":"移动卡片失败","board.search.placeholder":"搜索标题 / skill / label…","board.search.aria":"搜索卡片","board.filter.clear":"清空","board.filter.clearAria":"清空筛选","board.filter.aria":"按 {label} 筛选","board.filter.clearSelection":"清空选择","board.error.loadCards":"加载卡片失败","board.col.planning":"Planning","board.col.backlog":"Backlog","board.col.todo":"Todo","board.col.inprogress":"Inprogress","board.col.qa":"QA / Review","board.col.done":"Done","kanban.checklist.label":"检查清单 {done}/{total}","kanban.checklist.more":"… 还有 {count} 条","kanban.column.empty":"— 空 —","kanban.time.justNow":"刚才","kanban.time.minutes":"{n} 分钟前","kanban.time.hours":"{n} 小时前","kanban.time.days":"{n} 天前","newCard.title":"新建卡片","newCard.field.title":"标题 *","newCard.field.title.placeholder":"例如:接入 GitHub OAuth 登录","newCard.field.title.help":"写简短明了的目标(<200 字符)","newCard.field.description":"描述","newCard.field.description.placeholder":"用户故事、需求、验收标准、参考资料… Claude 启动时会读这里的内容","newCard.field.description.help":"支持 markdown。空的话就只有 title,Claude 只能靠 title 推断要做啥。","newCard.field.skills":"技能","newCard.field.skills.help":"勾选哪些 skill 会被加载(走 frontmatter `skills:`)。不选也行,Worker 默认加载项目级 skills。","newCard.field.skills.loading":"加载 skill 列表…","newCard.field.skills.error":"skill 列表加载失败,不影响创建:{detail}","newCard.field.skills.selected":"已选 {count} 个:{names}","newCard.field.dispatch":"派发","newCard.field.dispatch.label":"立即派发执行(直接进 Backlog)","newCard.field.dispatch.help":"默认不勾:卡进 Planning 暂存,等你看板上拖到 Backlog 再开工。勾上:跳过暂存,下次 tick 直接派 worker 跑。","newCard.create.aria":"创建卡片","cardDetail.loading":"加载中…","cardDetail.error.load":"卡片加载失败","cardDetail.tabs.overview":"概览","cardDetail.tabs.body":"描述","cardDetail.tabs.checklist":"检查清单","cardDetail.tabs.history":"历史","cardDetail.tabs.actions":"操作","cardDetail.field.state":"状态","cardDetail.field.skills":"技能","cardDetail.field.labels":"标签","cardDetail.field.branch":"分支","cardDetail.field.assignee":"处理人","cardDetail.field.created":"创建时间","cardDetail.field.updated":"更新时间","cardDetail.field.empty":"—","cardDetail.actions.delete":"删除卡片","cardDetail.actions.delete.confirm.title":"删除卡片 #{seq}","cardDetail.actions.delete.confirm.body":"该卡片会被永久删除。","cardDetail.actions.delete.error":"删除失败","cardDetail.actions.update.error":"更新失败","cardDetail.body.empty":"没有描述","cardDetail.checklist.empty":"没有检查清单","cardDetail.checklist.progress":"进度 {done}/{total}","cardDetail.history.empty":"没有历史记录","cardDetail.notFound":"卡片 #{seq} 不存在","cardDetail.copy.aria":"复制 seq","cardDetail.close.aria":"关闭","cardDetail.save":"保存","cardDetail.saving":"保存中…","workers.title":"Workers","workers.summary":"跨 {projects} 项目 · {running} 跑 · {starting} 启动 · {stuck} 卡 · {crashed} 崩 · {idle} 闲","workers.summary.stuck":"{n} 卡","workers.summary.crashed":"{n} 崩","workers.refresh.aria":"刷新","workers.refresh":"刷新","workers.error.load":"加载失败:{detail}","workers.empty.hint":"点击项目 / worker 查看详情","logs.title":"日志","logs.subtitle.allProjects":"全部项目","logs.subtitle.project":"{name} 实时日志","logs.filter.errors":"只看错误","logs.filter.errors.aria":"只显示错误","logs.filter.search.placeholder":"过滤消息…","logs.empty":"还没有日志 —— 等待事件中","logs.error.load":"日志加载失败","logs.refresh":"刷新","logs.refresh.aria":"刷新日志","logs.scroll.bottom.aria":"滚动到底部","logs.scroll.pause":"已暂停(自动滚动关闭)","logs.scroll.resume":"恢复自动滚动","logs.subtitle.allProjectsCount":"全部项目({count})","logs.poll.5s":"5s 轮询","logs.paused":"⏸ 已暂停","logs.mode.live":"实时","logs.mode.history":"历史","logs.history.startAria":"查询起始时间","logs.history.queryAria":"查询","logs.history.query":"查询","logs.filter.project.aria":"筛选项目","logs.filter.project.all":"全部项目","logs.filter.keyword.placeholder":"过滤关键字…","logs.filter.keyword.aria":"过滤日志","logs.empty.match":"没有匹配的日志","skills.title":"技能 🧠","skills.subtitle":"跨项目共用的 skill(用 `sps skill ...` 管理)","skills.empty.title":"还没有 skill","skills.empty.hint":"运行 {cmd} 同步 bundled skills。","skills.linked.tooltip":"已链接到该项目","skills.frozen.tooltip":"已冻结(项目独立副本)","skills.category.all":"全部","skills.category.language":"语言","skills.category.end":"终端","skills.category.persona":"角色","skills.category.workflow":"流程","skills.category.other":"其它","skills.subtitleCount":"{count} 个 user-level skill","skills.search.placeholder":"搜索 skill…","skills.search.aria":"搜索 skill","skillDetail.actionFailed":"{label}失败","skillDetail.unfreezeAction":"解冻","skillDetail.freezeAction":"冻结","skillDetail.removeAction":"移除","skillDetail.removeConfirm.title":"从 {project} 移除 {name}","skillDetail.removeConfirm.body":"skill 链接会被解除,项目后续运行时将无法使用该 skill。","skillDetail.removeConfirm.button":"移除","skillDetail.unfreezeConfirm.title":"解冻 {name} @ {project}","skillDetail.unfreezeConfirm.body":"本地对这个 skill 的改动会被覆盖,回到最新共享版本。","skillDetail.unfreezeConfirm.button":"解冻","skillDetail.close.aria":"关闭","skillDetail.loading":"加载中…","skillDetail.error.load":"加载失败:{detail}","skillDetail.section.projects":"项目链接状态","skillDetail.section.empty":"还没有任何项目。先去创建一个项目。","skillDetail.section.preview":"SKILL.md 预览","skillDetail.toggleSection.aria":"{action} {file}","skillDetail.expand":"展开","skillDetail.collapse":"收起","system.title":"系统","system.subtitle":"全局配置 + 诊断 + 升级","system.section.env":"全局 env","system.section.env.help":"存储在 ~/.coral/env(mode 600)。所有项目共用。","system.section.env.save":"保存 env","system.section.env.error.conflict":"env 已被其它地方修改","system.section.env.error.save":"保存 env 失败","system.section.env.error.load":"加载 env 失败","system.section.env.dirtyDot":"● 未保存","system.section.env.aria":"env 编辑器","system.section.env.reload":"重新加载","system.section.upgrade":"升级","system.section.upgrade.current":"当前:v{version}","system.section.upgrade.latest":"npm 最新:v{version}","system.section.upgrade.uptodate":"已是最新","system.section.upgrade.update":"立即升级","system.section.upgrade.upgrading":"升级中…","system.section.upgrade.checking":"正在查询 npm…","system.section.upgrade.checkError":"查询失败:{detail}","system.section.upgrade.upgradeError":"升级失败:{detail}","system.section.upgrade.upgradeError.title":"升级失败","system.section.upgrade.command":"或在终端执行:{cmd}","system.section.upgrade.runningPipelines":"有 pipeline 在跑,先停止:{projects}","system.section.diagnostics":"诊断","system.section.diagnostics.help":"一次性跑所有项目的 sps doctor,看哪些项目出问题","system.section.diagnostics.run":"运行诊断","system.section.diagnostics.running":"运行中…","system.section.diagnostics.empty":"没有项目","system.section.diagnostics.checkAria":"检查 {project}","system.section.diagnostics.statusOk":"正常","system.section.diagnostics.statusFail":"有问题","system.section.diagnostics.error":"诊断失败:{detail}","system.h1":"系统","system.runtime":"运行时","system.memory.title":"记忆后端","system.memory.desc":"全局设置:worker 的记忆读写走哪个后端。改动对新派发的卡生效。","system.memory.provider":"后端","system.memory.url":"自定义 URL","system.memory.url.placeholder":"http://127.0.0.1:3111","system.memory.save":"保存","system.memory.save.aria":"保存记忆后端设置","system.memory.saved":"已保存","system.memory.error":"保存失败","system.memory.opt.none":"关闭(none)","system.memory.opt.builtin":"本地文件记忆(builtin)","system.memory.opt.agentmemory":"agentmemory(语义库)","system.memory.opt.custom":"自定义 REST(custom)","system.env.title.code":"~/.coral/env","system.env.title.prefix":"全局配置 ","system.env.edit.aria":"编辑 env 文件","system.env.edit.button":"编辑","system.env.editing.label":"⚠ 编辑模式","system.env.empty.before":'env 文件不存在。点"编辑"或者终端运行 ',"system.env.empty.after":"。","system.env.warning":"⚠ 文件包含凭证明文。保存时保持 0600 权限。","system.env.aria":"env 文件编辑器","system.env.dirtyMark":" · ● 未保存","system.env.cancel":"取消","system.env.save":"保存","system.env.save.aria":"保存 env","system.env.error.conflict.title":"env 被其他地方修改了","system.env.error.save.title":"保存失败","system.env.error.conflict.body":"请点取消后重开编辑。","system.upgrade.title":"版本","system.upgrade.checkLatest.aria":"检查最新版本","system.upgrade.checkUpdate":"检查更新","system.upgrade.label.current":"sps-cli(当前)","system.upgrade.label.latest":"npm(最新)","system.upgrade.latestPill":"最新","system.upgrade.button.upgradeAria":"升级到最新版本","system.upgrade.button.upgrade":"升级","system.upgrade.button.copyAria":"复制升级命令","system.upgrade.button.copyTitle":"自动升级失败时手动跑","system.upgrade.button.copy":"复制命令","system.upgrade.label.installed":"已安装","system.upgrade.installed.ok":"已生效(重启 console 后可见)","system.upgrade.installed.fail":"未升级成功","system.upgrade.label.check":"检查","system.upgrade.confirm.title":"升级 sps-cli","system.upgrade.confirm.body":"当前 {current},升级到 {latest}。要求所有 pipeline 已停止。升级后请重启 sps console 生效。","system.upgrade.confirm.button":"升级","system.upgrade.success.title":"升级完成","system.upgrade.success.body":'装上了 v{version}。请 `pkill -f "sps console"` 再重启以生效。',"system.upgrade.notEffective.title":"升级未生效","system.upgrade.notEffective.same":"npm 执行完毕但版本没变(仍 {version})——多半是权限或 registry 问题。可复制下面的命令在终端手动跑。","system.upgrade.notEffective.notInstalled":"npm 没装上新版本。可复制命令手动跑,或看下面日志定位。","system.upgrade.error.title":"升级失败","system.upgrade.copy.success.title":"命令已复制","system.upgrade.copy.success.body":`粘贴到终端运行即可:
468
+ {cmd}`,"system.upgrade.copy.fail.title":"复制失败","system.upgrade.copy.fail.body":`请手动复制:
469
+ {cmd}`,"system.diagnostics.title":"项目健康检查","system.diagnostics.checkAll":"检查全部","system.diagnostics.empty":"还没有项目。","system.diagnostics.expandAria":"展开","system.diagnostics.collapseAria":"折叠","system.diagnostics.never":'点 "检查" 运行 sps doctor',"system.diagnostics.checkAria":"检查","system.diagnostics.check":"检查","system.diagnostics.noFixesNeeded":"已无可修问题","system.diagnostics.fix.tip":"调 sps doctor <proj> --fix:自动创建 .claude/hooks/stop.sh、state.json 等","system.diagnostics.fixAria":"自动修复","system.diagnostics.fix":"修复","system.diagnostics.fixed":"已修复","system.diagnostics.error.fix":"doctor 修复失败","system.diagnostics.error.check":"doctor 检查失败","chat.title":"对话 💬","chat.empty.title":"对话 💬","chat.empty.hint":'点左上角"新建对话"开始一个 session。或直接在下方输入,会自动建 session。',"chat.empty.shortcuts":"Enter 发送 · Shift+Enter 换行 · 内容流式返回","chat.list.heading":"历史 {count}","chat.list.new":"新建对话","chat.list.empty":"还没对话。点上面新建。","chat.list.delete.aria":"删除对话","chat.list.deleteCli.aria":"从 Console 移除该 CLI 会话(不影响 Claude jsonl 存档)","chat.list.openAria":"打开对话 {title}{cwd}","chat.list.cwdSuffix":"(工作目录 {cwd})","chat.list.msgs":"{count} 条 · {time}","chat.list.olderToggle":"更早 · {count} 条","chat.detail.model.tooltip":"当前使用的模型","chat.detail.claudeSession.tooltip":"底层 claude 会话 id —— 恢复会话与记忆的锚","chat.delete.confirm.title":"删除对话","chat.delete.confirm.body.cli":"会从 Console 列表移除(停 daemon 会话)。Claude CLI 在 ~/.claude/projects 下的对话存档会保留 —— 想恢复到终端继续聊就重新跑 sps agent --chat --name <名>。","chat.delete.confirm.body.console":"对话记录会永久删除,不可恢复。","chat.delete.confirm.button":"删除","chat.cli.banner.bold":"CLI 会话","chat.cli.banner":"这是 CLI 会话(由 sps agent 创建),Console 仅展示历史。续聊请在终端运行:","chat.input.placeholder":"说点什么… (Enter 发送,Shift+Enter 换行,可拖入文件 / 粘贴图片)","chat.input.dragOver":"松开鼠标以附加文件…","chat.input.aria":"消息输入","chat.input.attach.aria":"附加本地文件","chat.input.attach.title":"附加本地文件(也可拖拽 / 粘贴图片)","chat.input.send":"发送","chat.input.send.aria":"发送","chat.input.interrupt":"中断","chat.input.interrupt.aria":"中断生成","chat.input.uploading":"上传中…","chat.input.removeAttachment":"移除 {name}","chat.error.interrupt.title":"中断失败","chat.cliBadge":"CLI","chat.cliBadge.tooltip":"该会话由 sps agent CLI 创建,从 Claude jsonl 实时读取(只读)","chat.session.title":"{title}","chat.session.id":"{id}","chat.session.empty":"下方输入问题开始对话 · Enter 发送 · Shift+Enter 换行","notFound.title":"404","notFound.body":"这个页面不存在。","notFound.home":"回到首页","workers.active.empty":"没有 worker 在运行。","workers.alerts.allHealthy":"全部 worker 健康","workers.alerts.pidDead":"PID 已死。","workers.alerts.markerStale":"marker 停 {ago}。","workers.capacity.col.project":"项目","workers.capacity.col.usage":"占用","workers.capacity.col.other":"其它","workers.capacity.detailHint":"详情 →","workers.panel.boardLink":"看板 →","workers.panel.loading":"加载 workers…","workers.panel.empty.slots":"该项目没有 worker slot。","workers.panel.empty.noWorker":"无 worker","workers.panel.empty.pickOne":"请选择一个 worker","workers.panel.idle.short":"空闲","workers.panel.section.currentCard":"当前卡片","workers.panel.idle.full":"slot 空闲,没有当前卡片。","workers.panel.section.claudeOutput":"Claude 输出 · 最近 {n} 行","workers.panel.output.loading":"加载中…","workers.panel.output.empty":"还没收到 session 输出。Worker 刚启动时需要几秒。","workers.panel.section.heartbeat":"Supervisor 心跳 · 最近 {n} 行","workers.panel.heartbeat.fullLog":"查看完整 log →","workers.panel.action.restart":"重启","workers.panel.action.restart.confirm.title":"重启 worker-{slot}","workers.panel.action.restart.confirm.body":"先杀进程,再重新 launch 到 #{seq}","workers.panel.action.restart.confirm.button":"重启","workers.panel.action.restart.error":"重启失败","workers.panel.action.kill":"终止","workers.panel.action.kill.confirm.title":"终止 worker-{slot}","workers.panel.action.kill.confirm.body":"当前任务强制中断。","workers.panel.action.kill.confirm.button":"终止","workers.panel.action.kill.error":"终止失败","dialog.confirm.default":"确定","dialog.alert.default":"知道了","dialog.cancel.default":"取消","dirPicker.title.default":"选择目录","dirPicker.close.aria":"关闭","dirPicker.up.aria":"上级目录","dirPicker.up.title":"上级目录","dirPicker.home.aria":"回到 Home","dirPicker.home.title":"回到 Home","dirPicker.loading":"加载中...","dirPicker.error.title":"读取失败","dirPicker.empty":"— 空目录 —","dirPicker.enter.aria":"进入 {name}/","dirPicker.pickFile.aria":"选择 {name}(双击直接确认)","dirPicker.fileLocked":"文件不可选","dirPicker.cancel":"取消","dirPicker.useFile":"使用此文件","dirPicker.useFile.tooltip.empty":"请先点选一个文件","dirPicker.useDir":"选此目录","dirPicker.newDir":"新建目录","dirPicker.newDir.aria":"在当前目录下新建子目录","dirPicker.newDir.prompt":"新目录名(仅字母数字 _ . -)","dirPicker.newDir.placeholder":"目录名","dirPicker.newDir.create":"创建","dirPicker.newDir.error.title":"新建目录失败","errorBoundary.title":"💥 UI 崩了","errorBoundary.refresh":"刷新页面","chat.error.create.title":"新建对话失败","chat.error.send.title":"发送失败","chat.error.fileTooBig.title":"文件超过上限","chat.error.fileTooBig.body":"单文件上限 50 MB;当前 {size} MB({name})","chat.error.uploadAttachment.title":"附件上传失败","chat.placeholder.attachment":"(附件)","chat.placeholder.viewAttachment":"(请查看附件)","chat.placeholder.attachmentTitle":"附件","chat.attachment.previewTooltip":`{name}
470
+ {path}
471
+ 点击预览`,"chat.attachment.previewSimpleTooltip":`{name}
472
+ 点击放大`,"chat.attachment.preview.aria":"预览 {name}","chat.attachment.close.aria":"关闭","chat.attachment.readErr":"读取失败:{detail}","chat.attachment.loading":"加载中...","chat.attachment.unsupported":"此文件类型不支持内联预览。","chat.attachment.download":"下载","chat.message.role.you":"你","chat.message.role.error":"错误","chat.message.role.assistant":"assistant","chat.message.truncated":"⚠ 输出超过 10MB,已截断","chat.filePicker.title":"选择附件文件","chat.newSession.title":"新建对话","chat.newSession.title.aria":"新建对话","chat.newSession.close.aria":"关闭","chat.newSession.field.agent":"Agent","chat.newSession.field.model":"模型(可选)","chat.newSession.field.model.default":"用全局默认模型","chat.newSession.field.title":"标题(可选)","chat.newSession.field.title.placeholder":"留空 = 自动用首条消息生成","chat.newSession.field.cwd":"工作目录(可选)","chat.newSession.field.cwd.browse":"浏览","chat.newSession.field.cwd.browseAria":"浏览选择目录","chat.newSession.field.cwd.title":"选择目录","chat.newSession.field.cwd.help1":"Agent 在该目录下读写文件。绝对路径,必须存在。","chat.newSession.field.cwd.help2":"留空则用 daemon 启动时的目录。","chat.newSession.cancel":"取消","chat.newSession.create":"创建","cardModal.editing":"⚠ 编辑中","cardModal.title.aria":"卡片标题","cardModal.editAria":"编辑卡片","cardModal.edit":"编辑","cardModal.close.aria":"关闭","cardModal.error.save.title":"保存失败","cardModal.error.load":"加载失败:{detail}","cardModal.skills.loading":"加载 skill 列表…","cardModal.label.removeAria":"删除 {label}","cardModal.label.addPlaceholder":"+ 添加 label","cardModal.label.addAria":"添加 label","cardModal.label.note":"注意:AI-PIPELINE / STARTED-* / COMPLETED-* / NEEDS-FIX 由流水线自动管理,手动改可能被覆盖","cardModal.section.description":"描述","cardModal.section.empty":"(空)","cardModal.section.checklist":"检查清单","cardModal.checklist.empty":"暂无清单项。在描述里用 `- [ ] 项` 语法添加。","cardModal.section.log":"日志","cardModal.body.aria":"卡片描述","cardModal.body.replaceNote":'只替换 "## 描述" 段的内容;检查清单和日志段不动。',"cardModal.action.launch":"启动 worker","cardModal.action.launch.disabledDone":"卡片已完成;先拖回 Todo 再启动","cardModal.action.launch.disabledRunning":"Pipeline 正在跑——supervisor 会自动 dispatch,无需手动启动","cardModal.action.launch.error":"启动 worker 失败","cardModal.action.reset":"重置卡片","cardModal.action.reset.confirm.title":"重置卡片 #{seq}","cardModal.action.reset.confirm.body":"卡片状态会回到初始,已做的 checklist 会清空。","cardModal.action.reset.confirm.button":"重置","cardModal.action.reset.error":"重置失败","cardModal.action.delete":"删除卡片","cardModal.action.delete.confirm1.title":"删除卡片 #{seq}","cardModal.action.delete.confirm1.body":'即将删除 "{title}"。此操作不可恢复(md 文件将被物理删除)。是否继续?',"cardModal.action.delete.confirm1.button":"继续","cardModal.action.delete.confirm2.title":"最终确认","cardModal.action.delete.confirm2.body":"请再次确认删除卡片 #{seq}。","projectDetail.tab.skills":"技能","projectDetail.tab.rules":"规则","projectDetail.skills.title":"Skill 白名单","projectDetail.skills.desc":"选择本项目加载哪些 skill。收窄 worker、subagent 与 chat 能看到的范围,降低 token 消耗。","projectDetail.skills.noPolicy":"未设白名单 —— 全部 skill 都可用(subagent 会从磁盘吃全量)。","projectDetail.skills.hasPolicy":"白名单已生效 —— {count} 个 skill 合格。","projectDetail.skills.save":"保存白名单","projectDetail.skills.clear":"清除(加载全部)","projectDetail.skills.saveError":"保存白名单失败","projectDetail.skills.applied":"已保存。投影 {linked} 个链接,清理 {pruned} 个。","projectDetail.skills.unknown":"未识别的 skill 名(已忽略):{names}","projectDetail.skills.empty":"尚无已安装的 skill,先跑 `sps skill sync`。","projectDetail.skills.selectAll":"全选","projectDetail.skills.selectNone":"全不选","projectDetail.rules.title":"项目规则(只读)","projectDetail.rules.readonly":"sps-cli 只读这些文件。编辑在项目创建时或日后由 agent 协助完成。","projectDetail.rules.missing":"不存在","nav.prompts":"提示词","prompts.title":"提示词库","prompts.desc":"带 {{变量}} 模板的可复用提示词,可插入到会话中。","prompts.new":"新建提示词","prompts.search":"搜索提示词…","prompts.empty":"还没有提示词,新建一个。","prompts.name":"名称","prompts.namePlaceholder":"kebab-case,如 code-review","prompts.nameError":"名称须为 kebab-case(小写字母、数字、连字符)。","prompts.description":"描述","prompts.tags":"标签","prompts.tagsPlaceholder":"逗号,分隔","prompts.body":"正文","prompts.bodyPlaceholder":"写你的提示词。用 {{变量}} 做填充位。","prompts.favorite":"收藏","prompts.save":"保存","prompts.delete":"删除","prompts.deleteConfirm":"删除提示词「{name}」?会移除文件。","prompts.saveError":"保存提示词失败","prompts.vars":"变量:{names}","prompts.noVars":"无变量","prompts.insert":"插入提示词","prompts.selectHint":"在左侧选择一个提示词,或新建一个。","prompts.tagAdd":"输入标签后按 Enter","prompts.ai":"AI 生成","prompts.ai.title":"AI 生成提示词","prompts.ai.intent":"描述你想要什么","prompts.ai.placeholder":"例如:一个用于审查 TypeScript 代码安全问题的提示词","prompts.ai.submit":"生成","prompts.ai.wait":"agent 正在生成…可能需要一会儿。","prompts.ai.error":"生成失败","skills.import":"导入","skills.import.title":"导入 Skill","skills.import.name":"名称(kebab-case)","skills.import.body":"SKILL.md 内容","skills.import.submit":"导入","skills.import.error":"导入失败","skills.export":"导出 SKILL.md","skills.updates.badge":"有 {count} 个可更新","skills.updates.none":"已是最新","skills.ai":"AI 创建","skills.ai.title":"AI 创建 Skill","skills.ai.name":"名称(kebab-case)","skills.ai.intent":"这个 skill 用来做什么?","skills.ai.placeholder":"例如:如何写地道的 Rust 错误处理","skills.ai.submit":"创建","skills.ai.wait":"agent 正在生成 skill…可能需要一会儿。","skills.ai.error":"创建失败","projectDetail.tab.graph":"代码图谱","projectDetail.tab.logs":"日志","graph.title":"代码图谱","graph.desc":"本项目的符号级依赖图(tree-sitter,零 token)。给 agent 精准上下文,少读文件、省 token。","graph.build":"建图","graph.rebuild":"重建","graph.building":"建图中…","graph.sync":"增量同步","graph.syncing":"同步中…","graph.sync.desc":"增量 —— 只重新索引变化的文件(快)","graph.empty":"尚未建图 —— 建一次即可启用 agent 导航与依赖图。","graph.buildFailed":"建图失败","graph.stat.files":"文件","graph.stat.nodes":"节点","graph.stat.edges":"边","graph.stat.db":"DB 体积","graph.stat.lastBuilt":"上次建图","graph.viz.title":"文件依赖图","graph.viz.loading":"加载图谱…","graph.viz.empty":"建图后可查看依赖图。","graph.viz.hint":"节点=文件 · 边=import · 拖拽探索 · 搜索高亮","graph.viz.search":"高亮文件…"},s_=j.createContext(null),l_="sps-console-lang";function M3(){if(typeof window>"u")return"en";try{const e=window.localStorage.getItem(l_);if(e==="en"||e==="zh")return e}catch{}return"en"}function D3(e){try{window.localStorage.setItem(l_,e)}catch{}}function O3({children:e}){const[t,n]=j.useState(()=>M3());j.useEffect(()=>{typeof document<"u"&&(document.documentElement.lang=t==="zh"?"zh-CN":"en")},[t]);const i=j.useCallback(o=>{n(o),D3(o)},[]),a=j.useMemo(()=>{const o=t==="zh"?T3:A3;return(d,f)=>{let h=o[d]??d;if(f)for(const[g,m]of Object.entries(f))m!==void 0&&(h=h.replace(`{${g}}`,String(m)));return h}},[t]),l=j.useMemo(()=>({lang:t,setLang:i,t:a}),[t,i,a]);return c.jsx(s_.Provider,{value:l,children:e})}function o_(){const e=j.useContext(s_);if(!e)throw new Error("useLang must be used inside I18nProvider");return e}function Be(){return o_().t}function R3(){const{lang:e,setLang:t,t:n}=o_();return c.jsxs("div",{role:"group","aria-label":n("lang.toggle.aria"),className:"dimension-segmented flex-1 min-w-0",children:[c.jsx(fk,{active:e==="en",onClick:()=>t("en"),label:n("lang.en"),ariaLabel:"English"}),c.jsx(fk,{active:e==="zh",onClick:()=>t("zh"),label:n("lang.zh"),ariaLabel:"中文"})]})}function fk({active:e,onClick:t,label:n,ariaLabel:i}){return c.jsx("button",{type:"button",onClick:t,"aria-label":i,"aria-pressed":e,className:["dimension-segment flex-1 py-1.5 text-xs font-bold font-[family-name:var(--font-mono)]",e?"dimension-segment-active":""].join(" "),children:n})}const c_="sps-console-theme";function u_(){if(typeof window>"u")return"dark";try{const e=window.localStorage.getItem(c_);if(e==="dark"||e==="light")return e}catch{}return"dark"}function Uy(e){typeof document>"u"||(document.documentElement.dataset.theme=e)}function L3(e){try{window.localStorage.setItem(c_,e)}catch{}}function I3(){const e=u_();return Uy(e),e}const z3=["dark","light"];function P3(){const e=Be(),[t,n]=j.useState(()=>u_());j.useEffect(()=>{Uy(t)},[t]);const i=j.useCallback(a=>{n(a),L3(a),Uy(a)},[]);return c.jsx("div",{role:"group","aria-label":e("theme.toggle.aria"),className:"dimension-segmented shrink-0",children:z3.map(a=>{const l=t===a,o=a==="dark"?LL:h3;return c.jsx("button",{type:"button","aria-label":e(a==="dark"?"theme.dark":"theme.light"),"aria-pressed":l,title:e(a==="dark"?"theme.dark":"theme.light"),onClick:()=>i(a),className:["dimension-segment h-8 w-9",l?"dimension-segment-active":""].join(" "),children:c.jsx(o,{size:15,strokeWidth:2.4})},a)})})}const B3=[{to:"/chat",labelKey:"nav.chat",icon:QN},{to:"/projects",labelKey:"nav.projects",icon:YN},{to:"/board",labelKey:"nav.board",icon:jL},{to:"/workers",labelKey:"nav.workers",icon:r_},{to:"/skills",labelKey:"nav.skills",icon:yL},{to:"/prompts",labelKey:"nav.prompts",icon:XN},{to:"/arrange",labelKey:"nav.arrange",icon:Fb},{to:"/plugins",labelKey:"nav.plugins",icon:WL},{to:"/system",labelKey:"nav.system",icon:JN},{to:"/processes",labelKey:"nav.processes",icon:hh},{to:"/audit",labelKey:"nav.audit",icon:$b},{to:"/memory",labelKey:"nav.memory",icon:IR}];function $3(){const e=Be();return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"font-[family-name:var(--font-heading)] font-bold text-lg px-3 pt-2 pb-4 flex items-center gap-3 text-[var(--color-text)]",children:[c.jsx(hl,{size:20,strokeWidth:2.5}),e("app.title")]}),c.jsx("nav",{className:"flex flex-col gap-0.5 mt-2","aria-label":e("nav.aria"),children:B3.map(t=>{const n=t.icon;return c.jsxs(BN,{to:t.to,className:({isActive:i})=>["dimension-menu-item gap-3 px-3 py-2.5 pl-4 font-semibold text-sm cursor-pointer",i?"dimension-menu-item-active":""].join(" "),children:[c.jsx(n,{size:18,strokeWidth:2.5}),e(t.labelKey)]},t.to)})}),c.jsxs("div",{className:"mt-auto pt-3 flex items-center gap-2",children:[c.jsx(R3,{}),c.jsx(P3,{})]})]})}class U3 extends Error{constructor(t,n,i){super(n),this.status=t,this.detail=i,this.name="ApiError"}}async function qb(e){const t=await e.text().catch(()=>"");let n=t,i=`${e.status} ${e.statusText}`;try{const a=JSON.parse(t);if(n=a,a&&typeof a=="object"){const l=a,o=l.detail??l.title??l.message;typeof o=="string"&&o&&(i=o)}}catch{t&&(i=t.slice(0,300))}return new U3(e.status,i,n)}async function ft(e){const t=await fetch(e,{headers:{Accept:"application/json"}});if(!t.ok)throw await qb(t);return await t.json()}async function Lr(e,t){return d_("POST",e,t)}async function Hb(e,t){return d_("PUT",e,t)}async function F3(e){const t=await fetch(e,{method:"DELETE",headers:{Accept:"application/json"}});if(!t.ok)throw await qb(t)}async function d_(e,t,n){const i=await fetch(t,{method:e,headers:{Accept:"application/json","Content-Type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)});if(!i.ok)throw await qb(i);return await i.json()}function f_(){return ft("/api/system/info")}function q3(){return ft("/api/system/env")}function H3(){return ft("/api/system/env/raw")}async function K3(e,t){const n=await fetch("/api/system/env",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e,etag:t})});if(!n.ok){const i=await n.text(),a=new Error(`${n.status}: ${i}`);throw a.status=n.status,a}return n.json()}function G3(){return ft("/api/system/memory")}async function V3(e,t){const n=await fetch("/api/system/memory",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,url:t})});if(!n.ok)throw new Error(`${n.status}: ${await n.text()}`);return n.json()}function Kb(){return ft("/api/system/agents")}async function Y3(e){const t=await fetch("/api/system/agents",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(`${t.status}: ${await t.text()}`);return t.json()}function Q3(){return ft("/api/system/latest-version")}async function W3(){const e=await fetch("/api/system/upgrade",{method:"POST"});if(!e.ok&&e.status!==409)throw new Error(`${e.status}: ${await e.text()}`);return e.json()}async function X3(e,t=!1){const n=t?"?fix=1":"",i=await fetch(`/api/system/doctor/${encodeURIComponent(e)}${n}`,{method:"POST"});if(!i.ok)throw new Error(`${i.status}: ${await i.text()}`);return i.json()}function Es(){return ft("/api/projects")}function Z3(e){return ft(`/api/projects/${encodeURIComponent(e)}`)}async function J3(e){const t=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.text();throw new Error(`${t.status}: ${n}`)}return t.json()}function eI(e){return ft(`/api/projects/${encodeURIComponent(e)}/conf`)}async function tI(e,t,n){const i=await fetch(`/api/projects/${encodeURIComponent(e)}/conf`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t,etag:n})});if(!i.ok){const a=await i.text(),l=new Error(`${i.status}: ${a}`);throw l.status=i.status,l}return i.json()}async function nI(e,t={}){const n=await fetch(`/api/projects/${encodeURIComponent(e)}`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const i=await n.text();throw new Error(`${n.status}: ${i}`)}return n.json()}function iI(e){return ft(`/api/projects/${encodeURIComponent(e)}/pipelines`)}async function rI(e,t){const n=await fetch(`/api/projects/${encodeURIComponent(e)}/pipeline`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({pipeline:t})});if(!n.ok){const i=await n.text();throw new Error(`${n.status}: ${i}`)}return n.json()}function aI(e,t){return ft(`/api/projects/${encodeURIComponent(e)}/pipelines/${encodeURIComponent(t)}`)}async function sI(e,t,n,i){const a=await fetch(`/api/projects/${encodeURIComponent(e)}/pipelines/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:n,etag:i})});if(!a.ok){const l=await a.text(),o=new Error(`${a.status}: ${l}`);throw o.status=a.status,o}return a.json()}async function lI(e,t,n="blank"){const i=await fetch(`/api/projects/${encodeURIComponent(e)}/pipelines`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,template:n})});if(!i.ok){const a=await i.text();throw new Error(`${i.status}: ${a}`)}return i.json()}async function oI(e,t){const n=await fetch(`/api/projects/${encodeURIComponent(e)}/pipelines/${encodeURIComponent(t)}`,{method:"DELETE"});if(!n.ok){const i=await n.text();throw new Error(`${n.status}: ${i}`)}}function cI(){var f;const e=Be(),t=Ye({queryKey:["system-info"],queryFn:f_,refetchInterval:3e4}),n=Ye({queryKey:["projects"],queryFn:Es,refetchInterval:1e4}),i=dI(),a=!t.isError,l=((f=n.data)==null?void 0:f.data)??[],o=l.filter(h=>h.pipelineStatus==="running").length,d=l.reduce((h,g)=>h+g.workers.active,0);return c.jsxs("div",{className:"h-full flex items-center gap-3 px-6 font-[family-name:var(--font-mono)] text-[11px] text-[var(--color-text-muted)]",children:[c.jsx("span",{className:"nb-status",style:{background:a?"var(--color-running-bg)":"var(--color-crashed-bg)",color:a?"var(--color-running)":"var(--color-crashed)",padding:"2px 8px 2px 7px"},children:e(a?"status.server":"status.offline")}),c.jsx(uI,{state:i}),c.jsx("span",{className:"text-[var(--color-text-subtle)]",children:"·"}),c.jsxs("span",{className:"flex items-center gap-1",title:e("status.pipelines.tooltip"),children:[c.jsx($h,{size:10,strokeWidth:2.5}),c.jsx("span",{className:"font-bold text-[var(--color-text)]",children:o})," ",e("status.pipeline.unit")]}),c.jsx("span",{className:"text-[var(--color-text-subtle)]",children:"·"}),c.jsxs("span",{className:"flex items-center gap-1",title:e("status.workers.tooltip"),children:[c.jsx(ZN,{size:10,strokeWidth:2.5}),c.jsx("span",{className:"font-bold text-[var(--color-text)]",children:d})," ",e("status.worker.unit")]}),c.jsx("span",{className:"text-[var(--color-text-subtle)]",children:"·"}),c.jsxs("span",{children:["localhost:",window.location.port]}),t.data&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-[var(--color-text-subtle)]",children:"·"}),c.jsxs("span",{children:["v",t.data.version]}),c.jsx("span",{className:"text-[var(--color-text-subtle)]",children:"·"}),c.jsxs("span",{children:["node ",t.data.nodeVersion]})]})]})}function uI({state:e}){const t=Be();return e==="open"?c.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)",padding:"2px 8px 2px 7px"},children:t("status.sse.open")}):e==="connecting"?c.jsx("span",{className:"nb-status",style:{background:"var(--color-stuck-bg)",color:"var(--color-stuck)",padding:"2px 8px 2px 7px"},children:t("status.sse.connecting")}):c.jsxs("span",{className:"nb-status",style:{background:"var(--color-crashed-bg)",color:"var(--color-crashed)",padding:"2px 8px 2px 7px"},children:[c.jsx(ku,{size:9,strokeWidth:2.5}),t("status.sse.down")]})}function dI(){const[e,t]=j.useState("connecting");return j.useEffect(()=>{let n=null,i=null,a=!1;const l=()=>{a||(n=new EventSource("/stream/heartbeat"),n.addEventListener("server.heartbeat",()=>t("open")),n.addEventListener("open",()=>t("open")),n.addEventListener("error",()=>{(n==null?void 0:n.readyState)===EventSource.CLOSED?(t("closed"),i==null&&(i=setTimeout(()=>{i=null,n==null||n.close(),l()},1e4))):t("connecting")}))};return l(),()=>{a=!0,i!=null&&clearTimeout(i),n==null||n.close()}},[]),e}function fI(){return c.jsxs("div",{className:"grid grid-cols-[240px_1fr] grid-rows-[1fr_40px] h-screen",children:[c.jsx("aside",{className:"row-span-1 row-start-1 border-r-[3px] border-[var(--color-text)] bg-[var(--color-bg)] p-4 flex flex-col",children:c.jsx($3,{})}),c.jsx("main",{className:"row-start-1 overflow-auto p-6 flex flex-col gap-4",children:c.jsx(UO,{})}),c.jsx("footer",{className:"col-span-2 row-start-2 border-t-[3px] border-[var(--color-text)] bg-[var(--color-bg)]",children:c.jsx(cI,{})})]})}function Fy(e,t){try{const n=JSON.stringify({message:(e instanceof Error?e.message:String(e)).slice(0,1e3),stack:(e instanceof Error?e.stack??"":"").slice(0,4e3),url:typeof window<"u"?window.location.href:"",ua:typeof navigator<"u"?navigator.userAgent:"",ts:new Date().toISOString(),context:t==null?void 0:t.slice(0,200)});fetch("/api/system/client-errors",{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0}).catch(()=>{})}catch{}}function hI(){typeof window>"u"||(window.addEventListener("error",e=>{Fy(e.error??e.message??"unknown error","window.error")}),window.addEventListener("unhandledrejection",e=>{const t=e.reason;Fy(t instanceof Error?t:String(t),"unhandledrejection")}))}class pI extends j.Component{constructor(){super(...arguments);R1(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,i){var a;Fy(n,`ErrorBoundary: ${((a=i.componentStack)==null?void 0:a.slice(0,200))??""}`),console.error("[ErrorBoundary]",n,i)}render(){if(this.state.error){const n=(()=>{try{return window.localStorage.getItem("sps-console-lang")==="zh"?"zh":"en"}catch{return"en"}})(),i=n==="zh"?"💥 UI 崩了":"💥 UI crashed",a=n==="zh"?"刷新页面":"Refresh page";return c.jsx("div",{className:"p-6",children:c.jsxs("div",{className:"nb-card max-w-2xl bg-[var(--color-crashed-bg)]",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold mb-2",children:i}),c.jsx("p",{className:"text-sm mb-3 text-[var(--color-text-muted)]",children:this.state.error.message}),c.jsxs("details",{className:"text-xs mb-4",children:[c.jsx("summary",{className:"cursor-pointer font-semibold",children:"stack"}),c.jsx("pre",{className:"mt-2 font-[family-name:var(--font-mono)] overflow-auto max-h-60 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-md p-3",children:this.state.error.stack??"(no stack)"})]}),c.jsx("button",{className:"nb-btn nb-btn-mint",type:"button",onClick:()=>{this.setState({error:null}),window.location.reload()},children:a})]})})}return this.props.children}}function Gb(e,t){const[n,i]=j.useState(()=>{try{const a=localStorage.getItem(e);return a!==null?JSON.parse(a):t}catch{return t}});return j.useEffect(()=>{try{localStorage.setItem(e,JSON.stringify(n))}catch{}},[e,n]),[n,i]}const kf=e=>e.lastActivityAt?Date.parse(e.lastActivityAt):0;function h_(e,t){const n=[...e];return t==="name"?n.sort((i,a)=>i.name.localeCompare(a.name)):t==="date"?n.sort((i,a)=>kf(a)-kf(i)):n.sort((i,a)=>{const l=i.pipelineStatus==="running"?1:0,o=a.pipelineStatus==="running"?1:0;return l!==o?o-l:kf(a)-kf(i)})}function mI(e,t,n=7){const i=Date.now()-n*864e5,a=[],l=[];for(const o of e){const d=t(o);((d?Date.parse(d):0)>=i?a:l).push(o)}return{recent:a,older:l}}function gI(e){const t=new URLSearchParams;return e.project&&t.set("project",e.project),e.worker&&t.set("worker",e.worker),t.set("limit",String(e.limit)),e.since&&t.set("since",e.since),e.file&&t.set("file",e.file),ft(`/api/logs?${t}`)}function yI(e){return ft(`/api/logs/sources?project=${encodeURIComponent(e)}`)}const bI=["error","warn","info","debug"],xI=["error","warn","info"];function vI({project:e,initialWorker:t}){const n=Be(),i=t??"",[a,l]=j.useState([]),[o,d]=j.useState(!1),[f,h]=j.useState(!0),[g,m]=j.useState(()=>new Set(xI)),[y,b]=j.useState(""),[k,v]=j.useState("live"),[N,E]=j.useState(()=>{const F=new Date(Date.now()-36e5),Y=D=>String(D).padStart(2,"0");return`${F.getFullYear()}-${Y(F.getMonth()+1)}-${Y(F.getDate())}T${Y(F.getHours())}:${Y(F.getMinutes())}`}),C=j.useRef(null),[S,_]=j.useState(""),{data:M}=Ye({queryKey:["log-sources",e],queryFn:()=>yI(e),enabled:!!e,refetchInterval:5e3}),T=j.useMemo(()=>(M==null?void 0:M.sources)??[],[M]),R=T.find(F=>F.key===S)??(i?T.find(F=>F.worker===Number(i)):void 0)??T.find(F=>F.kind==="pipeline")??T[0],O=R==null?void 0:R.file;j.useEffect(()=>{l([])},[e,O]);const{data:$,refetch:I}=Ye({queryKey:["logs",e,O,k,k==="history"?N:"live"],queryFn:()=>gI({project:e,file:O,limit:k==="history"?2e3:500,since:k==="history"?new Date(N).toISOString():void 0}),enabled:!!e,refetchInterval:k==="live"&&!o?2500:!1});j.useEffect(()=>{$!=null&&$.data&&l($.data)},[$]),j.useEffect(()=>{if(!f)return;const F=C.current;F&&(F.scrollTop=F.scrollHeight)},[a,f]);const q=j.useMemo(()=>{const F=y.toLowerCase();return a.filter(Y=>!(!g.has(Y.level)||F&&!Y.msg.toLowerCase().includes(F)))},[a,g,y]);return c.jsxs("div",{className:"flex h-full min-h-0 max-w-full flex-col gap-3",children:[T.length>0&&c.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 flex-wrap",children:[T.filter(F=>F.worker==null).map(F=>c.jsx(hk,{s:F,active:(R==null?void 0:R.key)===F.key,onClick:()=>_(F.key)},F.key)),c.jsx("div",{className:"ml-auto flex items-center gap-1.5 flex-wrap",children:T.filter(F=>F.worker!=null).map(F=>c.jsx(hk,{s:F,active:(R==null?void 0:R.key)===F.key,onClick:()=>_(F.key)},F.key))})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-2 flex-wrap",children:[c.jsxs("div",{className:"flex gap-1 p-1 bg-[var(--color-bg)] border-[2px] border-[var(--color-text)] rounded-full shadow-[2px_2px_0_var(--color-text)]",children:[c.jsxs("button",{type:"button",onClick:()=>v("live"),"aria-pressed":k==="live",className:["px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1.5",k==="live"?"bg-[var(--color-primary)] text-[var(--color-text)] shadow-[1px_1px_0_var(--color-text)]":"text-[var(--color-text-muted)]"].join(" "),children:[c.jsx(ZN,{size:11,strokeWidth:2.5}),n("logs.mode.live")]}),c.jsxs("button",{type:"button",onClick:()=>v("history"),"aria-pressed":k==="history",className:["px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1.5",k==="history"?"bg-[var(--color-primary)] text-[var(--color-text)] shadow-[1px_1px_0_var(--color-text)]":"text-[var(--color-text-muted)]"].join(" "),children:[c.jsx(wL,{size:11,strokeWidth:2.5}),n("logs.mode.history")]})]}),k==="history"&&c.jsxs(c.Fragment,{children:[c.jsx("input",{type:"datetime-local",className:"nb-input",style:{padding:"4px 8px",fontSize:12},value:N,onChange:F=>E(F.target.value),"aria-label":n("logs.history.startAria")}),c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 12px",fontSize:12},onClick:()=>I(),type:"button","aria-label":n("logs.history.queryAria"),children:[c.jsx(fl,{size:11,strokeWidth:3}),n("logs.history.query")]})]}),c.jsxs("div",{className:"relative flex-1 max-w-md",children:[c.jsx(fl,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-subtle)]"}),c.jsx("input",{className:"nb-input pl-9 w-full",placeholder:n("logs.filter.keyword.placeholder"),value:y,onChange:F=>b(F.target.value),"aria-label":n("logs.filter.keyword.aria")})]}),c.jsx("div",{className:"flex items-center gap-1 p-1 bg-[var(--color-bg)] border-[2px] border-[var(--color-text)] rounded-full shadow-[2px_2px_0_var(--color-text)]",children:bI.map(F=>c.jsx(wI,{level:F,enabled:g.has(F),onToggle:()=>{m(Y=>{const D=new Set(Y);return D.has(F)?D.delete(F):D.add(F),D})}},F))}),c.jsxs("div",{className:"ml-auto flex gap-2",children:[k==="live"&&c.jsxs(c.Fragment,{children:[c.jsx("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>h(F=>!F),type:"button",children:f?"✓ Auto-scroll":"Auto-scroll"}),c.jsx("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>d(F=>!F),type:"button",children:o?c.jsxs(c.Fragment,{children:[c.jsx(Yu,{size:12,strokeWidth:3})," Resume"]}):c.jsxs(c.Fragment,{children:[c.jsx(qL,{size:12,strokeWidth:3})," Pause"]})})]}),c.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>{const F=new Blob([q.map(K=>K.raw).join(`
473
+ `)],{type:"text/plain"}),Y=URL.createObjectURL(F),D=document.createElement("a");D.href=Y,D.download=`${e}-log-${Date.now()}.log`,D.click(),URL.revokeObjectURL(Y)},type:"button",children:[c.jsx(Uh,{size:12,strokeWidth:2.5})," Export"]})]})]}),c.jsxs("div",{className:"scroll-frame flex min-h-0 flex-1 flex-col rounded-lg border-2 border-[var(--color-border-light)] bg-[var(--color-bg-cream)]",children:[c.jsxs("div",{className:"px-4 bg-color-bg-soft py-2 bg-[var(--color-bg-cream)] border-b-2 border-[var(--color-border-light)] flex shrink-0 items-center justify-between font-[family-name:var(--font-mono)] text-xs",children:[c.jsxs("span",{className:"text-[var(--color-text-muted)]",children:[($==null?void 0:$.file)??`~/.coral/projects/${e}/logs/*.log`," · ",a.length," lines",o&&c.jsx("span",{className:"text-[var(--color-stuck)] ml-2 font-bold",children:n("logs.paused")})]}),k==="live"?c.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:"live"}):c.jsx("span",{className:"nb-status",style:{background:"var(--color-accent-purple)",color:"var(--color-text)"},children:"history"})]}),c.jsxs("div",{ref:C,className:"scroll-frame-body flex-1 bg-surface-input font-[family-name:var(--font-mono)] text-[12px] leading-[22px] p-2",onScroll:F=>{const Y=F.currentTarget;!(Y.scrollHeight-Y.scrollTop-Y.clientHeight<40)&&f&&h(!1)},children:[q.map((F,Y)=>c.jsx(kI,{line:F},Y)),q.length===0&&c.jsx("div",{className:"text-center py-12 text-[var(--color-text-subtle)]",children:n("logs.empty.match")})]})]})]})}function wI({level:e,enabled:t,onToggle:n}){const i={error:"var(--color-crashed-bg)",warn:"var(--color-stuck-bg)",info:"var(--color-secondary)",debug:"var(--color-accent-purple)"},a={error:"var(--color-crashed)",warn:"var(--color-stuck)",info:"var(--color-text)",debug:"var(--color-text)"};return c.jsx("button",{type:"button",onClick:n,"aria-pressed":t,className:["px-3 py-0.5 rounded-full font-[family-name:var(--font-mono)] text-[10px] font-bold tracking-widest cursor-pointer",t?"border-[1.5px] border-[var(--color-text)]":"text-[var(--color-text-subtle)]"].join(" "),style:t?{background:i[e],color:a[e]}:{},children:e.toUpperCase()})}function kI({line:e}){var n;const t={error:"bg-[var(--color-crashed)] text-[var(--color-text)]",warn:"bg-[var(--color-stuck)] text-[var(--color-text)]",info:"bg-[var(--color-secondary)] text-[var(--color-text)]",debug:"",trace:""};return c.jsxs("div",{className:"grid gap-2 px-2 py-0.5 rounded hover:bg-[var(--color-bg-cream)] grid-cols-[100px_60px_1fr]",children:[c.jsx("span",{className:"text-[var(--color-text-subtle)] whitespace-nowrap",children:e.ts?((n=e.ts.split("T")[1])==null?void 0:n.replace("Z",""))??e.ts:"--"}),c.jsx("span",{className:`text-center font-bold ${t[e.level]??""}`,style:{borderRadius:4,padding:"0 6px"},children:e.level.toUpperCase()}),c.jsx("span",{className:"truncate text-[var(--color-text)]",children:e.msg})]})}function hk({s:e,active:t,onClick:n}){const i=e.status==="running"?"#22c55e":e.status==="error"?"#ef4444":"#9ca3af";return c.jsxs("button",{type:"button",onClick:n,"aria-pressed":t,"aria-label":`查看${e.label}日志`,className:["px-2.5 py-1 rounded-full text-xs font-bold border-[2px] border-[var(--color-text)] flex items-center gap-1.5",t?"bg-[var(--color-primary)] text-[var(--color-text)] shadow-[1px_1px_0_var(--color-text)]":"bg-white text-[var(--color-text-muted)] hover:-translate-y-px"].join(" "),children:[e.worker!=null&&c.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:i,display:"inline-block"},"aria-hidden":!0}),e.label]})}function EI({title:e,body:t,confirm:n,cancel:i,onConfirm:a,onCancel:l,danger:o}){const d=Be();return j.useEffect(()=>{const f=h=>{h.key==="Escape"&&l()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[l]),c.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"confirm-title",className:"fixed inset-0 z-50 flex items-center justify-center p-6 bg-black/30",children:c.jsxs("div",{className:"nb-card max-w-md w-full",children:[c.jsx("h2",{id:"confirm-title",className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-2",children:e}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mb-5",children:t}),c.jsxs("div",{className:"flex gap-3 justify-end",children:[c.jsx("button",{className:"nb-btn",onClick:l,type:"button",children:i??d("dialog.cancel.default")}),c.jsx("button",{className:o?"nb-btn nb-btn-danger":"nb-btn nb-btn-yellow",onClick:async()=>{await a()},type:"button",children:n})]})]})})}const p_=j.createContext(null);function SI({children:e}){const t=Be(),[n,i]=j.useState(null),a=j.useCallback(d=>new Promise(f=>{i({kind:"confirm",opts:d,resolve:h=>{i(null),f(h)}})}),[]),l=j.useCallback(d=>new Promise(f=>{i({kind:"alert",opts:d,resolve:()=>{i(null),f()}})}),[]),o=j.useCallback(d=>new Promise(f=>{i({kind:"prompt",opts:d,resolve:h=>{i(null),f(h)}})}),[]);return c.jsxs(p_.Provider,{value:{confirm:a,alert:l,prompt:o},children:[e,(n==null?void 0:n.kind)==="confirm"&&c.jsx(EI,{title:n.opts.title,body:n.opts.body,confirm:n.opts.confirm??t("dialog.confirm.default"),cancel:n.opts.cancel,danger:n.opts.danger,onConfirm:()=>n.resolve(!0),onCancel:()=>n.resolve(!1)}),(n==null?void 0:n.kind)==="alert"&&c.jsx(NI,{title:n.opts.title,body:n.opts.body,confirm:n.opts.confirm??t("dialog.alert.default"),onClose:()=>n.resolve()}),(n==null?void 0:n.kind)==="prompt"&&c.jsx(_I,{title:n.opts.title,body:n.opts.body,placeholder:n.opts.placeholder,defaultValue:n.opts.defaultValue,confirm:n.opts.confirm??t("dialog.confirm.default"),cancel:n.opts.cancel??t("dialog.cancel.default"),onConfirm:d=>n.resolve(d),onCancel:()=>n.resolve(null)})]})}function un(){const e=j.useContext(p_);if(!e)throw new Error("useDialog must be used inside <DialogProvider>");return e}function NI({title:e,body:t,confirm:n,onClose:i}){return j.useEffect(()=>{const a=l=>{(l.key==="Escape"||l.key==="Enter")&&i()};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[i]),c.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-50 flex items-center justify-center p-6 bg-black/30",children:c.jsxs("div",{className:"nb-card max-w-md w-full",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-2",children:e}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mb-5 whitespace-pre-wrap break-words",children:t}),c.jsx("div",{className:"flex gap-3 justify-end",children:c.jsx("button",{className:"nb-btn nb-btn-primary",onClick:i,type:"button",autoFocus:!0,children:n})})]})})}function _I({title:e,body:t,placeholder:n,defaultValue:i,confirm:a,cancel:l,onConfirm:o,onCancel:d}){const[f,h]=j.useState(i??""),g=j.useRef(null);j.useEffect(()=>{var b,k;(b=g.current)==null||b.focus(),(k=g.current)==null||k.select();const y=v=>{v.key==="Escape"&&d()};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[d]);const m=()=>{const y=f.trim();y&&o(y)};return c.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-50 flex items-center justify-center p-6 bg-black/30",children:c.jsxs("div",{className:"nb-card max-w-md w-full",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-2",children:e}),t&&c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mb-3 whitespace-pre-wrap break-words",children:t}),c.jsx("input",{ref:g,type:"text",className:"nb-input w-full mb-5",placeholder:n,value:f,onChange:y=>h(y.target.value),onKeyDown:y=>{y.key==="Enter"&&!y.nativeEvent.isComposing&&(y.preventDefault(),m())}}),c.jsxs("div",{className:"flex gap-3 justify-end",children:[c.jsx("button",{className:"nb-btn",onClick:d,type:"button",children:l}),c.jsx("button",{className:"nb-btn nb-btn-primary",onClick:m,type:"button",disabled:!f.trim(),children:a})]})]})})}const Vb=Symbol.for("yaml.alias"),qy=Symbol.for("yaml.document"),xs=Symbol.for("yaml.map"),m_=Symbol.for("yaml.pair"),Or=Symbol.for("yaml.scalar"),Jo=Symbol.for("yaml.seq"),Vi=Symbol.for("yaml.node.type"),Ss=e=>!!e&&typeof e=="object"&&e[Vi]===Vb,wl=e=>!!e&&typeof e=="object"&&e[Vi]===qy,ec=e=>!!e&&typeof e=="object"&&e[Vi]===xs,en=e=>!!e&&typeof e=="object"&&e[Vi]===m_,Kt=e=>!!e&&typeof e=="object"&&e[Vi]===Or,tc=e=>!!e&&typeof e=="object"&&e[Vi]===Jo;function on(e){if(e&&typeof e=="object")switch(e[Vi]){case xs:case Jo:return!0}return!1}function cn(e){if(e&&typeof e=="object")switch(e[Vi]){case Vb:case xs:case Or:case Jo:return!0}return!1}const g_=e=>(Kt(e)||on(e))&&!!e.anchor,fi=Symbol("break visit"),y_=Symbol("skip children"),Mr=Symbol("remove node");function kl(e,t){const n=b_(t);wl(e)?go(null,e.contents,n,Object.freeze([e]))===Mr&&(e.contents=null):go(null,e,n,Object.freeze([]))}kl.BREAK=fi;kl.SKIP=y_;kl.REMOVE=Mr;function go(e,t,n,i){const a=x_(e,t,n,i);if(cn(a)||en(a))return v_(e,i,a),go(e,a,n,i);if(typeof a!="symbol"){if(on(t)){i=Object.freeze(i.concat(t));for(let l=0;l<t.items.length;++l){const o=go(l,t.items[l],n,i);if(typeof o=="number")l=o-1;else{if(o===fi)return fi;o===Mr&&(t.items.splice(l,1),l-=1)}}}else if(en(t)){i=Object.freeze(i.concat(t));const l=go("key",t.key,n,i);if(l===fi)return fi;l===Mr&&(t.key=null);const o=go("value",t.value,n,i);if(o===fi)return fi;o===Mr&&(t.value=null)}}return a}async function Hh(e,t){const n=b_(t);wl(e)?await yo(null,e.contents,n,Object.freeze([e]))===Mr&&(e.contents=null):await yo(null,e,n,Object.freeze([]))}Hh.BREAK=fi;Hh.SKIP=y_;Hh.REMOVE=Mr;async function yo(e,t,n,i){const a=await x_(e,t,n,i);if(cn(a)||en(a))return v_(e,i,a),yo(e,a,n,i);if(typeof a!="symbol"){if(on(t)){i=Object.freeze(i.concat(t));for(let l=0;l<t.items.length;++l){const o=await yo(l,t.items[l],n,i);if(typeof o=="number")l=o-1;else{if(o===fi)return fi;o===Mr&&(t.items.splice(l,1),l-=1)}}}else if(en(t)){i=Object.freeze(i.concat(t));const l=await yo("key",t.key,n,i);if(l===fi)return fi;l===Mr&&(t.key=null);const o=await yo("value",t.value,n,i);if(o===fi)return fi;o===Mr&&(t.value=null)}}return a}function b_(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function x_(e,t,n,i){var a,l,o,d,f;if(typeof n=="function")return n(e,t,i);if(ec(t))return(a=n.Map)==null?void 0:a.call(n,e,t,i);if(tc(t))return(l=n.Seq)==null?void 0:l.call(n,e,t,i);if(en(t))return(o=n.Pair)==null?void 0:o.call(n,e,t,i);if(Kt(t))return(d=n.Scalar)==null?void 0:d.call(n,e,t,i);if(Ss(t))return(f=n.Alias)==null?void 0:f.call(n,e,t,i)}function v_(e,t,n){const i=t[t.length-1];if(on(i))i.items[e]=n;else if(en(i))e==="key"?i.key=n:i.value=n;else if(wl(i))i.contents=n;else{const a=Ss(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${a} parent`)}}const jI={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},CI=e=>e.replace(/[!,[\]{}]/g,t=>jI[t]);class ti{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},ti.defaultYaml,t),this.tags=Object.assign({},ti.defaultTags,n)}clone(){const t=new ti(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new ti(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:ti.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},ti.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:ti.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},ti.defaultTags),this.atNextDocument=!1);const i=t.trim().split(/[ \t]+/),a=i.shift();switch(a){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;const[l,o]=i;return this.tags[l]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[l]=i;if(l==="1.1"||l==="1.2")return this.yaml.version=l,!0;{const o=/^\d+\.\d+$/.test(l);return n(6,`Unsupported YAML version ${l}`,o),!1}}default:return n(0,`Unknown directive ${a}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,i,a]=t.match(/^(.*!)([^!]*)$/s);a||n(`The ${t} tag has no suffix`);const l=this.tags[i];if(l)try{return l+decodeURIComponent(a)}catch(o){return n(String(o)),null}return i==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,i]of Object.entries(this.tags))if(t.startsWith(i))return n+CI(t.substring(i.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags);let a;if(t&&i.length>0&&cn(t.contents)){const l={};kl(t.contents,(o,d)=>{cn(d)&&d.tag&&(l[d.tag]=!0)}),a=Object.keys(l)}else a=[];for(const[l,o]of i)l==="!!"&&o==="tag:yaml.org,2002:"||(!t||a.some(d=>d.startsWith(o)))&&n.push(`%TAG ${l} ${o}`);return n.join(`
474
+ `)}}ti.defaultYaml={explicit:!1,version:"1.2"};ti.defaultTags={"!!":"tag:yaml.org,2002:"};function w_(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function k_(e){const t=new Set;return kl(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function E_(e,t){for(let n=1;;++n){const i=`${e}${n}`;if(!t.has(i))return i}}function AI(e,t){const n=[],i=new Map;let a=null;return{onAnchor:l=>{n.push(l),a??(a=k_(e));const o=E_(t,a);return a.add(o),o},setAnchors:()=>{for(const l of n){const o=i.get(l);if(typeof o=="object"&&o.anchor&&(Kt(o.node)||on(o.node)))o.node.anchor=o.anchor;else{const d=new Error("Failed to resolve repeated object (this should not happen)");throw d.source=l,d}}},sourceObjects:i}}function bo(e,t,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let a=0,l=i.length;a<l;++a){const o=i[a],d=bo(e,i,String(a),o);d===void 0?delete i[a]:d!==o&&(i[a]=d)}else if(i instanceof Map)for(const a of Array.from(i.keys())){const l=i.get(a),o=bo(e,i,a,l);o===void 0?i.delete(a):o!==l&&i.set(a,o)}else if(i instanceof Set)for(const a of Array.from(i)){const l=bo(e,i,a,a);l===void 0?i.delete(a):l!==a&&(i.delete(a),i.add(l))}else for(const[a,l]of Object.entries(i)){const o=bo(e,i,a,l);o===void 0?delete i[a]:o!==l&&(i[a]=o)}return e.call(t,n,i)}function Ki(e,t,n){if(Array.isArray(e))return e.map((i,a)=>Ki(i,String(a),n));if(e&&typeof e.toJSON=="function"){if(!n||!g_(e))return e.toJSON(t,n);const i={aliasCount:0,count:1,res:void 0};n.anchors.set(e,i),n.onCreate=l=>{i.res=l,delete n.onCreate};const a=e.toJSON(t,n);return n.onCreate&&n.onCreate(a),a}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class Yb{constructor(t){Object.defineProperty(this,Vi,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:i,onAnchor:a,reviver:l}={}){if(!wl(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},d=Ki(this,"",o);if(typeof a=="function")for(const{count:f,res:h}of o.anchors.values())a(h,f);return typeof l=="function"?bo(l,{"":d},"",d):d}}class Kh extends Yb{constructor(t){super(Vb),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){let i;n!=null&&n.aliasResolveCache?i=n.aliasResolveCache:(i=[],kl(t,{Node:(l,o)=>{(Ss(o)||g_(o))&&i.push(o)}}),n&&(n.aliasResolveCache=i));let a;for(const l of i){if(l===this)break;l.anchor===this.source&&(a=l)}return a}toJSON(t,n){if(!n)return{source:this.source};const{anchors:i,doc:a,maxAliasCount:l}=n,o=this.resolve(a,n);if(!o){const f=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(f)}let d=i.get(o);if(d||(Ki(o,null,n),d=i.get(o)),(d==null?void 0:d.res)===void 0){const f="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(f)}if(l>=0&&(d.count+=1,d.aliasCount===0&&(d.aliasCount=Zf(a,o,i)),d.count*d.aliasCount>l)){const f="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(f)}return d.res}toString(t,n,i){const a=`*${this.source}`;if(t){if(w_(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(l)}if(t.implicitKey)return`${a} `}return a}}function Zf(e,t,n){if(Ss(t)){const i=t.resolve(e),a=n&&i&&n.get(i);return a?a.count*a.aliasCount:0}else if(on(t)){let i=0;for(const a of t.items){const l=Zf(e,a,n);l>i&&(i=l)}return i}else if(en(t)){const i=Zf(e,t.key,n),a=Zf(e,t.value,n);return Math.max(i,a)}return 1}const S_=e=>!e||typeof e!="function"&&typeof e!="object";class st extends Yb{constructor(t){super(Or),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:Ki(this.value,t,n)}toString(){return String(this.value)}}st.BLOCK_FOLDED="BLOCK_FOLDED";st.BLOCK_LITERAL="BLOCK_LITERAL";st.PLAIN="PLAIN";st.QUOTE_DOUBLE="QUOTE_DOUBLE";st.QUOTE_SINGLE="QUOTE_SINGLE";const TI="tag:yaml.org,2002:";function MI(e,t,n){if(t){const i=n.filter(l=>l.tag===t),a=i.find(l=>!l.format)??i[0];if(!a)throw new Error(`Tag ${t} not found`);return a}return n.find(i=>{var a;return((a=i.identify)==null?void 0:a.call(i,e))&&!i.format})}function Su(e,t,n){var m,y,b;if(wl(e)&&(e=e.contents),cn(e))return e;if(en(e)){const k=(y=(m=n.schema[xs]).createNode)==null?void 0:y.call(m,n.schema,null,n);return k.items.push(e),k}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:i,onAnchor:a,onTagObj:l,schema:o,sourceObjects:d}=n;let f;if(i&&e&&typeof e=="object"){if(f=d.get(e),f)return f.anchor??(f.anchor=a(e)),new Kh(f.anchor);f={anchor:null,node:null},d.set(e,f)}t!=null&&t.startsWith("!!")&&(t=TI+t.slice(2));let h=MI(e,t,o.tags);if(!h){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const k=new st(e);return f&&(f.node=k),k}h=e instanceof Map?o[xs]:Symbol.iterator in Object(e)?o[Jo]:o[xs]}l&&(l(h),delete n.onTagObj);const g=h!=null&&h.createNode?h.createNode(n.schema,e,n):typeof((b=h==null?void 0:h.nodeClass)==null?void 0:b.from)=="function"?h.nodeClass.from(n.schema,e,n):new st(e);return t?g.tag=t:h.default||(g.tag=h.tag),f&&(f.node=g),g}function mh(e,t,n){let i=n;for(let a=t.length-1;a>=0;--a){const l=t[a];if(typeof l=="number"&&Number.isInteger(l)&&l>=0){const o=[];o[l]=i,i=o}else i=new Map([[l,i]])}return Su(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const cu=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class N_ extends Yb{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(i=>cn(i)||en(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(cu(t))this.add(n);else{const[i,...a]=t,l=this.get(i,!0);if(on(l))l.addIn(a,n);else if(l===void 0&&this.schema)this.set(i,mh(this.schema,a,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${a}`)}}deleteIn(t){const[n,...i]=t;if(i.length===0)return this.delete(n);const a=this.get(n,!0);if(on(a))return a.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(t,n){const[i,...a]=t,l=this.get(i,!0);return a.length===0?!n&&Kt(l)?l.value:l:on(l)?l.getIn(a,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!en(n))return!1;const i=n.value;return i==null||t&&Kt(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(t){const[n,...i]=t;if(i.length===0)return this.has(n);const a=this.get(n,!0);return on(a)?a.hasIn(i):!1}setIn(t,n){const[i,...a]=t;if(a.length===0)this.set(i,n);else{const l=this.get(i,!0);if(on(l))l.setIn(a,n);else if(l===void 0&&this.schema)this.set(i,mh(this.schema,a,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${a}`)}}}const DI=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function da(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Ws=(e,t,n)=>e.endsWith(`
475
+ `)?da(n,t):n.includes(`
476
+ `)?`
477
+ `+da(n,t):(e.endsWith(" ")?"":" ")+n,__="flow",Hy="block",Jf="quoted";function Gh(e,t,n="flow",{indentAtStart:i,lineWidth:a=80,minContentWidth:l=20,onFold:o,onOverflow:d}={}){if(!a||a<0)return e;a<l&&(l=0);const f=Math.max(1+l,1+a-t.length);if(e.length<=f)return e;const h=[],g={};let m=a-t.length;typeof i=="number"&&(i>a-Math.max(2,l)?h.push(0):m=a-i);let y,b,k=!1,v=-1,N=-1,E=-1;n===Hy&&(v=pk(e,v,t.length),v!==-1&&(m=v+f));for(let S;S=e[v+=1];){if(n===Jf&&S==="\\"){switch(N=v,e[v+1]){case"x":v+=3;break;case"u":v+=5;break;case"U":v+=9;break;default:v+=1}E=v}if(S===`
478
+ `)n===Hy&&(v=pk(e,v,t.length)),m=v+t.length+f,y=void 0;else{if(S===" "&&b&&b!==" "&&b!==`
479
+ `&&b!==" "){const _=e[v+1];_&&_!==" "&&_!==`
480
+ `&&_!==" "&&(y=v)}if(v>=m)if(y)h.push(y),m=y+f,y=void 0;else if(n===Jf){for(;b===" "||b===" ";)b=S,S=e[v+=1],k=!0;const _=v>E+1?v-2:N-1;if(g[_])return e;h.push(_),g[_]=!0,m=_+f,y=void 0}else k=!0}b=S}if(k&&d&&d(),h.length===0)return e;o&&o();let C=e.slice(0,h[0]);for(let S=0;S<h.length;++S){const _=h[S],M=h[S+1]||e.length;_===0?C=`
481
+ ${t}${e.slice(0,M)}`:(n===Jf&&g[_]&&(C+=`${e[_]}\\`),C+=`
482
+ ${t}${e.slice(_+1,M)}`)}return C}function pk(e,t,n){let i=t,a=t+1,l=e[a];for(;l===" "||l===" ";)if(t<a+n)l=e[++t];else{do l=e[++t];while(l&&l!==`
483
+ `);i=t,a=t+1,l=e[a]}return i}const Vh=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Yh=e=>/^(%|---|\.\.\.)/m.test(e);function OI(e,t,n){if(!t||t<0)return!1;const i=t-n,a=e.length;if(a<=i)return!1;for(let l=0,o=0;l<a;++l)if(e[l]===`
484
+ `){if(l-o>i)return!0;if(o=l+1,a-o<=i)return!1}return!0}function fu(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:i}=t,a=t.options.doubleQuotedMinMultiLineLength,l=t.indent||(Yh(e)?" ":"");let o="",d=0;for(let f=0,h=n[f];h;h=n[++f])if(h===" "&&n[f+1]==="\\"&&n[f+2]==="n"&&(o+=n.slice(d,f)+"\\ ",f+=1,d=f,h="\\"),h==="\\")switch(n[f+1]){case"u":{o+=n.slice(d,f);const g=n.substr(f+2,4);switch(g){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:g.substr(0,2)==="00"?o+="\\x"+g.substr(2):o+=n.substr(f,6)}f+=5,d=f+1}break;case"n":if(i||n[f+2]==='"'||n.length<a)f+=1;else{for(o+=n.slice(d,f)+`
485
+
486
+ `;n[f+2]==="\\"&&n[f+3]==="n"&&n[f+4]!=='"';)o+=`
487
+ `,f+=2;o+=l,n[f+2]===" "&&(o+="\\"),f+=1,d=f+1}break;default:f+=1}return o=d?o+n.slice(d):n,i?o:Gh(o,l,Jf,Vh(t,!1))}function Ky(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
488
+ `)||/[ \t]\n|\n[ \t]/.test(e))return fu(e,t);const n=t.indent||(Yh(e)?" ":""),i="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
489
+ ${n}`)+"'";return t.implicitKey?i:Gh(i,n,__,Vh(t,!1))}function xo(e,t){const{singleQuote:n}=t.options;let i;if(n===!1)i=fu;else{const a=e.includes('"'),l=e.includes("'");a&&!l?i=Ky:l&&!a?i=fu:i=n?Ky:fu}return i(e,t)}let Gy;try{Gy=new RegExp(`(^|(?<!
490
+ ))
491
+ +(?!
492
+ |$)`,"g")}catch{Gy=/\n+(?!\n|$)/g}function eh({comment:e,type:t,value:n},i,a,l){const{blockQuote:o,commentString:d,lineWidth:f}=i.options;if(!o||/\n[\t ]+$/.test(n))return xo(n,i);const h=i.indent||(i.forceBlockIndent||Yh(n)?" ":""),g=o==="literal"?!0:o==="folded"||t===st.BLOCK_FOLDED?!1:t===st.BLOCK_LITERAL?!0:!OI(n,f,h.length);if(!n)return g?`|
493
+ `:`>
494
+ `;let m,y;for(y=n.length;y>0;--y){const M=n[y-1];if(M!==`
495
+ `&&M!==" "&&M!==" ")break}let b=n.substring(y);const k=b.indexOf(`
496
+ `);k===-1?m="-":n===b||k!==b.length-1?(m="+",l&&l()):m="",b&&(n=n.slice(0,-b.length),b[b.length-1]===`
497
+ `&&(b=b.slice(0,-1)),b=b.replace(Gy,`$&${h}`));let v=!1,N,E=-1;for(N=0;N<n.length;++N){const M=n[N];if(M===" ")v=!0;else if(M===`
498
+ `)E=N;else break}let C=n.substring(0,E<N?E+1:N);C&&(n=n.substring(C.length),C=C.replace(/\n+/g,`$&${h}`));let _=(v?h?"2":"1":"")+m;if(e&&(_+=" "+d(e.replace(/ ?[\r\n]+/g," ")),a&&a()),!g){const M=n.replace(/\n+/g,`
499
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${h}`);let T=!1;const R=Vh(i,!0);o!=="folded"&&t!==st.BLOCK_FOLDED&&(R.onOverflow=()=>{T=!0});const O=Gh(`${C}${M}${b}`,h,Hy,R);if(!T)return`>${_}
500
+ ${h}${O}`}return n=n.replace(/\n+/g,`$&${h}`),`|${_}
501
+ ${h}${C}${n}${b}`}function RI(e,t,n,i){const{type:a,value:l}=e,{actualString:o,implicitKey:d,indent:f,indentStep:h,inFlow:g}=t;if(d&&l.includes(`
502
+ `)||g&&/[[\]{},]/.test(l))return xo(l,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(l))return d||g||!l.includes(`
503
+ `)?xo(l,t):eh(e,t,n,i);if(!d&&!g&&a!==st.PLAIN&&l.includes(`
504
+ `))return eh(e,t,n,i);if(Yh(l)){if(f==="")return t.forceBlockIndent=!0,eh(e,t,n,i);if(d&&f===h)return xo(l,t)}const m=l.replace(/\n+/g,`$&
505
+ ${f}`);if(o){const y=v=>{var N;return v.default&&v.tag!=="tag:yaml.org,2002:str"&&((N=v.test)==null?void 0:N.test(m))},{compat:b,tags:k}=t.doc.schema;if(k.some(y)||b!=null&&b.some(y))return xo(l,t)}return d?m:Gh(m,f,__,Vh(t,!1))}function Qu(e,t,n,i){const{implicitKey:a,inFlow:l}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:d}=e;d!==st.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(d=st.QUOTE_DOUBLE);const f=g=>{switch(g){case st.BLOCK_FOLDED:case st.BLOCK_LITERAL:return a||l?xo(o.value,t):eh(o,t,n,i);case st.QUOTE_DOUBLE:return fu(o.value,t);case st.QUOTE_SINGLE:return Ky(o.value,t);case st.PLAIN:return RI(o,t,n,i);default:return null}};let h=f(d);if(h===null){const{defaultKeyType:g,defaultStringType:m}=t.options,y=a&&g||m;if(h=f(y),h===null)throw new Error(`Unsupported default string type ${y}`)}return h}function j_(e,t){const n=Object.assign({blockQuote:!0,commentString:DI,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function LI(e,t){var a;if(t.tag){const l=e.filter(o=>o.tag===t.tag);if(l.length>0)return l.find(o=>o.format===t.format)??l[0]}let n,i;if(Kt(t)){i=t.value;let l=e.filter(o=>{var d;return(d=o.identify)==null?void 0:d.call(o,i)});if(l.length>1){const o=l.filter(d=>d.test);o.length>0&&(l=o)}n=l.find(o=>o.format===t.format)??l.find(o=>!o.format)}else i=t,n=e.find(l=>l.nodeClass&&i instanceof l.nodeClass);if(!n){const l=((a=i==null?void 0:i.constructor)==null?void 0:a.name)??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${l} value`)}return n}function II(e,t,{anchors:n,doc:i}){if(!i.directives)return"";const a=[],l=(Kt(e)||on(e))&&e.anchor;l&&w_(l)&&(n.add(l),a.push(`&${l}`));const o=e.tag??(t.default?null:t.tag);return o&&a.push(i.directives.tagString(o)),a.join(" ")}function Bo(e,t,n,i){var f;if(en(e))return e.toString(t,n,i);if(Ss(e)){if(t.doc.directives)return e.toString(t);if((f=t.resolvedAliases)!=null&&f.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let a;const l=cn(e)?e:t.doc.createNode(e,{onTagObj:h=>a=h});a??(a=LI(t.doc.schema.tags,l));const o=II(l,a,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const d=typeof a.stringify=="function"?a.stringify(l,t,n,i):Kt(l)?Qu(l,t,n,i):l.toString(t,n,i);return o?Kt(l)||d[0]==="{"||d[0]==="["?`${o} ${d}`:`${o}
506
+ ${t.indent}${d}`:d}function zI({key:e,value:t},n,i,a){const{allNullValues:l,doc:o,indent:d,indentStep:f,options:{commentString:h,indentSeq:g,simpleKeys:m}}=n;let y=cn(e)&&e.comment||null;if(m){if(y)throw new Error("With simple keys, key nodes cannot have comments");if(on(e)||!cn(e)&&typeof e=="object"){const R="With simple keys, collection cannot be used as a key value";throw new Error(R)}}let b=!m&&(!e||y&&t==null&&!n.inFlow||on(e)||(Kt(e)?e.type===st.BLOCK_FOLDED||e.type===st.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!b&&(m||!l),indent:d+f});let k=!1,v=!1,N=Bo(e,n,()=>k=!0,()=>v=!0);if(!b&&!n.inFlow&&N.length>1024){if(m)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");b=!0}if(n.inFlow){if(l||t==null)return k&&i&&i(),N===""?"?":b?`? ${N}`:N}else if(l&&!m||t==null&&b)return N=`? ${N}`,y&&!k?N+=Ws(N,n.indent,h(y)):v&&a&&a(),N;k&&(y=null),b?(y&&(N+=Ws(N,n.indent,h(y))),N=`? ${N}
507
+ ${d}:`):(N=`${N}:`,y&&(N+=Ws(N,n.indent,h(y))));let E,C,S;cn(t)?(E=!!t.spaceBefore,C=t.commentBefore,S=t.comment):(E=!1,C=null,S=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!b&&!y&&Kt(t)&&(n.indentAtStart=N.length+1),v=!1,!g&&f.length>=2&&!n.inFlow&&!b&&tc(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let _=!1;const M=Bo(t,n,()=>_=!0,()=>v=!0);let T=" ";if(y||E||C){if(T=E?`
508
+ `:"",C){const R=h(C);T+=`
509
+ ${da(R,n.indent)}`}M===""&&!n.inFlow?T===`
510
+ `&&S&&(T=`
511
+
512
+ `):T+=`
513
+ ${n.indent}`}else if(!b&&on(t)){const R=M[0],O=M.indexOf(`
514
+ `),$=O!==-1,I=n.inFlow??t.flow??t.items.length===0;if($||!I){let q=!1;if($&&(R==="&"||R==="!")){let F=M.indexOf(" ");R==="&"&&F!==-1&&F<O&&M[F+1]==="!"&&(F=M.indexOf(" ",F+1)),(F===-1||O<F)&&(q=!0)}q||(T=`
515
+ ${n.indent}`)}}else(M===""||M[0]===`
516
+ `)&&(T="");return N+=T+M,n.inFlow?_&&i&&i():S&&!_?N+=Ws(N,n.indent,h(S)):v&&a&&a(),N}function C_(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Ef="<<",ha={identify:e=>e===Ef||typeof e=="symbol"&&e.description===Ef,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new st(Symbol(Ef)),{addToJSMap:A_}),stringify:()=>Ef},PI=(e,t)=>(ha.identify(t)||Kt(t)&&(!t.type||t.type===st.PLAIN)&&ha.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===ha.tag&&n.default));function A_(e,t,n){if(n=e&&Ss(n)?n.resolve(e.doc):n,tc(n))for(const i of n.items)Dg(e,t,i);else if(Array.isArray(n))for(const i of n)Dg(e,t,i);else Dg(e,t,n)}function Dg(e,t,n){const i=e&&Ss(n)?n.resolve(e.doc):n;if(!ec(i))throw new Error("Merge sources must be maps or map aliases");const a=i.toJSON(null,e,Map);for(const[l,o]of a)t instanceof Map?t.has(l)||t.set(l,o):t instanceof Set?t.add(l):Object.prototype.hasOwnProperty.call(t,l)||Object.defineProperty(t,l,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function T_(e,t,{key:n,value:i}){if(cn(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(PI(e,n))A_(e,t,i);else{const a=Ki(n,"",e);if(t instanceof Map)t.set(a,Ki(i,a,e));else if(t instanceof Set)t.add(a);else{const l=BI(n,a,e),o=Ki(i,l,e);l in t?Object.defineProperty(t,l,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[l]=o}}return t}function BI(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(cn(e)&&(n!=null&&n.doc)){const i=j_(n.doc,{});i.anchors=new Set;for(const l of n.anchors.keys())i.anchors.add(l.anchor);i.inFlow=!0,i.inStringifyKey=!0;const a=e.toString(i);if(!n.mapKeyWarned){let l=JSON.stringify(a);l.length>40&&(l=l.substring(0,36)+'..."'),C_(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${l}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return a}return JSON.stringify(t)}function Qb(e,t,n){const i=Su(e,void 0,n),a=Su(t,void 0,n);return new Vn(i,a)}class Vn{constructor(t,n=null){Object.defineProperty(this,Vi,{value:m_}),this.key=t,this.value=n}clone(t){let{key:n,value:i}=this;return cn(n)&&(n=n.clone(t)),cn(i)&&(i=i.clone(t)),new Vn(n,i)}toJSON(t,n){const i=n!=null&&n.mapAsMap?new Map:{};return T_(n,i,this)}toString(t,n,i){return t!=null&&t.doc?zI(this,t,n,i):JSON.stringify(this)}}function M_(e,t,n){return(t.inFlow??e.flow?UI:$I)(e,t,n)}function $I({comment:e,items:t},n,{blockItemPrefix:i,flowChars:a,itemIndent:l,onChompKeep:o,onComment:d}){const{indent:f,options:{commentString:h}}=n,g=Object.assign({},n,{indent:l,type:null});let m=!1;const y=[];for(let k=0;k<t.length;++k){const v=t[k];let N=null;if(cn(v))!m&&v.spaceBefore&&y.push(""),gh(n,y,v.commentBefore,m),v.comment&&(N=v.comment);else if(en(v)){const C=cn(v.key)?v.key:null;C&&(!m&&C.spaceBefore&&y.push(""),gh(n,y,C.commentBefore,m))}m=!1;let E=Bo(v,g,()=>N=null,()=>m=!0);N&&(E+=Ws(E,l,h(N))),m&&N&&(m=!1),y.push(i+E)}let b;if(y.length===0)b=a.start+a.end;else{b=y[0];for(let k=1;k<y.length;++k){const v=y[k];b+=v?`
517
+ ${f}${v}`:`
518
+ `}}return e?(b+=`
519
+ `+da(h(e),f),d&&d()):m&&o&&o(),b}function UI({items:e},t,{flowChars:n,itemIndent:i}){const{indent:a,indentStep:l,flowCollectionPadding:o,options:{commentString:d}}=t;i+=l;const f=Object.assign({},t,{indent:i,inFlow:!0,type:null});let h=!1,g=0;const m=[];for(let k=0;k<e.length;++k){const v=e[k];let N=null;if(cn(v))v.spaceBefore&&m.push(""),gh(t,m,v.commentBefore,!1),v.comment&&(N=v.comment);else if(en(v)){const C=cn(v.key)?v.key:null;C&&(C.spaceBefore&&m.push(""),gh(t,m,C.commentBefore,!1),C.comment&&(h=!0));const S=cn(v.value)?v.value:null;S?(S.comment&&(N=S.comment),S.commentBefore&&(h=!0)):v.value==null&&(C!=null&&C.comment)&&(N=C.comment)}N&&(h=!0);let E=Bo(v,f,()=>N=null);h||(h=m.length>g||E.includes(`
520
+ `)),k<e.length-1?E+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(h||(h=m.reduce((C,S)=>C+S.length+2,2)+(E.length+2)>t.options.lineWidth)),h&&(E+=",")),N&&(E+=Ws(E,i,d(N))),m.push(E),g=m.length}const{start:y,end:b}=n;if(m.length===0)return y+b;if(!h){const k=m.reduce((v,N)=>v+N.length+2,2);h=t.options.lineWidth>0&&k>t.options.lineWidth}if(h){let k=y;for(const v of m)k+=v?`
521
+ ${l}${a}${v}`:`
522
+ `;return`${k}
523
+ ${a}${b}`}else return`${y}${o}${m.join(" ")}${o}${b}`}function gh({indent:e,options:{commentString:t}},n,i,a){if(i&&a&&(i=i.replace(/^\n+/,"")),i){const l=da(t(i),e);n.push(l.trimStart())}}function Xs(e,t){const n=Kt(t)?t.value:t;for(const i of e)if(en(i)&&(i.key===t||i.key===n||Kt(i.key)&&i.key.value===n))return i}class Ni extends N_{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(xs,t),this.items=[]}static from(t,n,i){const{keepUndefined:a,replacer:l}=i,o=new this(t),d=(f,h)=>{if(typeof l=="function")h=l.call(n,f,h);else if(Array.isArray(l)&&!l.includes(f))return;(h!==void 0||a)&&o.items.push(Qb(f,h,i))};if(n instanceof Map)for(const[f,h]of n)d(f,h);else if(n&&typeof n=="object")for(const f of Object.keys(n))d(f,n[f]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){var o;let i;en(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new Vn(t,t==null?void 0:t.value):i=new Vn(t.key,t.value);const a=Xs(this.items,i.key),l=(o=this.schema)==null?void 0:o.sortMapEntries;if(a){if(!n)throw new Error(`Key ${i.key} already set`);Kt(a.value)&&S_(i.value)?a.value.value=i.value:a.value=i.value}else if(l){const d=this.items.findIndex(f=>l(i,f)<0);d===-1?this.items.push(i):this.items.splice(d,0,i)}else this.items.push(i)}delete(t){const n=Xs(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=Xs(this.items,t),a=i==null?void 0:i.value;return(!n&&Kt(a)?a.value:a)??void 0}has(t){return!!Xs(this.items,t)}set(t,n){this.add(new Vn(t,n),!0)}toJSON(t,n,i){const a=i?new i:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(a);for(const l of this.items)T_(n,a,l);return a}toString(t,n,i){if(!t)return JSON.stringify(this);for(const a of this.items)if(!en(a))throw new Error(`Map items must all be pairs; found ${JSON.stringify(a)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),M_(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:n})}}const nc={collection:"map",default:!0,nodeClass:Ni,tag:"tag:yaml.org,2002:map",resolve(e,t){return ec(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Ni.from(e,t,n)};class ws extends N_{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Jo,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Sf(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const i=Sf(t);if(typeof i!="number")return;const a=this.items[i];return!n&&Kt(a)?a.value:a}has(t){const n=Sf(t);return typeof n=="number"&&n<this.items.length}set(t,n){const i=Sf(t);if(typeof i!="number")throw new Error(`Expected a valid index, not ${t}.`);const a=this.items[i];Kt(a)&&S_(n)?a.value=n:this.items[i]=n}toJSON(t,n){const i=[];n!=null&&n.onCreate&&n.onCreate(i);let a=0;for(const l of this.items)i.push(Ki(l,String(a++),n));return i}toString(t,n,i){return t?M_(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:i,onComment:n}):JSON.stringify(this)}static from(t,n,i){const{replacer:a}=i,l=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let d of n){if(typeof a=="function"){const f=n instanceof Set?d:String(o++);d=a.call(n,f,d)}l.items.push(Su(d,void 0,i))}}return l}}function Sf(e){let t=Kt(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const ic={collection:"seq",default:!0,nodeClass:ws,tag:"tag:yaml.org,2002:seq",resolve(e,t){return tc(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>ws.from(e,t,n)},Qh={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,i){return t=Object.assign({actualString:!0},t),Qu(e,t,n,i)}},Wh={identify:e=>e==null,createNode:()=>new st(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new st(null),stringify:({source:e},t)=>typeof e=="string"&&Wh.test.test(e)?e:t.options.nullStr},Wb={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new st(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Wb.test.test(e)){const i=e[0]==="t"||e[0]==="T";if(t===i)return e}return t?n.options.trueStr:n.options.falseStr}};function mr({format:e,minFractionDigits:t,tag:n,value:i}){if(typeof i=="bigint")return String(i);const a=typeof i=="number"?i:Number(i);if(!isFinite(a))return isNaN(a)?".nan":a<0?"-.inf":".inf";let l=Object.is(i,-0)?"-0":JSON.stringify(i);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(l)){let o=l.indexOf(".");o<0&&(o=l.length,l+=".");let d=t-(l.length-o-1);for(;d-- >0;)l+="0"}return l}const D_={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:mr},O_={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():mr(e)}},R_={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new st(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:mr},Xh=e=>typeof e=="bigint"||Number.isInteger(e),Xb=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function L_(e,t,n){const{value:i}=e;return Xh(i)&&i>=0?n+i.toString(t):mr(e)}const I_={identify:e=>Xh(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Xb(e,2,8,n),stringify:e=>L_(e,8,"0o")},z_={identify:Xh,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Xb(e,0,10,n),stringify:mr},P_={identify:e=>Xh(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Xb(e,2,16,n),stringify:e=>L_(e,16,"0x")},FI=[nc,ic,Qh,Wh,Wb,I_,z_,P_,D_,O_,R_];function mk(e){return typeof e=="bigint"||Number.isInteger(e)}const Nf=({value:e})=>JSON.stringify(e),qI=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Nf},{identify:e=>e==null,createNode:()=>new st(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Nf},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Nf},{identify:mk,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>mk(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Nf}],HI={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},KI=[nc,ic].concat(qI,HI),Zb={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let a=0;a<n.length;++a)i[a]=n.charCodeAt(a);return i}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},i,a,l){if(!n)return"";const o=n;let d;if(typeof btoa=="function"){let f="";for(let h=0;h<o.length;++h)f+=String.fromCharCode(o[h]);d=btoa(f)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=st.BLOCK_LITERAL),t!==st.QUOTE_DOUBLE){const f=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),h=Math.ceil(d.length/f),g=new Array(h);for(let m=0,y=0;m<h;++m,y+=f)g[m]=d.substr(y,f);d=g.join(t===st.BLOCK_LITERAL?`
524
+ `:" ")}return Qu({comment:e,type:t,value:d},i,a,l)}};function B_(e,t){if(tc(e))for(let n=0;n<e.items.length;++n){let i=e.items[n];if(!en(i)){if(ec(i)){i.items.length>1&&t("Each pair must have its own sequence indicator");const a=i.items[0]||new Vn(new st(null));if(i.commentBefore&&(a.key.commentBefore=a.key.commentBefore?`${i.commentBefore}
525
+ ${a.key.commentBefore}`:i.commentBefore),i.comment){const l=a.value??a.key;l.comment=l.comment?`${i.comment}
526
+ ${l.comment}`:i.comment}i=a}e.items[n]=en(i)?i:new Vn(i)}}else t("Expected a sequence for this tag");return e}function $_(e,t,n){const{replacer:i}=n,a=new ws(e);a.tag="tag:yaml.org,2002:pairs";let l=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof i=="function"&&(o=i.call(t,String(l++),o));let d,f;if(Array.isArray(o))if(o.length===2)d=o[0],f=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const h=Object.keys(o);if(h.length===1)d=h[0],f=o[d];else throw new TypeError(`Expected tuple with one key, not ${h.length} keys`)}else d=o;a.items.push(Qb(d,f,n))}return a}const Jb={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:B_,createNode:$_};class ko extends ws{constructor(){super(),this.add=Ni.prototype.add.bind(this),this.delete=Ni.prototype.delete.bind(this),this.get=Ni.prototype.get.bind(this),this.has=Ni.prototype.has.bind(this),this.set=Ni.prototype.set.bind(this),this.tag=ko.tag}toJSON(t,n){if(!n)return super.toJSON(t);const i=new Map;n!=null&&n.onCreate&&n.onCreate(i);for(const a of this.items){let l,o;if(en(a)?(l=Ki(a.key,"",n),o=Ki(a.value,l,n)):l=Ki(a,"",n),i.has(l))throw new Error("Ordered maps must not include duplicate keys");i.set(l,o)}return i}static from(t,n,i){const a=$_(t,n,i),l=new this;return l.items=a.items,l}}ko.tag="tag:yaml.org,2002:omap";const ex={collection:"seq",identify:e=>e instanceof Map,nodeClass:ko,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=B_(e,t),i=[];for(const{key:a}of n.items)Kt(a)&&(i.includes(a.value)?t(`Ordered maps must not include duplicate keys: ${a.value}`):i.push(a.value));return Object.assign(new ko,n)},createNode:(e,t,n)=>ko.from(e,t,n)};function U_({value:e,source:t},n){return t&&(e?F_:q_).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const F_={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new st(!0),stringify:U_},q_={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new st(!1),stringify:U_},GI={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:mr},VI={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():mr(e)}},YI={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new st(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const i=e.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(t.minFractionDigits=i.length)}return t},stringify:mr},Wu=e=>typeof e=="bigint"||Number.isInteger(e);function Zh(e,t,n,{intAsBigInt:i}){const a=e[0];if((a==="-"||a==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),i){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return a==="-"?BigInt(-1)*o:o}const l=parseInt(e,n);return a==="-"?-1*l:l}function tx(e,t,n){const{value:i}=e;if(Wu(i)){const a=i.toString(t);return i<0?"-"+n+a.substr(1):n+a}return mr(e)}const QI={identify:Wu,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Zh(e,2,2,n),stringify:e=>tx(e,2,"0b")},WI={identify:Wu,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Zh(e,1,8,n),stringify:e=>tx(e,8,"0")},XI={identify:Wu,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Zh(e,0,10,n),stringify:mr},ZI={identify:Wu,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Zh(e,2,16,n),stringify:e=>tx(e,16,"0x")};class Eo extends Ni{constructor(t){super(t),this.tag=Eo.tag}add(t){let n;en(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Vn(t.key,null):n=new Vn(t,null),Xs(this.items,n.key)||this.items.push(n)}get(t,n){const i=Xs(this.items,t);return!n&&en(i)?Kt(i.key)?i.key.value:i.key:i}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const i=Xs(this.items,t);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new Vn(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,i){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(t,n,i){const{replacer:a}=i,l=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof a=="function"&&(o=a.call(n,o,o)),l.items.push(Qb(o,null,i));return l}}Eo.tag="tag:yaml.org,2002:set";const nx={collection:"map",identify:e=>e instanceof Set,nodeClass:Eo,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Eo.from(e,t,n),resolve(e,t){if(ec(e)){if(e.hasAllNullValues(!0))return Object.assign(new Eo,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function ix(e,t){const n=e[0],i=n==="-"||n==="+"?e.substring(1):e,a=o=>t?BigInt(o):Number(o),l=i.replace(/_/g,"").split(":").reduce((o,d)=>o*a(60)+a(d),a(0));return n==="-"?a(-1)*l:l}function H_(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return mr(e);let i="";t<0&&(i="-",t*=n(-1));const a=n(60),l=[t%a];return t<60?l.unshift(0):(t=(t-l[0])/a,l.unshift(t%a),t>=60&&(t=(t-l[0])/a,l.unshift(t))),i+l.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const K_={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>ix(e,n),stringify:H_},G_={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>ix(e,!1),stringify:H_},Jh={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(Jh.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,i,a,l,o,d]=t.map(Number),f=t[7]?Number((t[7]+"00").substr(1,3)):0;let h=Date.UTC(n,i-1,a,l||0,o||0,d||0,f);const g=t[8];if(g&&g!=="Z"){let m=ix(g,!1);Math.abs(m)<30&&(m*=60),h-=6e4*m}return new Date(h)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},gk=[nc,ic,Qh,Wh,F_,q_,QI,WI,XI,ZI,GI,VI,YI,Zb,ha,ex,Jb,nx,K_,G_,Jh],yk=new Map([["core",FI],["failsafe",[nc,ic,Qh]],["json",KI],["yaml11",gk],["yaml-1.1",gk]]),bk={binary:Zb,bool:Wb,float:R_,floatExp:O_,floatNaN:D_,floatTime:G_,int:z_,intHex:P_,intOct:I_,intTime:K_,map:nc,merge:ha,null:Wh,omap:ex,pairs:Jb,seq:ic,set:nx,timestamp:Jh},JI={"tag:yaml.org,2002:binary":Zb,"tag:yaml.org,2002:merge":ha,"tag:yaml.org,2002:omap":ex,"tag:yaml.org,2002:pairs":Jb,"tag:yaml.org,2002:set":nx,"tag:yaml.org,2002:timestamp":Jh};function Og(e,t,n){const i=yk.get(t);if(i&&!e)return n&&!i.includes(ha)?i.concat(ha):i.slice();let a=i;if(!a)if(Array.isArray(e))a=[];else{const l=Array.from(yk.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${l} or define customTags array`)}if(Array.isArray(e))for(const l of e)a=a.concat(l);else typeof e=="function"&&(a=e(a.slice()));return n&&(a=a.concat(ha)),a.reduce((l,o)=>{const d=typeof o=="string"?bk[o]:o;if(!d){const f=JSON.stringify(o),h=Object.keys(bk).map(g=>JSON.stringify(g)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${h}`)}return l.includes(d)||l.push(d),l},[])}const ez=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;let V_=class Y_{constructor({compat:t,customTags:n,merge:i,resolveKnownTags:a,schema:l,sortMapEntries:o,toStringDefaults:d}){this.compat=Array.isArray(t)?Og(t,"compat"):t?Og(null,t):null,this.name=typeof l=="string"&&l||"core",this.knownTags=a?JI:{},this.tags=Og(n,this.name,i),this.toStringOptions=d??null,Object.defineProperty(this,xs,{value:nc}),Object.defineProperty(this,Or,{value:Qh}),Object.defineProperty(this,Jo,{value:ic}),this.sortMapEntries=typeof o=="function"?o:o===!0?ez:null}clone(){const t=Object.create(Y_.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function tz(e,t){var f;const n=[];let i=t.directives===!0;if(t.directives!==!1&&e.directives){const h=e.directives.toString(e);h?(n.push(h),i=!0):e.directives.docStart&&(i=!0)}i&&n.push("---");const a=j_(e,t),{commentString:l}=a.options;if(e.commentBefore){n.length!==1&&n.unshift("");const h=l(e.commentBefore);n.unshift(da(h,""))}let o=!1,d=null;if(e.contents){if(cn(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){const m=l(e.contents.commentBefore);n.push(da(m,""))}a.forceBlockIndent=!!e.comment,d=e.contents.comment}const h=d?void 0:()=>o=!0;let g=Bo(e.contents,a,()=>d=null,h);d&&(g+=Ws(g,"",l(d))),(g[0]==="|"||g[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${g}`:n.push(g)}else n.push(Bo(e.contents,a));if((f=e.directives)!=null&&f.docEnd)if(e.comment){const h=l(e.comment);h.includes(`
527
+ `)?(n.push("..."),n.push(da(h,""))):n.push(`... ${h}`)}else n.push("...");else{let h=e.comment;h&&o&&(h=h.replace(/^\n+/,"")),h&&((!o||d)&&n[n.length-1]!==""&&n.push(""),n.push(da(l(h),"")))}return n.join(`
528
+ `)+`
529
+ `}class rc{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Vi,{value:qy});let a=null;typeof n=="function"||Array.isArray(n)?a=n:i===void 0&&n&&(i=n,n=void 0);const l=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=l;let{version:o}=l;i!=null&&i._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new ti({version:o}),this.setSchema(o,i),this.contents=t===void 0?null:this.createNode(t,a,i)}clone(){const t=Object.create(rc.prototype,{[Vi]:{value:qy}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=cn(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){so(this.contents)&&this.contents.add(t)}addIn(t,n){so(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const i=k_(this);t.anchor=!n||i.has(n)?E_(n||"a",i):n}return new Kh(t.anchor)}createNode(t,n,i){let a;if(typeof n=="function")t=n.call({"":t},"",t),a=n;else if(Array.isArray(n)){const N=C=>typeof C=="number"||C instanceof String||C instanceof Number,E=n.filter(N).map(String);E.length>0&&(n=n.concat(E)),a=n}else i===void 0&&n&&(i=n,n=void 0);const{aliasDuplicateObjects:l,anchorPrefix:o,flow:d,keepUndefined:f,onTagObj:h,tag:g}=i??{},{onAnchor:m,setAnchors:y,sourceObjects:b}=AI(this,o||"a"),k={aliasDuplicateObjects:l??!0,keepUndefined:f??!1,onAnchor:m,onTagObj:h,replacer:a,schema:this.schema,sourceObjects:b},v=Su(t,g,k);return d&&on(v)&&(v.flow=!0),y(),v}createPair(t,n,i={}){const a=this.createNode(t,null,i),l=this.createNode(n,null,i);return new Vn(a,l)}delete(t){return so(this.contents)?this.contents.delete(t):!1}deleteIn(t){return cu(t)?this.contents==null?!1:(this.contents=null,!0):so(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return on(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return cu(t)?!n&&Kt(this.contents)?this.contents.value:this.contents:on(this.contents)?this.contents.getIn(t,n):void 0}has(t){return on(this.contents)?this.contents.has(t):!1}hasIn(t){return cu(t)?this.contents!==void 0:on(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=mh(this.schema,[t],n):so(this.contents)&&this.contents.set(t,n)}setIn(t,n){cu(t)?this.contents=n:this.contents==null?this.contents=mh(this.schema,Array.from(t),n):so(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let i;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ti({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new ti({version:t}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{const a=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${a}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new V_(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:i,maxAliasCount:a,onAnchor:l,reviver:o}={}){const d={anchors:new Map,doc:this,keep:!t,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof a=="number"?a:100},f=Ki(this.contents,n??"",d);if(typeof l=="function")for(const{count:h,res:g}of d.anchors.values())l(g,h);return typeof o=="function"?bo(o,{"":f},"",f):f}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return tz(this,t)}}function so(e){if(on(e))return!0;throw new Error("Expected a YAML collection as document contents")}class rx extends Error{constructor(t,n,i,a){super(),this.name=t,this.code=i,this.message=a,this.pos=n}}class Zs extends rx{constructor(t,n,i){super("YAMLParseError",t,n,i)}}class Q_ extends rx{constructor(t,n,i){super("YAMLWarning",t,n,i)}}const yh=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(d=>t.linePos(d));const{line:i,col:a}=n.linePos[0];n.message+=` at line ${i}, column ${a}`;let l=a-1,o=e.substring(t.lineStarts[i-1],t.lineStarts[i]).replace(/[\n\r]+$/,"");if(l>=60&&o.length>80){const d=Math.min(l-39,o.length-79);o="…"+o.substring(d),l-=d-1}if(o.length>80&&(o=o.substring(0,79)+"…"),i>1&&/^ *$/.test(o.substring(0,l))){let d=e.substring(t.lineStarts[i-2],t.lineStarts[i-1]);d.length>80&&(d=d.substring(0,79)+`…
530
+ `),o=d+o}if(/[^ ]/.test(o)){let d=1;const f=n.linePos[1];(f==null?void 0:f.line)===i&&f.col>a&&(d=Math.max(1,Math.min(f.col-a,80-l)));const h=" ".repeat(l)+"^".repeat(d);n.message+=`:
531
+
532
+ ${o}
533
+ ${h}
534
+ `}};function $o(e,{flow:t,indicator:n,next:i,offset:a,onError:l,parentIndent:o,startOnNewline:d}){let f=!1,h=d,g=d,m="",y="",b=!1,k=!1,v=null,N=null,E=null,C=null,S=null,_=null,M=null;for(const O of e)switch(k&&(O.type!=="space"&&O.type!=="newline"&&O.type!=="comma"&&l(O.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),k=!1),v&&(h&&O.type!=="comment"&&O.type!=="newline"&&l(v,"TAB_AS_INDENT","Tabs are not allowed as indentation"),v=null),O.type){case"space":!t&&(n!=="doc-start"||(i==null?void 0:i.type)!=="flow-collection")&&O.source.includes(" ")&&(v=O),g=!0;break;case"comment":{g||l(O,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const $=O.source.substring(1)||" ";m?m+=y+$:m=$,y="",h=!1;break}case"newline":h?m?m+=O.source:(!_||n!=="seq-item-ind")&&(f=!0):y+=O.source,h=!0,b=!0,(N||E)&&(C=O),g=!0;break;case"anchor":N&&l(O,"MULTIPLE_ANCHORS","A node can have at most one anchor"),O.source.endsWith(":")&&l(O.offset+O.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),N=O,M??(M=O.offset),h=!1,g=!1,k=!0;break;case"tag":{E&&l(O,"MULTIPLE_TAGS","A node can have at most one tag"),E=O,M??(M=O.offset),h=!1,g=!1,k=!0;break}case n:(N||E)&&l(O,"BAD_PROP_ORDER",`Anchors and tags must be after the ${O.source} indicator`),_&&l(O,"UNEXPECTED_TOKEN",`Unexpected ${O.source} in ${t??"collection"}`),_=O,h=n==="seq-item-ind"||n==="explicit-key-ind",g=!1;break;case"comma":if(t){S&&l(O,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),S=O,h=!1,g=!1;break}default:l(O,"UNEXPECTED_TOKEN",`Unexpected ${O.type} token`),h=!1,g=!1}const T=e[e.length-1],R=T?T.offset+T.source.length:a;return k&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&l(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),v&&(h&&v.indent<=o||(i==null?void 0:i.type)==="block-map"||(i==null?void 0:i.type)==="block-seq")&&l(v,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:S,found:_,spaceBefore:f,comment:m,hasNewline:b,anchor:N,tag:E,newlineAfterProp:C,end:R,start:M??R}}function Nu(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
535
+ `))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(Nu(t.key)||Nu(t.value))return!0}return!1;default:return!0}}function Vy(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const i=t.end[0];i.indent===e&&(i.source==="]"||i.source==="}")&&Nu(t)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function W_(e,t,n){const{uniqueKeys:i}=e.options;if(i===!1)return!1;const a=typeof i=="function"?i:(l,o)=>l===o||Kt(l)&&Kt(o)&&l.value===o.value;return t.some(l=>a(l.key,n))}const xk="All mapping items must start at the same column";function nz({composeNode:e,composeEmptyNode:t},n,i,a,l){var g;const o=(l==null?void 0:l.nodeClass)??Ni,d=new o(n.schema);n.atRoot&&(n.atRoot=!1);let f=i.offset,h=null;for(const m of i.items){const{start:y,key:b,sep:k,value:v}=m,N=$o(y,{indicator:"explicit-key-ind",next:b??(k==null?void 0:k[0]),offset:f,onError:a,parentIndent:i.indent,startOnNewline:!0}),E=!N.found;if(E){if(b&&(b.type==="block-seq"?a(f,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in b&&b.indent!==i.indent&&a(f,"BAD_INDENT",xk)),!N.anchor&&!N.tag&&!k){h=N.end,N.comment&&(d.comment?d.comment+=`
536
+ `+N.comment:d.comment=N.comment);continue}(N.newlineAfterProp||Nu(b))&&a(b??y[y.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((g=N.found)==null?void 0:g.indent)!==i.indent&&a(f,"BAD_INDENT",xk);n.atKey=!0;const C=N.end,S=b?e(n,b,N,a):t(n,C,y,null,N,a);n.schema.compat&&Vy(i.indent,b,a),n.atKey=!1,W_(n,d.items,S)&&a(C,"DUPLICATE_KEY","Map keys must be unique");const _=$o(k??[],{indicator:"map-value-ind",next:v,offset:S.range[2],onError:a,parentIndent:i.indent,startOnNewline:!b||b.type==="block-scalar"});if(f=_.end,_.found){E&&((v==null?void 0:v.type)==="block-map"&&!_.hasNewline&&a(f,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&N.start<_.found.offset-1024&&a(S.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const M=v?e(n,v,_,a):t(n,f,k,null,_,a);n.schema.compat&&Vy(i.indent,v,a),f=M.range[2];const T=new Vn(S,M);n.options.keepSourceTokens&&(T.srcToken=m),d.items.push(T)}else{E&&a(S.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(S.comment?S.comment+=`
537
+ `+_.comment:S.comment=_.comment);const M=new Vn(S);n.options.keepSourceTokens&&(M.srcToken=m),d.items.push(M)}}return h&&h<f&&a(h,"IMPOSSIBLE","Map comment with trailing content"),d.range=[i.offset,f,h??f],d}function iz({composeNode:e,composeEmptyNode:t},n,i,a,l){const o=(l==null?void 0:l.nodeClass)??ws,d=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=i.offset,h=null;for(const{start:g,value:m}of i.items){const y=$o(g,{indicator:"seq-item-ind",next:m,offset:f,onError:a,parentIndent:i.indent,startOnNewline:!0});if(!y.found)if(y.anchor||y.tag||m)(m==null?void 0:m.type)==="block-seq"?a(y.end,"BAD_INDENT","All sequence items must start at the same column"):a(f,"MISSING_CHAR","Sequence item without - indicator");else{h=y.end,y.comment&&(d.comment=y.comment);continue}const b=m?e(n,m,y,a):t(n,y.end,g,null,y,a);n.schema.compat&&Vy(i.indent,m,a),f=b.range[2],d.items.push(b)}return d.range=[i.offset,f,h??f],d}function Xu(e,t,n,i){let a="";if(e){let l=!1,o="";for(const d of e){const{source:f,type:h}=d;switch(h){case"space":l=!0;break;case"comment":{n&&!l&&i(d,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const g=f.substring(1)||" ";a?a+=o+g:a=g,o="";break}case"newline":a&&(o+=f),l=!0;break;default:i(d,"UNEXPECTED_TOKEN",`Unexpected ${h} at node end`)}t+=f.length}}return{comment:a,offset:t}}const Rg="Block collections are not allowed within flow collections",Lg=e=>e&&(e.type==="block-map"||e.type==="block-seq");function rz({composeNode:e,composeEmptyNode:t},n,i,a,l){var N;const o=i.start.source==="{",d=o?"flow map":"flow sequence",f=(l==null?void 0:l.nodeClass)??(o?Ni:ws),h=new f(n.schema);h.flow=!0;const g=n.atRoot;g&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let m=i.offset+i.start.source.length;for(let E=0;E<i.items.length;++E){const C=i.items[E],{start:S,key:_,sep:M,value:T}=C,R=$o(S,{flow:d,indicator:"explicit-key-ind",next:_??(M==null?void 0:M[0]),offset:m,onError:a,parentIndent:i.indent,startOnNewline:!1});if(!R.found){if(!R.anchor&&!R.tag&&!M&&!T){E===0&&R.comma?a(R.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${d}`):E<i.items.length-1&&a(R.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${d}`),R.comment&&(h.comment?h.comment+=`
538
+ `+R.comment:h.comment=R.comment),m=R.end;continue}!o&&n.options.strict&&Nu(_)&&a(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(E===0)R.comma&&a(R.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${d}`);else if(R.comma||a(R.start,"MISSING_CHAR",`Missing , between ${d} items`),R.comment){let O="";e:for(const $ of S)switch($.type){case"comma":case"space":break;case"comment":O=$.source.substring(1);break e;default:break e}if(O){let $=h.items[h.items.length-1];en($)&&($=$.value??$.key),$.comment?$.comment+=`
539
+ `+O:$.comment=O,R.comment=R.comment.substring(O.length+1)}}if(!o&&!M&&!R.found){const O=T?e(n,T,R,a):t(n,R.end,M,null,R,a);h.items.push(O),m=O.range[2],Lg(T)&&a(O.range,"BLOCK_IN_FLOW",Rg)}else{n.atKey=!0;const O=R.end,$=_?e(n,_,R,a):t(n,O,S,null,R,a);Lg(_)&&a($.range,"BLOCK_IN_FLOW",Rg),n.atKey=!1;const I=$o(M??[],{flow:d,indicator:"map-value-ind",next:T,offset:$.range[2],onError:a,parentIndent:i.indent,startOnNewline:!1});if(I.found){if(!o&&!R.found&&n.options.strict){if(M)for(const Y of M){if(Y===I.found)break;if(Y.type==="newline"){a(Y,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}R.start<I.found.offset-1024&&a(I.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else T&&("source"in T&&((N=T.source)==null?void 0:N[0])===":"?a(T,"MISSING_CHAR",`Missing space after : in ${d}`):a(I.start,"MISSING_CHAR",`Missing , or : between ${d} items`));const q=T?e(n,T,I,a):I.found?t(n,I.end,M,null,I,a):null;q?Lg(T)&&a(q.range,"BLOCK_IN_FLOW",Rg):I.comment&&($.comment?$.comment+=`
540
+ `+I.comment:$.comment=I.comment);const F=new Vn($,q);if(n.options.keepSourceTokens&&(F.srcToken=C),o){const Y=h;W_(n,Y.items,$)&&a(O,"DUPLICATE_KEY","Map keys must be unique"),Y.items.push(F)}else{const Y=new Ni(n.schema);Y.flow=!0,Y.items.push(F);const D=(q??$).range;Y.range=[$.range[0],D[1],D[2]],h.items.push(Y)}m=q?q.range[2]:I.end}}const y=o?"}":"]",[b,...k]=i.end;let v=m;if((b==null?void 0:b.source)===y)v=b.offset+b.source.length;else{const E=d[0].toUpperCase()+d.substring(1),C=g?`${E} must end with a ${y}`:`${E} in block collection must be sufficiently indented and end with a ${y}`;a(m,g?"MISSING_CHAR":"BAD_INDENT",C),b&&b.source.length!==1&&k.unshift(b)}if(k.length>0){const E=Xu(k,v,n.options.strict,a);E.comment&&(h.comment?h.comment+=`
541
+ `+E.comment:h.comment=E.comment),h.range=[i.offset,v,E.offset]}else h.range=[i.offset,v,v];return h}function Ig(e,t,n,i,a,l){const o=n.type==="block-map"?nz(e,t,n,i,l):n.type==="block-seq"?iz(e,t,n,i,l):rz(e,t,n,i,l),d=o.constructor;return a==="!"||a===d.tagName?(o.tag=d.tagName,o):(a&&(o.tag=a),o)}function az(e,t,n,i,a){var y;const l=i.tag,o=l?t.directives.tagName(l.source,b=>a(l,"TAG_RESOLVE_FAILED",b)):null;if(n.type==="block-seq"){const{anchor:b,newlineAfterProp:k}=i,v=b&&l?b.offset>l.offset?b:l:b??l;v&&(!k||k.offset<v.offset)&&a(v,"MISSING_CHAR","Missing newline after block sequence props")}const d=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!l||!o||o==="!"||o===Ni.tagName&&d==="map"||o===ws.tagName&&d==="seq")return Ig(e,t,n,a,o);let f=t.schema.tags.find(b=>b.tag===o&&b.collection===d);if(!f){const b=t.schema.knownTags[o];if((b==null?void 0:b.collection)===d)t.schema.tags.push(Object.assign({},b,{default:!1})),f=b;else return b?a(l,"BAD_COLLECTION_TYPE",`${b.tag} used for ${d} collection, but expects ${b.collection??"scalar"}`,!0):a(l,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Ig(e,t,n,a,o)}const h=Ig(e,t,n,a,o,f),g=((y=f.resolve)==null?void 0:y.call(f,h,b=>a(l,"TAG_RESOLVE_FAILED",b),t.options))??h,m=cn(g)?g:new st(g);return m.range=h.range,m.tag=o,f!=null&&f.format&&(m.format=f.format),m}function X_(e,t,n){const i=t.offset,a=sz(t,e.options.strict,n);if(!a)return{value:"",type:null,comment:"",range:[i,i,i]};const l=a.mode===">"?st.BLOCK_FOLDED:st.BLOCK_LITERAL,o=t.source?lz(t.source):[];let d=o.length;for(let v=o.length-1;v>=0;--v){const N=o[v][1];if(N===""||N==="\r")d=v;else break}if(d===0){const v=a.chomp==="+"&&o.length>0?`
542
+ `.repeat(Math.max(1,o.length-1)):"";let N=i+a.length;return t.source&&(N+=t.source.length),{value:v,type:l,comment:a.comment,range:[i,N,N]}}let f=t.indent+a.indent,h=t.offset+a.length,g=0;for(let v=0;v<d;++v){const[N,E]=o[v];if(E===""||E==="\r")a.indent===0&&N.length>f&&(f=N.length);else{N.length<f&&n(h+N.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),a.indent===0&&(f=N.length),g=v,f===0&&!e.atRoot&&n(h,"BAD_INDENT","Block scalar values in collections must be indented");break}h+=N.length+E.length+1}for(let v=o.length-1;v>=d;--v)o[v][0].length>f&&(d=v+1);let m="",y="",b=!1;for(let v=0;v<g;++v)m+=o[v][0].slice(f)+`
543
+ `;for(let v=g;v<d;++v){let[N,E]=o[v];h+=N.length+E.length+1;const C=E[E.length-1]==="\r";if(C&&(E=E.slice(0,-1)),E&&N.length<f){const _=`Block scalar lines must not be less indented than their ${a.indent?"explicit indentation indicator":"first line"}`;n(h-E.length-(C?2:1),"BAD_INDENT",_),N=""}l===st.BLOCK_LITERAL?(m+=y+N.slice(f)+E,y=`
544
+ `):N.length>f||E[0]===" "?(y===" "?y=`
545
+ `:!b&&y===`
546
+ `&&(y=`
547
+
548
+ `),m+=y+N.slice(f)+E,y=`
549
+ `,b=!0):E===""?y===`
550
+ `?m+=`
551
+ `:y=`
552
+ `:(m+=y+E,y=" ",b=!1)}switch(a.chomp){case"-":break;case"+":for(let v=d;v<o.length;++v)m+=`
553
+ `+o[v][0].slice(f);m[m.length-1]!==`
554
+ `&&(m+=`
555
+ `);break;default:m+=`
556
+ `}const k=i+a.length+t.source.length;return{value:m,type:l,comment:a.comment,range:[i,k,k]}}function sz({offset:e,props:t},n,i){if(t[0].type!=="block-scalar-header")return i(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:a}=t[0],l=a[0];let o=0,d="",f=-1;for(let y=1;y<a.length;++y){const b=a[y];if(!d&&(b==="-"||b==="+"))d=b;else{const k=Number(b);!o&&k?o=k:f===-1&&(f=e+y)}}f!==-1&&i(f,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${a}`);let h=!1,g="",m=a.length;for(let y=1;y<t.length;++y){const b=t[y];switch(b.type){case"space":h=!0;case"newline":m+=b.source.length;break;case"comment":n&&!h&&i(b,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),m+=b.source.length,g=b.source.substring(1);break;case"error":i(b,"UNEXPECTED_TOKEN",b.message),m+=b.source.length;break;default:{const k=`Unexpected token in block scalar header: ${b.type}`;i(b,"UNEXPECTED_TOKEN",k);const v=b.source;v&&typeof v=="string"&&(m+=v.length)}}}return{mode:l,indent:o,chomp:d,comment:g,length:m}}function lz(e){const t=e.split(/\n( *)/),n=t[0],i=n.match(/^( *)/),l=[i!=null&&i[1]?[i[1],n.slice(i[1].length)]:["",n]];for(let o=1;o<t.length;o+=2)l.push([t[o],t[o+1]]);return l}function Z_(e,t,n){const{offset:i,type:a,source:l,end:o}=e;let d,f;const h=(y,b,k)=>n(i+y,b,k);switch(a){case"scalar":d=st.PLAIN,f=oz(l,h);break;case"single-quoted-scalar":d=st.QUOTE_SINGLE,f=cz(l,h);break;case"double-quoted-scalar":d=st.QUOTE_DOUBLE,f=uz(l,h);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${a}`),{value:"",type:null,comment:"",range:[i,i+l.length,i+l.length]}}const g=i+l.length,m=Xu(o,g,t,n);return{value:f,type:d,comment:m.comment,range:[i,g,m.offset]}}function oz(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),J_(e)}function cz(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),J_(e.slice(1,-1)).replace(/''/g,"'")}function J_(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
557
+ `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
558
+ `,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=t.exec(e);if(!i)return e;let a=i[1],l=" ",o=t.lastIndex;for(n.lastIndex=o;i=n.exec(e);)i[1]===""?l===`
559
+ `?a+=l:l=`
560
+ `:(a+=l+i[1],l=" "),o=n.lastIndex;const d=/[ \t]*(.*)/sy;return d.lastIndex=o,i=d.exec(e),a+l+((i==null?void 0:i[1])??"")}function uz(e,t){let n="";for(let i=1;i<e.length-1;++i){const a=e[i];if(!(a==="\r"&&e[i+1]===`
561
+ `))if(a===`
562
+ `){const{fold:l,offset:o}=dz(e,i);n+=l,i=o}else if(a==="\\"){let l=e[++i];const o=fz[l];if(o)n+=o;else if(l===`
563
+ `)for(l=e[i+1];l===" "||l===" ";)l=e[++i+1];else if(l==="\r"&&e[i+1]===`
564
+ `)for(l=e[++i+1];l===" "||l===" ";)l=e[++i+1];else if(l==="x"||l==="u"||l==="U"){const d={x:2,u:4,U:8}[l];n+=hz(e,i+1,d,t),i+=d}else{const d=e.substr(i-1,2);t(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${d}`),n+=d}}else if(a===" "||a===" "){const l=i;let o=e[i+1];for(;o===" "||o===" ";)o=e[++i+1];o!==`
565
+ `&&!(o==="\r"&&e[i+2]===`
566
+ `)&&(n+=i>l?e.slice(l,i+1):a)}else n+=a}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function dz(e,t){let n="",i=e[t+1];for(;(i===" "||i===" "||i===`
567
+ `||i==="\r")&&!(i==="\r"&&e[t+2]!==`
568
+ `);)i===`
569
+ `&&(n+=`
570
+ `),t+=1,i=e[t+1];return n||(n=" "),{fold:n,offset:t}}const fz={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
571
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function hz(e,t,n,i){const a=e.substr(t,n),o=a.length===n&&/^[0-9a-fA-F]+$/.test(a)?parseInt(a,16):NaN;if(isNaN(o)){const d=e.substr(t-2,n+2);return i(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${d}`),d}return String.fromCodePoint(o)}function e2(e,t,n,i){const{value:a,type:l,comment:o,range:d}=t.type==="block-scalar"?X_(e,t,i):Z_(t,e.options.strict,i),f=n?e.directives.tagName(n.source,m=>i(n,"TAG_RESOLVE_FAILED",m)):null;let h;e.options.stringKeys&&e.atKey?h=e.schema[Or]:f?h=pz(e.schema,a,f,n,i):t.type==="scalar"?h=mz(e,a,t,i):h=e.schema[Or];let g;try{const m=h.resolve(a,y=>i(n??t,"TAG_RESOLVE_FAILED",y),e.options);g=Kt(m)?m:new st(m)}catch(m){const y=m instanceof Error?m.message:String(m);i(n??t,"TAG_RESOLVE_FAILED",y),g=new st(a)}return g.range=d,g.source=a,l&&(g.type=l),f&&(g.tag=f),h.format&&(g.format=h.format),o&&(g.comment=o),g}function pz(e,t,n,i,a){var d;if(n==="!")return e[Or];const l=[];for(const f of e.tags)if(!f.collection&&f.tag===n)if(f.default&&f.test)l.push(f);else return f;for(const f of l)if((d=f.test)!=null&&d.test(t))return f;const o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(a(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Or])}function mz({atKey:e,directives:t,schema:n},i,a,l){const o=n.tags.find(d=>{var f;return(d.default===!0||e&&d.default==="key")&&((f=d.test)==null?void 0:f.test(i))})||n[Or];if(n.compat){const d=n.compat.find(f=>{var h;return f.default&&((h=f.test)==null?void 0:h.test(i))})??n[Or];if(o.tag!==d.tag){const f=t.tagString(o.tag),h=t.tagString(d.tag),g=`Value may be parsed as either ${f} or ${h}`;l(a,"TAG_RESOLVE_FAILED",g,!0)}}return o}function gz(e,t,n){if(t){n??(n=t.length);for(let i=n-1;i>=0;--i){let a=t[i];switch(a.type){case"space":case"comment":case"newline":e-=a.source.length;continue}for(a=t[++i];(a==null?void 0:a.type)==="space";)e+=a.source.length,a=t[++i];break}}return e}const yz={composeNode:t2,composeEmptyNode:ax};function t2(e,t,n,i){const a=e.atKey,{spaceBefore:l,comment:o,anchor:d,tag:f}=n;let h,g=!0;switch(t.type){case"alias":h=bz(e,t,i),(d||f)&&i(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":h=e2(e,t,f,i),d&&(h.anchor=d.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{h=az(yz,e,t,n,i),d&&(h.anchor=d.source.substring(1))}catch(m){const y=m instanceof Error?m.message:String(m);i(t,"RESOURCE_EXHAUSTION",y)}break;default:{const m=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;i(t,"UNEXPECTED_TOKEN",m),g=!1}}return h??(h=ax(e,t.offset,void 0,null,n,i)),d&&h.anchor===""&&i(d,"BAD_ALIAS","Anchor cannot be an empty string"),a&&e.options.stringKeys&&(!Kt(h)||typeof h.value!="string"||h.tag&&h.tag!=="tag:yaml.org,2002:str")&&i(f??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),l&&(h.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?h.comment=o:h.commentBefore=o),e.options.keepSourceTokens&&g&&(h.srcToken=t),h}function ax(e,t,n,i,{spaceBefore:a,comment:l,anchor:o,tag:d,end:f},h){const g={type:"scalar",offset:gz(t,n,i),indent:-1,source:""},m=e2(e,g,d,h);return o&&(m.anchor=o.source.substring(1),m.anchor===""&&h(o,"BAD_ALIAS","Anchor cannot be an empty string")),a&&(m.spaceBefore=!0),l&&(m.comment=l,m.range[2]=f),m}function bz({options:e},{offset:t,source:n,end:i},a){const l=new Kh(n.substring(1));l.source===""&&a(t,"BAD_ALIAS","Alias cannot be an empty string"),l.source.endsWith(":")&&a(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,d=Xu(i,o,e.strict,a);return l.range=[t,o,d.offset],d.comment&&(l.comment=d.comment),l}function xz(e,t,{offset:n,start:i,value:a,end:l},o){const d=Object.assign({_directives:t},e),f=new rc(void 0,d),h={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},g=$o(i,{indicator:"doc-start",next:a??(l==null?void 0:l[0]),offset:n,onError:o,parentIndent:0,startOnNewline:!0});g.found&&(f.directives.docStart=!0,a&&(a.type==="block-map"||a.type==="block-seq")&&!g.hasNewline&&o(g.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),f.contents=a?t2(h,a,g,o):ax(h,g.end,i,null,g,o);const m=f.contents.range[2],y=Xu(l,m,!1,o);return y.comment&&(f.comment=y.comment),f.range=[n,m,y.offset],f}function eu(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function vk(e){var a;let t="",n=!1,i=!1;for(let l=0;l<e.length;++l){const o=e[l];switch(o[0]){case"#":t+=(t===""?"":i?`
572
+
573
+ `:`
574
+ `)+(o.substring(1)||" "),n=!0,i=!1;break;case"%":((a=e[l+1])==null?void 0:a[0])!=="#"&&(l+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:t,afterEmptyLine:i}}class sx{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,a,l)=>{const o=eu(n);l?this.warnings.push(new Q_(o,i,a)):this.errors.push(new Zs(o,i,a))},this.directives=new ti({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:i,afterEmptyLine:a}=vk(this.prelude);if(i){const l=t.contents;if(n)t.comment=t.comment?`${t.comment}
575
+ ${i}`:i;else if(a||t.directives.docStart||!l)t.commentBefore=i;else if(on(l)&&!l.flow&&l.items.length>0){let o=l.items[0];en(o)&&(o=o.key);const d=o.commentBefore;o.commentBefore=d?`${i}
576
+ ${d}`:i}else{const o=l.commentBefore;l.commentBefore=o?`${i}
577
+ ${o}`:i}}n?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:vk(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,i=-1){for(const a of t)yield*this.next(a);yield*this.end(n,i)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,i,a)=>{const l=eu(t);l[0]+=n,this.onError(l,"BAD_DIRECTIVE",i,a)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=xz(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,i=new Zs(eu(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){const i="Unexpected doc-end without preceding document";this.errors.push(new Zs(eu(t),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;const n=Xu(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const i=this.doc.comment;this.doc.comment=i?`${i}
578
+ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Zs(eu(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const i=Object.assign({_directives:this.directives},this.options),a=new rc(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),a.range=[0,n,n],this.decorate(a,!1),yield a}}}function vz(e,t=!0,n){if(e){const i=(a,l,o)=>{const d=typeof a=="number"?a:Array.isArray(a)?a[0]:a.offset;if(n)n(d,l,o);else throw new Zs([d,d+1],l,o)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Z_(e,t,i);case"block-scalar":return X_({options:{strict:t}},e,i)}}return null}function wz(e,t){const{implicitKey:n=!1,indent:i,inFlow:a=!1,offset:l=-1,type:o="PLAIN"}=t,d=Qu({type:o,value:e},{implicitKey:n,indent:i>0?" ".repeat(i):"",inFlow:a,options:{blockQuote:!0,lineWidth:-1}}),f=t.end??[{type:"newline",offset:-1,indent:i,source:`
579
+ `}];switch(d[0]){case"|":case">":{const h=d.indexOf(`
580
+ `),g=d.substring(0,h),m=d.substring(h+1)+`
581
+ `,y=[{type:"block-scalar-header",offset:l,indent:i,source:g}];return n2(y,f)||y.push({type:"newline",offset:-1,indent:i,source:`
582
+ `}),{type:"block-scalar",offset:l,indent:i,props:y,source:m}}case'"':return{type:"double-quoted-scalar",offset:l,indent:i,source:d,end:f};case"'":return{type:"single-quoted-scalar",offset:l,indent:i,source:d,end:f};default:return{type:"scalar",offset:l,indent:i,source:d,end:f}}}function kz(e,t,n={}){let{afterKey:i=!1,implicitKey:a=!1,inFlow:l=!1,type:o}=n,d="indent"in e?e.indent:null;if(i&&typeof d=="number"&&(d+=2),!o)switch(e.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{const h=e.props[0];if(h.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=h.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}const f=Qu({type:o,value:t},{implicitKey:a||d===null,indent:d!==null&&d>0?" ".repeat(d):"",inFlow:l,options:{blockQuote:!0,lineWidth:-1}});switch(f[0]){case"|":case">":Ez(e,f);break;case'"':zg(e,f,"double-quoted-scalar");break;case"'":zg(e,f,"single-quoted-scalar");break;default:zg(e,f,"scalar")}}function Ez(e,t){const n=t.indexOf(`
583
+ `),i=t.substring(0,n),a=t.substring(n+1)+`
584
+ `;if(e.type==="block-scalar"){const l=e.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");l.source=i,e.source=a}else{const{offset:l}=e,o="indent"in e?e.indent:-1,d=[{type:"block-scalar-header",offset:l,indent:o,source:i}];n2(d,"end"in e?e.end:void 0)||d.push({type:"newline",offset:-1,indent:o,source:`
585
+ `});for(const f of Object.keys(e))f!=="type"&&f!=="offset"&&delete e[f];Object.assign(e,{type:"block-scalar",indent:o,props:d,source:a})}}function n2(e,t){if(t)for(const n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function zg(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{const i=e.props.slice(1);let a=t.length;e.props[0].type==="block-scalar-header"&&(a-=e.props[0].source.length);for(const l of i)l.offset+=a;delete e.props,Object.assign(e,{type:n,source:t,end:i});break}case"block-map":case"block-seq":{const a={type:"newline",offset:e.offset+t.length,indent:e.indent,source:`
586
+ `};delete e.items,Object.assign(e,{type:n,source:t,end:[a]});break}default:{const i="indent"in e?e.indent:-1,a="end"in e&&Array.isArray(e.end)?e.end.filter(l=>l.type==="space"||l.type==="comment"||l.type==="newline"):[];for(const l of Object.keys(e))l!=="type"&&l!=="offset"&&delete e[l];Object.assign(e,{type:n,indent:i,source:t,end:a})}}}const Sz=e=>"type"in e?bh(e):th(e);function bh(e){switch(e.type){case"block-scalar":{let t="";for(const n of e.props)t+=bh(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(const n of e.items)t+=th(n);return t}case"flow-collection":{let t=e.start.source;for(const n of e.items)t+=th(n);for(const n of e.end)t+=n.source;return t}case"document":{let t=th(e);if(e.end)for(const n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(const n of e.end)t+=n.source;return t}}}function th({start:e,key:t,sep:n,value:i}){let a="";for(const l of e)a+=l.source;if(t&&(a+=bh(t)),n)for(const l of n)a+=l.source;return i&&(a+=bh(i)),a}const Yy=Symbol("break visit"),Nz=Symbol("skip children"),i2=Symbol("remove item");function pl(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),r2(Object.freeze([]),e,t)}pl.BREAK=Yy;pl.SKIP=Nz;pl.REMOVE=i2;pl.itemAtPath=(e,t)=>{let n=e;for(const[i,a]of t){const l=n==null?void 0:n[i];if(l&&"items"in l)n=l.items[a];else return}return n};pl.parentCollection=(e,t)=>{const n=pl.itemAtPath(e,t.slice(0,-1)),i=t[t.length-1][0],a=n==null?void 0:n[i];if(a&&"items"in a)return a;throw new Error("Parent collection not found")};function r2(e,t,n){let i=n(t,e);if(typeof i=="symbol")return i;for(const a of["key","value"]){const l=t[a];if(l&&"items"in l){for(let o=0;o<l.items.length;++o){const d=r2(Object.freeze(e.concat([[a,o]])),l.items[o],n);if(typeof d=="number")o=d-1;else{if(d===Yy)return Yy;d===i2&&(l.items.splice(o,1),o-=1)}}typeof i=="function"&&a==="key"&&(i=i(t,e))}}return typeof i=="function"?i(t,e):i}const ep="\uFEFF",tp="",np="",_u="",_z=e=>!!e&&"items"in e,jz=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function Cz(e){switch(e){case ep:return"<BOM>";case tp:return"<DOC>";case np:return"<FLOW_END>";case _u:return"<SCALAR>";default:return JSON.stringify(e)}}function a2(e){switch(e){case ep:return"byte-order-mark";case tp:return"doc-mode";case np:return"flow-error-end";case _u:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
587
+ `:case`\r
588
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}const Az=Object.freeze(Object.defineProperty({__proto__:null,BOM:ep,DOCUMENT:tp,FLOW_END:np,SCALAR:_u,createScalarToken:wz,isCollection:_z,isScalar:jz,prettyToken:Cz,resolveAsScalar:vz,setScalarValue:kz,stringify:Sz,tokenType:a2,visit:pl},Symbol.toStringTag,{value:"Module"}));function rr(e){switch(e){case void 0:case" ":case`
589
+ `:case"\r":case" ":return!0;default:return!1}}const wk=new Set("0123456789ABCDEFabcdef"),Tz=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),_f=new Set(",[]{}"),Mz=new Set(` ,[]{}
590
+ \r `),Pg=e=>!e||Mz.has(e);class s2{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
591
+ `?!0:n==="\r"?this.buffer[t+1]===`
592
+ `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let i=0;for(;n===" ";)n=this.buffer[++i+t];if(n==="\r"){const a=this.buffer[i+t+1];if(a===`
593
+ `||!a&&!this.atEnd)return t+i+1}return n===`
594
+ `||i>=this.indentNext||!n&&!this.atEnd?t+i:-1}if(n==="-"||n==="."){const i=this.buffer.substr(t,3);if((i==="---"||i==="...")&&rr(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
595
+ `,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===ep&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,i=t.indexOf("#");for(;i!==-1;){const l=t[i-1];if(l===" "||l===" "){n=i-1;break}else i=t.indexOf("#",i+1)}for(;;){const l=t[n-1];if(l===" "||l===" ")n-=1;else break}const a=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-a),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield tp,yield*this.parseLineStart()}*parseLineStart(){const t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const n=this.peek(3);if((n==="---"||n==="...")&&rr(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!rr(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&rr(n)){const i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Pg),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,i=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const a=this.getLine();if(a===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&a[0]!=="#"||i===0&&(a.startsWith("---")||a.startsWith("..."))&&rr(a[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(a[0]==="]"||a[0]==="}")))return this.flowLevel=0,yield np,yield*this.parseLineStart();let l=0;for(;a[l]===",";)l+=yield*this.pushCount(1),l+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(l+=yield*this.pushIndicators(),a[l]){case void 0:return"flow";case"#":return yield*this.pushCount(a.length-l),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Pg),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||rr(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let l=0;for(;this.buffer[n-1-l]==="\\";)l+=1;if(l%2===0)break;n=this.buffer.indexOf('"',n+1)}const i=this.buffer.substring(0,n);let a=i.indexOf(`
596
+ `,this.pos);if(a!==-1){for(;a!==-1;){const l=this.continueScalar(a+1);if(l===-1)break;a=i.indexOf(`
597
+ `,l)}a!==-1&&(n=a-(i[a-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>rr(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,i;e:for(let l=this.pos;i=this.buffer[l];++l)switch(i){case" ":n+=1;break;case`
598
+ `:t=l,n=0;break;case"\r":{const o=this.buffer[l+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
599
+ `)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const l=this.continueScalar(t+1);if(l===-1)break;t=this.buffer.indexOf(`
600
+ `,l)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let a=t+1;for(i=this.buffer[a];i===" ";)i=this.buffer[++a];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===`
601
+ `;)i=this.buffer[++a];t=a-1}else if(!this.blockScalarKeep)do{let l=t-1,o=this.buffer[l];o==="\r"&&(o=this.buffer[--l]);const d=l;for(;o===" ";)o=this.buffer[--l];if(o===`
602
+ `&&l>=this.pos&&l+1+n>d)t=l;else break}while(!0);return yield _u,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,i=this.pos-1,a;for(;a=this.buffer[++i];)if(a===":"){const l=this.buffer[i+1];if(rr(l)||t&&_f.has(l))break;n=i}else if(rr(a)){let l=this.buffer[i+1];if(a==="\r"&&(l===`
603
+ `?(i+=1,a=`
604
+ `,l=this.buffer[i+1]):n=i),l==="#"||t&&_f.has(l))break;if(a===`
605
+ `){const o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(t&&_f.has(a))break;n=i}return!a&&!this.atEnd?this.setNext("plain-scalar"):(yield _u,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const i=this.buffer.slice(this.pos,t);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Pg))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(rr(n)||t&&_f.has(n))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!rr(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(Tz.has(n))n=this.buffer[++t];else if(n==="%"&&wk.has(this.buffer[t+1])&&wk.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
606
+ `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
607
+ `?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,i;do i=this.buffer[++n];while(i===" "||t&&i===" ");const a=n-this.pos;return a>0&&(yield this.buffer.substr(this.pos,a),this.pos=n),a}*pushUntil(t){let n=this.pos,i=this.buffer[n];for(;!t(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class l2{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,i=this.lineStarts.length;for(;n<i;){const l=n+i>>1;this.lineStarts[l]<t?n=l+1:i=l}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};const a=this.lineStarts[n-1];return{line:n,col:t-a+1}}}}function ls(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function kk(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function o2(e){switch(e==null?void 0:e.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function jf(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function lo(e){var n;if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function Ek(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!ls(t.start,"explicit-key-ind")&&!ls(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,o2(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}class lx{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new s2,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const i of this.lexer.lex(t,n))yield*this.next(i);n||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const n=a2(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const i=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(t==null?void 0:t.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&Ek(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{const a=i.items[i.items.length-1];if(a.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(a.sep)a.value=n;else{Object.assign(a,{key:n,sep:[]}),this.onKeyLine=!a.explicitKey;return}break}case"block-seq":{const a=i.items[i.items.length-1];a.value?i.items.push({start:[],value:n}):a.value=n;break}case"flow-collection":{const a=i.items[i.items.length-1];!a||a.value?i.items.push({start:[],key:n,sep:[]}):a.sep?a.value=n:Object.assign(a,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const a=n.items[n.items.length-1];a&&!a.sep&&!a.value&&a.start.length>0&&kk(a.start)===-1&&(n.indent===0||a.start.every(l=>l.type!=="comment"||l.indent<n.indent))&&(i.type==="document"?i.end=a.start:i.items.push({start:a.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{kk(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}const n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){const n=jf(this.peek(2)),i=lo(n);let a;t.end?(a=t.end,a.push(this.sourceToken),delete t.end):a=[this.sourceToken];const l={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:i,key:t,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
608
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
609
+ `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){var i;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const a="end"in n.value?n.value.end:void 0,l=Array.isArray(a)?a[a.length-1]:void 0;(l==null?void 0:l.type)==="comment"?a==null||a.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const a=t.items[t.items.length-2],l=(i=a==null?void 0:a.value)==null?void 0:i.end;if(Array.isArray(l)){Array.prototype.push.apply(l,n.start),l.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const a=!this.onKeyLine&&this.indent===t.indent,l=a&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let o=[];if(l&&n.sep&&!n.value){const d=[];for(let f=0;f<n.sep.length;++f){const h=n.sep[f];switch(h.type){case"newline":d.push(f);break;case"space":break;case"comment":h.indent>t.indent&&(d.length=0);break;default:d.length=0}}d.length>=2&&(o=n.sep.splice(d[1]))}switch(this.type){case"anchor":case"tag":l||n.value?(o.push(this.sourceToken),t.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):l||n.value?(o.push(this.sourceToken),t.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ls(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(o2(n.key)&&!ls(n.sep,"newline")){const d=lo(n.start),f=n.key,h=n.sep;h.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:f,sep:h}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(ls(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const d=lo(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||l?t.items.push({start:o,key:null,sep:[this.sourceToken]}):ls(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const d=this.flowScalar(this.type);l||n.value?(t.items.push({start:o,key:d,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(d):(Object.assign(n,{key:d,sep:[]}),this.onKeyLine=!0);return}default:{const d=this.startBlockValue(t);if(d){if(d.type==="block-seq"){if(!n.explicitKey&&n.sep&&!ls(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else a&&t.items.push({start:o});this.stack.push(d);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var i;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const a="end"in n.value?n.value.end:void 0,l=Array.isArray(a)?a[a.length-1]:void 0;(l==null?void 0:l.type)==="comment"?a==null||a.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const a=t.items[t.items.length-2],l=(i=a==null?void 0:a.value)==null?void 0:i.end;if(Array.isArray(l)){Array.prototype.push.apply(l,n.start),l.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||ls(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const a=this.startBlockValue(t);if(a){this.stack.push(a);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while((i==null?void 0:i.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const a=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:a,sep:[]}):n.sep?this.stack.push(a):Object.assign(n,{key:a,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const i=this.startBlockValue(t);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{const i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===t.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){const a=jf(i),l=lo(a);Ek(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const d={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:l,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=d}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
610
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
611
+ `,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=jf(t),i=lo(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=jf(t),i=lo(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function c2(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new l2||null,prettyErrors:t}}function Dz(e,t={}){const{lineCounter:n,prettyErrors:i}=c2(t),a=new lx(n==null?void 0:n.addNewLine),l=new sx(t),o=Array.from(l.compose(a.parse(e)));if(i&&n)for(const d of o)d.errors.forEach(yh(e,n)),d.warnings.forEach(yh(e,n));return o.length>0?o:Object.assign([],{empty:!0},l.streamInfo())}function u2(e,t={}){const{lineCounter:n,prettyErrors:i}=c2(t),a=new lx(n==null?void 0:n.addNewLine),l=new sx(t);let o=null;for(const d of l.compose(a.parse(e),!0,e.length))if(!o)o=d;else if(o.options.logLevel!=="silent"){o.errors.push(new Zs(d.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(o.errors.forEach(yh(e,n)),o.warnings.forEach(yh(e,n))),o}function Oz(e,t,n){let i;typeof t=="function"?i=t:n===void 0&&t&&typeof t=="object"&&(n=t);const a=u2(e,n);if(!a)return null;if(a.warnings.forEach(l=>C_(a.options.logLevel,l)),a.errors.length>0){if(a.options.logLevel!=="silent")throw a.errors[0];a.errors=[]}return a.toJS(Object.assign({reviver:i},n))}function Rz(e,t,n){let i=null;if(typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){const a=Math.round(n);n=a<1?void 0:a>8?{indent:8}:{indent:a}}if(e===void 0){const{keepUndefined:a}=n??t??{};if(!a)return}return wl(e)&&!i?e.toString(n):new rc(e,i,n).toString(n)}const Sk=Object.freeze(Object.defineProperty({__proto__:null,Alias:Kh,CST:Az,Composer:sx,Document:rc,Lexer:s2,LineCounter:l2,Pair:Vn,Parser:lx,Scalar:st,Schema:V_,YAMLError:rx,YAMLMap:Ni,YAMLParseError:Zs,YAMLSeq:ws,YAMLWarning:Q_,isAlias:Ss,isCollection:on,isDocument:wl,isMap:ec,isNode:cn,isPair:en,isScalar:Kt,isSeq:tc,parse:Oz,parseAllDocuments:Dz,parseDocument:u2,stringify:Rz,visit:kl,visitAsync:Hh},Symbol.toStringTag,{value:"Module"}));function Lz({projectName:e,file:t,onClose:n,onSaved:i}){const a=Be(),l=Gt(),{alert:o}=un(),{data:d,isLoading:f,isError:h,error:g,refetch:m}=Ye({queryKey:["pipeline-file",e,t],queryFn:()=>aI(e,t)}),[y,b]=j.useState("structured"),[k,v]=j.useState(null),[N,E]=j.useState(null);j.useEffect(()=>{d&&k===null&&(v(d.content),E(d.etag),d.parseError&&b("yaml"))},[d,k]),j.useEffect(()=>{const R=O=>{O.key==="Escape"&&n()};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[n]);const C=Ct({mutationFn:()=>{if(k===null||N===null)throw new Error("no draft");return sI(e,t,k,N)},onSuccess:R=>{E(R.etag),l.invalidateQueries({queryKey:["pipeline-file",e,t]}),l.invalidateQueries({queryKey:["project-pipelines",e]}),i()},onError:R=>{const O=R.status;o({title:a(O===409?"pipelineEditor.error.conflict.title":O===422?"pipelineEditor.error.yaml.title":"pipelineEditor.error.save.title"),body:R instanceof Error?R.message:String(R)})}}),S=k!==null&&d&&k!==d.content,{parsed:_,parseError:M}=j.useMemo(()=>{if(k===null)return{parsed:null,parseError:null};try{return{parsed:Sk.parse(k)??{},parseError:null}}catch(R){return{parsed:null,parseError:R instanceof Error?R.message:String(R)}}},[k]),T=R=>{try{const O=Sk.stringify(R,{lineWidth:0});v(O)}catch(O){o({title:a("pipelineEditor.error.serialize.title"),body:O instanceof Error?O.message:String(O)})}};return c.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",children:c.jsxs("div",{className:"nb-card mt-8 w-full max-w-4xl flex flex-col",style:{maxHeight:"calc(100vh - 64px)"},children:[c.jsxs("header",{className:"flex items-start justify-between gap-3 mb-3 flex-shrink-0",children:[c.jsxs("div",{children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold flex items-center gap-2",children:[c.jsx(uk,{size:20,strokeWidth:2.5}),c.jsx("code",{className:"font-[family-name:var(--font-mono)] text-lg",children:t}),(d==null?void 0:d.isActive)&&c.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)",padding:"2px 8px"},children:a("pipelineEditor.activeBadge")})]}),c.jsxs("p",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] mt-1",children:[e,"/pipelines/",t,N&&` · etag ${N}`]})]}),c.jsx("button",{className:"nb-btn nb-btn-mint p-2",onClick:n,type:"button","aria-label":a("pipelineEditor.close"),children:c.jsx(bn,{size:14,strokeWidth:3})})]}),f&&c.jsx("p",{className:"text-[var(--color-text-muted)]",children:a("common.loading")}),h&&c.jsx("p",{className:"text-[var(--color-crashed)]",children:a("pipelineEditor.error.load",{detail:g instanceof Error?g.message:String(g)})}),d&&k!==null&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center gap-3 mb-3 flex-shrink-0 flex-wrap",children:[c.jsxs("div",{className:"flex gap-1 p-1 bg-[var(--color-bg)] border-[2px] border-[var(--color-text)] rounded-full shadow-[2px_2px_0_var(--color-text)]",children:[c.jsxs("button",{type:"button",onClick:()=>b("structured"),"aria-pressed":y==="structured",disabled:!!M,className:["px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1.5",y==="structured"?"bg-[var(--color-primary)] text-[var(--color-text)] shadow-[1px_1px_0_var(--color-text)]":"text-[var(--color-text-muted)]",M?"opacity-50 cursor-not-allowed":""].join(" "),title:M??void 0,children:[c.jsx(Fh,{size:11,strokeWidth:2.5}),a("pipelineEditor.mode.structured")]}),c.jsxs("button",{type:"button",onClick:()=>b("yaml"),"aria-pressed":y==="yaml",className:["px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1.5",y==="yaml"?"bg-[var(--color-primary)] text-[var(--color-text)] shadow-[1px_1px_0_var(--color-text)]":"text-[var(--color-text-muted)]"].join(" "),children:[c.jsx(uk,{size:11,strokeWidth:2.5}),a("pipelineEditor.mode.yaml")]})]}),M&&c.jsxs("div",{className:"flex items-center gap-1 text-xs text-[var(--color-crashed)] font-bold",children:[c.jsx(ku,{size:12,strokeWidth:2.5}),a("pipelineEditor.parseError.prefix",{detail:M})]}),(d==null?void 0:d.isActive)&&c.jsx("span",{className:"text-xs text-[var(--color-stuck)] font-bold ml-auto",children:a("pipelineEditor.activeWarning")})]}),c.jsxs("div",{className:"flex-1 overflow-auto",children:[y==="structured"&&_&&c.jsx(Iz,{parsed:_,onChange:T}),y==="yaml"&&c.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",style:{minHeight:400,resize:"vertical"},value:k,onChange:R=>v(R.target.value),spellCheck:!1,"aria-label":a("pipelineEditor.yamlAria")})]}),c.jsxs("div",{className:"flex items-center justify-between mt-3 pt-3 border-t-2 border-dashed border-[var(--color-text)] flex-shrink-0",children:[c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:S?c.jsx("span",{className:"text-[var(--color-stuck)] font-bold",children:a("pipelineEditor.status.unsaved")}):C.isSuccess?c.jsxs("span",{className:"text-[var(--color-running)] font-bold flex items-center gap-1",children:[c.jsx(Eu,{size:12,strokeWidth:2.5})," ",a("pipelineEditor.status.saved")]}):a("pipelineEditor.status.noChanges")}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{className:"nb-btn",style:{padding:"6px 14px"},onClick:()=>{v(null),m()},disabled:C.isPending,type:"button",children:a("pipelineEditor.reload")}),c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 14px"},onClick:()=>C.mutate(),disabled:!S||C.isPending,type:"button","aria-label":a("pipelineEditor.saveAria"),children:[C.isPending?c.jsx(Xe,{size:13,strokeWidth:3,className:"animate-spin"}):c.jsx(Rr,{size:13,strokeWidth:3}),a("pipelineEditor.save")]})]})]})]})]})})}function Iz({parsed:e,onChange:t}){const n=Be(),i=e.stages??[],a=h=>{t({...e,stages:h})},l=()=>{a([...i,{name:`stage-${i.length+1}`,on_complete:"move_card Done"}])},o=h=>{a(i.filter((g,m)=>m!==h))},d=(h,g)=>{const m=[...i],y=h+g;y<0||y>=m.length||([m[h],m[y]]=[m[y],m[h]],a(m))},f=(h,g)=>{a(i.map((m,y)=>y===h?{...m,...g}:m))};return c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{className:"flex bg-surface-input items-center gap-3 p-3 border-2 border-[var(--color-text)] rounded-lg",children:[c.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[c.jsx("span",{className:"font-bold",children:"mode:"}),c.jsxs("select",{className:"nb-input",style:{padding:"4px 10px",fontSize:12},value:e.mode??"project",onChange:h=>t({...e,mode:h.target.value}),children:[c.jsx("option",{value:"project",children:"project"}),c.jsx("option",{value:"steps",children:"steps"})]})]}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:n("pipelineEditor.modeHint")})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider",children:n("pipelineEditor.stages.heading",{count:i.length})}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",style:{padding:"4px 12px",fontSize:12},onClick:l,"aria-label":n("pipelineEditor.stages.add"),children:[c.jsx(pi,{size:11,strokeWidth:3})," ",n("pipelineEditor.stages.add")]})]}),i.length===0?c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] italic p-4 border-2 border-dashed border-[var(--color-text)] rounded-lg text-center",children:n("pipelineEditor.stages.empty")}):c.jsx("div",{className:"flex flex-col gap-3",children:i.map((h,g)=>c.jsx(zz,{stage:h,index:g,total:i.length,onChange:m=>f(g,m),onRemove:()=>o(g),onMoveUp:()=>d(g,-1),onMoveDown:()=>d(g,1)},g))})]})]})}function zz({stage:e,index:t,total:n,onChange:i,onRemove:a,onMoveUp:l,onMoveDown:o}){const d=Be(),f=e.on_fail??{};return c.jsxs("div",{className:"nb-card bg-[var(--color-bg-cream)] p-4",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsxs("h4",{className:"font-[family-name:var(--font-heading)] font-bold text-sm",children:["Stage #",t+1,e.name&&c.jsx("code",{className:"ml-2 text-xs font-[family-name:var(--font-mono)] bg-[var(--color-bg)] border-2 border-[var(--color-text)] px-2 py-0.5 rounded",children:e.name})]}),c.jsxs("div",{className:"flex gap-1",children:[c.jsx("button",{type:"button",className:"nb-btn",style:{padding:"3px 8px"},onClick:l,disabled:t===0,"aria-label":d("pipelineEditor.stage.moveUp"),children:c.jsx(FR,{size:12,strokeWidth:3})}),c.jsx("button",{type:"button",className:"nb-btn",style:{padding:"3px 8px"},onClick:o,disabled:t===n-1,"aria-label":d("pipelineEditor.stage.moveDown"),children:c.jsx(Vu,{size:12,strokeWidth:3})}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-danger",style:{padding:"3px 8px"},onClick:a,"aria-label":d("pipelineEditor.stage.remove"),children:c.jsx(fr,{size:12,strokeWidth:3})})]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[c.jsx(es,{label:"name",hint:d("pipelineEditor.stage.name.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.name??"",onChange:h=>i({name:h.target.value}),placeholder:"develop"})}),c.jsx(es,{label:"profile",hint:d("pipelineEditor.stage.profile.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.profile??"",onChange:h=>i({profile:h.target.value||void 0}),placeholder:"fullstack"})}),c.jsx(es,{label:"card_state",hint:d("pipelineEditor.stage.cardState.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.card_state??"",onChange:h=>i({card_state:h.target.value||void 0}),placeholder:"Inprogress"})}),c.jsx(es,{label:"timeout",hint:d("pipelineEditor.stage.timeout.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.timeout??"",onChange:h=>i({timeout:h.target.value||void 0}),placeholder:"2h"})}),c.jsx(es,{label:"trigger",hint:d("pipelineEditor.stage.trigger.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.trigger??"",onChange:h=>i({trigger:h.target.value||void 0}),placeholder:"card_enters 'Todo'"})}),c.jsx(es,{label:"on_complete",hint:d("pipelineEditor.stage.onComplete.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.on_complete??"",onChange:h=>i({on_complete:h.target.value}),placeholder:"move_card Done"})})]}),c.jsxs("div",{className:"mt-4 pt-3 border-t-2 border-dashed border-[var(--color-text)]",children:[c.jsx("h5",{className:"text-xs font-bold uppercase tracking-wider mb-2 text-[var(--color-text-muted)]",children:"on_fail"}),c.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[c.jsx(es,{label:"action",hint:d("pipelineEditor.stage.onFail.action.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:f.action??"",onChange:h=>i({on_fail:{...f,action:h.target.value||void 0}}),placeholder:"label NEEDS-FIX"})}),c.jsx(es,{label:"comment",hint:d("pipelineEditor.stage.onFail.comment.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:f.comment??"",onChange:h=>i({on_fail:{...f,comment:h.target.value||void 0}}),placeholder:"Worker failed. Check logs."})})]}),c.jsxs("label",{className:"flex items-center gap-2 mt-3 text-sm cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:f.halt??!0,onChange:h=>i({on_fail:{...f,halt:h.target.checked}})}),c.jsx("span",{className:"font-bold",children:"halt"}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:d("pipelineEditor.stage.halt.note")})]})]})]})}function es({label:e,hint:t,children:n}){return c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-xs font-bold font-[family-name:var(--font-mono)]",children:e}),n,t&&c.jsx("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:t})]})}function Pz({onCancel:e,onCreate:t,hasActive:n,hasSample:i,isPending:a}){const l=Be(),[o,d]=j.useState(""),[f,h]=j.useState("blank");j.useEffect(()=>{const N=E=>{E.key==="Escape"&&e()};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[e]);const g=o.trim(),m=g.endsWith(".yaml")?g:g?`${g}.yaml`:"",y=m&&/^[a-zA-Z0-9_.-]+\.yaml$/.test(m),b=()=>{!y||a||t(m,f)},v=l("newPipelineDialog.field.filename.help",{filename:"__FN__"}).split("__FN__");return c.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-50 flex items-center justify-center p-6 bg-black/30",children:c.jsxs("div",{className:"nb-card max-w-md w-full",children:[c.jsxs("header",{className:"flex items-start justify-between mb-4",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold",children:l("newPipelineDialog.title")}),c.jsx("button",{className:"nb-btn nb-btn-mint p-2",onClick:e,type:"button","aria-label":l("common.close"),children:c.jsx(bn,{size:14,strokeWidth:3})})]}),c.jsxs("form",{onSubmit:N=>{N.preventDefault(),b()},className:"flex flex-col gap-4",children:[c.jsxs("label",{className:"flex flex-col gap-1.5",children:[c.jsx("span",{className:"text-sm font-bold",children:l("newPipelineDialog.field.filename.label")}),c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:l("newPipelineDialog.field.filename.placeholder"),value:o,onChange:N=>d(N.target.value),autoFocus:!0}),c.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:[v[0],c.jsx("code",{className:"font-[family-name:var(--font-mono)]",children:m||"xxx.yaml"}),v[1]]})]}),c.jsxs("fieldset",{className:"flex flex-col gap-2",children:[c.jsx("legend",{className:"text-sm font-bold mb-1",children:l("newPipelineDialog.section.template")}),c.jsx(Bg,{value:"blank",current:f,label:l("newPipelineDialog.template.blank.label"),desc:l("newPipelineDialog.template.blank.desc"),onSelect:h}),c.jsx(Bg,{value:"sample",current:f,label:l("newPipelineDialog.template.sample.label"),desc:l("newPipelineDialog.template.sample.desc"),onSelect:h,disabled:!i,disabledReason:l("newPipelineDialog.template.sample.unavailable")}),c.jsx(Bg,{value:"active",current:f,label:l("newPipelineDialog.template.active.label"),desc:l("newPipelineDialog.template.active.desc"),onSelect:h,disabled:!n,disabledReason:l("newPipelineDialog.template.active.unavailable")})]}),c.jsxs("div",{className:"flex gap-3 justify-end pt-2",children:[c.jsx("button",{className:"nb-btn",onClick:e,type:"button",disabled:a,children:l("common.cancel")}),c.jsxs("button",{className:"nb-btn nb-btn-primary",type:"submit",disabled:!y||a,"aria-label":l("newPipelineDialog.create.aria"),children:[a?c.jsx(Xe,{size:13,strokeWidth:3,className:"animate-spin"}):c.jsx(pi,{size:13,strokeWidth:3}),l("common.create")]})]})]})]})})}function Bg({value:e,current:t,label:n,desc:i,onSelect:a,disabled:l,disabledReason:o}){const d=t===e;return c.jsxs("label",{className:["flex items-start gap-2 p-2 rounded-lg border-2 cursor-pointer",l?"border-[var(--color-border-light)] opacity-50 cursor-not-allowed":d?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)]":"border-[var(--color-border-light)] hover:bg-[var(--color-bg-cream)] hover:border-[var(--color-text)]"].join(" "),children:[c.jsx("input",{type:"radio",name:"pipeline-template",value:e,checked:d,disabled:l,onChange:()=>a(e),className:"mt-1 flex-shrink-0"}),c.jsxs("div",{className:"flex-1",children:[c.jsx("div",{className:"text-sm font-bold",children:n}),c.jsx("div",{className:"text-xs text-[var(--color-text-muted)]",children:l?o:i})]})]})}function Bz(e){return ft(`/api/rules/${encodeURIComponent(e)}`)}function ox(e){const t=e?`?project=${encodeURIComponent(e)}`:"";return ft(`/api/skills${t}`)}function $z(e){return ft(`/api/skills/${encodeURIComponent(e)}`)}function Uz(e,t){return ft(`/api/skills/${encodeURIComponent(e)}/references/${encodeURIComponent(t)}`)}async function Fz(e,t){const n=await fetch(e,{method:"POST",headers:void 0,body:void 0});if(!n.ok)throw new Error(`${n.status}: ${await n.text()}`);return n.json().catch(()=>({}))}function qz(){return Fz("/api/skills/sync")}function Hz(e){return ft(`/api/skills/policy/${encodeURIComponent(e)}`)}function Kz(e,t){return Hb(`/api/skills/policy/${encodeURIComponent(e)}`,t)}function Gz(){return ft("/api/skills/updates")}function Vz(e,t,n){return Lr("/api/skills/import",{name:e,files:t,overwrite:n})}function Yz(e){return ft(`/api/skills/${encodeURIComponent(e)}/export`)}function Qz(e,t){return Lr("/api/skills/create",{name:e,intent:t})}function d2(){return c.jsx("div",{className:"nb-card",children:c.jsxs("p",{className:"text-[var(--color-text-muted)] flex items-center gap-2",children:[c.jsx(Xe,{size:14,className:"animate-spin"})," …"]})})}function f2({msg:e}){return c.jsx("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:c.jsx("p",{children:e})})}function Wz({name:e}){var b,k;const t=Be(),n=Gt(),{alert:i}=un(),a=Ye({queryKey:["skill-policy",e],queryFn:()=>Hz(e),enabled:!!e}),l=(b=a.data)==null?void 0:b.data,[o,d]=j.useState(null),[f,h]=j.useState(null);j.useEffect(()=>{var v;l&&o===null&&d((v=l.policy.allow)!=null&&v.length?new Set(l.policy.allow):new Set(l.skills.map(N=>N.name)))},[l,o]);const g=Ct({mutationFn:v=>Kz(e,v),onSuccess:v=>{h(v),d(null),n.invalidateQueries({queryKey:["skill-policy",e]})},onError:v=>void i({title:t("projectDetail.skills.saveError"),body:v instanceof Error?v.message:String(v)})});if(a.isLoading||l&&o===null)return c.jsx(d2,{});if(a.isError)return c.jsx(f2,{msg:a.error instanceof Error?a.error.message:String(a.error)});if(!l||!o)return null;if(l.skills.length===0)return c.jsx("div",{className:"nb-card",children:c.jsx("p",{className:"text-[var(--color-text-muted)]",children:t("projectDetail.skills.empty")})});const m=l.eligible!==null,y=v=>d(N=>{const E=new Set(N);return E.has(v)?E.delete(v):E.add(v),E});return c.jsxs("div",{className:"nb-card flex flex-col gap-4 h-full min-h-0",children:[c.jsxs("div",{className:"shrink-0",children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold flex items-center gap-2",children:[c.jsx(e_,{size:18,strokeWidth:2.5}),t("projectDetail.skills.title")]}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:t("projectDetail.skills.desc")}),c.jsx("p",{className:"text-sm mt-1 font-medium",children:m?t("projectDetail.skills.hasPolicy",{count:String(((k=l.eligible)==null?void 0:k.length)??0)}):t("projectDetail.skills.noPolicy")})]}),c.jsxs("div",{className:"flex gap-2 shrink-0",children:[c.jsx("button",{type:"button",className:"nb-btn",style:{padding:"4px 10px",fontSize:12},onClick:()=>d(new Set(l.skills.map(v=>v.name))),children:t("projectDetail.skills.selectAll")}),c.jsx("button",{type:"button",className:"nb-btn",style:{padding:"4px 10px",fontSize:12},onClick:()=>d(new Set),children:t("projectDetail.skills.selectNone")})]}),c.jsx("div",{className:"flex bg-surface-input flex-col gap-1 flex-1 min-h-0 overflow-auto border-2 border-[var(--color-text)] rounded p-2",children:l.skills.map(v=>c.jsxs("label",{className:"flex items-start gap-2 px-2 py-1 rounded hover:bg-[var(--color-bg-cream)] cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:o.has(v.name),onChange:()=>y(v.name),className:"mt-1"}),c.jsxs("span",{className:"flex-1",children:[c.jsx("code",{className:"font-[family-name:var(--font-mono)] text-sm font-bold",children:v.name}),c.jsx("span",{className:"ml-2 text-[10px] uppercase text-[var(--color-text-muted)]",children:v.category}),v.description&&c.jsx("span",{className:"block text-xs text-[var(--color-text-muted)]",children:v.description})]})]},v.name))}),c.jsxs("div",{className:"flex items-center gap-2 flex-wrap shrink-0",children:[c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",disabled:g.isPending,onClick:()=>g.mutate({allow:[...o]}),children:[g.isPending?c.jsx(Xe,{size:14,className:"animate-spin"}):c.jsx(Rr,{size:14,strokeWidth:3}),t("projectDetail.skills.save")]}),c.jsxs("button",{type:"button",className:"nb-btn",disabled:g.isPending,onClick:()=>g.mutate({}),children:[c.jsx(Bb,{size:14,strokeWidth:3}),t("projectDetail.skills.clear")]}),c.jsxs("span",{className:"text-sm text-[var(--color-text-muted)]",children:[o.size,"/",l.skills.length]})]}),f&&c.jsxs("div",{className:"text-sm border-2 border-[var(--color-text)] rounded p-2 bg-[var(--color-bg-cream)]",children:[c.jsx("p",{children:t("projectDetail.skills.applied",{linked:String(f.applied.linked),pruned:String(f.applied.pruned)})}),f.unknown.length>0&&c.jsx("p",{className:"text-[var(--color-text-muted)]",children:t("projectDetail.skills.unknown",{names:f.unknown.join(", ")})})]})]})}function Xz({name:e}){var a;const t=Be(),n=Ye({queryKey:["rules",e],queryFn:()=>Bz(e),enabled:!!e});if(n.isLoading)return c.jsx(d2,{});if(n.isError)return c.jsx(f2,{msg:n.error instanceof Error?n.error.message:String(n.error)});const i=((a=n.data)==null?void 0:a.data)??[];return c.jsxs("div",{className:"flex flex-col gap-4 min-h-full",children:[c.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:t("projectDetail.rules.readonly")}),i.map(l=>c.jsxs("div",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[c.jsx("code",{className:"font-[family-name:var(--font-mono)] text-sm font-bold border-2 border-[var(--color-text)] px-2 py-0.5 rounded",children:l.name}),!l.exists&&c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:t("projectDetail.rules.missing")})]}),l.exists&&c.jsx("pre",{className:"overflow-auto max-h-[28rem] text-xs font-[family-name:var(--font-mono)] whitespace-pre-wrap break-words bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded p-3",children:l.content})]},l.name))]})}const ip=e=>`/api/projects/${encodeURIComponent(e)}/graph`;function Zz(e){return ft(`${ip(e)}/status`)}function Jz(e){return ft(`${ip(e)}/data`)}function e4(e){return Lr(`${ip(e)}/build`)}function t4(e){return Lr(`${ip(e)}/sync`)}const n4={typescript:"#1D4E89",tsx:"#2563EB",javascript:"#B8860B",json:"#6B7280",yaml:"#C2410C"},Cf=e=>n4[e]??"#2D6A4F";function Nk(e){return[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)]}const i4=e=>Math.max(8,Math.min(22,8+e*2.5));function r4(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/1024/1024).toFixed(2)} MB`}function a4(e){if(!e)return"—";const t=new Date(e);if(Number.isNaN(t.getTime()))return"—";const n=i=>String(i).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}function s4({name:e,status:t}){var y,b,k,v;const n=Be(),i=Ye({queryKey:["graph-data",e],queryFn:()=>Jz(e)}),[a,l]=j.useState(""),o=j.useRef(null),d=j.useRef(null),f=j.useRef(null),h=j.useRef(null),g=[...new Set((((b=(y=i.data)==null?void 0:y.data)==null?void 0:b.nodes)??[]).map(N=>N.language))];if(j.useEffect(()=>{h.current&&(h.current.search=a.trim().toLowerCase())},[a]),j.useEffect(()=>{var De;const N=(De=i.data)==null?void 0:De.data,E=d.current,C=o.current;if(!N||!N.nodes.length||!E||!C)return;const S=E.getContext("2d");if(!S)return;const _={};for(const ce of N.links)_[ce.source]=(_[ce.source]??0)+1,_[ce.target]=(_[ce.target]??0)+1;const M=N.nodes.length,T=window.devicePixelRatio||1,R=C.getBoundingClientRect(),O=R.width||800,$=R.height||500,I=Math.min(O,$)*.35+M*1.5,q=N.nodes.map((ce,Ce)=>{const te=2*Math.PI*Ce/Math.max(M,1),pe=_[ce.id]??0;return{id:ce.id,language:ce.language,symbols:ce.symbols,deg:pe,name:ce.id.split("/").pop()||ce.id,x:Math.cos(te)*I+Math.sin(Ce*12.9898)*43758.5453%1*40,y:Math.sin(te)*I+Math.sin(Ce*78.233)*12345.678%1*40,vx:0,vy:0,r:i4(pe)}}),F={};for(const ce of q)F[ce.id]=ce;const Y=N.links.map(ce=>({source:ce.source,target:ce.target,weight:ce.weight})),D={nodes:q,edges:Y,map:F,panX:O/2,panY:$/2,zoom:1,drag:null,mouseX:0,mouseY:0,raf:null,tick:0,quiet:0,sel:null,search:a.trim().toLowerCase(),fitted:!1};h.current=D;const K=()=>{const ce=C.getBoundingClientRect();E.width=ce.width*T,E.height=ce.height*T,E.style.width=ce.width+"px",E.style.height=ce.height+"px",S.setTransform(T,0,0,T,0,0)};K();const P=new ResizeObserver(K);P.observe(C);const H=()=>{let ce=1/0,Ce=1/0,te=-1/0,pe=-1/0;for(const be of q)ce=Math.min(ce,be.x-be.r),Ce=Math.min(Ce,be.y-be.r),te=Math.max(te,be.x+be.r),pe=Math.max(pe,be.y+be.r);const Fe=E.width/T,ze=E.height/T,ae=Math.min(Fe/Math.max(te-ce,1),ze/Math.max(pe-Ce,1),1.4)*.88;D.zoom=ae,D.panX=Fe/2-(ce+te)/2*ae,D.panY=ze/2-(Ce+pe)/2*ae},Q=()=>{const ce=q.length;D.tick++;const Ce=.9-Math.min(.4,D.tick/1500),te=ce>1e3?3e3:ce>100?2e3:ce>50?1200:800,pe=ce>100?.002:.005,Fe=ce>1e3?.012:ce>100?.005:.01,ze=ce>1e3?6:ce>200?12:24;for(let ye=0;ye<ce;ye++){const he=q[ye];let Ee=-he.x*Fe,Ne=-he.y*Fe;for(let Ke=0;Ke<ce;Ke++){if(ye===Ke)continue;const ne=q[Ke],de=he.x-ne.x,Le=he.y-ne.y,Ze=de*de+Le*Le||1,rt=Math.sqrt(Ze),At=te/Ze;Ee+=de/rt*At,Ne+=Le/rt*At}if(he!==D.drag){let Ke=(he.vx+Ee)*Ce,ne=(he.vy+Ne)*Ce;Ke=Math.max(-ze,Math.min(ze,Ke)),ne=Math.max(-ze,Math.min(ze,ne)),he.vx=Ke,he.vy=ne}}for(const ye of Y){const he=F[ye.source],Ee=F[ye.target];if(!he||!Ee)continue;const Ne=Ee.x-he.x,Ke=Ee.y-he.y,ne=Math.sqrt(Ne*Ne+Ke*Ke)||1,de=(ne-100)*pe,Le=Ne/ne*de,Ze=Ke/ne*de;he!==D.drag&&(he.vx+=Le,he.vy+=Ze),Ee!==D.drag&&(Ee.vx-=Le,Ee.vy-=Ze)}let ae=0;for(const ye of q)ye!==D.drag&&(ye.x+=ye.vx,ye.y+=ye.vy,ae+=ye.vx*ye.vx+ye.vy*ye.vy);(ce?Math.sqrt(ae/ce):0)<.05&&D.tick>60&&!D.drag?D.quiet++:D.quiet=0,!D.fitted&&(D.quiet>8||D.tick>400)&&(D.fitted=!0,H())},G=()=>{const ce=E.width/T,Ce=E.height/T;S.clearRect(0,0,ce,Ce),S.strokeStyle="rgba(45,55,72,0.05)",S.lineWidth=.5;for(let be=0;be<ce;be+=24)S.beginPath(),S.moveTo(be,0),S.lineTo(be,Ce),S.stroke();for(let be=0;be<Ce;be+=24)S.beginPath(),S.moveTo(0,be),S.lineTo(ce,be),S.stroke();S.save(),S.translate(D.panX,D.panY),S.scale(D.zoom,D.zoom);const te=D.search,pe=q.length>40;let Fe=null;if(!D.drag){const be=E.getBoundingClientRect(),ye=(D.mouseX-be.left-D.panX)/D.zoom,he=(D.mouseY-be.top-D.panY)/D.zoom;for(let Ee=q.length-1;Ee>=0;Ee--){const Ne=q[Ee],Ke=Ne.x-ye,ne=Ne.y-he;if(Ke*Ke+ne*ne<Ne.r*Ne.r+25){Fe=Ne.id;break}}}const ze=D.sel||Fe;for(const be of Y){const ye=F[be.source],he=F[be.target];if(!ye||!he)continue;const Ee=te&&!(ye.name.toLowerCase().includes(te)||he.name.toLowerCase().includes(te)),Ne=ze&&(be.source===ze||be.target===ze),Ke=he.x-ye.x,ne=he.y-ye.y,de=Math.sqrt(Ke*Ke+ne*ne)||1,Le=pe?12:18,Ze=(ye.x+he.x)/2+-ne/de*Le,rt=(ye.y+he.y)/2+Ke/de*Le,[At,$n,dn]=Nk(Cf(ye.language));let Mt;if(Ee?Mt=.05:ze&&Ne?Mt=.6:ze&&!Ne?Mt=.05:Mt=pe?.14:.24,S.beginPath(),S.moveTo(ye.x,ye.y),S.quadraticCurveTo(Ze,rt,he.x,he.y),S.strokeStyle=`rgba(${At},${$n},${dn},${Mt})`,S.lineWidth=Ne?2+be.weight*.4:1+be.weight*.25,S.stroke(),!pe||Ne){const Qt=Math.atan2(he.y-rt,he.x-Ze),yt=5+S.lineWidth;S.beginPath(),S.moveTo(he.x-he.r*Math.cos(Qt),he.y-he.r*Math.sin(Qt)),S.lineTo(he.x-(he.r+yt)*Math.cos(Qt-.3),he.y-(he.r+yt)*Math.sin(Qt-.3)),S.lineTo(he.x-(he.r+yt)*Math.cos(Qt+.3),he.y-(he.r+yt)*Math.sin(Qt+.3)),S.closePath(),S.fillStyle=`rgba(${At},${$n},${dn},${Ee?.05:Ne?.55:.18})`,S.fill()}}const ae=pe?1.5:.5;for(const be of q){const ye=Cf(be.language),he=D.sel===be.id,Ee=Fe===be.id,Ne=!te||be.name.toLowerCase().includes(te),Ke=ze&&be.id!==ze&&!Y.some(At=>At.source===ze&&At.target===be.id||At.target===ze&&At.source===be.id),ne=Ne?Ke?.2:1:.12;S.save(),S.globalAlpha=ne,Ne&&!Ke&&(he||Ee||!te)&&(S.shadowColor=ye,S.shadowBlur=he?20:Ee?16:pe?4:8);const[de,Le,Ze]=Nk(ye),rt=S.createRadialGradient(be.x-be.r*.3,be.y-be.r*.3,0,be.x,be.y,be.r*1.2);if(rt.addColorStop(0,`rgba(${Math.min(255,de+60)},${Math.min(255,Le+60)},${Math.min(255,Ze+60)},0.95)`),rt.addColorStop(1,ye),S.beginPath(),S.arc(be.x,be.y,be.r,0,Math.PI*2),S.fillStyle=rt,S.fill(),S.shadowBlur=0,S.lineWidth=he?2.5:1,S.strokeStyle=he?"#111827":"rgba(255,255,255,0.7)",S.stroke(),S.restore(),Ne&&!Ke&&(he||Ee||D.zoom>ae)){const At=1/D.zoom;S.save(),S.globalAlpha=ne,S.fillStyle="rgba(45,55,72,0.92)",S.font=`${(10*At).toFixed(1)}px 'DM Sans', sans-serif`,S.textAlign="center",S.fillText(be.name,be.x,be.y+be.r+11*At),S.restore()}}S.restore()},L=()=>{if(Q(),G(),D.quiet>40&&!D.drag){D.raf=null;return}D.raf=requestAnimationFrame(L)},z=()=>{D.raf==null&&(D.quiet=0,D.raf=requestAnimationFrame(L))};D.raf=requestAnimationFrame(L);let V=!1,B=0,le=0;const ve=ce=>{const Ce=E.getBoundingClientRect();return{x:(ce.clientX-Ce.left-D.panX)/D.zoom,y:(ce.clientY-Ce.top-D.panY)/D.zoom}},ke=(ce,Ce)=>{for(let te=q.length-1;te>=0;te--){const pe=q[te];if(!pe)continue;const Fe=pe.x-ce,ze=pe.y-Ce;if(Fe*Fe+ze*ze<pe.r*pe.r+25)return pe}return null},Se=ce=>{const Ce=ve(ce),te=ke(Ce.x,Ce.y);te?D.drag=te:V=!0,B=ce.clientX,le=ce.clientY,z()},J=ce=>{const Ce=ce.clientX-B,te=ce.clientY-le;D.drag?(D.drag.x+=Ce/D.zoom,D.drag.y+=te/D.zoom,D.drag.vx=0,D.drag.vy=0,z()):V&&(D.panX+=Ce,D.panY+=te,z()),B=ce.clientX,le=ce.clientY,D.mouseX=ce.clientX,D.mouseY=ce.clientY;const pe=f.current,Fe=ve(ce),ze=!D.drag&&!V?ke(Fe.x,Fe.y):null;if(pe)if(ze){const ae=Y.filter(ye=>ye.source===ze.id||ye.target===ze.id).length;pe.innerHTML=`<div style="font-weight:700;word-break:break-all">${ze.id}</div><div style="margin-top:4px;color:#64748b;font-family:var(--font-mono,monospace)"><span style="color:${Cf(ze.language)}">●</span> ${ze.language} · ${ze.symbols} symbols · ${ae} links</div>`;const be=E.getBoundingClientRect();pe.style.left=ce.clientX-be.left+14+"px",pe.style.top=ce.clientY-be.top+14+"px",pe.style.display="block",E.style.cursor="pointer"}else pe.style.display="none",E.style.cursor=D.drag||V?"grabbing":"grab";z()},ue=ce=>{D.drag&&!V?Math.abs(ce.clientX-B)>3||(D.sel=D.sel===D.drag.id?null:D.drag.id):V&&Math.abs(ce.clientX-B)<3&&Math.abs(ce.clientY-le)<3&&(D.sel=null),D.drag=null,V=!1,z()},Te=ce=>{ce.preventDefault();const Ce=E.getBoundingClientRect(),te=ce.clientX-Ce.left,pe=ce.clientY-Ce.top,Fe=ce.deltaY>0?.9:1.1,ze=Math.max(.1,Math.min(5,D.zoom*Fe));D.panX=te-(te-D.panX)/D.zoom*ze,D.panY=pe-(pe-D.panY)/D.zoom*ze,D.zoom=ze,z()},Re=()=>{f.current&&(f.current.style.display="none")};return E.addEventListener("mousedown",Se),window.addEventListener("mousemove",J),window.addEventListener("mouseup",ue),E.addEventListener("wheel",Te,{passive:!1}),E.addEventListener("mouseleave",Re),()=>{D.raf!=null&&cancelAnimationFrame(D.raf),P.disconnect(),E.removeEventListener("mousedown",Se),window.removeEventListener("mousemove",J),window.removeEventListener("mouseup",ue),E.removeEventListener("wheel",Te),E.removeEventListener("mouseleave",Re),h.current=null}},[i.data]),i.isLoading)return c.jsxs("div",{className:"nb-card flex items-center gap-2 text-sm text-[var(--color-text-muted)]",children:[c.jsx(Xe,{size:14,className:"animate-spin"})," ",n("graph.viz.loading")]});if(!((v=(k=i.data)==null?void 0:k.data)!=null&&v.nodes.length))return c.jsx("div",{className:"nb-card text-sm text-[var(--color-text-muted)]",children:n("graph.viz.empty")});const m=[{label:n("graph.stat.files"),value:t.files.toLocaleString()},{label:n("graph.stat.nodes"),value:t.nodes.toLocaleString()},{label:n("graph.stat.edges"),value:t.edges.toLocaleString()},{label:n("graph.stat.db"),value:r4(t.dbSizeBytes)},{label:n("graph.stat.lastBuilt"),value:a4(t.lastIndexedAt)}];return c.jsxs("div",{ref:o,className:"relative w-full flex-1 min-h-[420px] nb-card p-0 overflow-hidden",style:{background:"var(--color-bg-cream)"},children:[c.jsx("canvas",{ref:d,className:"block absolute inset-0",style:{cursor:"grab"}}),c.jsx("div",{ref:f,className:"absolute z-40 pointer-events-none nb-card bg-[var(--color-bg)] px-3 py-2 text-xs max-w-xs",style:{display:"none"}}),c.jsxs("div",{className:"absolute top-3 right-3 w-52 flex flex-col gap-2 pointer-events-none",children:[c.jsxs("div",{className:"relative pointer-events-auto",children:[c.jsx(fl,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-subtle)]"}),c.jsx("input",{className:"nb-input pl-9 w-full text-sm",placeholder:n("graph.viz.search"),value:a,onChange:N=>l(N.target.value),"aria-label":n("graph.viz.search")})]}),c.jsxs("div",{className:"nb-card p-3 flex flex-col gap-1.5 pointer-events-auto bg-[var(--color-bg)]",children:[m.map(N=>c.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[c.jsx("span",{className:"text-[var(--color-text-subtle)] shrink-0",children:N.label}),c.jsx("span",{className:"font-bold font-[family-name:var(--font-mono)] text-right",children:N.value})]},N.label)),c.jsx("div",{className:"mt-1 pt-1.5 border-t-[1.5px] border-dashed border-[var(--color-border-light)] flex flex-wrap gap-x-2 gap-y-1",children:g.map(N=>c.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-[family-name:var(--font-mono)]",children:[c.jsx("span",{className:"inline-block w-2.5 h-2.5 rounded-full border-[1.5px] border-[var(--color-text)]",style:{background:Cf(N)}}),N]},N))})]}),c.jsx("p",{className:"text-[10px] text-[var(--color-text-subtle)] text-right leading-tight pointer-events-none",children:n("graph.viz.hint")})]})]})}function l4({name:e}){var m,y;const t=Be(),n=Gt(),i=Ye({queryKey:["graph-status",e],queryFn:()=>Zz(e)}),a=()=>{n.invalidateQueries({queryKey:["graph-status",e]}),n.invalidateQueries({queryKey:["graph-data",e]})},l=Ct({mutationFn:()=>e4(e),onSuccess:a}),o=Ct({mutationFn:()=>t4(e),onSuccess:a}),d=((m=i.data)==null?void 0:m.data)??null,f=l.isPending,h=o.isPending,g=f||h;return c.jsxs("div",{className:"flex flex-col gap-3 max-w-full flex-1 min-h-0",children:[c.jsxs("header",{className:"flex items-center justify-between flex-wrap gap-3 shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx(WN,{size:20,strokeWidth:2.5,className:"shrink-0"}),c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold shrink-0",children:t("graph.title")}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)] truncate hidden sm:inline",children:t("graph.desc")})]}),c.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[d&&c.jsxs("button",{className:"nb-btn shrink-0",onClick:()=>o.mutate(),disabled:g,type:"button",title:t("graph.sync.desc"),children:[h?c.jsx(Xe,{size:14,strokeWidth:2.5,className:"animate-spin"}):c.jsx(mL,{size:14,strokeWidth:2.5}),t(h?"graph.syncing":"graph.sync")]}),c.jsxs("button",{className:"nb-btn nb-btn-mint shrink-0",onClick:()=>l.mutate(),disabled:g,type:"button",children:[f?c.jsx(Xe,{size:14,strokeWidth:2.5,className:"animate-spin"}):d?c.jsx(ya,{size:14,strokeWidth:2.5}):c.jsx(xL,{size:14,strokeWidth:2.5}),t(f?"graph.building":d?"graph.rebuild":"graph.build")]})]})]}),(l.isError||o.isError)&&c.jsxs("div",{className:"nb-card bg-[var(--color-crashed-bg)] text-sm shrink-0",children:[t("graph.buildFailed"),": ",((y=l.error||o.error)==null?void 0:y.message)??""]}),i.isLoading?c.jsxs("div",{className:"nb-card flex items-center gap-2 text-sm text-[var(--color-text-muted)]",children:[c.jsx(Xe,{size:14,className:"animate-spin"})," ",t("graph.viz.loading")]}):d?c.jsx(s4,{name:e,status:d}):c.jsx("div",{className:"nb-card text-sm text-[var(--color-text-muted)]",children:t("graph.empty")})]})}const _k=["overview","config","pipelines","skills","rules","graph","logs"];function o4({name:e,embedded:t}={}){var v;const n=Be(),{name:i=""}=Db(),a=e??i,l=ks(),[o]=UN(),[d,f]=Gb("projectDetail.tab","overview"),h=_k.includes(d)?d:"overview",[g,m]=j.useState(!1),y=o.get("tab"),b=o.get("worker")??void 0;j.useEffect(()=>{if(y==="danger"){m(!0);return}y&&_k.includes(y)&&f(y)},[y]);const k=Ye({queryKey:["project",a],queryFn:()=>Z3(a),enabled:!!a});return c.jsxs("div",{className:"flex flex-col gap-4 w-full flex-1 min-h-0",children:[c.jsxs("header",{className:"flex items-center gap-3 shrink-0",children:[!t&&c.jsxs("button",{type:"button",onClick:()=>l("/projects"),className:"nb-btn",style:{padding:"6px 12px"},"aria-label":n("newProject.back.aria"),children:[c.jsx(qN,{size:14,strokeWidth:3}),n("newProject.back")]}),c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-3xl font-bold flex-1 truncate",children:a})]}),c.jsxs("nav",{className:"flex items-center gap-2 flex-wrap shrink-0",children:[c.jsx(ts,{current:h,value:"overview",onSelect:f,icon:aL,children:n("projectDetail.tab.overview")}),c.jsx(ts,{current:h,value:"config",onSelect:f,icon:JN,children:n("projectDetail.tab.config")}),c.jsx(ts,{current:h,value:"pipelines",onSelect:f,icon:Fb,children:n("projectDetail.tab.pipelines")}),c.jsx(ts,{current:h,value:"skills",onSelect:f,icon:e_,children:n("projectDetail.tab.skills")}),c.jsx(ts,{current:h,value:"rules",onSelect:f,icon:RR,children:n("projectDetail.tab.rules")}),c.jsx(ts,{current:h,value:"graph",onSelect:f,icon:WN,children:n("projectDetail.tab.graph")}),c.jsx(ts,{current:h,value:"logs",onSelect:f,icon:$b,children:n("projectDetail.tab.logs")}),c.jsx(ts,{current:h,value:"danger",onSelect:()=>m(!0),icon:fr,children:n("projectDetail.tab.danger")}),c.jsx(vs,{to:`/board?project=${encodeURIComponent(a)}`,className:"nb-btn nb-btn-mint ml-auto",children:n("projectDetail.openBoard")})]}),c.jsxs("div",{className:["flex-1 min-h-0 pr-1 flex flex-col",h==="logs"?"overflow-hidden":"overflow-y-auto"].join(" "),children:[h==="overview"&&c.jsx(c4,{name:a,data:k.data,loading:k.isLoading}),h==="config"&&c.jsx(u4,{name:a}),h==="pipelines"&&c.jsx(d4,{name:a}),h==="skills"&&c.jsx(Wz,{name:a}),h==="rules"&&c.jsx(Xz,{name:a}),h==="graph"&&c.jsx(l4,{name:a}),h==="logs"&&c.jsx(vI,{project:a,initialWorker:h==="logs"?b:void 0})]}),g&&c.jsx(f4,{name:a,repoDir:((v=k.data)==null?void 0:v.repoDir)??null,onClose:()=>m(!1)})]})}function ts({current:e,value:t,onSelect:n,icon:i,children:a}){const l=e===t;return c.jsxs("button",{type:"button",onClick:()=>n(t),"aria-current":l?"page":void 0,className:["nb-btn",l?"nb-btn-primary":""].join(" "),style:{padding:"6px 14px",fontSize:13},children:[c.jsx(i,{size:13,strokeWidth:2.5}),a]})}function c4({name:e,data:t,loading:n}){const i=Be();return n?c.jsx("div",{className:"nb-card",children:c.jsx("p",{className:"text-[var(--color-text-muted)]",children:i("common.loading")})}):t?c.jsx("div",{className:"nb-card",children:c.jsxs("dl",{className:"grid grid-cols-[160px_1fr] gap-y-3 text-sm",children:[c.jsx("dt",{className:"font-bold",children:i("projectDetail.overview.repoDir")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.repoDir??"—"}),c.jsx("dt",{className:"font-bold",children:i("projectDetail.overview.pmBackend")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.pmBackend}),c.jsx("dt",{className:"font-bold",children:i("projectDetail.overview.agent")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.agentProvider}),c.jsx("dt",{className:"font-bold",children:i("projectDetail.overview.cards")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:i("projectDetail.overview.cards.value",{total:t.cards.total,inprogress:t.cards.inprogress,done:t.cards.done})}),c.jsx("dt",{className:"font-bold",children:i("projectDetail.overview.workers")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:i("projectDetail.overview.workers.value",{total:t.workers.total,active:t.workers.active})}),c.jsx("dt",{className:"font-bold",children:i("projectDetail.overview.pipeline")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.pipelineStatus}),c.jsx("dt",{className:"font-bold",children:i("projectDetail.overview.lastActivity")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.lastActivityAt?new Date(t.lastActivityAt).toLocaleString():"—"})]})}):c.jsx("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:c.jsx("p",{children:i("projectDetail.overview.notFound",{name:e})})})}function u4({name:e}){const t=Be(),n=Gt(),{alert:i}=un(),{data:a,isLoading:l,isError:o,error:d,refetch:f}=Ye({queryKey:["project-conf",e],queryFn:()=>eI(e)}),[h,g]=j.useState(null),[m,y]=j.useState(null);j.useEffect(()=>{a&&h===null&&(g(a.content),y(a.etag))},[a,h]);const b=h!==null&&a!==void 0&&h!==a.content,k=Ct({mutationFn:()=>{if(h===null||m===null)throw new Error("no draft");return tI(e,h,m)},onSuccess:v=>{y(v.etag),n.invalidateQueries({queryKey:["project-conf",e]}),n.invalidateQueries({queryKey:["project",e]})},onError:v=>{const N=v.status;i({title:t(N===409?"projectDetail.config.error.conflict.title":"projectDetail.config.error.save.title"),body:N===409?t("projectDetail.config.error.conflict.body"):v instanceof Error?v.message:String(v)})}});return l?c.jsx("div",{className:"nb-card",children:c.jsx("p",{className:"text-[var(--color-text-muted)]",children:t("common.loading")})}):o?c.jsx("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:c.jsx("p",{children:t("projectDetail.config.error.load",{detail:d instanceof Error?d.message:String(d)})})}):c.jsxs("div",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold",children:c.jsxs("code",{className:"font-[family-name:var(--font-mono)] text-sm border-2 border-[var(--color-text)] px-2 py-0.5 rounded",children:["~/.coral/projects/",e,"/conf"]})}),m&&c.jsxs("p",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] mt-1",children:["etag: ",m]})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs("button",{type:"button",className:"nb-btn",style:{padding:"6px 12px"},onClick:()=>{g(null),f()},disabled:k.isPending,"aria-label":t("projectDetail.config.reload"),children:[c.jsx(ya,{size:13,strokeWidth:2.5}),t("projectDetail.config.reload")]}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-primary",style:{padding:"6px 12px"},onClick:()=>k.mutate(),disabled:!b||k.isPending,"aria-label":t("projectDetail.config.saveAria"),children:[k.isPending?c.jsx(Xe,{size:13,strokeWidth:3,className:"animate-spin"}):k.isSuccess&&!b?c.jsx(PR,{size:13,strokeWidth:3}):c.jsx(Rr,{size:13,strokeWidth:3}),t("projectDetail.config.save")]})]})]}),c.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",style:{minHeight:480,resize:"vertical"},value:h??"",onChange:v=>g(v.target.value),spellCheck:!1,"aria-label":t("projectDetail.config.editorAria")}),b&&c.jsx("p",{className:"text-xs text-[var(--color-stuck)] mt-2 font-bold",children:t("projectDetail.config.confDirty")})]})}function d4({name:e}){const t=Be(),n=Gt(),{confirm:i,alert:a}=un(),{data:l,isLoading:o}=Ye({queryKey:["project-pipelines",e],queryFn:()=>iI(e)}),[d,f]=j.useState(null),[h,g]=j.useState(!1),m=Ct({mutationFn:v=>rI(e,v),onSuccess:()=>n.invalidateQueries({queryKey:["project-pipelines",e]}),onError:v=>{a({title:t("projectDetail.pipelines.switch.error"),body:v instanceof Error?v.message:String(v)})}}),y=Ct({mutationFn:v=>oI(e,v),onSuccess:()=>n.invalidateQueries({queryKey:["project-pipelines",e]}),onError:v=>{a({title:t("projectDetail.pipelines.delete.error"),body:v instanceof Error?v.message:String(v)})}}),b=Ct({mutationFn:v=>lI(e,v.name,v.template),onSuccess:v=>{n.invalidateQueries({queryKey:["project-pipelines",e]}),g(!1),f(v.name)},onError:v=>{a({title:t("projectDetail.pipelines.create.error"),body:v instanceof Error?v.message:String(v)})}});if(o)return c.jsx("div",{className:"nb-card",children:c.jsx("p",{className:"text-[var(--color-text-muted)]",children:t("common.loading")})});const k=[];l!=null&&l.active&&k.push({name:l.active,isActive:!0});for(const v of(l==null?void 0:l.available)??[])k.push({name:v.name,isActive:!1});return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold",children:t("projectDetail.pipelines.title")}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",style:{padding:"6px 12px",fontSize:12},onClick:()=>g(!0),disabled:b.isPending,"aria-label":t("projectDetail.pipelines.add"),children:[c.jsx(pi,{size:12,strokeWidth:3}),t("projectDetail.pipelines.add")]})]}),k.length===0?c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] italic p-4 border-2 border-dashed border-[var(--color-text)] rounded-lg text-center",children:t("projectDetail.pipelines.empty")}):c.jsx("ul",{className:"flex flex-col gap-2",children:k.map(v=>c.jsxs("li",{className:"flex bg-surface-input items-center gap-3 p-3 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg",children:[c.jsx(Fb,{size:16,strokeWidth:2.5}),c.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold flex-1",children:v.name}),v.isActive&&c.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:t("projectDetail.pipelines.activeBadge")}),c.jsxs("div",{className:"flex gap-1",children:[c.jsxs("button",{type:"button",className:"nb-btn",style:{padding:"4px 10px",fontSize:11},onClick:()=>f(v.name),"aria-label":t("projectDetail.pipelines.editAria",{name:v.name}),children:[c.jsx(qh,{size:11,strokeWidth:2.5}),t("projectDetail.pipelines.edit")]}),!v.isActive&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"nb-btn nb-btn-primary",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{await i({title:t("projectDetail.pipelines.switch.confirm.title",{name:v.name}),body:t("projectDetail.pipelines.switch.confirm.body",{name:v.name}),confirm:t("projectDetail.pipelines.switch.confirm.button")})&&m.mutate(v.name)},disabled:m.isPending,"aria-label":t("projectDetail.pipelines.switchAria",{name:v.name}),children:t("projectDetail.pipelines.switch")}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-danger",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{await i({title:t("projectDetail.pipelines.delete.confirm.title",{name:v.name}),body:t("projectDetail.pipelines.delete.confirm.body"),confirm:t("common.delete"),danger:!0})&&y.mutate(v.name)},disabled:y.isPending,"aria-label":t("projectDetail.pipelines.deleteAria",{name:v.name}),children:c.jsx(fr,{size:11,strokeWidth:2.5})})]})]})]},v.name))})]}),d&&c.jsx(Lz,{projectName:e,file:d,onClose:()=>f(null),onSaved:()=>{n.invalidateQueries({queryKey:["project-pipelines",e]})}}),h&&c.jsx(Pz,{hasActive:!!(l!=null&&l.active),hasSample:!0,isPending:b.isPending,onCancel:()=>g(!1),onCreate:(v,N)=>b.mutate({name:v,template:N})})]})}function f4({name:e,repoDir:t,onClose:n}){const i=Be(),a=ks(),l=Gt(),{alert:o}=un(),[d,f]=j.useState(""),[h,g]=j.useState(!0),m=Ct({mutationFn:()=>nI(e,{includeClaudeDir:h}),onSuccess:N=>{l.invalidateQueries({queryKey:["projects"]});const E=N.claudeRemoved.filter(C=>C.ok).map(C=>C.path);n(),o({title:i("projectDetail.danger.deleted.title"),body:E.length>0?i("projectDetail.danger.deleted.bodyWithList",{paths:E.join(`
612
+ `)}):i("projectDetail.danger.deleted.body")}).then(()=>a("/projects"))},onError:N=>{o({title:i("projectDetail.danger.error"),body:N instanceof Error?N.message:String(N)})}});j.useEffect(()=>{const N=E=>{E.key==="Escape"&&n()};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[n]);const b=i("projectDetail.danger.body",{path:"__PATH__"}).split("__PATH__"),v=i("projectDetail.danger.confirmPrompt",{name:"__NAME__"}).split("__NAME__");return c.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"danger-dialog-title",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/30 p-4 overflow-hidden",children:c.jsxs("div",{className:"nb-card w-full max-w-xl max-h-[calc(100vh-2rem)] overflow-y-auto bg-[var(--color-crashed-bg)]",children:[c.jsxs("header",{className:"flex items-center justify-between gap-3 mb-3",children:[c.jsx("h2",{id:"danger-dialog-title",className:"font-[family-name:var(--font-heading)] text-lg font-bold text-[var(--color-crashed)]",children:i("projectDetail.danger.title")}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-mint p-2",onClick:n,"aria-label":i("common.close"),disabled:m.isPending,children:c.jsx(bn,{size:14,strokeWidth:3})})]}),c.jsxs("p",{className:"text-sm mb-4",children:[b[0],c.jsxs("code",{className:"font-[family-name:var(--font-mono)] bg-[var(--color-bg)] border-2 border-[var(--color-text)] px-1.5 py-0.5 rounded",children:["~/.coral/projects/",e,"/"]}),b[1]]}),t&&c.jsxs("label",{className:"flex items-start gap-2 mb-4 p-3 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-lg cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:h,onChange:N=>g(N.target.checked),className:"mt-0.5",disabled:m.isPending}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{className:"text-sm font-bold",children:i("projectDetail.danger.includeClaude.label")}),c.jsxs("div",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] break-all",children:[t,"/.claude/"]}),c.jsx("div",{className:"text-xs text-[var(--color-text-muted)] mt-1",children:i("projectDetail.danger.includeClaude.note")})]})]}),c.jsx("div",{className:"mb-4",children:c.jsxs("label",{className:"flex flex-col gap-1.5",children:[c.jsxs("span",{className:"text-sm font-bold",children:[v[0],c.jsx("code",{className:"font-[family-name:var(--font-mono)] text-xs",children:e}),v[1]]}),c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",value:d,onChange:N=>f(N.target.value),placeholder:e,disabled:m.isPending})]})}),c.jsxs("div",{className:"flex gap-2 justify-end pt-3 border-t-2 border-dashed border-[var(--color-text)]",children:[c.jsx("button",{type:"button",className:"nb-btn",onClick:n,disabled:m.isPending,children:i("common.cancel")}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-danger",disabled:d!==e||m.isPending,onClick:()=>m.mutate(),"aria-label":i("projectDetail.danger.deleteAria"),children:[m.isPending?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(fr,{size:14,strokeWidth:3}),i("projectDetail.danger.deleteButton")]})]})]})})}function cx(){return ft("/api/providers")}function h2(e){const t=[];for(const n of e)for(const i of n.models)t.push({providerId:n.id,model:i,label:`${i} · ${n.name}`});return t}async function h4(e,t){const n=await fetch("/api/providers",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({kind:e,entry:t})});if(!n.ok)throw new Error(`${n.status}: ${await n.text()}`);return n.json()}async function p4(e,t){const n=await fetch(`/api/providers/${e}/${encodeURIComponent(t)}`,{method:"DELETE"});if(!n.ok)throw new Error(`${n.status}: ${await n.text()}`);return n.json()}function p2(e){const t=e?`?path=${encodeURIComponent(e)}`:"";return ft(`/api/fs/browse${t}`)}async function m4(e,t){const n=await fetch("/api/fs/mkdir",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e,name:t})});if(!n.ok){const i=await n.text();throw new Error(`${n.status}: ${i}`)}return await n.json()}const m2=50*1024*1024;async function g4(e,t){if(t.size>m2)throw new Error(`文件超过 50 MB 上限(当前 ${(t.size/1024/1024).toFixed(2)} MB)`);const n=new FormData;n.append("sessionId",e),n.append("file",t,t.name);const i=await fetch("/api/fs/upload",{method:"POST",body:n});if(!i.ok){const a=await i.text();throw new Error(`${i.status}: ${a}`)}return await i.json()}function Qy(e,t){return`/api/fs/file?${new URLSearchParams({path:t,sessionId:e}).toString()}`}function ux({initialPath:e,onCancel:t,onSelect:n,title:i,mode:a="directory"}){var C,S,_;const l=Be(),{prompt:o,alert:d}=un(),f=i??l("dirPicker.title.default"),[h,g]=j.useState(e??null),[m,y]=j.useState(null),b=Ye({queryKey:["fs-browse",h],queryFn:()=>p2(h??void 0),staleTime:0,gcTime:0}),k=((C=b.data)==null?void 0:C.path)??h??"",v=((S=b.data)==null?void 0:S.parent)??null,N=((_=b.data)==null?void 0:_.home)??null,E=async()=>{var T;if(!k)return;const M=(T=await o({title:l("dirPicker.newDir"),body:l("dirPicker.newDir.prompt"),placeholder:l("dirPicker.newDir.placeholder"),confirm:l("dirPicker.newDir.create")}))==null?void 0:T.trim();if(M)try{const R=await m4(k,M);g(R.path)}catch(R){d({title:l("dirPicker.newDir.error.title"),body:R instanceof Error?R.message:String(R)})}};return j.useEffect(()=>{const M=T=>{T.key==="Escape"&&(T.preventDefault(),t())};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[t]),c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-[rgba(45,55,72,0.5)] p-4",role:"presentation",children:c.jsxs("div",{className:"nb-card bg-[var(--color-bg)] max-w-lg w-full p-5 flex flex-col",style:{maxHeight:"70vh"},role:"dialog","aria-modal":"true","aria-label":f,children:[c.jsxs("header",{className:"flex items-center justify-between mb-3 shrink-0",children:[c.jsx("div",{className:"flex items-center gap-2 min-w-0",children:c.jsx("h3",{className:"font-[family-name:var(--font-heading)] font-bold text-base truncate",children:f})}),c.jsx("button",{type:"button",className:"p-1 hover:bg-[var(--color-bg-cream)] rounded",onClick:t,"aria-label":l("dirPicker.close.aria"),children:c.jsx(bn,{size:14,strokeWidth:3})})]}),c.jsxs("div",{className:"flex items-center gap-2 mb-3 shrink-0",children:[c.jsx("button",{type:"button",className:"nb-btn flex-shrink-0",style:{padding:"4px 10px",fontSize:12},onClick:()=>v&&g(v),disabled:!v||b.isLoading,"aria-label":l("dirPicker.up.aria"),title:l("dirPicker.up.title"),children:c.jsx(HN,{size:12,strokeWidth:3})}),c.jsx("button",{type:"button",className:"nb-btn flex-shrink-0",style:{padding:"4px 10px",fontSize:12},onClick:()=>N&&g(N),disabled:!N||b.isLoading,"aria-label":l("dirPicker.home.aria"),title:l("dirPicker.home.title"),children:c.jsx(EL,{size:12,strokeWidth:3})}),c.jsx("button",{type:"button",className:"nb-btn flex-shrink-0",style:{padding:"4px 10px",fontSize:12},onClick:()=>void E(),disabled:!k||b.isLoading||b.isError,"aria-label":l("dirPicker.newDir.aria"),title:l("dirPicker.newDir.aria"),children:c.jsx(oL,{size:12,strokeWidth:3})}),c.jsx("div",{className:"flex-1 min-w-0 nb-input font-[family-name:var(--font-mono)] text-xs px-2 py-1.5 truncate",title:k,dir:"rtl",children:k||"..."})]}),c.jsx("div",{className:"scroll-frame flex-1 border-2 border-[var(--color-text)] rounded-lg bg-[var(--color-bg-cream)] min-h-0",children:c.jsxs("div",{className:"scroll-frame-body h-full",children:[b.isLoading&&c.jsxs("div",{className:"flex items-center justify-center py-12 text-[var(--color-text-muted)]",children:[c.jsx(Xe,{size:16,strokeWidth:3,className:"animate-spin mr-2"}),l("dirPicker.loading")]}),b.isError&&c.jsxs("div",{className:"p-4 text-sm text-[var(--color-crashed)]",children:[c.jsx("p",{className:"font-bold mb-1",children:l("dirPicker.error.title")}),c.jsx("p",{className:"text-xs font-[family-name:var(--font-mono)] break-all",children:b.error instanceof Error?b.error.message:String(b.error)})]}),b.data&&c.jsxs("ul",{className:"divide-y-2 divide-[var(--color-text)]/20",children:[b.data.entries.length===0&&c.jsx("li",{className:"p-4 text-xs text-[var(--color-text-subtle)] italic text-center",children:l("dirPicker.empty")}),b.data.entries.map(M=>{const T=(()=>{const $=k.endsWith("/")||k.endsWith("\\")?"":"/";return`${k}${$}${M.name}`})(),R=a==="file"&&m===T,O=M.isDirectory||a==="file";return c.jsx("li",{children:c.jsxs("button",{type:"button",className:["w-full flex items-center gap-2 px-3 py-2 text-left text-sm font-[family-name:var(--font-mono)]","disabled:opacity-50 disabled:cursor-not-allowed",R?"bg-[var(--color-accent-mint)] font-bold":"hover:bg-[var(--color-accent-mint)]"].join(" "),disabled:!O,onClick:()=>{M.isDirectory?(y(null),g(T)):a==="file"&&y(T)},onDoubleClick:()=>{a==="file"&&!M.isDirectory&&n(T)},title:M.isDirectory?l("dirPicker.enter.aria",{name:M.name}):a==="file"?l("dirPicker.pickFile.aria",{name:M.name}):l("dirPicker.fileLocked"),children:[M.isDirectory?c.jsx(ph,{size:14,strokeWidth:2.5,className:"flex-shrink-0 text-[var(--color-text)]"}):c.jsx("span",{className:"w-3.5 h-3.5 flex-shrink-0"}),c.jsx("span",{className:"truncate",children:M.name}),M.isDirectory&&c.jsx(Zo,{size:12,strokeWidth:2.5,className:"ml-auto flex-shrink-0 text-[var(--color-text-muted)]"})]})},M.name)})]})]})}),c.jsxs("div",{className:"flex gap-2 justify-end pt-3 shrink-0",children:[c.jsx("button",{type:"button",className:"nb-btn",onClick:t,children:l("dirPicker.cancel")}),a==="file"?c.jsxs("button",{type:"button",className:"nb-btn nb-btn-primary",onClick:()=>m&&n(m),disabled:!m||b.isLoading||b.isError,title:m??l("dirPicker.useFile.tooltip.empty"),children:[c.jsx(Eu,{size:14,strokeWidth:3}),l("dirPicker.useFile")]}):c.jsxs("button",{type:"button",className:"nb-btn nb-btn-primary",onClick:()=>n(k),disabled:!k||b.isLoading||b.isError,children:[c.jsx(Eu,{size:14,strokeWidth:3}),l("dirPicker.useDir")]})]})]})})}function Af(e){return(e.replace(/\/+$/,"").split("/").pop()??"").replace(/[^a-zA-Z0-9_-]/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function g2({onCancel:e,onCreated:t,dialogMode:n=!1}={}){var q,F,Y,D,K,P;const i=Be(),a=ks(),l=Gt(),{alert:o}=un(),d=e??(()=>a("/projects")),[f,h]=j.useState({name:"",projectDir:"",enableGit:!0,createIfMissing:!0,mergeBranch:"main",maxWorkers:"1",ackTimeoutMin:"5",pipelineMode:"pipeline"}),g=f.pipelineMode==="smartArrange",m=Ye({queryKey:["system-agents"],queryFn:Kb}),y=((q=m.data)==null?void 0:q.agents.worker.model)??"",b=((F=m.data)==null?void 0:F.agents.reviewer.model)??"",k=[...new Set((((Y=m.data)==null?void 0:Y.providers.openai)??[]).flatMap(H=>H.models))],v=Ye({queryKey:["providers"],queryFn:cx}),N=h2(((D=v.data)==null?void 0:D.anthropic)??[]),E=f.workerModel?`${f.workerProviderId??""}::${f.workerModel}`:"",[C,S]=j.useState(!1),_=Ct({mutationFn:H=>J3(H),onSuccess:H=>{l.invalidateQueries({queryKey:["projects"]}),t?t(H.name):a(`/projects/${encodeURIComponent(H.name)}`)},onError:H=>{o({title:i("newProject.error.create.title"),body:H instanceof Error?H.message:String(H)})}}),M=/^[a-zA-Z0-9_-]+$/.test(f.name),T=M&&f.projectDir.trim()!==""&&!_.isPending,R=f.projectDir.trim(),O=Ye({queryKey:["fs-browse-probe",R],queryFn:()=>p2(R),enabled:R.startsWith("/"),staleTime:0,gcTime:0,retry:!1}),$=O.isSuccess&&(((K=O.data)==null?void 0:K.entries.length)??0)>0,I=O.isError||O.isSuccess&&(((P=O.data)==null?void 0:P.entries.length)??0)===0;return c.jsxs("div",{className:n?"w-full h-full min-h-0":"w-full",children:[c.jsxs("div",{className:n?"nb-card flex h-full min-h-0 flex-col overflow-hidden":"nb-card flex flex-col gap-4",children:[c.jsxs("header",{className:n?"flex shrink-0 items-center gap-3 border-b-2 border-dashed border-[var(--color-text)] pb-4":"flex items-center gap-3",children:[c.jsxs("button",{type:"button",onClick:d,className:"nb-btn",style:{padding:"6px 12px"},"aria-label":i("newProject.back.aria"),children:[c.jsx(qN,{size:14,strokeWidth:3}),i("newProject.back")]}),c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold",children:i("newProject.title")})]}),c.jsxs("form",{onSubmit:H=>{H.preventDefault(),T&&_.mutate(f)},className:n?"flex min-h-0 flex-1 flex-col":"flex flex-col gap-4",children:[c.jsxs("div",{className:["grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-4",n?"min-h-0 flex-1 overflow-y-auto overscroll-contain pr-3 pt-4":""].join(" "),children:[c.jsx(Ui,{className:"md:col-span-2",label:i("newProject.field.mode"),hint:i(g?"newProject.field.mode.smartHint":"newProject.field.mode.pipelineHint"),children:c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:["pipeline","smartArrange"].map(H=>{const Q=f.pipelineMode===H;return c.jsxs("button",{type:"button",onClick:()=>h({...f,pipelineMode:H}),"aria-pressed":Q,className:["text-left rounded-xl border-2 p-3 transition-all",Q?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[3px_3px_0_var(--color-text)] font-bold":"bg-[var(--color-bg)] border-[var(--color-border-light)] hover:border-[var(--color-text)]"].join(" "),children:[c.jsx("div",{className:"text-sm font-bold",children:i(H==="pipeline"?"newProject.field.mode.pipeline":"newProject.field.mode.smart")}),c.jsx("div",{className:"text-xs text-[var(--color-text-muted)] mt-0.5",children:i(H==="pipeline"?"newProject.field.mode.pipelineDesc":"newProject.field.mode.smartDesc")})]},H)})})}),g&&c.jsx(Ui,{className:"md:col-span-2",label:i("newProject.field.goal"),hint:i("newProject.field.goal.hint"),children:c.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-sm",style:{minHeight:110,resize:"vertical"},placeholder:i("newProject.field.goal.placeholder"),value:f.goal??"",onChange:H=>h({...f,goal:H.target.value})})}),c.jsx(Ui,{label:"Worker 模型",hint:`默认:${y||"全局默认"}(留空用默认)`,children:c.jsxs("select",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:E,onChange:H=>{const Q=H.target.value;if(!Q)return h({...f,workerModel:void 0,workerProviderId:void 0});const[G,L]=Q.split("::");h({...f,workerModel:L,workerProviderId:G||void 0})},children:[c.jsx("option",{value:"",children:"用全局默认模型"}),N.map(H=>c.jsx("option",{value:`${H.providerId}::${H.model}`,children:H.label},`${H.providerId}::${H.model}`))]})}),g&&c.jsxs(Ui,{label:"OpenAI Agent(监工)模型",hint:`默认:${b||"全局默认"}(留空用默认)`,children:[c.jsx("input",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:f.reviewerModel??"",onChange:H=>h({...f,reviewerModel:H.target.value}),placeholder:b,list:"np-reviewer-models",spellCheck:!1}),c.jsx("datalist",{id:"np-reviewer-models",children:k.map(H=>c.jsx("option",{value:H},H))})]}),c.jsxs(Ui,{label:i("newProject.field.name"),hint:i("newProject.field.name.derived"),children:[c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:i("newProject.field.name.placeholder"),value:f.name,onChange:H=>h({...f,name:H.target.value}),required:!0}),f.name&&!M&&c.jsx("p",{className:"text-xs text-[var(--color-crashed)] mt-1",children:i("newProject.field.name.invalid")})]}),c.jsxs(Ui,{className:"md:col-span-2",label:i("newProject.field.dir"),hint:i("newProject.field.dir.long"),children:[c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{type:"text",className:"nb-input flex-1 font-[family-name:var(--font-mono)]",placeholder:i("newProject.field.dir.placeholder"),value:f.projectDir,onChange:H=>{const Q=H.target.value,G=Af(Q),L=Af(f.projectDir),z=f.name&&f.name!==L;h({...f,projectDir:Q,name:z?f.name:G})},required:!0}),c.jsxs("button",{type:"button",className:"nb-btn flex-shrink-0",onClick:()=>S(!0),"aria-label":i("newProject.dir.browseAria"),title:i("newProject.dir.browseAria"),children:[c.jsx(VN,{size:14,strokeWidth:2.5}),i("newProject.dir.browse")]})]}),$&&c.jsx("p",{className:"text-xs mt-1.5 font-bold text-[var(--color-text)]",children:i("newProject.field.dir.adopt")}),I&&R.startsWith("/")&&c.jsx("p",{className:"text-xs mt-1.5 text-[var(--color-text-muted)]",children:i("newProject.field.dir.fresh")}),c.jsxs("label",{className:"flex items-center gap-2 mt-2 cursor-pointer select-none",children:[c.jsx("input",{type:"checkbox",checked:f.createIfMissing!==!1,onChange:H=>h({...f,createIfMissing:H.target.checked}),className:"w-4 h-4 cursor-pointer"}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:i("newProject.field.dir.createIfMissing")})]})]}),c.jsx(Ui,{label:i("newProject.field.maxWorkers.short"),children:c.jsx("input",{type:"number",min:"1",max:"8",className:"nb-input w-full font-[family-name:var(--font-mono)]",value:f.maxWorkers,onChange:H=>h({...f,maxWorkers:H.target.value})})}),c.jsx(Ui,{label:i("newProject.field.ackTimeout.minutes"),hint:i("newProject.field.ackTimeout.minutes.help"),children:c.jsx("input",{type:"number",min:"1",max:"30",className:"nb-input w-full font-[family-name:var(--font-mono)]",value:f.ackTimeoutMin??"5",onChange:H=>h({...f,ackTimeoutMin:H.target.value})})}),c.jsxs("div",{className:"md:col-span-2 pt-3 border-t-2 border-[var(--color-text)] border-dashed",children:[c.jsxs("label",{className:"flex items-center gap-3 mb-2 cursor-pointer select-none",children:[c.jsx("input",{type:"checkbox",checked:f.enableReview??!1,onChange:H=>h({...f,enableReview:H.target.checked}),className:"w-4 h-4 cursor-pointer"}),c.jsx("span",{className:"text-sm font-bold",children:i("newProject.field.review.label")})]}),c.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:i("newProject.field.review.detail")})]}),c.jsxs("div",{className:"md:col-span-2 pt-3 border-t-2 border-[var(--color-text)] border-dashed",children:[c.jsxs("label",{className:"flex items-center gap-3 mb-3 cursor-pointer select-none",children:[c.jsx("input",{type:"checkbox",checked:f.enableGit??!0,onChange:H=>h({...f,enableGit:H.target.checked}),className:"w-4 h-4 cursor-pointer"}),c.jsx("span",{className:"text-sm font-bold",children:i("newProject.field.git.label")})]}),c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] mb-3",children:i("newProject.field.git.detail")}),f.enableGit!==!1&&c.jsxs("div",{className:"flex flex-col gap-4 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4",children:[c.jsx(Ui,{label:i("newProject.field.git.branch"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",value:f.mergeBranch??"main",onChange:H=>h({...f,mergeBranch:H.target.value})})}),c.jsx(Ui,{label:i("newProject.field.gitlabProject.label"),hint:i("newProject.field.gitlabProject.help2"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:i("newProject.field.gitlabProject.placeholder"),value:f.gitlabProject??"",onChange:H=>h({...f,gitlabProject:H.target.value})})}),f.gitlabProject&&c.jsx(Ui,{label:i("newProject.field.gitlabProjectId"),hint:i("newProject.field.gitlabProjectId.help"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:i("newProject.field.gitlabProjectId.placeholder"),value:f.gitlabProjectId??"",onChange:H=>h({...f,gitlabProjectId:H.target.value})})})]})]}),c.jsxs("div",{className:"md:col-span-2 pt-3 border-t-2 border-[var(--color-text)] border-dashed",children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider mb-3 text-[var(--color-text-muted)]",children:i("newProject.section.notifications")}),c.jsx(Ui,{label:i("newProject.field.matrixRoom.label"),hint:i("newProject.field.matrixRoom.help2"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:i("newProject.field.matrixRoom.placeholder"),value:f.matrixRoomId??"",onChange:H=>h({...f,matrixRoomId:H.target.value})})})]})]}),c.jsxs("div",{className:n?"flex shrink-0 gap-3 justify-end border-t-2 border-dashed border-[var(--color-text)] pt-4 mt-4":"flex gap-3 justify-end pt-3",children:[c.jsx("button",{type:"button",className:"nb-btn",onClick:d,disabled:_.isPending,children:i("common.cancel")}),c.jsx("button",{type:"submit",className:"nb-btn nb-btn-primary",disabled:!T,"aria-label":i("newProject.submit"),children:_.isPending?c.jsxs(c.Fragment,{children:[c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}),i("newProject.creating")]}):c.jsxs(c.Fragment,{children:[c.jsx(pi,{size:14,strokeWidth:3}),i("common.create")]})})]})]})]}),C&&c.jsx(ux,{title:i("newProject.field.dir.pickerTitle"),initialPath:f.projectDir.trim()||void 0,onCancel:()=>S(!1),onSelect:H=>{const Q=Af(H),G=Af(f.projectDir),L=f.name&&f.name!==G;h({...f,projectDir:H,name:L?f.name:Q}),S(!1)}})]})}function Ui({label:e,hint:t,children:n,className:i}){return c.jsxs("label",{className:`flex flex-col gap-1.5 ${i??""}`,children:[c.jsx("span",{className:"text-sm font-bold",children:e}),n,t&&c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:t})]})}function y4({onClose:e,onCreated:t}){return c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/30 p-4 overflow-hidden",children:c.jsx("div",{className:"w-full max-w-6xl h-[calc(100vh-2rem)] min-h-0",children:c.jsx(g2,{dialogMode:!0,onCancel:e,onCreated:n=>{e(),t(n)}})})})}const jk="projects.last",b4=["activity","date","name"];function Ck(){const e=Be(),t=ks(),{name:n}=Db(),[i,a]=Gb("projects.sort","activity"),[l,o]=j.useState(!1),[d,f]=j.useState(!1),{data:h,isLoading:g,isError:m,error:y,refetch:b}=Ye({queryKey:["projects"],queryFn:Es}),k=M=>t(`/projects/${encodeURIComponent(M)}`),v=h?h_(h.data,i):[],N=i!=="name",{recent:E,older:C}=N?mI(v,M=>M.lastActivityAt):{recent:v,older:[]},S=l?C:C.filter(M=>M.name===n),_=C.length-S.length;return j.useEffect(()=>{if(n)try{localStorage.setItem(jk,n)}catch{}},[n]),j.useEffect(()=>{if(n||!h)return;let M=null;try{M=localStorage.getItem(jk)}catch{}M&&h.data.some(T=>T.name===M)&&t(`/projects/${encodeURIComponent(M)}`,{replace:!0})},[n,h,t]),c.jsxs("div",{className:"flex flex-col flex-1 min-h-0 w-full",children:[m?c.jsxs("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-2",children:e("projects.load.failed")}),c.jsx("p",{className:"text-sm text-[var(--color-text)]",children:y instanceof Error?y.message:String(y)}),c.jsx("button",{className:"nb-btn mt-4",onClick:()=>b(),type:"button",children:e("common.retry")})]}):h&&h.data.length===0?c.jsx(k4,{onNew:()=>f(!0)}):c.jsxs("div",{className:"flex gap-5 flex-1 min-h-0",children:[c.jsxs("aside",{className:"w-80 shrink-0 flex flex-col min-h-0",children:[c.jsxs("div",{className:"shrink-0 flex flex-col gap-2 pb-3",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold truncate",children:e("projects.title")}),c.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:h?e("projects.count",{count:h.data.length}):e("common.loading")})]}),c.jsxs("button",{className:"nb-btn nb-btn-primary shrink-0",type:"button",onClick:()=>f(!0),"aria-label":e("projects.new"),children:[c.jsx(pi,{size:16,strokeWidth:3}),e("projects.new")]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"inline-flex flex-1 rounded-full overflow-hidden bg-color-bg-soft",role:"group","aria-label":e("projects.sort.label"),children:b4.map(M=>c.jsx("button",{type:"button","aria-pressed":i===M,onClick:()=>a(M),className:["flex-1 px-2 py-1.5 text-xs font-bold font-[family-name:var(--font-mono)] focus-visible:outline focus-visible:outline-2",i===M?"bg-surface-input text-[var(--color-text)]":"bg-transparent text-[var(--color-text-muted)] hover:bg-[rgba(255,255,255,0.08)]"].join(" "),children:e(`projects.sort.${M}`)},M))}),c.jsx("button",{className:"nb-btn nb-btn-yellow shrink-0",style:{padding:"6px 10px"},onClick:()=>b(),type:"button","aria-label":e("common.refresh"),children:c.jsx($h,{size:16,strokeWidth:2.5})})]})]}),c.jsx("ul",{className:"flex-1 min-h-0 overflow-y-auto flex flex-col gap-0.5 pr-1",children:g?c.jsx(w4,{}):c.jsxs(c.Fragment,{children:[[...E,...S].map(M=>c.jsx(x4,{project:M,selected:M.name===n,onClick:()=>k(M.name)},M.name)),(_>0||l&&C.length>0)&&c.jsx("button",{type:"button",className:"nb-btn text-xs self-start mt-1",onClick:()=>o(M=>!M),"aria-label":l?"收起更早项目":"显示更早项目",children:l?"收起更早":`含更早 (${_})`})]})})]}),c.jsx("div",{className:"flex-1 min-w-0 min-h-0 flex flex-col",children:n?c.jsx(o4,{name:n,embedded:!0}):c.jsx("div",{className:"nb-card",children:c.jsx("p",{className:"text-[var(--color-text-muted)]",children:e("projects.selectHint")})})})]}),d&&c.jsx(y4,{onClose:()=>f(!1),onCreated:k})]})}function x4({project:e,selected:t,onClick:n}){return c.jsx("li",{children:c.jsxs("button",{type:"button",onClick:n,className:["dimension-menu-item w-full text-left flex-col items-stretch gap-1 px-3 py-2 pl-4",t?"dimension-menu-item-active":""].join(" "),children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] font-bold truncate",children:e.name}),c.jsx(v4,{status:e.pipelineStatus})]}),e.repoDir&&c.jsx("p",{className:"text-[10px] font-[family-name:var(--font-mono)] text-[var(--color-text-muted)] truncate mt-0.5",children:e.repoDir}),c.jsxs("div",{className:"flex gap-3 text-[11px] font-[family-name:var(--font-mono)] text-[var(--color-text-muted)] mt-1.5",children:[c.jsxs("span",{children:[e.cards.total," cards"]}),c.jsxs("span",{children:[e.cards.inprogress," run"]}),c.jsxs("span",{children:[e.workers.active,"/",e.workers.total," w"]})]})]})})}function v4({status:e}){const t={running:{bg:"var(--color-running-bg)",label:"running"},idle:{bg:"var(--color-idle-bg)",label:"idle"},stopping:{bg:"var(--color-stuck-bg)",label:"stopping"},error:{bg:"var(--color-crashed-bg)",label:"error"}},{bg:n,label:i}=t[e],a=e==="running"?"var(--color-running)":e==="error"?"var(--color-crashed)":e==="stopping"?"var(--color-stuck)":"var(--color-idle)";return c.jsx("span",{className:"nb-status",style:{background:n,color:a},children:i})}function w4(){return c.jsx(c.Fragment,{children:[0,1,2].map(e=>c.jsxs("div",{className:"nb-card opacity-60 animate-pulse",style:{padding:"10px 12px"},children:[c.jsx("div",{className:"h-5 w-28 bg-[var(--color-border-light)] rounded-md mb-2"}),c.jsx("div",{className:"h-3 w-2/3 bg-[var(--color-border-light)] rounded-md"})]},e))})}function k4({onNew:e}){const t=Be(),n=t("projects.empty.hint",{cmd:"__CMD__"}),[i,a]=n.split("__CMD__");return c.jsxs("div",{className:"nb-card bg-[var(--color-accent-yellow)] flex items-center gap-6 p-8",children:[c.jsx("div",{className:"w-20 h-20 rounded-3xl bg-[rgba(255,255,255,0.12)] text-[var(--color-text)] flex items-center justify-center shadow-[rgba(255,255,255,0.10)_0_0_0_1px_inset]",children:c.jsx(r_,{size:32,strokeWidth:2.5})}),c.jsxs("div",{className:"flex-1",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold mb-2",children:t("projects.empty.title")}),c.jsxs("p",{className:"text-sm text-[var(--color-text)] mb-4",children:[i,c.jsx("code",{className:"bg-[rgba(0,0,0,0.35)] px-2 py-0.5 rounded-md font-[family-name:var(--font-mono)]",children:"sps project init <name>"}),a]}),c.jsxs("button",{className:"nb-btn nb-btn-primary",type:"button",onClick:e,children:[c.jsx(pi,{size:16,strokeWidth:3}),t("projects.new")]})]})]})}function E4({project:e,isPending:t,onCancel:n,onCreate:i}){var S;const a=Be(),[l,o]=j.useState(""),[d,f]=j.useState(""),[h,g]=j.useState(new Set),[m,y]=j.useState(!1),b=Ye({queryKey:["skills-all",e],queryFn:()=>ox(e)});j.useEffect(()=>{const _=M=>{M.key==="Escape"&&n()};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[n]);const v=l.trim().length>0&&l.trim().length<=200&&!t,N=_=>{const M=new Set(h);M.has(_)?M.delete(_):M.add(_),g(M)},E=()=>{v&&i({title:l.trim(),description:d.trim(),skills:[...h],labels:["AI-PIPELINE"],initialState:m?"Backlog":"Planning"})},C=((S=b.data)==null?void 0:S.data)??[];return c.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-40 flex items-center justify-center p-4 md:p-6 bg-black/30 overflow-hidden",children:c.jsxs("div",{className:"nb-card w-full max-w-5xl flex flex-col",style:{maxHeight:"calc(100vh - 48px)"},children:[c.jsxs("header",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold",children:a("newCard.title")}),c.jsx("button",{className:"nb-btn nb-btn-mint p-2",onClick:n,type:"button","aria-label":a("common.close"),children:c.jsx(bn,{size:14,strokeWidth:3})})]}),c.jsx("form",{onSubmit:_=>{_.preventDefault(),E()},className:"flex min-h-0 flex-1 flex-col",children:c.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-1 gap-4 overflow-y-auto pr-1 md:grid-cols-[minmax(0,1fr)_minmax(280px,380px)] md:overflow-hidden md:pr-0",children:[c.jsxs("div",{className:"flex min-h-0 flex-col gap-4 md:overflow-y-auto md:pr-1",children:[c.jsxs("label",{className:"flex flex-col gap-1.5",children:[c.jsx("span",{className:"text-sm font-bold",children:a("newCard.field.title")}),c.jsx("input",{type:"text",className:"nb-input w-full",placeholder:a("newCard.field.title.placeholder"),value:l,onChange:_=>o(_.target.value),maxLength:200,autoFocus:!0,required:!0}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:a("newCard.field.title.help")})]}),c.jsxs("label",{className:"flex flex-col gap-1.5",children:[c.jsx("span",{className:"text-sm font-bold",children:a("newCard.field.description")}),c.jsx("textarea",{className:"nb-input w-full",style:{minHeight:160,resize:"vertical"},placeholder:a("newCard.field.description.placeholder"),value:d,onChange:_=>f(_.target.value)}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:a("newCard.field.description.help")})]}),c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("span",{className:"text-sm font-bold",children:a("newCard.field.dispatch")}),c.jsxs("label",{className:"flex items-center gap-3 cursor-pointer select-none p-3 border-[2px] border-[var(--color-text)] rounded-lg bg-[var(--color-bg-cream)]",children:[c.jsx("input",{type:"checkbox",className:"w-4 h-4 accent-[var(--color-cta)] cursor-pointer",checked:m,onChange:_=>y(_.target.checked)}),c.jsxs("div",{className:"flex-1",children:[c.jsx("div",{className:"text-sm font-bold",children:a("newCard.field.dispatch.label")}),c.jsx("div",{className:"text-xs text-[var(--color-text-muted)] mt-0.5",children:a("newCard.field.dispatch.help")})]})]})]})]}),c.jsxs("section",{className:"flex min-h-[240px] flex-col gap-2 md:min-h-0 md:overflow-hidden",children:[c.jsx("span",{className:"text-sm font-bold",children:a("newCard.field.skills")}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:a("newCard.field.skills.help")}),c.jsx("div",{className:"scroll-frame min-h-0 flex-1 rounded-lg border-2 border-[var(--color-border-light)] bg-[var(--color-bg-cream)]",children:c.jsxs("div",{className:"scroll-frame-body h-full p-2",children:[b.isLoading&&c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:a("newCard.field.skills.loading")}),b.isError&&c.jsx("p",{className:"text-xs text-[var(--color-crashed)]",children:a("newCard.field.skills.error",{detail:b.error instanceof Error?b.error.message:String(b.error)})}),C.length>0&&c.jsx("div",{className:"flex flex-wrap gap-2",children:C.map(_=>{const M=h.has(_.name);return c.jsx("button",{type:"button",onClick:()=>N(_.name),className:["max-w-full break-all px-2.5 py-1 text-left text-xs font-[family-name:var(--font-mono)] rounded-full border-2 transition-all",M?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)] font-bold":"bg-[var(--color-bg)] border-[var(--color-border-light)] hover:border-[var(--color-text)]"].join(" "),"aria-pressed":M,children:_.name},_.name)})})]})}),h.size>0&&c.jsx("p",{className:"max-h-14 overflow-y-auto break-words text-xs text-[var(--color-text-muted)]",children:a("newCard.field.skills.selected",{count:h.size,names:[...h].join(", ")})})]})]})}),c.jsxs("div",{className:"flex gap-2 justify-end mt-4 pt-3 border-t-2 border-dashed border-[var(--color-text)] flex-shrink-0",children:[c.jsx("button",{className:"nb-btn",style:{padding:"6px 14px"},onClick:n,disabled:t,type:"button",children:a("common.cancel")}),c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 14px"},onClick:E,disabled:!v,type:"button","aria-label":a("newCard.create.aria"),children:[t?c.jsx(Xe,{size:13,strokeWidth:3,className:"animate-spin"}):c.jsx(pi,{size:13,strokeWidth:3}),a("common.create")]})]})]})})}function S4(e){return ft(`/api/projects/${encodeURIComponent(e)}/cards`)}function N4(e,t){return ft(`/api/projects/${encodeURIComponent(e)}/cards/${t}`)}async function ac(e,t){const n=await fetch(e,{method:"POST",headers:t?{"Content-Type":"application/json"}:void 0,body:t?JSON.stringify(t):void 0});if(!n.ok){const i=await n.text();throw new Error(`${n.status} ${n.statusText}: ${i}`)}return n.json().catch(()=>({}))}function _4(e,t){return ac(`/api/projects/${encodeURIComponent(e)}/cards/${t}/reset`)}async function j4(e,t){const n=await fetch(`/api/projects/${encodeURIComponent(e)}/cards/${t}`,{method:"DELETE"});if(!n.ok){const i=await n.text();throw new Error(`${n.status}: ${i}`)}}function C4(e,t){return ac(`/api/projects/${encodeURIComponent(e)}/cards/${t}/launch`)}function A4(e,t){const n=typeof t=="string"?{title:t}:t;return ac(`/api/projects/${encodeURIComponent(e)}/cards`,n)}async function T4(e,t,n){const i=await fetch(`/api/projects/${encodeURIComponent(e)}/cards/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({state:n})});if(!i.ok){const a=await i.text();throw new Error(`${i.status}: ${a}`)}}async function M4(e,t,n){const i=await fetch(`/api/projects/${encodeURIComponent(e)}/cards/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!i.ok){const a=await i.text();throw new Error(`${i.status}: ${a}`)}return i.json()}function y2(e){return ac(`/api/projects/${encodeURIComponent(e)}/pipeline/start`)}function b2(e){return ac(`/api/projects/${encodeURIComponent(e)}/pipeline/stop`)}function D4(e,t){return ac(`/api/projects/${encodeURIComponent(e)}/pipeline/reset`,t??{})}function O4(e){const t=Gt();j.useEffect(()=>{if(!e)return;const n=`/stream/projects/${encodeURIComponent(e)}`,i=new EventSource(n),a=d=>{try{const f=JSON.parse(d.data);t.invalidateQueries({queryKey:["cards",f.project]}),t.invalidateQueries({queryKey:["card",f.project,f.seq]}),t.invalidateQueries({queryKey:["projects"]})}catch{}},l=d=>{try{const f=JSON.parse(d.data);t.invalidateQueries({queryKey:["workers",f.project]}),t.invalidateQueries({queryKey:["projects"]})}catch{}},o=d=>{try{const f=JSON.parse(d.data);t.invalidateQueries({queryKey:["pipeline-status",f.project]}),t.invalidateQueries({queryKey:["projects"]})}catch{}};return i.addEventListener("card.created",a),i.addEventListener("card.updated",a),i.addEventListener("card.moved",a),i.addEventListener("card.deleted",a),i.addEventListener("worker.updated",l),i.addEventListener("worker.added",l),i.addEventListener("worker.deleted",l),i.addEventListener("pipeline.status",o),i.addEventListener("pipeline.started",o),i.addEventListener("pipeline.stopped",o),()=>i.close()},[e,t])}const R4=new Set(["python","typescript","golang","rust","kotlin","swift","java"]),L4=new Set(["frontend","backend","mobile","database","devops"]),I4=new Set(["backend-architect","frontend-developer","code-reviewer","database-optimizer","devops-automator","security-engineer","qa-tester","security","qa","architect","db-opt"]),z4=new Set(["coding-standards","tdd-workflow","git-workflow","architecture-decision-records","debugging-workflow"]);function P4(e){return R4.has(e)?"lang":L4.has(e)?"end":I4.has(e)?"persona":z4.has(e)?"workflow":"other"}const B4={lang:"var(--skill-badge-lang-bg, var(--color-accent-purple))",end:"var(--skill-badge-end-bg, var(--color-secondary))",persona:"var(--skill-badge-persona-bg, var(--color-primary))",workflow:"var(--skill-badge-workflow-bg, var(--color-accent-mint))",other:"var(--skill-badge-other-bg, var(--color-bg))"};function dx({name:e}){const t=B4[P4(e)];return c.jsx("span",{className:"nb-badge",style:{background:t},children:e})}function x2({label:e,kind:t="default"}){const n=t==="warn"?"var(--color-accent-pink)":t==="accent"?"var(--color-accent-yellow)":"var(--color-bg-cream)";return c.jsx("span",{className:"nb-badge",style:{background:n},children:e})}function $4({card:e,onClick:t,done:n,draggable:i}){const a=Be(),l=e.labels.some(o=>o.startsWith("STARTED-"))&&!n;return c.jsxs("article",{onClick:t,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),t())},draggable:i,onDragStart:o=>{o.dataTransfer.setData("application/x-sps-card-seq",String(e.seq)),o.dataTransfer.effectAllowed="move"},tabIndex:0,role:"button","aria-label":`Card #${e.seq}: ${e.title}`,className:["nb-card nb-card-interactive p-3 cursor-pointer","transition-[transform,background-color,border-color] duration-[180ms] ease-out","focus:outline-none focus-visible:ring-[3px] focus-visible:ring-offset-2 focus-visible:ring-[var(--color-text)]",n?"opacity-60":"",i?"active:cursor-grabbing":""].join(" "),children:[c.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[c.jsxs("span",{className:"nb-badge font-[family-name:var(--font-mono)] text-[11px] px-2 py-0.5",children:["#",e.seq]}),l&&c.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:"running"})]}),c.jsx("p",{className:`font-bold text-sm leading-5 mb-2 line-clamp-2 ${n?"line-through decoration-2":""}`,children:e.title}),(e.skills.length>0||e.labels.length>0)&&c.jsxs("div",{className:"flex flex-wrap gap-1 mb-2",children:[e.skills.slice(0,3).map(o=>c.jsx(dx,{name:o},o)),e.labels.filter(o=>o==="NEEDS-FIX").map(o=>c.jsx(x2,{label:o,kind:"warn"},o))]}),e.checklist&&e.checklist.total>0&&c.jsx(U4,{stats:e.checklist}),c.jsxs("div",{className:"pt-2 border-t-[1.5px] border-dashed border-[var(--color-border-light)] flex items-center gap-2 text-[11px] font-[family-name:var(--font-mono)] text-[var(--color-text-subtle)]",children:[c.jsx("span",{children:F4(e.updatedAt??e.createdAt,a)}),e.branch&&c.jsxs("span",{className:"truncate",children:["· ",e.branch]})]})]})}function U4({stats:e}){const t=Be();return c.jsxs("div",{className:"mb-2",children:[c.jsxs("div",{className:"flex items-center justify-between text-[11px] font-[family-name:var(--font-mono)] mb-1",children:[c.jsx("span",{className:"font-bold",children:t("kanban.checklist.label",{done:e.done,total:e.total})}),c.jsxs("span",{className:"text-[var(--color-text-subtle)]",children:[e.percent,"%"]})]}),c.jsx("div",{className:"w-full h-1.5 bg-[rgba(255,255,255,0.08)] rounded-full overflow-hidden mb-1.5",children:c.jsx("div",{className:"h-full bg-[var(--color-snow-white)] transition-[width] duration-200",style:{width:`${e.percent}%`}})}),c.jsxs("ul",{className:"text-[11px] space-y-0.5",children:[e.items.slice(0,3).map((n,i)=>c.jsxs("li",{className:`flex items-start gap-1 ${n.done?"opacity-60 line-through":""}`,children:[c.jsx("span",{className:"flex-shrink-0 mt-0.5",children:n.done?"✓":"○"}),c.jsx("span",{className:"line-clamp-1",children:n.text})]},i)),e.items.length>3&&c.jsx("li",{className:"text-[var(--color-text-subtle)] italic pl-3",children:t("kanban.checklist.more",{count:e.items.length-3})})]})]})}function F4(e,t){if(!e)return"—";const n=new Date(e),i=Date.now()-n.getTime();return i<6e4?t("kanban.time.justNow"):i<36e5?t("kanban.time.minutes",{n:Math.floor(i/6e4)}):i<864e5?t("kanban.time.hours",{n:Math.floor(i/36e5)}):n.toLocaleDateString()}function q4({label:e,bg:t,badgeVars:n,cards:i,onCardClick:a,onDropCard:l}){const o=Be(),[d,f]=j.useState(!1);return c.jsxs("div",{className:["nb-card flex flex-col p-3 min-h-[280px] h-full min-h-0 overflow-hidden","transition-all",d?"bg-[rgba(255,255,255,0.16)]":""].join(" "),style:{background:t,...n},onDragOver:h=>{!l||!h.dataTransfer.types.includes("application/x-sps-card-seq")||(h.preventDefault(),h.dataTransfer.dropEffect="move",d||f(!0))},onDragLeave:()=>f(!1),onDrop:h=>{if(f(!1),!l)return;const g=h.dataTransfer.getData("application/x-sps-card-seq"),m=Number.parseInt(g,10);Number.isFinite(m)&&(h.preventDefault(),l(m))},children:[c.jsxs("div",{className:"flex items-center justify-between px-1 pb-2 mb-2 border-b border-[var(--color-border-light)] shrink-0",children:[c.jsx("span",{className:"font-[family-name:var(--font-heading)] font-bold text-sm uppercase tracking-wider",children:e}),c.jsx("span",{className:"nb-badge font-[family-name:var(--font-mono)] text-xs px-2 py-0.5",children:i.length})]}),c.jsxs("div",{className:"flex flex-col gap-2 flex-1 min-h-0 overflow-y-auto pr-1 -mr-1",style:{scrollbarWidth:"thin",scrollbarColor:"rgba(229,229,229,0.36) transparent"},children:[i.length===0&&c.jsx("div",{className:"text-xs text-[var(--color-text-muted)] text-center py-6 italic",children:o("kanban.column.empty")}),i.map(h=>c.jsx($4,{card:h,onClick:()=>a(h),done:e==="Done",draggable:!!l},h.seq))]})]})}function Wy(e,t){if(!e)return"";const n=e.split(`
613
+ `),i=new RegExp(`^##\\s+${t}\\s*$`),a=n.findIndex(o=>i.test(o));if(a===-1)return"";let l=n.length;for(let o=a+1;o<n.length;o++)if(/^##\s+/.test(n[o]??"")){l=o;break}return n.slice(a+1,l).join(`
614
+ `).trim()}function $g(e){return Wy(e,"描述")}function H4({project:e,seq:t,onClose:n,onChanged:i}){var H,Q,G,L,z,V,B,le,ve,ke,Se;const a=Be(),l=Gt(),{confirm:o,alert:d}=un(),{data:f,isLoading:h,isError:g,error:m,refetch:y}=Ye({queryKey:["card",e,t],queryFn:()=>N4(e,t)}),[b,k]=j.useState(!1),[v,N]=j.useState(""),[E,C]=j.useState(""),[S,_]=j.useState(new Set),[M,T]=j.useState([]),[R,O]=j.useState(""),$=Ye({queryKey:["skills-all",e],queryFn:()=>ox(e),enabled:b}),q=((Q=(H=Ye({queryKey:["projects"],queryFn:Es,refetchInterval:1e4}).data)==null?void 0:H.data.find(J=>J.name===e))==null?void 0:Q.pipelineStatus)==="running";j.useEffect(()=>{b&&f&&(N(f.title),C($g(f.body)),_(new Set(f.skills)),T([...f.labels]))},[b,f]),j.useEffect(()=>{const J=ue=>{ue.key==="Escape"&&(b?k(!1):n())};return window.addEventListener("keydown",J),()=>window.removeEventListener("keydown",J)},[n,b]);const F=Ct({mutationFn:()=>{if(!f)throw new Error("no data");const J={},ue=v.trim();ue&&ue!==f.title&&(J.title=ue);const Te=$g(f.body);E!==Te&&(J.description=E);const Re=[...S].sort(),De=[...f.skills].sort();return JSON.stringify(Re)!==JSON.stringify(De)&&(J.skills=Re),JSON.stringify(M)!==JSON.stringify(f.labels)&&(J.labels=M),Object.keys(J).length===0?Promise.resolve({ok:!0,noop:!0}):M4(e,t,J)},onSuccess:()=>{l.invalidateQueries({queryKey:["card",e,t]}),l.invalidateQueries({queryKey:["cards",e]}),k(!1),i()},onError:J=>{d({title:a("cardModal.error.save.title"),body:J instanceof Error?J.message:String(J)})}}),Y=j.useMemo(()=>{if(!b||!f)return!1;if(v.trim()!==f.title||E!==$g(f.body))return!0;const J=[...S].sort(),ue=[...f.skills].sort();return JSON.stringify(J)!==JSON.stringify(ue)||JSON.stringify(M)!==JSON.stringify(f.labels)},[b,f,v,E,S,M]),D=J=>{const ue=new Set(S);ue.has(J)?ue.delete(J):ue.add(J),_(ue)},K=()=>{const J=R.trim();if(J){if(M.includes(J)){O("");return}T([...M,J]),O("")}},P=J=>{T(M.filter(ue=>ue!==J))};return c.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"card-modal-title",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",children:c.jsxs("div",{className:"nb-card mt-12 w-full max-w-3xl bg-[var(--color-bg)]",children:[c.jsxs("header",{className:"flex items-start justify-between gap-4 mb-4",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[c.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-xs px-2 py-0.5 bg-[var(--color-accent-purple)] border-2 border-[var(--color-text)] rounded-full",children:["#",t]}),(f==null?void 0:f.state)&&c.jsx("span",{className:"font-[family-name:var(--font-mono)] text-xs px-2 py-0.5 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-full font-semibold",children:f.state}),b&&c.jsx("span",{className:"text-xs font-bold text-[var(--color-stuck)]",children:a("cardModal.editing")})]}),b?c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-heading)] text-xl font-bold",value:v,onChange:J=>N(J.target.value),maxLength:200,"aria-label":a("cardModal.title.aria")}):c.jsx("h2",{id:"card-modal-title",className:"font-[family-name:var(--font-heading)] text-2xl font-bold break-words",children:(f==null?void 0:f.title)??a("common.loading")})]}),c.jsxs("div",{className:"flex gap-2 flex-shrink-0",children:[!b&&f&&c.jsxs("button",{onClick:()=>k(!0),className:"nb-btn",style:{padding:"6px 12px"},type:"button","aria-label":a("cardModal.editAria"),children:[c.jsx(qh,{size:12,strokeWidth:2.5})," ",a("cardModal.edit")]}),c.jsx("button",{onClick:n,className:"nb-btn nb-btn-mint p-2","aria-label":a("cardModal.close.aria"),type:"button",children:c.jsx(bn,{size:14,strokeWidth:3})})]})]}),h&&c.jsx("p",{className:"text-[var(--color-text-muted)]",children:a("common.loading")}),g&&c.jsx("p",{className:"text-[var(--color-crashed)]",children:a("cardModal.error.load",{detail:m instanceof Error?m.message:String(m)})}),f&&c.jsxs("div",{className:"flex flex-col gap-4",children:[f.branch&&!b&&c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[c.jsx(hL,{size:14}),c.jsx("span",{className:"font-[family-name:var(--font-mono)]",children:f.branch})]}),b?c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Skills"}),$.isLoading&&c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:a("cardModal.skills.loading")}),$.data&&$.data.data.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1.5",children:$.data.data.map(J=>{const ue=S.has(J.name);return c.jsx("button",{type:"button",onClick:()=>D(J.name),"aria-pressed":ue,className:["px-2.5 py-1 text-xs font-[family-name:var(--font-mono)] rounded-full border-2 transition-all",ue?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)] font-bold":"bg-[var(--color-bg)] border-[var(--color-border-light)] hover:border-[var(--color-text)]"].join(" "),children:J.name},J.name)})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Labels"}),c.jsxs("div",{className:"flex flex-wrap gap-1.5 items-center",children:[M.map(J=>c.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-xs font-[family-name:var(--font-mono)] bg-[var(--color-accent-yellow)] border-2 border-[var(--color-text)] rounded-full",children:[J,c.jsx("button",{type:"button",onClick:()=>P(J),className:"hover:text-[var(--color-crashed)]","aria-label":a("cardModal.label.removeAria",{label:J}),children:c.jsx(bn,{size:10,strokeWidth:3})})]},J)),c.jsx("input",{type:"text",className:"nb-input",style:{padding:"4px 8px",fontSize:12,width:140},placeholder:a("cardModal.label.addPlaceholder"),value:R,onChange:J=>O(J.target.value),onKeyDown:J=>{J.key==="Enter"&&!J.nativeEvent.isComposing&&(J.preventDefault(),K())}}),R&&c.jsx("button",{type:"button",className:"nb-btn",style:{padding:"2px 6px",fontSize:11},onClick:K,"aria-label":a("cardModal.label.addAria"),children:c.jsx(pi,{size:10,strokeWidth:3})})]}),c.jsx("p",{className:"text-[10px] text-[var(--color-text-muted)] mt-1",children:a("cardModal.label.note")})]})]}):c.jsxs(c.Fragment,{children:[f.skills.length>0&&c.jsxs("div",{children:[c.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Skills"}),c.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:f.skills.map(J=>c.jsx(dx,{name:J},J))})]}),f.labels.length>0&&c.jsxs("div",{children:[c.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Labels"}),c.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:f.labels.map(J=>c.jsx(x2,{label:J,kind:J==="NEEDS-FIX"?"warn":"default"},J))})]})]}),b?c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:a("cardModal.section.description")}),c.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",style:{minHeight:180,resize:"vertical"},value:E,onChange:J=>C(J.target.value),"aria-label":a("cardModal.body.aria")}),c.jsx("p",{className:"text-[10px] text-[var(--color-text-muted)] mt-1",children:a("cardModal.body.replaceNote")})]}),(((le=f.checklist)==null?void 0:le.total)??0)>0&&c.jsxs("div",{className:"nb-card bg-[var(--color-bg-cream)] p-3",children:[c.jsx("div",{className:"flex items-center justify-between mb-2",children:c.jsxs("span",{className:"font-bold text-sm",children:[a("cardModal.section.checklist")," ",((ve=f.checklist)==null?void 0:ve.done)??0,"/",((ke=f.checklist)==null?void 0:ke.total)??0]})}),c.jsx("ul",{className:"text-sm space-y-1",children:(((Se=f.checklist)==null?void 0:Se.items)??[]).map((J,ue)=>c.jsxs("li",{className:`flex items-start gap-2 ${J.done?"opacity-60 line-through":""}`,children:[c.jsx("span",{children:J.done?"✓":"○"}),c.jsx("span",{children:J.text})]},ue))})]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:a("cardModal.section.description")}),c.jsx("pre",{className:"text-xs whitespace-pre-wrap font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4 max-h-64 overflow-auto",children:Wy(f.body,"描述")||a("cardModal.section.empty")})]}),c.jsxs("div",{children:[c.jsxs("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:[a("cardModal.section.checklist")," ",c.jsxs("span",{className:"text-[var(--color-text-muted)] normal-case tracking-normal",children:[((G=f.checklist)==null?void 0:G.done)??0,"/",((L=f.checklist)==null?void 0:L.total)??0]})]}),c.jsx("div",{className:"nb-card bg-[var(--color-bg-cream)] p-3",children:(((z=f.checklist)==null?void 0:z.total)??0)>0?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"flex items-center justify-end mb-2",children:c.jsx("div",{className:"w-24 h-2 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-full overflow-hidden",children:c.jsx("div",{className:"h-full bg-[var(--color-cta)]",style:{width:`${((V=f.checklist)==null?void 0:V.percent)??0}%`}})})}),c.jsx("ul",{className:"text-sm space-y-1",children:(((B=f.checklist)==null?void 0:B.items)??[]).map((J,ue)=>c.jsxs("li",{className:`flex items-start gap-2 ${J.done?"opacity-60 line-through":""}`,children:[c.jsx("span",{children:J.done?"✓":"○"}),c.jsx("span",{children:J.text})]},ue))})]}):c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:a("cardModal.checklist.empty")})})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:a("cardModal.section.log")}),c.jsx("pre",{className:"text-xs whitespace-pre-wrap font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4 max-h-64 overflow-auto",children:Wy(f.body,"日志")||a("cardModal.section.empty")})]})]}),c.jsx("div",{className:"flex gap-2 pt-2 border-t-2 border-[var(--color-border-light)] justify-end flex-wrap",children:b?c.jsxs(c.Fragment,{children:[c.jsx("button",{className:"nb-btn",type:"button",onClick:()=>{k(!1),y()},disabled:F.isPending,children:a("common.cancel")}),c.jsxs("button",{className:"nb-btn nb-btn-primary",type:"button",onClick:()=>F.mutate(),disabled:!Y||!v.trim()||F.isPending,"aria-label":a("cardDetail.save"),children:[F.isPending?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(Rr,{size:14,strokeWidth:3}),a("common.save")]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("button",{className:"nb-btn nb-btn-primary",type:"button",disabled:f.state==="Done"||q,title:f.state==="Done"?a("cardModal.action.launch.disabledDone"):q?a("cardModal.action.launch.disabledRunning"):void 0,onClick:async()=>{try{await C4(e,t),i()}catch(J){d({title:a("cardModal.action.launch.error"),body:J instanceof Error?J.message:String(J)})}},children:[c.jsx(Yu,{size:14,strokeWidth:3}),a("cardModal.action.launch")]}),c.jsxs("button",{className:"nb-btn nb-btn-yellow",type:"button",onClick:async()=>{if(await o({title:a("cardModal.action.reset.confirm.title",{seq:t}),body:a("cardModal.action.reset.confirm.body"),confirm:a("cardModal.action.reset.confirm.button"),danger:!0}))try{await _4(e,t),i(),n()}catch(ue){d({title:a("cardModal.action.reset.error"),body:ue instanceof Error?ue.message:String(ue)})}},children:[c.jsx(Bb,{size:14,strokeWidth:2.5}),a("cardModal.action.reset")]}),c.jsxs("button",{className:"nb-btn",style:{background:"var(--color-crashed)",color:"var(--color-bg)"},type:"button",onClick:async()=>{if(!(!await o({title:a("cardModal.action.delete.confirm1.title",{seq:t}),body:a("cardModal.action.delete.confirm1.body",{title:f.title}),confirm:a("cardModal.action.delete.confirm1.button"),danger:!0})||!await o({title:a("cardModal.action.delete.confirm2.title"),body:a("cardModal.action.delete.confirm2.body",{seq:t}),confirm:a("cardModal.action.delete"),danger:!0})))try{await j4(e,t),i(),n()}catch(Te){d({title:a("projectDetail.pipelines.delete.error"),body:Te instanceof Error?Te.message:String(Te)})}},"aria-label":a("cardModal.action.delete"),children:[c.jsx(fr,{size:14,strokeWidth:2.5}),a("cardModal.action.delete")]})]})})]})]})})}function K4({current:e,onChange:t}){const[n,i]=j.useState(!1),a=j.useRef(null),{data:l}=Ye({queryKey:["projects"],queryFn:Es});return j.useEffect(()=>{const o=d=>{var f;(f=a.current)!=null&&f.contains(d.target)||i(!1)};return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[]),c.jsxs("div",{className:"relative",ref:a,children:[c.jsxs("button",{type:"button",className:"nb-btn font-[family-name:var(--font-mono)] text-sm",onClick:()=>i(o=>!o),children:[e,c.jsx(Vu,{size:14,strokeWidth:2.5})]}),n&&l&&c.jsx("div",{className:"absolute right-0 mt-2 z-20 min-w-[200px] nb-card p-1 overflow-hidden",children:c.jsx("div",{className:"max-h-[60vh] overflow-y-auto",children:h_(l.data,"activity").map(o=>{const d=o.pipelineStatus==="running";return c.jsxs("button",{type:"button",onClick:()=>{t(o.name),i(!1)},className:["dimension-menu-item w-full text-left px-4 py-2 text-sm font-semibold flex items-center gap-2",o.name===e?"dimension-menu-item-active":""].join(" "),children:[d&&c.jsx(Yu,{size:12,strokeWidth:3,className:"text-[var(--color-running)] shrink-0","aria-label":"运行中"}),c.jsx("span",{className:"font-[family-name:var(--font-mono)]",children:o.name}),c.jsxs("span",{className:"ml-auto text-xs text-[var(--color-text-muted)]",children:[o.cards.total," cards"]})]},o.name)})})})]})}const G4=[{state:"Planning",labelKey:"board.col.planning",bg:"linear-gradient(180deg, rgba(139, 117, 255, 0.20), rgba(188, 166, 255, 0.075))",badgeVars:{"--skill-badge-lang-bg":"rgba(172, 153, 255, 0.30)","--skill-badge-end-bg":"rgba(151, 133, 239, 0.26)","--skill-badge-persona-bg":"rgba(193, 178, 255, 0.24)","--skill-badge-workflow-bg":"rgba(159, 146, 220, 0.27)","--skill-badge-other-bg":"rgba(126, 107, 206, 0.30)"}},{state:"Backlog",labelKey:"board.col.backlog",bg:"linear-gradient(180deg, rgba(147, 158, 190, 0.14), rgba(188, 166, 255, 0.055))",badgeVars:{"--skill-badge-lang-bg":"rgba(149, 160, 198, 0.24)","--skill-badge-end-bg":"rgba(128, 141, 176, 0.25)","--skill-badge-persona-bg":"rgba(165, 172, 199, 0.22)","--skill-badge-workflow-bg":"rgba(138, 152, 184, 0.26)","--skill-badge-other-bg":"rgba(116, 127, 158, 0.28)"}},{state:"Todo",labelKey:"board.col.todo",bg:"linear-gradient(180deg, rgba(239, 201, 126, 0.18), rgba(188, 166, 255, 0.055))",badgeVars:{"--skill-badge-lang-bg":"rgba(245, 207, 135, 0.28)","--skill-badge-end-bg":"rgba(226, 182, 101, 0.25)","--skill-badge-persona-bg":"rgba(249, 221, 159, 0.23)","--skill-badge-workflow-bg":"rgba(232, 193, 118, 0.27)","--skill-badge-other-bg":"rgba(204, 159, 84, 0.29)"}},{state:"Inprogress",labelKey:"board.col.inprogress",bg:"linear-gradient(180deg, rgba(98, 176, 242, 0.18), rgba(188, 166, 255, 0.065))",badgeVars:{"--skill-badge-lang-bg":"rgba(104, 181, 246, 0.28)","--skill-badge-end-bg":"rgba(79, 153, 223, 0.26)","--skill-badge-persona-bg":"rgba(136, 198, 250, 0.22)","--skill-badge-workflow-bg":"rgba(91, 166, 228, 0.27)","--skill-badge-other-bg":"rgba(67, 128, 197, 0.29)"}},{state:"QA",labelKey:"board.col.qa",bg:"linear-gradient(180deg, rgba(222, 171, 222, 0.18), rgba(188, 166, 255, 0.065))",badgeVars:{"--skill-badge-lang-bg":"rgba(226, 174, 226, 0.28)","--skill-badge-end-bg":"rgba(206, 145, 213, 0.25)","--skill-badge-persona-bg":"rgba(236, 197, 236, 0.22)","--skill-badge-workflow-bg":"rgba(215, 158, 218, 0.27)","--skill-badge-other-bg":"rgba(184, 125, 196, 0.29)"}},{state:"Done",labelKey:"board.col.done",bg:"linear-gradient(180deg, rgba(120, 214, 163, 0.18), rgba(188, 166, 255, 0.055))",badgeVars:{"--skill-badge-lang-bg":"rgba(125, 216, 166, 0.27)","--skill-badge-end-bg":"rgba(93, 190, 139, 0.25)","--skill-badge-persona-bg":"rgba(154, 226, 185, 0.22)","--skill-badge-workflow-bg":"rgba(107, 202, 150, 0.28)","--skill-badge-other-bg":"rgba(75, 166, 120, 0.29)"}}],v2="sps-console:last-board-project";function V4(){if(typeof window>"u")return null;try{return localStorage.getItem(v2)}catch{return null}}function Y4(e){if(!(typeof window>"u"))try{localStorage.setItem(v2,e)}catch{}}function Q4(){var P,H,Q;const e=Be(),[t,n]=UN(),i=t.get("project"),[a,l]=j.useState(null),[o,d]=j.useState(""),[f,h]=j.useState(()=>new Set),[g,m]=j.useState(()=>new Set),{confirm:y,alert:b}=un();O4(i);const k=Ye({queryKey:["projects"],queryFn:Es}),v=Ye({queryKey:["cards",i],queryFn:()=>S4(i??""),enabled:!!i}),N=Gt(),E=()=>{N.invalidateQueries({queryKey:["cards",i]}),N.invalidateQueries({queryKey:["projects"]}),N.invalidateQueries({queryKey:["pipeline-status",i]})},C=G=>{n({project:G})};j.useEffect(()=>{var L;if(i){Y4(i);return}const G=V4();G&&((L=k.data)!=null&&L.data.some(z=>z.name===G))&&n({project:G},{replace:!0})},[i,k.data,n]);const S=Ct({mutationFn:()=>y2(i),onSuccess:()=>{E()},onError:G=>{b({title:e("board.action.startError"),body:G instanceof Error?G.message:String(G)})}}),_=Ct({mutationFn:()=>b2(i),onSuccess:()=>E(),onError:G=>{b({title:e("board.action.stopError"),body:G instanceof Error?G.message:String(G)})}}),M=Ct({mutationFn:()=>D4(i,{all:!0}),onSuccess:()=>E(),onError:G=>{b({title:e("board.action.resetError"),body:G instanceof Error?G.message:String(G)})}}),[T,R]=j.useState(!1),O=Ct({mutationFn:G=>A4(i,G),onSuccess:()=>{E(),R(!1)},onError:G=>{b({title:e("board.action.newCard.error"),body:G instanceof Error?G.message:String(G)})}}),$=Ct({mutationFn:({seq:G,state:L})=>T4(i,G,L),onMutate:async({seq:G,state:L})=>{await N.cancelQueries({queryKey:["cards",i]});const z=N.getQueryData(["cards",i]);return z&&N.setQueryData(["cards",i],{...z,data:z.data.map(V=>V.seq===G?{...V,state:L}:V)}),{prev:z}},onError:(G,L,z)=>{z!=null&&z.prev&&N.setQueryData(["cards",i],z.prev),b({title:e("board.action.moveCard.error"),body:G instanceof Error?G.message:String(G)})},onSettled:()=>{N.invalidateQueries({queryKey:["cards",i]})}}),I=((P=v.data)==null?void 0:P.data)??[],{allSkills:q,allLabels:F}=j.useMemo(()=>{const G=new Set,L=new Set;for(const z of I){for(const V of z.skills)G.add(V);for(const V of z.labels)L.add(V)}return{allSkills:[...G].sort(),allLabels:[...L].sort()}},[I]);if(!i)return c.jsxs("div",{className:"flex flex-col gap-6 w-full",children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold",children:e("board.title.bare")}),c.jsxs("div",{className:"nb-card bg-[var(--color-accent-yellow)] max-w-2xl",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-3",children:e("board.pickPrompt.title")}),c.jsx("p",{className:"text-sm mb-4 text-[var(--color-text-muted)]",children:e("board.pickPrompt.body")}),c.jsx("div",{className:"flex flex-wrap gap-2",children:(H=k.data)==null?void 0:H.data.map(G=>c.jsx("button",{className:"nb-btn nb-btn-blue",onClick:()=>C(G.name),type:"button",children:G.name},G.name))})]})]});const Y=I.filter(G=>{if(o){const L=o.toLowerCase();if(!(G.title.toLowerCase().includes(L)||G.skills.some(V=>V.toLowerCase().includes(L))||G.labels.some(V=>V.toLowerCase().includes(L))))return!1}return!(f.size>0&&!G.skills.some(z=>f.has(z))||g.size>0&&!G.labels.some(z=>g.has(z)))}),D=(Q=k.data)==null?void 0:Q.data.find(G=>G.name===i),K=(D==null?void 0:D.pipelineStatus)==="running";return c.jsxs("div",{className:"flex flex-col gap-4 max-w-full flex-1 min-h-0",children:[c.jsxs("header",{className:"flex items-center justify-between flex-wrap gap-3 shrink-0",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold tracking-tight",children:e("board.title")}),c.jsx("p",{className:"text-[var(--color-text-muted)] text-sm mt-1",children:D?e("board.subtitle",{name:D.name,cards:D.cards.total,workers:D.workers.active}):e("common.loading")})]}),c.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[c.jsx(K4,{current:i,onChange:C}),c.jsxs("button",{className:K?"nb-btn nb-btn-danger":"nb-btn nb-btn-primary",onClick:()=>K?_.mutate():S.mutate(),disabled:S.isPending||_.isPending,type:"button","aria-label":e(K?"board.action.stopAria":"board.action.startAria"),title:e(K?"board.action.stopAria":"board.action.startAria"),children:[S.isPending||_.isPending?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):K?c.jsx(Ub,{size:14,strokeWidth:3}):c.jsx(Yu,{size:14,strokeWidth:3}),e(K?"board.action.stop":"board.action.start")]}),c.jsxs("button",{className:"nb-btn nb-btn-yellow",type:"button",onClick:async()=>{await y({title:e("board.action.reset.confirm.title"),body:e("board.action.reset.confirm.body"),confirm:e("board.action.reset.confirm.button"),danger:!0})&&M.mutate()},disabled:M.isPending,children:[M.isPending?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(Bb,{size:14,strokeWidth:2.5}),e("board.action.reset")]}),c.jsxs("button",{className:"nb-btn nb-btn-mint",type:"button",onClick:()=>R(!0),disabled:O.isPending,children:[O.isPending?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(pi,{size:14,strokeWidth:3}),e("board.action.newCard")]})]})]}),c.jsxs("div",{className:"flex items-center gap-3 flex-wrap shrink-0",children:[c.jsxs("div",{className:"relative flex-1 max-w-md",children:[c.jsx(fl,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-subtle)]"}),c.jsx("input",{className:"nb-input pl-9 w-full",placeholder:e("board.search.placeholder"),value:o,onChange:G=>d(G.target.value),"aria-label":e("board.search.aria")})]}),c.jsx(Ak,{label:"skill",options:q,selected:f,onChange:h}),c.jsx(Ak,{label:"label",options:F,selected:g,onChange:m}),(o||f.size>0||g.size>0)&&c.jsxs("button",{className:"nb-btn",style:{padding:"4px 10px",fontSize:11},onClick:()=>{d(""),h(new Set),m(new Set)},type:"button","aria-label":e("board.filter.clearAria"),children:[c.jsx(bn,{size:11,strokeWidth:3}),e("board.filter.clear")]}),c.jsxs("span",{className:"text-xs text-[var(--color-text-muted)] flex items-center gap-1 font-[family-name:var(--font-mono)]",children:[c.jsx(dL,{size:12}),Y.length," / ",I.length]})]}),v.isError&&c.jsxs("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:[c.jsx("p",{className:"font-semibold",children:e("board.error.loadCards")}),c.jsx("p",{className:"text-sm mt-1 text-[var(--color-text-muted)]",children:v.error instanceof Error?v.error.message:String(v.error)})]}),!v.isError&&c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6 auto-rows-fr gap-3 flex-1 min-h-0",children:G4.map(G=>c.jsx(q4,{label:e(G.labelKey),bg:G.bg,badgeVars:G.badgeVars,cards:Y.filter(W4(G.state)),onCardClick:L=>l(L.seq),onDropCard:L=>$.mutate({seq:L,state:G.state})},G.state))}),a!==null&&c.jsx(H4,{project:i,seq:a,onClose:()=>l(null),onChanged:E}),T&&c.jsx(E4,{project:i,isPending:O.isPending,onCancel:()=>R(!1),onCreate:G=>O.mutate(G)})]})}function W4(e){return t=>e==="QA"?t.state==="QA"||t.state==="Review":e==="Done"?t.state==="Done"||t.state==="Canceled":t.state===e}function Ak({label:e,options:t,selected:n,onChange:i}){const a=Be(),[l,o]=j.useState(!1),d=j.useRef(null);j.useEffect(()=>{if(!l)return;const m=b=>{var k;(k=d.current)!=null&&k.contains(b.target)||o(!1)},y=b=>{b.key==="Escape"&&o(!1)};return window.addEventListener("click",m),window.addEventListener("keydown",y),()=>{window.removeEventListener("click",m),window.removeEventListener("keydown",y)}},[l]);const f=m=>{const y=new Set(n);y.has(m)?y.delete(m):y.add(m),i(y)},h=t.length===0,g=n.size;return c.jsxs("div",{ref:d,className:"relative",children:[c.jsxs("button",{type:"button",className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>!h&&o(m=>!m),disabled:h,"aria-haspopup":"listbox","aria-expanded":l,"aria-label":a("board.filter.aria",{label:e}),children:[e,g>0&&c.jsx("span",{className:"ml-1 px-1.5 py-0.5 text-[10px] font-bold rounded-full bg-[var(--color-primary)] text-[var(--color-text)] border border-[var(--color-text)]",children:g}),c.jsx(Vu,{size:11,strokeWidth:3,className:["transition-transform",l?"rotate-180":""].join(" ")})]}),l&&c.jsx("div",{className:"absolute left-0 top-full mt-2 z-20 min-w-[200px] nb-card p-2 overflow-hidden",style:{padding:8},children:c.jsxs("div",{role:"listbox",className:"max-h-64 overflow-auto",children:[t.map(m=>{const y=n.has(m);return c.jsxs("label",{className:["flex items-center gap-2 px-2 py-1.5 rounded cursor-pointer text-sm font-[family-name:var(--font-mono)]",y?"bg-[var(--color-accent-mint)]":"hover:bg-[var(--color-bg-cream)]"].join(" "),children:[c.jsx("input",{type:"checkbox",checked:y,onChange:()=>f(m),className:"flex-shrink-0"}),c.jsx("span",{className:"truncate",children:m})]},m)}),g>0&&c.jsx("button",{type:"button",className:"w-full mt-2 pt-2 border-t-2 border-dashed border-[var(--color-text)] text-xs font-bold text-[var(--color-crashed)] text-center",onClick:()=>i(new Set),children:a("board.filter.clearSelection")})]})})]})}function X4(){return ft("/api/workers/all")}function Z4(e){return ft(`/api/projects/${encodeURIComponent(e)}/workers`)}function J4(e,t){return ft(`/api/projects/${encodeURIComponent(e)}/workers/${t}`)}async function w2(e,t){const n=await fetch(e,{method:"POST",headers:t?{"Content-Type":"application/json"}:void 0,body:t?JSON.stringify(t):void 0});if(!n.ok)throw new Error(`${n.status}: ${await n.text()}`);return n.json().catch(()=>({}))}function Tk(e,t){return w2(`/api/projects/${encodeURIComponent(e)}/workers/${t}/kill`)}function eP(e,t,n){return w2(`/api/projects/${encodeURIComponent(e)}/workers/${t}/launch`,n?{seq:n}:void 0)}function fx({state:e}){const n={running:{bg:"var(--color-running-bg)",color:"var(--color-running)",label:"running"},starting:{bg:"var(--color-secondary)",color:"var(--color-text)",label:"starting",icon:c.jsx(Xe,{size:9,strokeWidth:3,className:"animate-spin"})},stuck:{bg:"var(--color-stuck-bg)",color:"var(--color-stuck)",label:"stuck"},crashed:{bg:"var(--color-crashed-bg)",color:"var(--color-crashed)",label:"crashed",icon:c.jsx(o3,{size:9,strokeWidth:2.5})},idle:{bg:"var(--color-idle-bg)",color:"var(--color-idle)",label:"idle"}}[e];return c.jsxs("span",{className:"nb-status inline-flex items-center gap-1",style:{background:n.bg,color:n.color},children:[n.icon,n.label]})}function hx(e){if(e==null||e<=0)return"—";const t=Math.floor(e/1e3),n=Math.floor(t/3600),i=Math.floor(t%3600/60),a=t%60;return n>0?`${n}h ${i}m`:i>0?`${i}m ${a}s`:`${a}s`}function tP(e){if(e==null||e<=0)return"text-[var(--color-text-muted)]";const t=e/6e4;return t<10?"text-[var(--color-running)]":t<60?"text-[var(--color-stuck)]":"text-[var(--color-crashed)]"}function px(e){const t=Date.now()-new Date(e).getTime();return t<6e4?`${Math.floor(t/1e3)}s 前`:t<36e5?`${Math.floor(t/6e4)}m 前`:`${Math.floor(t/36e5)}h 前`}function nP({alerts:e,selected:t,onSelect:n}){const i=Be();return e.length===0?c.jsxs("div",{className:"nb-card bg-[var(--color-running-bg)] flex items-center gap-3",children:[c.jsx(Eu,{size:18,strokeWidth:2.5,className:"text-[var(--color-running)]"}),c.jsx("span",{className:"text-sm font-bold text-[var(--color-running)]",children:i("workers.alerts.allHealthy")})]}):c.jsxs("section",{children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider mb-2 flex items-center gap-2 text-[var(--color-crashed)]",children:[c.jsx(w3,{size:14,strokeWidth:2.5}),"Alerts (",e.length,")"]}),c.jsx("div",{className:"flex flex-col gap-2",children:e.map(a=>{const l=(t==null?void 0:t.project)===a.project&&(t==null?void 0:t.slot)===a.slot;return c.jsxs("button",{type:"button",onClick:()=>n(a.project,a.slot),className:["nb-card p-3 text-left",a.state==="crashed"?"bg-[var(--color-crashed-bg)]":"bg-[var(--color-stuck-bg)]",l?"ring-4 ring-[var(--color-text)]":""].join(" "),children:[c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[c.jsx(fx,{state:a.state}),c.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold",children:[a.project,"/worker-",a.slot]}),a.card&&c.jsxs("span",{className:"truncate",children:["#",a.card.seq," ",a.card.title]}),c.jsxs("span",{className:"ml-auto text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] flex items-center gap-1",children:[c.jsx(GN,{size:10,strokeWidth:2.5}),hx(a.runtimeMs)]})]}),a.markerUpdatedAt&&c.jsx("div",{className:"text-xs text-[var(--color-text-muted)] mt-1 font-[family-name:var(--font-mono)]",children:a.state==="crashed"?i("workers.alerts.pidDead"):i("workers.alerts.markerStale",{ago:px(a.markerUpdatedAt)})})]},`${a.project}-${a.slot}`)})})]})}function iP({active:e,selected:t,onSelect:n}){const i=Be();return e.length===0?c.jsx("div",{className:"nb-card",children:c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] italic",children:i("workers.active.empty")})}):c.jsxs("section",{children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider mb-2 flex items-center gap-2",children:[c.jsx($h,{size:14,strokeWidth:2.5}),"Active (",e.length,")"]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:e.map(a=>{const l=(t==null?void 0:t.project)===a.project&&(t==null?void 0:t.slot)===a.slot;return c.jsxs("button",{type:"button",onClick:()=>n(a.project,a.slot),className:["nb-card p-3 text-left",a.state==="starting"?"bg-[var(--color-secondary)]":"bg-[var(--color-running-bg)]",l?"ring-4 ring-[var(--color-text)]":""].join(" "),children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsx(fx,{state:a.state}),c.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-sm flex-1 truncate",children:[a.project,"/worker-",a.slot]}),c.jsx("span",{className:`text-xs font-[family-name:var(--font-mono)] ${tP(a.runtimeMs)}`,children:hx(a.runtimeMs)})]}),a.card&&c.jsxs("div",{className:"text-sm font-semibold mb-1 truncate",children:["#",a.card.seq," · ",a.card.title]}),c.jsxs("div",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] flex items-center gap-2 mb-1",children:[a.stage&&c.jsxs("span",{children:["stage: ",a.stage]}),a.markerUpdatedAt&&c.jsxs("span",{className:"ml-auto",children:["marker ",px(a.markerUpdatedAt)]})]}),a.lastLogLine&&c.jsxs("div",{className:"text-[11px] font-[family-name:var(--font-mono)] text-[var(--color-text-muted)] bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded px-2 py-1 mt-2 truncate",children:[c.jsx(n_,{size:9,strokeWidth:2.5,className:"inline-block mr-1 align-text-bottom"}),a.lastLogLine.msg]})]},`${a.project}-${a.slot}`)})})]})}function rP({capacity:e,selected:t,onSelect:n}){const i=Be();return e.length===0?null:c.jsxs("section",{className:"flex flex-col min-h-0 flex-1",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider mb-2 shrink-0",children:"Capacity"}),c.jsxs("div",{className:"scroll-frame min-h-0 flex-1 rounded-lg border-2 border-[var(--color-border-light)] bg-[var(--color-bg-cream)] flex flex-col",children:[c.jsxs("table",{className:"w-full table-fixed text-sm shrink-0",children:[c.jsx(Mk,{}),c.jsx("thead",{children:c.jsxs("tr",{className:"border-b-2 border-[var(--color-border-light)] bg-[var(--color-bg-soft)]",children:[c.jsx("th",{className:"px-3 py-2 text-left font-bold text-xs uppercase tracking-wider",children:i("workers.capacity.col.project")}),c.jsx("th",{className:"px-3 py-2 text-left font-bold text-xs uppercase tracking-wider",children:i("workers.capacity.col.usage")}),c.jsx("th",{className:"px-3 py-2 text-right font-bold text-xs uppercase tracking-wider",children:"running"}),c.jsx("th",{className:"px-3 py-2 text-right font-bold text-xs uppercase tracking-wider",children:i("workers.capacity.col.other")}),c.jsx("th",{className:"px-3 py-2"})]})})]}),c.jsx("div",{className:"bg-color-bg-soft scroll-frame-body flex-1",children:c.jsxs("table",{className:"w-full table-fixed text-sm",children:[c.jsx(Mk,{}),c.jsx("tbody",{children:e.map(a=>c.jsx(aP,{capacity:a,selected:(t==null?void 0:t.project)===a.project,onSelect:()=>n(a.project)},a.project))})]})})]})]})}function Mk(){return c.jsxs("colgroup",{children:[c.jsx("col",{className:"w-[24%]"}),c.jsx("col",{className:"w-[28%]"}),c.jsx("col",{className:"w-[16%]"}),c.jsx("col",{className:"w-[20%]"}),c.jsx("col",{className:"w-[12%]"})]})}function aP({capacity:e,selected:t,onSelect:n}){const i=Be(),a=e.running+e.starting+e.stuck+e.crashed;return c.jsxs("tr",{onClick:n,className:["border-b border-dashed border-[var(--color-border-light)] last:border-0 cursor-pointer hover:bg-[var(--color-accent-yellow)]",t?"bg-[var(--color-accent-yellow)]":""].join(" "),children:[c.jsx("td",{className:"px-3 py-2 font-[family-name:var(--font-mono)] font-bold",children:e.project}),c.jsx("td",{className:"px-3 py-2",children:c.jsx(sP,{total:e.total,cap:e})}),c.jsxs("td",{className:"px-3 py-2 text-right font-[family-name:var(--font-mono)]",children:[c.jsx("span",{className:"text-[var(--color-running)] font-bold",children:e.running}),c.jsxs("span",{className:"text-[var(--color-text-muted)]",children:["/",e.total]})]}),c.jsxs("td",{className:"px-3 py-2 text-right text-xs font-[family-name:var(--font-mono)] text-[var(--color-text-muted)]",children:[e.starting>0&&c.jsxs("span",{className:"mr-2",children:["starting ",e.starting]}),e.stuck>0&&c.jsxs("span",{className:"text-[var(--color-stuck)] font-bold mr-2",children:["stuck ",e.stuck]}),e.crashed>0&&c.jsxs("span",{className:"text-[var(--color-crashed)] font-bold mr-2",children:["crashed ",e.crashed]}),a===0&&c.jsx("span",{children:"idle"})]}),c.jsx("td",{className:"px-3 py-2 text-right",children:c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:i("workers.capacity.detailHint")})})]})}function sP({total:e,cap:t}){const n=[];for(let i=0;i<t.crashed;i++)n.push("crashed");for(let i=0;i<t.stuck;i++)n.push("stuck");for(let i=0;i<t.starting;i++)n.push("starting");for(let i=0;i<t.running;i++)n.push("running");for(let i=0;i<t.idle;i++)n.push("idle");return c.jsxs("div",{className:"flex gap-1 items-center",children:[n.map((i,a)=>c.jsx("span",{className:"inline-block w-3 h-3 rounded-full border-2 border-[var(--color-text)]",style:{background:lP(i)},title:i},a)),c.jsxs("span",{className:"text-xs text-[var(--color-text-muted)] ml-2 font-[family-name:var(--font-mono)]",children:[e," slot",e!==1?"s":""]})]})}function lP(e){switch(e){case"running":return"var(--color-running-bg)";case"starting":return"var(--color-secondary)";case"stuck":return"var(--color-stuck-bg)";case"crashed":return"var(--color-crashed-bg)";default:return"var(--color-idle-bg)"}}function oP({project:e,initialSlot:t,onChange:n}){var h;const i=Be(),a=Ye({queryKey:["workers",e],queryFn:()=>Z4(e),refetchInterval:3e3}),l=((h=a.data)==null?void 0:h.data)??[],[o,d]=j.useState(null);j.useEffect(()=>{if(l.length===0){d(null);return}const g=l[0].slot;d(m=>m!=null&&l.some(y=>y.slot===m)?m:t!=null&&l.some(y=>y.slot===t)?t:g)},[e,t,l.length]);const f=l.find(g=>g.slot===o)??null;return c.jsxs("div",{className:"flex flex-col h-full",children:[c.jsxs("div",{className:"px-4 bg-color-bg-soft py-3 border-b-2 border-[var(--color-text)] bg-[var(--color-bg-cream)]",children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold truncate",children:e}),c.jsx(vs,{to:`/board?project=${encodeURIComponent(e)}`,className:"text-xs underline text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:i("workers.panel.boardLink")})]}),a.isLoading&&l.length===0?c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:i("workers.panel.loading")}):l.length===0?c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:i("workers.panel.empty.slots")}):c.jsx("div",{className:"flex flex-wrap gap-2",children:l.map(g=>c.jsx(cP,{worker:g,active:g.slot===o,onClick:()=>d(g.slot)},g.slot))})]}),f?c.jsx(uP,{project:e,worker:f,onChange:n}):c.jsx("div",{className:"flex-1 flex items-center justify-center p-6 text-center",children:c.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:l.length===0?i("workers.panel.empty.noWorker"):i("workers.panel.empty.pickOne")})})]})}function cP({worker:e,active:t,onClick:n}){const i=Be();return c.jsxs("button",{type:"button",onClick:n,className:["nb-card p-2 text-left min-w-[130px] transition-transform",t?"ring-4 ring-[var(--color-text)]":"opacity-80 hover:opacity-100"].join(" "),children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsx(fx,{state:e.state}),c.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-xs",children:["worker-",e.slot]})]}),e.card?c.jsxs("div",{className:"text-[11px] truncate font-[family-name:var(--font-mono)]",children:["#",e.card.seq," ",e.card.title]}):c.jsx("div",{className:"text-[11px] text-[var(--color-text-muted)] italic",children:i("workers.panel.idle.short")})]})}function uP({project:e,worker:t,onChange:n}){var y,b;const i=Be(),{confirm:a,alert:l}=un(),o=t.state==="crashed"||t.state==="stuck",d=Ye({queryKey:["worker-detail",e,t.slot],queryFn:()=>J4(e,t.slot),refetchInterval:3e3}),f=((y=d.data)==null?void 0:y.recentOutput)??[],h=((b=d.data)==null?void 0:b.recentLogs)??[],g=j.useRef(null),m=j.useRef(!0);return j.useEffect(()=>{const k=g.current;k&&m.current&&(k.scrollTop=k.scrollHeight)},[f]),c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex-1 overflow-auto p-4 flex flex-col gap-4",children:[t.card?c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-text-muted)] mb-1",children:i("workers.panel.section.currentCard")}),c.jsxs("div",{className:"text-sm font-semibold break-words",children:["#",t.card.seq," · ",t.card.title]})]}):c.jsx("div",{className:"text-sm text-[var(--color-text-muted)] italic",children:i("workers.panel.idle.full")}),c.jsxs("dl",{className:"grid grid-cols-[100px_1fr] gap-y-2 text-sm",children:[c.jsx("dt",{className:"font-bold",children:"Stage"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.stage??"—"}),c.jsx("dt",{className:"font-bold",children:"PID"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.pid??"—"}),c.jsx("dt",{className:"font-bold",children:"Runtime"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:hx(t.runtimeMs)}),c.jsx("dt",{className:"font-bold",children:"Started"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)] text-xs",children:t.startedAt?new Date(t.startedAt).toLocaleString():"—"}),c.jsx("dt",{className:"font-bold",children:"Marker"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)] text-xs",children:t.markerUpdatedAt?px(t.markerUpdatedAt):"—"})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-text-muted)] mb-1 flex items-center gap-1",children:[c.jsx(n_,{size:10,strokeWidth:2.5}),i("workers.panel.section.claudeOutput",{n:f.length})]}),d.isLoading&&f.length===0?c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:i("workers.panel.output.loading")}):f.length===0?c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:i("workers.panel.output.empty")}):c.jsx("pre",{ref:g,onScroll:k=>{const v=k.currentTarget;m.current=v.scrollHeight-v.scrollTop-v.clientHeight<24},className:"text-xs font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded p-2 max-h-80 overflow-auto whitespace-pre-wrap break-words",children:f.map(k=>`${k.ts?`${k.ts} [${k.kind}] `:`[${k.kind}] `}${k.text}`).join(`
615
+ `)})]}),h.length>0&&c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-text-muted)] mb-1 opacity-60",children:i("workers.panel.section.heartbeat",{n:h.length})}),c.jsx("pre",{className:"text-xs font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded p-2 max-h-40 overflow-auto whitespace-pre-wrap break-words opacity-80",children:h.map(k=>`${k.ts??""} [${k.level}] ${k.msg}`).join(`
616
+ `)}),c.jsx(vs,{to:`/projects/${encodeURIComponent(e)}?tab=logs&worker=${t.slot}`,className:"text-xs underline text-[var(--color-running)] mt-1 inline-block",children:i("workers.panel.heartbeat.fullLog")})]})]}),c.jsxs("div",{className:"px-4 py-3 border-t-2 border-[var(--color-text)] bg-[var(--color-bg-cream)] flex gap-2 justify-end flex-wrap",children:[o&&t.card&&c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{if(await a({title:i("workers.panel.action.restart.confirm.title",{slot:t.slot}),body:i("workers.panel.action.restart.confirm.body",{seq:t.card.seq}),confirm:i("workers.panel.action.restart.confirm.button")})){try{await Tk(e,t.slot)}catch{}try{await eP(e,t.slot,t.card.seq),n()}catch(v){l({title:i("workers.panel.action.restart.error"),body:v instanceof Error?v.message:String(v)})}}},children:[c.jsx(g3,{size:11,strokeWidth:2.5})," ",i("workers.panel.action.restart")]}),t.state!=="idle"&&c.jsxs("button",{type:"button",className:"nb-btn nb-btn-danger",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{if(await a({title:i("workers.panel.action.kill.confirm.title",{slot:t.slot}),body:i("workers.panel.action.kill.confirm.body"),confirm:i("workers.panel.action.kill.confirm.button"),danger:!0}))try{await Tk(e,t.slot),n()}catch(v){l({title:i("workers.panel.action.kill.error"),body:v instanceof Error?v.message:String(v)})}},children:[c.jsx(C3,{size:11,strokeWidth:2.5})," ",i("workers.panel.action.kill")]})]})]})}function dP(){var o;const e=Be(),t=Gt(),[n,i]=j.useState(null),a=Ye({queryKey:["workers-agg"],queryFn:X4,refetchInterval:5e3});j.useEffect(()=>{if(!a.data)return;const d=a.data.capacity.map(h=>h.project),f=[];for(const h of d){const g=new EventSource(`/stream/projects/${encodeURIComponent(h)}`),m=()=>{t.invalidateQueries({queryKey:["workers-agg"]})};g.addEventListener("worker.updated",m),g.addEventListener("worker.added",m),g.addEventListener("worker.deleted",m),g.addEventListener("card.updated",m),f.push(g)}return()=>{for(const h of f)h.close()}},[(o=a.data)==null?void 0:o.capacity.map(d=>d.project).join(","),t]);const l=j.useMemo(()=>{if(!a.data)return{projects:0,running:0,starting:0,stuck:0,crashed:0,idle:0};const d={projects:a.data.capacity.length,running:0,starting:0,stuck:0,crashed:0,idle:0};for(const f of a.data.capacity)d.running+=f.running,d.starting+=f.starting,d.stuck+=f.stuck,d.crashed+=f.crashed,d.idle+=f.idle;return d},[a.data]);return c.jsxs("div",{className:"flex flex-col gap-4 h-[calc(100vh-140px)]",children:[c.jsxs("header",{className:"flex items-center justify-between flex-wrap gap-3",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold tracking-tight",children:e("workers.title")}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:e("workers.summary",{projects:l.projects,running:l.running,starting:l.starting,stuck:l.stuck,crashed:l.crashed,idle:l.idle})})]}),c.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>a.refetch(),disabled:a.isFetching,type:"button","aria-label":e("workers.refresh.aria"),children:[a.isFetching?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(ya,{size:12,strokeWidth:2.5}),e("workers.refresh")]})]}),c.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-4 flex-1 min-h-0",children:[c.jsxs("div",{className:"flex flex-col gap-4 min-h-0 pr-2",children:[a.isLoading&&c.jsx("p",{className:"text-[var(--color-text-muted)] italic",children:e("common.loading")}),a.isError&&c.jsx("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:c.jsx("p",{children:e("workers.error.load",{detail:a.error instanceof Error?a.error.message:String(a.error)})})}),a.data&&c.jsxs(c.Fragment,{children:[c.jsx(nP,{alerts:a.data.alerts,selected:n,onSelect:(d,f)=>i({project:d,slot:f})}),c.jsx(iP,{active:a.data.active,selected:n,onSelect:(d,f)=>i({project:d,slot:f})}),c.jsx(rP,{capacity:a.data.capacity,selected:n,onSelect:d=>i({project:d})})]})]}),c.jsx("aside",{className:"nb-card p-0 overflow-hidden flex flex-col h-full",children:n?c.jsx(oP,{project:n.project,initialSlot:n.slot,onChange:()=>t.invalidateQueries({queryKey:["workers-agg"]})}):c.jsx("div",{className:"flex-1 bg-color-bg-soft bg-surface-input flex items-center justify-center p-6 text-center",children:c.jsxs("div",{children:[c.jsx($h,{size:32,className:"mx-auto mb-3 text-[var(--color-text-subtle)]",strokeWidth:2}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:e("workers.empty.hint")})]})})})]})]})}function k2(){return ft("/api/gen/jobs")}function fP(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const hP=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pP=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,mP={};function Dk(e,t){return(mP.jsx?pP:hP).test(e)}const gP=/[ \t\n\f\r]/g;function yP(e){return typeof e=="object"?e.type==="text"?Ok(e.value):!1:Ok(e)}function Ok(e){return e.replace(gP,"")===""}class Zu{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}Zu.prototype.normal={};Zu.prototype.property={};Zu.prototype.space=void 0;function E2(e,t){const n={},i={};for(const a of e)Object.assign(n,a.property),Object.assign(i,a.normal);return new Zu(n,i,t)}function Xy(e){return e.toLowerCase()}class mi{constructor(t,n){this.attribute=n,this.property=t}}mi.prototype.attribute="";mi.prototype.booleanish=!1;mi.prototype.boolean=!1;mi.prototype.commaOrSpaceSeparated=!1;mi.prototype.commaSeparated=!1;mi.prototype.defined=!1;mi.prototype.mustUseProperty=!1;mi.prototype.number=!1;mi.prototype.overloadedBoolean=!1;mi.prototype.property="";mi.prototype.spaceSeparated=!1;mi.prototype.space=void 0;let bP=0;const dt=El(),Sn=El(),Zy=El(),je=El(),Yt=El(),So=El(),Ei=El();function El(){return 2**++bP}const Jy=Object.freeze(Object.defineProperty({__proto__:null,boolean:dt,booleanish:Sn,commaOrSpaceSeparated:Ei,commaSeparated:So,number:je,overloadedBoolean:Zy,spaceSeparated:Yt},Symbol.toStringTag,{value:"Module"})),Ug=Object.keys(Jy);class mx extends mi{constructor(t,n,i,a){let l=-1;if(super(t,n),Rk(this,"space",a),typeof i=="number")for(;++l<Ug.length;){const o=Ug[l];Rk(this,Ug[l],(i&Jy[o])===Jy[o])}}}mx.prototype.defined=!0;function Rk(e,t,n){n&&(e[t]=n)}function sc(e){const t={},n={};for(const[i,a]of Object.entries(e.properties)){const l=new mx(i,e.transform(e.attributes||{},i),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(l.mustUseProperty=!0),t[i]=l,n[Xy(i)]=i,n[Xy(l.attribute)]=i}return new Zu(t,n,e.space)}const S2=sc({properties:{ariaActiveDescendant:null,ariaAtomic:Sn,ariaAutoComplete:null,ariaBusy:Sn,ariaChecked:Sn,ariaColCount:je,ariaColIndex:je,ariaColSpan:je,ariaControls:Yt,ariaCurrent:null,ariaDescribedBy:Yt,ariaDetails:null,ariaDisabled:Sn,ariaDropEffect:Yt,ariaErrorMessage:null,ariaExpanded:Sn,ariaFlowTo:Yt,ariaGrabbed:Sn,ariaHasPopup:null,ariaHidden:Sn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Yt,ariaLevel:je,ariaLive:null,ariaModal:Sn,ariaMultiLine:Sn,ariaMultiSelectable:Sn,ariaOrientation:null,ariaOwns:Yt,ariaPlaceholder:null,ariaPosInSet:je,ariaPressed:Sn,ariaReadOnly:Sn,ariaRelevant:null,ariaRequired:Sn,ariaRoleDescription:Yt,ariaRowCount:je,ariaRowIndex:je,ariaRowSpan:je,ariaSelected:Sn,ariaSetSize:je,ariaSort:null,ariaValueMax:je,ariaValueMin:je,ariaValueNow:je,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function N2(e,t){return t in e?e[t]:t}function _2(e,t){return N2(e,t.toLowerCase())}const xP=sc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:So,acceptCharset:Yt,accessKey:Yt,action:null,allow:null,allowFullScreen:dt,allowPaymentRequest:dt,allowUserMedia:dt,alt:null,as:null,async:dt,autoCapitalize:null,autoComplete:Yt,autoFocus:dt,autoPlay:dt,blocking:Yt,capture:null,charSet:null,checked:dt,cite:null,className:Yt,cols:je,colSpan:null,content:null,contentEditable:Sn,controls:dt,controlsList:Yt,coords:je|So,crossOrigin:null,data:null,dateTime:null,decoding:null,default:dt,defer:dt,dir:null,dirName:null,disabled:dt,download:Zy,draggable:Sn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:dt,formTarget:null,headers:Yt,height:je,hidden:Zy,high:je,href:null,hrefLang:null,htmlFor:Yt,httpEquiv:Yt,id:null,imageSizes:null,imageSrcSet:null,inert:dt,inputMode:null,integrity:null,is:null,isMap:dt,itemId:null,itemProp:Yt,itemRef:Yt,itemScope:dt,itemType:Yt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:dt,low:je,manifest:null,max:null,maxLength:je,media:null,method:null,min:null,minLength:je,multiple:dt,muted:dt,name:null,nonce:null,noModule:dt,noValidate:dt,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:dt,optimum:je,pattern:null,ping:Yt,placeholder:null,playsInline:dt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:dt,referrerPolicy:null,rel:Yt,required:dt,reversed:dt,rows:je,rowSpan:je,sandbox:Yt,scope:null,scoped:dt,seamless:dt,selected:dt,shadowRootClonable:dt,shadowRootDelegatesFocus:dt,shadowRootMode:null,shape:null,size:je,sizes:null,slot:null,span:je,spellCheck:Sn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:je,step:null,style:null,tabIndex:je,target:null,title:null,translate:null,type:null,typeMustMatch:dt,useMap:null,value:Sn,width:je,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Yt,axis:null,background:null,bgColor:null,border:je,borderColor:null,bottomMargin:je,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:dt,declare:dt,event:null,face:null,frame:null,frameBorder:null,hSpace:je,leftMargin:je,link:null,longDesc:null,lowSrc:null,marginHeight:je,marginWidth:je,noResize:dt,noHref:dt,noShade:dt,noWrap:dt,object:null,profile:null,prompt:null,rev:null,rightMargin:je,rules:null,scheme:null,scrolling:Sn,standby:null,summary:null,text:null,topMargin:je,valueType:null,version:null,vAlign:null,vLink:null,vSpace:je,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:dt,disableRemotePlayback:dt,prefix:null,property:null,results:je,security:null,unselectable:null},space:"html",transform:_2}),vP=sc({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:Ei,accentHeight:je,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:je,amplitude:je,arabicForm:null,ascent:je,attributeName:null,attributeType:null,azimuth:je,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:je,by:null,calcMode:null,capHeight:je,className:Yt,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:je,diffuseConstant:je,direction:null,display:null,dur:null,divisor:je,dominantBaseline:null,download:dt,dx:null,dy:null,edgeMode:null,editable:null,elevation:je,enableBackground:null,end:null,event:null,exponent:je,externalResourcesRequired:null,fill:null,fillOpacity:je,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:So,g2:So,glyphName:So,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:je,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:je,horizOriginX:je,horizOriginY:je,id:null,ideographic:je,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:je,k:je,k1:je,k2:je,k3:je,k4:je,kernelMatrix:Ei,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:je,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:je,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:je,overlineThickness:je,paintOrder:null,panose1:null,path:null,pathLength:je,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Yt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:je,pointsAtY:je,pointsAtZ:je,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ei,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ei,rev:Ei,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ei,requiredFeatures:Ei,requiredFonts:Ei,requiredFormats:Ei,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:je,specularExponent:je,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:je,strikethroughThickness:je,string:null,stroke:null,strokeDashArray:Ei,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:je,strokeOpacity:je,strokeWidth:null,style:null,surfaceScale:je,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ei,tabIndex:je,tableValues:null,target:null,targetX:je,targetY:je,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ei,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:je,underlineThickness:je,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:je,values:null,vAlphabetic:je,vMathematical:je,vectorEffect:null,vHanging:je,vIdeographic:je,version:null,vertAdvY:je,vertOriginX:je,vertOriginY:je,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:je,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:N2}),j2=sc({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()}}),C2=sc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:_2}),A2=sc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),wP={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"},kP=/[A-Z]/g,Lk=/-[a-z]/g,EP=/^data[-\w.:]+$/i;function SP(e,t){const n=Xy(t);let i=t,a=mi;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&EP.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(Lk,_P);i="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!Lk.test(l)){let o=l.replace(kP,NP);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}a=mx}return new a(i,t)}function NP(e){return"-"+e.toLowerCase()}function _P(e){return e.charAt(1).toUpperCase()}const jP=E2([S2,xP,j2,C2,A2],"html"),gx=E2([S2,vP,j2,C2,A2],"svg");function CP(e){return e.join(" ").trim()}var oo={},Fg,Ik;function AP(){if(Ik)return Fg;Ik=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,d=/^\s+|\s+$/g,f=`
617
+ `,h="/",g="*",m="",y="comment",b="declaration";function k(N,E){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];E=E||{};var C=1,S=1;function _(D){var K=D.match(t);K&&(C+=K.length);var P=D.lastIndexOf(f);S=~P?D.length-P:S+D.length}function M(){var D={line:C,column:S};return function(K){return K.position=new T(D),$(),K}}function T(D){this.start=D,this.end={line:C,column:S},this.source=E.source}T.prototype.content=N;function R(D){var K=new Error(E.source+":"+C+":"+S+": "+D);if(K.reason=D,K.filename=E.source,K.line=C,K.column=S,K.source=N,!E.silent)throw K}function O(D){var K=D.exec(N);if(K){var P=K[0];return _(P),N=N.slice(P.length),K}}function $(){O(n)}function I(D){var K;for(D=D||[];K=q();)K!==!1&&D.push(K);return D}function q(){var D=M();if(!(h!=N.charAt(0)||g!=N.charAt(1))){for(var K=2;m!=N.charAt(K)&&(g!=N.charAt(K)||h!=N.charAt(K+1));)++K;if(K+=2,m===N.charAt(K-1))return R("End of comment missing");var P=N.slice(2,K-2);return S+=2,_(P),N=N.slice(K),S+=2,D({type:y,comment:P})}}function F(){var D=M(),K=O(i);if(K){if(q(),!O(a))return R("property missing ':'");var P=O(l),H=D({type:b,property:v(K[0].replace(e,m)),value:P?v(P[0].replace(e,m)):m});return O(o),H}}function Y(){var D=[];I(D);for(var K;K=F();)K!==!1&&(D.push(K),I(D));return D}return $(),Y()}function v(N){return N?N.replace(d,m):m}return Fg=k,Fg}var zk;function TP(){if(zk)return oo;zk=1;var e=oo&&oo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(oo,"__esModule",{value:!0}),oo.default=n;const t=e(AP());function n(i,a){let l=null;if(!i||typeof i!="string")return l;const o=(0,t.default)(i),d=typeof a=="function";return o.forEach(f=>{if(f.type!=="declaration")return;const{property:h,value:g}=f;d?a(h,g,f):g&&(l=l||{},l[h]=g)}),l}return oo}var tu={},Pk;function MP(){if(Pk)return tu;Pk=1,Object.defineProperty(tu,"__esModule",{value:!0}),tu.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,l=function(h){return!h||n.test(h)||e.test(h)},o=function(h,g){return g.toUpperCase()},d=function(h,g){return"".concat(g,"-")},f=function(h,g){return g===void 0&&(g={}),l(h)?h:(h=h.toLowerCase(),g.reactCompat?h=h.replace(a,d):h=h.replace(i,d),h.replace(t,o))};return tu.camelCase=f,tu}var nu,Bk;function DP(){if(Bk)return nu;Bk=1;var e=nu&&nu.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(TP()),n=MP();function i(a,l){var o={};return!a||typeof a!="string"||(0,t.default)(a,function(d,f){d&&f&&(o[(0,n.camelCase)(d,l)]=f)}),o}return i.default=i,nu=i,nu}var OP=DP();const RP=qu(OP),T2=M2("end"),yx=M2("start");function M2(e){return t;function t(n){const i=n&&n.position&&n.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 LP(e){const t=yx(e),n=T2(e);if(t&&n)return{start:t,end:n}}function hu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?$k(e.position):"start"in e||"end"in e?$k(e):"line"in e||"column"in e?eb(e):""}function eb(e){return Uk(e&&e.line)+":"+Uk(e&&e.column)}function $k(e){return eb(e&&e.start)+"-"+eb(e&&e.end)}function Uk(e){return e&&typeof e=="number"?e:1}class Yn extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let a="",l={},o=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?a=t:!l.cause&&t&&(o=!0,a=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof i=="string"){const f=i.indexOf(":");f===-1?l.ruleId=i:(l.source=i.slice(0,f),l.ruleId=i.slice(f+1))}if(!l.place&&l.ancestors&&l.ancestors){const f=l.ancestors[l.ancestors.length-1];f&&(l.place=f.position)}const d=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=d?d.line:void 0,this.name=hu(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=o&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Yn.prototype.file="";Yn.prototype.name="";Yn.prototype.reason="";Yn.prototype.message="";Yn.prototype.stack="";Yn.prototype.column=void 0;Yn.prototype.line=void 0;Yn.prototype.ancestors=void 0;Yn.prototype.cause=void 0;Yn.prototype.fatal=void 0;Yn.prototype.place=void 0;Yn.prototype.ruleId=void 0;Yn.prototype.source=void 0;const bx={}.hasOwnProperty,IP=new Map,zP=/[A-Z]/g,PP=new Set(["table","tbody","thead","tfoot","tr"]),BP=new Set(["td","th"]),D2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $P(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=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=YP(n,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=VP(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?gx:jP,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=O2(a,e,void 0);return l&&typeof l!="string"?l:a.create(e,a.Fragment,{children:l||void 0},void 0)}function O2(e,t,n){if(t.type==="element")return UP(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return FP(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return HP(e,t,n);if(t.type==="mdxjsEsm")return qP(e,t);if(t.type==="root")return KP(e,t,n);if(t.type==="text")return GP(e,t)}function UP(e,t,n){const i=e.schema;let a=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(a=gx,e.schema=a),e.ancestors.push(t);const l=L2(e,t.tagName,!1),o=QP(e,t);let d=vx(e,t);return PP.has(t.tagName)&&(d=d.filter(function(f){return typeof f=="string"?!yP(f):!0})),R2(e,o,l,t),xx(o,d),e.ancestors.pop(),e.schema=i,e.create(t,l,o,n)}function FP(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)}ju(e,t.position)}function qP(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ju(e,t.position)}function HP(e,t,n){const i=e.schema;let a=i;t.name==="svg"&&i.space==="html"&&(a=gx,e.schema=a),e.ancestors.push(t);const l=t.name===null?e.Fragment:L2(e,t.name,!0),o=WP(e,t),d=vx(e,t);return R2(e,o,l,t),xx(o,d),e.ancestors.pop(),e.schema=i,e.create(t,l,o,n)}function KP(e,t,n){const i={};return xx(i,vx(e,t)),e.create(t,e.Fragment,i,n)}function GP(e,t){return t.value}function R2(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function xx(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function VP(e,t,n){return i;function i(a,l,o,d){const h=Array.isArray(o.children)?n:t;return d?h(l,o,d):h(l,o)}}function YP(e,t){return n;function n(i,a,l,o){const d=Array.isArray(l.children),f=yx(i);return t(a,l,o,d,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function QP(e,t){const n={};let i,a;for(a in t.properties)if(a!=="children"&&bx.call(t.properties,a)){const l=XP(e,a,t.properties[a]);if(l){const[o,d]=l;e.tableCellAlignToStyle&&o==="align"&&typeof d=="string"&&BP.has(t.tagName)?i=d:n[o]=d}}if(i){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function WP(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const l=i.data.estree.body[0];l.type;const o=l.expression;o.type;const d=o.properties[0];d.type,Object.assign(n,e.evaluater.evaluateExpression(d.argument))}else ju(e,t.position);else{const a=i.name;let l;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,l=e.evaluater.evaluateExpression(d.expression)}else ju(e,t.position);else l=i.value===null?!0:i.value;n[a]=l}return n}function vx(e,t){const n=[];let i=-1;const a=e.passKeys?new Map:IP;for(;++i<t.children.length;){const l=t.children[i];let o;if(e.passKeys){const f=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(f){const h=a.get(f)||0;o=f+"-"+h,a.set(f,h+1)}}const d=O2(e,l,o);d!==void 0&&n.push(d)}return n}function XP(e,t,n){const i=SP(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?fP(n):CP(n)),i.property==="style"){let a=typeof n=="object"?n:ZP(e,String(n));return e.stylePropertyNameCase==="css"&&(a=JP(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&i.space?wP[i.property]||i.property:i.attribute,n]}}function ZP(e,t){try{return RP(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const i=n,a=new Yn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=D2+"#cannot-parse-style-attribute",a}}function L2(e,t,n){let i;if(!n)i={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let l=-1,o;for(;++l<a.length;){const d=Dk(a[l])?{type:"Identifier",name:a[l]}:{type:"Literal",value:a[l]};o=o?{type:"MemberExpression",object:o,property:d,computed:!!(l&&d.type==="Literal"),optional:!1}:d}i=o}else i=Dk(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const a=i.value;return bx.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(i);ju(e)}function ju(e,t){const n=new Yn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=D2+"#cannot-handle-mdx-estrees-without-createevaluater",n}function JP(e){const t={};let n;for(n in e)bx.call(e,n)&&(t[e5(n)]=e[n]);return t}function e5(e){let t=e.replace(zP,t5);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function t5(e){return"-"+e.toLowerCase()}const qg={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"]},n5={};function wx(e,t){const n=n5,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return I2(e,i,a)}function I2(e,t,n){if(i5(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Fk(e.children,t,n)}return Array.isArray(e)?Fk(e,t,n):""}function Fk(e,t,n){const i=[];let a=-1;for(;++a<e.length;)i[a]=I2(e[a],t,n);return i.join("")}function i5(e){return!!(e&&typeof e=="object")}const qk=document.createElement("i");function kx(e){const t="&"+e+";";qk.innerHTML=t;const n=qk.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ji(e,t,n,i){const a=e.length;let l=0,o;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,i.length<1e4)o=Array.from(i),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);l<i.length;)o=i.slice(l,l+1e4),o.unshift(t,0),e.splice(...o),l+=1e4,t+=1e4}function Hi(e,t){return e.length>0?(ji(e,e.length,0,t),e):t}const Hk={}.hasOwnProperty;function z2(e){const t={};let n=-1;for(;++n<e.length;)r5(t,e[n]);return t}function r5(e,t){let n;for(n in t){const a=(Hk.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let o;if(l)for(o in l){Hk.call(a,o)||(a[o]=[]);const d=l[o];a5(a[o],Array.isArray(d)?d:d?[d]:[])}}}function a5(e,t){let n=-1;const i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);ji(e,0,0,i)}function P2(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function dr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ni=Ns(/[A-Za-z]/),Gn=Ns(/[\dA-Za-z]/),s5=Ns(/[#-'*+\--9=?A-Z^-~]/);function xh(e){return e!==null&&(e<32||e===127)}const tb=Ns(/\d/),l5=Ns(/[\dA-Fa-f]/),o5=Ns(/[!-/:-@[-`{-~]/);function Je(e){return e!==null&&e<-2}function Ht(e){return e!==null&&(e<0||e===32)}function gt(e){return e===-2||e===-1||e===32}const rp=Ns(new RegExp("\\p{P}|\\p{S}","u")),ml=Ns(/\s/);function Ns(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function lc(e){const t=[];let n=-1,i=0,a=0;for(;++n<e.length;){const l=e.charCodeAt(n);let o="";if(l===37&&Gn(e.charCodeAt(n+1))&&Gn(e.charCodeAt(n+2)))a=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(o=String.fromCharCode(l));else if(l>55295&&l<57344){const d=e.charCodeAt(n+1);l<56320&&d>56319&&d<57344?(o=String.fromCharCode(l,d),a=1):o="�"}else o=String.fromCharCode(l);o&&(t.push(e.slice(i,n),encodeURIComponent(o)),i=n+a+1,o=""),a&&(n+=a,a=0)}return t.join("")+e.slice(i)}function Et(e,t,n,i){const a=i?i-1:Number.POSITIVE_INFINITY;let l=0;return o;function o(f){return gt(f)?(e.enter(n),d(f)):t(f)}function d(f){return gt(f)&&l++<a?(e.consume(f),d):(e.exit(n),t(f))}}const c5={tokenize:u5};function u5(e){const t=e.attempt(this.parser.constructs.contentInitial,i,a);let n;return t;function i(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Et(e,t,"linePrefix")}function a(d){return e.enter("paragraph"),l(d)}function l(d){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,o(d)}function o(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return Je(d)?(e.consume(d),e.exit("chunkText"),l):(e.consume(d),o)}}const d5={tokenize:f5},Kk={tokenize:h5};function f5(e){const t=this,n=[];let i=0,a,l,o;return d;function d(S){if(i<n.length){const _=n[i];return t.containerState=_[1],e.attempt(_[0].continuation,f,h)(S)}return h(S)}function f(S){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&C();const _=t.events.length;let M=_,T;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){T=t.events[M][1].end;break}E(i);let R=_;for(;R<t.events.length;)t.events[R][1].end={...T},R++;return ji(t.events,M+1,0,t.events.slice(_)),t.events.length=R,h(S)}return d(S)}function h(S){if(i===n.length){if(!a)return y(S);if(a.currentConstruct&&a.currentConstruct.concrete)return k(S);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Kk,g,m)(S)}function g(S){return a&&C(),E(i),y(S)}function m(S){return t.parser.lazy[t.now().line]=i!==n.length,o=t.now().offset,k(S)}function y(S){return t.containerState={},e.attempt(Kk,b,k)(S)}function b(S){return i++,n.push([t.currentConstruct,t.containerState]),y(S)}function k(S){if(S===null){a&&C(),E(0),e.consume(S);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:l}),v(S)}function v(S){if(S===null){N(e.exit("chunkFlow"),!0),E(0),e.consume(S);return}return Je(S)?(e.consume(S),N(e.exit("chunkFlow")),i=0,t.interrupt=void 0,d):(e.consume(S),v)}function N(S,_){const M=t.sliceStream(S);if(_&&M.push(null),S.previous=l,l&&(l.next=S),l=S,a.defineSkip(S.start),a.write(M),t.parser.lazy[S.start.line]){let T=a.events.length;for(;T--;)if(a.events[T][1].start.offset<o&&(!a.events[T][1].end||a.events[T][1].end.offset>o))return;const R=t.events.length;let O=R,$,I;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){if($){I=t.events[O][1].end;break}$=!0}for(E(i),T=R;T<t.events.length;)t.events[T][1].end={...I},T++;ji(t.events,O+1,0,t.events.slice(R)),t.events.length=T}}function E(S){let _=n.length;for(;_-- >S;){const M=n[_];t.containerState=M[1],M[0].exit.call(t,e)}n.length=S}function C(){a.write([null]),l=void 0,a=void 0,t.containerState._closeFlow=void 0}}function h5(e,t,n){return Et(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Uo(e){if(e===null||Ht(e)||ml(e))return 1;if(rp(e))return 2}function ap(e,t,n){const i=[];let a=-1;for(;++a<e.length;){const l=e[a].resolveAll;l&&!i.includes(l)&&(t=l(t,n),i.push(l))}return t}const nb={name:"attention",resolveAll:p5,tokenize:m5};function p5(e,t){let n=-1,i,a,l,o,d,f,h,g;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(i=n;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[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;f=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[i][1].end},y={...e[n][1].start};Gk(m,-f),Gk(y,f),o={type:f>1?"strongSequence":"emphasisSequence",start:m,end:{...e[i][1].end}},d={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},l={type:f>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},a={type:f>1?"strong":"emphasis",start:{...o.start},end:{...d.end}},e[i][1].end={...o.start},e[n][1].start={...d.end},h=[],e[i][1].end.offset-e[i][1].start.offset&&(h=Hi(h,[["enter",e[i][1],t],["exit",e[i][1],t]])),h=Hi(h,[["enter",a,t],["enter",o,t],["exit",o,t],["enter",l,t]]),h=Hi(h,ap(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),h=Hi(h,[["exit",l,t],["enter",d,t],["exit",d,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,h=Hi(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,ji(e,i-1,n-i+3,h),n=i+h.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function m5(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,a=Uo(i);let l;return o;function o(f){return l=f,e.enter("attentionSequence"),d(f)}function d(f){if(f===l)return e.consume(f),d;const h=e.exit("attentionSequence"),g=Uo(f),m=!g||g===2&&a||n.includes(f),y=!a||a===2&&g||n.includes(i);return h._open=!!(l===42?m:m&&(a||!y)),h._close=!!(l===42?y:y&&(g||!m)),t(f)}}function Gk(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const g5={name:"autolink",tokenize:y5};function y5(e,t,n){let i=0;return a;function a(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(b){return ni(b)?(e.consume(b),o):b===64?n(b):h(b)}function o(b){return b===43||b===45||b===46||Gn(b)?(i=1,d(b)):h(b)}function d(b){return b===58?(e.consume(b),i=0,f):(b===43||b===45||b===46||Gn(b))&&i++<32?(e.consume(b),d):(i=0,h(b))}function f(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||xh(b)?n(b):(e.consume(b),f)}function h(b){return b===64?(e.consume(b),g):s5(b)?(e.consume(b),h):n(b)}function g(b){return Gn(b)?m(b):n(b)}function m(b){return b===46?(e.consume(b),i=0,g):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):y(b)}function y(b){if((b===45||Gn(b))&&i++<63){const k=b===45?y:m;return e.consume(b),k}return n(b)}}const Ju={partial:!0,tokenize:b5};function b5(e,t,n){return i;function i(l){return gt(l)?Et(e,a,"linePrefix")(l):a(l)}function a(l){return l===null||Je(l)?t(l):n(l)}}const B2={continuation:{tokenize:v5},exit:w5,name:"blockQuote",tokenize:x5};function x5(e,t,n){const i=this;return a;function a(o){if(o===62){const d=i.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),l}return n(o)}function l(o){return gt(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function v5(e,t,n){const i=this;return a;function a(o){return gt(o)?Et(e,l,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):l(o)}function l(o){return e.attempt(B2,t,n)(o)}}function w5(e){e.exit("blockQuote")}const $2={name:"characterEscape",tokenize:k5};function k5(e,t,n){return i;function i(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),a}function a(l){return o5(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const U2={name:"characterReference",tokenize:E5};function E5(e,t,n){const i=this;let a=0,l,o;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"),l=31,o=Gn,g(m))}function h(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,o=l5,g):(e.enter("characterReferenceValue"),l=7,o=tb,g(m))}function g(m){if(m===59&&a){const y=e.exit("characterReferenceValue");return o===Gn&&!kx(i.sliceSerialize(y))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(m)&&a++<l?(e.consume(m),g):n(m)}}const Vk={partial:!0,tokenize:N5},Yk={concrete:!0,name:"codeFenced",tokenize:S5};function S5(e,t,n){const i=this,a={partial:!0,tokenize:M};let l=0,o=0,d;return f;function f(T){return h(T)}function h(T){const R=i.events[i.events.length-1];return l=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[1],!0).length:0,d=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(T)}function g(T){return T===d?(o++,e.consume(T),g):o<3?n(T):(e.exit("codeFencedFenceSequence"),gt(T)?Et(e,m,"whitespace")(T):m(T))}function m(T){return T===null||Je(T)?(e.exit("codeFencedFence"),i.interrupt?t(T):e.check(Vk,v,_)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(T))}function y(T){return T===null||Je(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(T)):gt(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Et(e,b,"whitespace")(T)):T===96&&T===d?n(T):(e.consume(T),y)}function b(T){return T===null||Je(T)?m(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(T))}function k(T){return T===null||Je(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(T)):T===96&&T===d?n(T):(e.consume(T),k)}function v(T){return e.attempt(a,_,N)(T)}function N(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),E}function E(T){return l>0&&gt(T)?Et(e,C,"linePrefix",l+1)(T):C(T)}function C(T){return T===null||Je(T)?e.check(Vk,v,_)(T):(e.enter("codeFlowValue"),S(T))}function S(T){return T===null||Je(T)?(e.exit("codeFlowValue"),C(T)):(e.consume(T),S)}function _(T){return e.exit("codeFenced"),t(T)}function M(T,R,O){let $=0;return I;function I(K){return T.enter("lineEnding"),T.consume(K),T.exit("lineEnding"),q}function q(K){return T.enter("codeFencedFence"),gt(K)?Et(T,F,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(K):F(K)}function F(K){return K===d?(T.enter("codeFencedFenceSequence"),Y(K)):O(K)}function Y(K){return K===d?($++,T.consume(K),Y):$>=o?(T.exit("codeFencedFenceSequence"),gt(K)?Et(T,D,"whitespace")(K):D(K)):O(K)}function D(K){return K===null||Je(K)?(T.exit("codeFencedFence"),R(K)):O(K)}}}function N5(e,t,n){const i=this;return a;function a(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l)}function l(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}const Hg={name:"codeIndented",tokenize:j5},_5={partial:!0,tokenize:C5};function j5(e,t,n){const i=this;return a;function a(h){return e.enter("codeIndented"),Et(e,l,"linePrefix",5)(h)}function l(h){const g=i.events[i.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?o(h):n(h)}function o(h){return h===null?f(h):Je(h)?e.attempt(_5,o,f)(h):(e.enter("codeFlowValue"),d(h))}function d(h){return h===null||Je(h)?(e.exit("codeFlowValue"),o(h)):(e.consume(h),d)}function f(h){return e.exit("codeIndented"),t(h)}}function C5(e,t,n){const i=this;return a;function a(o){return i.parser.lazy[i.now().line]?n(o):Je(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):Et(e,l,"linePrefix",5)(o)}function l(o){const d=i.events[i.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(o):Je(o)?a(o):n(o)}}const A5={name:"codeText",previous:M5,resolve:T5,tokenize:D5};function T5(e){let t=e.length-4,n=3,i,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i<t;)if(e[i][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(i=n-1,t++;++i<=t;)a===void 0?i!==t&&e[i][1].type!=="lineEnding"&&(a=i):(i===t||e[i][1].type==="lineEnding")&&(e[a][1].type="codeTextData",i!==a+2&&(e[a][1].end=e[i-1][1].end,e.splice(a+2,i-a-2),t-=i-a-2,i=a+2),a=void 0);return e}function M5(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function D5(e,t,n){let i=0,a,l;return o;function o(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?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),f):m===96?(l=e.enter("codeTextSequence"),a=0,g(m)):Je(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||Je(m)?(e.exit("codeTextData"),f(m)):(e.consume(m),h)}function g(m){return m===96?(e.consume(m),a++,g):a===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(l.type="codeTextData",h(m))}}class O5{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,n){const i=n??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,n,i){const a=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return i&&iu(this.left,i),l.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),iu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),iu(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 n=this.left.splice(t,Number.POSITIVE_INFINITY);iu(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);iu(this.left,n.reverse())}}}function iu(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function F2(e){const t={};let n=-1,i,a,l,o,d,f,h;const g=new O5(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(i=g.get(n),n&&i[1].type==="chunkFlow"&&g.get(n-1)[1].type==="listItemPrefix"&&(f=i[1]._tokenizer.events,l=0,l<f.length&&f[l][1].type==="lineEndingBlank"&&(l+=2),l<f.length&&f[l][1].type==="content"))for(;++l<f.length&&f[l][1].type!=="content";)f[l][1].type==="chunkText"&&(f[l][1]._isInFirstContentOfListItem=!0,l++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,R5(g,n)),n=t[n],h=!0);else if(i[1]._container){for(l=n,a=void 0;l--;)if(o=g.get(l),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(a&&(g.get(a)[1].type="lineEndingBlank"),o[1].type="lineEnding",a=l);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;a&&(i[1].end={...g.get(a)[1].start},d=g.slice(a,n),d.unshift(i),g.splice(a,n-a+1,d))}}return ji(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!h}function R5(e,t){const n=e.get(t)[1],i=e.get(t)[2];let a=t-1;const l=[];let o=n._tokenizer;o||(o=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const d=o.events,f=[],h={};let g,m,y=-1,b=n,k=0,v=0;const N=[v];for(;b;){for(;e.get(++a)[1]!==b;);l.push(a),b._tokenizer||(g=i.sliceStream(b),b.next||g.push(null),m&&o.defineSkip(b.start),b._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(g),b._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),m=b,b=b.next}for(b=n;++y<d.length;)d[y][0]==="exit"&&d[y-1][0]==="enter"&&d[y][1].type===d[y-1][1].type&&d[y][1].start.line!==d[y][1].end.line&&(v=y+1,N.push(v),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(o.events=[],b?(b._tokenizer=void 0,b.previous=void 0):N.pop(),y=N.length;y--;){const E=d.slice(N[y],N[y+1]),C=l.pop();f.push([C,C+E.length-1]),e.splice(C,2,E)}for(f.reverse(),y=-1;++y<f.length;)h[k+f[y][0]]=k+f[y][1],k+=f[y][1]-f[y][0]-1;return h}const L5={resolve:z5,tokenize:P5},I5={partial:!0,tokenize:B5};function z5(e){return F2(e),e}function P5(e,t){let n;return i;function i(d){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(d)}function a(d){return d===null?l(d):Je(d)?e.check(I5,o,l)(d):(e.consume(d),a)}function l(d){return e.exit("chunkContent"),e.exit("content"),t(d)}function o(d){return e.consume(d),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function B5(e,t,n){const i=this;return a;function a(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Et(e,l,"linePrefix")}function l(o){if(o===null||Je(o))return n(o);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(o):e.interrupt(i.parser.constructs.flow,n,t)(o)}}function q2(e,t,n,i,a,l,o,d,f){const h=f||Number.POSITIVE_INFINITY;let g=0;return m;function m(E){return E===60?(e.enter(i),e.enter(a),e.enter(l),e.consume(E),e.exit(l),y):E===null||E===32||E===41||xh(E)?n(E):(e.enter(i),e.enter(o),e.enter(d),e.enter("chunkString",{contentType:"string"}),v(E))}function y(E){return E===62?(e.enter(l),e.consume(E),e.exit(l),e.exit(a),e.exit(i),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),b(E))}function b(E){return E===62?(e.exit("chunkString"),e.exit(d),y(E)):E===null||E===60||Je(E)?n(E):(e.consume(E),E===92?k:b)}function k(E){return E===60||E===62||E===92?(e.consume(E),b):b(E)}function v(E){return!g&&(E===null||E===41||Ht(E))?(e.exit("chunkString"),e.exit(d),e.exit(o),e.exit(i),t(E)):g<h&&E===40?(e.consume(E),g++,v):E===41?(e.consume(E),g--,v):E===null||E===32||E===40||xh(E)?n(E):(e.consume(E),E===92?N:v)}function N(E){return E===40||E===41||E===92?(e.consume(E),v):v(E)}}function H2(e,t,n,i,a,l){const o=this;let d=0,f;return h;function h(b){return e.enter(i),e.enter(a),e.consume(b),e.exit(a),e.enter(l),g}function g(b){return d>999||b===null||b===91||b===93&&!f||b===94&&!d&&"_hiddenFootnoteSupport"in o.parser.constructs?n(b):b===93?(e.exit(l),e.enter(a),e.consume(b),e.exit(a),e.exit(i),t):Je(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===null||b===91||b===93||Je(b)||d++>999?(e.exit("chunkString"),g(b)):(e.consume(b),f||(f=!gt(b)),b===92?y:m)}function y(b){return b===91||b===92||b===93?(e.consume(b),d++,m):m(b)}}function K2(e,t,n,i,a,l){let o;return d;function d(y){return y===34||y===39||y===40?(e.enter(i),e.enter(a),e.consume(y),e.exit(a),o=y===40?41:y,f):n(y)}function f(y){return y===o?(e.enter(a),e.consume(y),e.exit(a),e.exit(i),t):(e.enter(l),h(y))}function h(y){return y===o?(e.exit(l),f(o)):y===null?n(y):Je(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),Et(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(y))}function g(y){return y===o||y===null||Je(y)?(e.exit("chunkString"),h(y)):(e.consume(y),y===92?m:g)}function m(y){return y===o||y===92?(e.consume(y),g):g(y)}}function pu(e,t){let n;return i;function i(a){return Je(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,i):gt(a)?Et(e,i,n?"linePrefix":"lineSuffix")(a):t(a)}}const $5={name:"definition",tokenize:F5},U5={partial:!0,tokenize:q5};function F5(e,t,n){const i=this;let a;return l;function l(b){return e.enter("definition"),o(b)}function o(b){return H2.call(i,e,d,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function d(b){return a=dr(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),f):n(b)}function f(b){return Ht(b)?pu(e,h)(b):h(b)}function h(b){return q2(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function g(b){return e.attempt(U5,m,m)(b)}function m(b){return gt(b)?Et(e,y,"whitespace")(b):y(b)}function y(b){return b===null||Je(b)?(e.exit("definition"),i.parser.defined.push(a),t(b)):n(b)}}function q5(e,t,n){return i;function i(d){return Ht(d)?pu(e,a)(d):n(d)}function a(d){return K2(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function l(d){return gt(d)?Et(e,o,"whitespace")(d):o(d)}function o(d){return d===null||Je(d)?t(d):n(d)}}const H5={name:"hardBreakEscape",tokenize:K5};function K5(e,t,n){return i;function i(l){return e.enter("hardBreakEscape"),e.consume(l),a}function a(l){return Je(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const G5={name:"headingAtx",resolve:V5,tokenize:Y5};function V5(e,t){let n=e.length-2,i=3,a,l;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(a={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},l={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},ji(e,i,n-i+1,[["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t]])),e}function Y5(e,t,n){let i=0;return a;function a(g){return e.enter("atxHeading"),l(g)}function l(g){return e.enter("atxHeadingSequence"),o(g)}function o(g){return g===35&&i++<6?(e.consume(g),o):g===null||Ht(g)?(e.exit("atxHeadingSequence"),d(g)):n(g)}function d(g){return g===35?(e.enter("atxHeadingSequence"),f(g)):g===null||Je(g)?(e.exit("atxHeading"),t(g)):gt(g)?Et(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||Ht(g)?(e.exit("atxHeadingText"),d(g)):(e.consume(g),h)}}const Q5=["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"],Qk=["pre","script","style","textarea"],W5={concrete:!0,name:"htmlFlow",resolveTo:J5,tokenize:eB},X5={partial:!0,tokenize:nB},Z5={partial:!0,tokenize:tB};function J5(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 eB(e,t,n){const i=this;let a,l,o,d,f;return h;function h(B){return g(B)}function g(B){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(B),m}function m(B){return B===33?(e.consume(B),y):B===47?(e.consume(B),l=!0,v):B===63?(e.consume(B),a=3,i.interrupt?t:L):ni(B)?(e.consume(B),o=String.fromCharCode(B),N):n(B)}function y(B){return B===45?(e.consume(B),a=2,b):B===91?(e.consume(B),a=5,d=0,k):ni(B)?(e.consume(B),a=4,i.interrupt?t:L):n(B)}function b(B){return B===45?(e.consume(B),i.interrupt?t:L):n(B)}function k(B){const le="CDATA[";return B===le.charCodeAt(d++)?(e.consume(B),d===le.length?i.interrupt?t:F:k):n(B)}function v(B){return ni(B)?(e.consume(B),o=String.fromCharCode(B),N):n(B)}function N(B){if(B===null||B===47||B===62||Ht(B)){const le=B===47,ve=o.toLowerCase();return!le&&!l&&Qk.includes(ve)?(a=1,i.interrupt?t(B):F(B)):Q5.includes(o.toLowerCase())?(a=6,le?(e.consume(B),E):i.interrupt?t(B):F(B)):(a=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(B):l?C(B):S(B))}return B===45||Gn(B)?(e.consume(B),o+=String.fromCharCode(B),N):n(B)}function E(B){return B===62?(e.consume(B),i.interrupt?t:F):n(B)}function C(B){return gt(B)?(e.consume(B),C):I(B)}function S(B){return B===47?(e.consume(B),I):B===58||B===95||ni(B)?(e.consume(B),_):gt(B)?(e.consume(B),S):I(B)}function _(B){return B===45||B===46||B===58||B===95||Gn(B)?(e.consume(B),_):M(B)}function M(B){return B===61?(e.consume(B),T):gt(B)?(e.consume(B),M):S(B)}function T(B){return B===null||B===60||B===61||B===62||B===96?n(B):B===34||B===39?(e.consume(B),f=B,R):gt(B)?(e.consume(B),T):O(B)}function R(B){return B===f?(e.consume(B),f=null,$):B===null||Je(B)?n(B):(e.consume(B),R)}function O(B){return B===null||B===34||B===39||B===47||B===60||B===61||B===62||B===96||Ht(B)?M(B):(e.consume(B),O)}function $(B){return B===47||B===62||gt(B)?S(B):n(B)}function I(B){return B===62?(e.consume(B),q):n(B)}function q(B){return B===null||Je(B)?F(B):gt(B)?(e.consume(B),q):n(B)}function F(B){return B===45&&a===2?(e.consume(B),P):B===60&&a===1?(e.consume(B),H):B===62&&a===4?(e.consume(B),z):B===63&&a===3?(e.consume(B),L):B===93&&a===5?(e.consume(B),G):Je(B)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(X5,V,Y)(B)):B===null||Je(B)?(e.exit("htmlFlowData"),Y(B)):(e.consume(B),F)}function Y(B){return e.check(Z5,D,V)(B)}function D(B){return e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),K}function K(B){return B===null||Je(B)?Y(B):(e.enter("htmlFlowData"),F(B))}function P(B){return B===45?(e.consume(B),L):F(B)}function H(B){return B===47?(e.consume(B),o="",Q):F(B)}function Q(B){if(B===62){const le=o.toLowerCase();return Qk.includes(le)?(e.consume(B),z):F(B)}return ni(B)&&o.length<8?(e.consume(B),o+=String.fromCharCode(B),Q):F(B)}function G(B){return B===93?(e.consume(B),L):F(B)}function L(B){return B===62?(e.consume(B),z):B===45&&a===2?(e.consume(B),L):F(B)}function z(B){return B===null||Je(B)?(e.exit("htmlFlowData"),V(B)):(e.consume(B),z)}function V(B){return e.exit("htmlFlow"),t(B)}}function tB(e,t,n){const i=this;return a;function a(o){return Je(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l):n(o)}function l(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}function nB(e,t,n){return i;function i(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(Ju,t,n)}}const iB={name:"htmlText",tokenize:rB};function rB(e,t,n){const i=this;let a,l,o;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),M):L===63?(e.consume(L),S):ni(L)?(e.consume(L),O):n(L)}function h(L){return L===45?(e.consume(L),g):L===91?(e.consume(L),l=0,k):ni(L)?(e.consume(L),C):n(L)}function g(L){return L===45?(e.consume(L),b):n(L)}function m(L){return L===null?n(L):L===45?(e.consume(L),y):Je(L)?(o=m,H(L)):(e.consume(L),m)}function y(L){return L===45?(e.consume(L),b):m(L)}function b(L){return L===62?P(L):L===45?y(L):m(L)}function k(L){const z="CDATA[";return L===z.charCodeAt(l++)?(e.consume(L),l===z.length?v:k):n(L)}function v(L){return L===null?n(L):L===93?(e.consume(L),N):Je(L)?(o=v,H(L)):(e.consume(L),v)}function N(L){return L===93?(e.consume(L),E):v(L)}function E(L){return L===62?P(L):L===93?(e.consume(L),E):v(L)}function C(L){return L===null||L===62?P(L):Je(L)?(o=C,H(L)):(e.consume(L),C)}function S(L){return L===null?n(L):L===63?(e.consume(L),_):Je(L)?(o=S,H(L)):(e.consume(L),S)}function _(L){return L===62?P(L):S(L)}function M(L){return ni(L)?(e.consume(L),T):n(L)}function T(L){return L===45||Gn(L)?(e.consume(L),T):R(L)}function R(L){return Je(L)?(o=R,H(L)):gt(L)?(e.consume(L),R):P(L)}function O(L){return L===45||Gn(L)?(e.consume(L),O):L===47||L===62||Ht(L)?$(L):n(L)}function $(L){return L===47?(e.consume(L),P):L===58||L===95||ni(L)?(e.consume(L),I):Je(L)?(o=$,H(L)):gt(L)?(e.consume(L),$):P(L)}function I(L){return L===45||L===46||L===58||L===95||Gn(L)?(e.consume(L),I):q(L)}function q(L){return L===61?(e.consume(L),F):Je(L)?(o=q,H(L)):gt(L)?(e.consume(L),q):$(L)}function F(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),a=L,Y):Je(L)?(o=F,H(L)):gt(L)?(e.consume(L),F):(e.consume(L),D)}function Y(L){return L===a?(e.consume(L),a=void 0,K):L===null?n(L):Je(L)?(o=Y,H(L)):(e.consume(L),Y)}function D(L){return L===null||L===34||L===39||L===60||L===61||L===96?n(L):L===47||L===62||Ht(L)?$(L):(e.consume(L),D)}function K(L){return L===47||L===62||Ht(L)?$(L):n(L)}function P(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),t):n(L)}function H(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),Q}function Q(L){return gt(L)?Et(e,G,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):G(L)}function G(L){return e.enter("htmlTextData"),o(L)}}const Ex={name:"labelEnd",resolveAll:oB,resolveTo:cB,tokenize:uB},aB={tokenize:dB},sB={tokenize:fB},lB={tokenize:hB};function oB(e){let t=-1;const n=[];for(;++t<e.length;){const i=e[t][1];if(n.push(e[t]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const a=i.type==="labelImage"?4:2;i.type="data",t+=a}}return e.length!==n.length&&ji(e,0,e.length,n),e}function cB(e,t){let n=e.length,i=0,a,l,o,d;for(;n--;)if(a=e[n][1],l){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(l=n,a.type!=="labelLink")){i=2;break}}else a.type==="labelEnd"&&(o=n);const f={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[l][1].start},end:{...e[o][1].end}},g={type:"labelText",start:{...e[l+i+2][1].end},end:{...e[o-2][1].start}};return d=[["enter",f,t],["enter",h,t]],d=Hi(d,e.slice(l+1,l+i+3)),d=Hi(d,[["enter",g,t]]),d=Hi(d,ap(t.parser.constructs.insideSpan.null,e.slice(l+i+4,o-3),t)),d=Hi(d,[["exit",g,t],e[o-2],e[o-1],["exit",h,t]]),d=Hi(d,e.slice(o+1)),d=Hi(d,[["exit",f,t]]),ji(e,l,e.length,d),e}function uB(e,t,n){const i=this;let a=i.events.length,l,o;for(;a--;)if((i.events[a][1].type==="labelImage"||i.events[a][1].type==="labelLink")&&!i.events[a][1]._balanced){l=i.events[a][1];break}return d;function d(y){return l?l._inactive?m(y):(o=i.parser.defined.includes(dr(i.sliceSerialize({start:l.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),f):n(y)}function f(y){return y===40?e.attempt(aB,g,o?g:m)(y):y===91?e.attempt(sB,g,o?h:m)(y):o?g(y):m(y)}function h(y){return e.attempt(lB,g,m)(y)}function g(y){return t(y)}function m(y){return l._balanced=!0,n(y)}}function dB(e,t,n){return i;function i(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),a}function a(m){return Ht(m)?pu(e,l)(m):l(m)}function l(m){return m===41?g(m):q2(e,o,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function o(m){return Ht(m)?pu(e,f)(m):g(m)}function d(m){return n(m)}function f(m){return m===34||m===39||m===40?K2(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):g(m)}function h(m){return Ht(m)?pu(e,g)(m):g(m)}function g(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function fB(e,t,n){const i=this;return a;function a(d){return H2.call(i,e,l,o,"reference","referenceMarker","referenceString")(d)}function l(d){return i.parser.defined.includes(dr(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(d):n(d)}function o(d){return n(d)}}function hB(e,t,n){return i;function i(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),a}function a(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const pB={name:"labelStartImage",resolveAll:Ex.resolveAll,tokenize:mB};function mB(e,t,n){const i=this;return a;function a(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),l}function l(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),o):n(d)}function o(d){return d===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(d):t(d)}}const gB={name:"labelStartLink",resolveAll:Ex.resolveAll,tokenize:yB};function yB(e,t,n){const i=this;return a;function a(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),l}function l(o){return o===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(o):t(o)}}const Kg={name:"lineEnding",tokenize:bB};function bB(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),Et(e,t,"linePrefix")}}const nh={name:"thematicBreak",tokenize:xB};function xB(e,t,n){let i=0,a;return l;function l(h){return e.enter("thematicBreak"),o(h)}function o(h){return a=h,d(h)}function d(h){return h===a?(e.enter("thematicBreakSequence"),f(h)):i>=3&&(h===null||Je(h))?(e.exit("thematicBreak"),t(h)):n(h)}function f(h){return h===a?(e.consume(h),i++,f):(e.exit("thematicBreakSequence"),gt(h)?Et(e,d,"whitespace")(h):d(h))}}const ci={continuation:{tokenize:EB},exit:NB,name:"list",tokenize:kB},vB={partial:!0,tokenize:_B},wB={partial:!0,tokenize:SB};function kB(e,t,n){const i=this,a=i.events[i.events.length-1];let l=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,o=0;return d;function d(b){const k=i.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!i.containerState.marker||b===i.containerState.marker:tb(b)){if(i.containerState.type||(i.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(nh,n,h)(b):h(b);if(!i.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(b)}return n(b)}function f(b){return tb(b)&&++o<10?(e.consume(b),f):(!i.interrupt||o<2)&&(i.containerState.marker?b===i.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),h(b)):n(b)}function h(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||b,e.check(Ju,i.interrupt?n:g,e.attempt(vB,y,m))}function g(b){return i.containerState.initialBlankLine=!0,l++,y(b)}function m(b){return gt(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),y):n(b)}function y(b){return i.containerState.size=l+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function EB(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(Ju,a,l);function a(d){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Et(e,t,"listItemIndent",i.containerState.size+1)(d)}function l(d){return i.containerState.furtherBlankLines||!gt(d)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,o(d)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(wB,t,o)(d))}function o(d){return i.containerState._closeFlow=!0,i.interrupt=void 0,Et(e,e.attempt(ci,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function SB(e,t,n){const i=this;return Et(e,a,"listItemIndent",i.containerState.size+1);function a(l){const o=i.events[i.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===i.containerState.size?t(l):n(l)}}function NB(e){e.exit(this.containerState.type)}function _B(e,t,n){const i=this;return Et(e,a,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(l){const o=i.events[i.events.length-1];return!gt(l)&&o&&o[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const Wk={name:"setextUnderline",resolveTo:jB,tokenize:CB};function jB(e,t){let n=e.length,i,a,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const o={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",l?(e.splice(a,0,["enter",o,t]),e.splice(l+1,0,["exit",e[i][1],t]),e[i][1].end={...e[l][1].end}):e[i][1]=o,e.push(["exit",o,t]),e}function CB(e,t,n){const i=this;let a;return l;function l(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"),a=h,o(h)):n(h)}function o(h){return e.enter("setextHeadingLineSequence"),d(h)}function d(h){return h===a?(e.consume(h),d):(e.exit("setextHeadingLineSequence"),gt(h)?Et(e,f,"lineSuffix")(h):f(h))}function f(h){return h===null||Je(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const AB={tokenize:TB};function TB(e){const t=this,n=e.attempt(Ju,i,e.attempt(this.parser.constructs.flowInitial,a,Et(e,e.attempt(this.parser.constructs.flow,a,e.attempt(L5,a)),"linePrefix")));return n;function i(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const MB={resolveAll:V2()},DB=G2("string"),OB=G2("text");function G2(e){return{resolveAll:V2(e==="text"?RB:void 0),tokenize:t};function t(n){const i=this,a=this.parser.constructs[e],l=n.attempt(a,o,d);return o;function o(g){return h(g)?l(g):d(g)}function d(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),f}function f(g){return h(g)?(n.exit("data"),l(g)):(n.consume(g),f)}function h(g){if(g===null)return!0;const m=a[g];let y=-1;if(m)for(;++y<m.length;){const b=m[y];if(!b.previous||b.previous.call(i,i.previous))return!0}return!1}}}function V2(e){return t;function t(n,i){let a=-1,l;for(;++a<=n.length;)l===void 0?n[a]&&n[a][1].type==="data"&&(l=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==l+2&&(n[l][1].end=n[a-1][1].end,n.splice(l+2,a-l-2),a=l+2),l=void 0);return e?e(n,i):n}}function RB(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const i=e[n-1][1],a=t.sliceStream(i);let l=a.length,o=-1,d=0,f;for(;l--;){const h=a[l];if(typeof h=="string"){for(o=h.length;h.charCodeAt(o-1)===32;)d++,o--;if(o)break;o=-1}else if(h===-2)f=!0,d++;else if(h!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(d=0),d){const h={type:n===e.length||f||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?o:i.start._bufferIndex+o,_index:i.start._index+l,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(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const LB={42:ci,43:ci,45:ci,48:ci,49:ci,50:ci,51:ci,52:ci,53:ci,54:ci,55:ci,56:ci,57:ci,62:B2},IB={91:$5},zB={[-2]:Hg,[-1]:Hg,32:Hg},PB={35:G5,42:nh,45:[Wk,nh],60:W5,61:Wk,95:nh,96:Yk,126:Yk},BB={38:U2,92:$2},$B={[-5]:Kg,[-4]:Kg,[-3]:Kg,33:pB,38:U2,42:nb,60:[g5,iB],91:gB,92:[H5,$2],93:Ex,95:nb,96:A5},UB={null:[nb,MB]},FB={null:[42,95]},qB={null:[]},HB=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:FB,contentInitial:IB,disable:qB,document:LB,flow:PB,flowInitial:zB,insideSpan:UB,string:BB,text:$B},Symbol.toStringTag,{value:"Module"}));function KB(e,t,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},l=[];let o=[],d=[];const f={attempt:R(M),check:R(T),consume:C,enter:S,exit:_,interrupt:R(T,{interrupt:!0})},h={code:null,containerState:{},defineSkip:v,events:[],now:k,parser:e,previous:null,sliceSerialize:y,sliceStream:b,write:m};let g=t.tokenize.call(h,f);return t.resolveAll&&l.push(t),h;function m(q){return o=Hi(o,q),N(),o[o.length-1]!==null?[]:(O(t,0),h.events=ap(l,h.events,h),h.events)}function y(q,F){return VB(b(q),F)}function b(q){return GB(o,q)}function k(){const{_bufferIndex:q,_index:F,line:Y,column:D,offset:K}=i;return{_bufferIndex:q,_index:F,line:Y,column:D,offset:K}}function v(q){a[q.line]=q.column,I()}function N(){let q;for(;i._index<o.length;){const F=o[i._index];if(typeof F=="string")for(q=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===q&&i._bufferIndex<F.length;)E(F.charCodeAt(i._bufferIndex));else E(F)}}function E(q){g=g(q)}function C(q){Je(q)?(i.line++,i.column=1,i.offset+=q===-3?2:1,I()):q!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===o[i._index].length&&(i._bufferIndex=-1,i._index++)),h.previous=q}function S(q,F){const Y=F||{};return Y.type=q,Y.start=k(),h.events.push(["enter",Y,h]),d.push(Y),Y}function _(q){const F=d.pop();return F.end=k(),h.events.push(["exit",F,h]),F}function M(q,F){O(q,F.from)}function T(q,F){F.restore()}function R(q,F){return Y;function Y(D,K,P){let H,Q,G,L;return Array.isArray(D)?V(D):"tokenize"in D?V([D]):z(D);function z(ke){return Se;function Se(J){const ue=J!==null&&ke[J],Te=J!==null&&ke.null,Re=[...Array.isArray(ue)?ue:ue?[ue]:[],...Array.isArray(Te)?Te:Te?[Te]:[]];return V(Re)(J)}}function V(ke){return H=ke,Q=0,ke.length===0?P:B(ke[Q])}function B(ke){return Se;function Se(J){return L=$(),G=ke,ke.partial||(h.currentConstruct=ke),ke.name&&h.parser.constructs.disable.null.includes(ke.name)?ve():ke.tokenize.call(F?Object.assign(Object.create(h),F):h,f,le,ve)(J)}}function le(ke){return q(G,L),K}function ve(ke){return L.restore(),++Q<H.length?B(H[Q]):P}}}function O(q,F){q.resolveAll&&!l.includes(q)&&l.push(q),q.resolve&&ji(h.events,F,h.events.length-F,q.resolve(h.events.slice(F),h)),q.resolveTo&&(h.events=q.resolveTo(h.events,h))}function $(){const q=k(),F=h.previous,Y=h.currentConstruct,D=h.events.length,K=Array.from(d);return{from:D,restore:P};function P(){i=q,h.previous=F,h.currentConstruct=Y,h.events.length=D,d=K,I()}}function I(){i.line in a&&i.column<2&&(i.column=a[i.line],i.offset+=a[i.line]-1)}}function GB(e,t){const n=t.start._index,i=t.start._bufferIndex,a=t.end._index,l=t.end._bufferIndex;let o;if(n===a)o=[e[n].slice(i,l)];else{if(o=e.slice(n,a),i>-1){const d=o[0];typeof d=="string"?o[0]=d.slice(i):o.shift()}l>0&&o.push(e[a].slice(0,l))}return o}function VB(e,t){let n=-1;const i=[];let a;for(;++n<e.length;){const l=e[n];let o;if(typeof l=="string")o=l;else switch(l){case-5:{o="\r";break}case-4:{o=`
618
+ `;break}case-3:{o=`\r
619
+ `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&a)continue;o=" ";break}default:o=String.fromCharCode(l)}a=l===-2,i.push(o)}return i.join("")}function YB(e){const i={constructs:z2([HB,...(e||{}).extensions||[]]),content:a(c5),defined:[],document:a(d5),flow:a(AB),lazy:{},string:a(DB),text:a(OB)};return i;function a(l){return o;function o(d){return KB(i,l,d)}}}function QB(e){for(;!F2(e););return e}const Xk=/[\0\t\n\r]/g;function WB(){let e=1,t="",n=!0,i;return a;function a(l,o,d){const f=[];let h,g,m,y,b;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(o||void 0).decode(l)),m=0,t="",n&&(l.charCodeAt(0)===65279&&m++,n=void 0);m<l.length;){if(Xk.lastIndex=m,h=Xk.exec(l),y=h&&h.index!==void 0?h.index:l.length,b=l.charCodeAt(y),!h){t=l.slice(m);break}if(b===10&&m===y&&i)f.push(-3),i=void 0;else switch(i&&(f.push(-5),i=void 0),m<y&&(f.push(l.slice(m,y)),e+=y-m),b){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=y+1}return d&&(i&&f.push(-5),t&&f.push(t),f.push(null)),f}}const XB=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ZB(e){return e.replace(XB,JB)}function JB(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),l=a===120||a===88;return P2(n.slice(l?2:1),l?16:10)}return kx(n)||e}const Y2={}.hasOwnProperty;function e6(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),t6(n)(QB(YB(n).document().write(WB()(e,t,!0))))}function t6(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(ae),autolinkProtocol:$,autolinkEmail:$,atxHeading:l(te),blockQuote:l(Te),characterEscape:$,characterReference:$,codeFenced:l(Re),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:l(Re,o),codeText:l(De,o),codeTextData:$,data:$,codeFlowValue:$,definition:l(ce),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:l(Ce),hardBreakEscape:l(pe),hardBreakTrailing:l(pe),htmlFlow:l(Fe,o),htmlFlowData:$,htmlText:l(Fe,o),htmlTextData:$,image:l(ze),label:o,link:l(ae),listItem:l(ye),listItemValue:y,listOrdered:l(be,m),listUnordered:l(be),paragraph:l(he),reference:B,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:l(te),strong:l(Ee),thematicBreak:l(Ke)},exit:{atxHeading:f(),atxHeadingSequence:M,autolink:f(),autolinkEmail:ue,autolinkProtocol:J,blockQuote:f(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:ve,characterReferenceMarkerNumeric:ve,characterReferenceValue:ke,characterReference:Se,codeFenced:f(N),codeFencedFence:v,codeFencedFenceInfo:b,codeFencedFenceMeta:k,codeFlowValue:I,codeIndented:f(E),codeText:f(K),codeTextData:I,data:I,definition:f(),definitionDestinationString:_,definitionLabelString:C,definitionTitleString:S,emphasis:f(),hardBreakEscape:f(F),hardBreakTrailing:f(F),htmlFlow:f(Y),htmlFlowData:I,htmlText:f(D),htmlTextData:I,image:f(H),label:G,labelText:Q,lineEnding:q,link:f(P),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:le,resourceDestinationString:L,resourceTitleString:z,resource:V,setextHeading:f(O),setextHeadingLineSequence:R,setextHeadingText:T,strong:f(),thematicBreak:f()}};Q2(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(ne){let de={type:"root",children:[]};const Le={stack:[de],tokenStack:[],config:t,enter:d,exit:h,buffer:o,resume:g,data:n},Ze=[];let rt=-1;for(;++rt<ne.length;)if(ne[rt][1].type==="listOrdered"||ne[rt][1].type==="listUnordered")if(ne[rt][0]==="enter")Ze.push(rt);else{const At=Ze.pop();rt=a(ne,At,rt)}for(rt=-1;++rt<ne.length;){const At=t[ne[rt][0]];Y2.call(At,ne[rt][1].type)&&At[ne[rt][1].type].call(Object.assign({sliceSerialize:ne[rt][2].sliceSerialize},Le),ne[rt][1])}if(Le.tokenStack.length>0){const At=Le.tokenStack[Le.tokenStack.length-1];(At[1]||Zk).call(Le,void 0,At[0])}for(de.position={start:ns(ne.length>0?ne[0][1].start:{line:1,column:1,offset:0}),end:ns(ne.length>0?ne[ne.length-2][1].end:{line:1,column:1,offset:0})},rt=-1;++rt<t.transforms.length;)de=t.transforms[rt](de)||de;return de}function a(ne,de,Le){let Ze=de-1,rt=-1,At=!1,$n,dn,Mt,Qt;for(;++Ze<=Le;){const yt=ne[Ze];switch(yt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{yt[0]==="enter"?rt++:rt--,Qt=void 0;break}case"lineEndingBlank":{yt[0]==="enter"&&($n&&!Qt&&!rt&&!Mt&&(Mt=Ze),Qt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Qt=void 0}if(!rt&&yt[0]==="enter"&&yt[1].type==="listItemPrefix"||rt===-1&&yt[0]==="exit"&&(yt[1].type==="listUnordered"||yt[1].type==="listOrdered")){if($n){let Ti=Ze;for(dn=void 0;Ti--;){const Rn=ne[Ti];if(Rn[1].type==="lineEnding"||Rn[1].type==="lineEndingBlank"){if(Rn[0]==="exit")continue;dn&&(ne[dn][1].type="lineEndingBlank",At=!0),Rn[1].type="lineEnding",dn=Ti}else if(!(Rn[1].type==="linePrefix"||Rn[1].type==="blockQuotePrefix"||Rn[1].type==="blockQuotePrefixWhitespace"||Rn[1].type==="blockQuoteMarker"||Rn[1].type==="listItemIndent"))break}Mt&&(!dn||Mt<dn)&&($n._spread=!0),$n.end=Object.assign({},dn?ne[dn][1].start:yt[1].end),ne.splice(dn||Ze,0,["exit",$n,yt[2]]),Ze++,Le++}if(yt[1].type==="listItemPrefix"){const Ti={type:"listItem",_spread:!1,start:Object.assign({},yt[1].start),end:void 0};$n=Ti,ne.splice(Ze,0,["enter",Ti,yt[2]]),Ze++,Le++,Mt=void 0,Qt=!0}}}return ne[de][1]._spread=At,Le}function l(ne,de){return Le;function Le(Ze){d.call(this,ne(Ze),Ze),de&&de.call(this,Ze)}}function o(){this.stack.push({type:"fragment",children:[]})}function d(ne,de,Le){this.stack[this.stack.length-1].children.push(ne),this.stack.push(ne),this.tokenStack.push([de,Le||void 0]),ne.position={start:ns(de.start),end:void 0}}function f(ne){return de;function de(Le){ne&&ne.call(this,Le),h.call(this,Le)}}function h(ne,de){const Le=this.stack.pop(),Ze=this.tokenStack.pop();if(Ze)Ze[0].type!==ne.type&&(de?de.call(this,ne,Ze[0]):(Ze[1]||Zk).call(this,ne,Ze[0]));else throw new Error("Cannot close `"+ne.type+"` ("+hu({start:ne.start,end:ne.end})+"): it’s not open");Le.position.end=ns(ne.end)}function g(){return wx(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function y(ne){if(this.data.expectingFirstListItemValue){const de=this.stack[this.stack.length-2];de.start=Number.parseInt(this.sliceSerialize(ne),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.lang=ne}function k(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.meta=ne}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne.replace(/(\r?\n|\r)$/g,"")}function C(ne){const de=this.resume(),Le=this.stack[this.stack.length-1];Le.label=de,Le.identifier=dr(this.sliceSerialize(ne)).toLowerCase()}function S(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.title=ne}function _(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.url=ne}function M(ne){const de=this.stack[this.stack.length-1];if(!de.depth){const Le=this.sliceSerialize(ne).length;de.depth=Le}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function R(ne){const de=this.stack[this.stack.length-1];de.depth=this.sliceSerialize(ne).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function $(ne){const Le=this.stack[this.stack.length-1].children;let Ze=Le[Le.length-1];(!Ze||Ze.type!=="text")&&(Ze=Ne(),Ze.position={start:ns(ne.start),end:void 0},Le.push(Ze)),this.stack.push(Ze)}function I(ne){const de=this.stack.pop();de.value+=this.sliceSerialize(ne),de.position.end=ns(ne.end)}function q(ne){const de=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Le=de.children[de.children.length-1];Le.position.end=ns(ne.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(de.type)&&($.call(this,ne),I.call(this,ne))}function F(){this.data.atHardBreak=!0}function Y(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne}function D(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne}function K(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne}function P(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=de,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function H(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=de,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function Q(ne){const de=this.sliceSerialize(ne),Le=this.stack[this.stack.length-2];Le.label=ZB(de),Le.identifier=dr(de).toLowerCase()}function G(){const ne=this.stack[this.stack.length-1],de=this.resume(),Le=this.stack[this.stack.length-1];if(this.data.inReference=!0,Le.type==="link"){const Ze=ne.children;Le.children=Ze}else Le.alt=de}function L(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.url=ne}function z(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.title=ne}function V(){this.data.inReference=void 0}function B(){this.data.referenceType="collapsed"}function le(ne){const de=this.resume(),Le=this.stack[this.stack.length-1];Le.label=de,Le.identifier=dr(this.sliceSerialize(ne)).toLowerCase(),this.data.referenceType="full"}function ve(ne){this.data.characterReferenceType=ne.type}function ke(ne){const de=this.sliceSerialize(ne),Le=this.data.characterReferenceType;let Ze;Le?(Ze=P2(de,Le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ze=kx(de);const rt=this.stack[this.stack.length-1];rt.value+=Ze}function Se(ne){const de=this.stack.pop();de.position.end=ns(ne.end)}function J(ne){I.call(this,ne);const de=this.stack[this.stack.length-1];de.url=this.sliceSerialize(ne)}function ue(ne){I.call(this,ne);const de=this.stack[this.stack.length-1];de.url="mailto:"+this.sliceSerialize(ne)}function Te(){return{type:"blockquote",children:[]}}function Re(){return{type:"code",lang:null,meta:null,value:""}}function De(){return{type:"inlineCode",value:""}}function ce(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ce(){return{type:"emphasis",children:[]}}function te(){return{type:"heading",depth:0,children:[]}}function pe(){return{type:"break"}}function Fe(){return{type:"html",value:""}}function ze(){return{type:"image",title:null,url:"",alt:null}}function ae(){return{type:"link",title:null,url:"",children:[]}}function be(ne){return{type:"list",ordered:ne.type==="listOrdered",start:null,spread:ne._spread,children:[]}}function ye(ne){return{type:"listItem",spread:ne._spread,checked:null,children:[]}}function he(){return{type:"paragraph",children:[]}}function Ee(){return{type:"strong",children:[]}}function Ne(){return{type:"text",value:""}}function Ke(){return{type:"thematicBreak"}}}function ns(e){return{line:e.line,column:e.column,offset:e.offset}}function Q2(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?Q2(e,i):n6(e,i)}}function n6(e,t){let n;for(n in t)if(Y2.call(t,n))switch(n){case"canContainEols":{const i=t[n];i&&e[n].push(...i);break}case"transforms":{const i=t[n];i&&e[n].push(...i);break}case"enter":case"exit":{const i=t[n];i&&Object.assign(e[n],i);break}}}function Zk(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+hu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+hu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+hu({start:t.start,end:t.end})+") is still open")}function i6(e){const t=this;t.parser=n;function n(i){return e6(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function r6(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function a6(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
620
+ `}]}function s6(e,t){const n=t.value?t.value+`
621
+ `:"",i={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(i.className=["language-"+a[0]]);let l={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function l6(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function o6(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function c6(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),a=lc(i.toLowerCase()),l=e.footnoteOrder.indexOf(i);let o,d=e.footnoteCounts.get(i);d===void 0?(d=0,e.footnoteOrder.push(i),o=e.footnoteOrder.length):o=l+1,d+=1,e.footnoteCounts.set(i,d);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,f);const h={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,h),e.applyData(t,h)}function u6(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function d6(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function W2(e,t){const n=t.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const a=e.all(t),l=a[0];l&&l.type==="text"?l.value="["+l.value:a.unshift({type:"text",value:"["});const o=a[a.length-1];return o&&o.type==="text"?o.value+=i:a.push({type:"text",value:i}),a}function f6(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return W2(e,t);const a={src:lc(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(a.title=i.title);const l={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,l),e.applyData(t,l)}function h6(e,t){const n={src:lc(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)}function p6(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,i),e.applyData(t,i)}function m6(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return W2(e,t);const a={href:lc(i.url||"")};i.title!==null&&i.title!==void 0&&(a.title=i.title);const l={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function g6(e,t){const n={href:lc(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function y6(e,t,n){const i=e.all(t),a=n?b6(n):X2(t),l={},o=[];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:[]}),l.className=["task-list-item"]}let d=-1;for(;++d<i.length;){const g=i[d];(a||d!==0||g.type!=="element"||g.tagName!=="p")&&o.push({type:"text",value:`
622
+ `}),g.type==="element"&&g.tagName==="p"&&!a?o.push(...g.children):o.push(g)}const f=i[i.length-1];f&&(a||f.type!=="element"||f.tagName!=="p")&&o.push({type:"text",value:`
623
+ `});const h={type:"element",tagName:"li",properties:l,children:o};return e.patch(t,h),e.applyData(t,h)}function b6(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let i=-1;for(;!t&&++i<n.length;)t=X2(n[i])}return t}function X2(e){const t=e.spread;return t??e.children.length>1}function x6(e,t){const n={},i=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<i.length;){const o=i[a];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(i,!0)};return e.patch(t,l),e.applyData(t,l)}function v6(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function w6(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function k6(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function E6(e,t){const n=e.all(t),i=n.shift(),a=[];if(i){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(t.children[0],o),a.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},d=yx(t.children[1]),f=T2(t.children[t.children.length-1]);d&&f&&(o.position={start:d,end:f}),a.push(o)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,l),e.applyData(t,l)}function S6(e,t,n){const i=n?n.children:void 0,l=(i?i.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,d=o?o.length:t.children.length;let f=-1;const h=[];for(;++f<d;){const m=t.children[f],y={},b=o?o[f]:void 0;b&&(y.align=b);let k={type:"element",tagName:l,properties:y,children:[]};m&&(k.children=e.all(m),e.patch(m,k),k=e.applyData(m,k)),h.push(k)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,g),e.applyData(t,g)}function N6(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Jk=9,eE=32;function _6(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),a=0;const l=[];for(;i;)l.push(tE(t.slice(a,i.index),a>0,!0),i[0]),a=i.index+i[0].length,i=n.exec(t);return l.push(tE(t.slice(a),a>0,!1)),l.join("")}function tE(e,t,n){let i=0,a=e.length;if(t){let l=e.codePointAt(i);for(;l===Jk||l===eE;)i++,l=e.codePointAt(i)}if(n){let l=e.codePointAt(a-1);for(;l===Jk||l===eE;)a--,l=e.codePointAt(a-1)}return a>i?e.slice(i,a):""}function j6(e,t){const n={type:"text",value:_6(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function C6(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const A6={blockquote:r6,break:a6,code:s6,delete:l6,emphasis:o6,footnoteReference:c6,heading:u6,html:d6,imageReference:f6,image:h6,inlineCode:p6,linkReference:m6,link:g6,listItem:y6,list:x6,paragraph:v6,root:w6,strong:k6,table:E6,tableCell:N6,tableRow:S6,text:j6,thematicBreak:C6,toml:Tf,yaml:Tf,definition:Tf,footnoteDefinition:Tf};function Tf(){}const Z2=-1,sp=0,mu=1,vh=2,Sx=3,Nx=4,_x=5,jx=6,J2=7,ej=8,nE=typeof self=="object"?self:globalThis,T6=(e,t)=>{const n=(a,l)=>(e.set(l,a),a),i=a=>{if(e.has(a))return e.get(a);const[l,o]=t[a];switch(l){case sp:case Z2:return n(o,a);case mu:{const d=n([],a);for(const f of o)d.push(i(f));return d}case vh:{const d=n({},a);for(const[f,h]of o)d[i(f)]=i(h);return d}case Sx:return n(new Date(o),a);case Nx:{const{source:d,flags:f}=o;return n(new RegExp(d,f),a)}case _x:{const d=n(new Map,a);for(const[f,h]of o)d.set(i(f),i(h));return d}case jx:{const d=n(new Set,a);for(const f of o)d.add(i(f));return d}case J2:{const{name:d,message:f}=o;return n(new nE[d](f),a)}case ej:return n(BigInt(o),a);case"BigInt":return n(Object(BigInt(o)),a);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:d}=new Uint8Array(o);return n(new DataView(d),o)}}return n(new nE[l](o),a)};return i},iE=e=>T6(new Map,e)(0),co="",{toString:M6}={},{keys:D6}=Object,ru=e=>{const t=typeof e;if(t!=="object"||!e)return[sp,t];const n=M6.call(e).slice(8,-1);switch(n){case"Array":return[mu,co];case"Object":return[vh,co];case"Date":return[Sx,co];case"RegExp":return[Nx,co];case"Map":return[_x,co];case"Set":return[jx,co];case"DataView":return[mu,n]}return n.includes("Array")?[mu,n]:n.includes("Error")?[J2,n]:[vh,n]},Mf=([e,t])=>e===sp&&(t==="function"||t==="symbol"),O6=(e,t,n,i)=>{const a=(o,d)=>{const f=i.push(o)-1;return n.set(d,f),f},l=o=>{if(n.has(o))return n.get(o);let[d,f]=ru(o);switch(d){case sp:{let g=o;switch(f){case"bigint":d=ej,g=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);g=null;break;case"undefined":return a([Z2],o)}return a([d,g],o)}case mu:{if(f){let y=o;return f==="DataView"?y=new Uint8Array(o.buffer):f==="ArrayBuffer"&&(y=new Uint8Array(o)),a([f,[...y]],o)}const g=[],m=a([d,g],o);for(const y of o)g.push(l(y));return m}case vh:{if(f)switch(f){case"BigInt":return a([f,o.toString()],o);case"Boolean":case"Number":case"String":return a([f,o.valueOf()],o)}if(t&&"toJSON"in o)return l(o.toJSON());const g=[],m=a([d,g],o);for(const y of D6(o))(e||!Mf(ru(o[y])))&&g.push([l(y),l(o[y])]);return m}case Sx:return a([d,o.toISOString()],o);case Nx:{const{source:g,flags:m}=o;return a([d,{source:g,flags:m}],o)}case _x:{const g=[],m=a([d,g],o);for(const[y,b]of o)(e||!(Mf(ru(y))||Mf(ru(b))))&&g.push([l(y),l(b)]);return m}case jx:{const g=[],m=a([d,g],o);for(const y of o)(e||!Mf(ru(y)))&&g.push(l(y));return m}}const{message:h}=o;return a([d,{name:f,message:h}],o)};return l},rE=(e,{json:t,lossy:n}={})=>{const i=[];return O6(!(t||n),!!t,new Map,i)(e),i},wh=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?iE(rE(e,t)):structuredClone(e):(e,t)=>iE(rE(e,t));function R6(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function L6(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function I6(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||R6,i=e.options.footnoteBackLabel||L6,a=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",o=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(),y=lc(m.toLowerCase());let b=0;const k=[],v=e.footnoteCounts.get(m);for(;v!==void 0&&++b<=v;){k.length>0&&k.push({type:"text",value:" "});let C=typeof n=="string"?n:n(f,b);typeof C=="string"&&(C={type:"text",value:C}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(f,b),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const N=g[g.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const C=N.children[N.children.length-1];C&&C.type==="text"?C.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...k)}else g.push(...k);const E={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(g,!0)};e.patch(h,E),d.push(E)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...wh(o),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
624
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
625
+ `}]}}const ed=(function(e){if(e==null)return $6;if(typeof e=="function")return lp(e);if(typeof e=="object")return Array.isArray(e)?z6(e):P6(e);if(typeof e=="string")return B6(e);throw new Error("Expected function, string, or object as test")});function z6(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ed(e[n]);return lp(i);function i(...a){let l=-1;for(;++l<t.length;)if(t[l].apply(this,a))return!0;return!1}}function P6(e){const t=e;return lp(n);function n(i){const a=i;let l;for(l in e)if(a[l]!==t[l])return!1;return!0}}function B6(e){return lp(t);function t(n){return n&&n.type===e}}function lp(e){return t;function t(n,i,a){return!!(U6(n)&&e.call(this,n,typeof i=="number"?i:void 0,a||void 0))}}function $6(){return!0}function U6(e){return e!==null&&typeof e=="object"&&"type"in e}const tj=[],F6=!0,ib=!1,q6="skip";function nj(e,t,n,i){let a;typeof t=="function"&&typeof n!="function"?(i=n,n=t):a=t;const l=ed(a),o=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 b=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(f.type+(b?"<"+b+">":""))+")"})}return y;function y(){let b=tj,k,v,N;if((!t||l(f,h,g[g.length-1]||void 0))&&(b=H6(n(f,g)),b[0]===ib))return b;if("children"in f&&f.children){const E=f;if(E.children&&b[0]!==q6)for(v=(i?E.children.length:-1)+o,N=g.concat(E);v>-1&&v<E.children.length;){const C=E.children[v];if(k=d(C,v,N)(),k[0]===ib)return k;v=typeof k[1]=="number"?k[1]:v+o}}return b}}}function H6(e){return Array.isArray(e)?e:typeof e=="number"?[F6,e]:e==null?tj:[e]}function op(e,t,n,i){let a,l,o;typeof t=="function"&&typeof n!="function"?(l=void 0,o=t,a=n):(l=t,o=n,a=i),nj(e,l,d,a);function d(f,h){const g=h[h.length-1],m=g?g.children.indexOf(f):void 0;return o(f,m,g)}}const rb={}.hasOwnProperty,K6={};function G6(e,t){const n=t||K6,i=new Map,a=new Map,l=new Map,o={...A6,...n.handlers},d={all:h,applyData:Y6,definitionById:i,footnoteById:a,footnoteCounts:l,footnoteOrder:[],handlers:o,one:f,options:n,patch:V6,wrap:W6};return op(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const m=g.type==="definition"?i:a,y=String(g.identifier).toUpperCase();m.has(y)||m.set(y,g)}}),d;function f(g,m){const y=g.type,b=d.handlers[y];if(rb.call(d.handlers,y)&&b)return b(d,g,m);if(d.options.passThrough&&d.options.passThrough.includes(y)){if("children"in g){const{children:v,...N}=g,E=wh(N);return E.children=d.all(g),E}return wh(g)}return(d.options.unknownHandler||Q6)(d,g,m)}function h(g){const m=[];if("children"in g){const y=g.children;let b=-1;for(;++b<y.length;){const k=d.one(y[b],g);if(k){if(b&&y[b-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=aE(k.value)),!Array.isArray(k)&&k.type==="element")){const v=k.children[0];v&&v.type==="text"&&(v.value=aE(v.value))}Array.isArray(k)?m.push(...k):m.push(k)}}}return m}}function V6(e,t){e.position&&(t.position=LP(e))}function Y6(e,t){let n=t;if(e&&e.data){const i=e.data.hName,a=e.data.hChildren,l=e.data.hProperties;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const o="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:o}}n.type==="element"&&l&&Object.assign(n.properties,wh(l)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function Q6(e,t){const n=t.data||{},i="value"in t&&!(rb.call(n,"hProperties")||rb.call(n,"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 W6(e,t){const n=[];let i=-1;for(t&&n.push({type:"text",value:`
626
+ `});++i<e.length;)i&&n.push({type:"text",value:`
627
+ `}),n.push(e[i]);return t&&e.length>0&&n.push({type:"text",value:`
628
+ `}),n}function aE(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function sE(e,t){const n=G6(e,t),i=n.one(e,void 0),a=I6(n),l=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return a&&l.children.push({type:"text",value:`
629
+ `},a),l}function X6(e,t){return e&&"run"in e?async function(n,i){const a=sE(n,{file:i,...t});await e.run(a,i)}:function(n,i){return sE(n,{file:i,...e||t})}}function lE(e){if(e)throw e}var Gg,oE;function Z6(){if(oE)return Gg;oE=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},l=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 y;for(y in h);return typeof y>"u"||e.call(h,y)},o=function(h,g){n&&g.name==="__proto__"?n(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 Gg=function f(){var h,g,m,y,b,k,v=arguments[0],N=1,E=arguments.length,C=!1;for(typeof v=="boolean"&&(C=v,v=arguments[1]||{},N=2),(v==null||typeof v!="object"&&typeof v!="function")&&(v={});N<E;++N)if(h=arguments[N],h!=null)for(g in h)m=d(v,g),y=d(h,g),v!==y&&(C&&y&&(l(y)||(b=a(y)))?(b?(b=!1,k=m&&a(m)?m:[]):k=m&&l(m)?m:{},o(v,{name:g,newValue:f(C,k,y)})):typeof y<"u"&&o(v,{name:g,newValue:y}));return v},Gg}var J6=Z6();const Vg=qu(J6);function ab(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 e$(){const e=[],t={run:n,use:i};return t;function n(...a){let l=-1;const o=a.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);d(null,...a);function d(f,...h){const g=e[++l];let m=-1;if(f){o(f);return}for(;++m<a.length;)(h[m]===null||h[m]===void 0)&&(h[m]=a[m]);a=h,g?t$(g,d)(...h):o(null,...h)}}function i(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function t$(e,t){let n;return i;function i(...o){const d=e.length>o.length;let f;d&&o.push(a);try{f=e.apply(this,o)}catch(h){const g=h;if(d&&n)throw g;return a(g)}d||(f&&f.then&&typeof f.then=="function"?f.then(l,a):f instanceof Error?a(f):l(f))}function a(o,...d){n||(n=!0,t(o,...d))}function l(o){a(null,o)}}const Nr={basename:n$,dirname:i$,extname:r$,join:a$,sep:"/"};function n$(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');td(e);let n=0,i=-1,a=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(l){n=a+1;break}}else i<0&&(l=!0,i=a+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let o=-1,d=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(l){n=a+1;break}}else o<0&&(l=!0,o=a+1),d>-1&&(e.codePointAt(a)===t.codePointAt(d--)?d<0&&(i=a):(d=-1,i=o));return n===i?i=o:i<0&&(i=e.length),e.slice(n,i)}function i$(e){if(td(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function r$(e){td(e);let t=e.length,n=-1,i=0,a=-1,l=0,o;for(;t--;){const d=e.codePointAt(t);if(d===47){if(o){i=t+1;break}continue}n<0&&(o=!0,n=t+1),d===46?a<0?a=t:l!==1&&(l=1):a>-1&&(l=-1)}return a<0||n<0||l===0||l===1&&a===n-1&&a===i+1?"":e.slice(a,n)}function a$(...e){let t=-1,n;for(;++t<e.length;)td(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":s$(n)}function s$(e){td(e);const t=e.codePointAt(0)===47;let n=l$(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function l$(e,t){let n="",i=0,a=-1,l=0,o=-1,d,f;for(;++o<=e.length;){if(o<e.length)d=e.codePointAt(o);else{if(d===47)break;d=47}if(d===47){if(!(a===o-1||l===1))if(a!==o-1&&l===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",i=0):(n=n.slice(0,f),i=n.length-1-n.lastIndexOf("/")),a=o,l=0;continue}}else if(n.length>0){n="",i=0,a=o,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(a+1,o):n=e.slice(a+1,o),i=o-a-1;a=o,l=0}else d===46&&l>-1?l++:l=-1}return n}function td(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const o$={cwd:c$};function c$(){return"/"}function sb(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function u$(e){if(typeof e=="string")e=new URL(e);else if(!sb(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 d$(e)}function d$(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 n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const i=t.codePointAt(n+2);if(i===70||i===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const Yg=["history","path","basename","stem","extname","dirname"];class ij{constructor(t){let n;t?sb(t)?n={path:t}:typeof t=="string"||f$(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":o$.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<Yg.length;){const l=Yg[i];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let a;for(a in n)Yg.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?Nr.basename(this.path):void 0}set basename(t){Wg(t,"basename"),Qg(t,"basename"),this.path=Nr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Nr.dirname(this.path):void 0}set dirname(t){cE(this.basename,"dirname"),this.path=Nr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Nr.extname(this.path):void 0}set extname(t){if(Qg(t,"extname"),cE(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=Nr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){sb(t)&&(t=u$(t)),Wg(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Nr.basename(this.path,this.extname):void 0}set stem(t){Wg(t,"stem"),Qg(t,"stem"),this.path=Nr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,i){const a=this.message(t,n,i);throw a.fatal=!0,a}info(t,n,i){const a=this.message(t,n,i);return a.fatal=void 0,a}message(t,n,i){const a=new Yn(t,n,i);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Qg(e,t){if(e&&e.includes(Nr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Nr.sep+"`")}function Wg(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function cE(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function f$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const h$=(function(e){const i=this.constructor.prototype,a=i[e],l=function(){return a.apply(l,arguments)};return Object.setPrototypeOf(l,i),l}),p$={}.hasOwnProperty;class Cx extends h${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=e$()}copy(){const t=new Cx;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(Vg(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Jg("data",this.frozen),this.namespace[t]=n,this):p$.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Jg("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[n,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const a=n.call(t,...i);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Df(t),i=this.parser||this.Parser;return Xg("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),Xg("process",this.parser||this.Parser),Zg("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(l,o){const d=Df(t),f=i.parse(d);i.run(f,d,function(g,m,y){if(g||!m||!y)return h(g);const b=m,k=i.stringify(b,y);y$(k)?y.value=k:y.result=k,h(g,y)});function h(g,m){g||!m?o(g):l?l(m):n(void 0,m)}}}processSync(t){let n=!1,i;return this.freeze(),Xg("processSync",this.parser||this.Parser),Zg("processSync",this.compiler||this.Compiler),this.process(t,a),dE("processSync","process",n),i;function a(l,o){n=!0,lE(l),i=o}}run(t,n,i){uE(t),this.freeze();const a=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?l(void 0,i):new Promise(l);function l(o,d){const f=Df(n);a.run(t,f,h);function h(g,m,y){const b=m||t;g?d(g):o?o(b):i(void 0,b,y)}}}runSync(t,n){let i=!1,a;return this.run(t,n,l),dE("runSync","run",i),a;function l(o,d){lE(o),a=d,i=!0}}stringify(t,n){this.freeze();const i=Df(n),a=this.compiler||this.Compiler;return Zg("stringify",a),uE(t),a(t,i)}use(t,...n){const i=this.attachers,a=this.namespace;if(Jg("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?d(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(h){if(typeof h=="function")f(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[g,...m]=h;f(g,m)}else o(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function o(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&&(a.settings=Vg(!0,a.settings,h.settings))}function d(h){let g=-1;if(h!=null)if(Array.isArray(h))for(;++g<h.length;){const m=h[g];l(m)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function f(h,g){let m=-1,y=-1;for(;++m<i.length;)if(i[m][0]===h){y=m;break}if(y===-1)i.push([h,...g]);else if(g.length>0){let[b,...k]=g;const v=i[y][1];ab(v)&&ab(b)&&(b=Vg(!0,v,b)),i[y]=[h,b,...k]}}}}const m$=new Cx().freeze();function Xg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Zg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Jg(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 uE(e){if(!ab(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function dE(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Df(e){return g$(e)?e:new ij(e)}function g$(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function y$(e){return typeof e=="string"||b$(e)}function b$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const x$="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",fE=[],hE={allowDangerousHtml:!0},v$=/^(https?|ircs?|mailto|xmpp)$/i,w$=[{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 Ax(e){const t=k$(e),n=E$(e);return S$(t.runSync(t.parse(n),n),e)}function k$(e){const t=e.rehypePlugins||fE,n=e.remarkPlugins||fE,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...hE}:hE;return m$().use(i6).use(n).use(X6,i).use(t)}function E$(e){const t=e.children||"",n=new ij;return typeof t=="string"&&(n.value=t),n}function S$(e,t){const n=t.allowedElements,i=t.allowElement,a=t.components,l=t.disallowedElements,o=t.skipHtml,d=t.unwrapDisallowed,f=t.urlTransform||N$;for(const g of w$)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+x$+g.id,void 0);return op(e,h),$P(e,{Fragment:c.Fragment,components:a,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function h(g,m,y){if(g.type==="raw"&&y&&typeof m=="number")return o?y.children.splice(m,1):y.children[m]={type:"text",value:g.value},m;if(g.type==="element"){let b;for(b in qg)if(Object.hasOwn(qg,b)&&Object.hasOwn(g.properties,b)){const k=g.properties[b],v=qg[b];(v===null||v.includes(g.tagName))&&(g.properties[b]=f(String(k||""),b,g))}}if(g.type==="element"){let b=n?!n.includes(g.tagName):l?l.includes(g.tagName):!1;if(!b&&i&&typeof m=="number"&&(b=!i(g,m,y)),b&&y&&typeof m=="number")return d&&g.children?y.children.splice(m,1,...g.children):y.children.splice(m,1),m}}}function N$(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||i!==-1&&t>i||v$.test(e.slice(0,t))?e:""}function pE(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,a=n.indexOf(t);for(;a!==-1;)i++,a=n.indexOf(t,a+t.length);return i}function _$(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function j$(e,t,n){const a=ed((n||{}).ignore||[]),l=C$(t);let o=-1;for(;++o<l.length;)nj(e,"text",d);function d(h,g){let m=-1,y;for(;++m<g.length;){const b=g[m],k=y?y.children:void 0;if(a(b,k?k.indexOf(b):void 0,y))return;y=b}if(y)return f(h,g)}function f(h,g){const m=g[g.length-1],y=l[o][0],b=l[o][1];let k=0;const N=m.children.indexOf(h);let E=!1,C=[];y.lastIndex=0;let S=y.exec(h.value);for(;S;){const _=S.index,M={index:S.index,input:S.input,stack:[...g,h]};let T=b(...S,M);if(typeof T=="string"&&(T=T.length>0?{type:"text",value:T}:void 0),T===!1?y.lastIndex=_+1:(k!==_&&C.push({type:"text",value:h.value.slice(k,_)}),Array.isArray(T)?C.push(...T):T&&C.push(T),k=_+S[0].length,E=!0),!y.global)break;S=y.exec(h.value)}return E?(k<h.value.length&&C.push({type:"text",value:h.value.slice(k)}),m.children.splice(N,1,...C)):C=[h],N+C.length}}function C$(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let i=-1;for(;++i<n.length;){const a=n[i];t.push([A$(a[0]),T$(a[1])])}return t}function A$(e){return typeof e=="string"?new RegExp(_$(e),"g"):e}function T$(e){return typeof e=="function"?e:function(){return e}}const ey="phrasing",ty=["autolink","link","image","label"];function M$(){return{transforms:[P$],enter:{literalAutolink:O$,literalAutolinkEmail:ny,literalAutolinkHttp:ny,literalAutolinkWww:ny},exit:{literalAutolink:z$,literalAutolinkEmail:I$,literalAutolinkHttp:R$,literalAutolinkWww:L$}}}function D$(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ey,notInConstruct:ty},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ey,notInConstruct:ty},{character:":",before:"[ps]",after:"\\/",inConstruct:ey,notInConstruct:ty}]}}function O$(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ny(e){this.config.enter.autolinkProtocol.call(this,e)}function R$(e){this.config.exit.autolinkProtocol.call(this,e)}function L$(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 I$(e){this.config.exit.autolinkEmail.call(this,e)}function z$(e){this.exit(e)}function P$(e){j$(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,B$],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),$$]],{ignore:["link","linkReference"]})}function B$(e,t,n,i,a){let l="";if(!rj(a)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!U$(n)))return!1;const o=F$(n+i);if(!o[0])return!1;const d={type:"link",title:null,url:l+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[d,{type:"text",value:o[1]}]:d}function $$(e,t,n,i){return!rj(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function U$(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 F$(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const a=pE(e,"(");let l=pE(e,")");for(;i!==-1&&a>l;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),l++;return[e,n]}function rj(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||ml(n)||rp(n))&&(!t||n!==47)}aj.peek=X$;function q$(){this.buffer()}function H$(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function K$(){this.buffer()}function G$(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function V$(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=dr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Y$(e){this.exit(e)}function Q$(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=dr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function W$(e){this.exit(e)}function X$(){return"["}function aj(e,t,n,i){const a=n.createTracker(i);let l=a.move("[^");const o=n.enter("footnoteReference"),d=n.enter("reference");return l+=a.move(n.safe(n.associationId(e),{after:"]",before:l})),d(),o(),l+=a.move("]"),l}function Z$(){return{enter:{gfmFootnoteCallString:q$,gfmFootnoteCall:H$,gfmFootnoteDefinitionLabelString:K$,gfmFootnoteDefinition:G$},exit:{gfmFootnoteCallString:V$,gfmFootnoteCall:Y$,gfmFootnoteDefinitionLabelString:Q$,gfmFootnoteDefinition:W$}}}function J$(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:aj},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,a,l,o){const d=l.createTracker(o);let f=d.move("[^");const h=l.enter("footnoteDefinition"),g=l.enter("label");return f+=d.move(l.safe(l.associationId(i),{before:f,after:"]"})),g(),f+=d.move("]:"),i.children&&i.children.length>0&&(d.shift(4),f+=d.move((t?`
630
+ `:" ")+l.indentLines(l.containerFlow(i,d.current()),t?sj:eU))),h(),f}}function eU(e,t,n){return t===0?e:sj(e,t,n)}function sj(e,t,n){return(n?"":" ")+e}const tU=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];lj.peek=sU;function nU(){return{canContainEols:["delete"],enter:{strikethrough:rU},exit:{strikethrough:aU}}}function iU(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:tU}],handlers:{delete:lj}}}function rU(e){this.enter({type:"delete",children:[]},e)}function aU(e){this.exit(e)}function lj(e,t,n,i){const a=n.createTracker(i),l=n.enter("strikethrough");let o=a.move("~~");return o+=n.containerPhrasing(e,{...a.current(),before:o,after:"~"}),o+=a.move("~~"),l(),o}function sU(){return"~"}function lU(e){return e.length}function oU(e,t){const n=t||{},i=(n.align||[]).concat(),a=n.stringLength||lU,l=[],o=[],d=[],f=[];let h=0,g=-1;for(;++g<e.length;){const v=[],N=[];let E=-1;for(e[g].length>h&&(h=e[g].length);++E<e[g].length;){const C=cU(e[g][E]);if(n.alignDelimiters!==!1){const S=a(C);N[E]=S,(f[E]===void 0||S>f[E])&&(f[E]=S)}v.push(C)}o[g]=v,d[g]=N}let m=-1;if(typeof i=="object"&&"length"in i)for(;++m<h;)l[m]=mE(i[m]);else{const v=mE(i);for(;++m<h;)l[m]=v}m=-1;const y=[],b=[];for(;++m<h;){const v=l[m];let N="",E="";v===99?(N=":",E=":"):v===108?N=":":v===114&&(E=":");let C=n.alignDelimiters===!1?1:Math.max(1,f[m]-N.length-E.length);const S=N+"-".repeat(C)+E;n.alignDelimiters!==!1&&(C=N.length+C+E.length,C>f[m]&&(f[m]=C),b[m]=C),y[m]=S}o.splice(1,0,y),d.splice(1,0,b),g=-1;const k=[];for(;++g<o.length;){const v=o[g],N=d[g];m=-1;const E=[];for(;++m<h;){const C=v[m]||"";let S="",_="";if(n.alignDelimiters!==!1){const M=f[m]-(N[m]||0),T=l[m];T===114?S=" ".repeat(M):T===99?M%2?(S=" ".repeat(M/2+.5),_=" ".repeat(M/2-.5)):(S=" ".repeat(M/2),_=S):_=" ".repeat(M)}n.delimiterStart!==!1&&!m&&E.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&C==="")&&(n.delimiterStart!==!1||m)&&E.push(" "),n.alignDelimiters!==!1&&E.push(S),E.push(C),n.alignDelimiters!==!1&&E.push(_),n.padding!==!1&&E.push(" "),(n.delimiterEnd!==!1||m!==h-1)&&E.push("|")}k.push(n.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return k.join(`
631
+ `)}function cU(e){return e==null?"":String(e)}function mE(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 uU(e,t,n,i){const a=n.enter("blockquote"),l=n.createTracker(i);l.move("> "),l.shift(2);const o=n.indentLines(n.containerFlow(e,l.current()),dU);return a(),o}function dU(e,t,n){return">"+(n?"":" ")+e}function fU(e,t){return gE(e,t.inConstruct,!0)&&!gE(e,t.notInConstruct,!1)}function gE(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++i<t.length;)if(e.includes(t[i]))return!0;return!1}function yE(e,t,n,i){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
632
+ `&&fU(n.stack,n.unsafe[a]))return/[ \t]/.test(i.before)?"":" ";return`\\
633
+ `}function hU(e,t){const n=String(e);let i=n.indexOf(t),a=i,l=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===a?++l>o&&(o=l):l=1,a=i+t.length,i=n.indexOf(t,a);return o}function pU(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 mU(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 gU(e,t,n,i){const a=mU(n),l=e.value||"",o=a==="`"?"GraveAccent":"Tilde";if(pU(e,n)){const m=n.enter("codeIndented"),y=n.indentLines(l,yU);return m(),y}const d=n.createTracker(i),f=a.repeat(Math.max(hU(l,a)+1,3)),h=n.enter("codeFenced");let g=d.move(f);if(e.lang){const m=n.enter(`codeFencedLang${o}`);g+=d.move(n.safe(e.lang,{before:g,after:" ",encode:["`"],...d.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${o}`);g+=d.move(" "),g+=d.move(n.safe(e.meta,{before:g,after:`
634
+ `,encode:["`"],...d.current()})),m()}return g+=d.move(`
635
+ `),l&&(g+=d.move(l+`
636
+ `)),g+=d.move(f),h(),g}function yU(e,t,n){return(n?"":" ")+e}function Tx(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 bU(e,t,n,i){const a=Tx(n),l=a==='"'?"Quote":"Apostrophe",o=n.enter("definition");let d=n.enter("label");const f=n.createTracker(i);let h=f.move("[");return h+=f.move(n.safe(n.associationId(e),{before:h,after:"]",...f.current()})),h+=f.move("]: "),d(),!e.url||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(n.safe(e.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(d=n.enter("destinationRaw"),h+=f.move(n.safe(e.url,{before:h,after:e.title?" ":`
637
+ `,...f.current()}))),d(),e.title&&(d=n.enter(`title${l}`),h+=f.move(" "+a),h+=f.move(n.safe(e.title,{before:h,after:a,...f.current()})),h+=f.move(a),d()),o(),h}function xU(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 Cu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function kh(e,t,n){const i=Uo(e),a=Uo(t);return i===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}oj.peek=vU;function oj(e,t,n,i){const a=xU(n),l=n.enter("emphasis"),o=n.createTracker(i),d=o.move(a);let f=o.move(n.containerPhrasing(e,{after:a,before:d,...o.current()}));const h=f.charCodeAt(0),g=kh(i.before.charCodeAt(i.before.length-1),h,a);g.inside&&(f=Cu(h)+f.slice(1));const m=f.charCodeAt(f.length-1),y=kh(i.after.charCodeAt(0),m,a);y.inside&&(f=f.slice(0,-1)+Cu(m));const b=o.move(a);return l(),n.attentionEncodeSurroundingInfo={after:y.outside,before:g.outside},d+f+b}function vU(e,t,n){return n.options.emphasis||"*"}function wU(e,t){let n=!1;return op(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,ib}),!!((!e.depth||e.depth<3)&&wx(e)&&(t.options.setext||n))}function kU(e,t,n,i){const a=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(i);if(wU(e,n)){const g=n.enter("headingSetext"),m=n.enter("phrasing"),y=n.containerPhrasing(e,{...l.current(),before:`
638
+ `,after:`
639
+ `});return m(),g(),y+`
640
+ `+(a===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
641
+ `))+1))}const o="#".repeat(a),d=n.enter("headingAtx"),f=n.enter("phrasing");l.move(o+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
642
+ `,...l.current()});return/^[\t ]/.test(h)&&(h=Cu(h.charCodeAt(0))+h.slice(1)),h=h?o+" "+h:o,n.options.closeAtx&&(h+=" "+o),f(),d(),h}cj.peek=EU;function cj(e){return e.value||""}function EU(){return"<"}uj.peek=SU;function uj(e,t,n,i){const a=Tx(n),l=a==='"'?"Quote":"Apostrophe",o=n.enter("image");let d=n.enter("label");const f=n.createTracker(i);let h=f.move("![");return h+=f.move(n.safe(e.alt,{before:h,after:"]",...f.current()})),h+=f.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(n.safe(e.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(d=n.enter("destinationRaw"),h+=f.move(n.safe(e.url,{before:h,after:e.title?" ":")",...f.current()}))),d(),e.title&&(d=n.enter(`title${l}`),h+=f.move(" "+a),h+=f.move(n.safe(e.title,{before:h,after:a,...f.current()})),h+=f.move(a),d()),h+=f.move(")"),o(),h}function SU(){return"!"}dj.peek=NU;function dj(e,t,n,i){const a=e.referenceType,l=n.enter("imageReference");let o=n.enter("label");const d=n.createTracker(i);let f=d.move("![");const h=n.safe(e.alt,{before:f,after:"]",...d.current()});f+=d.move(h+"]["),o();const g=n.stack;n.stack=[],o=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...d.current()});return o(),n.stack=g,l(),a==="full"||!h||h!==m?f+=d.move(m+"]"):a==="shortcut"?f=f.slice(0,-1):f+=d.move("]"),f}function NU(){return"!"}fj.peek=_U;function fj(e,t,n){let i=e.value||"",a="`",l=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(i);)a+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++l<n.unsafe.length;){const o=n.unsafe[l],d=n.compilePattern(o);let f;if(o.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 a+i+a}function _U(){return"`"}function hj(e,t){const n=wx(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}pj.peek=jU;function pj(e,t,n,i){const a=Tx(n),l=a==='"'?"Quote":"Apostrophe",o=n.createTracker(i);let d,f;if(hj(e,n)){const g=n.stack;n.stack=[],d=n.enter("autolink");let m=o.move("<");return m+=o.move(n.containerPhrasing(e,{before:m,after:">",...o.current()})),m+=o.move(">"),d(),n.stack=g,m}d=n.enter("link"),f=n.enter("label");let h=o.move("[");return h+=o.move(n.containerPhrasing(e,{before:h,after:"](",...o.current()})),h+=o.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=o.move("<"),h+=o.move(n.safe(e.url,{before:h,after:">",...o.current()})),h+=o.move(">")):(f=n.enter("destinationRaw"),h+=o.move(n.safe(e.url,{before:h,after:e.title?" ":")",...o.current()}))),f(),e.title&&(f=n.enter(`title${l}`),h+=o.move(" "+a),h+=o.move(n.safe(e.title,{before:h,after:a,...o.current()})),h+=o.move(a),f()),h+=o.move(")"),d(),h}function jU(e,t,n){return hj(e,n)?"<":"["}mj.peek=CU;function mj(e,t,n,i){const a=e.referenceType,l=n.enter("linkReference");let o=n.enter("label");const d=n.createTracker(i);let f=d.move("[");const h=n.containerPhrasing(e,{before:f,after:"]",...d.current()});f+=d.move(h+"]["),o();const g=n.stack;n.stack=[],o=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...d.current()});return o(),n.stack=g,l(),a==="full"||!h||h!==m?f+=d.move(m+"]"):a==="shortcut"?f=f.slice(0,-1):f+=d.move("]"),f}function CU(){return"["}function Mx(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 AU(e){const t=Mx(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function TU(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 gj(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 MU(e,t,n,i){const a=n.enter("list"),l=n.bulletCurrent;let o=e.ordered?TU(n):Mx(n);const d=e.ordered?o==="."?")":".":AU(n);let f=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&g&&(!g.children||!g.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),gj(n)===o&&g){let m=-1;for(;++m<e.children.length;){const y=e.children[m];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(o=d),n.bulletCurrent=o;const h=n.containerFlow(e,i);return n.bulletLastUsed=o,n.bulletCurrent=l,a(),h}function DU(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 OU(e,t,n,i){const a=DU(n);let l=n.bulletCurrent||Mx(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let o=l.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const d=n.createTracker(i);d.move(l+" ".repeat(o-l.length)),d.shift(o);const f=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,d.current()),g);return f(),h;function g(m,y,b){return y?(b?"":" ".repeat(o))+m:(b?l:l+" ".repeat(o-l.length))+m}}function RU(e,t,n,i){const a=n.enter("paragraph"),l=n.enter("phrasing"),o=n.containerPhrasing(e,i);return l(),a(),o}const LU=ed(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function IU(e,t,n,i){return(e.children.some(function(o){return LU(o)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function zU(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}yj.peek=PU;function yj(e,t,n,i){const a=zU(n),l=n.enter("strong"),o=n.createTracker(i),d=o.move(a+a);let f=o.move(n.containerPhrasing(e,{after:a,before:d,...o.current()}));const h=f.charCodeAt(0),g=kh(i.before.charCodeAt(i.before.length-1),h,a);g.inside&&(f=Cu(h)+f.slice(1));const m=f.charCodeAt(f.length-1),y=kh(i.after.charCodeAt(0),m,a);y.inside&&(f=f.slice(0,-1)+Cu(m));const b=o.move(a+a);return l(),n.attentionEncodeSurroundingInfo={after:y.outside,before:g.outside},d+f+b}function PU(e,t,n){return n.options.strong||"*"}function BU(e,t,n,i){return n.safe(e.value,i)}function $U(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 UU(e,t,n){const i=(gj(n)+(n.options.ruleSpaces?" ":"")).repeat($U(n));return n.options.ruleSpaces?i.slice(0,-1):i}const bj={blockquote:uU,break:yE,code:gU,definition:bU,emphasis:oj,hardBreak:yE,heading:kU,html:cj,image:uj,imageReference:dj,inlineCode:fj,link:pj,linkReference:mj,list:MU,listItem:OU,paragraph:RU,root:IU,strong:yj,text:BU,thematicBreak:UU};function FU(){return{enter:{table:qU,tableData:bE,tableHeader:bE,tableRow:KU},exit:{codeText:GU,table:HU,tableData:iy,tableHeader:iy,tableRow:iy}}}function qU(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function HU(e){this.exit(e),this.data.inTable=void 0}function KU(e){this.enter({type:"tableRow",children:[]},e)}function iy(e){this.exit(e)}function bE(e){this.enter({type:"tableCell",children:[]},e)}function GU(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,VU));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function VU(e,t){return t==="|"?t:e}function YU(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,a=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
643
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:o,tableCell:f,tableRow:d}};function o(b,k,v,N){return h(g(b,v,N),b.align)}function d(b,k,v,N){const E=m(b,v,N),C=h([E]);return C.slice(0,C.indexOf(`
644
+ `))}function f(b,k,v,N){const E=v.enter("tableCell"),C=v.enter("phrasing"),S=v.containerPhrasing(b,{...N,before:l,after:l});return C(),E(),S}function h(b,k){return oU(b,{align:k,alignDelimiters:i,padding:n,stringLength:a})}function g(b,k,v){const N=b.children;let E=-1;const C=[],S=k.enter("table");for(;++E<N.length;)C[E]=m(N[E],k,v);return S(),C}function m(b,k,v){const N=b.children;let E=-1;const C=[],S=k.enter("tableRow");for(;++E<N.length;)C[E]=f(N[E],b,k,v);return S(),C}function y(b,k,v){let N=bj.inlineCode(b,k,v);return v.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function QU(){return{exit:{taskListCheckValueChecked:xE,taskListCheckValueUnchecked:xE,paragraph:XU}}}function WU(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:ZU}}}function xE(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function XU(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const i=n.children[0];if(i&&i.type==="text"){const a=t.children;let l=-1,o;for(;++l<a.length;){const d=a[l];if(d.type==="paragraph"){o=d;break}}o===n&&(i.value=i.value.slice(1),i.value.length===0?n.children.shift():n.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,n.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function ZU(e,t,n,i){const a=e.children[0],l=typeof e.checked=="boolean"&&a&&a.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",d=n.createTracker(i);l&&d.move(o);let f=bj.listItem(e,t,n,{...i,...d.current()});return l&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),f;function h(g){return g+o}}function JU(){return[M$(),Z$(),nU(),FU(),QU()]}function e9(e){return{extensions:[D$(),J$(e),iU(),YU(e),WU()]}}const t9={tokenize:l9,partial:!0},xj={tokenize:o9,partial:!0},vj={tokenize:c9,partial:!0},wj={tokenize:u9,partial:!0},n9={tokenize:d9,partial:!0},kj={name:"wwwAutolink",tokenize:a9,previous:Sj},Ej={name:"protocolAutolink",tokenize:s9,previous:Nj},xa={name:"emailAutolink",tokenize:r9,previous:_j},Ir={};function i9(){return{text:Ir}}let Gs=48;for(;Gs<123;)Ir[Gs]=xa,Gs++,Gs===58?Gs=65:Gs===91&&(Gs=97);Ir[43]=xa;Ir[45]=xa;Ir[46]=xa;Ir[95]=xa;Ir[72]=[xa,Ej];Ir[104]=[xa,Ej];Ir[87]=[xa,kj];Ir[119]=[xa,kj];function r9(e,t,n){const i=this;let a,l;return o;function o(m){return!lb(m)||!_j.call(i,i.previous)||Dx(i.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(m))}function d(m){return lb(m)?(e.consume(m),d):m===64?(e.consume(m),f):n(m)}function f(m){return m===46?e.check(n9,g,h)(m):m===45||m===95||Gn(m)?(l=!0,e.consume(m),f):g(m)}function h(m){return e.consume(m),a=!0,f}function g(m){return l&&a&&ni(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):n(m)}}function a9(e,t,n){const i=this;return a;function a(o){return o!==87&&o!==119||!Sj.call(i,i.previous)||Dx(i.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(t9,e.attempt(xj,e.attempt(vj,l),n),n)(o))}function l(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function s9(e,t,n){const i=this;let a="",l=!1;return o;function o(m){return(m===72||m===104)&&Nj.call(i,i.previous)&&!Dx(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(m),e.consume(m),d):n(m)}function d(m){if(ni(m)&&a.length<5)return a+=String.fromCodePoint(m),e.consume(m),d;if(m===58){const y=a.toLowerCase();if(y==="http"||y==="https")return e.consume(m),f}return n(m)}function f(m){return m===47?(e.consume(m),l?h:(l=!0,f)):n(m)}function h(m){return m===null||xh(m)||Ht(m)||ml(m)||rp(m)?n(m):e.attempt(xj,e.attempt(vj,g),n)(m)}function g(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function l9(e,t,n){let i=0;return a;function a(o){return(o===87||o===119)&&i<3?(i++,e.consume(o),a):o===46&&i===3?(e.consume(o),l):n(o)}function l(o){return o===null?n(o):t(o)}}function o9(e,t,n){let i,a,l;return o;function o(h){return h===46||h===95?e.check(wj,f,d)(h):h===null||Ht(h)||ml(h)||h!==45&&rp(h)?f(h):(l=!0,e.consume(h),o)}function d(h){return h===95?i=!0:(a=i,i=void 0),e.consume(h),o}function f(h){return a||i||!l?n(h):t(h)}}function c9(e,t){let n=0,i=0;return a;function a(o){return o===40?(n++,e.consume(o),a):o===41&&i<n?l(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(wj,t,l)(o):o===null||Ht(o)||ml(o)?t(o):(e.consume(o),a)}function l(o){return o===41&&i++,e.consume(o),a}}function u9(e,t,n){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),l):d===93?(e.consume(d),a):d===60||d===null||Ht(d)||ml(d)?t(d):n(d)}function a(d){return d===null||d===40||d===91||Ht(d)||ml(d)?t(d):i(d)}function l(d){return ni(d)?o(d):n(d)}function o(d){return d===59?(e.consume(d),i):ni(d)?(e.consume(d),o):n(d)}}function d9(e,t,n){return i;function i(l){return e.consume(l),a}function a(l){return Gn(l)?n(l):t(l)}}function Sj(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ht(e)}function Nj(e){return!ni(e)}function _j(e){return!(e===47||lb(e))}function lb(e){return e===43||e===45||e===46||e===95||Gn(e)}function Dx(e){let t=e.length,n=!1;for(;t--;){const i=e[t][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const f9={tokenize:v9,partial:!0};function h9(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:y9,continuation:{tokenize:b9},exit:x9}},text:{91:{name:"gfmFootnoteCall",tokenize:g9},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:p9,resolveTo:m9}}}}function p9(e,t,n){const i=this;let a=i.events.length;const l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o;for(;a--;){const f=i.events[a][1];if(f.type==="labelImage"){o=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(!o||!o._balanced)return n(f);const h=dr(i.sliceSerialize({start:o.end,end:i.now()}));return h.codePointAt(0)!==94||!l.includes(h.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function m9(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},d=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...d),e}function g9(e,t,n){const i=this,a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l=0,o;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?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(m){if(l>999||m===93&&!o||m===null||m===91||Ht(m))return n(m);if(m===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return a.includes(dr(i.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return Ht(m)||(o=!0),l++,e.consume(m),m===92?g:h}function g(m){return m===91||m===92||m===93?(e.consume(m),l++,h):h(m)}}function y9(e,t,n){const i=this,a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l,o=0,d;return f;function f(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):n(k)}function g(k){if(o>999||k===93&&!d||k===null||k===91||Ht(k))return n(k);if(k===93){e.exit("chunkString");const v=e.exit("gfmFootnoteDefinitionLabelString");return l=dr(i.sliceSerialize(v)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return Ht(k)||(d=!0),o++,e.consume(k),k===92?m:g}function m(k){return k===91||k===92||k===93?(e.consume(k),o++,g):g(k)}function y(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),a.includes(l)||a.push(l),Et(e,b,"gfmFootnoteDefinitionWhitespace")):n(k)}function b(k){return t(k)}}function b9(e,t,n){return e.check(Ju,t,e.attempt(f9,t,n))}function x9(e){e.exit("gfmFootnoteDefinition")}function v9(e,t,n){const i=this;return Et(e,a,"gfmFootnoteDefinitionIndent",5);function a(l){const o=i.events[i.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(l):n(l)}}function w9(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:l,resolveAll:a};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function a(o,d){let f=-1;for(;++f<o.length;)if(o[f][0]==="enter"&&o[f][1].type==="strikethroughSequenceTemporary"&&o[f][1]._close){let h=f;for(;h--;)if(o[h][0]==="exit"&&o[h][1].type==="strikethroughSequenceTemporary"&&o[h][1]._open&&o[f][1].end.offset-o[f][1].start.offset===o[h][1].end.offset-o[h][1].start.offset){o[f][1].type="strikethroughSequence",o[h][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},o[h][1].start),end:Object.assign({},o[f][1].end)},m={type:"strikethroughText",start:Object.assign({},o[h][1].end),end:Object.assign({},o[f][1].start)},y=[["enter",g,d],["enter",o[h][1],d],["exit",o[h][1],d],["enter",m,d]],b=d.parser.constructs.insideSpan.null;b&&ji(y,y.length,0,ap(b,o.slice(h+1,f),d)),ji(y,y.length,0,[["exit",m,d],["enter",o[f][1],d],["exit",o[f][1],d],["exit",g,d]]),ji(o,h-1,f-h+3,y),f=h+y.length-2;break}}for(f=-1;++f<o.length;)o[f][1].type==="strikethroughSequenceTemporary"&&(o[f][1].type="data");return o}function l(o,d,f){const h=this.previous,g=this.events;let m=0;return y;function y(k){return h===126&&g[g.length-1][1].type!=="characterEscape"?f(k):(o.enter("strikethroughSequenceTemporary"),b(k))}function b(k){const v=Uo(h);if(k===126)return m>1?f(k):(o.consume(k),m++,b);if(m<2&&!n)return f(k);const N=o.exit("strikethroughSequenceTemporary"),E=Uo(k);return N._open=!E||E===2&&!!v,N._close=!v||v===2&&!!E,d(k)}}}class k9{constructor(){this.map=[]}add(t,n,i){E9(this,t,n,i)}consume(t){if(this.map.sort(function(l,o){return l[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let a=i.pop();for(;a;){for(const l of a)t.push(l);a=i.pop()}this.map.length=0}}function E9(e,t,n,i){let a=0;if(!(n===0&&i.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...i);return}a+=1}e.map.push([t,n,i])}}function S9(e,t){let n=!1;const i=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&i.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const l=i.length-1;i[l]=i[l]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return i}function N9(){return{flow:{null:{name:"table",tokenize:_9,resolveAll:j9}}}}function _9(e,t,n){const i=this;let a=0,l=0,o;return d;function d(I){let q=i.events.length-1;for(;q>-1;){const D=i.events[q][1].type;if(D==="lineEnding"||D==="linePrefix")q--;else break}const F=q>-1?i.events[q][1].type:null,Y=F==="tableHead"||F==="tableRow"?T:f;return Y===T&&i.parser.lazy[i.now().line]?n(I):Y(I)}function f(I){return e.enter("tableHead"),e.enter("tableRow"),h(I)}function h(I){return I===124||(o=!0,l+=1),g(I)}function g(I){return I===null?n(I):Je(I)?l>1?(l=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),b):n(I):gt(I)?Et(e,g,"whitespace")(I):(l+=1,o&&(o=!1,a+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),o=!0,g):(e.enter("data"),m(I)))}function m(I){return I===null||I===124||Ht(I)?(e.exit("data"),g(I)):(e.consume(I),I===92?y:m)}function y(I){return I===92||I===124?(e.consume(I),m):m(I)}function b(I){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(I):(e.enter("tableDelimiterRow"),o=!1,gt(I)?Et(e,k,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):k(I))}function k(I){return I===45||I===58?N(I):I===124?(o=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),v):M(I)}function v(I){return gt(I)?Et(e,N,"whitespace")(I):N(I)}function N(I){return I===58?(l+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),E):I===45?(l+=1,E(I)):I===null||Je(I)?_(I):M(I)}function E(I){return I===45?(e.enter("tableDelimiterFiller"),C(I)):M(I)}function C(I){return I===45?(e.consume(I),C):I===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),S):(e.exit("tableDelimiterFiller"),S(I))}function S(I){return gt(I)?Et(e,_,"whitespace")(I):_(I)}function _(I){return I===124?k(I):I===null||Je(I)?!o||a!==l?M(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):M(I)}function M(I){return n(I)}function T(I){return e.enter("tableRow"),R(I)}function R(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),R):I===null||Je(I)?(e.exit("tableRow"),t(I)):gt(I)?Et(e,R,"whitespace")(I):(e.enter("data"),O(I))}function O(I){return I===null||I===124||Ht(I)?(e.exit("data"),R(I)):(e.consume(I),I===92?$:O)}function $(I){return I===92||I===124?(e.consume(I),O):O(I)}}function j9(e,t){let n=-1,i=!0,a=0,l=[0,0,0,0],o=[0,0,0,0],d=!1,f=0,h,g,m;const y=new k9;for(;++n<e.length;){const b=e[n],k=b[1];b[0]==="enter"?k.type==="tableHead"?(d=!1,f!==0&&(vE(y,t,f,h,g),g=void 0,f=0),h={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},y.add(n,0,[["enter",h,t]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(i=!0,m=void 0,l=[0,0,0,0],o=[0,n+1,0,0],d&&(d=!1,g={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},y.add(n,0,[["enter",g,t]])),a=k.type==="tableDelimiterRow"?2:g?3:1):a&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(i=!1,o[2]===0&&(l[1]!==0&&(o[0]=o[1],m=Of(y,t,l,a,void 0,m),l=[0,0,0,0]),o[2]=n)):k.type==="tableCellDivider"&&(i?i=!1:(l[1]!==0&&(o[0]=o[1],m=Of(y,t,l,a,void 0,m)),l=o,o=[l[1],n,0,0])):k.type==="tableHead"?(d=!0,f=n):k.type==="tableRow"||k.type==="tableDelimiterRow"?(f=n,l[1]!==0?(o[0]=o[1],m=Of(y,t,l,a,n,m)):o[1]!==0&&(m=Of(y,t,o,a,n,m)),a=0):a&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(o[3]=n)}for(f!==0&&vE(y,t,f,h,g),y.consume(t.events),n=-1;++n<t.events.length;){const b=t.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=S9(t.events,n))}return e}function Of(e,t,n,i,a,l){const o=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",d="tableContent";n[0]!==0&&(l.end=Object.assign({},ho(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const f=ho(t.events,n[1]);if(l={type:o,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const h=ho(t.events,n[2]),g=ho(t.events,n[3]),m={type:d,start:Object.assign({},h),end:Object.assign({},g)};if(e.add(n[2],0,[["enter",m,t]]),i!==2){const y=t.events[n[2]],b=t.events[n[3]];if(y[1].end=Object.assign({},b[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const k=n[2]+1,v=n[3]-n[2]-1;e.add(k,v,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return a!==void 0&&(l.end=Object.assign({},ho(t.events,a)),e.add(a,0,[["exit",l,t]]),l=void 0),l}function vE(e,t,n,i,a){const l=[],o=ho(t.events,n);a&&(a.end=Object.assign({},o),l.push(["exit",a,t])),i.end=Object.assign({},o),l.push(["exit",i,t]),e.add(n+1,0,l)}function ho(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const C9={name:"tasklistCheck",tokenize:T9};function A9(){return{text:{91:C9}}}function T9(e,t,n){const i=this;return a;function a(f){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),l)}function l(f){return Ht(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),o):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),o):n(f)}function o(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),d):n(f)}function d(f){return Je(f)?t(f):gt(f)?e.check({tokenize:M9},t,n)(f):n(f)}}function M9(e,t,n){return Et(e,i,"whitespace");function i(a){return a===null?n(a):t(a)}}function D9(e){return z2([i9(),h9(),w9(e),N9(),A9()])}const O9={};function Ox(e){const t=this,n=e||O9,i=t.data(),a=i.micromarkExtensions||(i.micromarkExtensions=[]),l=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),o=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);a.push(D9(n)),l.push(JU()),o.push(e9(n))}const wE=(function(e,t,n){const i=ed(n);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]}),Sl=(function(e){if(e==null)return I9;if(typeof e=="string")return L9(e);if(typeof e=="object")return R9(e);if(typeof e=="function")return Rx(e);throw new Error("Expected function, string, or array as `test`")});function R9(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Sl(e[n]);return Rx(i);function i(...a){let l=-1;for(;++l<t.length;)if(t[l].apply(this,a))return!0;return!1}}function L9(e){return Rx(t);function t(n){return n.tagName===e}}function Rx(e){return t;function t(n,i,a){return!!(z9(n)&&e.call(this,n,typeof i=="number"?i:void 0,a||void 0))}}function I9(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function z9(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const kE=/\n/g,EE=/[\t ]+/g,ob=Sl("br"),SE=Sl(K9),P9=Sl("p"),NE=Sl("tr"),B9=Sl(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",H9,G9]),jj=Sl(["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 $9(e,t){const n=t||{},i="children"in e?e.children:[],a=jj(e),l=Tj(e,{whitespace:n.whitespace||"normal"}),o=[];(e.type==="text"||e.type==="comment")&&o.push(...Aj(e,{breakBefore:!0,breakAfter:!0}));let d=-1;for(;++d<i.length;)o.push(...Cj(i[d],e,{whitespace:l,breakBefore:d?void 0:a,breakAfter:d<i.length-1?ob(i[d+1]):a}));const f=[];let h;for(d=-1;++d<o.length;){const g=o[d];typeof g=="number"?h!==void 0&&g>h&&(h=g):g&&(h!==void 0&&h>-1&&f.push(`
645
+ `.repeat(h)||" "),h=-1,f.push(g))}return f.join("")}function Cj(e,t,n){return e.type==="element"?U9(e,t,n):e.type==="text"?n.whitespace==="normal"?Aj(e,n):F9(e):[]}function U9(e,t,n){const i=Tj(e,n),a=e.children||[];let l=-1,o=[];if(B9(e))return o;let d,f;for(ob(e)||NE(e)&&wE(t,e,NE)?f=`
646
+ `:P9(e)?(d=2,f=2):jj(e)&&(d=1,f=1);++l<a.length;)o=o.concat(Cj(a[l],e,{whitespace:i,breakBefore:l?void 0:d,breakAfter:l<a.length-1?ob(a[l+1]):f}));return SE(e)&&wE(t,e,SE)&&o.push(" "),d&&o.unshift(d),f&&o.push(f),o}function Aj(e,t){const n=String(e.value),i=[],a=[];let l=0;for(;l<=n.length;){kE.lastIndex=l;const f=kE.exec(n),h=f&&"index"in f?f.index:n.length;i.push(q9(n.slice(l,h).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),l===0?t.breakBefore:!0,h===n.length?t.breakAfter:!0)),l=h+1}let o=-1,d;for(;++o<i.length;)i[o].charCodeAt(i[o].length-1)===8203||o<i.length-1&&i[o+1].charCodeAt(0)===8203?(a.push(i[o]),d=void 0):i[o]?(typeof d=="number"&&a.push(d),a.push(i[o]),d=0):(o===0||o===i.length-1)&&a.push(0);return a}function F9(e){return[String(e.value)]}function q9(e,t,n){const i=[];let a=0,l;for(;a<e.length;){EE.lastIndex=a;const o=EE.exec(e);l=o?o.index:e.length,!a&&!l&&o&&!t&&i.push(""),a!==l&&i.push(e.slice(a,l)),a=o?l+o[0].length:l}return a!==l&&!n&&i.push(""),i.join(" ")}function Tj(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function H9(e){return!!(e.properties||{}).hidden}function K9(e){return e.tagName==="td"||e.tagName==="th"}function G9(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function V9(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",o="(?!struct)("+i+"|"+t.optional(a)+"[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:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:t.optional(a)+e.IDENT_RE,relevance:0},b=t.optional(a)+e.IDENT_RE+"\\s*\\(",k=["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"],v=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],N=["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"],E=["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"],_={type:v,keyword:k,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:N},M={className:"function.dispatch",relevance:0,keywords:{_hint:E},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},T=[M,m,d,n,e.C_BLOCK_COMMENT_MODE,g,h],R={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:T.concat([{begin:/\(/,end:/\)/,keywords:_,contains:T.concat(["self"]),relevance:0}]),relevance:0},O={className:"function",begin:"("+o+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:_,relevance:0},{begin:b,returnBegin:!0,contains:[y],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[h,g]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,h,g,d,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,h,g,d]}]},d,n,e.C_BLOCK_COMMENT_MODE,m]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(R,O,M,T,[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:_,contains:["self",d]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Y9(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"]},n=V9(e),i=n.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,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function Q9(e){const t=e.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const a={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},l=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={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,n,a]};a.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,n]},y=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],b=e.SHEBANG({binary:`(${y.join("|")})`,relevance:10}),k={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},v=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],N=["true","false"],E={match:/(\/[a-z._-]+)+/},C=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],S=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],_=["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"],M=["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:v,literal:N,built_in:[...C,...S,"set","shopt",..._,...M]},contains:[b,e.SHEBANG(),k,m,l,o,E,d,f,h,g,n]}}function W9(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",o="("+i+"|"+t.optional(a)+"[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:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:t.optional(a)+e.IDENT_RE,relevance:0},b=t.optional(a)+e.IDENT_RE+"\\s*\\(",N={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"},E=[m,d,n,e.C_BLOCK_COMMENT_MODE,g,h],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:N,contains:E.concat([{begin:/\(/,end:/\)/,keywords:N,contains:E.concat(["self"]),relevance:0}]),relevance:0},S={begin:"("+o+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:N,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:N,relevance:0},{begin:b,returnBegin:!0,contains:[e.inherit(y,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,h,g,d,{begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,h,g,d]}]},d,n,e.C_BLOCK_COMMENT_MODE,m]};return{name:"C",aliases:["h"],keywords:N,disableAutodetect:!0,illegal:"</",contains:[].concat(C,S,E,[m,{begin:e.IDENT_RE+"::",keywords:N},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:m,strings:h,keywords:N}}}function X9(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",o="(?!struct)("+i+"|"+t.optional(a)+"[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:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:t.optional(a)+e.IDENT_RE,relevance:0},b=t.optional(a)+e.IDENT_RE+"\\s*\\(",k=["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"],v=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],N=["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"],E=["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"],_={type:v,keyword:k,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:N},M={className:"function.dispatch",relevance:0,keywords:{_hint:E},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},T=[M,m,d,n,e.C_BLOCK_COMMENT_MODE,g,h],R={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:T.concat([{begin:/\(/,end:/\)/,keywords:_,contains:T.concat(["self"]),relevance:0}]),relevance:0},O={className:"function",begin:"("+o+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:_,relevance:0},{begin:b,returnBegin:!0,contains:[y],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[h,g]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,h,g,d,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,h,g,d]}]},d,n,e.C_BLOCK_COMMENT_MODE,m]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(R,O,M,T,[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:_,contains:["self",d]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Z9(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],i=["default","false","null","true"],a=["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"],l=["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"],o={keyword:a.concat(l),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/}),y={className:"subst",begin:/\{/,end:/\}/,keywords:o},b=e.inherit(y,{illegal:/\n/}),k={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,b]},v={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},y]},N=e.inherit(v,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},b]});y.contains=[v,k,g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,e.C_BLOCK_COMMENT_MODE],b.contains=[N,k,m,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const E={variants:[h,v,k,g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},C={begin:"<",end:">",contains:[{beginKeywords:"in out"},d]},S=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",_={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:o,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"}},E,f,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},d,C,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,C,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:"("+S+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,C],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[E,f,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_]}}const J9=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_-]*/}}),eF=["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"],tF=["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"],nF=[...eF,...tF],iF=["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(),rF=["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(),aF=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),sF=["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 lF(e){const t=e.regex,n=J9(e),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},a="and or not only",l=/@-?\w[\w]*(-\w+)*/,o="[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:[n.BLOCK_COMMENT,i,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+rF.join("|")+")"},{begin:":(:)?("+aF.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+sF.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.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}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:l},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:iF.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...d,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+nF.join("|")+")\\b"}]}}function oF(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 cF(e){const l={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:l,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:l,illegal:/["']/}]}]}}function uF(e){const t=e.regex,n=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[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(n,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function dF(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},i=e.COMMENT();i.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const a={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},l={className:"literal",begin:/\bon|off|true|false|yes|no\b/},o={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},d={begin:/\[/,end:/\]/,contains:[i,l,a,o,n,"self"],relevance:0},f=/[A-Za-z0-9_-]+/,h=/"(\\"|[^"])*"/,g=/'[^']*'/,m=t.either(f,h,g),y=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:y,className:"attr",starts:{end:/$/,contains:[i,d,l,a,o,n]}}]}}var po="[0-9](_*[0-9])*",Rf=`\\.(${po})`,Lf="[0-9a-fA-F](_*[0-9a-fA-F])*",_E={className:"number",variants:[{begin:`(\\b(${po})((${Rf})|\\.)?|(${Rf}))[eE][+-]?(${po})[fFdD]?\\b`},{begin:`\\b(${po})((${Rf})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Rf})[fFdD]?\\b`},{begin:`\\b(${po})[fFdD]\\b`},{begin:`\\b0[xX]((${Lf})\\.?|(${Lf})?\\.(${Lf}))[pP][+-]?(${po})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Lf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Mj(e,t,n){return n===-1?"":e.replace(t,i=>Mj(e,t,n-1))}function fF(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+Mj("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/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:"@"+n,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+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],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,_E,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_E,h]}}const jE="[A-Za-z$_][0-9A-Za-z$_]*",hF=["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"],pF=["true","false","null","undefined","NaN","Infinity"],Dj=["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"],Oj=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Rj=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],mF=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],gF=[].concat(Rj,Dj,Oj);function yF(e){const t=e.regex,n=(Q,{after:G})=>{const L="</"+Q[0].slice(1);return Q.input.indexOf(L,G)!==-1},i=jE,a={begin:"<>",end:"</>"},l=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Q,G)=>{const L=Q[0].length+Q.index,z=Q.input[L];if(z==="<"||z===","){G.ignoreMatch();return}z===">"&&(n(Q,{after:L})||G.ignoreMatch());let V;const B=Q.input.substring(L);if(V=B.match(/^\s*=/)){G.ignoreMatch();return}if((V=B.match(/^\s+extends\s+/))&&V.index===0){G.ignoreMatch();return}}},d={$pattern:jE,keyword:hF,literal:pF,built_in:gF,"variable.language":mF},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},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:d,contains:[]},b={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},k={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"css"}},v={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},N={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,y]},C={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]},S=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,k,v,N,{match:/\$\d+/},m];y.contains=S.concat({begin:/\{/,end:/\}/,keywords:d,contains:["self"].concat(S)});const _=[].concat(C,y.contains),M=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:d,contains:["self"].concat(_)}]),T={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:M},R={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"}}]},O={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:{_:[...Dj,...Oj]}},$={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[T],illegal:/%/},q={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(Q){return t.concat("(?!",Q.join("|"),")")}const Y={match:t.concat(/\b/,F([...Rj,"super","import"].map(Q=>`${Q}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},D={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},K={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},T]},P="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",H={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(P)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[T]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:d,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:O},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),$,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,k,v,N,C,{match:/\$\d+/},m,O,{scope:"attr",match:i+t.lookahead(":"),relevance:0},H,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[C,e.REGEXP_MODE,{className:"function",begin:P,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:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:l},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[T,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},D,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[T]},Y,q,R,K,{match:/\$[(.]/}]}}function bF(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],a={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[t,n,e.QUOTE_STRING_MODE,a,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var mo="[0-9](_*[0-9])*",If=`\\.(${mo})`,zf="[0-9a-fA-F](_*[0-9a-fA-F])*",xF={className:"number",variants:[{begin:`(\\b(${mo})((${If})|\\.)?|(${If}))[eE][+-]?(${mo})[fFdD]?\\b`},{begin:`\\b(${mo})((${If})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${If})[fFdD]?\\b`},{begin:`\\b(${mo})[fFdD]\\b`},{begin:`\\b0[xX]((${zf})\\.?|(${zf})?\\.(${zf}))[pP][+-]?(${mo})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${zf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function vF(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"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},i={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},a={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},l={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[l,a]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,l,a]}]};a.contains.push(o);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(o,{className:"string"}),"self"]}]},h=xF,g=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),m={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},y=m;return y.variants[1].contains=[m],m.variants[1].contains=[y],{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,n,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,o,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]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
647
+ `},h]}}const wF=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_-]*/}}),kF=["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"],EF=["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"],SF=[...kF,...EF],NF=["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(),Lj=["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(),Ij=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),_F=["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(),jF=Lj.concat(Ij).sort().reverse();function CF(e){const t=wF(e),n=jF,i="and or not only",a="[\\w-]+",l="("+a+"|@\\{"+a+"\\})",o=[],d=[],f=function(S){return{className:"string",begin:"~?"+S+".*?"+S}},h=function(S,_,M){return{className:S,begin:_,relevance:M}},g={$pattern:/[a-z-]+/,keyword:i,attribute:NF.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","@@?"+a,10),h("variable","@\\{"+a+"\\}"),h("built_in","~?`[^`]*?`"),{className:"attribute",begin:a+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const y=d.concat({begin:/\{/,end:/\}/,contains:o}),b={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(d)},k={begin:l+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+_F.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:d}}]},v={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}},N={className:"variable",variants:[{begin:"@"+a+"\\s*:",relevance:15},{begin:"@"+a}],starts:{end:"[;}]",returnEnd:!0,contains:y}},E={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:l,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,b,h("keyword","all\\b"),h("variable","@\\{"+a+"\\}"),{begin:"\\b("+SF.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,h("selector-tag",l,0),h("selector-id","#"+l),h("selector-class","\\."+l,0),h("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+Lj.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Ij.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:y},{begin:"!important"},t.FUNCTION_DISPATCH]},C={begin:a+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[E]};return o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,v,N,C,k,E,b,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}function AF(e){const t="\\[=*\\[",n="\\]=*\\]",i={begin:t,end:n,contains:["self"]},a=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{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:a.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:a}].concat(a)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[i],relevance:5}])}}function TF(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={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,n]},a={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},l={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},o={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,n,i,a,l,o]}}function MF(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},a={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}]},l={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={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:[]}),y=e.inherit(g,{contains:[]});h.contains.push(y),g.contains.push(m);let b=[n,f];return[h,g,m,y].forEach(E=>{E.contains=E.contains.concat(b)}),b=b.concat(h,g),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:b},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:b}]}]},n,l,h,g,{className:"quote",begin:"^>\\s+",contains:b,end:"$"},a,i,f,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function DF(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+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,d={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},f={$pattern:n,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 OF(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],i=/[dualxmsipngr]{0,12}/,a={$pattern:/[\w.]+/,keyword:n.join(" ")},l={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:a},o={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,l,f],m=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],y=(v,N,E="\\1")=>{const C=E==="\\1"?E:t.concat(E,N);return t.concat(t.concat("(?:",v,")"),N,/(?:\\.|[^\\\/])*?/,C,/(?:\\.|[^\\\/])*?/,E,i)},b=(v,N,E)=>t.concat(t.concat("(?:",v,")"),N,/(?:\\.|[^\\\/])*?/,E,i),k=[f,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{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:y("s|tr|y",t.either(...m,{capture:!0}))},{begin:y("s|tr|y","\\(","\\)")},{begin:y("s|tr|y","\\[","\\]")},{begin:y("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:b("(?:m|qr)?",/\//,/\//)},{begin:b("m|qr",t.either(...m,{capture:!0}),/\1/)},{begin:b("m|qr",/\(/,/\)/)},{begin:b("m|qr",/\[/,/\]/)},{begin:b("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 l.contains=k,o.contains=k,{name:"Perl",aliases:["pl","pm"],keywords:a,contains:k}}function RF(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,i=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),a=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),l=t.concat(/[A-Z]+/,n),o={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":(D,K)=>{K.data._beginMatch=D[1]||D[2]},"on:end":(D,K)=>{K.data._beginMatch!==D[1]&&K.ignoreMatch()}},y=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),b=`[
648
+ ]`,k={scope:"string",variants:[g,h,m,y]},v={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},N=["false","null","true"],E=["__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"],C=["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"],_={keyword:E,literal:(D=>{const K=[];return D.forEach(P=>{K.push(P),P.toLowerCase()===P?K.push(P.toUpperCase()):K.push(P.toLowerCase())}),K})(N),built_in:C},M=D=>D.map(K=>K.replace(/\|\d+$/,"")),T={variants:[{match:[/new/,t.concat(b,"+"),t.concat("(?!",M(C).join("\\b|"),"\\b)"),a],scope:{1:"keyword",4:"title.class"}}]},R=t.concat(i,"\\b(?!\\()"),O={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),R],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[a,t.concat(/::/,t.lookahead(/(?!class\b)/)),R],scope:{1:"title.class",3:"variable.constant"}},{match:[a,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[a,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},$={scope:"attr",match:t.concat(i,t.lookahead(":"),t.lookahead(/(?!::)/))},I={relevance:0,begin:/\(/,end:/\)/,keywords:_,contains:[$,o,O,e.C_BLOCK_COMMENT_MODE,k,v,T]},q={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",M(E).join("\\b|"),"|",M(C).join("\\b|"),"\\b)"),i,t.concat(b,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[I]};I.contains.push(q);const F=[$,O,e.C_BLOCK_COMMENT_MODE,k,v,T],Y={begin:t.concat(/#\[\s*\\?/,t.either(a,l)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:N,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:N,keyword:["new","array"]},contains:["self",...F]},...F,{scope:"meta",variants:[{match:a},{match:l}]}]};return{case_insensitive:!1,keywords:_,contains:[Y,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/},o,q,O,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},T,{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:_,contains:["self",Y,o,O,e.C_BLOCK_COMMENT_MODE,k,v]}]},{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]},k,v]}}function LF(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 IF(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function zF(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],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]},y="[0-9](_?[0-9])*",b=`(\\b(${y}))?\\.(${y})|\\b(${y})\\.`,k=`\\b|${i.join("|")}`,v={className:"number",relevance:0,variants:[{begin:`(\\b(${y})|(${b}))[eE][+-]?(${y})[jJ]?(?=${k})`},{begin:`(${b})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${k})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${k})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${k})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${k})`},{begin:`\\b(${y})[jJ](?=${k})`}]},N={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:d,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},E={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:["self",f,v,m,e.HASH_COMMENT_MODE]}]};return h.contains=[m,v,f],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:d,illegal:/(<\/|\?)|=>/,contains:[f,v,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},m,N,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[E]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[v,E,m]}]}}function PF(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function BF(e){const t=e.regex,n=/(?:(?:[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]?/),a=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,l=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[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:n},{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:[a,i]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,i]},{scope:{1:"punctuation",2:"number"},match:[l,i]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,i]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:a},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:l},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function $F(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),a=t.concat(i,/(::\w+)*/),o={"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:o},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]})]}]},y="[1-9](_?[0-9])*|0",b="[0-9](_?[0-9])*",k={className:"number",relevance:0,variants:[{begin:`\\b(${y})(\\.(${b}))?([eE][+-]?(${b})|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"}]},v={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},T=[m,{variants:[{match:[/class\s+/,a,/\s+<\s+/,a]},{match:[/\b(class|module)\s+/,a]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,a],scope:{2:"title.class"},keywords:o},{relevance:0,match:[a,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:i,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[v]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[m,{begin:n}],relevance:0},k,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{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=T,v.contains=T;const I=[{begin:/^\s*=>/,starts:{end:"$",contains:T}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:T}}];return h.unshift(f),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(I).concat(h).concat(T)}}function UF(e){const t=e.regex,n=/(r#)?/,i=t.concat(n,e.UNDERSCORE_IDENT_RE),a=t.concat(n,e.IDENT_RE),l={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,a,t.lookahead(/\s*\(/))},o="([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_]+)"+o},{begin:"\\b0o([0-7_]+)"+o},{begin:"\\b0x([A-Fa-f0-9_]+)"+o},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+o}],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:"->"},l]}}const FF=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_-]*/}}),qF=["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"],HF=["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"],KF=[...qF,...HF],GF=["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(),VF=["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(),YF=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),QF=["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 WF(e){const t=FF(e),n=YF,i=VF,a="@[a-z-]+",l="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("+KF.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+i.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},d,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+QF.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:a,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:l,attribute:GF.join(" ")},contains:[{begin:a,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 XF(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function ZF(e){const t=e.regex,n=e.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},a={begin:/"/,end:/"/,contains:[{match:/""/}]},l=["true","false","unknown"],o=["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"],y=["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"],b=g,k=[...h,...f].filter(M=>!g.includes(M)),v={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},N={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},E={match:t.concat(/\b/,t.either(...b),/\s*\(/),relevance:0,keywords:{built_in:b}};function C(M){return t.concat(/\b/,t.either(...M.map(T=>T.replace(/\s+/,"\\s+"))),/\b/)}const S={scope:"keyword",match:C(y),relevance:0};function _(M,{exceptions:T,when:R}={}){const O=R;return T=T||[],M.map($=>$.match(/\|\d+$/)||T.includes($)?$:O($)?`${$}|0`:$)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:_(k,{when:M=>M.length<3}),literal:l,type:d,built_in:m},contains:[{scope:"type",match:C(o)},S,E,v,i,a,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,N]}}function zj(e){return e?typeof e=="string"?e:e.source:null}function au(e){return Ut("(?=",e,")")}function Ut(...e){return e.map(n=>zj(n)).join("")}function JF(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Jn(...e){return"("+(JF(e).capture?"":"?:")+e.map(i=>zj(i)).join("|")+")"}const Lx=e=>Ut(/\b/,e,/\w$/.test(e)?/\b/:/\B/),e8=["Protocol","Type"].map(Lx),CE=["init","self"].map(Lx),t8=["Any","Self"],ry=["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"],AE=["false","nil","true"],n8=["assignment","associativity","higherThan","left","lowerThan","none","right"],i8=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],TE=["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"],Pj=Jn(/[/=\-+!*%<>&|^~?]/,/[\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]/),Bj=Jn(Pj,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),ay=Ut(Pj,Bj,"*"),$j=Jn(/[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]/),Eh=Jn($j,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Sr=Ut($j,Eh,"*"),Pf=Ut(/[A-Z]/,Eh,"*"),r8=["attached","autoclosure",Ut(/convention\(/,Jn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Ut(/objc\(/,Sr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],a8=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function s8(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[e.C_LINE_COMMENT_MODE,n],a={match:[/\./,Jn(...e8,...CE)],className:{2:"keyword"}},l={match:Ut(/\./,Jn(...ry)),relevance:0},o=ry.filter(pe=>typeof pe=="string").concat(["_|0"]),d=ry.filter(pe=>typeof pe!="string").concat(t8).map(Lx),f={variants:[{className:"keyword",match:Jn(...d,...CE)}]},h={$pattern:Jn(/\b\w+/,/#\w+/),keyword:o.concat(i8),literal:AE},g=[a,l,f],m={match:Ut(/\./,Jn(...TE)),relevance:0},y={className:"built_in",match:Ut(/\b/,Jn(...TE),/(?=\()/)},b=[m,y],k={match:/->/,relevance:0},v={className:"operator",relevance:0,variants:[{match:ay},{match:`\\.(\\.|${Bj})+`}]},N=[k,v],E="([0-9]_*)+",C="([0-9a-fA-F]_*)+",S={className:"number",relevance:0,variants:[{match:`\\b(${E})(\\.(${E}))?([eE][+-]?(${E}))?\\b`},{match:`\\b0x(${C})(\\.(${C}))?([pP][+-]?(${E}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},_=(pe="")=>({className:"subst",variants:[{match:Ut(/\\/,pe,/[0\\tnr"']/)},{match:Ut(/\\/,pe,/u\{[0-9a-fA-F]{1,8}\}/)}]}),M=(pe="")=>({className:"subst",match:Ut(/\\/,pe,/[\t ]*(?:[\r\n]|\r\n)/)}),T=(pe="")=>({className:"subst",label:"interpol",begin:Ut(/\\/,pe,/\(/),end:/\)/}),R=(pe="")=>({begin:Ut(pe,/"""/),end:Ut(/"""/,pe),contains:[_(pe),M(pe),T(pe)]}),O=(pe="")=>({begin:Ut(pe,/"/),end:Ut(/"/,pe),contains:[_(pe),T(pe)]}),$={className:"string",variants:[R(),R("#"),R("##"),R("###"),O(),O("#"),O("##"),O("###")]},I=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],q={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:I},F=pe=>{const Fe=Ut(pe,/\//),ze=Ut(/\//,pe);return{begin:Fe,end:ze,contains:[...I,{scope:"comment",begin:`#(?!.*${ze})`,end:/$/}]}},Y={scope:"regexp",variants:[F("###"),F("##"),F("#"),q]},D={match:Ut(/`/,Sr,/`/)},K={className:"variable",match:/\$\d+/},P={className:"variable",match:`\\$${Eh}+`},H=[D,K,P],Q={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:a8,contains:[...N,S,$]}]}},G={scope:"keyword",match:Ut(/@/,Jn(...r8),au(Jn(/\(/,/\s+/)))},L={scope:"meta",match:Ut(/@/,Sr)},z=[Q,G,L],V={match:au(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Ut(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Eh,"+")},{className:"type",match:Pf,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Ut(/\s+&\s+/,au(Pf)),relevance:0}]},B={begin:/</,end:/>/,keywords:h,contains:[...i,...g,...z,k,V]};V.contains.push(B);const le={match:Ut(Sr,/\s*:/),keywords:"_|0",relevance:0},ve={begin:/\(/,end:/\)/,relevance:0,keywords:h,contains:["self",le,...i,Y,...g,...b,...N,S,$,...H,...z,V]},ke={begin:/</,end:/>/,keywords:"repeat each",contains:[...i,V]},Se={begin:Jn(au(Ut(Sr,/\s*:/)),au(Ut(Sr,/\s+/,Sr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Sr}]},J={begin:/\(/,end:/\)/,keywords:h,contains:[Se,...i,...g,...N,S,$,...z,V,ve],endsParent:!0,illegal:/["']/},ue={match:[/(func|macro)/,/\s+/,Jn(D.match,Sr,ay)],className:{1:"keyword",3:"title.function"},contains:[ke,J,t],illegal:[/\[/,/%/]},Te={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ke,J,t],illegal:/\[|%/},Re={match:[/operator/,/\s+/,ay],className:{1:"keyword",3:"title"}},De={begin:[/precedencegroup/,/\s+/,Pf],className:{1:"keyword",3:"title"},contains:[V],keywords:[...n8,...AE],end:/}/},ce={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Ce={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},te={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Sr,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:h,contains:[ke,...g,{begin:/:/,end:/\{/,keywords:h,contains:[{scope:"title.class.inherited",match:Pf},...g],relevance:0}]};for(const pe of $.variants){const Fe=pe.contains.find(ae=>ae.label==="interpol");Fe.keywords=h;const ze=[...g,...b,...N,S,$,...H];Fe.contains=[...ze,{begin:/\(/,end:/\)/,contains:["self",...ze]}]}return{name:"Swift",keywords:h,contains:[...i,ue,Te,ce,Ce,te,Re,De,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},Y,...g,...b,...N,S,$,...H,...z,V,ve]}}const Sh="[A-Za-z$_][0-9A-Za-z$_]*",Uj=["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"],Fj=["true","false","null","undefined","NaN","Infinity"],qj=["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"],Hj=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Kj=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Gj=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Vj=[].concat(Kj,qj,Hj);function l8(e){const t=e.regex,n=(Q,{after:G})=>{const L="</"+Q[0].slice(1);return Q.input.indexOf(L,G)!==-1},i=Sh,a={begin:"<>",end:"</>"},l=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Q,G)=>{const L=Q[0].length+Q.index,z=Q.input[L];if(z==="<"||z===","){G.ignoreMatch();return}z===">"&&(n(Q,{after:L})||G.ignoreMatch());let V;const B=Q.input.substring(L);if(V=B.match(/^\s*=/)){G.ignoreMatch();return}if((V=B.match(/^\s+extends\s+/))&&V.index===0){G.ignoreMatch();return}}},d={$pattern:Sh,keyword:Uj,literal:Fj,built_in:Vj,"variable.language":Gj},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},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:d,contains:[]},b={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},k={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"css"}},v={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},N={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,y]},C={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]},S=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,k,v,N,{match:/\$\d+/},m];y.contains=S.concat({begin:/\{/,end:/\}/,keywords:d,contains:["self"].concat(S)});const _=[].concat(C,y.contains),M=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:d,contains:["self"].concat(_)}]),T={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:M},R={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"}}]},O={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:{_:[...qj,...Hj]}},$={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[T],illegal:/%/},q={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(Q){return t.concat("(?!",Q.join("|"),")")}const Y={match:t.concat(/\b/,F([...Kj,"super","import"].map(Q=>`${Q}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},D={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},K={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},T]},P="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",H={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(P)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[T]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:d,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:O},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),$,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,k,v,N,C,{match:/\$\d+/},m,O,{scope:"attr",match:i+t.lookahead(":"),relevance:0},H,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[C,e.REGEXP_MODE,{className:"function",begin:P,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:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:l},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[T,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},D,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[T]},Y,q,R,K,{match:/\$[(.]/}]}}function o8(e){const t=e.regex,n=l8(e),i=Sh,a=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],l={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:a},contains:[n.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:Sh,keyword:Uj.concat(f),literal:Fj,built_in:Vj.concat(a),"variable.language":Gj},g={className:"meta",begin:"@"+i},m=(v,N,E)=>{const C=v.contains.findIndex(S=>S.label===N);if(C===-1)throw new Error("can not find mode to replace");v.contains.splice(C,1,E)};Object.assign(n.keywords,h),n.exports.PARAMS_CONTAINS.push(g);const y=n.contains.find(v=>v.scope==="attr"),b=Object.assign({},y,{match:t.concat(i,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,y,b]),n.contains=n.contains.concat([g,l,o,b]),m(n,"shebang",e.SHEBANG()),m(n,"use_strict",d);const k=n.contains.find(v=>v.label==="func.def");return k.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function c8(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},i={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},a=/\d{1,2}\/\d{1,2}\/\d{4}/,l=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\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(l,a),/ *#/)},{begin:t.concat(/# */,d,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(l,a),/ +/,t.either(o,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:/>/}]}),y=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:[n,i,f,h,g,m,y,{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:[y]}]}}function u8(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=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"],a={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},l={className:"variable",begin:/\$[\w_]+/},o={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:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},l,o,a,e.QUOTE_STRING_MODE,f,h,d]}}function d8(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,a={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},l={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(l,{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:[a]},{begin:/'/,end:/'/,contains:[a]},{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:[l,f,d,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[l,o,f,d]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},a,{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(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:h}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function f8(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},a={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},l={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,a]},d=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),y={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"},b={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},k={begin:/\{/,end:/\}/,contains:[b],illegal:"\\n",relevance:0},v={begin:"\\[",end:"\\]",contains:[b],illegal:"\\n",relevance:0},N=[i,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+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}},y,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},k,v,l,o],E=[...N];return E.pop(),E.push(d),b.contains=E,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:N}}const h8={arduino:Y9,bash:Q9,c:W9,cpp:X9,csharp:Z9,css:lF,diff:oF,go:cF,graphql:uF,ini:dF,java:fF,javascript:yF,json:bF,kotlin:vF,less:CF,lua:AF,makefile:TF,markdown:MF,objectivec:DF,perl:OF,php:RF,"php-template":LF,plaintext:IF,python:zF,"python-repl":PF,r:BF,ruby:$F,rust:UF,scss:WF,shell:XF,sql:ZF,swift:s8,typescript:o8,vbnet:c8,wasm:u8,xml:d8,yaml:f8};var sy,ME;function p8(){if(ME)return sy;ME=1;function e(Z){return Z instanceof Map?Z.clear=Z.delete=Z.set=function(){throw new Error("map is read-only")}:Z instanceof Set&&(Z.add=Z.clear=Z.delete=function(){throw new Error("set is read-only")}),Object.freeze(Z),Object.getOwnPropertyNames(Z).forEach(ge=>{const Me=Z[ge],it=typeof Me;(it==="object"||it==="function")&&!Object.isFrozen(Me)&&e(Me)}),Z}class t{constructor(ge){ge.data===void 0&&(ge.data={}),this.data=ge.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(Z){return Z.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function i(Z,...ge){const Me=Object.create(null);for(const it in Z)Me[it]=Z[it];return ge.forEach(function(it){for(const Ft in it)Me[Ft]=it[Ft]}),Me}const a="</span>",l=Z=>!!Z.scope,o=(Z,{prefix:ge})=>{if(Z.startsWith("language:"))return Z.replace("language:","language-");if(Z.includes(".")){const Me=Z.split(".");return[`${ge}${Me.shift()}`,...Me.map((it,Ft)=>`${it}${"_".repeat(Ft+1)}`)].join(" ")}return`${ge}${Z}`};class d{constructor(ge,Me){this.buffer="",this.classPrefix=Me.classPrefix,ge.walk(this)}addText(ge){this.buffer+=n(ge)}openNode(ge){if(!l(ge))return;const Me=o(ge.scope,{prefix:this.classPrefix});this.span(Me)}closeNode(ge){l(ge)&&(this.buffer+=a)}value(){return this.buffer}span(ge){this.buffer+=`<span class="${ge}">`}}const f=(Z={})=>{const ge={children:[]};return Object.assign(ge,Z),ge};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(ge){this.top.children.push(ge)}openNode(ge){const Me=f({scope:ge});this.add(Me),this.stack.push(Me)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(ge){return this.constructor._walk(ge,this.rootNode)}static _walk(ge,Me){return typeof Me=="string"?ge.addText(Me):Me.children&&(ge.openNode(Me),Me.children.forEach(it=>this._walk(ge,it)),ge.closeNode(Me)),ge}static _collapse(ge){typeof ge!="string"&&ge.children&&(ge.children.every(Me=>typeof Me=="string")?ge.children=[ge.children.join("")]:ge.children.forEach(Me=>{h._collapse(Me)}))}}class g extends h{constructor(ge){super(),this.options=ge}addText(ge){ge!==""&&this.add(ge)}startScope(ge){this.openNode(ge)}endScope(){this.closeNode()}__addSublanguage(ge,Me){const it=ge.root;Me&&(it.scope=`language:${Me}`),this.add(it)}toHTML(){return new d(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function m(Z){return Z?typeof Z=="string"?Z:Z.source:null}function y(Z){return v("(?=",Z,")")}function b(Z){return v("(?:",Z,")*")}function k(Z){return v("(?:",Z,")?")}function v(...Z){return Z.map(Me=>m(Me)).join("")}function N(Z){const ge=Z[Z.length-1];return typeof ge=="object"&&ge.constructor===Object?(Z.splice(Z.length-1,1),ge):{}}function E(...Z){return"("+(N(Z).capture?"":"?:")+Z.map(it=>m(it)).join("|")+")"}function C(Z){return new RegExp(Z.toString()+"|").exec("").length-1}function S(Z,ge){const Me=Z&&Z.exec(ge);return Me&&Me.index===0}const _=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function M(Z,{joinWith:ge}){let Me=0;return Z.map(it=>{Me+=1;const Ft=Me;let Ot=m(it),Ue="";for(;Ot.length>0;){const Pe=_.exec(Ot);if(!Pe){Ue+=Ot;break}Ue+=Ot.substring(0,Pe.index),Ot=Ot.substring(Pe.index+Pe[0].length),Pe[0][0]==="\\"&&Pe[1]?Ue+="\\"+String(Number(Pe[1])+Ft):(Ue+=Pe[0],Pe[0]==="("&&Me++)}return Ue}).map(it=>`(${it})`).join(ge)}const T=/\b\B/,R="[a-zA-Z]\\w*",O="[a-zA-Z_]\\w*",$="\\b\\d+(\\.\\d+)?",I="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",q="\\b(0b[01]+)",F="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Y=(Z={})=>{const ge=/^#![ ]*\//;return Z.binary&&(Z.begin=v(ge,/.*\b/,Z.binary,/\b.*/)),i({scope:"meta",begin:ge,end:/$/,relevance:0,"on:begin":(Me,it)=>{Me.index!==0&&it.ignoreMatch()}},Z)},D={begin:"\\\\[\\s\\S]",relevance:0},K={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[D]},P={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[D]},H={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/},Q=function(Z,ge,Me={}){const it=i({scope:"comment",begin:Z,end:ge,contains:[]},Me);it.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 Ft=E("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 it.contains.push({begin:v(/[ ]+/,"(",Ft,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),it},G=Q("//","$"),L=Q("/\\*","\\*/"),z=Q("#","$"),V={scope:"number",begin:$,relevance:0},B={scope:"number",begin:I,relevance:0},le={scope:"number",begin:q,relevance:0},ve={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[D,{begin:/\[/,end:/\]/,relevance:0,contains:[D]}]},ke={scope:"title",begin:R,relevance:0},Se={scope:"title",begin:O,relevance:0},J={begin:"\\.\\s*"+O,relevance:0};var Te=Object.freeze({__proto__:null,APOS_STRING_MODE:K,BACKSLASH_ESCAPE:D,BINARY_NUMBER_MODE:le,BINARY_NUMBER_RE:q,COMMENT:Q,C_BLOCK_COMMENT_MODE:L,C_LINE_COMMENT_MODE:G,C_NUMBER_MODE:B,C_NUMBER_RE:I,END_SAME_AS_BEGIN:function(Z){return Object.assign(Z,{"on:begin":(ge,Me)=>{Me.data._beginMatch=ge[1]},"on:end":(ge,Me)=>{Me.data._beginMatch!==ge[1]&&Me.ignoreMatch()}})},HASH_COMMENT_MODE:z,IDENT_RE:R,MATCH_NOTHING_RE:T,METHOD_GUARD:J,NUMBER_MODE:V,NUMBER_RE:$,PHRASAL_WORDS_MODE:H,QUOTE_STRING_MODE:P,REGEXP_MODE:ve,RE_STARTERS_RE:F,SHEBANG:Y,TITLE_MODE:ke,UNDERSCORE_IDENT_RE:O,UNDERSCORE_TITLE_MODE:Se});function Re(Z,ge){Z.input[Z.index-1]==="."&&ge.ignoreMatch()}function De(Z,ge){Z.className!==void 0&&(Z.scope=Z.className,delete Z.className)}function ce(Z,ge){ge&&Z.beginKeywords&&(Z.begin="\\b("+Z.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",Z.__beforeBegin=Re,Z.keywords=Z.keywords||Z.beginKeywords,delete Z.beginKeywords,Z.relevance===void 0&&(Z.relevance=0))}function Ce(Z,ge){Array.isArray(Z.illegal)&&(Z.illegal=E(...Z.illegal))}function te(Z,ge){if(Z.match){if(Z.begin||Z.end)throw new Error("begin & end are not supported with match");Z.begin=Z.match,delete Z.match}}function pe(Z,ge){Z.relevance===void 0&&(Z.relevance=1)}const Fe=(Z,ge)=>{if(!Z.beforeMatch)return;if(Z.starts)throw new Error("beforeMatch cannot be used with starts");const Me=Object.assign({},Z);Object.keys(Z).forEach(it=>{delete Z[it]}),Z.keywords=Me.keywords,Z.begin=v(Me.beforeMatch,y(Me.begin)),Z.starts={relevance:0,contains:[Object.assign(Me,{endsParent:!0})]},Z.relevance=0,delete Me.beforeMatch},ze=["of","and","for","in","not","or","if","then","parent","list","value"],ae="keyword";function be(Z,ge,Me=ae){const it=Object.create(null);return typeof Z=="string"?Ft(Me,Z.split(" ")):Array.isArray(Z)?Ft(Me,Z):Object.keys(Z).forEach(function(Ot){Object.assign(it,be(Z[Ot],ge,Ot))}),it;function Ft(Ot,Ue){ge&&(Ue=Ue.map(Pe=>Pe.toLowerCase())),Ue.forEach(function(Pe){const et=Pe.split("|");it[et[0]]=[Ot,ye(et[0],et[1])]})}}function ye(Z,ge){return ge?Number(ge):he(Z)?0:1}function he(Z){return ze.includes(Z.toLowerCase())}const Ee={},Ne=Z=>{console.error(Z)},Ke=(Z,...ge)=>{console.log(`WARN: ${Z}`,...ge)},ne=(Z,ge)=>{Ee[`${Z}/${ge}`]||(console.log(`Deprecated as of ${Z}. ${ge}`),Ee[`${Z}/${ge}`]=!0)},de=new Error;function Le(Z,ge,{key:Me}){let it=0;const Ft=Z[Me],Ot={},Ue={};for(let Pe=1;Pe<=ge.length;Pe++)Ue[Pe+it]=Ft[Pe],Ot[Pe+it]=!0,it+=C(ge[Pe-1]);Z[Me]=Ue,Z[Me]._emit=Ot,Z[Me]._multi=!0}function Ze(Z){if(Array.isArray(Z.begin)){if(Z.skip||Z.excludeBegin||Z.returnBegin)throw Ne("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),de;if(typeof Z.beginScope!="object"||Z.beginScope===null)throw Ne("beginScope must be object"),de;Le(Z,Z.begin,{key:"beginScope"}),Z.begin=M(Z.begin,{joinWith:""})}}function rt(Z){if(Array.isArray(Z.end)){if(Z.skip||Z.excludeEnd||Z.returnEnd)throw Ne("skip, excludeEnd, returnEnd not compatible with endScope: {}"),de;if(typeof Z.endScope!="object"||Z.endScope===null)throw Ne("endScope must be object"),de;Le(Z,Z.end,{key:"endScope"}),Z.end=M(Z.end,{joinWith:""})}}function At(Z){Z.scope&&typeof Z.scope=="object"&&Z.scope!==null&&(Z.beginScope=Z.scope,delete Z.scope)}function $n(Z){At(Z),typeof Z.beginScope=="string"&&(Z.beginScope={_wrap:Z.beginScope}),typeof Z.endScope=="string"&&(Z.endScope={_wrap:Z.endScope}),Ze(Z),rt(Z)}function dn(Z){function ge(Ue,Pe){return new RegExp(m(Ue),"m"+(Z.case_insensitive?"i":"")+(Z.unicodeRegex?"u":"")+(Pe?"g":""))}class Me{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Pe,et){et.position=this.position++,this.matchIndexes[this.matchAt]=et,this.regexes.push([et,Pe]),this.matchAt+=C(Pe)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Pe=this.regexes.map(et=>et[1]);this.matcherRe=ge(M(Pe,{joinWith:"|"}),!0),this.lastIndex=0}exec(Pe){this.matcherRe.lastIndex=this.lastIndex;const et=this.matcherRe.exec(Pe);if(!et)return null;const rn=et.findIndex((Qi,ka)=>ka>0&&Qi!==void 0),Vt=this.matchIndexes[rn];return et.splice(0,rn),Object.assign(et,Vt)}}class it{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Pe){if(this.multiRegexes[Pe])return this.multiRegexes[Pe];const et=new Me;return this.rules.slice(Pe).forEach(([rn,Vt])=>et.addRule(rn,Vt)),et.compile(),this.multiRegexes[Pe]=et,et}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Pe,et){this.rules.push([Pe,et]),et.type==="begin"&&this.count++}exec(Pe){const et=this.getMatcher(this.regexIndex);et.lastIndex=this.lastIndex;let rn=et.exec(Pe);if(this.resumingScanAtSamePosition()&&!(rn&&rn.index===this.lastIndex)){const Vt=this.getMatcher(0);Vt.lastIndex=this.lastIndex+1,rn=Vt.exec(Pe)}return rn&&(this.regexIndex+=rn.position+1,this.regexIndex===this.count&&this.considerAll()),rn}}function Ft(Ue){const Pe=new it;return Ue.contains.forEach(et=>Pe.addRule(et.begin,{rule:et,type:"begin"})),Ue.terminatorEnd&&Pe.addRule(Ue.terminatorEnd,{type:"end"}),Ue.illegal&&Pe.addRule(Ue.illegal,{type:"illegal"}),Pe}function Ot(Ue,Pe){const et=Ue;if(Ue.isCompiled)return et;[De,te,$n,Fe].forEach(Vt=>Vt(Ue,Pe)),Z.compilerExtensions.forEach(Vt=>Vt(Ue,Pe)),Ue.__beforeBegin=null,[ce,Ce,pe].forEach(Vt=>Vt(Ue,Pe)),Ue.isCompiled=!0;let rn=null;return typeof Ue.keywords=="object"&&Ue.keywords.$pattern&&(Ue.keywords=Object.assign({},Ue.keywords),rn=Ue.keywords.$pattern,delete Ue.keywords.$pattern),rn=rn||/\w+/,Ue.keywords&&(Ue.keywords=be(Ue.keywords,Z.case_insensitive)),et.keywordPatternRe=ge(rn,!0),Pe&&(Ue.begin||(Ue.begin=/\B|\b/),et.beginRe=ge(et.begin),!Ue.end&&!Ue.endsWithParent&&(Ue.end=/\B|\b/),Ue.end&&(et.endRe=ge(et.end)),et.terminatorEnd=m(et.end)||"",Ue.endsWithParent&&Pe.terminatorEnd&&(et.terminatorEnd+=(Ue.end?"|":"")+Pe.terminatorEnd)),Ue.illegal&&(et.illegalRe=ge(Ue.illegal)),Ue.contains||(Ue.contains=[]),Ue.contains=[].concat(...Ue.contains.map(function(Vt){return Qt(Vt==="self"?Ue:Vt)})),Ue.contains.forEach(function(Vt){Ot(Vt,et)}),Ue.starts&&Ot(Ue.starts,Pe),et.matcher=Ft(et),et}if(Z.compilerExtensions||(Z.compilerExtensions=[]),Z.contains&&Z.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return Z.classNameAliases=i(Z.classNameAliases||{}),Ot(Z)}function Mt(Z){return Z?Z.endsWithParent||Mt(Z.starts):!1}function Qt(Z){return Z.variants&&!Z.cachedVariants&&(Z.cachedVariants=Z.variants.map(function(ge){return i(Z,{variants:null},ge)})),Z.cachedVariants?Z.cachedVariants:Mt(Z)?i(Z,{starts:Z.starts?i(Z.starts):null}):Object.isFrozen(Z)?i(Z):Z}var yt="11.11.1";class Ti extends Error{constructor(ge,Me){super(ge),this.name="HTMLInjectionError",this.html=Me}}const Rn=n,Nl=i,Pr=Symbol("nomatch"),wa=7,Br=function(Z){const ge=Object.create(null),Me=Object.create(null),it=[];let Ft=!0;const Ot="Could not find the language '{}', did you forget to load/include a language module?",Ue={disableAutodetect:!0,name:"Plain text",contains:[]};let Pe={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:g};function et(_e){return Pe.noHighlightRe.test(_e)}function rn(_e){let Ve=_e.className+" ";Ve+=_e.parentNode?_e.parentNode.className:"";const ht=Pe.languageDetectRe.exec(Ve);if(ht){const Nt=Ln(ht[1]);return Nt||(Ke(Ot.replace("{}",ht[1])),Ke("Falling back to no-highlight mode for this block.",_e)),Nt?ht[1]:"no-highlight"}return Ve.split(/\s+/).find(Nt=>et(Nt)||Ln(Nt))}function Vt(_e,Ve,ht){let Nt="",sn="";typeof Ve=="object"?(Nt=_e,ht=Ve.ignoreIllegals,sn=Ve.language):(ne("10.7.0","highlight(lang, code, ...args) has been deprecated."),ne("10.7.0",`Please use highlight(code, options) instead.
649
+ https://github.com/highlightjs/highlight.js/issues/2277`),sn=_e,Nt=Ve),ht===void 0&&(ht=!0);const Mn={code:Nt,language:sn};Ur("before:highlight",Mn);const Qn=Mn.result?Mn.result:Qi(Mn.language,Mn.code,ht);return Qn.code=Mn.code,Ur("after:highlight",Qn),Qn}function Qi(_e,Ve,ht,Nt){const sn=Object.create(null);function Mn(Ae,qe){return Ae.keywords[qe]}function Qn(){if(!nt.keywords){xn.addText(Rt);return}let Ae=0;nt.keywordPatternRe.lastIndex=0;let qe=nt.keywordPatternRe.exec(Rt),lt="";for(;qe;){lt+=Rt.substring(Ae,qe.index);const bt=_n.case_insensitive?qe[0].toLowerCase():qe[0],ln=Mn(nt,bt);if(ln){const[Di,cc]=ln;if(xn.addText(lt),lt="",sn[bt]=(sn[bt]||0)+1,sn[bt]<=wa&&(Aa+=cc),Di.startsWith("_"))lt+=qe[0];else{const cd=_n.classNameAliases[Di]||Di;Wn(qe[0],cd)}}else lt+=qe[0];Ae=nt.keywordPatternRe.lastIndex,qe=nt.keywordPatternRe.exec(Rt)}lt+=Rt.substring(Ae),xn.addText(lt)}function Fn(){if(Rt==="")return;let Ae=null;if(typeof nt.subLanguage=="string"){if(!ge[nt.subLanguage]){xn.addText(Rt);return}Ae=Qi(nt.subLanguage,Rt,!0,od[nt.subLanguage]),od[nt.subLanguage]=Ae._top}else Ae=Ea(Rt,nt.subLanguage.length?nt.subLanguage:null);nt.relevance>0&&(Aa+=Ae.relevance),xn.__addSublanguage(Ae._emitter,Ae.language)}function zt(){nt.subLanguage!=null?Fn():Qn(),Rt=""}function Wn(Ae,qe){Ae!==""&&(xn.startScope(qe),xn.addText(Ae),xn.endScope())}function Cl(Ae,qe){let lt=1;const bt=qe.length-1;for(;lt<=bt;){if(!Ae._emit[lt]){lt++;continue}const ln=_n.classNameAliases[Ae[lt]]||Ae[lt],Di=qe[lt];ln?Wn(Di,ln):(Rt=Di,Qn(),Rt=""),lt++}}function _a(Ae,qe){return Ae.scope&&typeof Ae.scope=="string"&&xn.openNode(_n.classNameAliases[Ae.scope]||Ae.scope),Ae.beginScope&&(Ae.beginScope._wrap?(Wn(Rt,_n.classNameAliases[Ae.beginScope._wrap]||Ae.beginScope._wrap),Rt=""):Ae.beginScope._multi&&(Cl(Ae.beginScope,qe),Rt="")),nt=Object.create(Ae,{parent:{value:nt}}),nt}function br(Ae,qe,lt){let bt=S(Ae.endRe,lt);if(bt){if(Ae["on:end"]){const ln=new t(Ae);Ae["on:end"](qe,ln),ln.isMatchIgnored&&(bt=!1)}if(bt){for(;Ae.endsParent&&Ae.parent;)Ae=Ae.parent;return Ae}}if(Ae.endsWithParent)return br(Ae.parent,qe,lt)}function ja(Ae){return nt.matcher.regexIndex===0?(Rt+=Ae[0],1):(Ta=!0,0)}function Al(Ae){const qe=Ae[0],lt=Ae.rule,bt=new t(lt),ln=[lt.__beforeBegin,lt["on:begin"]];for(const Di of ln)if(Di&&(Di(Ae,bt),bt.isMatchIgnored))return ja(qe);return lt.skip?Rt+=qe:(lt.excludeBegin&&(Rt+=qe),zt(),!lt.returnBegin&&!lt.excludeBegin&&(Rt=qe)),_a(lt,Ae),lt.returnBegin?0:qe.length}function qn(Ae){const qe=Ae[0],lt=Ve.substring(Ae.index),bt=br(nt,Ae,lt);if(!bt)return Pr;const ln=nt;nt.endScope&&nt.endScope._wrap?(zt(),Wn(qe,nt.endScope._wrap)):nt.endScope&&nt.endScope._multi?(zt(),Cl(nt.endScope,Ae)):ln.skip?Rt+=qe:(ln.returnEnd||ln.excludeEnd||(Rt+=qe),zt(),ln.excludeEnd&&(Rt=qe));do nt.scope&&xn.closeNode(),!nt.skip&&!nt.subLanguage&&(Aa+=nt.relevance),nt=nt.parent;while(nt!==bt.parent);return bt.starts&&_a(bt.starts,Ae),ln.returnEnd?0:qe.length}function Cs(){const Ae=[];for(let qe=nt;qe!==_n;qe=qe.parent)qe.scope&&Ae.unshift(qe.scope);Ae.forEach(qe=>xn.openNode(qe))}let er={};function Ca(Ae,qe){const lt=qe&&qe[0];if(Rt+=Ae,lt==null)return zt(),0;if(er.type==="begin"&&qe.type==="end"&&er.index===qe.index&&lt===""){if(Rt+=Ve.slice(qe.index,qe.index+1),!Ft){const bt=new Error(`0 width match regex (${_e})`);throw bt.languageName=_e,bt.badRule=er.rule,bt}return 1}if(er=qe,qe.type==="begin")return Al(qe);if(qe.type==="illegal"&&!ht){const bt=new Error('Illegal lexeme "'+lt+'" for mode "'+(nt.scope||"<unnamed>")+'"');throw bt.mode=nt,bt}else if(qe.type==="end"){const bt=qn(qe);if(bt!==Pr)return bt}if(qe.type==="illegal"&&lt==="")return Rt+=`
650
+ `,1;if(oc>1e5&&oc>qe.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Rt+=lt,lt.length}const _n=Ln(_e);if(!_n)throw Ne(Ot.replace("{}",_e)),new Error('Unknown language: "'+_e+'"');const As=dn(_n);let Tl="",nt=Nt||As;const od={},xn=new Pe.__emitter(Pe);Cs();let Rt="",Aa=0,Fr=0,oc=0,Ta=!1;try{if(_n.__emitTokens)_n.__emitTokens(Ve,xn);else{for(nt.matcher.considerAll();;){oc++,Ta?Ta=!1:nt.matcher.considerAll(),nt.matcher.lastIndex=Fr;const Ae=nt.matcher.exec(Ve);if(!Ae)break;const qe=Ve.substring(Fr,Ae.index),lt=Ca(qe,Ae);Fr=Ae.index+lt}Ca(Ve.substring(Fr))}return xn.finalize(),Tl=xn.toHTML(),{language:_e,value:Tl,relevance:Aa,illegal:!1,_emitter:xn,_top:nt}}catch(Ae){if(Ae.message&&Ae.message.includes("Illegal"))return{language:_e,value:Rn(Ve),illegal:!0,relevance:0,_illegalBy:{message:Ae.message,index:Fr,context:Ve.slice(Fr-100,Fr+100),mode:Ae.mode,resultSoFar:Tl},_emitter:xn};if(Ft)return{language:_e,value:Rn(Ve),illegal:!1,relevance:0,errorRaised:Ae,_emitter:xn,_top:nt};throw Ae}}function ka(_e){const Ve={value:Rn(_e),illegal:!1,relevance:0,_top:Ue,_emitter:new Pe.__emitter(Pe)};return Ve._emitter.addText(_e),Ve}function Ea(_e,Ve){Ve=Ve||Pe.languages||Object.keys(ge);const ht=ka(_e),Nt=Ve.filter(Ln).filter(Zi).map(zt=>Qi(zt,_e,!1));Nt.unshift(ht);const sn=Nt.sort((zt,Wn)=>{if(zt.relevance!==Wn.relevance)return Wn.relevance-zt.relevance;if(zt.language&&Wn.language){if(Ln(zt.language).supersetOf===Wn.language)return 1;if(Ln(Wn.language).supersetOf===zt.language)return-1}return 0}),[Mn,Qn]=sn,Fn=Mn;return Fn.secondBest=Qn,Fn}function Mi(_e,Ve,ht){const Nt=Ve&&Me[Ve]||ht;_e.classList.add("hljs"),_e.classList.add(`language-${Nt}`)}function an(_e){let Ve=null;const ht=rn(_e);if(et(ht))return;if(Ur("before:highlightElement",{el:_e,language:ht}),_e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",_e);return}if(_e.children.length>0&&(Pe.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(_e)),Pe.throwUnescapedHTML))throw new Ti("One of your code blocks includes unescaped HTML.",_e.innerHTML);Ve=_e;const Nt=Ve.textContent,sn=ht?Vt(Nt,{language:ht,ignoreIllegals:!0}):Ea(Nt);_e.innerHTML=sn.value,_e.dataset.highlighted="yes",Mi(_e,ht,sn.language),_e.result={language:sn.language,re:sn.relevance,relevance:sn.relevance},sn.secondBest&&(_e.secondBest={language:sn.secondBest.language,relevance:sn.secondBest.relevance}),Ur("after:highlightElement",{el:_e,result:sn,text:Nt})}function Tn(_e){Pe=Nl(Pe,_e)}const Wi=()=>{Na(),ne("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Sa(){Na(),ne("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let _s=!1;function Na(){function _e(){Na()}if(document.readyState==="loading"){_s||window.addEventListener("DOMContentLoaded",_e,!1),_s=!0;return}document.querySelectorAll(Pe.cssSelector).forEach(an)}function _l(_e,Ve){let ht=null;try{ht=Ve(Z)}catch(Nt){if(Ne("Language definition for '{}' could not be registered.".replace("{}",_e)),Ft)Ne(Nt);else throw Nt;ht=Ue}ht.name||(ht.name=_e),ge[_e]=ht,ht.rawDefinition=Ve.bind(null,Z),ht.aliases&&Xi(ht.aliases,{languageName:_e})}function $r(_e){delete ge[_e];for(const Ve of Object.keys(Me))Me[Ve]===_e&&delete Me[Ve]}function js(){return Object.keys(ge)}function Ln(_e){return _e=(_e||"").toLowerCase(),ge[_e]||ge[Me[_e]]}function Xi(_e,{languageName:Ve}){typeof _e=="string"&&(_e=[_e]),_e.forEach(ht=>{Me[ht.toLowerCase()]=Ve})}function Zi(_e){const Ve=Ln(_e);return Ve&&!Ve.disableAutodetect}function yr(_e){_e["before:highlightBlock"]&&!_e["before:highlightElement"]&&(_e["before:highlightElement"]=Ve=>{_e["before:highlightBlock"](Object.assign({block:Ve.el},Ve))}),_e["after:highlightBlock"]&&!_e["after:highlightElement"]&&(_e["after:highlightElement"]=Ve=>{_e["after:highlightBlock"](Object.assign({block:Ve.el},Ve))})}function fn(_e){yr(_e),it.push(_e)}function jl(_e){const Ve=it.indexOf(_e);Ve!==-1&&it.splice(Ve,1)}function Ur(_e,Ve){const ht=_e;it.forEach(function(Nt){Nt[ht]&&Nt[ht](Ve)})}function Ji(_e){return ne("10.7.0","highlightBlock will be removed entirely in v12.0"),ne("10.7.0","Please use highlightElement now."),an(_e)}Object.assign(Z,{highlight:Vt,highlightAuto:Ea,highlightAll:Na,highlightElement:an,highlightBlock:Ji,configure:Tn,initHighlighting:Wi,initHighlightingOnLoad:Sa,registerLanguage:_l,unregisterLanguage:$r,listLanguages:js,getLanguage:Ln,registerAliases:Xi,autoDetection:Zi,inherit:Nl,addPlugin:fn,removePlugin:jl}),Z.debugMode=function(){Ft=!1},Z.safeMode=function(){Ft=!0},Z.versionString=yt,Z.regex={concat:v,lookahead:y,either:E,optional:k,anyNumberOfTimes:b};for(const _e in Te)typeof Te[_e]=="object"&&e(Te[_e]);return Object.assign(Z,Te),Z},Un=Br({});return Un.newInstance=()=>Br({}),sy=Un,Un.HighlightJS=Un,Un.default=Un,sy}var m8=p8();const g8=qu(m8),DE={},y8="hljs-";function b8(e){const t=g8.newInstance();return e&&l(e),{highlight:n,highlightAuto:i,listLanguages:a,register:l,registerAlias:o,registered:d};function n(f,h,g){const m=g||DE,y=typeof m.prefix=="string"?m.prefix:y8;if(!t.getLanguage(f))throw new Error("Unknown language: `"+f+"` is not registered");t.configure({__emitter:x8,classPrefix:y});const b=t.highlight(h,{ignoreIllegals:!0,language:f});if(b.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:b.errorRaised});const k=b._emitter.root,v=k.data;return v.language=b.language,v.relevance=b.relevance,k}function i(f,h){const m=(h||DE).subset||a();let y=-1,b=0,k;for(;++y<m.length;){const v=m[y];if(!t.getLanguage(v))continue;const N=n(v,f,h);N.data&&N.data.relevance!==void 0&&N.data.relevance>b&&(b=N.data.relevance,k=N)}return k||{type:"root",children:[],data:{language:void 0,relevance:b}}}function a(){return t.listLanguages()}function l(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 o(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 x8{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 n=this.stack[this.stack.length-1],i=n.children[n.children.length-1];i&&i.type==="text"?i.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const i=this.stack[this.stack.length-1],a=t.root.children;n?i.children.push({type:"element",tagName:"span",properties:{className:[n]},children:a}):i.children.push(...a)}openNode(t){const n=this,i=t.split(".").map(function(o,d){return d?o+"_".repeat(d):n.options.classPrefix+o}),a=this.stack[this.stack.length-1],l={type:"element",tagName:"span",properties:{className:i},children:[]};a.children.push(l),this.stack.push(l)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const v8={};function Ix(e){const t=e||v8,n=t.aliases,i=t.detect||!1,a=t.languages||h8,l=t.plainText,o=t.prefix,d=t.subset;let f="hljs";const h=b8(a);if(n&&h.registerAlias(n),o){const g=o.indexOf("-");f=g===-1?o:o.slice(0,g)}return function(g,m){op(g,"element",function(y,b,k){if(y.tagName!=="code"||!k||k.type!=="element"||k.tagName!=="pre")return;const v=w8(y);if(v===!1||!v&&!i||v&&l&&l.includes(v))return;Array.isArray(y.properties.className)||(y.properties.className=[]),y.properties.className.includes(f)||y.properties.className.unshift(f);const N=$9(y,{whitespace:"pre"});let E;try{E=v?h.highlight(v,N,{prefix:o}):h.highlightAuto(N,{prefix:o,subset:d})}catch(C){const S=C;if(v&&/Unknown language/.test(S.message)){m.message("Cannot highlight as `"+v+"`, it’s not registered",{ancestors:[k,y],cause:S,place:y.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw S}!v&&E.data&&E.data.language&&y.properties.className.push("language-"+E.data.language),E.children.length>0&&(y.children=E.children)})}}function w8(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let i;for(;++n<t.length;){const a=String(t[n]);if(a==="no-highlight"||a==="nohighlight")return!1;!i&&a.slice(0,5)==="lang-"&&(i=a.slice(5)),!i&&a.slice(0,9)==="language-"&&(i=a.slice(9))}return i}function k8({name:e,onClose:t}){const n=Be(),{data:i,isLoading:a,isError:l,error:o}=Ye({queryKey:["skill",e],queryFn:()=>$z(e)});return j.useEffect(()=>{const d=f=>{f.key==="Escape"&&t()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[t]),c.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",children:c.jsxs("div",{className:"nb-card mt-8 w-full max-w-4xl",children:[c.jsxs("header",{className:"flex items-start justify-between gap-4 mb-4",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-3xl font-bold",children:e}),i&&c.jsxs("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:[i.category," · ",i.origin||"local"]})]}),c.jsx("button",{onClick:t,className:"nb-btn nb-btn-mint p-2","aria-label":n("skillDetail.close.aria"),type:"button",children:c.jsx(bn,{size:16,strokeWidth:3})})]}),a&&c.jsx("p",{children:n("skillDetail.loading")}),l&&c.jsx("p",{className:"text-[var(--color-crashed)]",children:n("skillDetail.error.load",{detail:o instanceof Error?o.message:String(o)})}),i&&c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:n("skillDetail.section.preview")}),c.jsx("div",{className:"scroll-frame max-h-80 rounded-lg border-2 border-[var(--color-text)] bg-surface-input",children:c.jsx("div",{className:"scroll-frame-body prose-chat max-h-80 p-4 text-sm",children:i.body?c.jsx(Ax,{remarkPlugins:[Ox],rehypePlugins:[Ix],children:i.body}):c.jsx("p",{className:"text-[var(--color-text-muted)] italic",children:"(empty)"})})})]}),i.references.length>0&&c.jsxs("div",{children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:"References"}),c.jsx("ul",{className:"flex flex-col gap-2",children:i.references.map(d=>c.jsx(E8,{skillName:e,file:d.name,lines:d.lines},d.name))})]})]})]})})}function E8({skillName:e,file:t,lines:n}){const i=Be(),[a,l]=j.useState(!1),{data:o,isLoading:d,isError:f,error:h}=Ye({queryKey:["skill-ref",e,t],queryFn:()=>Uz(e,t),enabled:a,staleTime:1/0});return c.jsxs("li",{className:"border-2 border-[var(--color-text)] rounded-lg overflow-hidden bg-[var(--color-bg-cream)]",children:[c.jsxs("button",{type:"button",onClick:()=>l(g=>!g),"aria-label":i("skillDetail.toggleSection.aria",{action:i(a?"skillDetail.collapse":"skillDetail.expand"),file:t}),"aria-expanded":a,className:"w-full flex items-center gap-2 px-3 py-2 text-sm font-[family-name:var(--font-mono)] hover:bg-[var(--color-accent-yellow)] transition-colors",children:[c.jsx(Zo,{size:12,strokeWidth:3,className:["transition-transform",a?"rotate-90":""].join(" ")}),c.jsx(Fh,{size:12,strokeWidth:2.5}),c.jsx("span",{className:"flex-1 text-left font-bold",children:t}),c.jsxs("span",{className:"text-xs text-[var(--color-text-subtle)]",children:[n," lines"]})]}),a&&c.jsxs("div",{className:"px-4 py-3 border-t-2 border-[var(--color-text)] bg-[var(--color-bg)] max-h-96 overflow-auto",children:[d&&c.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:i("skillDetail.loading")}),f&&c.jsx("p",{className:"text-xs text-[var(--color-crashed)]",children:i("skillDetail.error.load",{detail:h instanceof Error?h.message:String(h)})}),o&&c.jsx("div",{className:"prose-chat text-sm",children:c.jsx(Ax,{remarkPlugins:[Ox],rehypePlugins:[Ix],children:o.content})})]})]})}function S8({onClose:e}){const t=Be(),n=Gt(),{alert:i}=un(),[a,l]=j.useState(""),[o,d]=j.useState(""),f=/^[a-z0-9][a-z0-9-]*$/.test(a),h=Ct({mutationFn:()=>Vz(a,{"SKILL.md":o}),onSuccess:()=>{n.invalidateQueries({queryKey:["skills"]}),n.invalidateQueries({queryKey:["skill-updates"]}),e()},onError:g=>void i({title:t("skills.import.error"),body:g instanceof Error?g.message:String(g)})});return c.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/30 p-4",onClick:e,children:c.jsxs("div",{className:"nb-card mt-16 w-full max-w-xl flex flex-col gap-3",onClick:g=>g.stopPropagation(),children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold",children:t("skills.import.title")}),c.jsx("button",{type:"button",className:"nb-btn p-2",onClick:e,"aria-label":"close",children:c.jsx(bn,{size:14,strokeWidth:3})})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:t("skills.import.name")}),c.jsx("input",{className:"nb-input w-full",value:a,onChange:g=>l(g.target.value),placeholder:"code-review","aria-label":t("skills.import.name")})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:t("skills.import.body")}),c.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-sm",rows:12,value:o,onChange:g=>d(g.target.value),placeholder:`---
651
+ name: code-review
652
+ description: ...
653
+ ---
654
+
655
+ # ...`,"aria-label":t("skills.import.body")})]}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint self-start",disabled:h.isPending||!f||!o.trim(),onClick:()=>h.mutate(),children:[h.isPending?c.jsx(Xe,{size:14,className:"animate-spin"}):c.jsx(i_,{size:14,strokeWidth:3}),t("skills.import.submit")]})]})})}function N8({onClose:e,onSubmit:t}){const n=Be(),[i,a]=j.useState(""),[l,o]=j.useState(""),d=/^[a-z0-9][a-z0-9-]*$/.test(i);return c.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/30 p-4 overflow-auto",children:c.jsx("div",{className:"w-full max-w-xl my-8",children:c.jsxs("div",{className:"nb-card flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-center justify-between shrink-0",children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold flex items-center gap-2",children:[c.jsx(hl,{size:16,strokeWidth:2.5}),n("skills.ai.title")]}),c.jsx("button",{type:"button",className:"nb-btn p-2",onClick:e,"aria-label":"close",children:c.jsx(bn,{size:14,strokeWidth:3})})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:n("skills.ai.name")}),c.jsx("input",{type:"text",value:i,onChange:f=>a(f.target.value),placeholder:"rust-error-handling",className:"nb-input w-full font-[family-name:var(--font-mono)]","aria-label":n("skills.ai.name")})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:n("skills.ai.intent")}),c.jsx("textarea",{value:l,onChange:f=>o(f.target.value),placeholder:n("skills.ai.placeholder"),rows:5,className:"nb-input w-full text-sm","aria-label":n("skills.ai.intent")})]}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint self-start",disabled:!d||!l.trim(),onClick:()=>t(i,l),children:[c.jsx(hl,{size:14,strokeWidth:2.5}),n("skills.ai.submit")]})]})})})}async function _8(e){const{files:t}=await Yz(e),n=t["SKILL.md"]??"",i=new Blob([n],{type:"text/markdown"}),a=URL.createObjectURL(i),l=document.createElement("a");l.href=a,l.download=`${e}.SKILL.md`,l.click(),URL.revokeObjectURL(a)}const j8=[{value:"all",labelKey:"skills.category.all"},{value:"language",labelKey:"skills.category.language"},{value:"end",labelKey:"skills.category.end"},{value:"persona",labelKey:"skills.category.persona"},{value:"workflow",labelKey:"skills.category.workflow"},{value:"other",labelKey:"skills.category.other"}],C8={language:"var(--color-accent-purple)",end:"var(--color-secondary)",persona:"var(--color-primary)",workflow:"var(--color-accent-mint)",other:"var(--color-bg-cream)"};function A8(){var O,$;const e=Be(),[t,n]=j.useState("all"),[i,a]=j.useState(""),[l,o]=j.useState(null),[d,f]=j.useState(!1),[h,g]=j.useState(!1),m=Gt(),b=(((O=Ye({queryKey:["gen-jobs"],queryFn:k2,refetchInterval:3e3}).data)==null?void 0:O.data)??[]).filter(I=>I.kind==="skill"),k=b.filter(I=>I.status!=="done"),v=j.useRef(new Set);j.useEffect(()=>{for(const I of b)(I.status==="done"||I.status==="error")&&!v.current.has(I.id)&&(v.current.add(I.id),m.invalidateQueries({queryKey:["skills"]}),m.invalidateQueries({queryKey:["skill-updates"]}))},[b,m]);const N=(I,q)=>{Qz(I,q).then(()=>m.invalidateQueries({queryKey:["gen-jobs"]})).catch(()=>{})},C=((($=Ye({queryKey:["skill-updates"],queryFn:Gz}).data)==null?void 0:$.data)??[]).filter(I=>I.status!=="same").length,{data:S,isLoading:_}=Ye({queryKey:["skills"],queryFn:()=>ox()}),M=Ye({queryKey:["projects"],queryFn:Es}),T=j.useMemo(()=>((S==null?void 0:S.data)??[]).filter(q=>!(t!=="all"&&q.category!==t||i&&!q.name.toLowerCase().includes(i.toLowerCase()))),[S,t,i]),R=j.useMemo(()=>{const I=(S==null?void 0:S.data)??[],q={all:I.length};for(const F of I)q[F.category]=(q[F.category]??0)+1;return q},[S]);return c.jsxs("div",{className:"flex flex-col gap-4 max-w-full",children:[c.jsxs("header",{className:"flex items-center justify-between flex-wrap gap-3",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold",children:"Skills"}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:_?e("common.loading"):e("skills.subtitleCount",{count:(S==null?void 0:S.data.length)??0})})]}),c.jsxs("div",{className:"flex gap-3 items-center",children:[C>0&&c.jsx("span",{className:"nb-badge text-[10px]",title:e("skills.updates.badge",{count:String(C)}),children:e("skills.updates.badge",{count:String(C)})}),c.jsxs("button",{className:"nb-btn",onClick:()=>g(!0),type:"button",children:[c.jsx(hl,{size:14,strokeWidth:2.5}),e("skills.ai")]}),c.jsxs("button",{className:"nb-btn",onClick:()=>f(!0),type:"button",children:[c.jsx(i_,{size:14,strokeWidth:2.5}),e("skills.import")]}),c.jsxs("button",{className:"nb-btn nb-btn-mint",onClick:async()=>{await qz(),m.invalidateQueries({queryKey:["skills"]}),m.invalidateQueries({queryKey:["skill-updates"]})},type:"button",children:[c.jsx(ya,{size:14,strokeWidth:2.5}),"Sync bundled"]})]})]}),c.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[c.jsxs("div",{className:"relative flex-1 max-w-md",children:[c.jsx(fl,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-subtle)]"}),c.jsx("input",{className:"nb-input pl-9 w-full",placeholder:e("skills.search.placeholder"),value:i,onChange:I=>a(I.target.value),"aria-label":e("skills.search.aria")})]}),c.jsx("div",{className:"flex gap-1 bg-color-bg-soft p-1 bg-[var(--color-bg)] border-[2px] border-[var(--color-text)] rounded-full shadow-[2px_2px_0_var(--color-text)]",children:j8.map(I=>c.jsxs("button",{type:"button",onClick:()=>n(I.value),className:["px-3 py-1 rounded-full text-xs font-bold font-[family-name:var(--font-body)]",t===I.value?"bg-[var(--color-text)] text-[var(--color-bg)]":"text-[var(--color-text-muted)] hover:text-[var(--color-text)]"].join(" "),children:[e(I.labelKey)," ",R[I.value]]},I.value))})]}),c.jsxs("div",{className:"grid gap-4 grid-cols-[repeat(auto-fill,minmax(280px,1fr))]",children:[k.map(I=>c.jsxs("div",{className:`nb-card flex items-center gap-2 ${I.status==="error"?"bg-[var(--color-crashed-bg)]":"opacity-70"}`,children:[I.status==="running"?c.jsx(Xe,{size:14,className:"animate-spin"}):c.jsx(bn,{size:14,strokeWidth:3}),c.jsx("span",{className:"text-sm text-[var(--color-text-muted)] truncate",children:I.status==="running"?`${I.label} · ${e("skills.ai.wait")}`:`${I.label}: ${I.error??e("skills.ai.error")}`})]},I.id)),T.map(I=>{var q;return c.jsx(T8,{skill:I,projectCount:((q=M.data)==null?void 0:q.data.length)??0,onOpen:()=>o(I.name),onExport:()=>void _8(I.name)},I.name)})]}),l&&c.jsx(k8,{name:l,onClose:()=>o(null)}),d&&c.jsx(S8,{onClose:()=>f(!1)}),h&&c.jsx(N8,{onClose:()=>g(!1),onSubmit:(I,q)=>{N(I,q),g(!1)}})]})}function T8({skill:e,projectCount:t,onOpen:n,onExport:i}){const a=Be(),l=C8[e.category];return c.jsxs("article",{onClick:n,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),n())},tabIndex:0,role:"button","aria-label":`Open ${e.name}`,className:"nb-card nb-card-interactive flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:e.name}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("button",{type:"button",className:"nb-btn p-1",onClick:o=>{o.stopPropagation(),i()},"aria-label":a("skills.export"),title:a("skills.export"),children:c.jsx(Uh,{size:12,strokeWidth:2.5})}),c.jsx("span",{className:"nb-badge text-[10px]",style:{background:l},children:e.category})]})]}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] leading-5 line-clamp-3",children:e.description||"(no description)"}),c.jsxs("div",{className:"flex items-center justify-between text-xs font-[family-name:var(--font-mono)] pt-2 border-t-[1.5px] border-dashed border-[var(--color-border-light)]",children:[c.jsx("span",{className:"font-bold",children:e.linkedProjects.length>0?`● linked in ${e.linkedProjects.length}`:"○ not linked"}),c.jsxs("span",{className:"text-[var(--color-text-subtle)]",children:[t," projects"]})]})]})}function Yj(e){const t=e?`?q=${encodeURIComponent(e)}`:"";return ft(`/api/prompts${t}`)}function zx(e){return ft(`/api/prompts/${encodeURIComponent(e)}`)}function M8(e){return Lr("/api/prompts",e)}function D8(e,t){return Hb(`/api/prompts/${encodeURIComponent(e)}`,t)}function O8(e){return F3(`/api/prompts/${encodeURIComponent(e)}`)}function R8(e){return Lr("/api/prompts/generate",{intent:e})}function Qj(e){const t=new Set,n=[];for(const i of e.matchAll(/\{\{\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*\}\}/g)){const a=i[1];a&&!t.has(a)&&(t.add(a),n.push(a))}return n}function L8(){var T,R;const e=Be(),[t,n]=Gb("prompts.last",""),[i,a]=j.useState(null),[l,o]=j.useState(!1),[d,f]=j.useState(""),[h,g]=j.useState(new Set),m=Gt(),y=Ye({queryKey:["prompts"],queryFn:()=>Yj()}),b=((T=y.data)==null?void 0:T.data)??[],k=j.useMemo(()=>[...new Set(b.flatMap(O=>O.tags))].sort(),[b]),N=(((R=Ye({queryKey:["gen-jobs"],queryFn:k2,refetchInterval:3e3}).data)==null?void 0:R.data)??[]).filter(O=>O.kind==="prompt"),E=N.filter(O=>O.status!=="done"),C=j.useRef(new Set);j.useEffect(()=>{for(const O of N)(O.status==="done"||O.status==="error")&&!C.current.has(O.id)&&(C.current.add(O.id),m.invalidateQueries({queryKey:["prompts"]}),O.status==="done"&&O.result&&n(O.result))},[N,m,n]);const S=O=>{R8(O).then(()=>m.invalidateQueries({queryKey:["gen-jobs"]})).catch(()=>{})},_=j.useMemo(()=>{const O=d.trim().toLowerCase();return b.filter($=>!(h.size&&![...h].every(I=>$.tags.includes(I))||O&&!($.name.toLowerCase().includes(O)||$.description.toLowerCase().includes(O)||$.tags.some(q=>q.toLowerCase().includes(O)))))},[b,h,d]);j.useEffect(()=>{t&&b.length&&!b.some(O=>O.name===t)&&n("")},[t,b,n]);const M=O=>g($=>{const I=new Set($);return I.has(O)?I.delete(O):I.add(O),I});return c.jsxs("div",{className:"flex flex-col flex-1 min-h-0 w-full gap-3",children:[c.jsxs("div",{className:"shrink-0 flex items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-3xl font-bold",children:e("prompts.title")}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:e("prompts.desc")})]}),c.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[c.jsxs("button",{className:"nb-btn",type:"button",onClick:()=>o(!0),children:[c.jsx(hl,{size:14,strokeWidth:2.5}),e("prompts.ai")]}),c.jsxs("button",{className:"nb-btn nb-btn-mint",type:"button",onClick:()=>a({mode:"new"}),children:[c.jsx(pi,{size:14,strokeWidth:3}),e("prompts.new")]})]})]}),c.jsxs("div",{className:"shrink-0 flex flex-col gap-2",children:[c.jsxs("label",{className:"nb-input flex items-center gap-2 w-full",style:{padding:"6px 10px"},children:[c.jsx(fl,{size:14}),c.jsx("input",{type:"text",value:d,onChange:O=>f(O.target.value),placeholder:e("prompts.search"),className:"bg-transparent outline-none flex-1 text-sm","aria-label":e("prompts.search")})]}),k.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1.5",children:k.map(O=>c.jsx("button",{type:"button",onClick:()=>M(O),className:`text-xs border-2 border-[var(--color-text)] rounded-full px-2 py-0.5 ${h.has(O)?"bg-[var(--color-accent-mint)] font-bold":""}`,children:O},O))})]}),c.jsxs("div",{className:"flex gap-5 flex-1 min-h-0",children:[c.jsxs("aside",{className:"w-80 shrink-0 min-h-0 overflow-y-auto flex flex-col gap-2 pr-1",children:[E.map(O=>c.jsxs("div",{className:`nb-card flex items-center gap-2 ${O.status==="error"?"bg-[var(--color-crashed-bg)]":"opacity-70"}`,style:{padding:"8px 10px"},children:[O.status==="running"?c.jsx(Xe,{size:12,className:"animate-spin"}):c.jsx(bn,{size:12,strokeWidth:3}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)] truncate",children:O.status==="running"?e("prompts.ai.wait"):`${e("prompts.ai.error")}: ${O.error??""}`})]},O.id)),y.isLoading?c.jsx("div",{className:"nb-card",children:c.jsx(Xe,{size:14,className:"animate-spin"})}):_.length===0?c.jsx("div",{className:"nb-card",children:c.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:e("prompts.empty")})}):_.map(O=>c.jsxs("button",{type:"button",onClick:()=>n(O.name),className:`nb-card w-full text-left ${t===O.name?"bg-[var(--color-accent-mint)]":""}`,style:{padding:"8px 10px"},children:[c.jsxs("span",{className:"flex items-center gap-1.5",children:[O.favorite&&c.jsx(t_,{size:12,fill:"currentColor"}),c.jsx("code",{className:"font-[family-name:var(--font-mono)] text-sm font-bold truncate",children:O.name})]}),O.description&&c.jsx("span",{className:"block text-xs text-[var(--color-text-muted)] truncate",children:O.description})]},O.name))]}),c.jsx("div",{className:"flex-1 min-w-0 min-h-0",children:t?c.jsx(z8,{name:t,onEdit:()=>a({mode:"edit",name:t}),onDeleted:()=>n("")},t):c.jsx("div",{className:"nb-card",children:c.jsx("p",{className:"text-[var(--color-text-muted)]",children:e("prompts.selectHint")})})})]}),i&&c.jsx(B8,{name:i.mode==="edit"?i.name:null,onClose:()=>a(null),onSaved:O=>{a(null),n(O)}}),l&&c.jsx(I8,{onClose:()=>o(!1),onSubmit:O=>{S(O),o(!1)}})]})}function I8({onClose:e,onSubmit:t}){const n=Be(),[i,a]=j.useState("");return c.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/30 p-4 overflow-auto",children:c.jsx("div",{className:"w-full max-w-xl my-8",children:c.jsxs("div",{className:"nb-card flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-center justify-between shrink-0",children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold flex items-center gap-2",children:[c.jsx(hl,{size:16,strokeWidth:2.5}),n("prompts.ai.title")]}),c.jsx("button",{type:"button",className:"nb-btn p-2",onClick:e,"aria-label":"close",children:c.jsx(bn,{size:14,strokeWidth:3})})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:n("prompts.ai.intent")}),c.jsx("textarea",{value:i,onChange:l=>a(l.target.value),placeholder:n("prompts.ai.placeholder"),rows:5,className:"nb-input w-full text-sm","aria-label":n("prompts.ai.intent")})]}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint self-start",disabled:!i.trim(),onClick:()=>t(i),children:[c.jsx(hl,{size:14,strokeWidth:2.5}),n("prompts.ai.submit")]})]})})})}function z8({name:e,onEdit:t,onDeleted:n}){const i=Be(),a=Gt(),{confirm:l}=un(),o=Ye({queryKey:["prompt",e],queryFn:()=>zx(e)}),d=Ct({mutationFn:()=>O8(e),onSuccess:()=>{a.invalidateQueries({queryKey:["prompts"]}),n()}});if(o.isLoading)return c.jsx("div",{className:"nb-card",children:c.jsx(Xe,{size:14,className:"animate-spin"})});const f=o.data;if(!f)return null;const h=Qj(f.body);return c.jsxs("div",{className:"nb-card flex flex-col gap-3 h-full min-h-0",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3 shrink-0",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold flex items-center gap-2",children:[f.favorite&&c.jsx(t_,{size:16,fill:"currentColor"}),c.jsx("code",{className:"font-[family-name:var(--font-mono)] truncate",children:f.name})]}),f.description&&c.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:f.description})]}),c.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",onClick:t,children:[c.jsx(qh,{size:14,strokeWidth:3}),i("common.edit")]}),c.jsx("button",{type:"button",className:"nb-btn",disabled:d.isPending,onClick:async()=>{await l({title:i("prompts.delete"),body:i("prompts.deleteConfirm",{name:e})})&&d.mutate()},"aria-label":i("prompts.delete"),children:c.jsx(fr,{size:14,strokeWidth:3})})]})]}),f.tags.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1.5 shrink-0",children:f.tags.map(g=>c.jsx("span",{className:"text-xs border-2 border-[var(--color-text)] rounded-full px-2 py-0.5",children:g},g))}),c.jsx("pre",{className:"flex-1 bg-surface-input min-h-0 overflow-auto text-sm font-[family-name:var(--font-mono)] whitespace-pre-wrap break-words bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded p-3",children:f.body}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)] shrink-0",children:h.length?i("prompts.vars",{names:h.join(", ")}):i("prompts.noVars")})]})}function P8({tags:e,onChange:t}){const n=Be(),[i,a]=j.useState(""),l=()=>{const o=i.trim();o&&!e.includes(o)&&t([...e,o]),a("")};return c.jsxs("div",{className:"nb-input w-full flex flex-wrap gap-1.5 items-center",children:[e.map(o=>c.jsxs("span",{className:"inline-flex items-center gap-1 text-xs bg-[var(--color-accent-mint)] border-2 border-[var(--color-text)] rounded px-1.5 py-0.5",children:[o,c.jsx("button",{type:"button",onClick:()=>t(e.filter(d=>d!==o)),"aria-label":`remove ${o}`,children:c.jsx(bn,{size:10,strokeWidth:3})})]},o)),c.jsx("input",{className:"flex-1 min-w-[90px] bg-transparent outline-none text-sm",value:i,onChange:o=>a(o.target.value),onKeyDown:o=>{o.key==="Enter"?(o.preventDefault(),l()):o.key==="Backspace"&&!i&&e.length&&t(e.slice(0,-1))},placeholder:e.length?"":n("prompts.tagAdd"),"aria-label":n("prompts.tags")})]})}function B8({name:e,onClose:t,onSaved:n}){const i=Be(),a=Gt(),{alert:l}=un(),o=e===null,d=Ye({queryKey:["prompt",e],queryFn:()=>zx(e),enabled:!o}),[f,h]=j.useState(o?{name:"",description:"",tags:[],body:"",favorite:!1}:null);j.useEffect(()=>{if(!o&&d.data&&f===null){const b=d.data;h({name:b.name,description:b.description,tags:b.tags,body:b.body,favorite:b.favorite})}},[o,d.data,f]);const g=Ct({mutationFn:()=>{if(!f)throw new Error("no form");const b={description:f.description||void 0,tags:f.tags,favorite:f.favorite,body:f.body};return o?M8({name:f.name,...b}):D8(e,b)},onSuccess:b=>{a.invalidateQueries({queryKey:["prompts"]}),a.invalidateQueries({queryKey:["prompt",b.name]}),n(b.name)},onError:b=>void l({title:i("prompts.saveError"),body:b instanceof Error?b.message:String(b)})}),m=j.useMemo(()=>f?/^[a-z0-9][a-z0-9-]*$/.test(f.name):!1,[f]),y=j.useMemo(()=>f?Qj(f.body):[],[f]);return c.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/30 p-4 overflow-auto",children:c.jsx("div",{className:"w-full max-w-2xl my-8",children:c.jsxs("div",{className:"nb-card flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-center justify-between shrink-0",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold",children:o?i("prompts.new"):e}),c.jsx("button",{type:"button",className:"nb-btn p-2",onClick:t,"aria-label":"close",children:c.jsx(bn,{size:14,strokeWidth:3})})]}),!o&&d.isLoading?c.jsx(Xe,{size:14,className:"animate-spin"}):f?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:i("prompts.name")}),c.jsx("input",{type:"text",value:f.name,disabled:!o,onChange:b=>h({...f,name:b.target.value}),placeholder:i("prompts.namePlaceholder"),className:"nb-input w-full","aria-label":i("prompts.name")}),o&&f.name&&!m&&c.jsx("span",{className:"text-xs text-[var(--color-crashed)]",children:i("prompts.nameError")})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:i("prompts.description")}),c.jsx("input",{type:"text",value:f.description,onChange:b=>h({...f,description:b.target.value}),className:"nb-input w-full","aria-label":i("prompts.description")})]})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:i("prompts.tags")}),c.jsx(P8,{tags:f.tags,onChange:b=>h({...f,tags:b})})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:i("prompts.body")}),c.jsx("textarea",{value:f.body,onChange:b=>h({...f,body:b.target.value}),placeholder:i("prompts.bodyPlaceholder"),rows:12,className:"nb-input w-full font-[family-name:var(--font-mono)] text-sm","aria-label":i("prompts.body")}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:y.length?i("prompts.vars",{names:y.join(", ")}):i("prompts.noVars")})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",disabled:g.isPending||o&&!m||!f.body.trim(),onClick:()=>g.mutate(),children:[g.isPending?c.jsx(Xe,{size:14,className:"animate-spin"}):c.jsx(Rr,{size:14,strokeWidth:3}),i("prompts.save")]}),c.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:f.favorite,onChange:b=>h({...f,favorite:b.target.checked})}),i("prompts.favorite")]})]})]}):null]})})})}function $8(){var l;const e=Be(),t=Ye({queryKey:["system-info"],queryFn:f_}),n=Ye({queryKey:["system-env"],queryFn:q3}),[i,a]=j.useState(!1);return c.jsxs("div",{className:"flex flex-col gap-6 w-full",children:[c.jsx("header",{children:c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold",children:e("system.h1")})}),c.jsx(U8,{current:(l=t.data)==null?void 0:l.version}),c.jsxs("section",{className:"nb-card",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-3",children:e("system.runtime")}),t.data?c.jsxs("dl",{className:"grid grid-cols-1 sm:grid-cols-[160px_1fr] gap-y-2 text-sm",children:[c.jsx("dt",{className:"font-bold",children:"Node"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.data.nodeVersion}),c.jsx("dt",{className:"font-bold",children:"Platform"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.data.platform}),c.jsx("dt",{className:"font-bold",children:"PID"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.data.pid??"—"}),c.jsx("dt",{className:"font-bold",children:"Uptime"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:K8(t.data.uptimeMs)})]}):c.jsx("p",{className:"text-[var(--color-text-muted)]",children:e("common.loading")})]}),c.jsxs("section",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold",children:[e("system.env.title.prefix"),c.jsx("code",{className:"text-sm font-[family-name:var(--font-mono)] font-normal bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] px-2 py-0.5 rounded",children:"~/.coral/env"})]}),i?c.jsx("span",{className:"text-xs text-[var(--color-stuck)] font-bold",children:e("system.env.editing.label")}):c.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>a(!0),type:"button","aria-label":e("system.env.edit.aria"),children:[c.jsx(qh,{size:12,strokeWidth:2.5})," ",e("system.env.edit.button")]})]}),i?c.jsx(F8,{onClose:()=>{a(!1),n.refetch()}}):n.data&&n.data.exists?c.jsx("dl",{className:"grid grid-cols-1 sm:grid-cols-[220px_1fr] gap-y-1 text-sm font-[family-name:var(--font-mono)]",children:n.data.entries.map(o=>c.jsxs("div",{className:"contents",children:[c.jsxs("dt",{className:"font-bold flex items-center gap-2",children:[o.masked&&c.jsx("span",{className:"text-[var(--color-stuck)]",children:"🔒"}),o.key]}),c.jsx("dd",{className:"text-[var(--color-text-muted)] truncate",children:o.value})]},o.key))}):c.jsxs("p",{className:"text-[var(--color-text-muted)] text-sm",children:[e("system.env.empty.before"),c.jsx("code",{className:"bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] px-2 py-0.5 rounded font-[family-name:var(--font-mono)]",children:"sps setup"}),e("system.env.empty.after")]})]}),c.jsx(q8,{})]})}function U8({current:e}){var v;const t=Be(),{confirm:n,alert:i}=un(),[a,l]=j.useState(!1),[o,d]=j.useState(null),f=Ye({queryKey:["latest-version"],queryFn:Q3,enabled:!1}),[h,g]=j.useState(null),[m,y]=j.useState("npm i -g @coralai/sps-cli@latest"),b=async()=>{var E;if(await n({title:t("system.upgrade.confirm.title"),body:t("system.upgrade.confirm.body",{current:e??"?",latest:((E=f.data)==null?void 0:E.latest)??"?"}),confirm:t("system.upgrade.confirm.button")})){l(!0),d(null),g(null);try{const C=await W3();if(d(C.output),g(C.installedVersion),y(C.command),C.ok)i({title:t("system.upgrade.success.title"),body:t("system.upgrade.success.body",{version:C.installedVersion??"?"})});else{const S=C.installedVersion&&C.installedVersion===e?t("system.upgrade.notEffective.same",{version:C.installedVersion}):t("system.upgrade.notEffective.notInstalled");i({title:t("system.upgrade.notEffective.title"),body:S})}}catch(C){d(C.message),i({title:t("system.upgrade.error.title"),body:C.message})}finally{l(!1)}}},k=async()=>{const N=f.data&&!f.data.upToDate?`npm i -g @coralai/sps-cli@${f.data.latest}`:m;try{await navigator.clipboard.writeText(N),i({title:t("system.upgrade.copy.success.title"),body:t("system.upgrade.copy.success.body",{cmd:N})})}catch{i({title:t("system.upgrade.copy.fail.title"),body:t("system.upgrade.copy.fail.body",{cmd:N})})}};return c.jsxs("section",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold",children:t("system.upgrade.title")}),c.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>f.refetch(),disabled:f.isFetching||!e,type:"button","aria-label":t("system.upgrade.checkLatest.aria"),children:[f.isFetching?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(ya,{size:12,strokeWidth:2.5}),t("system.upgrade.checkUpdate")]})]}),c.jsxs("dl",{className:"grid grid-cols-1 sm:grid-cols-[160px_1fr] gap-y-2 text-sm",children:[c.jsx("dt",{className:"font-bold",children:t("system.upgrade.label.current")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:e??"—"}),f.data&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{className:"font-bold",children:t("system.upgrade.label.latest")}),c.jsxs("dd",{className:"font-[family-name:var(--font-mono)] flex items-center gap-2 flex-wrap",children:[f.data.latest,f.data.upToDate?c.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:t("system.upgrade.latestPill")}):c.jsxs(c.Fragment,{children:[c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"3px 10px",fontSize:11},onClick:b,disabled:a,type:"button","aria-label":t("system.upgrade.button.upgradeAria"),children:[a?c.jsx(Xe,{size:11,strokeWidth:3,className:"animate-spin"}):c.jsx(Uh,{size:11,strokeWidth:2.5}),t("system.upgrade.button.upgrade")]}),c.jsxs("button",{className:"nb-btn",style:{padding:"3px 10px",fontSize:11},onClick:k,type:"button","aria-label":t("system.upgrade.button.copyAria"),title:t("system.upgrade.button.copyTitle"),children:[c.jsx(QR,{size:11,strokeWidth:2.5})," ",t("system.upgrade.button.copy")]})]})]})]}),h&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{className:"font-bold",children:t("system.upgrade.label.installed")}),c.jsxs("dd",{className:"font-[family-name:var(--font-mono)] flex items-center gap-2",children:[h,h===((v=f.data)==null?void 0:v.latest)?c.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:t("system.upgrade.installed.ok")}):h===e?c.jsx("span",{className:"nb-status",style:{background:"var(--color-stuck-bg)",color:"var(--color-stuck)"},children:t("system.upgrade.installed.fail")}):null]})]}),f.isError&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{className:"font-bold",children:t("system.upgrade.label.check")}),c.jsx("dd",{className:"text-[var(--color-crashed)] text-xs",children:f.error instanceof Error?f.error.message:String(f.error)})]})]}),o&&c.jsx("pre",{className:"mt-3 text-xs font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-3 max-h-40 overflow-auto whitespace-pre-wrap",children:o})]})}function F8({onClose:e}){const t=Be(),n=Gt(),{alert:i}=un(),a=Ye({queryKey:["system-env-raw"],queryFn:H3}),[l,o]=j.useState(null),[d,f]=j.useState(null);j.useEffect(()=>{a.data&&l===null&&(o(a.data.content),f(a.data.etag))},[a.data,l]);const h=l!==null&&a.data&&l!==a.data.content,g=Ct({mutationFn:()=>{if(l===null)throw new Error("no draft");return K3(l,d??"")},onSuccess:()=>{n.invalidateQueries({queryKey:["system-env"]}),n.invalidateQueries({queryKey:["system-env-raw"]}),e()},onError:m=>{const y=m.status;i({title:t(y===409?"system.env.error.conflict.title":"system.env.error.save.title"),body:y===409?t("system.env.error.conflict.body"):m instanceof Error?m.message:String(m)})}});return a.isLoading?c.jsx("p",{className:"text-[var(--color-text-muted)]",children:t("common.loading")}):c.jsxs("div",{children:[c.jsx("p",{className:"text-xs text-[var(--color-stuck)] font-bold mb-2",children:t("system.env.warning")}),c.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",style:{minHeight:320,resize:"vertical"},value:l??"",onChange:m=>o(m.target.value),spellCheck:!1,"aria-label":t("system.env.aria")}),c.jsxs("div",{className:"flex items-center justify-between mt-3",children:[c.jsxs("span",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)]",children:[d?`etag: ${d}`:"",h?t("system.env.dirtyMark"):""]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px"},onClick:e,disabled:g.isPending,type:"button",children:[c.jsx(bn,{size:12,strokeWidth:3})," ",t("system.env.cancel")]}),c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 12px"},onClick:()=>g.mutate(),disabled:!h||g.isPending,type:"button","aria-label":t("system.env.save.aria"),children:[g.isPending?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(Rr,{size:12,strokeWidth:3}),t("system.env.save")]})]})]})]})}function q8(){var y;const e=Be(),{alert:t}=un(),n=Ye({queryKey:["projects"],queryFn:Es}),[i,a]=j.useState({}),[l,o]=j.useState({}),[d,f]=j.useState({}),h=(((y=n.data)==null?void 0:y.data)??[]).map(b=>({project:b.name})),g=async(b,k)=>{o(v=>({...v,[b]:k?"fix":"check"}));try{const v=await X3(b,k);a(N=>({...N,[b]:v})),f(N=>({...N,[b]:!0}))}catch(v){t({title:e(k?"system.diagnostics.error.fix":"system.diagnostics.error.check"),body:v instanceof Error?v.message:String(v)})}finally{o(v=>({...v,[b]:null}))}},m=async()=>{for(const b of h)await g(b.project,!1)};return c.jsxs("section",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold",children:e("system.diagnostics.title")}),c.jsxs("button",{className:"nb-btn nb-btn-mint",style:{padding:"6px 12px",fontSize:12},onClick:()=>{m()},disabled:h.length===0||Object.values(l).some(Boolean),type:"button",children:[c.jsx(ya,{size:12,strokeWidth:2.5}),e("system.diagnostics.checkAll")]})]}),h.length===0?c.jsx("p",{className:"text-[var(--color-text-muted)] text-sm",children:e("system.diagnostics.empty")}):c.jsx("ul",{className:"flex flex-col gap-2",children:h.map(b=>{const k=i[b.project],v=l[b.project],N=k?k.checks.filter(_=>_.status==="fail").length:0,E=k?k.checks.filter(_=>_.status==="warn").length:0,C=d[b.project]??!1,S=k!=null;return c.jsxs("li",{className:"bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg",children:[c.jsxs("div",{className:"flex items-center gap-3 px-3 py-2",children:[c.jsxs("button",{type:"button",onClick:()=>f(_=>({..._,[b.project]:!C})),disabled:!S,className:"flex items-center gap-2 flex-1 text-left min-w-0","aria-label":e(C?"system.diagnostics.collapseAria":"system.diagnostics.expandAria"),children:[S&&k.ok?c.jsx(fh,{size:16,className:"text-[var(--color-running)] shrink-0",strokeWidth:2.5}):S?c.jsx(ku,{size:16,className:"text-[var(--color-stuck)] shrink-0",strokeWidth:2.5}):c.jsx(fh,{size:16,className:"text-[var(--color-text-subtle)] shrink-0",strokeWidth:2.5}),S&&(C?c.jsx(Vu,{size:12}):c.jsx(Zo,{size:12})),c.jsx("span",{className:"font-bold font-[family-name:var(--font-mono)]",children:b.project}),S?k.ok?c.jsx("span",{className:"text-xs text-[var(--color-running)] font-semibold",children:"OK"}):c.jsxs("span",{className:"text-xs text-[var(--color-stuck)] font-semibold",children:[N," fail · ",E," warn"]}):c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:e("system.diagnostics.never")})]}),c.jsxs("button",{className:"nb-btn",style:{padding:"4px 10px",fontSize:11},onClick:()=>{g(b.project,!1)},disabled:!!v,type:"button","aria-label":e("system.diagnostics.checkAria"),children:[v==="check"?c.jsx(Xe,{size:11,strokeWidth:3,className:"animate-spin"}):c.jsx(ya,{size:11,strokeWidth:2.5}),e("system.diagnostics.check")]}),c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"4px 10px",fontSize:11},onClick:()=>{g(b.project,!0)},disabled:!!v||S&&k.ok,type:"button","aria-label":e("system.diagnostics.fixAria"),title:S&&k.ok?e("system.diagnostics.noFixesNeeded"):e("system.diagnostics.fix.tip"),children:[v==="fix"?c.jsx(Xe,{size:11,strokeWidth:3,className:"animate-spin"}):c.jsx(a_,{size:11,strokeWidth:2.5}),e("system.diagnostics.fix")]})]}),C&&S&&c.jsxs("div",{className:"border-t-2 border-dashed border-[var(--color-text)] px-3 py-2",children:[c.jsx("ul",{className:"flex flex-col gap-1 text-xs font-[family-name:var(--font-mono)]",children:k.checks.map((_,M)=>c.jsx(H8,{check:_},`${_.name}-${M}`))}),k.fixes.length>0&&c.jsxs("div",{className:"mt-3 bg-[var(--color-running-bg)] border-2 border-[var(--color-running)] rounded p-2",children:[c.jsx("div",{className:"text-xs font-bold text-[var(--color-running)] mb-1",children:e("system.diagnostics.fixed")}),c.jsx("ul",{className:"text-xs list-disc pl-4",children:k.fixes.map((_,M)=>c.jsx("li",{children:_},M))})]})]})]},b.project)})})]})}function H8({check:e}){const t=e.status==="pass"?c.jsx(fh,{size:12,className:"text-[var(--color-running)]",strokeWidth:2.5}):e.status==="fail"?c.jsx(ku,{size:12,className:"text-[var(--color-crashed)]",strokeWidth:2.5}):e.status==="warn"?c.jsx(ku,{size:12,className:"text-[var(--color-stuck)]",strokeWidth:2.5}):c.jsx("span",{className:"w-3 h-3 rounded-full bg-[var(--color-text-subtle)] inline-block"});return c.jsxs("li",{className:"flex items-start gap-2",children:[c.jsx("span",{className:"pt-0.5 shrink-0",children:t}),c.jsx("span",{className:"font-bold w-32 shrink-0",children:e.name}),c.jsx("span",{className:"text-[var(--color-text-muted)] break-words",children:e.message})]})}function K8(e){const t=Math.floor(e/1e3),n=Math.floor(t/3600),i=Math.floor(t%3600/60),a=t%60;return n>0?`${n}h ${i}m ${a}s`:i>0?`${i}m ${a}s`:`${a}s`}function G8(){return ft("/api/chat/sessions")}function V8(e){return ft(`/api/chat/sessions/${e}`)}async function ly(e={}){const t=await fetch("/api/chat/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(`${t.status}: ${await t.text()}`);return await t.json()}async function Y8(e){const t=await fetch(`/api/chat/sessions/${e}`,{method:"DELETE"});if(!t.ok)throw new Error(`${t.status}`)}async function Q8(e,t,n){const i=await fetch(`/api/chat/sessions/${e}/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t,attachments:n})});if(!i.ok)throw new Error(`${i.status}: ${await i.text()}`);return await i.json()}async function W8(e){const t=await fetch(`/api/chat/sessions/${e}/interrupt`,{method:"POST"});if(!t.ok&&t.status!==204)throw new Error(`${t.status}: ${await t.text()}`)}function X8(e,t){const n=t?`?since=${encodeURIComponent(t)}`:"";return ft(`/api/chat/sessions/${e}/messages${n}`)}function Z8({onInsert:e,disabled:t,className:n="nb-btn"}){var m;const i=Be(),[a,l]=j.useState(!1),[o,d]=j.useState(""),h=((m=Ye({queryKey:["prompts",o],queryFn:()=>Yj(o||void 0),enabled:a}).data)==null?void 0:m.data)??[],g=async y=>{try{const b=await zx(y);e(b.body)}finally{l(!1),d("")}};return c.jsxs("div",{className:"relative flex-shrink-0",children:[c.jsx("button",{type:"button",className:n,onClick:()=>l(y=>!y),disabled:t,"aria-label":i("prompts.insert"),title:i("prompts.insert"),children:c.jsx(XN,{size:15,strokeWidth:2.5})}),a&&c.jsxs("div",{className:"absolute bottom-full mb-2 left-0 z-20 w-72 nb-card overflow-hidden flex flex-col gap-2",children:[c.jsxs("label",{className:"flex items-center gap-2 border-2 border-[var(--color-text)] rounded px-2 py-1",children:[c.jsx(fl,{size:12}),c.jsx("input",{autoFocus:!0,value:o,onChange:y=>d(y.target.value),placeholder:i("prompts.search"),className:"bg-transparent outline-none flex-1 text-sm","aria-label":i("prompts.search")})]}),c.jsx("div",{className:"max-h-64 overflow-auto flex flex-col gap-1",children:h.length===0?c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] px-1 py-2",children:i("prompts.empty")}):h.map(y=>c.jsxs("button",{type:"button",onClick:()=>void g(y.name),className:"text-left px-2 py-1 rounded hover:bg-[var(--color-bg-cream)]",children:[c.jsx("code",{className:"font-[family-name:var(--font-mono)] text-sm font-bold",children:y.name}),y.description&&c.jsx("span",{className:"block text-xs text-[var(--color-text-muted)] truncate",children:y.description})]},y.name))})]})]})}function OE(){var Te,Re,De,ce,Ce,te,pe,Fe,ze;const e=Be(),{sessionId:t}=Db(),n=ks(),i=Gt(),{confirm:a,alert:l}=un(),o=Ye({queryKey:["chat-sessions"],queryFn:G8,refetchInterval:5e3}),d=Ye({queryKey:["chat-session",t],queryFn:()=>V8(t??""),enabled:!!t,refetchInterval:4e3}),[f,h]=j.useState(null),g=ae=>`chat-draft:${ae??""}`,[m,y]=j.useState(()=>localStorage.getItem(g(t))??""),b=j.useCallback(ae=>{y(be=>{const ye=typeof ae=="function"?ae(be):ae;try{t&&localStorage.setItem(g(t),ye)}catch{}return ye})},[t]);j.useEffect(()=>{y(localStorage.getItem(g(t))??"")},[t]);const[k,v]=j.useState(!1),N=j.useRef(null),E=j.useRef(!0),[C,S]=j.useState(!1),_=()=>{const ae=N.current;return!ae||ae.scrollHeight-ae.scrollTop-ae.clientHeight<40},M=j.useCallback(()=>{const ae=N.current;ae&&(ae.scrollTop=ae.scrollHeight),E.current=!0,S(!1)},[]),T=j.useCallback(()=>{const ae=_();E.current=ae,S(!ae)},[]),R=j.useRef(null);j.useEffect(()=>{const ae=R.current;ae&&(ae.style.height="auto",ae.style.height=`${Math.min(ae.scrollHeight,200)}px`,ae.scrollTop=ae.scrollHeight)},[m]);const O="w-8 h-8 flex items-center justify-center rounded-full bg-[rgba(255,255,255,0.08)] text-[var(--color-text-muted)] hover:bg-[rgba(255,255,255,0.14)] hover:text-[var(--color-text)] transition-colors disabled:opacity-50",[$,I]=j.useState(!1),[q,F]=j.useState([]),[Y,D]=j.useState(!1),[K,P]=j.useState(!1),[H,Q]=j.useState(!1),[G,L]=j.useState(null),[z,V]=j.useState(!1);j.useEffect(()=>{if(!t)return;const ae=new EventSource(`/stream/chat/${encodeURIComponent(t)}`);let be=!0;return ae.addEventListener("open",()=>{if(be){be=!1;return}const ye=i.getQueryData(["chat-session",t]),he=ye!=null&&ye.messages.length?ye.messages[ye.messages.length-1].ts:void 0;X8(t,he).then(Ee=>{Ee.data.length!==0&&i.setQueryData(["chat-session",t],Ne=>{if(!Ne)return Ne;const Ke=new Set(Ne.messages.map(de=>de.id)),ne=Ee.data.filter(de=>!Ke.has(de.id));return ne.length===0?Ne:{...Ne,messages:[...Ne.messages,...ne],lastMessageAt:ne[ne.length-1].ts,messageCount:Ne.messageCount+ne.length}})}).catch(()=>{})}),ae.addEventListener("chat.message",ye=>{try{const he=JSON.parse(ye.data);i.setQueryData(["chat-session",t],Ee=>{if(!Ee||Ee.messages.some(ne=>ne.id===he.message.id))return Ee;const Ke=Ee.messages.findIndex(ne=>ne.role==="user"&&ne.id.startsWith("optim-")&&ne.content===he.message.content);if(Ke>=0){const ne=[...Ee.messages];return ne[Ke]=he.message,{...Ee,messages:ne}}return{...Ee,messages:[...Ee.messages,he.message]}})}catch{}}),ae.addEventListener("chat.message.pending",ye=>{try{const he=JSON.parse(ye.data);h({sessionId:t,id:he.assistantId,blocks:[],done:!1,finalMessage:null})}catch{}}),ae.addEventListener("chat.message.snapshot",ye=>{try{const he=JSON.parse(ye.data);h({sessionId:t,id:he.assistantId,blocks:he.blocks.map(Ee=>Ee.type==="text"?{type:"text",target:Ee.text,displayed:Ee.text}:{type:"tool_use",id:Ee.id,title:Ee.title,kind:Ee.kind,status:Ee.status,input:Ee.input,locations:Ee.locations}),done:!1,finalMessage:null})}catch{}}),ae.addEventListener("chat.message.chunk.text",ye=>{try{const he=JSON.parse(ye.data);h(Ee=>{if(!Ee||Ee.id!==he.assistantId)return Ee;const Ne=[...Ee.blocks],Ke=Ne[Ne.length-1];return Ke&&Ke.type==="text"?Ne[Ne.length-1]={...Ke,target:Ke.target+he.text}:Ne.push({type:"text",target:he.text,displayed:""}),{...Ee,blocks:Ne}})}catch{}}),ae.addEventListener("chat.message.chunk.tool_use",ye=>{try{const he=JSON.parse(ye.data);h(Ee=>!Ee||Ee.id!==he.assistantId?Ee:{...Ee,blocks:[...Ee.blocks,{type:"tool_use",id:he.id,title:he.title,kind:he.kind,status:he.status,input:he.input,locations:he.locations}]})}catch{}}),ae.addEventListener("chat.message.chunk.tool_update",ye=>{try{const he=JSON.parse(ye.data);h(Ee=>!Ee||Ee.id!==he.assistantId?Ee:{...Ee,blocks:Ee.blocks.map(Ne=>Ne.type==="tool_use"&&Ne.id===he.id?{...Ne,status:he.status,input:Ne.input??he.input,locations:Ne.locations??he.locations}:Ne)})}catch{}}),ae.addEventListener("chat.message.complete",ye=>{try{const he=JSON.parse(ye.data);h(Ee=>Ee&&Ee.id===he.assistantId?{...Ee,done:!0,finalMessage:he.message}:Ee)}catch{}}),ae.addEventListener("chat.message.error",ye=>{try{const he=JSON.parse(ye.data);h(Ne=>Ne&&Ne.sessionId===t&&(!he.assistantId||Ne.id===he.assistantId||Ne.id===he.turnId)?null:Ne),v(!1);const Ee=he.message;Ee&&i.setQueryData(["chat-session",t],Ne=>!Ne||Ne.messages.some(Ke=>Ke.id===Ee.id)?Ne:{...Ne,messages:[...Ne.messages,Ee],lastMessageAt:Ee.ts,messageCount:Ne.messageCount+1})}catch{}}),()=>ae.close()},[t,i]),j.useEffect(()=>{if(!f||f.sessionId!==t)return;const ae=f.blocks.reduce((ye,he)=>he.type==="text"?ye+(he.target.length-he.displayed.length):ye,0);if(ae<=0){if(f.done&&f.finalMessage){const ye=f.finalMessage;i.setQueryData(["chat-session",t],he=>!he||he.messages.some(Ee=>Ee.id===ye.id)?he:{...he,messages:[...he.messages,ye],lastMessageAt:ye.ts,messageCount:he.messageCount+1}),i.invalidateQueries({queryKey:["chat-sessions"]}),i.invalidateQueries({queryKey:["chat-session",t]}),h(null),v(!1)}return}const be=setTimeout(()=>{h(ye=>{if(!ye)return ye;let he=Math.max(1,Math.ceil(ae/40));const Ee=ye.blocks.map(Ne=>{if(Ne.type!=="text"||he<=0)return Ne;const Ke=Ne.target.length-Ne.displayed.length;if(Ke<=0)return Ne;const ne=Math.min(Ke,he);return he-=ne,{...Ne,displayed:Ne.target.slice(0,Ne.displayed.length+ne)}});return{...ye,blocks:Ee}})},25);return()=>clearTimeout(be)},[f,i,t]),j.useEffect(()=>{if(E.current){const ae=N.current;ae&&(ae.scrollTop=ae.scrollHeight)}},[d.data,f]),j.useEffect(()=>{E.current=!0,S(!1),v(!1)},[t]);const B=j.useCallback(async(ae={})=>{var be,ye;try{const he=await ly({cwd:((be=ae.cwd)==null?void 0:be.trim())||void 0,title:((ye=ae.title)==null?void 0:ye.trim())||void 0,agentKind:ae.agentKind,model:ae.model,providerId:ae.providerId});i.invalidateQueries({queryKey:["chat-sessions"]}),n(`/chat/${he.id}`),I(!1)}catch(he){l({title:e("chat.error.create.title"),body:he instanceof Error?he.message:String(he)})}},[i,n,l,e]),le=j.useCallback(async()=>{const ae=m.trim();if(!ae&&q.length===0||k)return;let be=t;if(!be){const Ee=await ly();i.invalidateQueries({queryKey:["chat-sessions"]}),be=Ee.id,n(`/chat/${be}`,{replace:!0})}E.current=!0,S(!1);const ye=q.map(Ee=>Ee.path),he={id:`optim-${Date.now()}`,role:"user",content:ae||e("chat.placeholder.attachment"),ts:new Date().toISOString(),status:"complete",attachments:ye.length>0?ye:void 0};i.setQueryData(["chat-session",be],Ee=>Ee?{...Ee,messages:[...Ee.messages,he],lastMessageAt:he.ts,messageCount:Ee.messageCount+1}:{id:be,createdAt:he.ts,lastMessageAt:he.ts,title:ae.slice(0,60)||e("chat.placeholder.attachmentTitle"),project:null,messageCount:1,messages:[he]}),b(""),F([]),v(!0);try{await Q8(be,ae||e("chat.placeholder.viewAttachment"),ye.length>0?ye:void 0)}catch(Ee){v(!1),console.error("sendMessage failed",Ee),l({title:e("chat.error.send.title"),body:Ee instanceof Error?Ee.message:String(Ee)})}},[m,q,k,t,i,n,l,e]),ve=j.useCallback(async ae=>{if(ae.size>m2){l({title:e("chat.error.fileTooBig.title"),body:e("chat.error.fileTooBig.body",{size:(ae.size/1024/1024).toFixed(2),name:ae.name})});return}let be=t;if(!be){const ye=await ly();i.invalidateQueries({queryKey:["chat-sessions"]}),be=ye.id,n(`/chat/${be}`,{replace:!0})}D(!0);try{const ye=await g4(be,ae);F(he=>[...he,{path:ye.path,name:ye.name}])}catch(ye){l({title:e("chat.error.uploadAttachment.title"),body:ye instanceof Error?ye.message:String(ye)})}finally{D(!1)}},[t,i,n,l,e]),ke=j.useCallback(ae=>{F(be=>be.filter(ye=>ye.path!==ae))},[]),Se=j.useCallback(async(ae,be)=>{await a({title:e("chat.delete.confirm.title"),body:e(be==="cli"?"chat.delete.confirm.body.cli":"chat.delete.confirm.body.console"),confirm:e("chat.delete.confirm.button"),danger:!0})&&(await Y8(ae),i.invalidateQueries({queryKey:["chat-sessions"]}),t===ae&&n("/chat"))},[i,t,n,a,e]),J=j.useCallback(async()=>{if(t)try{await W8(t)}catch(ae){l({title:e("chat.error.interrupt.title"),body:ae instanceof Error?ae.message:String(ae)})}},[t,l,e]),ue=f&&f.sessionId===t?f:null;return c.jsxs("div",{className:"grid flex-1 min-h-0 grid-cols-[260px_minmax(0,1fr)] items-stretch gap-4",children:[c.jsxs("aside",{className:"nb-card p-3 overflow-hidden flex h-full min-h-0 flex-col gap-2",children:[c.jsxs("button",{className:"nb-btn nb-btn-primary w-full justify-center",onClick:()=>I(!0),type:"button",children:[c.jsx(pi,{size:14,strokeWidth:3}),e("chat.list.new")]}),c.jsx("div",{className:"mt-2 text-xs font-[family-name:var(--font-heading)] uppercase tracking-wider text-[var(--color-text-muted)] px-2",children:e("chat.list.heading",{count:((Te=o.data)==null?void 0:Te.data.length)??0})}),c.jsx("div",{className:"flex flex-col gap-0.5 mt-1 overflow-auto min-h-0",children:(()=>{var ne;const ae=((ne=o.data)==null?void 0:ne.data)??[],be=Date.now(),ye=10080*60*1e3,he=de=>new Date(de.lastMessageAt??de.createdAt).getTime(),Ee=ae.filter(de=>be-he(de)<=ye),Ne=ae.filter(de=>be-he(de)>ye),Ke=de=>c.jsxs("div",{className:["dimension-menu-item group items-start gap-2 px-3 py-2 pl-4",t===de.id?"dimension-menu-item-active":""].join(" "),children:[c.jsxs("button",{type:"button","aria-label":e("chat.list.openAria",{title:de.title,cwd:de.cwd?e("chat.list.cwdSuffix",{cwd:de.cwd}):""}),onClick:()=>n(`/chat/${de.id}`),className:"flex items-start gap-2 flex-1 min-w-0 text-left",children:[c.jsx(dk,{size:14,strokeWidth:2.5,className:"mt-0.5 flex-shrink-0"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[c.jsx("p",{className:"text-sm font-semibold truncate flex-1",children:de.title}),de.source==="cli"&&c.jsx("span",{className:"flex-shrink-0 px-1.5 py-0 rounded-md bg-[var(--color-accent-purple)] border-2 border-[var(--color-text)] text-[9px] font-[family-name:var(--font-mono)] uppercase tracking-wider leading-tight",title:e("chat.cliBadge.tooltip"),children:e("chat.cliBadge")})]}),c.jsx("p",{className:"text-[10px] text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] truncate",children:e("chat.list.msgs",{count:de.messageCount,time:Zj(de.lastMessageAt??de.createdAt,e)})}),de.cwd&&c.jsxs("p",{className:"text-[10px] text-[var(--color-text-subtle)] font-[family-name:var(--font-mono)] truncate flex items-center gap-1",title:de.cwd,children:[c.jsx(ph,{size:9,strokeWidth:2.5,className:"flex-shrink-0"}),c.jsx("span",{className:"truncate",dir:"rtl",children:de.cwd})]})]})]}),c.jsx("button",{type:"button","aria-label":de.source==="cli"?e("chat.list.deleteCli.aria"):e("chat.list.delete.aria"),className:"opacity-0 group-hover:opacity-100 p-1 hover:text-[var(--color-crashed)]",onClick:Le=>{Le.stopPropagation(),Se(de.id,de.source)},children:c.jsx(fr,{size:12})})]},de.id);return c.jsxs(c.Fragment,{children:[Ee.map(Ke),Ne.length>0&&c.jsxs(c.Fragment,{children:[c.jsxs("button",{type:"button",onClick:()=>V(de=>!de),"aria-expanded":z,className:"flex items-center gap-1 px-2 py-1 mt-1 rounded-lg text-xs font-semibold text-[var(--color-text-muted)] hover:text-[var(--color-text)] hover:bg-[var(--color-bg-cream)] focus-visible:outline focus-visible:outline-2",children:[z?c.jsx(Vu,{size:12,strokeWidth:2.5}):c.jsx(Zo,{size:12,strokeWidth:2.5}),e("chat.list.olderToggle",{count:Ne.length})]}),z&&Ne.map(Ke)]}),ae.length===0&&c.jsx("p",{className:"text-xs text-[var(--color-text-subtle)] italic text-center py-4",children:e("chat.list.empty")})]})})()})]}),c.jsx("div",{className:"nb-card p-0 flex h-full min-h-0 flex-col overflow-hidden",children:t?c.jsxs(c.Fragment,{children:[c.jsxs("header",{className:"px-4 py-3 border-b-2 border-[var(--color-text)] bg-color-bg-soft",children:[c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:((Re=d.data)==null?void 0:Re.title)??e("common.loading")}),((De=d.data)==null?void 0:De.model)&&c.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-[var(--color-accent-yellow)] border-2 border-[var(--color-text)] text-[10px] font-[family-name:var(--font-mono)] font-bold uppercase tracking-wider",title:e("chat.detail.model.tooltip"),children:[c.jsx(hh,{size:11,strokeWidth:2.5})," ",d.data.model]})]}),c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)]",children:t}),((ce=d.data)==null?void 0:ce.claudeSessionId)&&c.jsxs("p",{className:"text-xs text-[var(--color-text-subtle)] font-[family-name:var(--font-mono)] truncate",title:e("chat.detail.claudeSession.tooltip"),children:["claude: ",d.data.claudeSessionId]}),((Ce=d.data)==null?void 0:Ce.cwd)&&c.jsxs("p",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] flex items-center gap-1 mt-1",title:d.data.cwd,children:[c.jsx(ph,{size:11,strokeWidth:2.5,className:"flex-shrink-0"}),c.jsx("span",{className:"truncate",children:d.data.cwd})]})]}),c.jsxs("div",{className:"relative flex-1 flex flex-col min-h-0",children:[c.jsxs("div",{ref:N,onScroll:T,className:"flex-1 overflow-auto p-4 flex flex-col gap-4",children:[(((te=d.data)==null?void 0:te.messages)??[]).filter(ae=>!(ue&&ae.status==="streaming")).map(ae=>c.jsx(tq,{msg:ae,sessionId:t??null,onPreviewAttachment:be=>L(be)},ae.id)),ue&&c.jsx(iq,{pending:ue}),!d.isLoading&&(((pe=d.data)==null?void 0:pe.messages)??[]).length===0&&!ue&&!k&&c.jsx("p",{className:"text-center text-[var(--color-text-subtle)] italic mt-12",children:e("chat.session.empty")})]}),C&&c.jsx("button",{type:"button",onClick:M,className:"absolute bottom-3 right-4 z-10 w-9 h-9 flex items-center justify-center rounded-full border-2 border-[var(--color-text)] bg-white shadow-[2px_2px_0_var(--color-text)] hover:-translate-y-px hover:shadow-[3px_3px_0_var(--color-text)] active:translate-y-px active:shadow-none transition-transform","aria-label":"滚动到底部",title:"↓ 回到底部",children:c.jsx(TR,{size:18,strokeWidth:3})})]}),((Fe=d.data)==null?void 0:Fe.source)==="cli"?c.jsxs("div",{className:"border-t-2 border-[var(--color-text)] p-4 bg-[var(--color-accent-purple)]",children:[c.jsxs("p",{className:"text-sm font-[family-name:var(--font-mono)] text-[var(--color-text-muted)] text-center",children:[c.jsx("strong",{children:e("chat.cli.banner.bold")})," — ",e("chat.cli.banner")]}),c.jsxs("pre",{className:"mt-2 px-3 py-2 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-md text-xs font-[family-name:var(--font-mono)] overflow-x-auto",children:["sps agent --chat --name ",(t??"").replace(/^session-/,"")]})]}):c.jsxs("div",{className:["border-t-2 border-[var(--color-text)] p-3 transition-colors",H?"bg-[var(--color-accent-mint)]":""].join(" "),onDragOver:ae=>{ae.dataTransfer.types.includes("Files")&&(ae.preventDefault(),ae.dataTransfer.dropEffect="copy",H||Q(!0))},onDragLeave:()=>Q(!1),onDrop:ae=>{if(!ae.dataTransfer.types.includes("Files"))return;ae.preventDefault(),Q(!1);const be=Array.from(ae.dataTransfer.files??[]);for(const ye of be)ve(ye)},children:[(q.length>0||Y)&&c.jsxs("div",{className:"flex flex-wrap gap-2 mb-2",children:[q.map(ae=>c.jsxs("button",{type:"button",className:"flex items-center gap-1.5 px-2 py-1 rounded-md bg-[var(--color-bg)] border-2 border-[var(--color-text)] text-xs font-[family-name:var(--font-mono)] hover:bg-[var(--color-accent-mint)] group",onClick:()=>L(ae.path),title:e("chat.attachment.previewTooltip",{name:ae.name,path:ae.path}),children:[Nh(ae.path)?c.jsx(NL,{size:11,strokeWidth:2.5,className:"flex-shrink-0"}):c.jsx(Fh,{size:11,strokeWidth:2.5,className:"flex-shrink-0"}),c.jsx("span",{className:"truncate max-w-[180px]",children:ae.name}),c.jsx("span",{role:"button","aria-label":e("chat.input.removeAttachment",{name:ae.name}),className:"ml-1 hover:text-[var(--color-crashed)] cursor-pointer",onClick:be=>{be.stopPropagation(),ke(ae.path)},children:c.jsx(bn,{size:11,strokeWidth:3})})]},ae.path)),Y&&c.jsxs("span",{className:"flex items-center gap-1.5 px-2 py-1 text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)]",children:[c.jsx(Xe,{size:11,strokeWidth:2.5,className:"animate-spin"}),e("chat.input.uploading")]})]}),c.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border-[3px] border-[var(--color-text)] bg-white px-3 py-2 shadow-[3px_3px_0_var(--color-text)] focus-within:shadow-[4px_4px_0_var(--color-text)] transition-shadow",children:[c.jsx("textarea",{ref:R,className:"w-full resize-none border-0 !bg-transparent outline-none text-sm leading-relaxed max-h-[200px] px-1 pt-1",placeholder:e(H?"chat.input.dragOver":"chat.input.placeholder"),rows:1,value:m,onChange:ae=>b(ae.target.value),onKeyDown:ae=>{ae.key==="Enter"&&!ae.shiftKey&&!ae.nativeEvent.isComposing&&(ae.preventDefault(),le())},onPaste:ae=>{const ye=Array.from(ae.clipboardData.items??[]).filter(he=>he.kind==="file"&&he.type.startsWith("image/"));if(ye.length!==0){ae.preventDefault();for(const he of ye){const Ee=he.getAsFile();Ee&&ve(Ee)}}},"aria-label":e("chat.input.aria")}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("button",{type:"button",className:O,onClick:()=>P(!0),disabled:k,"aria-label":e("chat.input.attach.aria"),title:e("chat.input.attach.title"),children:c.jsx(UL,{size:15,strokeWidth:2.5})}),c.jsx(Z8,{className:O,disabled:k,onInsert:ae=>b(be=>be.trim()?`${be}
656
+ ${ae}`:ae)}),c.jsx("div",{className:"flex-1"}),ue?c.jsx("button",{className:"nb-btn nb-btn-danger w-9 h-9 p-0 justify-center",onClick:J,type:"button","aria-label":e("chat.input.interrupt.aria"),title:e("chat.input.interrupt"),children:c.jsx(Ub,{size:14,strokeWidth:3})}):c.jsx("button",{className:"nb-btn nb-btn-primary w-9 h-9 p-0 justify-center disabled:opacity-40 disabled:cursor-not-allowed",onClick:le,disabled:!m.trim()&&q.length===0||k,type:"button","aria-label":e("chat.input.send.aria"),title:e("chat.input.send"),children:k?c.jsx(Xe,{size:16,strokeWidth:3,className:"animate-spin"}):c.jsx(HN,{size:18,strokeWidth:3})})]})]})]})]}):c.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:c.jsxs("div",{className:"text-center max-w-md",children:[c.jsx("div",{className:"w-20 h-20 rounded-2xl bg-[var(--color-accent-mint)] border-[3px] border-[var(--color-text)] shadow-[3px_3px_0_var(--color-text)] flex items-center justify-center mx-auto mb-4",children:c.jsx(dk,{size:32,strokeWidth:2.5})}),c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold mb-2",children:e("chat.empty.title")}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mb-4",children:e("chat.empty.hint")}),c.jsx("p",{className:"text-xs text-[var(--color-text-subtle)] italic",children:e("chat.empty.shortcuts")})]})})}),$&&c.jsx(eq,{onCancel:()=>I(!1),onCreate:ae=>B(ae)}),K&&c.jsx(ux,{mode:"file",title:e("chat.filePicker.title"),initialPath:((ze=d.data)==null?void 0:ze.cwd)??void 0,onCancel:()=>P(!1),onSelect:ae=>{F(be=>{if(be.some(he=>he.path===ae))return be;const ye=ae.split(/[\\/]/).pop()||ae;return[...be,{path:ae,name:ye}]}),P(!1)}}),G&&t&&c.jsx(J8,{sessionId:t,path:G,onClose:()=>L(null)})]})}function Nh(e){return/\.(png|jpe?g|gif|webp|svg|avif)$/i.test(e)}function RE(e){return/\.pdf$/i.test(e)}function oy(e){return/\.(txt|md|log|json|yaml|yml|csv|html|xml|tsx?|jsx?|css|sh|ya?ml|conf|toml|ini|env|gitignore|sql|py|rb|go|rs|java|kt|swift|c|cc|cpp|h|hpp)$/i.test(e)}function J8({sessionId:e,path:t,onClose:n}){const i=Be(),[a,l]=j.useState(null),[o,d]=j.useState(null);j.useEffect(()=>{const g=m=>{m.key==="Escape"&&(m.preventDefault(),n())};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[n]),j.useEffect(()=>{if(!oy(t))return;let g=!1;return fetch(Qy(e,t)).then(async m=>{if(!m.ok)throw new Error(`${m.status}`);return m.text()}).then(m=>{g||l(m.length>2e5?m.slice(0,2e5)+`
657
+
658
+ …(truncated)`:m)}).catch(m=>{g||d(m instanceof Error?m.message:String(m))}),()=>{g=!0}},[e,t]);const f=Qy(e,t),h=t.split(/[\\/]/).pop()??t;return c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-[rgba(45,55,72,0.6)] p-4",role:"presentation",children:c.jsxs("div",{className:"nb-card bg-[var(--color-bg)] max-w-3xl w-full p-5 flex flex-col",style:{maxHeight:"85vh"},role:"dialog","aria-modal":"true","aria-label":i("chat.attachment.preview.aria",{name:h}),children:[c.jsxs("header",{className:"flex items-center justify-between mb-3 shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx(tL,{size:16,strokeWidth:2.5,className:"flex-shrink-0"}),c.jsx("h3",{className:"font-[family-name:var(--font-heading)] font-bold text-base truncate",children:h})]}),c.jsx("button",{type:"button",className:"p-1 hover:bg-[var(--color-bg-cream)] rounded flex-shrink-0",onClick:n,"aria-label":i("chat.attachment.close.aria"),children:c.jsx(bn,{size:16,strokeWidth:3})})]}),c.jsx("p",{className:"text-[10px] text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] truncate mb-2 shrink-0",title:t,dir:"rtl",children:t}),c.jsxs("div",{className:"flex-1 overflow-auto border-2 border-[var(--color-text)] rounded-lg bg-[var(--color-bg-cream)] min-h-0",children:[Nh(t)&&c.jsx("div",{className:"flex items-center justify-center p-4",children:c.jsx("img",{src:f,alt:`Preview: ${h}`,className:"max-w-full max-h-[60vh] object-contain"})}),RE(t)&&c.jsx("iframe",{src:f,title:`PDF: ${h}`,className:"w-full",style:{height:"60vh",border:0}}),oy(t)&&c.jsx("pre",{className:"p-3 text-xs font-[family-name:var(--font-mono)] whitespace-pre-wrap break-words",children:o?c.jsx("span",{className:"text-[var(--color-crashed)]",children:i("chat.attachment.readErr",{detail:o})}):a===null?c.jsx("span",{className:"text-[var(--color-text-muted)]",children:i("chat.attachment.loading")}):a}),!Nh(t)&&!RE(t)&&!oy(t)&&c.jsxs("div",{className:"p-6 text-center text-sm text-[var(--color-text-muted)]",children:[c.jsx("p",{className:"mb-3",children:i("chat.attachment.unsupported")}),c.jsx("a",{href:f,download:h,className:"nb-btn nb-btn-primary inline-flex",children:i("chat.attachment.download")})]})]})]})})}function eq({onCancel:e,onCreate:t}){var S;const n=Be(),[i,a]=j.useState(""),[l,o]=j.useState(""),[d,f]=j.useState(""),[h,g]=j.useState(!1),[m,y]=j.useState(!1),[b,k]=j.useState(!1),v=Ye({queryKey:["providers"],queryFn:cx}),N=Ye({queryKey:["system-agents"],queryFn:Kb}),E=h2(((S=v.data)==null?void 0:S.anthropic)??[]);j.useEffect(()=>{var T;if(h)return;const _=(T=N.data)==null?void 0:T.agents.worker;if(!_)return;const M=`${_.providerId||"official"}::${_.model}`;E.some(R=>`${R.providerId}::${R.model}`===M)&&f(M)},[N.data,E,h]),j.useEffect(()=>{if(b)return;const _=M=>{M.key==="Escape"&&(M.preventDefault(),e())};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[e,b]);const C=async()=>{if(!m){y(!0);try{const[_,M]=d?d.split("::"):[void 0,void 0];t({title:i.trim()||void 0,cwd:l.trim()||void 0,agentKind:"claude",model:M,providerId:_})}finally{y(!1)}}};return c.jsxs("div",{className:"fixed inset-0 z-40 flex items-center justify-center bg-[rgba(45,55,72,0.4)] p-4",role:"presentation",children:[c.jsxs("div",{className:"nb-card bg-[var(--color-bg)] max-w-md w-full p-5",role:"dialog","aria-modal":"true","aria-label":n("chat.newSession.title.aria"),children:[c.jsxs("header",{className:"flex items-center justify-between mb-4",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:n("chat.newSession.title")}),c.jsx("button",{type:"button",className:"p-1 hover:bg-[var(--color-bg-cream)] rounded",onClick:e,"aria-label":n("chat.newSession.close.aria"),children:c.jsx(bn,{size:16,strokeWidth:3})})]}),c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{children:[c.jsx("label",{htmlFor:"new-session-model",className:"block text-xs font-bold mb-1.5 uppercase tracking-wider",children:n("chat.newSession.field.model")}),c.jsxs("select",{id:"new-session-model",className:"nb-input w-full font-[family-name:var(--font-mono)] text-sm",value:d,onChange:_=>{g(!0),f(_.target.value)},children:[c.jsx("option",{value:"",children:n("chat.newSession.field.model.default")}),E.map(_=>c.jsx("option",{value:`${_.providerId}::${_.model}`,children:_.label},`${_.providerId}::${_.model}`))]})]}),c.jsxs("div",{children:[c.jsx("label",{htmlFor:"new-session-title",className:"block text-xs font-bold mb-1.5 uppercase tracking-wider",children:n("chat.newSession.field.title")}),c.jsx("input",{id:"new-session-title",type:"text",className:"nb-input w-full",placeholder:n("chat.newSession.field.title.placeholder"),value:i,onChange:_=>a(_.target.value),autoFocus:!0})]}),c.jsxs("div",{children:[c.jsx("label",{htmlFor:"new-session-cwd",className:"block text-xs font-bold mb-1.5 uppercase tracking-wider",children:n("chat.newSession.field.cwd")}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{id:"new-session-cwd",type:"text",className:"nb-input flex-1 font-[family-name:var(--font-mono)] text-sm",placeholder:"/home/coral/projects/my-app",value:l,onChange:_=>o(_.target.value)}),c.jsxs("button",{type:"button",className:"nb-btn flex-shrink-0",onClick:()=>k(!0),"aria-label":n("chat.newSession.field.cwd.browseAria"),title:n("chat.newSession.field.cwd.browseAria"),children:[c.jsx(VN,{size:14,strokeWidth:2.5}),n("chat.newSession.field.cwd.browse")]})]}),c.jsxs("p",{className:"text-[11px] text-[var(--color-text-muted)] mt-1.5 leading-relaxed",children:[c.jsx(ph,{size:10,strokeWidth:2.5,className:"inline mr-1 -mt-0.5"}),n("chat.newSession.field.cwd.help1")," ",n("chat.newSession.field.cwd.help2")]})]}),c.jsxs("div",{className:"flex gap-2 justify-end pt-2",children:[c.jsx("button",{type:"button",className:"nb-btn",onClick:e,children:n("chat.newSession.cancel")}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-primary",onClick:C,disabled:m,children:[m?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(pi,{size:14,strokeWidth:3}),n("chat.newSession.create")]})]})]})]}),b&&c.jsx(ux,{initialPath:l.trim()||void 0,onCancel:()=>k(!1),onSelect:_=>{o(_),k(!1)}})]})}function tq({msg:e,sessionId:t,onPreviewAttachment:n}){const i=Be(),a=e.role==="user",l=e.role==="error",o=e.blocks&&e.blocks.length>0?e.blocks:[{type:"text",text:e.content}],d=e.attachments??[];return c.jsx("div",{className:a?"self-end max-w-3xl":"self-start max-w-3xl",children:c.jsxs("div",{className:["nb-card",a?"bg-[var(--color-secondary)]":l?"bg-[var(--color-crashed-bg)]":"bg-surface-input"].join(" "),children:[c.jsxs("p",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-text-muted)] mb-2 flex items-center gap-2",children:[i(a?"chat.message.role.you":l?"chat.message.role.error":"chat.message.role.assistant"),c.jsx("span",{className:"font-normal",children:"·"}),c.jsx("span",{className:"font-normal cursor-help",title:sq(e.ts),children:Zj(e.ts,i)})]}),c.jsx("div",{className:"flex flex-col gap-2",children:o.map((f,h)=>c.jsx(rq,{block:f},h))}),d.length>0&&t&&c.jsx("div",{className:"mt-3 pt-3 border-t-2 border-dashed border-[var(--color-text)]/30 flex flex-wrap gap-2",children:d.map(f=>c.jsx(nq,{sessionId:t,path:f,onPreview:()=>n(f)},f))}),e.truncated&&c.jsx("p",{className:"mt-3 px-3 py-2 bg-[var(--color-stuck-bg)] border-2 border-[var(--color-stuck)] rounded-lg text-xs text-[var(--color-stuck)] font-bold",children:i("chat.message.truncated")})]})})}function nq({sessionId:e,path:t,onPreview:n}){const i=Be(),a=t.split(/[\\/]/).pop()??t;return Nh(t)?c.jsx("button",{type:"button",onClick:n,className:"block rounded-md overflow-hidden border-2 border-[var(--color-text)] hover:shadow-[2px_2px_0_var(--color-text)] transition-shadow",title:i("chat.attachment.previewSimpleTooltip",{name:a}),children:c.jsx("img",{src:Qy(e,t),alt:a,className:"block max-h-40 max-w-[12rem] object-cover",loading:"lazy"})}):c.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1.5 px-2 py-1 rounded-md bg-[var(--color-bg)] border-2 border-[var(--color-text)] text-xs font-[family-name:var(--font-mono)] hover:bg-[var(--color-accent-mint)]",title:i("chat.attachment.previewTooltip",{name:a,path:t}),children:[c.jsx(Fh,{size:11,strokeWidth:2.5,className:"flex-shrink-0"}),c.jsx("span",{className:"truncate max-w-[200px]",children:a})]})}function iq({pending:e}){const t=(()=>{for(let n=e.blocks.length-1;n>=0;n--)if(e.blocks[n].type==="text")return n;return-1})();return c.jsx("div",{className:"self-start max-w-3xl",children:c.jsxs("div",{className:"nb-card bg-[var(--color-bg)]",children:[c.jsxs("p",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-text-muted)] mb-2 flex items-center gap-2",children:["assistant",c.jsx("span",{className:"font-normal",children:"·"}),c.jsxs("span",{className:"flex items-center gap-1 font-normal text-[var(--color-running)]",children:[c.jsx(Xe,{size:10,strokeWidth:3,className:"animate-spin"}),"streaming"]})]}),c.jsxs("div",{className:"flex flex-col gap-2",children:[e.blocks.length===0&&c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] italic",children:"…"}),e.blocks.map((n,i)=>{if(n.type==="text"){const a=i===t;return c.jsxs("div",{className:"relative",children:[c.jsx(Wj,{text:n.displayed}),a&&c.jsx("span",{className:"inline-block w-2 h-4 ml-1 bg-[var(--color-text)] animate-pulse align-middle"})]},i)}return c.jsx(Xj,{tool:n},i)})]})]})})}function rq({block:e}){return e.type==="text"?c.jsx(Wj,{text:e.text}):c.jsx(Xj,{tool:e})}function Wj({text:e}){return e?c.jsx("div",{className:"text-sm font-[family-name:var(--font-body)] break-words prose-chat",children:c.jsx(Ax,{remarkPlugins:[Ox],rehypePlugins:[Ix],children:e})}):null}function aq(e){if(e==null||typeof e!="object")return typeof e=="string"?e:"";const t=e,n=a=>typeof t[a]=="string"?t[a]:void 0;return n("file_path")??n("path")??n("notebook_path")??n("command")??n("pattern")??n("query")??n("url")??n("name")??n("description")??n("prompt")??Object.values(t).find(a=>typeof a=="string"&&a.trim())??""}function Xj({tool:e}){const[t,n]=j.useState(!1),i=e.status==="completed"||e.status==="complete",a=e.status==="failed",l=!i&&!a,o=aq(e.input),d=e.input!=null&&(typeof e.input!="object"||Object.keys(e.input).length>0);return c.jsxs("div",{className:"border-2 border-[var(--color-text)] rounded-lg overflow-hidden bg-[var(--color-bg-cream)]",children:[c.jsxs("button",{type:"button",onClick:()=>n(f=>!f),className:"w-full bg-color-bg-soft-button flex items-center gap-2 px-3 py-2 text-xs font-[family-name:var(--font-mono)] hover:bg-[var(--color-accent-yellow)] transition-colors",children:[c.jsx(Zo,{size:12,strokeWidth:3,className:["transition-transform flex-shrink-0",t?"rotate-90":""].join(" ")}),c.jsx(a_,{size:12,strokeWidth:2.5,className:"flex-shrink-0"}),c.jsx("span",{className:"font-bold flex-shrink-0",children:e.title||e.kind}),c.jsx("span",{className:"flex-1 text-left text-[var(--color-text-muted)] truncate",title:o,children:o}),l&&c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin text-[var(--color-running)] flex-shrink-0"}),i&&c.jsx(Eu,{size:12,strokeWidth:2.5,className:"text-[var(--color-running)] flex-shrink-0"}),a&&c.jsx(KN,{size:12,strokeWidth:2.5,className:"text-[var(--color-crashed)] flex-shrink-0"})]}),t&&c.jsxs("div",{className:"px-3 py-2 text-xs font-[family-name:var(--font-mono)] text-[var(--color-text-muted)] border-t-2 border-[var(--color-text)] space-y-1",children:[d?c.jsx("pre",{className:"whitespace-pre-wrap break-all text-[var(--color-text)] max-h-72 overflow-auto",children:typeof e.input=="string"?e.input:JSON.stringify(e.input,null,2)}):c.jsx("div",{children:"无参数"}),c.jsxs("div",{className:"opacity-60",children:["id: ",e.id," · ",e.status]})]})]})}function Zj(e,t){if(!e)return"";const n=new Date(e),i=Date.now()-n.getTime();return i<6e4?t("kanban.time.justNow"):i<36e5?t("kanban.time.minutes",{n:Math.floor(i/6e4)}):i<864e5?t("kanban.time.hours",{n:Math.floor(i/36e5)}):n.toLocaleDateString()}function sq(e){if(!e)return;const t=new Date(e),n=i=>String(i).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}function lq(){return ft("/api/processes").then(e=>e.data)}function oq(e){return Lr(`/api/processes/${e}/kill`)}function cq(){return ft("/api/processes/reclaim")}async function uq(e){const t=await fetch("/api/processes/reclaim",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({idleMinutes:e})});if(!t.ok)throw new Error(`${t.status}: ${await t.text()}`);return t.json()}const LE="nb-card";function dq(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime();if(!Number.isFinite(t)||t<0)return"—";const n=Math.floor(t/6e4);if(n<1)return"<1m";if(n<60)return`${n}m`;const i=Math.floor(n/60);return i<24?`${i}h${n%60?` ${n%60}m`:""}`:`${Math.floor(i/24)}d${i%24?` ${i%24}h`:""}`}function cy(e){return e.project?e.project:e.cwd?e.cwd.split("/").filter(Boolean).pop()??e.slot:e.slot}function IE(e){const t=/^session-chat-(.+)$/.exec(e.slot);return(t==null?void 0:t[1])??null}function fq({p:e}){const t=e.alive?e.sessionState??"alive":"offline",n=e.alive?"bg-[var(--color-accent-mint)]":"bg-[var(--color-bg-cream)] text-[var(--color-text)]/60";return c.jsx("span",{className:`nb-status font-[family-name:var(--font-mono)] ${n}`,children:t})}function hq(){var k;const e=Be(),t=Gt(),[n,i]=j.useState(null),[a,l]=j.useState("all"),o=Ye({queryKey:["processes"],queryFn:lq,refetchInterval:5e3}),d=Ct({mutationFn:oq,onSuccess:v=>{i(v.message),t.invalidateQueries({queryKey:["processes"]})},onError:v=>i(v instanceof Error?v.message:String(v))}),f=Ye({queryKey:["reclaim"],queryFn:cq}),[h,g]=j.useState("");j.useEffect(()=>{f.data&&h===""&&g(String(f.data.idleMinutes))},[f.data,h]);const m=Ct({mutationFn:v=>uq(v),onSuccess:v=>{i(`自动回收已设为 ${v.idleMinutes} 分钟空闲`),t.invalidateQueries({queryKey:["reclaim"]})},onError:v=>i(v instanceof Error?v.message:String(v))}),y=o.data??[],b=y.filter(v=>a==="all"?!0:v.kind===a);return c.jsxs("div",{className:"max-w-full",children:[c.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[c.jsx(hh,{size:22,strokeWidth:2.5}),c.jsx("h1",{className:"font-[family-name:var(--font-heading)] font-bold text-2xl",children:e("processes.title")}),c.jsxs("button",{type:"button","aria-label":e("processes.refresh"),onClick:()=>t.invalidateQueries({queryKey:["processes"]}),className:"nb-btn ml-auto text-sm",children:[o.isFetching?c.jsx(Xe,{size:15,className:"animate-spin"}):c.jsx(ya,{size:15}),e("processes.refresh")]})]}),c.jsxs("p",{className:"text-sm text-[var(--color-text)]/70 mb-3",children:[e("processes.subtitle")," · ",e("processes.aliveCount").replace("{n}",String(y.length))]}),c.jsxs("div",{className:`${LE} px-4 py-3 mb-4 flex flex-wrap items-center gap-2`,children:[c.jsx(b3,{size:16,strokeWidth:2.5}),c.jsx("span",{className:"text-sm font-bold",children:"自动回收"}),c.jsx("span",{className:"text-sm text-[var(--color-text)]/70",children:"会话空闲"}),c.jsx("input",{type:"number",min:1,max:1440,value:h,onChange:v=>g(v.target.value),className:"nb-input w-20 px-2 py-1 font-[family-name:var(--font-mono)] text-sm","aria-label":"自动回收空闲分钟数"}),c.jsx("span",{className:"text-sm text-[var(--color-text)]/70",children:"分钟后自动停(下次访问自动续上,不丢上下文)"}),c.jsxs("button",{type:"button",disabled:m.isPending||h===""||Number(h)===((k=f.data)==null?void 0:k.idleMinutes),onClick:()=>m.mutate(Math.round(Number(h))),className:"nb-btn nb-btn-primary ml-auto text-sm disabled:opacity-50","aria-label":"保存自动回收设置",children:[m.isPending?c.jsx(Xe,{size:14,className:"animate-spin"}):c.jsx(Rr,{size:14,strokeWidth:3}),"保存"]})]}),n&&c.jsx("div",{className:"nb-card mb-3 px-3 py-2 text-sm font-mono",children:n}),c.jsx("div",{className:"flex flex-wrap gap-2 mb-3 items-center",children:["all","worker","chat"].map(v=>c.jsx("button",{type:"button","aria-label":e(`processes.kind.${v}`),onClick:()=>l(v),className:`nb-btn px-3 py-1 text-sm ${a===v?"dimension-menu-item-active":""}`,children:e(`processes.kind.${v}`)},v))}),c.jsx("div",{className:`${LE} overflow-hidden p-0`,children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{className:"bg-[var(--color-bg-cream)] font-[family-name:var(--font-heading)]",children:c.jsxs("tr",{className:"text-left",children:[c.jsx("th",{className:"px-3 py-2",children:e("processes.col.kind")}),c.jsx("th",{className:"px-3 py-2",children:e("processes.col.slot")}),c.jsx("th",{className:"px-3 py-2",children:e("processes.col.project")}),c.jsx("th",{className:"px-3 py-2",children:"PID"}),c.jsx("th",{className:"px-3 py-2",children:e("processes.col.state")}),c.jsx("th",{className:"px-3 py-2",children:e("processes.col.memory")}),c.jsx("th",{className:"px-3 py-2",children:"运行时间"}),c.jsx("th",{className:"px-3 py-2",children:e("processes.col.action")})]})}),c.jsxs("tbody",{className:"font-[family-name:var(--font-mono)]",children:[b.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:8,className:"px-3 py-6 text-center text-[var(--color-text)]/50",children:e("processes.empty")})}),b.map(v=>c.jsxs("tr",{className:"border-t-2 border-[var(--color-text)]/10",title:v.cwd??"",children:[c.jsx("td",{className:"px-3 py-2",children:c.jsx("span",{className:`nb-badge text-xs ${v.kind==="worker"?"bg-[var(--color-accent-yellow)]":"bg-[var(--color-accent-purple)]"}`,children:e(`processes.kind.${v.kind}`)})}),c.jsx("td",{className:"px-3 py-2 max-w-[220px] truncate",children:v.slot}),c.jsx("td",{className:"px-3 py-2 max-w-[220px] truncate",children:v.kind==="chat"&&IE(v)?c.jsxs(vs,{to:`/chat/${IE(v)}`,className:"inline-flex items-center gap-1 font-semibold text-[var(--color-text)] underline decoration-2 underline-offset-2 hover:opacity-70",title:"打开对话窗口",children:[c.jsx(QN,{size:12,strokeWidth:2.5})," ",cy(v)]}):v.kind==="worker"&&v.project?c.jsxs(vs,{to:`/board?project=${encodeURIComponent(v.project)}`,className:"inline-flex items-center gap-1 font-semibold text-[var(--color-text)] underline decoration-2 underline-offset-2 hover:opacity-70",title:"打开该项目看板",children:[c.jsx(hh,{size:12,strokeWidth:2.5})," ",cy(v)]}):c.jsx("span",{children:cy(v)})}),c.jsx("td",{className:"px-3 py-2",children:v.pid??"—"}),c.jsx("td",{className:"px-3 py-2",children:c.jsx(fq,{p:v})}),c.jsx("td",{className:"px-3 py-2",children:v.memoryMB!=null?`${v.memoryMB} MB`:"—"}),c.jsx("td",{className:"px-3 py-2",children:dq(v.startedAt)}),c.jsx("td",{className:"px-3 py-2",children:v.alive&&v.pid!=null?c.jsxs("button",{type:"button","aria-label":`${e("processes.kill")} ${v.slot}`,onClick:()=>{confirm(e("processes.killConfirm").replace("{slot}",v.slot))&&d.mutate(v.pid)},className:"nb-btn nb-btn-danger px-2.5 py-1 text-xs",children:[c.jsx(KN,{size:13})," ",e("processes.kill")]}):c.jsx("span",{className:"text-[var(--color-text)]/40 text-xs",children:"—"})})]},v.slot))]})]})})]})}function pq(e={}){const t=new URLSearchParams;e.project&&t.set("project",e.project),e.action&&t.set("action",e.action);const n=t.toString();return ft(`/api/audit${n?`?${n}`:""}`).then(i=>i.data)}const mq="nb-card",gq={create:"bg-[var(--color-accent-mint)]",modify:"bg-[var(--color-accent-yellow)]",delete:"bg-[var(--color-accent-pink)]",daemon:"bg-[var(--color-accent-purple)]"};function yq(){const e=Be(),t=Gt(),[n,i]=j.useState(""),a=Ye({queryKey:["audit",n],queryFn:()=>pq(n?{action:n}:{}),refetchInterval:8e3}),l=a.data??[],o=d=>e(`audit.action.${d}`);return c.jsxs("div",{className:"max-w-full",children:[c.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[c.jsx($b,{size:22,strokeWidth:2.5}),c.jsx("h1",{className:"font-[family-name:var(--font-heading)] font-bold text-2xl",children:e("audit.title")}),c.jsxs("button",{type:"button","aria-label":e("audit.refresh"),onClick:()=>t.invalidateQueries({queryKey:["audit"]}),className:"nb-btn ml-auto text-sm",children:[a.isFetching?c.jsx(Xe,{size:15,className:"animate-spin"}):c.jsx(ya,{size:15}),e("audit.refresh")]})]}),c.jsx("p",{className:"text-sm text-[var(--color-text)]/70 mb-4",children:e("audit.subtitle")}),c.jsx("div",{className:"flex gap-2 mb-3",children:["","create","modify","delete","daemon"].map(d=>c.jsx("button",{type:"button","aria-label":d?o(d):e("audit.filter.all"),onClick:()=>i(d),className:`nb-btn px-3 py-1 text-sm ${n===d?"dimension-menu-item-active":""}`,children:d?o(d):e("audit.filter.all")},d||"all"))}),c.jsx("div",{className:`${mq} overflow-hidden p-0`,children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{className:"bg-[var(--color-bg-cream)] font-[family-name:var(--font-heading)]",children:c.jsxs("tr",{className:"text-left",children:[c.jsx("th",{className:"px-3 py-2",children:e("audit.col.time")}),c.jsx("th",{className:"px-3 py-2",children:e("audit.col.action")}),c.jsx("th",{className:"px-3 py-2",children:e("audit.col.project")}),c.jsx("th",{className:"px-3 py-2",children:e("audit.col.detail")})]})}),c.jsxs("tbody",{className:"font-[family-name:var(--font-mono)]",children:[l.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:4,className:"px-3 py-6 text-center text-[var(--color-text)]/50",children:e("audit.empty")})}),l.map((d,f)=>c.jsxs("tr",{className:"border-t-2 border-[var(--color-text)]/10",children:[c.jsx("td",{className:"px-3 py-2 whitespace-nowrap",children:new Date(d.ts).toLocaleString()}),c.jsx("td",{className:"px-3 py-2",children:c.jsx("span",{className:`nb-badge text-xs ${gq[d.action]}`,children:o(d.action)})}),c.jsx("td",{className:"px-3 py-2",children:d.project}),c.jsx("td",{className:"px-3 py-2 text-[var(--color-text)]/70",children:d.detail??(d.source?`(${d.source})`:"—")})]},`${d.ts}-${f}`))]})]})})]})}const bq=["convention","decision","gotcha","pattern","reference","note"];function is(e){return`${e.scope}:${e.project??e.agentId??""}`}function Bf(e){return e.scope==="global"?`全局 (${e.count})`:e.scope==="project"?`项目:${e.project} (${e.count})`:`会话:${e.agentId} (${e.count})`}function Vs(e){const t={scope:e.scope};return e.project&&(t.project=e.project),e.agentId&&(t.agentId=e.agentId),t}async function Er(e,t){const n=await fetch(e,t);if(!n.ok){const i=await n.json().catch(()=>null);throw new Error((i==null?void 0:i.detail)||(i==null?void 0:i.title)||`HTTP ${n.status}`)}return await n.json()}const xq=()=>({title:"",body:"",category:"note",tags:"",salience:3});function vq(){var ke,Se,J,ue,Te,Re,De,ce,Ce;const e=Be(),[t,n]=j.useState([]),[i,a]=j.useState(null),[l,o]=j.useState(!1),[d,f]=j.useState([]),[h,g]=j.useState(null),[m,y]=j.useState(!1),[b,k]=j.useState(""),[v,N]=j.useState(!0),[E,C]=j.useState([]),[S,_]=j.useState(null),[M,T]=j.useState(null),[R,O]=j.useState(null),[$,I]=j.useState(null),[q,F]=j.useState(""),[Y,D]=j.useState(""),K=j.useCallback(async()=>{try{const{scopes:te}=await Er("/api/memory/scopes");n(te),a(pe=>pe??te[0]??null)}catch(te){g(te instanceof Error?te.message:String(te))}},[]),P=j.useCallback(async te=>{try{const pe=new URLSearchParams(Vs(te)).toString(),{data:Fe}=await Er(`/api/memory/entries?${pe}`);f(Fe)}catch(pe){g(pe instanceof Error?pe.message:String(pe))}},[]);j.useEffect(()=>{K(),Er("/api/system/memory").then(te=>{I(te),F(te.mode),D(te.externalUrl)}).catch(()=>{})},[K]),j.useEffect(()=>{i&&P(i),(i==null?void 0:i.scope)==="project"&&i.project?Er(`/api/memory/external?project=${encodeURIComponent(i.project)}`).then(te=>O(te)).catch(()=>O(null)):O(null)},[i,P]);const H=j.useCallback(async()=>{if(!b.trim()){C([]);return}y(!0),g(null);try{const te=new URLSearchParams({q:b,limit:"20"});if(v)te.set("all","1");else if(i)for(const[Fe,ze]of Object.entries(Vs(i)))te.set(Fe,ze);const{results:pe}=await Er(`/api/memory/recall?${te.toString()}`);C(pe)}catch(te){g(te instanceof Error?te.message:String(te))}finally{y(!1)}},[b,v,i]),Q=j.useCallback(async()=>{if(!(!i||!S)){y(!0),g(null);try{await Er("/api/memory/entries",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({...Vs(i),id:S.id,title:S.title,body:S.body,category:S.category,tags:S.tags.split(",").map(te=>te.trim()).filter(Boolean),salience:S.salience})}),_(null),await Promise.all([P(i),K()])}catch(te){g(te instanceof Error?te.message:String(te))}finally{y(!1)}}},[i,S,P,K]),G=j.useCallback(async te=>{if(i){y(!0),g(null);try{const pe=new URLSearchParams(Vs(i)).toString();await Er(`/api/memory/entries/${encodeURIComponent(te)}?${pe}`,{method:"DELETE"}),await Promise.all([P(i),K()])}catch(pe){g(pe instanceof Error?pe.message:String(pe))}finally{y(!1)}}},[i,P,K]),L=j.useCallback(async(te,pe,Fe)=>{if(i){y(!0),g(null);try{await Er("/api/memory/promote",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({from:Vs(i),id:te.id,to:Vs(pe),move:Fe})}),T(null),await Promise.all([P(i),K()])}catch(ze){g(ze instanceof Error?ze.message:String(ze))}finally{y(!1)}}},[i,P,K]),z=j.useCallback(async()=>{if(i){y(!0),g(null);try{const pe=(await Er("/api/memory/gc",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(Vs(i))})).results[0];pe&&g(`收敛完成:清 tombstone ${pe.purged}、去重 ${pe.deduped}、剩余 ${pe.kept}`),await Promise.all([P(i),K()])}catch(te){g(te instanceof Error?te.message:String(te))}finally{y(!1)}}},[i,P,K]),V=j.useCallback(async()=>{y(!0),g(null);try{const te=await Er("/api/system/memory",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({mode:q,externalUrl:Y})});I(te),F(te.mode),D(te.externalUrl),g("模式已保存(重启 worker 生效)")}catch(te){g(te instanceof Error?te.message:String(te))}finally{y(!1)}},[q,Y]),B=$!=null&&(q!==$.mode||Y!==$.externalUrl),le=q==="external"||q==="local+external",ve=j.useMemo(()=>M?t.filter(te=>is(te)!==is(i??{scope:""})):[],[M,t,i]);return c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[c.jsxs("h1",{className:"font-[family-name:var(--font-heading)] font-bold text-2xl text-[var(--color-text)]",children:["🧠 ",e("nav.memory")]}),c.jsx("span",{className:"text-xs text-[var(--color-text)] opacity-60",children:"本地记忆 v2 · markdown 真源"})]}),$&&c.jsxs("section",{className:"nb-card flex flex-wrap items-end gap-3",children:[c.jsxs("label",{className:"flex flex-col gap-1 text-sm",children:[c.jsx("span",{className:"font-bold",children:"记忆模式"}),c.jsx("select",{className:"nb-input",value:q,onChange:te=>F(te.target.value),"aria-label":"记忆模式",children:$.modeOptions.map(te=>c.jsx("option",{value:te,children:te},te))})]}),le&&c.jsxs("label",{className:"flex flex-col gap-1 text-sm flex-1 min-w-[220px]",children:[c.jsx("span",{className:"font-bold",children:"外部后端地址"}),c.jsx("input",{className:"nb-input font-[family-name:var(--font-mono)] text-xs",value:Y,onChange:te=>D(te.target.value),placeholder:"http://127.0.0.1:3113",spellCheck:!1,"aria-label":"外部后端地址"})]}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-mint",onClick:V,disabled:m||!B,"aria-label":"保存模式",children:"保存模式"})]}),c.jsxs("div",{className:"flex gap-2 flex-wrap items-center",children:[c.jsx("input",{value:b,onChange:te=>k(te.target.value),onKeyDown:te=>te.key==="Enter"&&H(),placeholder:"检索记忆…","aria-label":"检索记忆",className:"nb-input flex-1 min-w-[200px] font-[family-name:var(--font-mono)] text-sm"}),c.jsxs("label",{className:"flex items-center gap-1 text-sm font-semibold",children:[c.jsx("input",{type:"checkbox",checked:v,onChange:te=>N(te.target.checked),"aria-label":"全局检索"}),"全局"]}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-mint",onClick:H,disabled:m,"aria-label":"检索",children:m?"…":"检索"})]}),h&&c.jsxs("div",{className:"text-sm text-[var(--color-text)] font-semibold nb-card py-2",children:["ℹ ",h]}),E.length>0&&c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] font-bold text-sm",children:["检索结果(",E.length,")"]}),E.map(te=>c.jsxs("div",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center gap-2 text-xs opacity-60 font-[family-name:var(--font-mono)]",children:[c.jsx("span",{className:"nb-badge",children:te.source==="external"?"🌐 外部":"📁 本地"}),c.jsx("span",{children:te.source==="external"?te.type??"":te.scope==="project"?`项目:${te.project}`:te.scope}),te.category&&c.jsxs(c.Fragment,{children:[c.jsx("span",{children:"·"}),c.jsx("span",{children:te.category})]})]}),c.jsx("div",{className:"font-bold text-sm mt-1",children:te.title}),c.jsx("div",{className:"text-sm mt-1 whitespace-pre-wrap opacity-80",children:te.snippet.slice(0,300)})]},te.id))]}),(()=>{const te=new Date(Date.now()-6048e5).toISOString(),pe=i?is(i):"",Fe=l?t:t.filter(ae=>ae.scope!=="project"||ae.updated>=te||is(ae)===pe),ze=t.length-Fe.length;return c.jsxs("div",{className:"flex gap-2 flex-wrap items-center",children:[c.jsx("select",{className:"nb-input",value:pe,onChange:ae=>a(t.find(be=>is(be)===ae.target.value)??null),"aria-label":"选择作用域",children:Fe.map(ae=>c.jsx("option",{value:is(ae),children:Bf(ae)},is(ae)))}),(ze>0||l)&&c.jsx("button",{type:"button",className:"nb-btn text-xs",onClick:()=>o(ae=>!ae),"aria-label":l?"收起更早项目":"显示更早项目",children:l?"收起更早":`含更早 (${ze})`}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-blue",onClick:()=>_(xq()),disabled:!i,"aria-label":"新建记忆",children:"+ 新建"}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-yellow",onClick:z,disabled:m||!i,"aria-label":"收敛去重",children:"收敛"})]})})(),R&&((Se=(ke=R.profile)==null?void 0:ke.topConcepts)!=null&&Se.length||(ue=(J=R.graph)==null?void 0:J.edges)!=null&&ue.length)?c.jsxs("section",{className:"nb-card flex flex-col gap-1",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] font-bold text-sm",children:"🌐 外部智能(agentmemory)"}),(Re=(Te=R.profile)==null?void 0:Te.topConcepts)!=null&&Re.length?c.jsxs("div",{className:"text-xs",children:[c.jsx("span",{className:"font-bold",children:"概念:"}),R.profile.topConcepts.slice(0,8).map(te=>c.jsx("span",{className:"nb-badge ml-1",children:te.concept},te.concept))]}):null,c.jsxs("div",{className:"text-xs opacity-70 font-[family-name:var(--font-mono)]",children:["知识图谱 ",((ce=(De=R.graph)==null?void 0:De.edges)==null?void 0:ce.length)??0," 条边 · 观测 ",((Ce=R.profile)==null?void 0:Ce.totalObservations)??0]})]}):null,S&&c.jsxs("section",{className:"nb-card flex flex-col gap-2",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] font-bold text-sm",children:S.id?"编辑记忆":"新建记忆"}),c.jsx("input",{className:"nb-input text-sm",value:S.title,onChange:te=>_({...S,title:te.target.value}),placeholder:"标题","aria-label":"标题"}),c.jsxs("div",{className:"flex gap-2 flex-wrap",children:[c.jsx("select",{className:"nb-input",value:S.category,onChange:te=>_({...S,category:te.target.value}),"aria-label":"类别",children:bq.map(te=>c.jsx("option",{value:te,children:te},te))}),c.jsx("input",{className:"nb-input flex-1 min-w-[160px] text-sm",value:S.tags,onChange:te=>_({...S,tags:te.target.value}),placeholder:"标签(逗号分隔)","aria-label":"标签"}),c.jsxs("label",{className:"flex items-center gap-1 text-sm",children:["显著度",c.jsx("input",{className:"nb-input w-16",type:"number",min:1,max:5,value:S.salience,onChange:te=>_({...S,salience:Number(te.target.value)}),"aria-label":"显著度"})]})]}),c.jsx("textarea",{className:"nb-input font-[family-name:var(--font-mono)] text-sm min-h-[120px]",value:S.body,onChange:te=>_({...S,body:te.target.value}),placeholder:"正文","aria-label":"正文"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"button",className:"nb-btn nb-btn-mint",onClick:Q,disabled:m||!S.title.trim()||!S.body.trim(),"aria-label":"保存",children:"保存"}),c.jsx("button",{type:"button",className:"nb-btn",onClick:()=>_(null),"aria-label":"取消",children:"取消"})]})]}),c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] font-bold text-sm",children:i?Bf(i):"条目"}),d.length===0&&c.jsx("div",{className:"nb-card text-sm opacity-60",children:"(无记忆)"}),d.map(te=>c.jsxs("div",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center gap-2 text-xs opacity-60 font-[family-name:var(--font-mono)] flex-wrap",children:[c.jsx("span",{className:"nb-badge",children:te.category}),c.jsxs("span",{children:["s",te.salience]}),c.jsx("span",{children:"·"}),c.jsx("span",{children:te.source}),te.tags.map(pe=>c.jsxs("span",{children:["#",pe]},pe))]}),c.jsx("div",{className:"font-bold text-sm mt-1",children:te.title}),c.jsx("div",{className:"text-sm mt-1 whitespace-pre-wrap opacity-80",children:te.body.slice(0,400)}),c.jsxs("div",{className:"flex gap-2 mt-2",children:[c.jsx("button",{type:"button",className:"nb-btn nb-btn-blue text-xs",onClick:()=>_({id:te.id,title:te.title,body:te.body,category:te.category,tags:te.tags.join(", "),salience:te.salience}),"aria-label":"编辑",children:"编辑"}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-purple text-xs",onClick:()=>T(te),"aria-label":"提升",children:"提升"}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-danger text-xs",onClick:()=>G(te.id),"aria-label":"删除",children:"删除"})]}),(M==null?void 0:M.id)===te.id&&c.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 border-t-[3px] border-[var(--color-text)] pt-2",children:[c.jsx("span",{className:"text-xs font-bold",children:"提升到:"}),ve.map(pe=>c.jsx("button",{type:"button",className:"nb-btn nb-btn-mint text-xs",onClick:()=>L(te,pe,!1),"aria-label":`复制到${Bf(pe)}`,children:Bf(pe)},is(pe))),ve.length===0&&c.jsx("span",{className:"text-xs opacity-60",children:"(无其它作用域)"}),c.jsx("button",{type:"button",className:"nb-btn text-xs",onClick:()=>T(null),"aria-label":"取消提升",children:"取消"})]})]},te.id))]})]})}async function wq(){return(await ft("/api/channels")).data??{console:{},adapters:[]}}async function kq(e){return(await Hb("/api/channels",e)).data}async function Eq(){return(await ft("/api/codex-proxy")).data}async function Sq(){return(await Lr("/api/codex-proxy/install")).data}async function Nq(e){const t=await fetch(`/api/codex-proxy?purgeAuth=${e?"1":"0"}`,{method:"DELETE",headers:{Accept:"application/json"}});if(!t.ok)throw new Error(`${t.status}: ${await t.text()}`);return(await t.json()).data}async function _q(){return(await Lr("/api/codex-proxy/auth/start")).data}async function jq(){await Lr("/api/codex-proxy/auth/cancel")}const zE=[{key:"memory",labelKey:"plugins.tab.memory"},{key:"channel",labelKey:"plugins.tab.channel"},{key:"model",labelKey:"plugins.tab.model"},{key:"tool",labelKey:"plugins.tab.tool"}];function Cq(){const e=Be(),[t,n]=j.useState("memory");return c.jsxs("div",{className:"flex flex-col gap-6 w-full",children:[c.jsxs("header",{children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold",children:e("plugins.h1")}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:e("plugins.desc")})]}),c.jsx("div",{role:"tablist","aria-label":e("plugins.h1"),className:"flex gap-2 flex-wrap",children:zE.map(i=>{const a=t===i.key;return c.jsx("button",{role:"tab","aria-selected":a,type:"button",onClick:()=>n(i.key),className:["px-4 bg-surface-soft-button py-2 rounded-xl font-bold text-sm border-2 transition-transform duration-150",a?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[3px_3px_0_var(--color-text)]":"border-[var(--color-text)] hover:-translate-x-px hover:-translate-y-px hover:shadow-[3px_3px_0_var(--color-text)]"].join(" "),children:e(i.labelKey)},i.key)})}),c.jsx("div",{role:"tabpanel",children:t==="memory"?c.jsx(Tq,{}):t==="channel"?c.jsx(Iq,{}):t==="model"?c.jsx(Mq,{}):c.jsx(Aq,{label:e(zE.find(i=>i.key===t).labelKey)})})]})}function Aq({label:e}){const t=Be();return c.jsx("section",{className:"nb-card",children:c.jsxs("p",{className:"text-[var(--color-text-muted)] text-sm",children:[e," — ",t("plugins.comingSoon")]})})}function Tq(){var k,v,N;const e=Be(),t=Gt(),{alert:n}=un(),i=Ye({queryKey:["system-memory"],queryFn:G3}),[a,l]=j.useState(null),[o,d]=j.useState(null);j.useEffect(()=>{i.data&&a===null&&(l(i.data.provider),d(i.data.url))},[i.data,a]);const f=a??((k=i.data)==null?void 0:k.provider)??"agentmemory",h=o??((v=i.data)==null?void 0:v.url)??"",g=i.data!=null&&(f!==i.data.provider||f==="custom"&&h!==i.data.url),m=E=>{const C=`system.memory.opt.${E}`;return e(C)},y=Ct({mutationFn:()=>V3(f,f==="custom"?h:""),onSuccess:()=>{t.invalidateQueries({queryKey:["system-memory"]}),t.invalidateQueries({queryKey:["system-env"]})},onError:E=>{n({title:e("system.memory.error"),body:E instanceof Error?E.message:String(E)})}}),b=((N=i.data)==null?void 0:N.options)??["none","builtin","agentmemory","custom"];return c.jsxs("section",{className:"nb-card",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-1",children:e("system.memory.title")}),c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] mb-3",children:e("system.memory.desc")}),c.jsxs("div",{className:"flex flex-col gap-3 max-w-md",children:[c.jsxs("label",{className:"flex flex-col gap-1 text-sm",children:[c.jsx("span",{className:"font-bold",children:e("system.memory.provider")}),c.jsx("select",{className:"nb-input",value:f,onChange:E=>l(E.target.value),"aria-label":e("system.memory.provider"),children:b.map(E=>c.jsx("option",{value:E,children:m(E)},E))})]}),f==="custom"&&c.jsxs("label",{className:"flex flex-col gap-1 text-sm",children:[c.jsx("span",{className:"font-bold",children:e("system.memory.url")}),c.jsx("input",{className:"nb-input font-[family-name:var(--font-mono)] text-xs",type:"text",value:h,onChange:E=>d(E.target.value),placeholder:e("system.memory.url.placeholder"),spellCheck:!1,"aria-label":e("system.memory.url")})]}),c.jsx("div",{className:"flex justify-end",children:c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 12px",fontSize:12},onClick:()=>y.mutate(),disabled:!g||y.isPending,type:"button","aria-label":e("system.memory.save.aria"),children:[y.isPending?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(Rr,{size:12,strokeWidth:3}),y.isSuccess&&!g?e("system.memory.saved"):e("system.memory.save")]})})]})]})}function Mq(){var N,E,C;const e=Gt(),{alert:t,confirm:n}=un(),i=Ye({queryKey:["providers"],queryFn:cx}),l=(N=Ye({queryKey:["system-agents"],queryFn:Kb}).data)==null?void 0:N.agents,[o,d]=j.useState(null),f=Ct({mutationFn:()=>h4(o.kind,o.entry),onSuccess:()=>{d(null),e.invalidateQueries({queryKey:["providers"]})},onError:S=>void t({title:"保存失败",body:S instanceof Error?S.message:String(S)})}),h=Ct({mutationFn:S=>p4(S.kind,S.id),onSuccess:()=>void e.invalidateQueries({queryKey:["providers"]}),onError:S=>void t({title:"删除失败",body:S instanceof Error?S.message:String(S)})}),g=Ct({mutationFn:S=>Y3(S),onSuccess:()=>void e.invalidateQueries({queryKey:["system-agents"]}),onError:S=>void t({title:"设默认失败",body:S instanceof Error?S.message:String(S)})}),m=(S,_,M)=>{if(!l)return!1;const T=S==="anthropic"?l.worker:l.reviewer;return(T.providerId||"official")===_&&T.model===M},y=(S,_,M)=>{if(!l)return;let T;if(S==="anthropic"){const R={...l.worker,model:M};_==="official"?delete R.providerId:R.providerId=_,T={...l,worker:R}}else T={...l,reviewer:{...l.reviewer,providerId:_,model:M}};g.mutate(T)},b=[{kind:"anthropic",title:"Anthropic 兼容(worker / claude)",items:((E=i.data)==null?void 0:E.anthropic)??[]},{kind:"openai",title:"OpenAI 兼容(reviewer / openai agent)",items:((C=i.data)==null?void 0:C.openai)??[]}],k=S=>d({kind:S,isNew:!0,entry:{id:"",name:"",baseUrl:"",apiKey:"",models:[]}}),v=(S,_)=>d({kind:S,isNew:!1,entry:{id:_.id,name:_.name,baseUrl:_.baseUrl,apiKey:"",models:_.models}});return c.jsxs("section",{className:"nb-card",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-1",children:"模型 API 端点"}),c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] mb-4",children:"本地官方订阅(已登录验证)自动置顶,不可编辑;下方可增删第三方兼容端点。**点模型标签设为默认**(anthropic→worker / openai→监工);✓ = 当前默认。"}),c.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-5",children:b.map(S=>c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"font-bold text-sm",children:S.title}),c.jsxs("button",{className:"nb-btn",style:{padding:"4px 10px",fontSize:12},type:"button",onClick:()=>k(S.kind),"aria-label":`添加 ${S.title} 端点`,children:[c.jsx(pi,{size:12,strokeWidth:3})," 添加"]})]}),S.items.length===0&&c.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:"(无端点)"}),S.items.map(_=>_.id==="codex-proxy"?c.jsx(Oq,{isDefault:M=>m(S.kind,_.id,M),pickDefault:M=>y(S.kind,_.id,M),setDefaultPending:g.isPending},_.id):c.jsxs("div",{className:["rounded-lg px-3 py-2 border-2",(_.builtin,"border-[var(--color-text)]")].join(" "),children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold text-sm",children:_.id}),c.jsxs("span",{className:"text-[var(--color-text-muted)] text-sm",children:[" · ",_.name]}),_.builtin?c.jsxs("div",{className:"text-xs text-[var(--color-text-muted)] truncate",children:["本地订阅",_.detail?` · ${_.detail}`:""," · 已验证可用"]}):c.jsxs("div",{className:"text-xs text-[var(--color-text-muted)] truncate",children:[_.baseUrl," · key ",_.hasKey?_.apiKey:"未设置"]})]}),_.builtin?c.jsx("span",{className:"shrink-0 text-[10px] font-bold px-2 py-0.5 rounded-md border-2 border-[var(--color-text)] bg-[var(--color-accent-yellow)]",children:"内置"}):c.jsxs("div",{className:"flex gap-1 shrink-0",children:[c.jsx("button",{className:"nb-btn",style:{padding:"4px 8px"},type:"button",onClick:()=>v(S.kind,_),"aria-label":`编辑 ${_.id}`,children:c.jsx(GL,{size:12,strokeWidth:3})}),c.jsx("button",{className:"nb-btn nb-btn-danger",style:{padding:"4px 8px"},type:"button",onClick:async()=>{await n({title:"删除端点",body:`删除 ${_.id}?`,danger:!0})&&h.mutate({kind:S.kind,id:_.id})},"aria-label":`删除 ${_.id}`,children:c.jsx(fr,{size:12,strokeWidth:3})})]})]}),_.models.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:_.models.map(M=>{const T=m(S.kind,_.id,M);return c.jsxs("button",{type:"button",onClick:()=>y(S.kind,_.id,M),disabled:g.isPending,"aria-pressed":T,className:["px-2 py-0.5 rounded-md text-xs font-[family-name:var(--font-mono)] border-2 border-[var(--color-text)]",T?"bg-[var(--color-accent-mint)] font-bold":" hover:bg-[var(--color-bg-cream)]"].join(" "),title:T?"当前默认":"设为默认",children:[M,T?" ✓":""]},M)})})]},_.id))]},S.kind))}),o&&c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",onClick:()=>d(null),children:c.jsx("div",{onClick:S=>S.stopPropagation(),children:c.jsx(Dq,{state:o,onChange:S=>d({...o,entry:S}),onCancel:()=>d(null),onSave:()=>f.mutate(),saving:f.isPending})})})]})}function Dq({state:e,onChange:t,onCancel:n,onSave:i,saving:a}){const l=e.entry,o=f=>t({...l,...f}),d=/^[a-zA-Z0-9_-]+$/.test(l.id)&&l.name.trim()&&l.baseUrl.trim();return c.jsxs("div",{className:"border-[3px] border-[var(--color-text)] rounded-2xl p-6 bg-[var(--color-bg-cream)] shadow-[6px_6px_0_var(--color-text)] flex flex-col gap-4 w-[min(92vw,640px)] max-h-[88vh] overflow-y-auto",children:[c.jsxs("span",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:[e.isNew?"新增端点":`编辑 ${l.id}`,c.jsxs("span",{className:"text-[var(--color-text-muted)] text-sm font-normal",children:["(",e.kind,")"]})]}),c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:["id(英数 _ -)",c.jsx("input",{className:"nb-input font-[family-name:var(--font-mono)]",value:l.id,disabled:!e.isNew,onChange:f=>o({id:f.target.value}),placeholder:"如 my-openai",spellCheck:!1})]}),c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:["名称",c.jsx("input",{className:"nb-input",value:l.name,onChange:f=>o({name:f.target.value}),placeholder:"显示名"})]})]}),c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:["Base URL",c.jsx("input",{className:"nb-input font-[family-name:var(--font-mono)] text-sm",value:l.baseUrl,onChange:f=>o({baseUrl:f.target.value}),placeholder:"https://api.example.com/v1",spellCheck:!1})]}),c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:["API Key",!e.isNew&&"(留空=保留)",c.jsx("input",{className:"nb-input font-[family-name:var(--font-mono)] text-sm",type:"password",value:l.apiKey??"",onChange:f=>o({apiKey:f.target.value}),placeholder:e.isNew?"sk-...":"••••(留空不改)",spellCheck:!1})]}),c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:["Models(逗号或换行分隔)",c.jsx("textarea",{className:"nb-input font-[family-name:var(--font-mono)] text-sm",rows:5,value:l.models.join(", "),onChange:f=>o({models:f.target.value.split(/[,\n]/).map(h=>h.trim()).filter(Boolean)}),placeholder:"gpt-5.4, gpt-4o",spellCheck:!1})]}),c.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[c.jsx("button",{className:"nb-btn",style:{padding:"8px 16px"},type:"button",onClick:n,children:"取消"}),c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"8px 16px"},type:"button",disabled:!d||a,onClick:i,children:[a?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(Rr,{size:14,strokeWidth:3})," 保存"]})]})]})}function Oq({isDefault:e,pickDefault:t,setDefaultPending:n}){const i=Gt(),{alert:a,confirm:l}=un(),[o,d]=j.useState(!1),[f,h]=j.useState(null),[g,m]=j.useState(!1),[y,b]=j.useState(!1),[k,v]=j.useState(!1),E=Ye({queryKey:["codex-proxy"],queryFn:Eq,refetchInterval:o?3e3:!1}).data;j.useEffect(()=>{o&&(E!=null&&E.authed)&&(d(!1),h(null),i.invalidateQueries({queryKey:["codex-proxy"]}))},[o,E==null?void 0:E.authed,i]);const C=Ct({mutationFn:Sq,onSuccess:$=>{i.invalidateQueries({queryKey:["codex-proxy"]}),i.invalidateQueries({queryKey:["providers"]}),$.ok||a({title:"安装失败",body:($.output||"未知错误").slice(-600)})},onError:$=>void a({title:"安装失败",body:$ instanceof Error?$.message:String($)})}),S=Ct({mutationFn:$=>Nq($),onSuccess:$=>{m(!1),b(!1),i.invalidateQueries({queryKey:["codex-proxy"]}),i.invalidateQueries({queryKey:["providers"]}),i.invalidateQueries({queryKey:["system-agents"]}),$.ok||a({title:"卸载未完成",body:$.note??"删除失败(可能需 sudo)"})},onError:$=>void a({title:"卸载失败",body:$ instanceof Error?$.message:String($)})}),_=async()=>{await l({title:"安装 claude-code-proxy",body:"将运行官方安装脚本(curl … install.sh | bash),下载预编译二进制到 ~/.local/bin。继续?"})&&C.mutate()},M=async()=>{d(!0),h(null);try{const $=await _q();h($)}catch($){d(!1),a({title:"订阅失败",body:$ instanceof Error?$.message:String($)})}},T=()=>{jq(),d(!1),h(null)},R=C.isPending||(E==null?void 0:E.installing),O=k&&(E!=null&&E.models.all.length)?E.models.all:(E==null?void 0:E.models.curated)??[];return c.jsxs("div",{className:"rounded-lg px-3 py-2 border-2 border-[var(--color-text)]",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold text-sm",children:"codex-proxy"}),c.jsx("span",{className:"text-[var(--color-text-muted)] text-sm",children:" · ChatGPT 订阅"}),c.jsx("div",{className:"text-xs text-[var(--color-text-muted)] truncate",children:E?E.binInstalled?E.authed?`已订阅${E.account?` · ${E.account.slice(0,8)}…`:""} · worker 出 GPT`:"已安装 · 未订阅":"未安装 claude-code-proxy":"加载中…"})]}),(E==null?void 0:E.binInstalled)&&c.jsx("button",{className:"nb-btn nb-btn-danger shrink-0",style:{padding:"4px 8px"},type:"button",onClick:()=>m(!0),"aria-label":"卸载 codex-proxy",children:c.jsx(fr,{size:12,strokeWidth:3})})]}),c.jsx("div",{className:"mt-2",children:E?E.binInstalled?E.authed?c.jsxs("div",{className:"flex flex-wrap gap-1.5 items-center",children:[O.map($=>{const I=e($);return c.jsxs("button",{type:"button",onClick:()=>t($),disabled:n,"aria-pressed":I,className:["px-2 py-0.5 rounded-md text-xs font-[family-name:var(--font-mono)] border-2 border-[var(--color-text)]",I?"bg-[var(--color-accent-mint)] font-bold":" hover:bg-[var(--color-bg-cream)]"].join(" "),title:I?"当前默认":"设为 worker 默认",children:[$,I?" ✓":""]},$)}),E.models.all.length>E.models.curated.length&&c.jsx("button",{type:"button",className:"text-xs text-[var(--color-text-muted)] underline",onClick:()=>v($=>!$),children:k?"收起":`显示全部(${E.models.all.length})`})]}):c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"4px 12px",fontSize:12},type:"button",onClick:M,children:[c.jsx(AL,{size:12,strokeWidth:3})," 订阅(授权 ChatGPT)"]}):c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"4px 12px",fontSize:12},type:"button",disabled:!!R,onClick:_,children:[R?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(Uh,{size:12,strokeWidth:3}),R?" 安装中…":" 安装插件"]}):c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin text-[var(--color-text-muted)]"})}),o&&c.jsxs(PE,{onClose:T,children:[c.jsx("span",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:"订阅 ChatGPT(设备码授权)"}),f!=null&&f.verificationUrl&&(f!=null&&f.userCode)?c.jsxs("div",{className:"flex flex-col gap-3 text-sm",children:[c.jsxs("div",{children:["① 打开"," ",c.jsxs("a",{href:f.verificationUrl,target:"_blank",rel:"noreferrer",className:"font-bold underline inline-flex items-center gap-1",children:[f.verificationUrl," ",c.jsx(JR,{size:12,strokeWidth:3})]})]}),c.jsxs("div",{children:["② 输入验证码:",c.jsx("code",{className:"ml-1 px-2 py-0.5 rounded-md border-2 border-[var(--color-text)] bg-[var(--color-accent-yellow)] font-bold font-[family-name:var(--font-mono)]",children:f.userCode})]}),c.jsx("div",{children:"③ 在浏览器完成授权"}),c.jsxs("div",{className:"flex items-center gap-2 text-[var(--color-text-muted)]",children:[c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"})," 等待授权…(完成后自动刷新)"]})]}):c.jsxs("div",{className:"flex flex-col gap-2 text-sm text-[var(--color-text-muted)]",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"})," 正在获取设备码…"]}),c.jsxs("div",{children:["若长时间无响应,可在终端运行 ",c.jsx("code",{className:"font-[family-name:var(--font-mono)]",children:"sps codex-proxy auth"}),",完成后此处自动刷新。"]})]}),c.jsx("div",{className:"flex justify-end pt-1",children:c.jsx("button",{className:"nb-btn",style:{padding:"6px 14px"},type:"button",onClick:T,children:"取消"})})]}),g&&c.jsxs(PE,{onClose:()=>m(!1),children:[c.jsx("span",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:"卸载 claude-code-proxy"}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"停止 proxy 并删除二进制。默认保留授权(重装免再授权)。"}),c.jsxs("label",{className:"flex items-center gap-2 text-sm font-bold",children:[c.jsx("input",{type:"checkbox",checked:y,onChange:$=>b($.target.checked)}),"同时清除授权(~/.config/claude-code-proxy)"]}),c.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[c.jsx("button",{className:"nb-btn",style:{padding:"6px 14px"},type:"button",onClick:()=>m(!1),children:"取消"}),c.jsxs("button",{className:"nb-btn nb-btn-danger",style:{padding:"6px 14px"},type:"button",disabled:S.isPending,onClick:()=>S.mutate(y),children:[S.isPending?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(fr,{size:14,strokeWidth:3})," 卸载"]})]})]})]})}function PE({children:e,onClose:t}){return c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",onClick:t,children:c.jsx("div",{className:"border-[3px] border-[var(--color-text)] rounded-2xl p-6 bg-[var(--color-bg-cream)] shadow-[6px_6px_0_var(--color-text)] flex flex-col gap-4 w-[min(92vw,520px)]",onClick:n=>n.stopPropagation(),children:e})})}const Rq=["telegram","dingtalk","matrix","slack","discord","feishu"],gu={telegram:"Telegram",dingtalk:"钉钉 (Stream)",matrix:"Matrix",slack:"Slack",discord:"Discord",feishu:"飞书 / Lark"},Lq={telegram:[{key:"token",label:"Bot Token(@BotFather)",type:"password",placeholder:"123456:ABC-..."},{key:"allowedChatIds",label:"允许的 Chat ID(白名单,空=全放)",type:"list",placeholder:"逗号/换行分隔"}],dingtalk:[{key:"clientId",label:"Client ID(AppKey)",type:"text"},{key:"clientSecret",label:"Client Secret(AppSecret)",type:"password"},{key:"allowedConversations",label:"允许的会话 ID(白名单,空=全放)",type:"list"}],matrix:[{key:"homeserver",label:"Homeserver URL",type:"text",placeholder:"https://matrix.org"},{key:"accessToken",label:"Access Token",type:"password"},{key:"allowedRooms",label:"允许的 Room ID(白名单,空=全放)",type:"list"}],slack:[{key:"appToken",label:"App Token(xapp-,Socket Mode)",type:"password",placeholder:"xapp-..."},{key:"botToken",label:"Bot Token(xoxb-)",type:"password",placeholder:"xoxb-..."},{key:"allowedChannels",label:"允许的 Channel(白名单,空=全放)",type:"list"}],discord:[{key:"token",label:"Bot Token",type:"password"},{key:"allowedChannels",label:"允许的 Channel ID(白名单,空=全放)",type:"list"}],feishu:[{key:"appId",label:"App ID",type:"text"},{key:"appSecret",label:"App Secret",type:"password"},{key:"verificationToken",label:"Verification Token",type:"text"},{key:"encryptKey",label:"Encrypt Key(设了则事件 AES 解密)",type:"password"},{key:"port",label:"本机监听端口(默认 9800)",type:"number",placeholder:"9800"},{key:"path",label:"监听路径(默认 /feishu)",type:"text",placeholder:"/feishu"},{key:"allowedChats",label:"允许的 chat_id(白名单,空=全放)",type:"list"}]};function Iq(){var k,v,N;const e=Gt(),{alert:t}=un(),n=Ye({queryKey:["channels"],queryFn:wq}),[i,a]=j.useState(null),[l,o]=j.useState({type:"console"});j.useEffect(()=>{n.data&&!i&&a({console:n.data.console??{},adapters:n.data.adapters??[]})},[n.data,i]);const d=Ct({mutationFn:()=>kq(i),onSuccess:E=>{a({console:E.console??{},adapters:E.adapters??[]}),e.invalidateQueries({queryKey:["channels"]})},onError:E=>void t({title:"保存失败",body:E instanceof Error?E.message:String(E)})});if(!i)return c.jsx("section",{className:"nb-card",children:c.jsxs("p",{className:"text-sm text-[var(--color-text-muted)] flex items-center gap-2",children:[c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"})," 加载频道配置…"]})});const f=i.adapters??[],h=JSON.stringify(i)!==JSON.stringify({console:((k=n.data)==null?void 0:k.console)??{},adapters:((v=n.data)==null?void 0:v.adapters)??[]}),g=E=>{const C=[...f,{kind:E,enabled:!0}];a({...i,adapters:C}),o({type:"adapter",index:C.length-1})},m=E=>{const C=f.filter((S,_)=>_!==E);a({...i,adapters:C}),o({type:"console"})},y=(E,C)=>{const S=f.map((_,M)=>M===E?{..._,...C}:_);a({...i,adapters:S})},b=E=>a({...i,console:{...i.console,...E}});return c.jsxs("section",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3 mb-1",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold",children:"频道(IM 网关)"}),c.jsxs("p",{className:"text-xs text-[var(--color-text-muted)] mt-1",children:["接入 Telegram / 钉钉 / 飞书 / Slack / Discord / Matrix。左侧选频道,右侧改设置。保存后 ",c.jsx("code",{className:"font-[family-name:var(--font-mono)]",children:"sps im"})," 重启生效。"]})]}),c.jsxs("button",{className:"nb-btn nb-btn-primary shrink-0",style:{padding:"8px 16px"},type:"button",disabled:!h||d.isPending,onClick:()=>d.mutate(),"aria-label":"保存频道配置",children:[d.isPending?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(Rr,{size:14,strokeWidth:3})," 保存"]})]}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[220px_1fr] gap-5 mt-4",children:[c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx(BE,{label:"console 桥接",sub:((N=i.console)==null?void 0:N.url)||"未配置",active:l.type==="console",onClick:()=>o({type:"console"})}),c.jsx("div",{className:"h-px bg-[var(--color-text)] opacity-20 my-1"}),f.length===0&&c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] px-1",children:"(无频道)"}),f.map((E,C)=>c.jsx(BE,{label:gu[E.kind]??E.kind,sub:E.enabled===!1?"已停用":"启用",active:l.type==="adapter"&&l.index===C,onClick:()=>o({type:"adapter",index:C})},C)),c.jsxs("div",{className:"mt-2",children:[c.jsx("span",{className:"text-xs font-bold text-[var(--color-text-muted)]",children:"添加频道"}),c.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1.5",children:Rq.map(E=>c.jsxs("button",{className:"nb-btn",style:{padding:"4px 8px",fontSize:12},type:"button",onClick:()=>g(E),"aria-label":`添加 ${gu[E]} 频道`,children:[c.jsx(pi,{size:11,strokeWidth:3})," ",gu[E]]},E))})]})]}),c.jsx("div",{className:"border-2 bg-surface-input border-[var(--color-text)] rounded-xl p-4 bg-[var(--color-bg-cream)]",children:(()=>{if(l.type!=="adapter")return c.jsx($E,{console:i.console??{},onChange:b});const E=f[l.index];if(!E)return c.jsx($E,{console:i.console??{},onChange:b});const C=l.index;return c.jsx(zq,{adapter:E,onChange:S=>y(C,S),onRemove:()=>m(C)})})()})]})]})}function BE({label:e,sub:t,active:n,onClick:i}){return c.jsxs("button",{type:"button",onClick:i,"aria-pressed":n,className:["text-left rounded-lg px-3 py-2 border-2 border-[var(--color-text)] transition-transform duration-150",n?"bg-[var(--color-accent-mint)] shadow-[3px_3px_0_var(--color-text)]":"bg-white hover:-translate-x-px hover:-translate-y-px hover:shadow-[3px_3px_0_var(--color-text)]"].join(" "),children:[c.jsx("div",{className:"font-bold text-sm",children:e}),c.jsx("div",{className:"text-xs text-[var(--color-text-muted)] truncate font-[family-name:var(--font-mono)]",children:t})]})}function $E({console:e,onChange:t}){return c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:"console 桥接"}),c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] mt-1",children:"IM 纯文本消息桥接到项目 agent 对话。设了 URL 才启用桥接;token 为 console 鉴权令牌。"})]}),c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:["Console URL",c.jsx("input",{className:"nb-input font-[family-name:var(--font-mono)] text-sm",value:e.url??"",onChange:n=>t({url:n.target.value}),placeholder:"http://localhost:4321",spellCheck:!1})]}),c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:["Console Token(SPS_CONSOLE_TOKEN)",c.jsx("input",{className:"nb-input font-[family-name:var(--font-mono)] text-sm",type:"password",value:e.token??"",onChange:n=>t({token:n.target.value}),placeholder:"鉴权令牌(可空)",spellCheck:!1})]}),c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:["对话后端",c.jsxs("select",{className:"nb-input",value:e.agentKind??"claude",onChange:n=>t({agentKind:n.target.value}),children:[c.jsx("option",{value:"claude",children:"claude"}),c.jsx("option",{value:"openai",children:"openai"})]})]})]})}function zq({adapter:e,onChange:t,onRemove:n}){const{confirm:i}=un(),a=Lq[e.kind]??[],l=e.enabled!==!1;return c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{className:"flex items-start justify-between gap-2",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:gu[e.kind]??e.kind}),c.jsxs("span",{className:"text-[var(--color-text-muted)] text-sm font-[family-name:var(--font-mono)]",children:[" · ",e.kind]})]}),c.jsxs("button",{className:"nb-btn nb-btn-danger shrink-0",style:{padding:"4px 10px",fontSize:12},type:"button",onClick:async()=>{await i({title:"删除频道",body:`删除 ${gu[e.kind]??e.kind} 频道?`,danger:!0})&&n()},"aria-label":"删除频道",children:[c.jsx(fr,{size:12,strokeWidth:3})," 删除"]})]}),c.jsxs("label",{className:"flex items-center gap-2 text-sm font-bold",children:[c.jsx("input",{type:"checkbox",checked:l,onChange:o=>t({enabled:o.target.checked})}),"启用此频道"]}),a.map(o=>c.jsx(Pq,{spec:o,value:e[o.key],onChange:d=>t({[o.key]:d})},o.key))]})}function Pq({spec:e,value:t,onChange:n}){if(e.type==="list"){const i=Array.isArray(t)?t.map(String):[];return c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:[e.label,c.jsx("textarea",{className:"nb-input font-[family-name:var(--font-mono)] text-sm",rows:2,value:i.join(", "),onChange:a=>{const l=a.target.value.split(/[,\n]/).map(o=>o.trim()).filter(Boolean);n(l.length?l:void 0)},placeholder:e.placeholder,spellCheck:!1})]})}return c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:[e.label,c.jsx("input",{className:"nb-input font-[family-name:var(--font-mono)] text-sm",type:e.type==="password"?"password":"text",value:t==null?"":String(t),onChange:i=>{const a=i.target.value;e.type==="number"?n(a.trim()===""?void 0:Number(a)):n(a===""?void 0:a)},placeholder:e.placeholder,spellCheck:!1})]})}function Nn(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,i;n<e.length;n++)(i=Nn(e[n]))!==""&&(t+=(t&&" ")+i);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Bq={value:()=>{}};function cp(){for(var e=0,t=arguments.length,n={},i;e<t;++e){if(!(i=arguments[e]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new ih(n)}function ih(e){this._=e}function $q(e,t){return e.trim().split(/^|\s+/).map(function(n){var i="",a=n.indexOf(".");if(a>=0&&(i=n.slice(a+1),n=n.slice(0,a)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}ih.prototype=cp.prototype={constructor:ih,on:function(e,t){var n=this._,i=$q(e+"",n),a,l=-1,o=i.length;if(arguments.length<2){for(;++l<o;)if((a=(e=i[l]).type)&&(a=Uq(n[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<o;)if(a=(e=i[l]).type)n[a]=UE(n[a],e.name,t);else if(t==null)for(a in n)n[a]=UE(n[a],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ih(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var n=new Array(a),i=0,a,l;i<a;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],i=0,a=l.length;i<a;++i)l[i].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],a=0,l=i.length;a<l;++a)i[a].value.apply(t,n)}};function Uq(e,t){for(var n=0,i=e.length,a;n<i;++n)if((a=e[n]).name===t)return a.value}function UE(e,t,n){for(var i=0,a=e.length;i<a;++i)if(e[i].name===t){e[i]=Bq,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}var cb="http://www.w3.org/1999/xhtml";const FE={svg:"http://www.w3.org/2000/svg",xhtml:cb,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function up(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),FE.hasOwnProperty(t)?{space:FE[t],local:e}:e}function Fq(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===cb&&t.documentElement.namespaceURI===cb?t.createElement(e):t.createElementNS(n,e)}}function qq(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Jj(e){var t=up(e);return(t.local?qq:Fq)(t)}function Hq(){}function Px(e){return e==null?Hq:function(){return this.querySelector(e)}}function Kq(e){typeof e!="function"&&(e=Px(e));for(var t=this._groups,n=t.length,i=new Array(n),a=0;a<n;++a)for(var l=t[a],o=l.length,d=i[a]=new Array(o),f,h,g=0;g<o;++g)(f=l[g])&&(h=e.call(f,f.__data__,g,l))&&("__data__"in f&&(h.__data__=f.__data__),d[g]=h);return new Ci(i,this._parents)}function Gq(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Vq(){return[]}function eC(e){return e==null?Vq:function(){return this.querySelectorAll(e)}}function Yq(e){return function(){return Gq(e.apply(this,arguments))}}function Qq(e){typeof e=="function"?e=Yq(e):e=eC(e);for(var t=this._groups,n=t.length,i=[],a=[],l=0;l<n;++l)for(var o=t[l],d=o.length,f,h=0;h<d;++h)(f=o[h])&&(i.push(e.call(f,f.__data__,h,o)),a.push(f));return new Ci(i,a)}function tC(e){return function(){return this.matches(e)}}function nC(e){return function(t){return t.matches(e)}}var Wq=Array.prototype.find;function Xq(e){return function(){return Wq.call(this.children,e)}}function Zq(){return this.firstElementChild}function Jq(e){return this.select(e==null?Zq:Xq(typeof e=="function"?e:nC(e)))}var eH=Array.prototype.filter;function tH(){return Array.from(this.children)}function nH(e){return function(){return eH.call(this.children,e)}}function iH(e){return this.selectAll(e==null?tH:nH(typeof e=="function"?e:nC(e)))}function rH(e){typeof e!="function"&&(e=tC(e));for(var t=this._groups,n=t.length,i=new Array(n),a=0;a<n;++a)for(var l=t[a],o=l.length,d=i[a]=[],f,h=0;h<o;++h)(f=l[h])&&e.call(f,f.__data__,h,l)&&d.push(f);return new Ci(i,this._parents)}function iC(e){return new Array(e.length)}function aH(){return new Ci(this._enter||this._groups.map(iC),this._parents)}function _h(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}_h.prototype={constructor:_h,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function sH(e){return function(){return e}}function lH(e,t,n,i,a,l){for(var o=0,d,f=t.length,h=l.length;o<h;++o)(d=t[o])?(d.__data__=l[o],i[o]=d):n[o]=new _h(e,l[o]);for(;o<f;++o)(d=t[o])&&(a[o]=d)}function oH(e,t,n,i,a,l,o){var d,f,h=new Map,g=t.length,m=l.length,y=new Array(g),b;for(d=0;d<g;++d)(f=t[d])&&(y[d]=b=o.call(f,f.__data__,d,t)+"",h.has(b)?a[d]=f:h.set(b,f));for(d=0;d<m;++d)b=o.call(e,l[d],d,l)+"",(f=h.get(b))?(i[d]=f,f.__data__=l[d],h.delete(b)):n[d]=new _h(e,l[d]);for(d=0;d<g;++d)(f=t[d])&&h.get(y[d])===f&&(a[d]=f)}function cH(e){return e.__data__}function uH(e,t){if(!arguments.length)return Array.from(this,cH);var n=t?oH:lH,i=this._parents,a=this._groups;typeof e!="function"&&(e=sH(e));for(var l=a.length,o=new Array(l),d=new Array(l),f=new Array(l),h=0;h<l;++h){var g=i[h],m=a[h],y=m.length,b=dH(e.call(g,g&&g.__data__,h,i)),k=b.length,v=d[h]=new Array(k),N=o[h]=new Array(k),E=f[h]=new Array(y);n(g,m,v,N,E,b,t);for(var C=0,S=0,_,M;C<k;++C)if(_=v[C]){for(C>=S&&(S=C+1);!(M=N[S])&&++S<k;);_._next=M||null}}return o=new Ci(o,i),o._enter=d,o._exit=f,o}function dH(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function fH(){return new Ci(this._exit||this._groups.map(iC),this._parents)}function hH(e,t,n){var i=this.enter(),a=this,l=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(a=t(a),a&&(a=a.selection())),n==null?l.remove():n(l),i&&a?i.merge(a).order():a}function pH(e){for(var t=e.selection?e.selection():e,n=this._groups,i=t._groups,a=n.length,l=i.length,o=Math.min(a,l),d=new Array(a),f=0;f<o;++f)for(var h=n[f],g=i[f],m=h.length,y=d[f]=new Array(m),b,k=0;k<m;++k)(b=h[k]||g[k])&&(y[k]=b);for(;f<a;++f)d[f]=n[f];return new Ci(d,this._parents)}function mH(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var i=e[t],a=i.length-1,l=i[a],o;--a>=0;)(o=i[a])&&(l&&o.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(o,l),l=o);return this}function gH(e){e||(e=yH);function t(m,y){return m&&y?e(m.__data__,y.__data__):!m-!y}for(var n=this._groups,i=n.length,a=new Array(i),l=0;l<i;++l){for(var o=n[l],d=o.length,f=a[l]=new Array(d),h,g=0;g<d;++g)(h=o[g])&&(f[g]=h);f.sort(t)}return new Ci(a,this._parents).order()}function yH(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function bH(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function xH(){return Array.from(this)}function vH(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],a=0,l=i.length;a<l;++a){var o=i[a];if(o)return o}return null}function wH(){let e=0;for(const t of this)++e;return e}function kH(){return!this.node()}function EH(e){for(var t=this._groups,n=0,i=t.length;n<i;++n)for(var a=t[n],l=0,o=a.length,d;l<o;++l)(d=a[l])&&e.call(d,d.__data__,l,a);return this}function SH(e){return function(){this.removeAttribute(e)}}function NH(e){return function(){this.removeAttributeNS(e.space,e.local)}}function _H(e,t){return function(){this.setAttribute(e,t)}}function jH(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function CH(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function AH(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function TH(e,t){var n=up(e);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((t==null?n.local?NH:SH:typeof t=="function"?n.local?AH:CH:n.local?jH:_H)(n,t))}function rC(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function MH(e){return function(){this.style.removeProperty(e)}}function DH(e,t,n){return function(){this.style.setProperty(e,t,n)}}function OH(e,t,n){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,n)}}function RH(e,t,n){return arguments.length>1?this.each((t==null?MH:typeof t=="function"?OH:DH)(e,t,n??"")):Fo(this.node(),e)}function Fo(e,t){return e.style.getPropertyValue(t)||rC(e).getComputedStyle(e,null).getPropertyValue(t)}function LH(e){return function(){delete this[e]}}function IH(e,t){return function(){this[e]=t}}function zH(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function PH(e,t){return arguments.length>1?this.each((t==null?LH:typeof t=="function"?zH:IH)(e,t)):this.node()[e]}function aC(e){return e.trim().split(/^|\s+/)}function Bx(e){return e.classList||new sC(e)}function sC(e){this._node=e,this._names=aC(e.getAttribute("class")||"")}sC.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function lC(e,t){for(var n=Bx(e),i=-1,a=t.length;++i<a;)n.add(t[i])}function oC(e,t){for(var n=Bx(e),i=-1,a=t.length;++i<a;)n.remove(t[i])}function BH(e){return function(){lC(this,e)}}function $H(e){return function(){oC(this,e)}}function UH(e,t){return function(){(t.apply(this,arguments)?lC:oC)(this,e)}}function FH(e,t){var n=aC(e+"");if(arguments.length<2){for(var i=Bx(this.node()),a=-1,l=n.length;++a<l;)if(!i.contains(n[a]))return!1;return!0}return this.each((typeof t=="function"?UH:t?BH:$H)(n,t))}function qH(){this.textContent=""}function HH(e){return function(){this.textContent=e}}function KH(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function GH(e){return arguments.length?this.each(e==null?qH:(typeof e=="function"?KH:HH)(e)):this.node().textContent}function VH(){this.innerHTML=""}function YH(e){return function(){this.innerHTML=e}}function QH(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function WH(e){return arguments.length?this.each(e==null?VH:(typeof e=="function"?QH:YH)(e)):this.node().innerHTML}function XH(){this.nextSibling&&this.parentNode.appendChild(this)}function ZH(){return this.each(XH)}function JH(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function e7(){return this.each(JH)}function t7(e){var t=typeof e=="function"?e:Jj(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function n7(){return null}function i7(e,t){var n=typeof e=="function"?e:Jj(e),i=t==null?n7:typeof t=="function"?t:Px(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function r7(){var e=this.parentNode;e&&e.removeChild(this)}function a7(){return this.each(r7)}function s7(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function l7(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function o7(e){return this.select(e?l7:s7)}function c7(e){return arguments.length?this.property("__data__",e):this.node().__data__}function u7(e){return function(t){e.call(this,t,this.__data__)}}function d7(e){return e.trim().split(/^|\s+/).map(function(t){var n="",i=t.indexOf(".");return i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),{type:t,name:n}})}function f7(e){return function(){var t=this.__on;if(t){for(var n=0,i=-1,a=t.length,l;n<a;++n)l=t[n],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++i]=l;++i?t.length=i:delete this.__on}}}function h7(e,t,n){return function(){var i=this.__on,a,l=u7(t);if(i){for(var o=0,d=i.length;o<d;++o)if((a=i[o]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=l,a.options=n),a.value=t;return}}this.addEventListener(e.type,l,n),a={type:e.type,name:e.name,value:t,listener:l,options:n},i?i.push(a):this.__on=[a]}}function p7(e,t,n){var i=d7(e+""),a,l=i.length,o;if(arguments.length<2){var d=this.node().__on;if(d){for(var f=0,h=d.length,g;f<h;++f)for(a=0,g=d[f];a<l;++a)if((o=i[a]).type===g.type&&o.name===g.name)return g.value}return}for(d=t?h7:f7,a=0;a<l;++a)this.each(d(i[a],t,n));return this}function cC(e,t,n){var i=rC(e),a=i.CustomEvent;typeof a=="function"?a=new a(t,n):(a=i.document.createEvent("Event"),n?(a.initEvent(t,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function m7(e,t){return function(){return cC(this,e,t)}}function g7(e,t){return function(){return cC(this,e,t.apply(this,arguments))}}function y7(e,t){return this.each((typeof t=="function"?g7:m7)(e,t))}function*b7(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],a=0,l=i.length,o;a<l;++a)(o=i[a])&&(yield o)}var uC=[null];function Ci(e,t){this._groups=e,this._parents=t}function nd(){return new Ci([[document.documentElement]],uC)}function x7(){return this}Ci.prototype=nd.prototype={constructor:Ci,select:Kq,selectAll:Qq,selectChild:Jq,selectChildren:iH,filter:rH,data:uH,enter:aH,exit:fH,join:hH,merge:pH,selection:x7,order:mH,sort:gH,call:bH,nodes:xH,node:vH,size:wH,empty:kH,each:EH,attr:TH,style:RH,property:PH,classed:FH,text:GH,html:WH,raise:ZH,lower:e7,append:t7,insert:i7,remove:a7,clone:o7,datum:c7,on:p7,dispatch:y7,[Symbol.iterator]:b7};function _i(e){return typeof e=="string"?new Ci([[document.querySelector(e)]],[document.documentElement]):new Ci([[e]],uC)}function v7(e){let t;for(;t=e.sourceEvent;)e=t;return e}function sr(e,t){if(e=v7(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}if(t.getBoundingClientRect){var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}}return[e.pageX,e.pageY]}const w7={passive:!1},Au={capture:!0,passive:!1};function uy(e){e.stopImmediatePropagation()}function No(e){e.preventDefault(),e.stopImmediatePropagation()}function dC(e){var t=e.document.documentElement,n=_i(e).on("dragstart.drag",No,Au);"onselectstart"in t?n.on("selectstart.drag",No,Au):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function fC(e,t){var n=e.document.documentElement,i=_i(e).on("dragstart.drag",null);t&&(i.on("click.drag",No,Au),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const $f=e=>()=>e;function ub(e,{sourceEvent:t,subject:n,target:i,identifier:a,active:l,x:o,y:d,dx:f,dy:h,dispatch:g}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:d,enumerable:!0,configurable:!0},dx:{value:f,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:g}})}ub.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function k7(e){return!e.ctrlKey&&!e.button}function E7(){return this.parentNode}function S7(e,t){return t??{x:e.x,y:e.y}}function N7(){return navigator.maxTouchPoints||"ontouchstart"in this}function hC(){var e=k7,t=E7,n=S7,i=N7,a={},l=cp("start","drag","end"),o=0,d,f,h,g,m=0;function y(_){_.on("mousedown.drag",b).filter(i).on("touchstart.drag",N).on("touchmove.drag",E,w7).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(_,M){if(!(g||!e.call(this,_,M))){var T=S(this,t.call(this,_,M),_,M,"mouse");T&&(_i(_.view).on("mousemove.drag",k,Au).on("mouseup.drag",v,Au),dC(_.view),uy(_),h=!1,d=_.clientX,f=_.clientY,T("start",_))}}function k(_){if(No(_),!h){var M=_.clientX-d,T=_.clientY-f;h=M*M+T*T>m}a.mouse("drag",_)}function v(_){_i(_.view).on("mousemove.drag mouseup.drag",null),fC(_.view,h),No(_),a.mouse("end",_)}function N(_,M){if(e.call(this,_,M)){var T=_.changedTouches,R=t.call(this,_,M),O=T.length,$,I;for($=0;$<O;++$)(I=S(this,R,_,M,T[$].identifier,T[$]))&&(uy(_),I("start",_,T[$]))}}function E(_){var M=_.changedTouches,T=M.length,R,O;for(R=0;R<T;++R)(O=a[M[R].identifier])&&(No(_),O("drag",_,M[R]))}function C(_){var M=_.changedTouches,T=M.length,R,O;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),R=0;R<T;++R)(O=a[M[R].identifier])&&(uy(_),O("end",_,M[R]))}function S(_,M,T,R,O,$){var I=l.copy(),q=sr($||T,M),F,Y,D;if((D=n.call(_,new ub("beforestart",{sourceEvent:T,target:y,identifier:O,active:o,x:q[0],y:q[1],dx:0,dy:0,dispatch:I}),R))!=null)return F=D.x-q[0]||0,Y=D.y-q[1]||0,function K(P,H,Q){var G=q,L;switch(P){case"start":a[O]=K,L=o++;break;case"end":delete a[O],--o;case"drag":q=sr(Q||H,M),L=o;break}I.call(P,_,new ub(P,{sourceEvent:H,subject:D,target:y,identifier:O,active:L,x:q[0]+F,y:q[1]+Y,dx:q[0]-G[0],dy:q[1]-G[1],dispatch:I}),R)}}return y.filter=function(_){return arguments.length?(e=typeof _=="function"?_:$f(!!_),y):e},y.container=function(_){return arguments.length?(t=typeof _=="function"?_:$f(_),y):t},y.subject=function(_){return arguments.length?(n=typeof _=="function"?_:$f(_),y):n},y.touchable=function(_){return arguments.length?(i=typeof _=="function"?_:$f(!!_),y):i},y.on=function(){var _=l.on.apply(l,arguments);return _===l?y:_},y.clickDistance=function(_){return arguments.length?(m=(_=+_)*_,y):Math.sqrt(m)},y}function $x(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function pC(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function id(){}var Tu=.7,jh=1/Tu,_o="\\s*([+-]?\\d+)\\s*",Mu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Dr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",_7=/^#([0-9a-f]{3,8})$/,j7=new RegExp(`^rgb\\(${_o},${_o},${_o}\\)$`),C7=new RegExp(`^rgb\\(${Dr},${Dr},${Dr}\\)$`),A7=new RegExp(`^rgba\\(${_o},${_o},${_o},${Mu}\\)$`),T7=new RegExp(`^rgba\\(${Dr},${Dr},${Dr},${Mu}\\)$`),M7=new RegExp(`^hsl\\(${Mu},${Dr},${Dr}\\)$`),D7=new RegExp(`^hsla\\(${Mu},${Dr},${Dr},${Mu}\\)$`),qE={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};$x(id,gl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:HE,formatHex:HE,formatHex8:O7,formatHsl:R7,formatRgb:KE,toString:KE});function HE(){return this.rgb().formatHex()}function O7(){return this.rgb().formatHex8()}function R7(){return mC(this).formatHsl()}function KE(){return this.rgb().formatRgb()}function gl(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=_7.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?GE(t):n===3?new hi(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Uf(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Uf(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=j7.exec(e))?new hi(t[1],t[2],t[3],1):(t=C7.exec(e))?new hi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=A7.exec(e))?Uf(t[1],t[2],t[3],t[4]):(t=T7.exec(e))?Uf(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=M7.exec(e))?QE(t[1],t[2]/100,t[3]/100,1):(t=D7.exec(e))?QE(t[1],t[2]/100,t[3]/100,t[4]):qE.hasOwnProperty(e)?GE(qE[e]):e==="transparent"?new hi(NaN,NaN,NaN,0):null}function GE(e){return new hi(e>>16&255,e>>8&255,e&255,1)}function Uf(e,t,n,i){return i<=0&&(e=t=n=NaN),new hi(e,t,n,i)}function L7(e){return e instanceof id||(e=gl(e)),e?(e=e.rgb(),new hi(e.r,e.g,e.b,e.opacity)):new hi}function db(e,t,n,i){return arguments.length===1?L7(e):new hi(e,t,n,i??1)}function hi(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}$x(hi,db,pC(id,{brighter(e){return e=e==null?jh:Math.pow(jh,e),new hi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Tu:Math.pow(Tu,e),new hi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new hi(cl(this.r),cl(this.g),cl(this.b),Ch(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:VE,formatHex:VE,formatHex8:I7,formatRgb:YE,toString:YE}));function VE(){return`#${Js(this.r)}${Js(this.g)}${Js(this.b)}`}function I7(){return`#${Js(this.r)}${Js(this.g)}${Js(this.b)}${Js((isNaN(this.opacity)?1:this.opacity)*255)}`}function YE(){const e=Ch(this.opacity);return`${e===1?"rgb(":"rgba("}${cl(this.r)}, ${cl(this.g)}, ${cl(this.b)}${e===1?")":`, ${e})`}`}function Ch(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function cl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Js(e){return e=cl(e),(e<16?"0":"")+e.toString(16)}function QE(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new lr(e,t,n,i)}function mC(e){if(e instanceof lr)return new lr(e.h,e.s,e.l,e.opacity);if(e instanceof id||(e=gl(e)),!e)return new lr;if(e instanceof lr)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,a=Math.min(t,n,i),l=Math.max(t,n,i),o=NaN,d=l-a,f=(l+a)/2;return d?(t===l?o=(n-i)/d+(n<i)*6:n===l?o=(i-t)/d+2:o=(t-n)/d+4,d/=f<.5?l+a:2-l-a,o*=60):d=f>0&&f<1?0:o,new lr(o,d,f,e.opacity)}function z7(e,t,n,i){return arguments.length===1?mC(e):new lr(e,t,n,i??1)}function lr(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}$x(lr,z7,pC(id,{brighter(e){return e=e==null?jh:Math.pow(jh,e),new lr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Tu:Math.pow(Tu,e),new lr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,a=2*n-i;return new hi(dy(e>=240?e-240:e+120,a,i),dy(e,a,i),dy(e<120?e+240:e-120,a,i),this.opacity)},clamp(){return new lr(WE(this.h),Ff(this.s),Ff(this.l),Ch(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ch(this.opacity);return`${e===1?"hsl(":"hsla("}${WE(this.h)}, ${Ff(this.s)*100}%, ${Ff(this.l)*100}%${e===1?")":`, ${e})`}`}}));function WE(e){return e=(e||0)%360,e<0?e+360:e}function Ff(e){return Math.max(0,Math.min(1,e||0))}function dy(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Ux=e=>()=>e;function P7(e,t){return function(n){return e+n*t}}function B7(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function $7(e){return(e=+e)==1?gC:function(t,n){return n-t?B7(t,n,e):Ux(isNaN(t)?n:t)}}function gC(e,t){var n=t-e;return n?P7(e,n):Ux(isNaN(e)?t:e)}const Ah=(function e(t){var n=$7(t);function i(a,l){var o=n((a=db(a)).r,(l=db(l)).r),d=n(a.g,l.g),f=n(a.b,l.b),h=gC(a.opacity,l.opacity);return function(g){return a.r=o(g),a.g=d(g),a.b=f(g),a.opacity=h(g),a+""}}return i.gamma=e,i})(1);function U7(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,i=t.slice(),a;return function(l){for(a=0;a<n;++a)i[a]=e[a]*(1-l)+t[a]*l;return i}}function F7(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function q7(e,t){var n=t?t.length:0,i=e?Math.min(n,e.length):0,a=new Array(i),l=new Array(n),o;for(o=0;o<i;++o)a[o]=yu(e[o],t[o]);for(;o<n;++o)l[o]=t[o];return function(d){for(o=0;o<i;++o)l[o]=a[o](d);return l}}function H7(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function Ar(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function K7(e,t){var n={},i={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=yu(e[a],t[a]):i[a]=t[a];return function(l){for(a in n)i[a]=n[a](l);return i}}var fb=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,fy=new RegExp(fb.source,"g");function G7(e){return function(){return e}}function V7(e){return function(t){return e(t)+""}}function yC(e,t){var n=fb.lastIndex=fy.lastIndex=0,i,a,l,o=-1,d=[],f=[];for(e=e+"",t=t+"";(i=fb.exec(e))&&(a=fy.exec(t));)(l=a.index)>n&&(l=t.slice(n,l),d[o]?d[o]+=l:d[++o]=l),(i=i[0])===(a=a[0])?d[o]?d[o]+=a:d[++o]=a:(d[++o]=null,f.push({i:o,x:Ar(i,a)})),n=fy.lastIndex;return n<t.length&&(l=t.slice(n),d[o]?d[o]+=l:d[++o]=l),d.length<2?f[0]?V7(f[0].x):G7(t):(t=f.length,function(h){for(var g=0,m;g<t;++g)d[(m=f[g]).i]=m.x(h);return d.join("")})}function yu(e,t){var n=typeof t,i;return t==null||n==="boolean"?Ux(t):(n==="number"?Ar:n==="string"?(i=gl(t))?(t=i,Ah):yC:t instanceof gl?Ah:t instanceof Date?H7:F7(t)?U7:Array.isArray(t)?q7:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?K7:Ar)(e,t)}var XE=180/Math.PI,hb={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function bC(e,t,n,i,a,l){var o,d,f;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(f=e*n+t*i)&&(n-=e*f,i-=t*f),(d=Math.sqrt(n*n+i*i))&&(n/=d,i/=d,f/=d),e*i<t*n&&(e=-e,t=-t,f=-f,o=-o),{translateX:a,translateY:l,rotate:Math.atan2(t,e)*XE,skewX:Math.atan(f)*XE,scaleX:o,scaleY:d}}var qf;function Y7(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?hb:bC(t.a,t.b,t.c,t.d,t.e,t.f)}function Q7(e){return e==null||(qf||(qf=document.createElementNS("http://www.w3.org/2000/svg","g")),qf.setAttribute("transform",e),!(e=qf.transform.baseVal.consolidate()))?hb:(e=e.matrix,bC(e.a,e.b,e.c,e.d,e.e,e.f))}function xC(e,t,n,i){function a(h){return h.length?h.pop()+" ":""}function l(h,g,m,y,b,k){if(h!==m||g!==y){var v=b.push("translate(",null,t,null,n);k.push({i:v-4,x:Ar(h,m)},{i:v-2,x:Ar(g,y)})}else(m||y)&&b.push("translate("+m+t+y+n)}function o(h,g,m,y){h!==g?(h-g>180?g+=360:g-h>180&&(h+=360),y.push({i:m.push(a(m)+"rotate(",null,i)-2,x:Ar(h,g)})):g&&m.push(a(m)+"rotate("+g+i)}function d(h,g,m,y){h!==g?y.push({i:m.push(a(m)+"skewX(",null,i)-2,x:Ar(h,g)}):g&&m.push(a(m)+"skewX("+g+i)}function f(h,g,m,y,b,k){if(h!==m||g!==y){var v=b.push(a(b)+"scale(",null,",",null,")");k.push({i:v-4,x:Ar(h,m)},{i:v-2,x:Ar(g,y)})}else(m!==1||y!==1)&&b.push(a(b)+"scale("+m+","+y+")")}return function(h,g){var m=[],y=[];return h=e(h),g=e(g),l(h.translateX,h.translateY,g.translateX,g.translateY,m,y),o(h.rotate,g.rotate,m,y),d(h.skewX,g.skewX,m,y),f(h.scaleX,h.scaleY,g.scaleX,g.scaleY,m,y),h=g=null,function(b){for(var k=-1,v=y.length,N;++k<v;)m[(N=y[k]).i]=N.x(b);return m.join("")}}}var W7=xC(Y7,"px, ","px)","deg)"),X7=xC(Q7,", ",")",")"),Z7=1e-12;function ZE(e){return((e=Math.exp(e))+1/e)/2}function J7(e){return((e=Math.exp(e))-1/e)/2}function eK(e){return((e=Math.exp(2*e))-1)/(e+1)}const rh=(function e(t,n,i){function a(l,o){var d=l[0],f=l[1],h=l[2],g=o[0],m=o[1],y=o[2],b=g-d,k=m-f,v=b*b+k*k,N,E;if(v<Z7)E=Math.log(y/h)/t,N=function(R){return[d+R*b,f+R*k,h*Math.exp(t*R*E)]};else{var C=Math.sqrt(v),S=(y*y-h*h+i*v)/(2*h*n*C),_=(y*y-h*h-i*v)/(2*y*n*C),M=Math.log(Math.sqrt(S*S+1)-S),T=Math.log(Math.sqrt(_*_+1)-_);E=(T-M)/t,N=function(R){var O=R*E,$=ZE(M),I=h/(n*C)*($*eK(t*O+M)-J7(M));return[d+I*b,f+I*k,h*$/ZE(t*O+M)]}}return N.duration=E*1e3*t/Math.SQRT2,N}return a.rho=function(l){var o=Math.max(.001,+l),d=o*o,f=d*d;return e(o,d,f)},a})(Math.SQRT2,2,4);var qo=0,uu=0,su=0,vC=1e3,Th,du,Mh=0,yl=0,dp=0,Du=typeof performance=="object"&&performance.now?performance:Date,wC=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Fx(){return yl||(wC(tK),yl=Du.now()+dp)}function tK(){yl=0}function Dh(){this._call=this._time=this._next=null}Dh.prototype=kC.prototype={constructor:Dh,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Fx():+n)+(t==null?0:+t),!this._next&&du!==this&&(du?du._next=this:Th=this,du=this),this._call=e,this._time=n,pb()},stop:function(){this._call&&(this._call=null,this._time=1/0,pb())}};function kC(e,t,n){var i=new Dh;return i.restart(e,t,n),i}function nK(){Fx(),++qo;for(var e=Th,t;e;)(t=yl-e._time)>=0&&e._call.call(void 0,t),e=e._next;--qo}function JE(){yl=(Mh=Du.now())+dp,qo=uu=0;try{nK()}finally{qo=0,rK(),yl=0}}function iK(){var e=Du.now(),t=e-Mh;t>vC&&(dp-=t,Mh=e)}function rK(){for(var e,t=Th,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Th=n);du=e,pb(i)}function pb(e){if(!qo){uu&&(uu=clearTimeout(uu));var t=e-yl;t>24?(e<1/0&&(uu=setTimeout(JE,e-Du.now()-dp)),su&&(su=clearInterval(su))):(su||(Mh=Du.now(),su=setInterval(iK,vC)),qo=1,wC(JE))}}function eS(e,t,n){var i=new Dh;return t=t==null?0:+t,i.restart(a=>{i.stop(),e(a+t)},t,n),i}var aK=cp("start","end","cancel","interrupt"),sK=[],EC=0,tS=1,mb=2,ah=3,nS=4,gb=5,sh=6;function fp(e,t,n,i,a,l){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;lK(e,n,{name:t,index:i,group:a,on:aK,tween:sK,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:EC})}function qx(e,t){var n=gr(e,t);if(n.state>EC)throw new Error("too late; already scheduled");return n}function zr(e,t){var n=gr(e,t);if(n.state>ah)throw new Error("too late; already running");return n}function gr(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function lK(e,t,n){var i=e.__transition,a;i[t]=n,n.timer=kC(l,0,n.time);function l(h){n.state=tS,n.timer.restart(o,n.delay,n.time),n.delay<=h&&o(h-n.delay)}function o(h){var g,m,y,b;if(n.state!==tS)return f();for(g in i)if(b=i[g],b.name===n.name){if(b.state===ah)return eS(o);b.state===nS?(b.state=sh,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete i[g]):+g<t&&(b.state=sh,b.timer.stop(),b.on.call("cancel",e,e.__data__,b.index,b.group),delete i[g])}if(eS(function(){n.state===ah&&(n.state=nS,n.timer.restart(d,n.delay,n.time),d(h))}),n.state=mb,n.on.call("start",e,e.__data__,n.index,n.group),n.state===mb){for(n.state=ah,a=new Array(y=n.tween.length),g=0,m=-1;g<y;++g)(b=n.tween[g].value.call(e,e.__data__,n.index,n.group))&&(a[++m]=b);a.length=m+1}}function d(h){for(var g=h<n.duration?n.ease.call(null,h/n.duration):(n.timer.restart(f),n.state=gb,1),m=-1,y=a.length;++m<y;)a[m].call(e,g);n.state===gb&&(n.on.call("end",e,e.__data__,n.index,n.group),f())}function f(){n.state=sh,n.timer.stop(),delete i[t];for(var h in i)return;delete e.__transition}}function lh(e,t){var n=e.__transition,i,a,l=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((i=n[o]).name!==t){l=!1;continue}a=i.state>mb&&i.state<gb,i.state=sh,i.timer.stop(),i.on.call(a?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete n[o]}l&&delete e.__transition}}function oK(e){return this.each(function(){lh(this,e)})}function cK(e,t){var n,i;return function(){var a=zr(this,e),l=a.tween;if(l!==n){i=n=l;for(var o=0,d=i.length;o<d;++o)if(i[o].name===t){i=i.slice(),i.splice(o,1);break}}a.tween=i}}function uK(e,t,n){var i,a;if(typeof n!="function")throw new Error;return function(){var l=zr(this,e),o=l.tween;if(o!==i){a=(i=o).slice();for(var d={name:t,value:n},f=0,h=a.length;f<h;++f)if(a[f].name===t){a[f]=d;break}f===h&&a.push(d)}l.tween=a}}function dK(e,t){var n=this._id;if(e+="",arguments.length<2){for(var i=gr(this.node(),n).tween,a=0,l=i.length,o;a<l;++a)if((o=i[a]).name===e)return o.value;return null}return this.each((t==null?cK:uK)(n,e,t))}function Hx(e,t,n){var i=e._id;return e.each(function(){var a=zr(this,i);(a.value||(a.value={}))[t]=n.apply(this,arguments)}),function(a){return gr(a,i).value[t]}}function SC(e,t){var n;return(typeof t=="number"?Ar:t instanceof gl?Ah:(n=gl(t))?(t=n,Ah):yC)(e,t)}function fK(e){return function(){this.removeAttribute(e)}}function hK(e){return function(){this.removeAttributeNS(e.space,e.local)}}function pK(e,t,n){var i,a=n+"",l;return function(){var o=this.getAttribute(e);return o===a?null:o===i?l:l=t(i=o,n)}}function mK(e,t,n){var i,a=n+"",l;return function(){var o=this.getAttributeNS(e.space,e.local);return o===a?null:o===i?l:l=t(i=o,n)}}function gK(e,t,n){var i,a,l;return function(){var o,d=n(this),f;return d==null?void this.removeAttribute(e):(o=this.getAttribute(e),f=d+"",o===f?null:o===i&&f===a?l:(a=f,l=t(i=o,d)))}}function yK(e,t,n){var i,a,l;return function(){var o,d=n(this),f;return d==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),f=d+"",o===f?null:o===i&&f===a?l:(a=f,l=t(i=o,d)))}}function bK(e,t){var n=up(e),i=n==="transform"?X7:SC;return this.attrTween(e,typeof t=="function"?(n.local?yK:gK)(n,i,Hx(this,"attr."+e,t)):t==null?(n.local?hK:fK)(n):(n.local?mK:pK)(n,i,t))}function xK(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function vK(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function wK(e,t){var n,i;function a(){var l=t.apply(this,arguments);return l!==i&&(n=(i=l)&&vK(e,l)),n}return a._value=t,a}function kK(e,t){var n,i;function a(){var l=t.apply(this,arguments);return l!==i&&(n=(i=l)&&xK(e,l)),n}return a._value=t,a}function EK(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var i=up(e);return this.tween(n,(i.local?wK:kK)(i,t))}function SK(e,t){return function(){qx(this,e).delay=+t.apply(this,arguments)}}function NK(e,t){return t=+t,function(){qx(this,e).delay=t}}function _K(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?SK:NK)(t,e)):gr(this.node(),t).delay}function jK(e,t){return function(){zr(this,e).duration=+t.apply(this,arguments)}}function CK(e,t){return t=+t,function(){zr(this,e).duration=t}}function AK(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?jK:CK)(t,e)):gr(this.node(),t).duration}function TK(e,t){if(typeof t!="function")throw new Error;return function(){zr(this,e).ease=t}}function MK(e){var t=this._id;return arguments.length?this.each(TK(t,e)):gr(this.node(),t).ease}function DK(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;zr(this,e).ease=n}}function OK(e){if(typeof e!="function")throw new Error;return this.each(DK(this._id,e))}function RK(e){typeof e!="function"&&(e=tC(e));for(var t=this._groups,n=t.length,i=new Array(n),a=0;a<n;++a)for(var l=t[a],o=l.length,d=i[a]=[],f,h=0;h<o;++h)(f=l[h])&&e.call(f,f.__data__,h,l)&&d.push(f);return new ba(i,this._parents,this._name,this._id)}function LK(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,i=t.length,a=n.length,l=Math.min(i,a),o=new Array(i),d=0;d<l;++d)for(var f=t[d],h=n[d],g=f.length,m=o[d]=new Array(g),y,b=0;b<g;++b)(y=f[b]||h[b])&&(m[b]=y);for(;d<i;++d)o[d]=t[d];return new ba(o,this._parents,this._name,this._id)}function IK(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function zK(e,t,n){var i,a,l=IK(t)?qx:zr;return function(){var o=l(this,e),d=o.on;d!==i&&(a=(i=d).copy()).on(t,n),o.on=a}}function PK(e,t){var n=this._id;return arguments.length<2?gr(this.node(),n).on.on(e):this.each(zK(n,e,t))}function BK(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function $K(){return this.on("end.remove",BK(this._id))}function UK(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Px(e));for(var i=this._groups,a=i.length,l=new Array(a),o=0;o<a;++o)for(var d=i[o],f=d.length,h=l[o]=new Array(f),g,m,y=0;y<f;++y)(g=d[y])&&(m=e.call(g,g.__data__,y,d))&&("__data__"in g&&(m.__data__=g.__data__),h[y]=m,fp(h[y],t,n,y,h,gr(g,n)));return new ba(l,this._parents,t,n)}function FK(e){var t=this._name,n=this._id;typeof e!="function"&&(e=eC(e));for(var i=this._groups,a=i.length,l=[],o=[],d=0;d<a;++d)for(var f=i[d],h=f.length,g,m=0;m<h;++m)if(g=f[m]){for(var y=e.call(g,g.__data__,m,f),b,k=gr(g,n),v=0,N=y.length;v<N;++v)(b=y[v])&&fp(b,t,n,v,y,k);l.push(y),o.push(g)}return new ba(l,o,t,n)}var qK=nd.prototype.constructor;function HK(){return new qK(this._groups,this._parents)}function KK(e,t){var n,i,a;return function(){var l=Fo(this,e),o=(this.style.removeProperty(e),Fo(this,e));return l===o?null:l===n&&o===i?a:a=t(n=l,i=o)}}function NC(e){return function(){this.style.removeProperty(e)}}function GK(e,t,n){var i,a=n+"",l;return function(){var o=Fo(this,e);return o===a?null:o===i?l:l=t(i=o,n)}}function VK(e,t,n){var i,a,l;return function(){var o=Fo(this,e),d=n(this),f=d+"";return d==null&&(f=d=(this.style.removeProperty(e),Fo(this,e))),o===f?null:o===i&&f===a?l:(a=f,l=t(i=o,d))}}function YK(e,t){var n,i,a,l="style."+t,o="end."+l,d;return function(){var f=zr(this,e),h=f.on,g=f.value[l]==null?d||(d=NC(t)):void 0;(h!==n||a!==g)&&(i=(n=h).copy()).on(o,a=g),f.on=i}}function QK(e,t,n){var i=(e+="")=="transform"?W7:SC;return t==null?this.styleTween(e,KK(e,i)).on("end.style."+e,NC(e)):typeof t=="function"?this.styleTween(e,VK(e,i,Hx(this,"style."+e,t))).each(YK(this._id,e)):this.styleTween(e,GK(e,i,t),n).on("end.style."+e,null)}function WK(e,t,n){return function(i){this.style.setProperty(e,t.call(this,i),n)}}function XK(e,t,n){var i,a;function l(){var o=t.apply(this,arguments);return o!==a&&(i=(a=o)&&WK(e,o,n)),i}return l._value=t,l}function ZK(e,t,n){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,XK(e,t,n??""))}function JK(e){return function(){this.textContent=e}}function eG(e){return function(){var t=e(this);this.textContent=t??""}}function tG(e){return this.tween("text",typeof e=="function"?eG(Hx(this,"text",e)):JK(e==null?"":e+""))}function nG(e){return function(t){this.textContent=e.call(this,t)}}function iG(e){var t,n;function i(){var a=e.apply(this,arguments);return a!==n&&(t=(n=a)&&nG(a)),t}return i._value=e,i}function rG(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,iG(e))}function aG(){for(var e=this._name,t=this._id,n=_C(),i=this._groups,a=i.length,l=0;l<a;++l)for(var o=i[l],d=o.length,f,h=0;h<d;++h)if(f=o[h]){var g=gr(f,t);fp(f,e,n,h,o,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new ba(i,this._parents,e,n)}function sG(){var e,t,n=this,i=n._id,a=n.size();return new Promise(function(l,o){var d={value:o},f={value:function(){--a===0&&l()}};n.each(function(){var h=zr(this,i),g=h.on;g!==e&&(t=(e=g).copy(),t._.cancel.push(d),t._.interrupt.push(d),t._.end.push(f)),h.on=t}),a===0&&l()})}var lG=0;function ba(e,t,n,i){this._groups=e,this._parents=t,this._name=n,this._id=i}function _C(){return++lG}var aa=nd.prototype;ba.prototype={constructor:ba,select:UK,selectAll:FK,selectChild:aa.selectChild,selectChildren:aa.selectChildren,filter:RK,merge:LK,selection:HK,transition:aG,call:aa.call,nodes:aa.nodes,node:aa.node,size:aa.size,empty:aa.empty,each:aa.each,on:PK,attr:bK,attrTween:EK,style:QK,styleTween:ZK,text:tG,textTween:rG,remove:$K,tween:dK,delay:_K,duration:AK,ease:MK,easeVarying:OK,end:sG,[Symbol.iterator]:aa[Symbol.iterator]};function oG(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var cG={time:null,delay:0,duration:250,ease:oG};function uG(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function dG(e){var t,n;e instanceof ba?(t=e._id,e=e._name):(t=_C(),(n=cG).time=Fx(),e=e==null?null:e+"");for(var i=this._groups,a=i.length,l=0;l<a;++l)for(var o=i[l],d=o.length,f,h=0;h<d;++h)(f=o[h])&&fp(f,e,t,h,o,n||uG(f,t));return new ba(i,this._parents,e,t)}nd.prototype.interrupt=oK;nd.prototype.transition=dG;const Hf=e=>()=>e;function fG(e,{sourceEvent:t,target:n,transform:i,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:a}})}function fa(e,t,n){this.k=e,this.x=t,this.y=n}fa.prototype={constructor:fa,scale:function(e){return e===1?this:new fa(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new fa(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var hp=new fa(1,0,0);jC.prototype=fa.prototype;function jC(e){for(;!e.__zoom;)if(!(e=e.parentNode))return hp;return e.__zoom}function hy(e){e.stopImmediatePropagation()}function lu(e){e.preventDefault(),e.stopImmediatePropagation()}function hG(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function pG(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function iS(){return this.__zoom||hp}function mG(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function gG(){return navigator.maxTouchPoints||"ontouchstart"in this}function yG(e,t,n){var i=e.invertX(t[0][0])-n[0][0],a=e.invertX(t[1][0])-n[1][0],l=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a),o>l?(l+o)/2:Math.min(0,l)||Math.max(0,o))}function CC(){var e=hG,t=pG,n=yG,i=mG,a=gG,l=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],d=250,f=rh,h=cp("start","zoom","end"),g,m,y,b=500,k=150,v=0,N=10;function E(D){D.property("__zoom",iS).on("wheel.zoom",O,{passive:!1}).on("mousedown.zoom",$).on("dblclick.zoom",I).filter(a).on("touchstart.zoom",q).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}E.transform=function(D,K,P,H){var Q=D.selection?D.selection():D;Q.property("__zoom",iS),D!==Q?M(D,K,P,H):Q.interrupt().each(function(){T(this,arguments).event(H).start().zoom(null,typeof K=="function"?K.apply(this,arguments):K).end()})},E.scaleBy=function(D,K,P,H){E.scaleTo(D,function(){var Q=this.__zoom.k,G=typeof K=="function"?K.apply(this,arguments):K;return Q*G},P,H)},E.scaleTo=function(D,K,P,H){E.transform(D,function(){var Q=t.apply(this,arguments),G=this.__zoom,L=P==null?_(Q):typeof P=="function"?P.apply(this,arguments):P,z=G.invert(L),V=typeof K=="function"?K.apply(this,arguments):K;return n(S(C(G,V),L,z),Q,o)},P,H)},E.translateBy=function(D,K,P,H){E.transform(D,function(){return n(this.__zoom.translate(typeof K=="function"?K.apply(this,arguments):K,typeof P=="function"?P.apply(this,arguments):P),t.apply(this,arguments),o)},null,H)},E.translateTo=function(D,K,P,H,Q){E.transform(D,function(){var G=t.apply(this,arguments),L=this.__zoom,z=H==null?_(G):typeof H=="function"?H.apply(this,arguments):H;return n(hp.translate(z[0],z[1]).scale(L.k).translate(typeof K=="function"?-K.apply(this,arguments):-K,typeof P=="function"?-P.apply(this,arguments):-P),G,o)},H,Q)};function C(D,K){return K=Math.max(l[0],Math.min(l[1],K)),K===D.k?D:new fa(K,D.x,D.y)}function S(D,K,P){var H=K[0]-P[0]*D.k,Q=K[1]-P[1]*D.k;return H===D.x&&Q===D.y?D:new fa(D.k,H,Q)}function _(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function M(D,K,P,H){D.on("start.zoom",function(){T(this,arguments).event(H).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(H).end()}).tween("zoom",function(){var Q=this,G=arguments,L=T(Q,G).event(H),z=t.apply(Q,G),V=P==null?_(z):typeof P=="function"?P.apply(Q,G):P,B=Math.max(z[1][0]-z[0][0],z[1][1]-z[0][1]),le=Q.__zoom,ve=typeof K=="function"?K.apply(Q,G):K,ke=f(le.invert(V).concat(B/le.k),ve.invert(V).concat(B/ve.k));return function(Se){if(Se===1)Se=ve;else{var J=ke(Se),ue=B/J[2];Se=new fa(ue,V[0]-J[0]*ue,V[1]-J[1]*ue)}L.zoom(null,Se)}})}function T(D,K,P){return!P&&D.__zooming||new R(D,K)}function R(D,K){this.that=D,this.args=K,this.active=0,this.sourceEvent=null,this.extent=t.apply(D,K),this.taps=0}R.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,K){return this.mouse&&D!=="mouse"&&(this.mouse[1]=K.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=K.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=K.invert(this.touch1[0])),this.that.__zoom=K,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var K=_i(this.that).datum();h.call(D,this.that,new fG(D,{sourceEvent:this.sourceEvent,target:E,transform:this.that.__zoom,dispatch:h}),K)}};function O(D,...K){if(!e.apply(this,arguments))return;var P=T(this,K).event(D),H=this.__zoom,Q=Math.max(l[0],Math.min(l[1],H.k*Math.pow(2,i.apply(this,arguments)))),G=sr(D);if(P.wheel)(P.mouse[0][0]!==G[0]||P.mouse[0][1]!==G[1])&&(P.mouse[1]=H.invert(P.mouse[0]=G)),clearTimeout(P.wheel);else{if(H.k===Q)return;P.mouse=[G,H.invert(G)],lh(this),P.start()}lu(D),P.wheel=setTimeout(L,k),P.zoom("mouse",n(S(C(H,Q),P.mouse[0],P.mouse[1]),P.extent,o));function L(){P.wheel=null,P.end()}}function $(D,...K){if(y||!e.apply(this,arguments))return;var P=D.currentTarget,H=T(this,K,!0).event(D),Q=_i(D.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",B,!0),G=sr(D,P),L=D.clientX,z=D.clientY;dC(D.view),hy(D),H.mouse=[G,this.__zoom.invert(G)],lh(this),H.start();function V(le){if(lu(le),!H.moved){var ve=le.clientX-L,ke=le.clientY-z;H.moved=ve*ve+ke*ke>v}H.event(le).zoom("mouse",n(S(H.that.__zoom,H.mouse[0]=sr(le,P),H.mouse[1]),H.extent,o))}function B(le){Q.on("mousemove.zoom mouseup.zoom",null),fC(le.view,H.moved),lu(le),H.event(le).end()}}function I(D,...K){if(e.apply(this,arguments)){var P=this.__zoom,H=sr(D.changedTouches?D.changedTouches[0]:D,this),Q=P.invert(H),G=P.k*(D.shiftKey?.5:2),L=n(S(C(P,G),H,Q),t.apply(this,K),o);lu(D),d>0?_i(this).transition().duration(d).call(M,L,H,D):_i(this).call(E.transform,L,H,D)}}function q(D,...K){if(e.apply(this,arguments)){var P=D.touches,H=P.length,Q=T(this,K,D.changedTouches.length===H).event(D),G,L,z,V;for(hy(D),L=0;L<H;++L)z=P[L],V=sr(z,this),V=[V,this.__zoom.invert(V),z.identifier],Q.touch0?!Q.touch1&&Q.touch0[2]!==V[2]&&(Q.touch1=V,Q.taps=0):(Q.touch0=V,G=!0,Q.taps=1+!!g);g&&(g=clearTimeout(g)),G&&(Q.taps<2&&(m=V[0],g=setTimeout(function(){g=null},b)),lh(this),Q.start())}}function F(D,...K){if(this.__zooming){var P=T(this,K).event(D),H=D.changedTouches,Q=H.length,G,L,z,V;for(lu(D),G=0;G<Q;++G)L=H[G],z=sr(L,this),P.touch0&&P.touch0[2]===L.identifier?P.touch0[0]=z:P.touch1&&P.touch1[2]===L.identifier&&(P.touch1[0]=z);if(L=P.that.__zoom,P.touch1){var B=P.touch0[0],le=P.touch0[1],ve=P.touch1[0],ke=P.touch1[1],Se=(Se=ve[0]-B[0])*Se+(Se=ve[1]-B[1])*Se,J=(J=ke[0]-le[0])*J+(J=ke[1]-le[1])*J;L=C(L,Math.sqrt(Se/J)),z=[(B[0]+ve[0])/2,(B[1]+ve[1])/2],V=[(le[0]+ke[0])/2,(le[1]+ke[1])/2]}else if(P.touch0)z=P.touch0[0],V=P.touch0[1];else return;P.zoom("touch",n(S(L,z,V),P.extent,o))}}function Y(D,...K){if(this.__zooming){var P=T(this,K).event(D),H=D.changedTouches,Q=H.length,G,L;for(hy(D),y&&clearTimeout(y),y=setTimeout(function(){y=null},b),G=0;G<Q;++G)L=H[G],P.touch0&&P.touch0[2]===L.identifier?delete P.touch0:P.touch1&&P.touch1[2]===L.identifier&&delete P.touch1;if(P.touch1&&!P.touch0&&(P.touch0=P.touch1,delete P.touch1),P.touch0)P.touch0[1]=this.__zoom.invert(P.touch0[0]);else if(P.end(),P.taps===2&&(L=sr(L,this),Math.hypot(m[0]-L[0],m[1]-L[1])<N)){var z=_i(this).on("dblclick.zoom");z&&z.apply(this,arguments)}}}return E.wheelDelta=function(D){return arguments.length?(i=typeof D=="function"?D:Hf(+D),E):i},E.filter=function(D){return arguments.length?(e=typeof D=="function"?D:Hf(!!D),E):e},E.touchable=function(D){return arguments.length?(a=typeof D=="function"?D:Hf(!!D),E):a},E.extent=function(D){return arguments.length?(t=typeof D=="function"?D:Hf([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),E):t},E.scaleExtent=function(D){return arguments.length?(l[0]=+D[0],l[1]=+D[1],E):[l[0],l[1]]},E.translateExtent=function(D){return arguments.length?(o[0][0]=+D[0][0],o[1][0]=+D[1][0],o[0][1]=+D[0][1],o[1][1]=+D[1][1],E):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},E.constrain=function(D){return arguments.length?(n=D,E):n},E.duration=function(D){return arguments.length?(d=+D,E):d},E.interpolate=function(D){return arguments.length?(f=D,E):f},E.on=function(){var D=h.on.apply(h,arguments);return D===h?E:D},E.clickDistance=function(D){return arguments.length?(v=(D=+D)*D,E):Math.sqrt(v)},E.tapDistance=function(D){return arguments.length?(N=+D,E):N},E}const hr={error001:(e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:i})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:i}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Ou=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],AC=["Enter"," ","Escape"],TC={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Ho;(function(e){e.Strict="strict",e.Loose="loose"})(Ho||(Ho={}));var ul;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ul||(ul={}));var Ru;(function(e){e.Partial="partial",e.Full="full"})(Ru||(Ru={}));const MC={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var os;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(os||(os={}));var Oh;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Oh||(Oh={}));var Ge;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ge||(Ge={}));const rS={[Ge.Left]:Ge.Right,[Ge.Right]:Ge.Left,[Ge.Top]:Ge.Bottom,[Ge.Bottom]:Ge.Top};function DC(e){return e===null?null:e?"valid":"invalid"}const OC=e=>"id"in e&&"source"in e&&"target"in e,bG=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Kx=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),rd=(e,t=[0,0])=>{const{width:n,height:i}=va(e),a=e.origin??t,l=n*a[0],o=i*a[1];return{x:e.position.x-l,y:e.position.y-o}},xG=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((i,a)=>{const l=typeof a=="string";let o=!t.nodeLookup&&!l?a:void 0;t.nodeLookup&&(o=l?t.nodeLookup.get(a):Kx(a)?a:t.nodeLookup.get(a.id));const d=o?Rh(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return pp(i,d)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return mp(n)},ad=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},i=!1;return e.forEach(a=>{(t.filter===void 0||t.filter(a))&&(n=pp(n,Rh(a)),i=!0)}),i?mp(n):{x:0,y:0,width:0,height:0}},Gx=(e,t,[n,i,a]=[0,0,1],l=!1,o=!1)=>{const d=(t.x-n)/a,f=(t.y-i)/a,h=t.width/a,g=t.height/a,m=[];for(const y of e.values()){const{measured:b,selectable:k=!0,hidden:v=!1}=y;if(o&&!k||v)continue;const N=b.width??y.width??y.initialWidth??0,E=b.height??y.height??y.initialHeight??0,{x:C,y:S}=y.internals.positionAbsolute,_=zC(d,f,h,g,C,S,N,E),M=N*E,T=l&&_>0;(!y.internals.handleBounds||T||_>=M||y.dragging)&&m.push(y)}return m},vG=(e,t)=>{const n=new Set;return e.forEach(i=>{n.add(i.id)}),t.filter(i=>n.has(i.source)||n.has(i.target))};function wG(e,t){const n=new Map,i=t!=null&&t.nodes?new Set(t.nodes.map(a=>a.id)):null;return e.forEach(a=>{a.measured.width&&a.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!a.hidden)&&(!i||i.has(a.id))&&n.set(a.id,a)}),n}async function kG({nodes:e,width:t,height:n,panZoom:i,minZoom:a,maxZoom:l},o){if(e.size===0)return!0;const d=wG(e,o),f=ad(d),h=Yx(f,t,n,(o==null?void 0:o.minZoom)??a,(o==null?void 0:o.maxZoom)??l,(o==null?void 0:o.padding)??.1);return await i.setViewport(h,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),!0}function RC({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:i=[0,0],nodeExtent:a,onError:l}){const o=n.get(e),d=o.parentId?n.get(o.parentId):void 0,{x:f,y:h}=d?d.internals.positionAbsolute:{x:0,y:0},g=o.origin??i;let m=o.extent||a;if(o.extent==="parent"&&!o.expandParent)if(!d)l==null||l("005",hr.error005());else{const b=d.measured.width,k=d.measured.height;b&&k&&(m=[[f,h],[f+b,h+k]])}else d&&xl(o.extent)&&(m=[[o.extent[0][0]+f,o.extent[0][1]+h],[o.extent[1][0]+f,o.extent[1][1]+h]]);const y=xl(m)?bl(t,m,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(l==null||l("015",hr.error015())),{position:{x:y.x-f+(o.measured.width??0)*g[0],y:y.y-h+(o.measured.height??0)*g[1]},positionAbsolute:y}}async function EG({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:i,onBeforeDelete:a}){const l=new Set(e.map(y=>y.id)),o=[];for(const y of n){if(y.deletable===!1)continue;const b=l.has(y.id),k=!b&&y.parentId&&o.find(v=>v.id===y.parentId);(b||k)&&o.push(y)}const d=new Set(t.map(y=>y.id)),f=i.filter(y=>y.deletable!==!1),g=vG(o,f);for(const y of f)d.has(y.id)&&!g.find(k=>k.id===y.id)&&g.push(y);if(!a)return{edges:g,nodes:o};const m=await a({nodes:o,edges:g});return typeof m=="boolean"?m?{edges:g,nodes:o}:{edges:[],nodes:[]}:m}const Ko=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),bl=(e={x:0,y:0},t,n)=>({x:Ko(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Ko(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function LC(e,t,n){const{width:i,height:a}=va(n),{x:l,y:o}=n.internals.positionAbsolute;return bl(e,[[l,o],[l+i,o+a]],t)}const aS=(e,t,n)=>e<t?Ko(Math.abs(e-t),1,t)/t:e>n?-Ko(Math.abs(e-n),1,t)/t:0,Vx=(e,t,n=15,i=40)=>{const a=aS(e.x,i,t.width-i)*n,l=aS(e.y,i,t.height-i)*n;return[a,l]},pp=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),yb=({x:e,y:t,width:n,height:i})=>({x:e,y:t,x2:e+n,y2:t+i}),mp=({x:e,y:t,x2:n,y2:i})=>({x:e,y:t,width:n-e,height:i-t}),Lu=(e,t=[0,0])=>{var a,l;const{x:n,y:i}=Kx(e)?e.internals.positionAbsolute:rd(e,t);return{x:n,y:i,width:((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0,height:((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0}},Rh=(e,t=[0,0])=>{var a,l;const{x:n,y:i}=Kx(e)?e.internals.positionAbsolute:rd(e,t);return{x:n,y:i,x2:n+(((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0),y2:i+(((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0)}},IC=(e,t)=>mp(pp(yb(e),yb(t))),zC=(e,t,n,i,a,l,o,d)=>{const f=Math.max(0,Math.min(e+n,a+o)-Math.max(e,a)),h=Math.max(0,Math.min(t+i,l+d)-Math.max(t,l));return Math.ceil(f*h)},Lh=(e,t)=>zC(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),sS=e=>or(e.width)&&or(e.height)&&or(e.x)&&or(e.y),or=e=>!isNaN(e)&&isFinite(e),PC=(e,t)=>(n,i)=>{},sd=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),ld=({x:e,y:t},[n,i,a],l=!1,o=[1,1])=>{const d={x:(e-n)/a,y:(t-i)/a};return l?sd(d,o):d},Go=({x:e,y:t},[n,i,a])=>({x:e*a+n,y:t*a+i});function uo(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function SG(e,t,n){if(typeof e=="string"||typeof e=="number"){const i=uo(e,n),a=uo(e,t);return{top:i,right:a,bottom:i,left:a,x:a*2,y:i*2}}if(typeof e=="object"){const i=uo(e.top??e.y??0,n),a=uo(e.bottom??e.y??0,n),l=uo(e.left??e.x??0,t),o=uo(e.right??e.x??0,t);return{top:i,right:o,bottom:a,left:l,x:l+o,y:i+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function NG(e,t,n,i,a,l){const{x:o,y:d}=Go(e,[t,n,i]),{x:f,y:h}=Go({x:e.x+e.width,y:e.y+e.height},[t,n,i]),g=a-f,m=l-h;return{left:Math.floor(o),top:Math.floor(d),right:Math.floor(g),bottom:Math.floor(m)}}const Yx=(e,t,n,i,a,l)=>{const o=SG(l,t,n),d=(t-o.x)/e.width,f=(n-o.y)/e.height,h=Math.min(d,f),g=Ko(h,i,a),m=e.x+e.width/2,y=e.y+e.height/2,b=t/2-m*g,k=n/2-y*g,v=NG(e,b,k,g,t,n),N={left:Math.min(v.left-o.left,0),top:Math.min(v.top-o.top,0),right:Math.min(v.right-o.right,0),bottom:Math.min(v.bottom-o.bottom,0)};return{x:b-N.left+N.right,y:k-N.top+N.bottom,zoom:g}},Iu=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function xl(e){return e!=null&&e!=="parent"}function va(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function BC(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function $C(e,t={width:0,height:0},n,i,a){const l={...e},o=i.get(n);if(o){const d=o.origin||a;l.x+=o.internals.positionAbsolute.x-(t.width??0)*d[0],l.y+=o.internals.positionAbsolute.y-(t.height??0)*d[1]}return l}function lS(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function _G(){let e,t;return{promise:new Promise((i,a)=>{e=i,t=a}),resolve:e,reject:t}}function jG(e){return{...TC,...e||{}}}function bu(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:i,containerBounds:a}){const{x:l,y:o}=cr(e),d=ld({x:l-((a==null?void 0:a.left)??0),y:o-((a==null?void 0:a.top)??0)},i),{x:f,y:h}=n?sd(d,t):d;return{xSnapped:f,ySnapped:h,...d}}const Qx=e=>({width:e.offsetWidth,height:e.offsetHeight}),UC=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},CG=["INPUT","SELECT","TEXTAREA"];function FC(e){var i,a;const t=((a=(i=e.composedPath)==null?void 0:i.call(e))==null?void 0:a[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:CG.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const qC=e=>"clientX"in e,cr=(e,t)=>{var l,o;const n=qC(e),i=n?e.clientX:(l=e.touches)==null?void 0:l[0].clientX,a=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:i-((t==null?void 0:t.left)??0),y:a-((t==null?void 0:t.top)??0)}},oS=(e,t,n,i,a)=>{const l=t.querySelectorAll(`.${e}`);return!l||!l.length?null:Array.from(l).map(o=>{const d=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:a,position:o.getAttribute("data-handlepos"),x:(d.left-n.left)/i,y:(d.top-n.top)/i,...Qx(o)}})};function HC({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:a,sourceControlY:l,targetControlX:o,targetControlY:d}){const f=e*.125+a*.375+o*.375+n*.125,h=t*.125+l*.375+d*.375+i*.125,g=Math.abs(f-e),m=Math.abs(h-t);return[f,h,g,m]}function Kf(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function cS({pos:e,x1:t,y1:n,x2:i,y2:a,c:l}){switch(e){case Ge.Left:return[t-Kf(t-i,l),n];case Ge.Right:return[t+Kf(i-t,l),n];case Ge.Top:return[t,n-Kf(n-a,l)];case Ge.Bottom:return[t,n+Kf(a-n,l)]}}function KC({sourceX:e,sourceY:t,sourcePosition:n=Ge.Bottom,targetX:i,targetY:a,targetPosition:l=Ge.Top,curvature:o=.25}){const[d,f]=cS({pos:n,x1:e,y1:t,x2:i,y2:a,c:o}),[h,g]=cS({pos:l,x1:i,y1:a,x2:e,y2:t,c:o}),[m,y,b,k]=HC({sourceX:e,sourceY:t,targetX:i,targetY:a,sourceControlX:d,sourceControlY:f,targetControlX:h,targetControlY:g});return[`M${e},${t} C${d},${f} ${h},${g} ${i},${a}`,m,y,b,k]}function GC({sourceX:e,sourceY:t,targetX:n,targetY:i}){const a=Math.abs(n-e)/2,l=n<e?n+a:n-a,o=Math.abs(i-t)/2,d=i<t?i+o:i-o;return[l,d,a,o]}function AG({sourceNode:e,targetNode:t,selected:n=!1,zIndex:i=0,elevateOnSelect:a=!1,zIndexMode:l="basic"}){if(l==="manual")return i;const o=a&&n?i+1e3:i,d=Math.max(e.parentId||a&&e.selected?e.internals.z:0,t.parentId||a&&t.selected?t.internals.z:0);return o+d}function TG({sourceNode:e,targetNode:t,width:n,height:i,transform:a}){const l=pp(Rh(e),Rh(t));l.x===l.x2&&(l.x2+=1),l.y===l.y2&&(l.y2+=1);const o={x:-a[0]/a[2],y:-a[1]/a[2],width:n/a[2],height:i/a[2]};return Lh(o,mp(l))>0}const MG=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,DG=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),OG=(e,t,n={})=>{var l;if(!e.source||!e.target)return(l=n.onError)==null||l.call(n,"006",hr.error006()),t;const i=n.getEdgeId||MG;let a;return OC(e)?a={...e}:a={...e,id:i(e)},DG(a,t)?t:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,t.concat(a))};function VC({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[a,l,o,d]=GC({sourceX:e,sourceY:t,targetX:n,targetY:i});return[`M ${e},${t}L ${n},${i}`,a,l,o,d]}const uS={[Ge.Left]:{x:-1,y:0},[Ge.Right]:{x:1,y:0},[Ge.Top]:{x:0,y:-1},[Ge.Bottom]:{x:0,y:1}},RG=({source:e,sourcePosition:t=Ge.Bottom,target:n})=>t===Ge.Left||t===Ge.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},dS=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function LG({source:e,sourcePosition:t=Ge.Bottom,target:n,targetPosition:i=Ge.Top,center:a,offset:l,stepPosition:o}){const d=uS[t],f=uS[i],h={x:e.x+d.x*l,y:e.y+d.y*l},g={x:n.x+f.x*l,y:n.y+f.y*l},m=RG({source:h,sourcePosition:t,target:g}),y=m.x!==0?"x":"y",b=m[y];let k=[],v,N;const E={x:0,y:0},C={x:0,y:0},[,,S,_]=GC({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(d[y]*f[y]===-1){y==="x"?(v=a.x??h.x+(g.x-h.x)*o,N=a.y??(h.y+g.y)/2):(v=a.x??(h.x+g.x)/2,N=a.y??h.y+(g.y-h.y)*o);const O=[{x:v,y:h.y},{x:v,y:g.y}],$=[{x:h.x,y:N},{x:g.x,y:N}];d[y]===b?k=y==="x"?O:$:k=y==="x"?$:O}else{const O=[{x:h.x,y:g.y}],$=[{x:g.x,y:h.y}];if(y==="x"?k=d.x===b?$:O:k=d.y===b?O:$,t===i){const D=Math.abs(e[y]-n[y]);if(D<=l){const K=Math.min(l-1,l-D);d[y]===b?E[y]=(h[y]>e[y]?-1:1)*K:C[y]=(g[y]>n[y]?-1:1)*K}}if(t!==i){const D=y==="x"?"y":"x",K=d[y]===f[D],P=h[D]>g[D],H=h[D]<g[D];(d[y]===1&&(!K&&P||K&&H)||d[y]!==1&&(!K&&H||K&&P))&&(k=y==="x"?O:$)}const I={x:h.x+E.x,y:h.y+E.y},q={x:g.x+C.x,y:g.y+C.y},F=Math.max(Math.abs(I.x-k[0].x),Math.abs(q.x-k[0].x)),Y=Math.max(Math.abs(I.y-k[0].y),Math.abs(q.y-k[0].y));F>=Y?(v=(I.x+q.x)/2,N=k[0].y):(v=k[0].x,N=(I.y+q.y)/2)}const M={x:h.x+E.x,y:h.y+E.y},T={x:g.x+C.x,y:g.y+C.y};return[[e,...M.x!==k[0].x||M.y!==k[0].y?[M]:[],...k,...T.x!==k[k.length-1].x||T.y!==k[k.length-1].y?[T]:[],n],v,N,S,_]}function IG(e,t,n,i){const a=Math.min(dS(e,t)/2,dS(t,n)/2,i),{x:l,y:o}=t;if(e.x===l&&l===n.x||e.y===o&&o===n.y)return`L${l} ${o}`;if(e.y===o){const h=e.x<n.x?-1:1,g=e.y<n.y?1:-1;return`L ${l+a*h},${o}Q ${l},${o} ${l},${o+a*g}`}const d=e.x<n.x?1:-1,f=e.y<n.y?-1:1;return`L ${l},${o+a*f}Q ${l},${o} ${l+a*d},${o}`}function bb({sourceX:e,sourceY:t,sourcePosition:n=Ge.Bottom,targetX:i,targetY:a,targetPosition:l=Ge.Top,borderRadius:o=5,centerX:d,centerY:f,offset:h=20,stepPosition:g=.5}){const[m,y,b,k,v]=LG({source:{x:e,y:t},sourcePosition:n,target:{x:i,y:a},targetPosition:l,center:{x:d,y:f},offset:h,stepPosition:g});let N=`M${m[0].x} ${m[0].y}`;for(let E=1;E<m.length-1;E++)N+=IG(m[E-1],m[E],m[E+1],o);return N+=`L${m[m.length-1].x} ${m[m.length-1].y}`,[N,y,b,k,v]}function fS(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function zG(e){var m;const{sourceNode:t,targetNode:n}=e;if(!fS(t)||!fS(n))return null;const i=t.internals.handleBounds||hS(t.handles),a=n.internals.handleBounds||hS(n.handles),l=pS((i==null?void 0:i.source)??[],e.sourceHandle),o=pS(e.connectionMode===Ho.Strict?(a==null?void 0:a.target)??[]:((a==null?void 0:a.target)??[]).concat((a==null?void 0:a.source)??[]),e.targetHandle);if(!l||!o)return(m=e.onError)==null||m.call(e,"008",hr.error008(l?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const d=(l==null?void 0:l.position)||Ge.Bottom,f=(o==null?void 0:o.position)||Ge.Top,h=vl(t,l,d),g=vl(n,o,f);return{sourceX:h.x,sourceY:h.y,targetX:g.x,targetY:g.y,sourcePosition:d,targetPosition:f}}function hS(e){if(!e)return null;const t=[],n=[];for(const i of e)i.width=i.width??1,i.height=i.height??1,i.type==="source"?t.push(i):i.type==="target"&&n.push(i);return{source:t,target:n}}function vl(e,t,n=Ge.Left,i=!1){const a=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,l=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:o,height:d}=t??va(e);if(i)return{x:a+o/2,y:l+d/2};switch((t==null?void 0:t.position)??n){case Ge.Top:return{x:a+o/2,y:l};case Ge.Right:return{x:a+o,y:l+d/2};case Ge.Bottom:return{x:a+o/2,y:l+d};case Ge.Left:return{x:a,y:l+d/2}}}function pS(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function xb(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function PG(e,{id:t,defaultColor:n,defaultMarkerStart:i,defaultMarkerEnd:a}){const l=new Set;return e.reduce((o,d)=>([d.markerStart||i,d.markerEnd||a].forEach(f=>{if(f&&typeof f=="object"){const h=xb(f,t);l.has(h)||(o.push({id:h,color:f.color||n,...f}),l.add(h))}}),o),[]).sort((o,d)=>o.id.localeCompare(d.id))}const YC=1e3,BG=10,Wx={nodeOrigin:[0,0],nodeExtent:Ou,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},$G={...Wx,checkEquality:!0};function Xx(e,t){const n={...e};for(const i in t)t[i]!==void 0&&(n[i]=t[i]);return n}function UG(e,t,n){const i=Xx(Wx,n);for(const a of e.values())if(a.parentId)Jx(a,e,t,i);else{const l=rd(a,i.nodeOrigin),o=xl(a.extent)?a.extent:i.nodeExtent,d=bl(l,o,va(a));a.internals.positionAbsolute=d}}function FG(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],i=[];for(const a of e.handles){const l={id:a.id,width:a.width??1,height:a.height??1,nodeId:e.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?n.push(l):a.type==="target"&&i.push(l)}return{source:n,target:i}}function Zx(e){return e==="manual"}function vb(e,t,n,i={}){var g,m;const a=Xx($G,i),l={i:0},o=new Map(t),d=a!=null&&a.elevateNodesOnSelect&&!Zx(a.zIndexMode)?YC:0;let f=e.length>0,h=!1;t.clear(),n.clear();for(const y of e){let b=o.get(y.id);if(a.checkEquality&&y===(b==null?void 0:b.internals.userNode))t.set(y.id,b);else{const k=rd(y,a.nodeOrigin),v=xl(y.extent)?y.extent:a.nodeExtent,N=bl(k,v,va(y));b={...a.defaults,...y,measured:{width:(g=y.measured)==null?void 0:g.width,height:(m=y.measured)==null?void 0:m.height},internals:{positionAbsolute:N,handleBounds:FG(y,b),z:QC(y,d,a.zIndexMode),userNode:y}},t.set(y.id,b)}(b.measured===void 0||b.measured.width===void 0||b.measured.height===void 0)&&!b.hidden&&(f=!1),y.parentId&&Jx(b,t,n,i,l),h||(h=y.selected??!1)}return{nodesInitialized:f,hasSelectedNodes:h}}function qG(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Jx(e,t,n,i,a){const{elevateNodesOnSelect:l,nodeOrigin:o,nodeExtent:d,zIndexMode:f}=Xx(Wx,i),h=e.parentId,g=t.get(h);if(!g){console.warn(`Parent node ${h} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}qG(e,n),a&&!g.parentId&&g.internals.rootParentIndex===void 0&&f==="auto"&&(g.internals.rootParentIndex=++a.i,g.internals.z=g.internals.z+a.i*BG),a&&g.internals.rootParentIndex!==void 0&&(a.i=g.internals.rootParentIndex);const m=l&&!Zx(f)?YC:0,{x:y,y:b,z:k}=HG(e,g,o,d,m,f),{positionAbsolute:v}=e.internals,N=y!==v.x||b!==v.y;(N||k!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:N?{x:y,y:b}:v,z:k}})}function QC(e,t,n){const i=or(e.zIndex)?e.zIndex:0;return Zx(n)?i:i+(e.selected?t:0)}function HG(e,t,n,i,a,l){const{x:o,y:d}=t.internals.positionAbsolute,f=va(e),h=rd(e,n),g=xl(e.extent)?bl(h,e.extent,f):h;let m=bl({x:o+g.x,y:d+g.y},i,f);e.extent==="parent"&&(m=LC(m,f,t));const y=QC(e,a,l),b=t.internals.z??0;return{x:m.x,y:m.y,z:b>=y?b+1:y}}function ev(e,t,n,i=[0,0]){var o;const a=[],l=new Map;for(const d of e){const f=t.get(d.parentId);if(!f)continue;const h=((o=l.get(d.parentId))==null?void 0:o.expandedRect)??Lu(f),g=IC(h,d.rect);l.set(d.parentId,{expandedRect:g,parent:f})}return l.size>0&&l.forEach(({expandedRect:d,parent:f},h)=>{var S;const g=f.internals.positionAbsolute,m=va(f),y=f.origin??i,b=d.x<g.x?Math.round(Math.abs(g.x-d.x)):0,k=d.y<g.y?Math.round(Math.abs(g.y-d.y)):0,v=Math.max(m.width,Math.round(d.width)),N=Math.max(m.height,Math.round(d.height)),E=(v-m.width)*y[0],C=(N-m.height)*y[1];(b>0||k>0||E||C)&&(a.push({id:h,type:"position",position:{x:f.position.x-b+E,y:f.position.y-k+C}}),(S=n.get(h))==null||S.forEach(_=>{e.some(M=>M.id===_.id)||a.push({id:_.id,type:"position",position:{x:_.position.x+b,y:_.position.y+k}})})),(m.width<d.width||m.height<d.height||b||k)&&a.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:v+(b?y[0]*b-E:0),height:N+(k?y[1]*k-C:0)}})}),a}function KG(e,t,n,i,a,l,o){const d=i==null?void 0:i.querySelector(".xyflow__viewport");let f=!1;if(!d)return{changes:[],updatedInternals:f};const h=[],g=window.getComputedStyle(d),{m22:m}=new window.DOMMatrixReadOnly(g.transform),y=[];for(const b of e.values()){const k=t.get(b.id);if(!k)continue;if(k.hidden){t.set(k.id,{...k,internals:{...k.internals,handleBounds:void 0}}),f=!0;continue}const v=Qx(b.nodeElement),N=k.measured.width!==v.width||k.measured.height!==v.height;if(!!(v.width&&v.height&&(N||!k.internals.handleBounds||b.force))){const C=b.nodeElement.getBoundingClientRect(),S=xl(k.extent)?k.extent:l;let{positionAbsolute:_}=k.internals;k.parentId&&k.extent==="parent"?_=LC(_,v,t.get(k.parentId)):S&&(_=bl(_,S,v));const M={...k,measured:v,internals:{...k.internals,positionAbsolute:_,handleBounds:{source:oS("source",b.nodeElement,C,m,k.id),target:oS("target",b.nodeElement,C,m,k.id)}}};t.set(k.id,M),k.parentId&&Jx(M,t,n,{nodeOrigin:a,zIndexMode:o}),f=!0,N&&(h.push({id:k.id,type:"dimensions",dimensions:v}),k.expandParent&&k.parentId&&y.push({id:k.id,parentId:k.parentId,rect:Lu(M,a)}))}}if(y.length>0){const b=ev(y,t,n,a);h.push(...b)}return{changes:h,updatedInternals:f}}async function GG({delta:e,panZoom:t,transform:n,translateExtent:i,width:a,height:l}){if(!t||!e.x&&!e.y)return!1;const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[a,l]],i);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function mS(e,t,n,i,a,l){let o=a;const d=i.get(o)||new Map;i.set(o,d.set(n,t)),o=`${a}-${e}`;const f=i.get(o)||new Map;if(i.set(o,f.set(n,t)),l){o=`${a}-${e}-${l}`;const h=i.get(o)||new Map;i.set(o,h.set(n,t))}}function WC(e,t,n){e.clear(),t.clear();for(const i of n){const{source:a,target:l,sourceHandle:o=null,targetHandle:d=null}=i,f={edgeId:i.id,source:a,target:l,sourceHandle:o,targetHandle:d},h=`${a}-${o}--${l}-${d}`,g=`${l}-${d}--${a}-${o}`;mS("source",f,g,e,a,o),mS("target",f,h,e,l,d),t.set(i.id,i)}}function XC(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:XC(n,t):!1}function gS(e,t,n){var a;let i=e;do{if((a=i==null?void 0:i.matches)!=null&&a.call(i,t))return!0;if(i===n)return!1;i=i==null?void 0:i.parentElement}while(i);return!1}function VG(e,t,n,i){const a=new Map;for(const[l,o]of e)if((o.selected||o.id===i)&&(!o.parentId||!XC(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const d=e.get(l);d&&a.set(l,{id:l,position:d.position||{x:0,y:0},distance:{x:n.x-d.internals.positionAbsolute.x,y:n.y-d.internals.positionAbsolute.y},extent:d.extent,parentId:d.parentId,origin:d.origin,expandParent:d.expandParent,internals:{positionAbsolute:d.internals.positionAbsolute||{x:0,y:0}},measured:{width:d.measured.width??0,height:d.measured.height??0}})}return a}function py({nodeId:e,dragItems:t,nodeLookup:n,dragging:i=!0}){var o,d,f;const a=[];for(const[h,g]of t){const m=(o=n.get(h))==null?void 0:o.internals.userNode;m&&a.push({...m,position:g.position,dragging:i})}if(!e)return[a[0],a];const l=(d=n.get(e))==null?void 0:d.internals.userNode;return[l?{...l,position:((f=t.get(e))==null?void 0:f.position)||l.position,dragging:i}:a[0],a]}function YG({dragItems:e,snapGrid:t,x:n,y:i}){const a=e.values().next().value;if(!a)return null;const l={x:n-a.distance.x,y:i-a.distance.y},o=sd(l,t);return{x:o.x-l.x,y:o.y-l.y}}function QG({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:i,onDragStop:a}){let l={x:null,y:null},o=0,d=new Map,f=!1,h={x:0,y:0},g=null,m=!1,y=null,b=!1,k=!1,v=null;function N({noDragClassName:C,handleSelector:S,domNode:_,isSelectable:M,nodeId:T,nodeClickDistance:R=0}){y=_i(_);function O({x:F,y:Y}){const{nodeLookup:D,nodeExtent:K,snapGrid:P,snapToGrid:H,nodeOrigin:Q,onNodeDrag:G,onSelectionDrag:L,onError:z,updateNodePositions:V}=t();l={x:F,y:Y};let B=!1;const le=d.size>1,ve=le&&K?yb(ad(d)):null,ke=le&&H?YG({dragItems:d,snapGrid:P,x:F,y:Y}):null;for(const[Se,J]of d){if(!D.has(Se))continue;let ue={x:F-J.distance.x,y:Y-J.distance.y};H&&(ue=ke?{x:Math.round(ue.x+ke.x),y:Math.round(ue.y+ke.y)}:sd(ue,P));let Te=null;if(le&&K&&!J.extent&&ve){const{positionAbsolute:ce}=J.internals,Ce=ce.x-ve.x+K[0][0],te=ce.x+J.measured.width-ve.x2+K[1][0],pe=ce.y-ve.y+K[0][1],Fe=ce.y+J.measured.height-ve.y2+K[1][1];Te=[[Ce,pe],[te,Fe]]}const{position:Re,positionAbsolute:De}=RC({nodeId:Se,nextPosition:ue,nodeLookup:D,nodeExtent:Te||K,nodeOrigin:Q,onError:z});B=B||J.position.x!==Re.x||J.position.y!==Re.y,J.position=Re,J.internals.positionAbsolute=De}if(k=k||B,!!B&&(V(d,!0),v&&(i||G||!T&&L))){const[Se,J]=py({nodeId:T,dragItems:d,nodeLookup:D});i==null||i(v,d,Se,J),G==null||G(v,Se,J),T||L==null||L(v,J)}}async function $(){if(!g)return;const{transform:F,panBy:Y,autoPanSpeed:D,autoPanOnNodeDrag:K}=t();if(!K){f=!1,cancelAnimationFrame(o);return}const[P,H]=Vx(h,g,D);(P!==0||H!==0)&&(l.x=(l.x??0)-P/F[2],l.y=(l.y??0)-H/F[2],await Y({x:P,y:H})&&O(l)),o=requestAnimationFrame($)}function I(F){var le;const{nodeLookup:Y,multiSelectionActive:D,nodesDraggable:K,transform:P,snapGrid:H,snapToGrid:Q,selectNodesOnDrag:G,onNodeDragStart:L,onSelectionDragStart:z,unselectNodesAndEdges:V}=t();m=!0,(!G||!M)&&!D&&T&&((le=Y.get(T))!=null&&le.selected||V()),M&&G&&T&&(e==null||e(T));const B=bu(F.sourceEvent,{transform:P,snapGrid:H,snapToGrid:Q,containerBounds:g});if(l=B,d=VG(Y,K,B,T),d.size>0&&(n||L||!T&&z)){const[ve,ke]=py({nodeId:T,dragItems:d,nodeLookup:Y});n==null||n(F.sourceEvent,d,ve,ke),L==null||L(F.sourceEvent,ve,ke),T||z==null||z(F.sourceEvent,ke)}}const q=hC().clickDistance(R).on("start",F=>{const{domNode:Y,nodeDragThreshold:D,transform:K,snapGrid:P,snapToGrid:H}=t();g=(Y==null?void 0:Y.getBoundingClientRect())||null,b=!1,k=!1,v=F.sourceEvent,D===0&&I(F),l=bu(F.sourceEvent,{transform:K,snapGrid:P,snapToGrid:H,containerBounds:g}),h=cr(F.sourceEvent,g)}).on("drag",F=>{const{autoPanOnNodeDrag:Y,transform:D,snapGrid:K,snapToGrid:P,nodeDragThreshold:H,nodeLookup:Q}=t(),G=bu(F.sourceEvent,{transform:D,snapGrid:K,snapToGrid:P,containerBounds:g});if(v=F.sourceEvent,(F.sourceEvent.type==="touchmove"&&F.sourceEvent.touches.length>1||T&&!Q.has(T))&&(b=!0),!b){if(!f&&Y&&m&&(f=!0,$()),!m){const L=cr(F.sourceEvent,g),z=L.x-h.x,V=L.y-h.y;Math.sqrt(z*z+V*V)>H&&I(F)}(l.x!==G.xSnapped||l.y!==G.ySnapped)&&d&&m&&(h=cr(F.sourceEvent,g),O(G))}}).on("end",F=>{if(!m||b){b&&d.size>0&&t().updateNodePositions(d,!1);return}if(f=!1,m=!1,cancelAnimationFrame(o),d.size>0){const{nodeLookup:Y,updateNodePositions:D,onNodeDragStop:K,onSelectionDragStop:P}=t();if(k&&(D(d,!1),k=!1),a||K||!T&&P){const[H,Q]=py({nodeId:T,dragItems:d,nodeLookup:Y,dragging:!1});a==null||a(F.sourceEvent,d,H,Q),K==null||K(F.sourceEvent,H,Q),T||P==null||P(F.sourceEvent,Q)}}}).filter(F=>{const Y=F.target;return!F.button&&(!C||!gS(Y,`.${C}`,_))&&(!S||gS(Y,S,_))});y.call(q)}function E(){y==null||y.on(".drag",null)}return{update:N,destroy:E}}function WG(e,t,n){const i=[],a={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const l of t.values())Lh(a,Lu(l))>0&&i.push(l);return i}const XG=250;function ZG(e,t,n,i){var d,f;let a=[],l=1/0;const o=WG(e,n,t+XG);for(const h of o){const g=[...((d=h.internals.handleBounds)==null?void 0:d.source)??[],...((f=h.internals.handleBounds)==null?void 0:f.target)??[]];for(const m of g){if(i.nodeId===m.nodeId&&i.type===m.type&&i.id===m.id)continue;const{x:y,y:b}=vl(h,m,m.position,!0),k=Math.sqrt(Math.pow(y-e.x,2)+Math.pow(b-e.y,2));k>t||(k<l?(a=[{...m,x:y,y:b}],l=k):k===l&&a.push({...m,x:y,y:b}))}}if(!a.length)return null;if(a.length>1){const h=i.type==="source"?"target":"source";return a.find(g=>g.type===h)??a[0]}return a[0]}function ZC(e,t,n,i,a,l=!1){var h,g,m;const o=i.get(e);if(!o)return null;const d=a==="strict"?(h=o.internals.handleBounds)==null?void 0:h[t]:[...((g=o.internals.handleBounds)==null?void 0:g.source)??[],...((m=o.internals.handleBounds)==null?void 0:m.target)??[]],f=(n?d==null?void 0:d.find(y=>y.id===n):d==null?void 0:d[0])??null;return f&&l?{...f,...vl(o,f,f.position,!0)}:f}function JC(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function JG(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const eA=()=>!0;function eV(e,{connectionMode:t,connectionRadius:n,handleId:i,nodeId:a,edgeUpdaterType:l,isTarget:o,domNode:d,nodeLookup:f,lib:h,autoPanOnConnect:g,flowId:m,panBy:y,cancelConnection:b,onConnectStart:k,onConnect:v,onConnectEnd:N,isValidConnection:E=eA,onReconnectEnd:C,updateConnection:S,getTransform:_,getFromHandle:M,autoPanSpeed:T,dragThreshold:R=1,handleDomNode:O}){const $=UC(e.target);let I=0,q;const{x:F,y:Y}=cr(e),D=JC(l,O),K=d==null?void 0:d.getBoundingClientRect();let P=!1;if(!K||!D)return;const H=ZC(a,D,i,f,t);if(!H)return;let Q=cr(e,K),G=!1,L=null,z=!1,V=null;function B(){if(!g||!K)return;const[Re,De]=Vx(Q,K,T);y({x:Re,y:De}),I=requestAnimationFrame(B)}const le={...H,nodeId:a,type:D,position:H.position},ve=f.get(a);let Se={inProgress:!0,isValid:null,from:vl(ve,le,Ge.Left,!0),fromHandle:le,fromPosition:le.position,fromNode:ve,to:Q,toHandle:null,toPosition:rS[le.position],toNode:null,pointer:Q};function J(){P=!0,S(Se),k==null||k(e,{nodeId:a,handleId:i,handleType:D})}R===0&&J();function ue(Re){if(!P){const{x:Fe,y:ze}=cr(Re),ae=Fe-F,be=ze-Y;if(!(ae*ae+be*be>R*R))return;J()}if(!M()||!le){Te(Re);return}const De=_();Q=cr(Re,K),q=ZG(ld(Q,De,!1,[1,1]),n,f,le),G||(B(),G=!0);const ce=tA(Re,{handle:q,connectionMode:t,fromNodeId:a,fromHandleId:i,fromType:o?"target":"source",isValidConnection:E,doc:$,lib:h,flowId:m,nodeLookup:f});V=ce.handleDomNode,L=ce.connection,z=JG(!!q,ce.isValid);const Ce=f.get(a),te=Ce?vl(Ce,le,Ge.Left,!0):Se.from,pe={...Se,from:te,isValid:z,to:ce.toHandle&&z?Go({x:ce.toHandle.x,y:ce.toHandle.y},De):Q,toHandle:ce.toHandle,toPosition:z&&ce.toHandle?ce.toHandle.position:rS[le.position],toNode:ce.toHandle?f.get(ce.toHandle.nodeId):null,pointer:Q};S(pe),Se=pe}function Te(Re){if(!("touches"in Re&&Re.touches.length>0)){if(P){(q||V)&&L&&z&&(v==null||v(L));const{inProgress:De,...ce}=Se,Ce={...ce,toPosition:Se.toHandle?Se.toPosition:null};N==null||N(Re,Ce),l&&(C==null||C(Re,Ce))}b(),cancelAnimationFrame(I),G=!1,z=!1,L=null,V=null,$.removeEventListener("mousemove",ue),$.removeEventListener("mouseup",Te),$.removeEventListener("touchmove",ue),$.removeEventListener("touchend",Te)}}$.addEventListener("mousemove",ue),$.addEventListener("mouseup",Te),$.addEventListener("touchmove",ue),$.addEventListener("touchend",Te)}function tA(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:a,fromType:l,doc:o,lib:d,flowId:f,isValidConnection:h=eA,nodeLookup:g}){const m=l==="target",y=t?o.querySelector(`.${d}-flow__handle[data-id="${f}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:b,y:k}=cr(e),v=o.elementFromPoint(b,k),N=v!=null&&v.classList.contains(`${d}-flow__handle`)?v:y,E={handleDomNode:N,isValid:!1,connection:null,toHandle:null};if(N){const C=JC(void 0,N),S=N.getAttribute("data-nodeid"),_=N.getAttribute("data-handleid"),M=N.classList.contains("connectable"),T=N.classList.contains("connectableend");if(!S||!C)return E;const R={source:m?S:i,sourceHandle:m?_:a,target:m?i:S,targetHandle:m?a:_};E.connection=R;const $=M&&T&&(n===Ho.Strict?m&&C==="source"||!m&&C==="target":S!==i||_!==a);E.isValid=$&&h(R),E.toHandle=ZC(S,C,_,g,n,!0)}return E}const wb={onPointerDown:eV,isValid:tA};function tV({domNode:e,panZoom:t,getTransform:n,getViewScale:i}){const a=_i(e);function l({translateExtent:d,width:f,height:h,zoomStep:g=1,pannable:m=!0,zoomable:y=!0,inversePan:b=!1}){const k=S=>{if(S.sourceEvent.type!=="wheel"||!t)return;const _=n(),M=S.sourceEvent.ctrlKey&&Iu()?10:1,T=-S.sourceEvent.deltaY*(S.sourceEvent.deltaMode===1?.05:S.sourceEvent.deltaMode?1:.002)*g,R=_[2]*Math.pow(2,T*M);t.scaleTo(R)};let v=[0,0];const N=S=>{(S.sourceEvent.type==="mousedown"||S.sourceEvent.type==="touchstart")&&(v=[S.sourceEvent.clientX??S.sourceEvent.touches[0].clientX,S.sourceEvent.clientY??S.sourceEvent.touches[0].clientY])},E=S=>{const _=n();if(S.sourceEvent.type!=="mousemove"&&S.sourceEvent.type!=="touchmove"||!t)return;const M=[S.sourceEvent.clientX??S.sourceEvent.touches[0].clientX,S.sourceEvent.clientY??S.sourceEvent.touches[0].clientY],T=[M[0]-v[0],M[1]-v[1]];v=M;const R=i()*Math.max(_[2],Math.log(_[2]))*(b?-1:1),O={x:_[0]-T[0]*R,y:_[1]-T[1]*R},$=[[0,0],[f,h]];t.setViewportConstrained({x:O.x,y:O.y,zoom:_[2]},$,d)},C=CC().on("start",N).on("zoom",m?E:null).on("zoom.wheel",y?k:null);a.call(C,{})}function o(){a.on("zoom",null)}return{update:l,destroy:o,pointer:sr}}const gp=e=>({x:e.x,y:e.y,zoom:e.k}),my=({x:e,y:t,zoom:n})=>hp.translate(e,t).scale(n),vo=(e,t)=>e.target.closest(`.${t}`),nA=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),nV=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,gy=(e,t=0,n=nV,i=()=>{})=>{const a=typeof t=="number"&&t>0;return a||i(),a?e.transition().duration(t).ease(n).on("end",i):e},iA=e=>{const t=e.ctrlKey&&Iu()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function iV({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:i,panOnScrollMode:a,panOnScrollSpeed:l,zoomOnPinch:o,onPanZoomStart:d,onPanZoom:f,onPanZoomEnd:h}){return g=>{if(vo(g,t))return g.ctrlKey&&g.preventDefault(),!1;g.preventDefault(),g.stopImmediatePropagation();const m=n.property("__zoom").k||1;if(g.ctrlKey&&o){const N=sr(g),E=iA(g),C=m*Math.pow(2,E);i.scaleTo(n,C,N,g);return}const y=g.deltaMode===1?20:1;let b=a===ul.Vertical?0:g.deltaX*y,k=a===ul.Horizontal?0:g.deltaY*y;!Iu()&&g.shiftKey&&a!==ul.Vertical&&(b=g.deltaY*y,k=0),i.translateBy(n,-(b/m)*l,-(k/m)*l,{internal:!0});const v=gp(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(f==null||f(g,v),e.panScrollTimeout=setTimeout(()=>{h==null||h(g,v),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,d==null||d(g,v))}}function rV({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(i,a){const l=i.type==="wheel",o=!t&&l&&!i.ctrlKey,d=vo(i,e);if(i.ctrlKey&&l&&d&&i.preventDefault(),o||d)return null;i.preventDefault(),n.call(this,i,a)}}function aV({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return i=>{var l,o,d;if((l=i.sourceEvent)!=null&&l.internal)return;const a=gp(i.transform);e.mouseButton=((o=i.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=a,((d=i.sourceEvent)==null?void 0:d.type)==="mousedown"&&t(!0),n&&(n==null||n(i.sourceEvent,a))}}function sV({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:a}){return l=>{var o,d;e.usedRightMouseButton=!!(n&&nA(t,e.mouseButton??0)),(o=l.sourceEvent)!=null&&o.sync||i([l.transform.x,l.transform.y,l.transform.k]),a&&!((d=l.sourceEvent)!=null&&d.internal)&&(a==null||a(l.sourceEvent,gp(l.transform)))}}function lV({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:i,onPanZoomEnd:a,onPaneContextMenu:l}){return o=>{var d;if(!((d=o.sourceEvent)!=null&&d.internal)&&(e.isZoomingOrPanning=!1,l&&nA(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&l(o.sourceEvent),e.usedRightMouseButton=!1,i(!1),a)){const f=gp(o.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a==null||a(o.sourceEvent,f)},n?150:0)}}}function oV({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:i,panOnScroll:a,zoomOnDoubleClick:l,userSelectionActive:o,noWheelClassName:d,noPanClassName:f,lib:h,connectionInProgress:g}){return m=>{var N;const y=e||t,b=n&&m.ctrlKey,k=m.type==="wheel";if(m.button===1&&m.type==="mousedown"&&(vo(m,`${h}-flow__node`)||vo(m,`${h}-flow__edge`)))return!0;if(!i&&!y&&!a&&!l&&!n||o||g&&!k||vo(m,d)&&k||vo(m,f)&&(!k||a&&k&&!e)||!n&&m.ctrlKey&&k)return!1;if(!n&&m.type==="touchstart"&&((N=m.touches)==null?void 0:N.length)>1)return m.preventDefault(),!1;if(!y&&!a&&!b&&k||!i&&(m.type==="mousedown"||m.type==="touchstart")||Array.isArray(i)&&!i.includes(m.button)&&m.type==="mousedown")return!1;const v=Array.isArray(i)&&i.includes(m.button)||!m.button||m.button<=1;return(!m.ctrlKey||k)&&v}}function cV({domNode:e,minZoom:t,maxZoom:n,translateExtent:i,viewport:a,onPanZoom:l,onPanZoomStart:o,onPanZoomEnd:d,onDraggingChange:f}){const h={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},g=e.getBoundingClientRect(),m=CC().scaleExtent([t,n]).translateExtent(i),y=_i(e).call(m);C({x:a.x,y:a.y,zoom:Ko(a.zoom,t,n)},[[0,0],[g.width,g.height]],i);const b=y.on("wheel.zoom"),k=y.on("dblclick.zoom");m.wheelDelta(iA);async function v(q,F){return y?new Promise(Y=>{m==null||m.interpolate((F==null?void 0:F.interpolate)==="linear"?yu:rh).transform(gy(y,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>Y(!0)),q)}):!1}function N({noWheelClassName:q,noPanClassName:F,onPaneContextMenu:Y,userSelectionActive:D,panOnScroll:K,panOnDrag:P,panOnScrollMode:H,panOnScrollSpeed:Q,preventScrolling:G,zoomOnPinch:L,zoomOnScroll:z,zoomOnDoubleClick:V,zoomActivationKeyPressed:B,lib:le,onTransformChange:ve,connectionInProgress:ke,paneClickDistance:Se,selectionOnDrag:J}){D&&!h.isZoomingOrPanning&&E();const ue=K&&!B&&!D;m.clickDistance(J?1/0:!or(Se)||Se<0?0:Se);const Te=ue?iV({zoomPanValues:h,noWheelClassName:q,d3Selection:y,d3Zoom:m,panOnScrollMode:H,panOnScrollSpeed:Q,zoomOnPinch:L,onPanZoomStart:o,onPanZoom:l,onPanZoomEnd:d}):rV({noWheelClassName:q,preventScrolling:G,d3ZoomHandler:b});y.on("wheel.zoom",Te,{passive:!1});const Re=aV({zoomPanValues:h,onDraggingChange:f,onPanZoomStart:o});m.on("start",Re);const De=sV({zoomPanValues:h,panOnDrag:P,onPaneContextMenu:!!Y,onPanZoom:l,onTransformChange:ve});m.on("zoom",De);const ce=lV({zoomPanValues:h,panOnDrag:P,panOnScroll:K,onPaneContextMenu:Y,onPanZoomEnd:d,onDraggingChange:f});m.on("end",ce);const Ce=oV({zoomActivationKeyPressed:B,panOnDrag:P,zoomOnScroll:z,panOnScroll:K,zoomOnDoubleClick:V,zoomOnPinch:L,userSelectionActive:D,noPanClassName:F,noWheelClassName:q,lib:le,connectionInProgress:ke});m.filter(Ce),V?y.on("dblclick.zoom",k):y.on("dblclick.zoom",null)}function E(){m.on("zoom",null)}async function C(q,F,Y){const D=my(q),K=m==null?void 0:m.constrain()(D,F,Y);return K&&await v(K),K}async function S(q,F){const Y=my(q);return await v(Y,F),Y}function _(q){if(y){const F=my(q),Y=y.property("__zoom");(Y.k!==q.zoom||Y.x!==q.x||Y.y!==q.y)&&(m==null||m.transform(y,F,null,{sync:!0}))}}function M(){const q=y?jC(y.node()):{x:0,y:0,k:1};return{x:q.x,y:q.y,zoom:q.k}}async function T(q,F){return y?new Promise(Y=>{m==null||m.interpolate((F==null?void 0:F.interpolate)==="linear"?yu:rh).scaleTo(gy(y,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>Y(!0)),q)}):!1}async function R(q,F){return y?new Promise(Y=>{m==null||m.interpolate((F==null?void 0:F.interpolate)==="linear"?yu:rh).scaleBy(gy(y,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>Y(!0)),q)}):!1}function O(q){m==null||m.scaleExtent(q)}function $(q){m==null||m.translateExtent(q)}function I(q){const F=!or(q)||q<0?0:q;m==null||m.clickDistance(F)}return{update:N,destroy:E,setViewport:S,setViewportConstrained:C,getViewport:M,scaleTo:T,scaleBy:R,setScaleExtent:O,setTranslateExtent:$,syncViewport:_,setClickDistance:I}}var Vo;(function(e){e.Line="line",e.Handle="handle"})(Vo||(Vo={}));function uV({width:e,prevWidth:t,height:n,prevHeight:i,affectsX:a,affectsY:l}){const o=e-t,d=n-i,f=[o>0?1:o<0?-1:0,d>0?1:d<0?-1:0];return o&&a&&(f[0]=f[0]*-1),d&&l&&(f[1]=f[1]*-1),f}function yS(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),i=e.includes("left"),a=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:i,affectsY:a}}function rs(e,t){return Math.max(0,t-e)}function as(e,t){return Math.max(0,e-t)}function Gf(e,t,n){return Math.max(0,t-e,e-n)}function bS(e,t){return e?!t:t}function dV(e,t,n,i,a,l,o,d){let{affectsX:f,affectsY:h}=t;const{isHorizontal:g,isVertical:m}=t,y=g&&m,{xSnapped:b,ySnapped:k}=n,{minWidth:v,maxWidth:N,minHeight:E,maxHeight:C}=i,{x:S,y:_,width:M,height:T,aspectRatio:R}=e;let O=Math.floor(g?b-e.pointerX:0),$=Math.floor(m?k-e.pointerY:0);const I=M+(f?-O:O),q=T+(h?-$:$),F=-l[0]*M,Y=-l[1]*T;let D=Gf(I,v,N),K=Gf(q,E,C);if(o){let Q=0,G=0;f&&O<0?Q=rs(S+O+F,o[0][0]):!f&&O>0&&(Q=as(S+I+F,o[1][0])),h&&$<0?G=rs(_+$+Y,o[0][1]):!h&&$>0&&(G=as(_+q+Y,o[1][1])),D=Math.max(D,Q),K=Math.max(K,G)}if(d){let Q=0,G=0;f&&O>0?Q=as(S+O,d[0][0]):!f&&O<0&&(Q=rs(S+I,d[1][0])),h&&$>0?G=as(_+$,d[0][1]):!h&&$<0&&(G=rs(_+q,d[1][1])),D=Math.max(D,Q),K=Math.max(K,G)}if(a){if(g){const Q=Gf(I/R,E,C)*R;if(D=Math.max(D,Q),o){let G=0;!f&&!h||f&&!h&&y?G=as(_+Y+I/R,o[1][1])*R:G=rs(_+Y+(f?O:-O)/R,o[0][1])*R,D=Math.max(D,G)}if(d){let G=0;!f&&!h||f&&!h&&y?G=rs(_+I/R,d[1][1])*R:G=as(_+(f?O:-O)/R,d[0][1])*R,D=Math.max(D,G)}}if(m){const Q=Gf(q*R,v,N)/R;if(K=Math.max(K,Q),o){let G=0;!f&&!h||h&&!f&&y?G=as(S+q*R+F,o[1][0])/R:G=rs(S+(h?$:-$)*R+F,o[0][0])/R,K=Math.max(K,G)}if(d){let G=0;!f&&!h||h&&!f&&y?G=rs(S+q*R,d[1][0])/R:G=as(S+(h?$:-$)*R,d[0][0])/R,K=Math.max(K,G)}}}$=$+($<0?K:-K),O=O+(O<0?D:-D),a&&(y?I>q*R?$=(bS(f,h)?-O:O)/R:O=(bS(f,h)?-$:$)*R:g?($=O/R,h=f):(O=$*R,f=h));const P=f?S+O:S,H=h?_+$:_;return{width:M+(f?-O:O),height:T+(h?-$:$),x:l[0]*O*(f?-1:1)+P,y:l[1]*$*(h?-1:1)+H}}const rA={width:0,height:0,x:0,y:0},fV={...rA,pointerX:0,pointerY:0,aspectRatio:1};function hV(e,t,n){const i=t.position.x+e.position.x,a=t.position.y+e.position.y,l=e.measured.width??0,o=e.measured.height??0,d=n[0]*l,f=n[1]*o;return[[i-d,a-f],[i+l-d,a+o-f]]}function pV({domNode:e,nodeId:t,getStoreItems:n,onChange:i,onEnd:a}){const l=_i(e);let o={controlDirection:yS("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function d({controlPosition:h,boundaries:g,keepAspectRatio:m,resizeDirection:y,onResizeStart:b,onResize:k,onResizeEnd:v,shouldResize:N}){let E={...rA},C={...fV};o={boundaries:g,resizeDirection:y,keepAspectRatio:m,controlDirection:yS(h)};let S,_=null,M=[],T,R,O,$=!1;const I=hC().on("start",q=>{const{nodeLookup:F,transform:Y,snapGrid:D,snapToGrid:K,nodeOrigin:P,paneDomNode:H}=n();if(S=F.get(t),!S)return;_=(H==null?void 0:H.getBoundingClientRect())??null;const{xSnapped:Q,ySnapped:G}=bu(q.sourceEvent,{transform:Y,snapGrid:D,snapToGrid:K,containerBounds:_});E={width:S.measured.width??0,height:S.measured.height??0,x:S.position.x??0,y:S.position.y??0},C={...E,pointerX:Q,pointerY:G,aspectRatio:E.width/E.height},T=void 0,R=xl(S.extent)?S.extent:void 0,S.parentId&&(S.extent==="parent"||S.expandParent)&&(T=F.get(S.parentId)),T&&S.extent==="parent"&&(R=[[0,0],[T.measured.width,T.measured.height]]),M=[],O=void 0;for(const[L,z]of F)if(z.parentId===t&&(M.push({id:L,position:{...z.position},extent:z.extent}),z.extent==="parent"||z.expandParent)){const V=hV(z,S,z.origin??P);O?O=[[Math.min(V[0][0],O[0][0]),Math.min(V[0][1],O[0][1])],[Math.max(V[1][0],O[1][0]),Math.max(V[1][1],O[1][1])]]:O=V}b==null||b(q,{...E})}).on("drag",q=>{const{transform:F,snapGrid:Y,snapToGrid:D,nodeOrigin:K}=n(),P=bu(q.sourceEvent,{transform:F,snapGrid:Y,snapToGrid:D,containerBounds:_}),H=[];if(!S)return;const{x:Q,y:G,width:L,height:z}=E,V={},B=S.origin??K,{width:le,height:ve,x:ke,y:Se}=dV(C,o.controlDirection,P,o.boundaries,o.keepAspectRatio,B,R,O),J=le!==L,ue=ve!==z,Te=ke!==Q&&J,Re=Se!==G&&ue;if(!Te&&!Re&&!J&&!ue)return;if((Te||Re||B[0]===1||B[1]===1)&&(V.x=Te?ke:E.x,V.y=Re?Se:E.y,E.x=V.x,E.y=V.y,M.length>0)){const te=ke-Q,pe=Se-G;for(const Fe of M)Fe.position={x:Fe.position.x-te+B[0]*(le-L),y:Fe.position.y-pe+B[1]*(ve-z)},H.push(Fe)}if((J||ue)&&(V.width=J&&(!o.resizeDirection||o.resizeDirection==="horizontal")?le:E.width,V.height=ue&&(!o.resizeDirection||o.resizeDirection==="vertical")?ve:E.height,E.width=V.width,E.height=V.height),T&&S.expandParent){const te=B[0]*(V.width??0);V.x&&V.x<te&&(E.x=te,C.x=C.x-(V.x-te));const pe=B[1]*(V.height??0);V.y&&V.y<pe&&(E.y=pe,C.y=C.y-(V.y-pe))}const De=uV({width:E.width,prevWidth:L,height:E.height,prevHeight:z,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),ce={...E,direction:De};(N==null?void 0:N(q,ce))!==!1&&($=!0,k==null||k(q,ce),i(V,H))}).on("end",q=>{$&&(v==null||v(q,{...E}),a==null||a({...E}),$=!1)});l.call(I)}function f(){l.on(".drag",null)}return{update:d,destroy:f}}var yy={exports:{}},by={},xy={exports:{}},vy={};/**
659
+ * @license React
660
+ * use-sync-external-store-shim.production.js
661
+ *
662
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
663
+ *
664
+ * This source code is licensed under the MIT license found in the
665
+ * LICENSE file in the root directory of this source tree.
666
+ */var xS;function mV(){if(xS)return vy;xS=1;var e=Hu();function t(m,y){return m===y&&(m!==0||1/m===1/y)||m!==m&&y!==y}var n=typeof Object.is=="function"?Object.is:t,i=e.useState,a=e.useEffect,l=e.useLayoutEffect,o=e.useDebugValue;function d(m,y){var b=y(),k=i({inst:{value:b,getSnapshot:y}}),v=k[0].inst,N=k[1];return l(function(){v.value=b,v.getSnapshot=y,f(v)&&N({inst:v})},[m,b,y]),a(function(){return f(v)&&N({inst:v}),m(function(){f(v)&&N({inst:v})})},[m]),o(b),b}function f(m){var y=m.getSnapshot;m=m.value;try{var b=y();return!n(m,b)}catch{return!0}}function h(m,y){return y()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:d;return vy.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,vy}var vS;function gV(){return vS||(vS=1,xy.exports=mV()),xy.exports}/**
667
+ * @license React
668
+ * use-sync-external-store-shim/with-selector.production.js
669
+ *
670
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
671
+ *
672
+ * This source code is licensed under the MIT license found in the
673
+ * LICENSE file in the root directory of this source tree.
674
+ */var wS;function yV(){if(wS)return by;wS=1;var e=Hu(),t=gV();function n(h,g){return h===g&&(h!==0||1/h===1/g)||h!==h&&g!==g}var i=typeof Object.is=="function"?Object.is:n,a=t.useSyncExternalStore,l=e.useRef,o=e.useEffect,d=e.useMemo,f=e.useDebugValue;return by.useSyncExternalStoreWithSelector=function(h,g,m,y,b){var k=l(null);if(k.current===null){var v={hasValue:!1,value:null};k.current=v}else v=k.current;k=d(function(){function E(T){if(!C){if(C=!0,S=T,T=y(T),b!==void 0&&v.hasValue){var R=v.value;if(b(R,T))return _=R}return _=T}if(R=_,i(S,T))return R;var O=y(T);return b!==void 0&&b(R,O)?(S=T,R):(S=T,_=O)}var C=!1,S,_,M=m===void 0?null:m;return[function(){return E(g())},M===null?void 0:function(){return E(M())}]},[g,m,y,b]);var N=a(h,k[0],k[1]);return o(function(){v.hasValue=!0,v.value=N},[N]),f(N),N},by}var kS;function bV(){return kS||(kS=1,yy.exports=yV()),yy.exports}var xV=bV();const vV=qu(xV),wV={},ES=e=>{let t;const n=new Set,i=(g,m)=>{const y=typeof g=="function"?g(t):g;if(!Object.is(y,t)){const b=t;t=m??(typeof y!="object"||y===null)?y:Object.assign({},t,y),n.forEach(k=>k(t,b))}},a=()=>t,f={setState:i,getState:a,getInitialState:()=>h,subscribe:g=>(n.add(g),()=>n.delete(g)),destroy:()=>{(wV?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},h=t=e(i,a,f);return f},kV=e=>e?ES(e):ES,{useDebugValue:EV}=JM,{useSyncExternalStoreWithSelector:SV}=vV,NV=e=>e;function aA(e,t=NV,n){const i=SV(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return EV(i),i}const SS=(e,t)=>{const n=kV(e),i=(a,l=t)=>aA(n,a,l);return Object.assign(i,n),i},_V=(e,t)=>e?SS(e,t):SS;function tn(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[i,a]of e)if(!Object.is(a,t.get(i)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(t,i)||!Object.is(e[i],t[i]))return!1;return!0}const yp=j.createContext(null),jV=yp.Provider,sA=hr.error001("react");function St(e,t){const n=j.useContext(yp);if(n===null)throw new Error(sA);return aA(n,e,t)}function nn(){const e=j.useContext(yp);if(e===null)throw new Error(sA);return j.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const NS={display:"none"},CV={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},lA="react-flow__node-desc",oA="react-flow__edge-desc",AV="react-flow__aria-live",TV=e=>e.ariaLiveMessage,MV=e=>e.ariaLabelConfig;function DV({rfId:e}){const t=St(TV);return c.jsx("div",{id:`${AV}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:CV,children:t})}function OV({rfId:e,disableKeyboardA11y:t}){const n=St(MV);return c.jsxs(c.Fragment,{children:[c.jsx("div",{id:`${lA}-${e}`,style:NS,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),c.jsx("div",{id:`${oA}-${e}`,style:NS,children:n["edge.a11yDescription.default"]}),!t&&c.jsx(DV,{rfId:e})]})}const bp=j.forwardRef(({position:e="top-left",children:t,className:n,style:i,...a},l)=>{const o=`${e}`.split("-");return c.jsx("div",{className:Nn(["react-flow__panel",n,...o]),style:i,ref:l,...a,children:t})});bp.displayName="Panel";const _S="https://reactflow.dev?utm_source=attribution";function RV({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:c.jsx(bp,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${_S}`,children:c.jsx("a",{href:_S,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const LV=e=>{const t=[],n=[];for(const[,i]of e.nodeLookup)i.selected&&t.push(i.internals.userNode);for(const[,i]of e.edgeLookup)i.selected&&n.push(i);return{selectedNodes:t,selectedEdges:n}},Vf=e=>e.id;function IV(e,t){return tn(e.selectedNodes.map(Vf),t.selectedNodes.map(Vf))&&tn(e.selectedEdges.map(Vf),t.selectedEdges.map(Vf))}function zV({onSelectionChange:e}){const t=nn(),{selectedNodes:n,selectedEdges:i}=St(LV,IV);return j.useEffect(()=>{const a={nodes:n,edges:i};e==null||e(a),t.getState().onSelectionChangeHandlers.forEach(l=>l(a))},[n,i,e]),null}const PV=e=>!!e.onSelectionChangeHandlers;function BV({onSelectionChange:e}){const t=St(PV);return e||t?c.jsx(zV,{onSelectionChange:e}):null}const cA=[0,0],$V={x:0,y:0,zoom:1},UV=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],jS=[...UV,"rfId"],FV=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),CS={translateExtent:Ou,nodeOrigin:cA,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function qV(e){const{setNodes:t,setEdges:n,setMinZoom:i,setMaxZoom:a,setTranslateExtent:l,setNodeExtent:o,reset:d,setDefaultNodesAndEdges:f}=St(FV,tn),h=nn();j.useEffect(()=>(f(e.defaultNodes,e.defaultEdges),()=>{g.current=CS,d()}),[]);const g=j.useRef(CS);return j.useEffect(()=>{for(const m of jS){const y=e[m],b=g.current[m];y!==b&&(typeof e[m]>"u"||(m==="nodes"?t(y):m==="edges"?n(y):m==="minZoom"?i(y):m==="maxZoom"?a(y):m==="translateExtent"?l(y):m==="nodeExtent"?o(y):m==="ariaLabelConfig"?h.setState({ariaLabelConfig:jG(y)}):m==="fitView"?h.setState({fitViewQueued:y}):m==="fitViewOptions"?h.setState({fitViewOptions:y}):h.setState({[m]:y})))}g.current=e},jS.map(m=>e[m])),null}function AS(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function HV(e){var i;const[t,n]=j.useState(e==="system"?null:e);return j.useEffect(()=>{if(e!=="system"){n(e);return}const a=AS(),l=()=>n(a!=null&&a.matches?"dark":"light");return l(),a==null||a.addEventListener("change",l),()=>{a==null||a.removeEventListener("change",l)}},[e]),t!==null?t:(i=AS())!=null&&i.matches?"dark":"light"}const TS=typeof document<"u"?document:null;function zu(e=null,t={target:TS,actInsideInputWithModifier:!0}){const[n,i]=j.useState(!1),a=j.useRef(!1),l=j.useRef(new Set([])),[o,d]=j.useMemo(()=>{if(e!==null){const h=(Array.isArray(e)?e:[e]).filter(m=>typeof m=="string").map(m=>m.replace("+",`
675
+ `).replace(`
676
+
677
+ `,`
678
+ +`).split(`
679
+ `)),g=h.reduce((m,y)=>m.concat(...y),[]);return[h,g]}return[[],[]]},[e]);return j.useEffect(()=>{const f=(t==null?void 0:t.target)??TS,h=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const g=b=>{var N,E;if(a.current=b.ctrlKey||b.metaKey||b.shiftKey||b.altKey,(!a.current||a.current&&!h)&&FC(b))return!1;const v=DS(b.code,d);if(l.current.add(b[v]),MS(o,l.current,!1)){const C=((E=(N=b.composedPath)==null?void 0:N.call(b))==null?void 0:E[0])||b.target,S=(C==null?void 0:C.nodeName)==="BUTTON"||(C==null?void 0:C.nodeName)==="A";t.preventDefault!==!1&&(a.current||!S)&&b.preventDefault(),i(!0)}},m=b=>{const k=DS(b.code,d);MS(o,l.current,!0)?(i(!1),l.current.clear()):l.current.delete(b[k]),b.key==="Meta"&&l.current.clear(),a.current=!1},y=()=>{l.current.clear(),i(!1)};return f==null||f.addEventListener("keydown",g),f==null||f.addEventListener("keyup",m),window.addEventListener("blur",y),window.addEventListener("contextmenu",y),()=>{f==null||f.removeEventListener("keydown",g),f==null||f.removeEventListener("keyup",m),window.removeEventListener("blur",y),window.removeEventListener("contextmenu",y)}}},[e,i]),n}function MS(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(a=>t.has(a)))}function DS(e,t){return t.includes(e)?"code":"key"}const KV=()=>{const e=nn();return j.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:i}=e.getState();return i?i.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[i,a,l],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??i,y:t.y??a,zoom:t.zoom??l},n),!0):!1},getViewport:()=>{const[t,n,i]=e.getState().transform;return{x:t,y:n,zoom:i}},setCenter:async(t,n,i)=>e.getState().setCenter(t,n,i),fitBounds:async(t,n)=>{const{width:i,height:a,minZoom:l,maxZoom:o,panZoom:d}=e.getState(),f=Yx(t,i,a,l,o,(n==null?void 0:n.padding)??.1);return d?(await d.setViewport(f,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:i,snapGrid:a,snapToGrid:l,domNode:o}=e.getState();if(!o)return t;const{x:d,y:f}=o.getBoundingClientRect(),h={x:t.x-d,y:t.y-f},g=n.snapGrid??a,m=n.snapToGrid??l;return ld(h,i,m,g)},flowToScreenPosition:t=>{const{transform:n,domNode:i}=e.getState();if(!i)return t;const{x:a,y:l}=i.getBoundingClientRect(),o=Go(t,n);return{x:o.x+a,y:o.y+l}}}),[])};function uA(e,t){const n=[],i=new Map,a=[];for(const l of e)if(l.type==="add"){a.push(l);continue}else if(l.type==="remove"||l.type==="replace")i.set(l.id,[l]);else{const o=i.get(l.id);o?o.push(l):i.set(l.id,[l])}for(const l of t){const o=i.get(l.id);if(!o){n.push(l);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const d={...l};for(const f of o)GV(f,d);n.push(d)}return a.length&&a.forEach(l=>{l.index!==void 0?n.splice(l.index,0,{...l.item}):n.push({...l.item})}),n}function GV(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function dA(e,t){return uA(e,t)}function fA(e,t){return uA(e,t)}function Ys(e,t){return{id:e,type:"select",selected:t}}function wo(e,t=new Set,n=!1){const i=[];for(const[a,l]of e){const o=t.has(a);!(l.selected===void 0&&!o)&&l.selected!==o&&(n&&(l.selected=o),i.push(Ys(l.id,o)))}return i}function OS({items:e=[],lookup:t}){var a;const n=[],i=new Map(e.map(l=>[l.id,l]));for(const[l,o]of e.entries()){const d=t.get(o.id),f=((a=d==null?void 0:d.internals)==null?void 0:a.userNode)??d;f!==void 0&&f!==o&&n.push({id:o.id,item:o,type:"replace"}),f===void 0&&n.push({item:o,type:"add",index:l})}for(const[l]of t)i.get(l)===void 0&&n.push({id:l,type:"remove"});return n}function RS(e){return{id:e.id,type:"remove"}}const VV=PC();function YV(e,t,n={}){return OG(e,t,{...n,onError:n.onError??VV})}const LS=e=>bG(e),QV=e=>OC(e);function hA(e){return j.forwardRef(e)}const WV=typeof window<"u"?j.useLayoutEffect:j.useEffect;function IS(e){const[t,n]=j.useState(BigInt(0)),[i]=j.useState(()=>XV(()=>n(a=>a+BigInt(1))));return WV(()=>{const a=i.get();a.length&&(e(a),i.reset())},[t]),i}function XV(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const pA=j.createContext(null);function ZV({children:e}){const t=nn(),n=j.useCallback(d=>{const{nodes:f=[],setNodes:h,hasDefaultNodes:g,onNodesChange:m,nodeLookup:y,fitViewQueued:b,onNodesChangeMiddlewareMap:k}=t.getState();let v=f;for(const E of d)v=typeof E=="function"?E(v):E;let N=OS({items:v,lookup:y});for(const E of k.values())N=E(N);g&&h(v),N.length>0?m==null||m(N):b&&window.requestAnimationFrame(()=>{const{fitViewQueued:E,nodes:C,setNodes:S}=t.getState();E&&S(C)})},[]),i=IS(n),a=j.useCallback(d=>{const{edges:f=[],setEdges:h,hasDefaultEdges:g,onEdgesChange:m,edgeLookup:y}=t.getState();let b=f;for(const k of d)b=typeof k=="function"?k(b):k;g?h(b):m&&m(OS({items:b,lookup:y}))},[]),l=IS(a),o=j.useMemo(()=>({nodeQueue:i,edgeQueue:l}),[]);return c.jsx(pA.Provider,{value:o,children:e})}function JV(){const e=j.useContext(pA);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const eY=e=>!!e.panZoom;function xp(){const e=KV(),t=nn(),n=JV(),i=St(eY),a=j.useMemo(()=>{const l=m=>t.getState().nodeLookup.get(m),o=m=>{n.nodeQueue.push(m)},d=m=>{n.edgeQueue.push(m)},f=m=>{var E,C;const{nodeLookup:y,nodeOrigin:b}=t.getState(),k=LS(m)?m:y.get(m.id),v=k.parentId?$C(k.position,k.measured,k.parentId,y,b):k.position,N={...k,position:v,width:((E=k.measured)==null?void 0:E.width)??k.width,height:((C=k.measured)==null?void 0:C.height)??k.height};return Lu(N)},h=(m,y,b={replace:!1})=>{o(k=>k.map(v=>{if(v.id===m){const N=typeof y=="function"?y(v):y;return b.replace&&LS(N)?N:{...v,...N}}return v}))},g=(m,y,b={replace:!1})=>{d(k=>k.map(v=>{if(v.id===m){const N=typeof y=="function"?y(v):y;return b.replace&&QV(N)?N:{...v,...N}}return v}))};return{getNodes:()=>t.getState().nodes.map(m=>({...m})),getNode:m=>{var y;return(y=l(m))==null?void 0:y.internals.userNode},getInternalNode:l,getEdges:()=>{const{edges:m=[]}=t.getState();return m.map(y=>({...y}))},getEdge:m=>t.getState().edgeLookup.get(m),setNodes:o,setEdges:d,addNodes:m=>{const y=Array.isArray(m)?m:[m];n.nodeQueue.push(b=>[...b,...y])},addEdges:m=>{const y=Array.isArray(m)?m:[m];n.edgeQueue.push(b=>[...b,...y])},toObject:()=>{const{nodes:m=[],edges:y=[],transform:b}=t.getState(),[k,v,N]=b;return{nodes:m.map(E=>({...E})),edges:y.map(E=>({...E})),viewport:{x:k,y:v,zoom:N}}},deleteElements:async({nodes:m=[],edges:y=[]})=>{const{nodes:b,edges:k,onNodesDelete:v,onEdgesDelete:N,triggerNodeChanges:E,triggerEdgeChanges:C,onDelete:S,onBeforeDelete:_}=t.getState(),{nodes:M,edges:T}=await EG({nodesToRemove:m,edgesToRemove:y,nodes:b,edges:k,onBeforeDelete:_}),R=T.length>0,O=M.length>0;if(R){const $=T.map(RS);N==null||N(T),C($)}if(O){const $=M.map(RS);v==null||v(M),E($)}return(O||R)&&(S==null||S({nodes:M,edges:T})),{deletedNodes:M,deletedEdges:T}},getIntersectingNodes:(m,y=!0,b)=>{const k=sS(m),v=k?m:f(m),N=b!==void 0;return v?(b||t.getState().nodes).filter(E=>{const C=t.getState().nodeLookup.get(E.id);if(C&&!k&&(E.id===m.id||!C.internals.positionAbsolute))return!1;const S=Lu(N?E:C),_=Lh(S,v);return y&&_>0||_>=S.width*S.height||_>=v.width*v.height}):[]},isNodeIntersecting:(m,y,b=!0)=>{const v=sS(m)?m:f(m);if(!v)return!1;const N=Lh(v,y);return b&&N>0||N>=y.width*y.height||N>=v.width*v.height},updateNode:h,updateNodeData:(m,y,b={replace:!1})=>{h(m,k=>{const v=typeof y=="function"?y(k):y;return b.replace?{...k,data:v}:{...k,data:{...k.data,...v}}},b)},updateEdge:g,updateEdgeData:(m,y,b={replace:!1})=>{g(m,k=>{const v=typeof y=="function"?y(k):y;return b.replace?{...k,data:v}:{...k,data:{...k.data,...v}}},b)},getNodesBounds:m=>{const{nodeLookup:y,nodeOrigin:b}=t.getState();return xG(m,{nodeLookup:y,nodeOrigin:b})},getHandleConnections:({type:m,id:y,nodeId:b})=>{var k;return Array.from(((k=t.getState().connectionLookup.get(`${b}-${m}${y?`-${y}`:""}`))==null?void 0:k.values())??[])},getNodeConnections:({type:m,handleId:y,nodeId:b})=>{var k;return Array.from(((k=t.getState().connectionLookup.get(`${b}${m?y?`-${m}-${y}`:`-${m}`:""}`))==null?void 0:k.values())??[])},fitView:async m=>{const y=t.getState().fitViewResolver??_G();return t.setState({fitViewQueued:!0,fitViewOptions:m,fitViewResolver:y}),n.nodeQueue.push(b=>[...b]),y.promise}}},[]);return j.useMemo(()=>({...a,...e,viewportInitialized:i}),[i])}const zS=e=>e.selected,tY=typeof window<"u"?window:void 0;function nY({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=nn(),{deleteElements:i}=xp(),a=zu(e,{actInsideInputWithModifier:!1}),l=zu(t,{target:tY});j.useEffect(()=>{if(a){const{edges:o,nodes:d}=n.getState();i({nodes:d.filter(zS),edges:o.filter(zS)}),n.setState({nodesSelectionActive:!1})}},[a]),j.useEffect(()=>{n.setState({multiSelectionActive:l})},[l])}function iY(e){const t=nn();j.useEffect(()=>{const n=()=>{var a,l,o,d;if(!e.current||!(((l=(a=e.current).checkVisibility)==null?void 0:l.call(a))??!0))return!1;const i=Qx(e.current);(i.height===0||i.width===0)&&((d=(o=t.getState()).onError)==null||d.call(o,"004",hr.error004())),t.setState({width:i.width||500,height:i.height||500})};if(e.current){n(),window.addEventListener("resize",n);const i=new ResizeObserver(()=>n());return i.observe(e.current),()=>{window.removeEventListener("resize",n),i&&e.current&&i.unobserve(e.current)}}},[])}const vp={position:"absolute",width:"100%",height:"100%",top:0,left:0},rY=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function aY({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=ul.Free,zoomOnDoubleClick:o=!0,panOnDrag:d=!0,defaultViewport:f,translateExtent:h,minZoom:g,maxZoom:m,zoomActivationKeyCode:y,preventScrolling:b=!0,children:k,noWheelClassName:v,noPanClassName:N,onViewportChange:E,isControlledViewport:C,paneClickDistance:S,selectionOnDrag:_}){const M=nn(),T=j.useRef(null),{userSelectionActive:R,lib:O,connectionInProgress:$}=St(rY,tn),I=zu(y),q=j.useRef();iY(T);const F=j.useCallback(Y=>{E==null||E({x:Y[0],y:Y[1],zoom:Y[2]}),C||M.setState({transform:Y})},[E,C]);return j.useEffect(()=>{if(T.current){q.current=cV({domNode:T.current,minZoom:g,maxZoom:m,translateExtent:h,viewport:f,onDraggingChange:P=>M.setState(H=>H.paneDragging===P?H:{paneDragging:P}),onPanZoomStart:(P,H)=>{const{onViewportChangeStart:Q,onMoveStart:G}=M.getState();G==null||G(P,H),Q==null||Q(H)},onPanZoom:(P,H)=>{const{onViewportChange:Q,onMove:G}=M.getState();G==null||G(P,H),Q==null||Q(H)},onPanZoomEnd:(P,H)=>{const{onViewportChangeEnd:Q,onMoveEnd:G}=M.getState();G==null||G(P,H),Q==null||Q(H)}});const{x:Y,y:D,zoom:K}=q.current.getViewport();return M.setState({panZoom:q.current,transform:[Y,D,K],domNode:T.current.closest(".react-flow")}),()=>{var P;(P=q.current)==null||P.destroy()}}},[]),j.useEffect(()=>{var Y;(Y=q.current)==null||Y.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:a,panOnScrollMode:l,zoomOnDoubleClick:o,panOnDrag:d,zoomActivationKeyPressed:I,preventScrolling:b,noPanClassName:N,userSelectionActive:R,noWheelClassName:v,lib:O,onTransformChange:F,connectionInProgress:$,selectionOnDrag:_,paneClickDistance:S})},[e,t,n,i,a,l,o,d,I,b,N,R,v,O,F,$,_,S]),c.jsx("div",{className:"react-flow__renderer",ref:T,style:vp,children:k})}const sY=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function lY(){const{userSelectionActive:e,userSelectionRect:t}=St(sY,tn);return e&&t?c.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const wy=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},oY=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function cY({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Ru.Full,panOnDrag:i,autoPanOnSelection:a,paneClickDistance:l,selectionOnDrag:o,onSelectionStart:d,onSelectionEnd:f,onPaneClick:h,onPaneContextMenu:g,onPaneScroll:m,onPaneMouseEnter:y,onPaneMouseMove:b,onPaneMouseLeave:k,children:v}){const N=j.useRef(0),E=nn(),{userSelectionActive:C,elementsSelectable:S,dragging:_,panBy:M,autoPanSpeed:T}=St(oY,tn),R=S&&(e||C),O=j.useRef(null),$=j.useRef(),I=j.useRef(new Set),q=j.useRef(new Set),F=j.useRef(!1),Y=j.useRef(!1),D=j.useRef({x:0,y:0}),K=j.useRef(!1),P=J=>{if(Y.current||F.current||E.getState().connection.inProgress){Y.current=!1,F.current=!1;return}h==null||h(J),E.getState().resetSelectedElements(),E.setState({nodesSelectionActive:!1})},H=J=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){J.preventDefault();return}g==null||g(J)},Q=m?J=>m(J):void 0,G=J=>{Y.current&&(J.stopPropagation(),Y.current=!1)},L=J=>{var Fe,ze;const{domNode:ue,transform:Te}=E.getState();if($.current=ue==null?void 0:ue.getBoundingClientRect(),!$.current)return;const Re=J.target===O.current;if(!Re&&!!J.target.closest(".nokey")||!e||!(o&&Re||t)||J.button!==0||!J.isPrimary)return;(ze=(Fe=J.target)==null?void 0:Fe.setPointerCapture)==null||ze.call(Fe,J.pointerId),Y.current=!1;const{x:Ce,y:te}=cr(J.nativeEvent,$.current),pe=ld({x:Ce,y:te},Te);E.setState({userSelectionRect:{width:0,height:0,startX:pe.x,startY:pe.y,x:Ce,y:te}}),Re||(J.stopPropagation(),J.preventDefault())};function z(J,ue){const{userSelectionRect:Te}=E.getState();if(!Te)return;const{transform:Re,nodeLookup:De,edgeLookup:ce,connectionLookup:Ce,triggerNodeChanges:te,triggerEdgeChanges:pe,defaultEdgeOptions:Fe}=E.getState(),ze={x:Te.startX,y:Te.startY},{x:ae,y:be}=Go(ze,Re),ye={startX:ze.x,startY:ze.y,x:J<ae?J:ae,y:ue<be?ue:be,width:Math.abs(J-ae),height:Math.abs(ue-be)},he=I.current,Ee=q.current;I.current=new Set(Gx(De,ye,Re,n===Ru.Partial,!0).map(Ke=>Ke.id)),q.current=new Set;const Ne=(Fe==null?void 0:Fe.selectable)??!0;for(const Ke of I.current){const ne=Ce.get(Ke);if(ne)for(const{edgeId:de}of ne.values()){const Le=ce.get(de);Le&&(Le.selectable??Ne)&&q.current.add(de)}}if(!lS(he,I.current)){const Ke=wo(De,I.current,!0);te(Ke)}if(!lS(Ee,q.current)){const Ke=wo(ce,q.current);pe(Ke)}E.setState({userSelectionRect:ye,userSelectionActive:!0,nodesSelectionActive:!1})}function V(){if(!a||!$.current)return;const[J,ue]=Vx(D.current,$.current,T);M({x:J,y:ue}).then(Te=>{if(!Y.current||!Te){N.current=requestAnimationFrame(V);return}const{x:Re,y:De}=D.current;z(Re,De),N.current=requestAnimationFrame(V)})}const B=()=>{cancelAnimationFrame(N.current),N.current=0,K.current=!1};j.useEffect(()=>()=>B(),[]);const le=J=>{const{userSelectionRect:ue,transform:Te,resetSelectedElements:Re}=E.getState();if(!$.current||!ue)return;const{x:De,y:ce}=cr(J.nativeEvent,$.current);D.current={x:De,y:ce};const Ce=Go({x:ue.startX,y:ue.startY},Te);if(!Y.current){const te=t?0:l;if(Math.hypot(De-Ce.x,ce-Ce.y)<=te)return;Re(),d==null||d(J)}Y.current=!0,K.current||(V(),K.current=!0),z(De,ce)},ve=J=>{var ue,Te;if(!R){J.target===O.current&&E.getState().connection.inProgress&&(F.current=!0);return}J.button===0&&((Te=(ue=J.target)==null?void 0:ue.releasePointerCapture)==null||Te.call(ue,J.pointerId),!C&&J.target===O.current&&E.getState().userSelectionRect&&(P==null||P(J)),E.setState({userSelectionActive:!1,userSelectionRect:null}),Y.current&&(f==null||f(J),E.setState({nodesSelectionActive:I.current.size>0})),B())},ke=J=>{var ue,Te;(Te=(ue=J.target)==null?void 0:ue.releasePointerCapture)==null||Te.call(ue,J.pointerId),B()},Se=i===!0||Array.isArray(i)&&i.includes(0);return c.jsxs("div",{className:Nn(["react-flow__pane",{draggable:Se,dragging:_,selection:e}]),onClick:R?void 0:wy(P,O),onContextMenu:wy(H,O),onWheel:wy(Q,O),onPointerEnter:R?void 0:y,onPointerMove:R?le:b,onPointerUp:ve,onPointerCancel:R?ke:void 0,onPointerDownCapture:R?L:void 0,onClickCapture:R?G:void 0,onPointerLeave:k,ref:O,style:vp,children:[v,c.jsx(lY,{})]})}function kb({id:e,store:t,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:a,unselectNodesAndEdges:l,multiSelectionActive:o,nodeLookup:d,onError:f}=t.getState(),h=d.get(e);if(!h){f==null||f("012",hr.error012(e));return}t.setState({nodesSelectionActive:!1}),h.selected?(n||h.selected&&o)&&(l({nodes:[h],edges:[]}),requestAnimationFrame(()=>{var g;return(g=i==null?void 0:i.current)==null?void 0:g.blur()})):a([e])}function mA({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:a,isSelectable:l,nodeClickDistance:o}){const d=nn(),[f,h]=j.useState(!1),g=j.useRef();return j.useEffect(()=>{g.current=QG({getStoreItems:()=>d.getState(),onNodeMouseDown:m=>{kb({id:m,store:d,nodeRef:e})},onDragStart:()=>{h(!0)},onDragStop:()=>{h(!1)}})},[]),j.useEffect(()=>{if(!(t||!e.current||!g.current))return g.current.update({noDragClassName:n,handleSelector:i,domNode:e.current,isSelectable:l,nodeId:a,nodeClickDistance:o}),()=>{var m;(m=g.current)==null||m.destroy()}},[n,i,t,l,e,a,o]),f}const uY=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function gA(){const e=nn();return j.useCallback(n=>{const{nodeExtent:i,snapToGrid:a,snapGrid:l,nodesDraggable:o,onError:d,updateNodePositions:f,nodeLookup:h,nodeOrigin:g}=e.getState(),m=new Map,y=uY(o),b=a?l[0]:5,k=a?l[1]:5,v=n.direction.x*b*n.factor,N=n.direction.y*k*n.factor;for(const[,E]of h){if(!y(E))continue;let C={x:E.internals.positionAbsolute.x+v,y:E.internals.positionAbsolute.y+N};a&&(C=sd(C,l));const{position:S,positionAbsolute:_}=RC({nodeId:E.id,nextPosition:C,nodeLookup:h,nodeExtent:i,nodeOrigin:g,onError:d});E.position=S,E.internals.positionAbsolute=_,m.set(E.id,E)}f(m)},[])}const tv=j.createContext(null),dY=tv.Provider;tv.Consumer;const yA=()=>j.useContext(tv),fY=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),bA=j.createContext(null);function hY({children:e}){const t=St(fY,tn);return c.jsx(bA.Provider,{value:t,children:e})}function pY(){const e=j.useContext(bA);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const mY={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},gY=(e,t,n)=>i=>{const{connectionClickStartHandle:a,connectionMode:l,connection:o}=i,{fromHandle:d,toHandle:f,isValid:h}=o;if(!d&&!a)return mY;const g=(f==null?void 0:f.nodeId)===e&&(f==null?void 0:f.id)===t&&(f==null?void 0:f.type)===n;return{connectingFrom:(d==null?void 0:d.nodeId)===e&&(d==null?void 0:d.id)===t&&(d==null?void 0:d.type)===n,connectingTo:g,clickConnecting:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n,isPossibleEndHandle:l===Ho.Strict?(d==null?void 0:d.type)!==n:e!==(d==null?void 0:d.nodeId)||t!==(d==null?void 0:d.id),connectionInProcess:!!d,clickConnectionInProcess:!!a,valid:g&&h}};function yY({type:e="source",position:t=Ge.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:a=!0,isConnectableEnd:l=!0,id:o,onConnect:d,children:f,className:h,onMouseDown:g,onTouchStart:m,...y},b){var K,P;const k=o||null,v=e==="target",N=nn(),E=yA(),{connectOnClick:C,noPanClassName:S,rfId:_}=pY(),{connectingFrom:M,connectingTo:T,clickConnecting:R,isPossibleEndHandle:O,connectionInProcess:$,clickConnectionInProcess:I,valid:q}=St(gY(E,k,e),tn);E||(P=(K=N.getState()).onError)==null||P.call(K,"010",hr.error010());const F=H=>{const{defaultEdgeOptions:Q,onConnect:G,hasDefaultEdges:L}=N.getState(),z={...Q,...H};if(L){const{edges:V,setEdges:B,onError:le}=N.getState();B(YV(z,V,{onError:le}))}G==null||G(z),d==null||d(z)},Y=H=>{if(!E)return;const Q=qC(H.nativeEvent);if(a&&(Q&&H.button===0||!Q)){const G=N.getState();wb.onPointerDown(H.nativeEvent,{handleDomNode:H.currentTarget,autoPanOnConnect:G.autoPanOnConnect,connectionMode:G.connectionMode,connectionRadius:G.connectionRadius,domNode:G.domNode,nodeLookup:G.nodeLookup,lib:G.lib,isTarget:v,handleId:k,nodeId:E,flowId:G.rfId,panBy:G.panBy,cancelConnection:G.cancelConnection,onConnectStart:G.onConnectStart,onConnectEnd:(...L)=>{var z,V;return(V=(z=N.getState()).onConnectEnd)==null?void 0:V.call(z,...L)},updateConnection:G.updateConnection,onConnect:F,isValidConnection:n||((...L)=>{var z,V;return((V=(z=N.getState()).isValidConnection)==null?void 0:V.call(z,...L))??!0}),getTransform:()=>N.getState().transform,getFromHandle:()=>N.getState().connection.fromHandle,autoPanSpeed:G.autoPanSpeed,dragThreshold:G.connectionDragThreshold})}Q?g==null||g(H):m==null||m(H)},D=H=>{const{onClickConnectStart:Q,onClickConnectEnd:G,connectionClickStartHandle:L,connectionMode:z,isValidConnection:V,lib:B,rfId:le,nodeLookup:ve,connection:ke}=N.getState();if(!E||!L&&!a)return;if(!L){Q==null||Q(H.nativeEvent,{nodeId:E,handleId:k,handleType:e}),N.setState({connectionClickStartHandle:{nodeId:E,type:e,id:k}});return}const Se=UC(H.target),J=n||V,{connection:ue,isValid:Te}=wb.isValid(H.nativeEvent,{handle:{nodeId:E,id:k,type:e},connectionMode:z,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:J,flowId:le,doc:Se,lib:B,nodeLookup:ve});Te&&ue&&F(ue);const Re=structuredClone(ke);delete Re.inProgress,Re.toPosition=Re.toHandle?Re.toHandle.position:null,G==null||G(H,Re),N.setState({connectionClickStartHandle:null})};return c.jsx("div",{"data-handleid":k,"data-nodeid":E,"data-handlepos":t,"data-id":`${_}-${E}-${k}-${e}`,className:Nn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",S,h,{source:!v,target:v,connectable:i,connectablestart:a,connectableend:l,clickconnecting:R,connectingfrom:M,connectingto:T,valid:q,connectionindicator:i&&(!$||O)&&($||I?l:a)}]),onMouseDown:Y,onTouchStart:Y,onClick:C?D:void 0,ref:b,...y,children:f})}const Tr=j.memo(hA(yY));function bY({data:e,isConnectable:t,sourcePosition:n=Ge.Bottom}){return c.jsxs(c.Fragment,{children:[e==null?void 0:e.label,c.jsx(Tr,{type:"source",position:n,isConnectable:t})]})}function xY({data:e,isConnectable:t,targetPosition:n=Ge.Top,sourcePosition:i=Ge.Bottom}){return c.jsxs(c.Fragment,{children:[c.jsx(Tr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,c.jsx(Tr,{type:"source",position:i,isConnectable:t})]})}function vY(){return null}function wY({data:e,isConnectable:t,targetPosition:n=Ge.Top}){return c.jsxs(c.Fragment,{children:[c.jsx(Tr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Ih={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},PS={input:bY,default:xY,output:wY,group:vY};function kY(e){var t,n,i,a;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((i=e.style)==null?void 0:i.width),height:e.height??((a=e.style)==null?void 0:a.height)}}const EY=e=>{const{width:t,height:n,x:i,y:a}=ad(e.nodeLookup,{filter:l=>!!l.selected});return{width:or(t)?t:null,height:or(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${i}px,${a}px)`}};function SY({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=nn(),{width:a,height:l,transformString:o,userSelectionActive:d}=St(EY,tn),f=gA(),h=j.useRef(null);j.useEffect(()=>{var b;n||(b=h.current)==null||b.focus({preventScroll:!0})},[n]);const g=!d&&a!==null&&l!==null;if(mA({nodeRef:h,disabled:!g}),!g)return null;const m=e?b=>{const k=i.getState().nodes.filter(v=>v.selected);e(b,k)}:void 0,y=b=>{Object.prototype.hasOwnProperty.call(Ih,b.key)&&(b.preventDefault(),f({direction:Ih[b.key],factor:b.shiftKey?4:1}))};return c.jsx("div",{className:Nn(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:c.jsx("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:m,tabIndex:n?void 0:-1,onKeyDown:n?void 0:y,style:{width:a,height:l}})})}const BS=typeof window<"u"?window:void 0,NY=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function xA({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:a,onPaneContextMenu:l,onPaneScroll:o,paneClickDistance:d,deleteKeyCode:f,selectionKeyCode:h,selectionOnDrag:g,selectionMode:m,onSelectionStart:y,onSelectionEnd:b,multiSelectionKeyCode:k,panActivationKeyCode:v,zoomActivationKeyCode:N,elementsSelectable:E,zoomOnScroll:C,zoomOnPinch:S,panOnScroll:_,panOnScrollSpeed:M,panOnScrollMode:T,zoomOnDoubleClick:R,panOnDrag:O,autoPanOnSelection:$,defaultViewport:I,translateExtent:q,minZoom:F,maxZoom:Y,preventScrolling:D,onSelectionContextMenu:K,noWheelClassName:P,noPanClassName:H,disableKeyboardA11y:Q,onViewportChange:G,isControlledViewport:L}){const{nodesSelectionActive:z,userSelectionActive:V}=St(NY,tn),B=zu(h,{target:BS}),le=zu(v,{target:BS}),ve=le||O,ke=le||_,Se=g&&ve!==!0,J=B||V||Se;return nY({deleteKeyCode:f,multiSelectionKeyCode:k}),c.jsx(aY,{onPaneContextMenu:l,elementsSelectable:E,zoomOnScroll:C,zoomOnPinch:S,panOnScroll:ke,panOnScrollSpeed:M,panOnScrollMode:T,zoomOnDoubleClick:R,panOnDrag:!B&&ve,defaultViewport:I,translateExtent:q,minZoom:F,maxZoom:Y,zoomActivationKeyCode:N,preventScrolling:D,noWheelClassName:P,noPanClassName:H,onViewportChange:G,isControlledViewport:L,paneClickDistance:d,selectionOnDrag:Se,children:c.jsxs(cY,{onSelectionStart:y,onSelectionEnd:b,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:a,onPaneContextMenu:l,onPaneScroll:o,panOnDrag:ve,autoPanOnSelection:$,isSelecting:!!J,selectionMode:m,selectionKeyPressed:B,paneClickDistance:d,selectionOnDrag:Se,children:[e,z&&c.jsx(SY,{onSelectionContextMenu:K,noPanClassName:H,disableKeyboardA11y:Q})]})})}xA.displayName="FlowRenderer";const _Y=j.memo(xA),jY=e=>t=>e?Gx(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function CY(e){return St(j.useCallback(jY(e),[e]),tn)}const AY=e=>e.updateNodeInternals;function TY(){const e=St(AY),[t]=j.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const i=new Map;n.forEach(a=>{const l=a.target.getAttribute("data-id");i.set(l,{id:l,nodeElement:a.target,force:!0})}),e(i)}));return j.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function MY({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const a=nn(),l=j.useRef(null),o=j.useRef(null),d=j.useRef(e.sourcePosition),f=j.useRef(e.targetPosition),h=j.useRef(t),g=n&&!!e.internals.handleBounds;return j.useEffect(()=>{l.current&&!e.hidden&&(!g||o.current!==l.current)&&(o.current&&(i==null||i.unobserve(o.current)),i==null||i.observe(l.current),o.current=l.current)},[g,e.hidden]),j.useEffect(()=>()=>{o.current&&(i==null||i.unobserve(o.current),o.current=null)},[]),j.useEffect(()=>{if(l.current){const m=h.current!==t,y=d.current!==e.sourcePosition,b=f.current!==e.targetPosition;(m||y||b)&&(h.current=t,d.current=e.sourcePosition,f.current=e.targetPosition,a.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:l.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),l}function DY({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:a,onContextMenu:l,onDoubleClick:o,nodesDraggable:d,elementsSelectable:f,nodesConnectable:h,nodesFocusable:g,resizeObserver:m,noDragClassName:y,noPanClassName:b,disableKeyboardA11y:k,rfId:v,nodeTypes:N,nodeClickDistance:E,onError:C}){const{node:S,internals:_,isParent:M}=St(J=>{const ue=J.nodeLookup.get(e),Te=J.parentLookup.has(e);return{node:ue,internals:ue.internals,isParent:Te}},tn);let T=S.type||"default",R=(N==null?void 0:N[T])||PS[T];R===void 0&&(C==null||C("003",hr.error003(T)),T="default",R=(N==null?void 0:N.default)||PS.default);const O=!!(S.draggable||d&&typeof S.draggable>"u"),$=!!(S.selectable||f&&typeof S.selectable>"u"),I=!!(S.connectable||h&&typeof S.connectable>"u"),q=!!(S.focusable||g&&typeof S.focusable>"u"),F=nn(),Y=BC(S),D=MY({node:S,nodeType:T,hasDimensions:Y,resizeObserver:m}),K=mA({nodeRef:D,disabled:S.hidden||!O,noDragClassName:y,handleSelector:S.dragHandle,nodeId:e,isSelectable:$,nodeClickDistance:E}),P=gA();if(S.hidden)return null;const H=va(S),Q=kY(S),G=$||O||t||n||i||a,L=n?J=>n(J,{..._.userNode}):void 0,z=i?J=>i(J,{..._.userNode}):void 0,V=a?J=>a(J,{..._.userNode}):void 0,B=l?J=>l(J,{..._.userNode}):void 0,le=o?J=>o(J,{..._.userNode}):void 0,ve=J=>{const{selectNodesOnDrag:ue,nodeDragThreshold:Te}=F.getState();$&&(!ue||!O||Te>0)&&kb({id:e,store:F,nodeRef:D}),t&&t(J,{..._.userNode})},ke=J=>{if(!(FC(J.nativeEvent)||k)){if(AC.includes(J.key)&&$){const ue=J.key==="Escape";kb({id:e,store:F,unselect:ue,nodeRef:D})}else if(O&&S.selected&&Object.prototype.hasOwnProperty.call(Ih,J.key)){J.preventDefault();const{ariaLabelConfig:ue}=F.getState();F.setState({ariaLiveMessage:ue["node.a11yDescription.ariaLiveMessage"]({direction:J.key.replace("Arrow","").toLowerCase(),x:~~_.positionAbsolute.x,y:~~_.positionAbsolute.y})}),P({direction:Ih[J.key],factor:J.shiftKey?4:1})}}},Se=()=>{var Ce;if(k||!((Ce=D.current)!=null&&Ce.matches(":focus-visible")))return;const{transform:J,width:ue,height:Te,autoPanOnNodeFocus:Re,setCenter:De}=F.getState();if(!Re)return;Gx(new Map([[e,S]]),{x:0,y:0,width:ue,height:Te},J,!0).length>0||De(S.position.x+H.width/2,S.position.y+H.height/2,{zoom:J[2]})};return c.jsx("div",{className:Nn(["react-flow__node",`react-flow__node-${T}`,{[b]:O},S.className,{selected:S.selected,selectable:$,parent:M,draggable:O,dragging:K}]),ref:D,style:{zIndex:_.z,transform:`translate(${_.positionAbsolute.x}px,${_.positionAbsolute.y}px)`,pointerEvents:G?"all":"none",visibility:Y?"visible":"hidden",...S.style,...Q},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:z,onMouseLeave:V,onContextMenu:B,onClick:ve,onDoubleClick:le,onKeyDown:q?ke:void 0,tabIndex:q?0:void 0,onFocus:q?Se:void 0,role:S.ariaRole??(q?"group":void 0),"aria-roledescription":"node","aria-describedby":k?void 0:`${lA}-${v}`,"aria-label":S.ariaLabel,...S.domAttributes,children:c.jsx(dY,{value:e,children:c.jsx(R,{id:e,data:S.data,type:T,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:S.selected??!1,selectable:$,draggable:O,deletable:S.deletable??!0,isConnectable:I,sourcePosition:S.sourcePosition,targetPosition:S.targetPosition,dragging:K,dragHandle:S.dragHandle,zIndex:_.z,parentId:S.parentId,...H})})})}var OY=j.memo(DY);const RY=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function vA(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:a,onError:l}=St(RY,tn),o=CY(e.onlyRenderVisibleElements),d=TY();return c.jsx("div",{className:"react-flow__nodes",style:vp,children:o.map(f=>c.jsx(OY,{id:f,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:d,nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:a,nodeClickDistance:e.nodeClickDistance,onError:l},f))})}vA.displayName="NodeRenderer";const LY=j.memo(vA);function IY(e){return St(j.useCallback(n=>{if(!e)return n.edges.map(a=>a.id);const i=[];if(n.width&&n.height)for(const a of n.edges){const l=n.nodeLookup.get(a.source),o=n.nodeLookup.get(a.target);l&&o&&TG({sourceNode:l,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&i.push(a.id)}return i},[e]),tn)}const zY=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return c.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},PY=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return c.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},$S={[Oh.Arrow]:zY,[Oh.ArrowClosed]:PY};function BY(e){const t=nn();return j.useMemo(()=>{var a,l;return Object.prototype.hasOwnProperty.call($S,e)?$S[e]:((l=(a=t.getState()).onError)==null||l.call(a,"009",hr.error009(e)),null)},[e])}const $Y=({id:e,type:t,color:n,width:i=12.5,height:a=12.5,markerUnits:l="strokeWidth",strokeWidth:o,orient:d="auto-start-reverse"})=>{const f=BY(t);return f?c.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:l,orient:d,refX:"0",refY:"0",children:c.jsx(f,{color:n,strokeWidth:o})}):null},wA=({defaultColor:e,rfId:t})=>{const n=St(l=>l.edges),i=St(l=>l.defaultEdgeOptions),a=j.useMemo(()=>PG(n,{id:t,defaultColor:e,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[n,i,t,e]);return a.length?c.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:c.jsx("defs",{children:a.map(l=>c.jsx($Y,{id:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,strokeWidth:l.strokeWidth,orient:l.orient},l.id))})}):null};wA.displayName="MarkerDefinitions";var UY=j.memo(wA);function kA({x:e,y:t,label:n,labelStyle:i,labelShowBg:a=!0,labelBgStyle:l,labelBgPadding:o=[2,4],labelBgBorderRadius:d=2,children:f,className:h,...g}){const[m,y]=j.useState({x:1,y:0,width:0,height:0}),b=Nn(["react-flow__edge-textwrapper",h]),k=j.useRef(null);return j.useEffect(()=>{if(k.current){const v=k.current.getBBox();y({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),n?c.jsxs("g",{transform:`translate(${e-m.width/2} ${t-m.height/2})`,className:b,visibility:m.width?"visible":"hidden",...g,children:[a&&c.jsx("rect",{width:m.width+2*o[0],x:-o[0],y:-o[1],height:m.height+2*o[1],className:"react-flow__edge-textbg",style:l,rx:d,ry:d}),c.jsx("text",{className:"react-flow__edge-text",y:m.height/2,dy:"0.3em",ref:k,style:i,children:n}),f]}):null}kA.displayName="EdgeText";const FY=j.memo(kA);function wp({path:e,labelX:t,labelY:n,label:i,labelStyle:a,labelShowBg:l,labelBgStyle:o,labelBgPadding:d,labelBgBorderRadius:f,interactionWidth:h=20,...g}){return c.jsxs(c.Fragment,{children:[c.jsx("path",{...g,d:e,fill:"none",className:Nn(["react-flow__edge-path",g.className])}),h?c.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}):null,i&&or(t)&&or(n)?c.jsx(FY,{x:t,y:n,label:i,labelStyle:a,labelShowBg:l,labelBgStyle:o,labelBgPadding:d,labelBgBorderRadius:f}):null]})}function US({pos:e,x1:t,y1:n,x2:i,y2:a}){return e===Ge.Left||e===Ge.Right?[.5*(t+i),n]:[t,.5*(n+a)]}function EA({sourceX:e,sourceY:t,sourcePosition:n=Ge.Bottom,targetX:i,targetY:a,targetPosition:l=Ge.Top}){const[o,d]=US({pos:n,x1:e,y1:t,x2:i,y2:a}),[f,h]=US({pos:l,x1:i,y1:a,x2:e,y2:t}),[g,m,y,b]=HC({sourceX:e,sourceY:t,targetX:i,targetY:a,sourceControlX:o,sourceControlY:d,targetControlX:f,targetControlY:h});return[`M${e},${t} C${o},${d} ${f},${h} ${i},${a}`,g,m,y,b]}function SA(e){return j.memo(({id:t,sourceX:n,sourceY:i,targetX:a,targetY:l,sourcePosition:o,targetPosition:d,label:f,labelStyle:h,labelShowBg:g,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:b,style:k,markerEnd:v,markerStart:N,interactionWidth:E})=>{const[C,S,_]=EA({sourceX:n,sourceY:i,sourcePosition:o,targetX:a,targetY:l,targetPosition:d}),M=e.isInternal?void 0:t;return c.jsx(wp,{id:M,path:C,labelX:S,labelY:_,label:f,labelStyle:h,labelShowBg:g,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:b,style:k,markerEnd:v,markerStart:N,interactionWidth:E})})}const qY=SA({isInternal:!1}),NA=SA({isInternal:!0});qY.displayName="SimpleBezierEdge";NA.displayName="SimpleBezierEdgeInternal";function _A(e){return j.memo(({id:t,sourceX:n,sourceY:i,targetX:a,targetY:l,label:o,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:m,style:y,sourcePosition:b=Ge.Bottom,targetPosition:k=Ge.Top,markerEnd:v,markerStart:N,pathOptions:E,interactionWidth:C})=>{const[S,_,M]=bb({sourceX:n,sourceY:i,sourcePosition:b,targetX:a,targetY:l,targetPosition:k,borderRadius:E==null?void 0:E.borderRadius,offset:E==null?void 0:E.offset,stepPosition:E==null?void 0:E.stepPosition}),T=e.isInternal?void 0:t;return c.jsx(wp,{id:T,path:S,labelX:_,labelY:M,label:o,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:m,style:y,markerEnd:v,markerStart:N,interactionWidth:C})})}const jA=_A({isInternal:!1}),CA=_A({isInternal:!0});jA.displayName="SmoothStepEdge";CA.displayName="SmoothStepEdgeInternal";function AA(e){return j.memo(({id:t,...n})=>{var a;const i=e.isInternal?void 0:t;return c.jsx(jA,{...n,id:i,pathOptions:j.useMemo(()=>{var l;return{borderRadius:0,offset:(l=n.pathOptions)==null?void 0:l.offset}},[(a=n.pathOptions)==null?void 0:a.offset])})})}const HY=AA({isInternal:!1}),TA=AA({isInternal:!0});HY.displayName="StepEdge";TA.displayName="StepEdgeInternal";function MA(e){return j.memo(({id:t,sourceX:n,sourceY:i,targetX:a,targetY:l,label:o,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:m,style:y,markerEnd:b,markerStart:k,interactionWidth:v})=>{const[N,E,C]=VC({sourceX:n,sourceY:i,targetX:a,targetY:l}),S=e.isInternal?void 0:t;return c.jsx(wp,{id:S,path:N,labelX:E,labelY:C,label:o,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:m,style:y,markerEnd:b,markerStart:k,interactionWidth:v})})}const KY=MA({isInternal:!1}),DA=MA({isInternal:!0});KY.displayName="StraightEdge";DA.displayName="StraightEdgeInternal";function OA(e){return j.memo(({id:t,sourceX:n,sourceY:i,targetX:a,targetY:l,sourcePosition:o=Ge.Bottom,targetPosition:d=Ge.Top,label:f,labelStyle:h,labelShowBg:g,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:b,style:k,markerEnd:v,markerStart:N,pathOptions:E,interactionWidth:C})=>{const[S,_,M]=KC({sourceX:n,sourceY:i,sourcePosition:o,targetX:a,targetY:l,targetPosition:d,curvature:E==null?void 0:E.curvature}),T=e.isInternal?void 0:t;return c.jsx(wp,{id:T,path:S,labelX:_,labelY:M,label:f,labelStyle:h,labelShowBg:g,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:b,style:k,markerEnd:v,markerStart:N,interactionWidth:C})})}const GY=OA({isInternal:!1}),RA=OA({isInternal:!0});GY.displayName="BezierEdge";RA.displayName="BezierEdgeInternal";const FS={default:RA,straight:DA,step:TA,smoothstep:CA,simplebezier:NA},qS={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},VY=(e,t,n)=>n===Ge.Left?e-t:n===Ge.Right?e+t:e,YY=(e,t,n)=>n===Ge.Top?e-t:n===Ge.Bottom?e+t:e,HS="react-flow__edgeupdater";function KS({position:e,centerX:t,centerY:n,radius:i=10,onMouseDown:a,onMouseEnter:l,onMouseOut:o,type:d}){return c.jsx("circle",{onMouseDown:a,onMouseEnter:l,onMouseOut:o,className:Nn([HS,`${HS}-${d}`]),cx:VY(t,i,e),cy:YY(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function QY({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:i,sourceY:a,targetX:l,targetY:o,sourcePosition:d,targetPosition:f,onReconnect:h,onReconnectStart:g,onReconnectEnd:m,setReconnecting:y,setUpdateHover:b}){const k=nn(),v=(_,M)=>{if(_.button!==0)return;const{autoPanOnConnect:T,domNode:R,connectionMode:O,connectionRadius:$,lib:I,onConnectStart:q,cancelConnection:F,nodeLookup:Y,rfId:D,panBy:K,updateConnection:P}=k.getState(),H=M.type==="target",Q=(z,V)=>{y(!1),m==null||m(z,n,M.type,V)},G=z=>h==null?void 0:h(n,z),L=(z,V)=>{y(!0),g==null||g(_,n,M.type),q==null||q(z,V)};wb.onPointerDown(_.nativeEvent,{autoPanOnConnect:T,connectionMode:O,connectionRadius:$,domNode:R,handleId:M.id,nodeId:M.nodeId,nodeLookup:Y,isTarget:H,edgeUpdaterType:M.type,lib:I,flowId:D,cancelConnection:F,panBy:K,isValidConnection:(...z)=>{var V,B;return((B=(V=k.getState()).isValidConnection)==null?void 0:B.call(V,...z))??!0},onConnect:G,onConnectStart:L,onConnectEnd:(...z)=>{var V,B;return(B=(V=k.getState()).onConnectEnd)==null?void 0:B.call(V,...z)},onReconnectEnd:Q,updateConnection:P,getTransform:()=>k.getState().transform,getFromHandle:()=>k.getState().connection.fromHandle,dragThreshold:k.getState().connectionDragThreshold,handleDomNode:_.currentTarget})},N=_=>v(_,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),E=_=>v(_,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),C=()=>b(!0),S=()=>b(!1);return c.jsxs(c.Fragment,{children:[(e===!0||e==="source")&&c.jsx(KS,{position:d,centerX:i,centerY:a,radius:t,onMouseDown:N,onMouseEnter:C,onMouseOut:S,type:"source"}),(e===!0||e==="target")&&c.jsx(KS,{position:f,centerX:l,centerY:o,radius:t,onMouseDown:E,onMouseEnter:C,onMouseOut:S,type:"target"})]})}function WY({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:a,onDoubleClick:l,onContextMenu:o,onMouseEnter:d,onMouseMove:f,onMouseLeave:h,reconnectRadius:g,onReconnect:m,onReconnectStart:y,onReconnectEnd:b,rfId:k,edgeTypes:v,noPanClassName:N,onError:E,disableKeyboardA11y:C}){let S=St(De=>De.edgeLookup.get(e));const _=St(De=>De.defaultEdgeOptions);S=_?{..._,...S}:S;let M=S.type||"default",T=(v==null?void 0:v[M])||FS[M];T===void 0&&(E==null||E("011",hr.error011(M)),M="default",T=(v==null?void 0:v.default)||FS.default);const R=!!(S.focusable||t&&typeof S.focusable>"u"),O=typeof m<"u"&&(S.reconnectable||n&&typeof S.reconnectable>"u"),$=!!(S.selectable||i&&typeof S.selectable>"u"),I=j.useRef(null),[q,F]=j.useState(!1),[Y,D]=j.useState(!1),K=nn(),{zIndex:P=S.zIndex,sourceX:H,sourceY:Q,targetX:G,targetY:L,sourcePosition:z,targetPosition:V}=St(j.useCallback(De=>{const ce=De.nodeLookup.get(S.source),Ce=De.nodeLookup.get(S.target);if(!ce||!Ce)return qS;const te=zG({id:e,sourceNode:ce,targetNode:Ce,sourceHandle:S.sourceHandle||null,targetHandle:S.targetHandle||null,connectionMode:De.connectionMode,onError:E}),pe=AG({selected:S.selected,zIndex:S.zIndex,sourceNode:ce,targetNode:Ce,elevateOnSelect:De.elevateEdgesOnSelect,zIndexMode:De.zIndexMode});return{...te||qS,zIndex:pe}},[S.source,S.target,S.sourceHandle,S.targetHandle,S.selected,S.zIndex]),tn),B=j.useMemo(()=>S.markerStart?`url('#${xb(S.markerStart,k)}')`:void 0,[S.markerStart,k]),le=j.useMemo(()=>S.markerEnd?`url('#${xb(S.markerEnd,k)}')`:void 0,[S.markerEnd,k]);if(S.hidden||H===null||Q===null||G===null||L===null)return null;const ve=De=>{var pe;const{addSelectedEdges:ce,unselectNodesAndEdges:Ce,multiSelectionActive:te}=K.getState();$&&(K.setState({nodesSelectionActive:!1}),S.selected&&te?(Ce({nodes:[],edges:[S]}),(pe=I.current)==null||pe.blur()):ce([e])),a&&a(De,S)},ke=l?De=>{l(De,{...S})}:void 0,Se=o?De=>{o(De,{...S})}:void 0,J=d?De=>{d(De,{...S})}:void 0,ue=f?De=>{f(De,{...S})}:void 0,Te=h?De=>{h(De,{...S})}:void 0,Re=De=>{var ce;if(!C&&AC.includes(De.key)&&$){const{unselectNodesAndEdges:Ce,addSelectedEdges:te}=K.getState();De.key==="Escape"?((ce=I.current)==null||ce.blur(),Ce({edges:[S]})):te([e])}};return c.jsx("svg",{style:{zIndex:P},children:c.jsxs("g",{className:Nn(["react-flow__edge",`react-flow__edge-${M}`,S.className,N,{selected:S.selected,animated:S.animated,inactive:!$&&!a,updating:q,selectable:$}]),onClick:ve,onDoubleClick:ke,onContextMenu:Se,onMouseEnter:J,onMouseMove:ue,onMouseLeave:Te,onKeyDown:R?Re:void 0,tabIndex:R?0:void 0,role:S.ariaRole??(R?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":S.ariaLabel===null?void 0:S.ariaLabel||`Edge from ${S.source} to ${S.target}`,"aria-describedby":R?`${oA}-${k}`:void 0,ref:I,...S.domAttributes,children:[!Y&&c.jsx(T,{id:e,source:S.source,target:S.target,type:S.type,selected:S.selected,animated:S.animated,selectable:$,deletable:S.deletable??!0,label:S.label,labelStyle:S.labelStyle,labelShowBg:S.labelShowBg,labelBgStyle:S.labelBgStyle,labelBgPadding:S.labelBgPadding,labelBgBorderRadius:S.labelBgBorderRadius,sourceX:H,sourceY:Q,targetX:G,targetY:L,sourcePosition:z,targetPosition:V,data:S.data,style:S.style,sourceHandleId:S.sourceHandle,targetHandleId:S.targetHandle,markerStart:B,markerEnd:le,pathOptions:"pathOptions"in S?S.pathOptions:void 0,interactionWidth:S.interactionWidth}),O&&c.jsx(QY,{edge:S,isReconnectable:O,reconnectRadius:g,onReconnect:m,onReconnectStart:y,onReconnectEnd:b,sourceX:H,sourceY:Q,targetX:G,targetY:L,sourcePosition:z,targetPosition:V,setUpdateHover:F,setReconnecting:D})]})})}var XY=j.memo(WY);const ZY=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function LA({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:a,onReconnect:l,onEdgeContextMenu:o,onEdgeMouseEnter:d,onEdgeMouseMove:f,onEdgeMouseLeave:h,onEdgeClick:g,reconnectRadius:m,onEdgeDoubleClick:y,onReconnectStart:b,onReconnectEnd:k,disableKeyboardA11y:v}){const{edgesFocusable:N,edgesReconnectable:E,elementsSelectable:C,onError:S}=St(ZY,tn),_=IY(t);return c.jsxs("div",{className:"react-flow__edges",children:[c.jsx(UY,{defaultColor:e,rfId:n}),_.map(M=>c.jsx(XY,{id:M,edgesFocusable:N,edgesReconnectable:E,elementsSelectable:C,noPanClassName:a,onReconnect:l,onContextMenu:o,onMouseEnter:d,onMouseMove:f,onMouseLeave:h,onClick:g,reconnectRadius:m,onDoubleClick:y,onReconnectStart:b,onReconnectEnd:k,rfId:n,onError:S,edgeTypes:i,disableKeyboardA11y:v},M))]})}LA.displayName="EdgeRenderer";const JY=j.memo(LA),eQ=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function tQ({children:e}){const t=St(eQ);return c.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function nQ(e){const t=xp(),n=j.useRef(!1);j.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const iQ=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function rQ(e){const t=St(iQ),n=nn();return j.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function aQ(e){return e.connection.inProgress?{...e.connection,to:ld(e.connection.to,e.transform)}:{...e.connection}}function sQ(e){return aQ}function lQ(e){const t=sQ();return St(t,tn)}const oQ=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function cQ({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:a,width:l,height:o,isValid:d,inProgress:f}=St(oQ,tn);return!(l&&a&&f)?null:c.jsx("svg",{style:e,width:l,height:o,className:"react-flow__connectionline react-flow__container",children:c.jsx("g",{className:Nn(["react-flow__connection",DC(d)]),children:c.jsx(IA,{style:t,type:n,CustomComponent:i,isValid:d})})})}const IA=({style:e,type:t=os.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:a,from:l,fromNode:o,fromHandle:d,fromPosition:f,to:h,toNode:g,toHandle:m,toPosition:y,pointer:b}=lQ();if(!a)return;if(n)return c.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:d,fromX:l.x,fromY:l.y,toX:h.x,toY:h.y,fromPosition:f,toPosition:y,connectionStatus:DC(i),toNode:g,toHandle:m,pointer:b});let k="";const v={sourceX:l.x,sourceY:l.y,sourcePosition:f,targetX:h.x,targetY:h.y,targetPosition:y};switch(t){case os.Bezier:[k]=KC(v);break;case os.SimpleBezier:[k]=EA(v);break;case os.Step:[k]=bb({...v,borderRadius:0});break;case os.SmoothStep:[k]=bb(v);break;default:[k]=VC(v)}return c.jsx("path",{d:k,fill:"none",className:"react-flow__connection-path",style:e})};IA.displayName="ConnectionLine";const uQ={};function GS(e=uQ){j.useRef(e),nn(),j.useEffect(()=>{},[e])}function dQ(){nn(),j.useRef(!1),j.useEffect(()=>{},[])}function zA({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:o,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:h,onNodeContextMenu:g,onSelectionContextMenu:m,onSelectionStart:y,onSelectionEnd:b,connectionLineType:k,connectionLineStyle:v,connectionLineComponent:N,connectionLineContainerStyle:E,selectionKeyCode:C,selectionOnDrag:S,selectionMode:_,multiSelectionKeyCode:M,panActivationKeyCode:T,zoomActivationKeyCode:R,deleteKeyCode:O,onlyRenderVisibleElements:$,elementsSelectable:I,defaultViewport:q,translateExtent:F,minZoom:Y,maxZoom:D,preventScrolling:K,defaultMarkerColor:P,zoomOnScroll:H,zoomOnPinch:Q,panOnScroll:G,panOnScrollSpeed:L,panOnScrollMode:z,zoomOnDoubleClick:V,panOnDrag:B,autoPanOnSelection:le,onPaneClick:ve,onPaneMouseEnter:ke,onPaneMouseMove:Se,onPaneMouseLeave:J,onPaneScroll:ue,onPaneContextMenu:Te,paneClickDistance:Re,nodeClickDistance:De,onEdgeContextMenu:ce,onEdgeMouseEnter:Ce,onEdgeMouseMove:te,onEdgeMouseLeave:pe,reconnectRadius:Fe,onReconnect:ze,onReconnectStart:ae,onReconnectEnd:be,noDragClassName:ye,noWheelClassName:he,noPanClassName:Ee,disableKeyboardA11y:Ne,nodeExtent:Ke,rfId:ne,viewport:de,onViewportChange:Le}){return GS(e),GS(t),dQ(),nQ(n),rQ(de),c.jsx(_Y,{onPaneClick:ve,onPaneMouseEnter:ke,onPaneMouseMove:Se,onPaneMouseLeave:J,onPaneContextMenu:Te,onPaneScroll:ue,paneClickDistance:Re,deleteKeyCode:O,selectionKeyCode:C,selectionOnDrag:S,selectionMode:_,onSelectionStart:y,onSelectionEnd:b,multiSelectionKeyCode:M,panActivationKeyCode:T,zoomActivationKeyCode:R,elementsSelectable:I,zoomOnScroll:H,zoomOnPinch:Q,zoomOnDoubleClick:V,panOnScroll:G,panOnScrollSpeed:L,panOnScrollMode:z,panOnDrag:B,autoPanOnSelection:le,defaultViewport:q,translateExtent:F,minZoom:Y,maxZoom:D,onSelectionContextMenu:m,preventScrolling:K,noDragClassName:ye,noWheelClassName:he,noPanClassName:Ee,disableKeyboardA11y:Ne,onViewportChange:Le,isControlledViewport:!!de,children:c.jsxs(tQ,{children:[c.jsx(JY,{edgeTypes:t,onEdgeClick:a,onEdgeDoubleClick:o,onReconnect:ze,onReconnectStart:ae,onReconnectEnd:be,onlyRenderVisibleElements:$,onEdgeContextMenu:ce,onEdgeMouseEnter:Ce,onEdgeMouseMove:te,onEdgeMouseLeave:pe,reconnectRadius:Fe,defaultMarkerColor:P,noPanClassName:Ee,disableKeyboardA11y:Ne,rfId:ne}),c.jsx(cQ,{style:v,type:k,component:N,containerStyle:E}),c.jsx("div",{className:"react-flow__edgelabel-renderer"}),c.jsx(LY,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:l,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:h,onNodeContextMenu:g,nodeClickDistance:De,onlyRenderVisibleElements:$,noPanClassName:Ee,noDragClassName:ye,disableKeyboardA11y:Ne,nodeExtent:Ke,rfId:ne}),c.jsx("div",{className:"react-flow__viewport-portal"})]})})}zA.displayName="GraphView";const fQ=j.memo(zA),hQ=PC(),VS=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:a,height:l,fitView:o,fitViewOptions:d,minZoom:f=.5,maxZoom:h=2,nodeOrigin:g,nodeExtent:m,zIndexMode:y="basic"}={})=>{const b=new Map,k=new Map,v=new Map,N=new Map,E=i??t??[],C=n??e??[],S=g??[0,0],_=m??Ou;WC(v,N,E);const{nodesInitialized:M}=vb(C,b,k,{nodeOrigin:S,nodeExtent:_,zIndexMode:y});let T=[0,0,1];if(o&&a&&l){const R=ad(b,{filter:q=>!!((q.width||q.initialWidth)&&(q.height||q.initialHeight))}),{x:O,y:$,zoom:I}=Yx(R,a,l,f,h,(d==null?void 0:d.padding)??.1);T=[O,$,I]}return{rfId:"1",width:a??0,height:l??0,transform:T,nodes:C,nodesInitialized:M,nodeLookup:b,parentLookup:k,edges:E,edgeLookup:N,connectionLookup:v,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:f,maxZoom:h,translateExtent:Ou,nodeExtent:_,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ho.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:S,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:d,fitViewResolver:null,connection:{...MC},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:hQ,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:TC,zIndexMode:y,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},pQ=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:a,height:l,fitView:o,fitViewOptions:d,minZoom:f,maxZoom:h,nodeOrigin:g,nodeExtent:m,zIndexMode:y})=>_V((b,k)=>{async function v(){const{nodeLookup:N,panZoom:E,fitViewOptions:C,fitViewResolver:S,width:_,height:M,minZoom:T,maxZoom:R}=k();E&&(await kG({nodes:N,width:_,height:M,panZoom:E,minZoom:T,maxZoom:R},C),S==null||S.resolve(!0),b({fitViewResolver:null}))}return{...VS({nodes:e,edges:t,width:a,height:l,fitView:o,fitViewOptions:d,minZoom:f,maxZoom:h,nodeOrigin:g,nodeExtent:m,defaultNodes:n,defaultEdges:i,zIndexMode:y}),setNodes:N=>{const{nodeLookup:E,parentLookup:C,nodeOrigin:S,elevateNodesOnSelect:_,fitViewQueued:M,zIndexMode:T,nodesSelectionActive:R}=k(),{nodesInitialized:O,hasSelectedNodes:$}=vb(N,E,C,{nodeOrigin:S,nodeExtent:m,elevateNodesOnSelect:_,checkEquality:!0,zIndexMode:T}),I=R&&$;M&&O?(v(),b({nodes:N,nodesInitialized:O,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:I})):b({nodes:N,nodesInitialized:O,nodesSelectionActive:I})},setEdges:N=>{const{connectionLookup:E,edgeLookup:C}=k();WC(E,C,N),b({edges:N})},setDefaultNodesAndEdges:(N,E)=>{if(N){const{setNodes:C}=k();C(N),b({hasDefaultNodes:!0})}if(E){const{setEdges:C}=k();C(E),b({hasDefaultEdges:!0})}},updateNodeInternals:N=>{const{triggerNodeChanges:E,nodeLookup:C,parentLookup:S,domNode:_,nodeOrigin:M,nodeExtent:T,debug:R,fitViewQueued:O,zIndexMode:$}=k(),{changes:I,updatedInternals:q}=KG(N,C,S,_,M,T,$);q&&(UG(C,S,{nodeOrigin:M,nodeExtent:T,zIndexMode:$}),O?(v(),b({fitViewQueued:!1,fitViewOptions:void 0})):b({}),(I==null?void 0:I.length)>0&&(R&&console.log("React Flow: trigger node changes",I),E==null||E(I)))},updateNodePositions:(N,E=!1)=>{const C=[];let S=[];const{nodeLookup:_,triggerNodeChanges:M,connection:T,updateConnection:R,onNodesChangeMiddlewareMap:O}=k();for(const[$,I]of N){const q=_.get($),F=!!(q!=null&&q.expandParent&&(q!=null&&q.parentId)&&(I!=null&&I.position)),Y={id:$,type:"position",position:F?{x:Math.max(0,I.position.x),y:Math.max(0,I.position.y)}:I.position,dragging:E};if(q&&T.inProgress&&T.fromNode.id===q.id){const D=vl(q,T.fromHandle,Ge.Left,!0);R({...T,from:D})}F&&q.parentId&&C.push({id:$,parentId:q.parentId,rect:{...I.internals.positionAbsolute,width:I.measured.width??0,height:I.measured.height??0}}),S.push(Y)}if(C.length>0){const{parentLookup:$,nodeOrigin:I}=k(),q=ev(C,_,$,I);S.push(...q)}for(const $ of O.values())S=$(S);M(S)},triggerNodeChanges:N=>{const{onNodesChange:E,setNodes:C,nodes:S,hasDefaultNodes:_,debug:M}=k();if(N!=null&&N.length){if(_){const T=dA(N,S);C(T)}M&&console.log("React Flow: trigger node changes",N),E==null||E(N)}},triggerEdgeChanges:N=>{const{onEdgesChange:E,setEdges:C,edges:S,hasDefaultEdges:_,debug:M}=k();if(N!=null&&N.length){if(_){const T=fA(N,S);C(T)}M&&console.log("React Flow: trigger edge changes",N),E==null||E(N)}},addSelectedNodes:N=>{const{multiSelectionActive:E,edgeLookup:C,nodeLookup:S,triggerNodeChanges:_,triggerEdgeChanges:M}=k();if(E){const T=N.map(R=>Ys(R,!0));_(T);return}_(wo(S,new Set([...N]),!0)),M(wo(C))},addSelectedEdges:N=>{const{multiSelectionActive:E,edgeLookup:C,nodeLookup:S,triggerNodeChanges:_,triggerEdgeChanges:M}=k();if(E){const T=N.map(R=>Ys(R,!0));M(T);return}M(wo(C,new Set([...N]))),_(wo(S,new Set,!0))},unselectNodesAndEdges:({nodes:N,edges:E}={})=>{const{edges:C,nodes:S,nodeLookup:_,triggerNodeChanges:M,triggerEdgeChanges:T}=k(),R=N||S,O=E||C,$=[];for(const q of R){if(!q.selected)continue;const F=_.get(q.id);F&&(F.selected=!1),$.push(Ys(q.id,!1))}const I=[];for(const q of O)q.selected&&I.push(Ys(q.id,!1));M($),T(I)},setMinZoom:N=>{const{panZoom:E,maxZoom:C}=k();E==null||E.setScaleExtent([N,C]),b({minZoom:N})},setMaxZoom:N=>{const{panZoom:E,minZoom:C}=k();E==null||E.setScaleExtent([C,N]),b({maxZoom:N})},setTranslateExtent:N=>{var E;(E=k().panZoom)==null||E.setTranslateExtent(N),b({translateExtent:N})},resetSelectedElements:()=>{const{edges:N,nodes:E,triggerNodeChanges:C,triggerEdgeChanges:S,elementsSelectable:_}=k();if(!_)return;const M=E.reduce((R,O)=>O.selected?[...R,Ys(O.id,!1)]:R,[]),T=N.reduce((R,O)=>O.selected?[...R,Ys(O.id,!1)]:R,[]);C(M),S(T)},setNodeExtent:N=>{const{nodes:E,nodeLookup:C,parentLookup:S,nodeOrigin:_,elevateNodesOnSelect:M,nodeExtent:T,zIndexMode:R}=k();N[0][0]===T[0][0]&&N[0][1]===T[0][1]&&N[1][0]===T[1][0]&&N[1][1]===T[1][1]||(vb(E,C,S,{nodeOrigin:_,nodeExtent:N,elevateNodesOnSelect:M,checkEquality:!1,zIndexMode:R}),b({nodeExtent:N}))},panBy:N=>{const{transform:E,width:C,height:S,panZoom:_,translateExtent:M}=k();return GG({delta:N,panZoom:_,transform:E,translateExtent:M,width:C,height:S})},setCenter:async(N,E,C)=>{const{width:S,height:_,maxZoom:M,panZoom:T}=k();if(!T)return!1;const R=typeof(C==null?void 0:C.zoom)<"u"?C.zoom:M;return await T.setViewport({x:S/2-N*R,y:_/2-E*R,zoom:R},{duration:C==null?void 0:C.duration,ease:C==null?void 0:C.ease,interpolate:C==null?void 0:C.interpolate}),!0},cancelConnection:()=>{b({connection:{...MC}})},updateConnection:N=>{b({connection:N})},reset:()=>b({...VS()})}},Object.is);function PA({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:a,initialHeight:l,initialMinZoom:o,initialMaxZoom:d,initialFitViewOptions:f,fitView:h,nodeOrigin:g,nodeExtent:m,zIndexMode:y,children:b}){const[k]=j.useState(()=>pQ({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:a,height:l,fitView:h,minZoom:o,maxZoom:d,fitViewOptions:f,nodeOrigin:g,nodeExtent:m,zIndexMode:y}));return c.jsx(jV,{value:k,children:c.jsx(ZV,{children:c.jsx(hY,{children:b})})})}function mQ({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:a,width:l,height:o,fitView:d,fitViewOptions:f,minZoom:h,maxZoom:g,nodeOrigin:m,nodeExtent:y,zIndexMode:b}){return j.useContext(yp)?c.jsx(c.Fragment,{children:e}):c.jsx(PA,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:a,initialWidth:l,initialHeight:o,fitView:d,initialFitViewOptions:f,initialMinZoom:h,initialMaxZoom:g,nodeOrigin:m,nodeExtent:y,zIndexMode:b,children:e})}const gQ={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function yQ({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:a,nodeTypes:l,edgeTypes:o,onNodeClick:d,onEdgeClick:f,onInit:h,onMove:g,onMoveStart:m,onMoveEnd:y,onConnect:b,onConnectStart:k,onConnectEnd:v,onClickConnectStart:N,onClickConnectEnd:E,onNodeMouseEnter:C,onNodeMouseMove:S,onNodeMouseLeave:_,onNodeContextMenu:M,onNodeDoubleClick:T,onNodeDragStart:R,onNodeDrag:O,onNodeDragStop:$,onNodesDelete:I,onEdgesDelete:q,onDelete:F,onSelectionChange:Y,onSelectionDragStart:D,onSelectionDrag:K,onSelectionDragStop:P,onSelectionContextMenu:H,onSelectionStart:Q,onSelectionEnd:G,onBeforeDelete:L,connectionMode:z,connectionLineType:V=os.Bezier,connectionLineStyle:B,connectionLineComponent:le,connectionLineContainerStyle:ve,deleteKeyCode:ke="Backspace",selectionKeyCode:Se="Shift",selectionOnDrag:J=!1,selectionMode:ue=Ru.Full,panActivationKeyCode:Te="Space",multiSelectionKeyCode:Re=Iu()?"Meta":"Control",zoomActivationKeyCode:De=Iu()?"Meta":"Control",snapToGrid:ce,snapGrid:Ce,onlyRenderVisibleElements:te=!1,selectNodesOnDrag:pe,nodesDraggable:Fe,autoPanOnNodeFocus:ze,nodesConnectable:ae,nodesFocusable:be,nodeOrigin:ye=cA,edgesFocusable:he,edgesReconnectable:Ee,elementsSelectable:Ne=!0,defaultViewport:Ke=$V,minZoom:ne=.5,maxZoom:de=2,translateExtent:Le=Ou,preventScrolling:Ze=!0,nodeExtent:rt,defaultMarkerColor:At="#b1b1b7",zoomOnScroll:$n=!0,zoomOnPinch:dn=!0,panOnScroll:Mt=!1,panOnScrollSpeed:Qt=.5,panOnScrollMode:yt=ul.Free,zoomOnDoubleClick:Ti=!0,panOnDrag:Rn=!0,onPaneClick:Nl,onPaneMouseEnter:Pr,onPaneMouseMove:wa,onPaneMouseLeave:Br,onPaneScroll:Un,onPaneContextMenu:Z,paneClickDistance:ge=1,nodeClickDistance:Me=0,children:it,onReconnect:Ft,onReconnectStart:Ot,onReconnectEnd:Ue,onEdgeContextMenu:Pe,onEdgeDoubleClick:et,onEdgeMouseEnter:rn,onEdgeMouseMove:Vt,onEdgeMouseLeave:Qi,reconnectRadius:ka=10,onNodesChange:Ea,onEdgesChange:Mi,noDragClassName:an="nodrag",noWheelClassName:Tn="nowheel",noPanClassName:Wi="nopan",fitView:Sa,fitViewOptions:_s,connectOnClick:Na,attributionPosition:_l,proOptions:$r,defaultEdgeOptions:js,elevateNodesOnSelect:Ln=!0,elevateEdgesOnSelect:Xi=!1,disableKeyboardA11y:Zi=!1,autoPanOnConnect:yr,autoPanOnNodeDrag:fn,autoPanOnSelection:jl=!0,autoPanSpeed:Ur,connectionRadius:Ji,isValidConnection:_e,onError:Ve,style:ht,id:Nt,nodeDragThreshold:sn,connectionDragThreshold:Mn,viewport:Qn,onViewportChange:Fn,width:zt,height:Wn,colorMode:Cl="light",debug:_a,onScroll:br,ariaLabelConfig:ja,zIndexMode:Al="basic",...qn},Cs){const er=Nt||"1",Ca=HV(Cl),_n=j.useCallback(As=>{As.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),br==null||br(As)},[br]);return c.jsx("div",{"data-testid":"rf__wrapper",...qn,onScroll:_n,style:{...ht,...gQ},ref:Cs,className:Nn(["react-flow",a,Ca]),id:Nt,role:"application",children:c.jsxs(mQ,{nodes:e,edges:t,width:zt,height:Wn,fitView:Sa,fitViewOptions:_s,minZoom:ne,maxZoom:de,nodeOrigin:ye,nodeExtent:rt,zIndexMode:Al,children:[c.jsx(qV,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:b,onConnectStart:k,onConnectEnd:v,onClickConnectStart:N,onClickConnectEnd:E,nodesDraggable:Fe,autoPanOnNodeFocus:ze,nodesConnectable:ae,nodesFocusable:be,edgesFocusable:he,edgesReconnectable:Ee,elementsSelectable:Ne,elevateNodesOnSelect:Ln,elevateEdgesOnSelect:Xi,minZoom:ne,maxZoom:de,nodeExtent:rt,onNodesChange:Ea,onEdgesChange:Mi,snapToGrid:ce,snapGrid:Ce,connectionMode:z,translateExtent:Le,connectOnClick:Na,defaultEdgeOptions:js,fitView:Sa,fitViewOptions:_s,onNodesDelete:I,onEdgesDelete:q,onDelete:F,onNodeDragStart:R,onNodeDrag:O,onNodeDragStop:$,onSelectionDrag:K,onSelectionDragStart:D,onSelectionDragStop:P,onMove:g,onMoveStart:m,onMoveEnd:y,noPanClassName:Wi,nodeOrigin:ye,rfId:er,autoPanOnConnect:yr,autoPanOnNodeDrag:fn,autoPanSpeed:Ur,onError:Ve,connectionRadius:Ji,isValidConnection:_e,selectNodesOnDrag:pe,nodeDragThreshold:sn,connectionDragThreshold:Mn,onBeforeDelete:L,debug:_a,ariaLabelConfig:ja,zIndexMode:Al}),c.jsx(fQ,{onInit:h,onNodeClick:d,onEdgeClick:f,onNodeMouseEnter:C,onNodeMouseMove:S,onNodeMouseLeave:_,onNodeContextMenu:M,onNodeDoubleClick:T,nodeTypes:l,edgeTypes:o,connectionLineType:V,connectionLineStyle:B,connectionLineComponent:le,connectionLineContainerStyle:ve,selectionKeyCode:Se,selectionOnDrag:J,selectionMode:ue,deleteKeyCode:ke,multiSelectionKeyCode:Re,panActivationKeyCode:Te,zoomActivationKeyCode:De,onlyRenderVisibleElements:te,defaultViewport:Ke,translateExtent:Le,minZoom:ne,maxZoom:de,preventScrolling:Ze,zoomOnScroll:$n,zoomOnPinch:dn,zoomOnDoubleClick:Ti,panOnScroll:Mt,panOnScrollSpeed:Qt,panOnScrollMode:yt,panOnDrag:Rn,autoPanOnSelection:jl,onPaneClick:Nl,onPaneMouseEnter:Pr,onPaneMouseMove:wa,onPaneMouseLeave:Br,onPaneScroll:Un,onPaneContextMenu:Z,paneClickDistance:ge,nodeClickDistance:Me,onSelectionContextMenu:H,onSelectionStart:Q,onSelectionEnd:G,onReconnect:Ft,onReconnectStart:Ot,onReconnectEnd:Ue,onEdgeContextMenu:Pe,onEdgeDoubleClick:et,onEdgeMouseEnter:rn,onEdgeMouseMove:Vt,onEdgeMouseLeave:Qi,reconnectRadius:ka,defaultMarkerColor:At,noDragClassName:an,noWheelClassName:Tn,noPanClassName:Wi,rfId:er,disableKeyboardA11y:Zi,nodeExtent:rt,viewport:Qn,onViewportChange:Fn}),c.jsx(BV,{onSelectionChange:Y}),it,c.jsx(RV,{proOptions:$r,position:_l}),c.jsx(OV,{rfId:er,disableKeyboardA11y:Zi})]})})}var bQ=hA(yQ);function xQ(e){const[t,n]=j.useState(e),i=j.useCallback(a=>n(l=>dA(a,l)),[]);return[t,n,i]}function vQ(e){const[t,n]=j.useState(e),i=j.useCallback(a=>n(l=>fA(a,l)),[]);return[t,n,i]}function wQ({dimensions:e,lineWidth:t,variant:n,className:i}){return c.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Nn(["react-flow__background-pattern",n,i])})}function kQ({radius:e,className:t}){return c.jsx("circle",{cx:e,cy:e,r:e,className:Nn(["react-flow__background-pattern","dots",t])})}var pa;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(pa||(pa={}));const EQ={[pa.Dots]:1,[pa.Lines]:1,[pa.Cross]:6},SQ=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function BA({id:e,variant:t=pa.Dots,gap:n=20,size:i,lineWidth:a=1,offset:l=0,color:o,bgColor:d,style:f,className:h,patternClassName:g}){const m=j.useRef(null),{transform:y,patternId:b}=St(SQ,tn),k=i||EQ[t],v=t===pa.Dots,N=t===pa.Cross,E=Array.isArray(n)?n:[n,n],C=[E[0]*y[2]||1,E[1]*y[2]||1],S=k*y[2],_=Array.isArray(l)?l:[l,l],M=N?[S,S]:C,T=[_[0]*y[2]||1+M[0]/2,_[1]*y[2]||1+M[1]/2],R=`${b}${e||""}`;return c.jsxs("svg",{className:Nn(["react-flow__background",h]),style:{...f,...vp,"--xy-background-color-props":d,"--xy-background-pattern-color-props":o},ref:m,"data-testid":"rf__background",children:[c.jsx("pattern",{id:R,x:y[0]%C[0],y:y[1]%C[1],width:C[0],height:C[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`,children:v?c.jsx(kQ,{radius:S/2,className:g}):c.jsx(wQ,{dimensions:M,lineWidth:a,variant:t,className:g})}),c.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${R})`})]})}BA.displayName="Background";const NQ=j.memo(BA);function _Q(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:c.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function jQ(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:c.jsx("path",{d:"M0 0h32v4.2H0z"})})}function CQ(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:c.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function AQ(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:c.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function TQ(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:c.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Yf({children:e,className:t,...n}){return c.jsx("button",{type:"button",className:Nn(["react-flow__controls-button",t]),...n,children:e})}const MQ=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function $A({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:a,onZoomIn:l,onZoomOut:o,onFitView:d,onInteractiveChange:f,className:h,children:g,position:m="bottom-left",orientation:y="vertical","aria-label":b}){const k=nn(),{isInteractive:v,minZoomReached:N,maxZoomReached:E,ariaLabelConfig:C}=St(MQ,tn),{zoomIn:S,zoomOut:_,fitView:M}=xp(),T=()=>{S(),l==null||l()},R=()=>{_(),o==null||o()},O=()=>{M(a),d==null||d()},$=()=>{k.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),f==null||f(!v)},I=y==="horizontal"?"horizontal":"vertical";return c.jsxs(bp,{className:Nn(["react-flow__controls",I,h]),position:m,style:e,"data-testid":"rf__controls","aria-label":b??C["controls.ariaLabel"],children:[t&&c.jsxs(c.Fragment,{children:[c.jsx(Yf,{onClick:T,className:"react-flow__controls-zoomin",title:C["controls.zoomIn.ariaLabel"],"aria-label":C["controls.zoomIn.ariaLabel"],disabled:E,children:c.jsx(_Q,{})}),c.jsx(Yf,{onClick:R,className:"react-flow__controls-zoomout",title:C["controls.zoomOut.ariaLabel"],"aria-label":C["controls.zoomOut.ariaLabel"],disabled:N,children:c.jsx(jQ,{})})]}),n&&c.jsx(Yf,{className:"react-flow__controls-fitview",onClick:O,title:C["controls.fitView.ariaLabel"],"aria-label":C["controls.fitView.ariaLabel"],children:c.jsx(CQ,{})}),i&&c.jsx(Yf,{className:"react-flow__controls-interactive",onClick:$,title:C["controls.interactive.ariaLabel"],"aria-label":C["controls.interactive.ariaLabel"],children:v?c.jsx(TQ,{}):c.jsx(AQ,{})}),g]})}$A.displayName="Controls";const DQ=j.memo($A);function OQ({id:e,x:t,y:n,width:i,height:a,style:l,color:o,strokeColor:d,strokeWidth:f,className:h,borderRadius:g,shapeRendering:m,selected:y,onClick:b}){const{background:k,backgroundColor:v}=l||{},N=o||k||v;return c.jsx("rect",{className:Nn(["react-flow__minimap-node",{selected:y},h]),x:t,y:n,rx:g,ry:g,width:i,height:a,style:{fill:N,stroke:d,strokeWidth:f},shapeRendering:m,onClick:b?E=>b(E,e):void 0})}const RQ=j.memo(OQ),LQ=e=>e.nodes.map(t=>t.id),ky=e=>e instanceof Function?e:()=>e;function IQ({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:l=RQ,onClick:o}){const d=St(LQ,tn),f=ky(t),h=ky(e),g=ky(n),m=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return c.jsx(c.Fragment,{children:d.map(y=>c.jsx(PQ,{id:y,nodeColorFunc:f,nodeStrokeColorFunc:h,nodeClassNameFunc:g,nodeBorderRadius:i,nodeStrokeWidth:a,NodeComponent:l,onClick:o,shapeRendering:m},y))})}function zQ({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:a,nodeStrokeWidth:l,shapeRendering:o,NodeComponent:d,onClick:f}){const{node:h,x:g,y:m,width:y,height:b}=St(k=>{const v=k.nodeLookup.get(e);if(!v)return{node:void 0,x:0,y:0,width:0,height:0};const N=v.internals.userNode,{x:E,y:C}=v.internals.positionAbsolute,{width:S,height:_}=va(N);return{node:N,x:E,y:C,width:S,height:_}},tn);return!h||h.hidden||!BC(h)?null:c.jsx(d,{x:g,y:m,width:y,height:b,style:h.style,selected:!!h.selected,className:i(h),color:t(h),borderRadius:a,strokeColor:n(h),strokeWidth:l,shapeRendering:o,onClick:f,id:h.id})}const PQ=j.memo(zQ);var BQ=j.memo(IQ);const $Q=200,UQ=150,FQ=e=>!e.hidden,qQ=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?IC(ad(e.nodeLookup,{filter:FQ}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},HQ="react-flow__minimap-desc";function UA({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:a="",nodeBorderRadius:l=5,nodeStrokeWidth:o,nodeComponent:d,bgColor:f,maskColor:h,maskStrokeColor:g,maskStrokeWidth:m,position:y="bottom-right",onClick:b,onNodeClick:k,pannable:v=!1,zoomable:N=!1,ariaLabel:E,inversePan:C,zoomStep:S=1,offsetScale:_=5}){const M=nn(),T=j.useRef(null),{boundingRect:R,viewBB:O,rfId:$,panZoom:I,translateExtent:q,flowWidth:F,flowHeight:Y,ariaLabelConfig:D}=St(qQ,tn),K=(e==null?void 0:e.width)??$Q,P=(e==null?void 0:e.height)??UQ,H=R.width/K,Q=R.height/P,G=Math.max(H,Q),L=G*K,z=G*P,V=_*G,B=R.x-(L-R.width)/2-V,le=R.y-(z-R.height)/2-V,ve=L+V*2,ke=z+V*2,Se=`${HQ}-${$}`,J=j.useRef(0),ue=j.useRef();J.current=G,j.useEffect(()=>{if(T.current&&I)return ue.current=tV({domNode:T.current,panZoom:I,getTransform:()=>M.getState().transform,getViewScale:()=>J.current}),()=>{var ce;(ce=ue.current)==null||ce.destroy()}},[I]),j.useEffect(()=>{var ce;(ce=ue.current)==null||ce.update({translateExtent:q,width:F,height:Y,inversePan:C,pannable:v,zoomStep:S,zoomable:N})},[v,N,C,S,q,F,Y]);const Te=b?ce=>{var pe;const[Ce,te]=((pe=ue.current)==null?void 0:pe.pointer(ce))||[0,0];b(ce,{x:Ce,y:te})}:void 0,Re=k?j.useCallback((ce,Ce)=>{const te=M.getState().nodeLookup.get(Ce).internals.userNode;k(ce,te)},[]):void 0,De=E??D["minimap.ariaLabel"];return c.jsx(bp,{position:y,style:{...e,"--xy-minimap-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-color-props":typeof g=="string"?g:void 0,"--xy-minimap-mask-stroke-width-props":typeof m=="number"?m*G:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="number"?o:void 0},className:Nn(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:c.jsxs("svg",{width:K,height:P,viewBox:`${B} ${le} ${ve} ${ke}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Se,ref:T,onClick:Te,children:[De&&c.jsx("title",{id:Se,children:De}),c.jsx(BQ,{onClick:Re,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:l,nodeClassName:a,nodeStrokeWidth:o,nodeComponent:d}),c.jsx("path",{className:"react-flow__minimap-mask",d:`M${B-V},${le-V}h${ve+V*2}v${ke+V*2}h${-ve-V*2}z
680
+ M${O.x},${O.y}h${O.width}v${O.height}h${-O.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}UA.displayName="MiniMap";j.memo(UA);const KQ=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,GQ={[Vo.Line]:"right",[Vo.Handle]:"bottom-right"};function VQ({nodeId:e,position:t,variant:n=Vo.Handle,className:i,style:a=void 0,children:l,color:o,minWidth:d=10,minHeight:f=10,maxWidth:h=Number.MAX_VALUE,maxHeight:g=Number.MAX_VALUE,keepAspectRatio:m=!1,resizeDirection:y,autoScale:b=!0,shouldResize:k,onResizeStart:v,onResize:N,onResizeEnd:E}){const C=yA(),S=typeof e=="string"?e:C,_=nn(),M=j.useRef(null),T=n===Vo.Handle,R=St(j.useCallback(KQ(T&&b),[T,b]),tn),O=j.useRef(null),$=t??GQ[n];j.useEffect(()=>{if(!(!M.current||!S))return O.current||(O.current=pV({domNode:M.current,nodeId:S,getStoreItems:()=>{const{nodeLookup:q,transform:F,snapGrid:Y,snapToGrid:D,nodeOrigin:K,domNode:P}=_.getState();return{nodeLookup:q,transform:F,snapGrid:Y,snapToGrid:D,nodeOrigin:K,paneDomNode:P}},onChange:(q,F)=>{const{triggerNodeChanges:Y,nodeLookup:D,parentLookup:K,nodeOrigin:P}=_.getState(),H=[],Q={x:q.x,y:q.y},G=D.get(S);if(G&&G.expandParent&&G.parentId){const L=G.origin??P,z=q.width??G.measured.width??0,V=q.height??G.measured.height??0,B={id:G.id,parentId:G.parentId,rect:{width:z,height:V,...$C({x:q.x??G.position.x,y:q.y??G.position.y},{width:z,height:V},G.parentId,D,L)}},le=ev([B],D,K,P);H.push(...le),Q.x=q.x?Math.max(L[0]*z,q.x):void 0,Q.y=q.y?Math.max(L[1]*V,q.y):void 0}if(Q.x!==void 0&&Q.y!==void 0){const L={id:S,type:"position",position:{...Q}};H.push(L)}if(q.width!==void 0&&q.height!==void 0){const z={id:S,type:"dimensions",resizing:!0,setAttributes:y?y==="horizontal"?"width":"height":!0,dimensions:{width:q.width,height:q.height}};H.push(z)}for(const L of F){const z={...L,type:"position"};H.push(z)}Y(H)},onEnd:({width:q,height:F})=>{const Y={id:S,type:"dimensions",resizing:!1,dimensions:{width:q,height:F}};_.getState().triggerNodeChanges([Y])}})),O.current.update({controlPosition:$,boundaries:{minWidth:d,minHeight:f,maxWidth:h,maxHeight:g},keepAspectRatio:m,resizeDirection:y,onResizeStart:v,onResize:N,onResizeEnd:E,shouldResize:k}),()=>{var q;(q=O.current)==null||q.destroy()}},[$,d,f,h,g,m,v,N,E,k]);const I=$.split("-");return c.jsx("div",{className:Nn(["react-flow__resize-control","nodrag",...I,n,i]),ref:M,style:{...a,scale:R,...o&&{[T?"backgroundColor":"borderColor"]:o}},children:l})}j.memo(VQ);function YQ(e){return ft(`/api/smartarrange/${encodeURIComponent(e)}`)}async function QQ(e){const t=await fetch(`/api/smartarrange/${encodeURIComponent(e)}/approve`,{method:"POST"});if(!t.ok)throw new Error(`${t.status}: ${await t.text()}`);return t.json()}const Ey=["var(--color-accent-mint)","var(--color-accent-pink)","var(--color-accent-purple)","var(--color-accent-yellow)","var(--color-running-bg)","var(--color-idle-bg)","var(--color-stuck-bg)"];function YS(e,t){return Ey[t%Ey.length]??Ey[0]}const FA={done:"var(--color-cta)",doing:"var(--color-secondary-dark)",todo:"var(--color-text-subtle)",stuck:"var(--color-crashed)"},fo={width:9,height:9,background:"var(--color-bg)",border:"1px solid var(--color-border-light)"},WQ=j.memo(function({data:t,selected:n}){var a;const i=t;return c.jsxs("div",{className:"rounded-2xl border border-[var(--color-border-light)] bg-[var(--color-bg-soft)] overflow-hidden cursor-pointer flex flex-col",style:{width:260,height:158,boxShadow:n?"rgba(255, 255, 255, 0.22) 0 0 0 1px inset":"rgba(255, 255, 255, 0.10) 0 0 0 1px inset"},children:[c.jsx(Tr,{id:"l-t",type:"target",position:Ge.Left,style:fo}),c.jsx(Tr,{id:"r-t",type:"target",position:Ge.Right,style:fo}),c.jsx(Tr,{id:"t-t",type:"target",position:Ge.Top,style:fo}),c.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5 border-b border-[var(--color-border-light)]",style:{background:i.color},children:[c.jsxs("span",{className:"font-[family-name:var(--font-mono)] text-xs font-bold text-[var(--color-text)]",children:["#",i.seq]}),c.jsx("span",{className:"text-[11px] text-[var(--color-text)] truncate",children:i.taskLabel}),c.jsx("span",{className:"w-2.5 h-2.5 rounded-full inline-block shrink-0 ml-auto",style:{background:FA[i.status]??"gray"},title:i.status})]}),c.jsxs("div",{className:"px-2.5 py-2 flex-1 min-h-0 overflow-hidden",children:[c.jsx("p",{className:"text-[13px] font-semibold text-[var(--color-text)] leading-snug line-clamp-3",children:i.title}),((a=i.skills)==null?void 0:a.length)>0&&c.jsx("div",{className:"flex flex-wrap gap-1 mt-2 max-h-[46px] overflow-hidden",children:i.skills.slice(0,6).map(l=>c.jsx("span",{className:"text-[10px] font-[family-name:var(--font-mono)] px-1.5 py-0.5 rounded bg-[rgba(255,255,255,0.08)] text-[var(--color-text)]",children:l},l))})]}),c.jsx(Tr,{id:"r-s",type:"source",position:Ge.Right,style:fo}),c.jsx(Tr,{id:"l-s",type:"source",position:Ge.Left,style:fo}),c.jsx(Tr,{id:"b-s",type:"source",position:Ge.Bottom,style:fo})]})});function XQ({card:e,status:t,onClose:n}){var a;const i=Be();return j.useEffect(()=>{const l=o=>{o.key==="Escape"&&n()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[n]),c.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",onClick:n,children:c.jsxs("div",{className:"nb-card mt-12 w-full max-w-2xl bg-[var(--color-bg)]",onClick:l=>l.stopPropagation(),children:[c.jsxs("header",{className:"flex items-start justify-between gap-4 mb-4",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-2 flex-wrap",children:[c.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-xs px-2 py-0.5 bg-[var(--color-accent-purple)] border-2 border-[var(--color-text)] rounded-full",children:["#",e.seq]}),c.jsxs("span",{className:"font-[family-name:var(--font-mono)] text-xs px-2 py-0.5 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-full font-semibold",children:[i("arrange.cardTask")," T",e.taskId]}),c.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs px-2 py-0.5 border-2 border-[var(--color-text)] rounded-full font-semibold",children:[c.jsx("span",{className:"w-2.5 h-2.5 rounded-full inline-block border border-[var(--color-text)]",style:{background:FA[t]??"gray"}}),t]})]}),c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold break-words",children:e.title})]}),c.jsx("button",{onClick:n,className:"nb-btn nb-btn-mint p-2 flex-shrink-0","aria-label":i("arrange.close"),type:"button",children:c.jsx(bn,{size:14,strokeWidth:3})})]}),c.jsxs("div",{className:"flex flex-col gap-4",children:[e.at&&c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[c.jsx(GN,{size:14,strokeWidth:2.5}),c.jsx("span",{className:"font-[family-name:var(--font-mono)]",children:e.at})]}),((a=e.skills)==null?void 0:a.length)>0&&c.jsxs("div",{children:[c.jsx("div",{className:"text-sm font-bold mb-1.5",children:i("arrange.cardSkills")}),c.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:e.skills.map(l=>c.jsx(dx,{name:l},l))})]}),e.prompt&&c.jsxs("div",{children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:i("arrange.cardPrompt")}),c.jsx("pre",{className:"text-xs whitespace-pre-wrap font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4 max-h-72 overflow-auto",children:e.prompt})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:i("arrange.cardLog")}),c.jsxs("pre",{className:"text-xs whitespace-pre-wrap font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4",children:[e.at?`${e.at} [派发] #${e.seq} → ${i("arrange.cardTask")} T${e.taskId}`:"—",`
681
+ ${e.at??""} [状态] ${t}`]})]})]})]})})}const ZQ=j.memo(function({data:t}){const n=t;return c.jsxs("div",{className:"relative w-full h-full rounded-2xl border-2 border-dashed border-[var(--color-text)]",children:[c.jsx("div",{className:"absolute inset-0 rounded-2xl",style:{background:n.color,opacity:.16}}),c.jsx("span",{className:"absolute top-1.5 left-2.5 px-2 py-0.5 text-[11px] font-bold rounded-md border-2 border-[var(--color-text)] bg-[var(--color-bg)] text-[var(--color-text)] whitespace-nowrap max-w-[90%] truncate",children:n.label})]})}),JQ={card:WQ,laneBox:ZQ},nv=260,qA=nv+36,eW=200,tW={todo:"var(--color-text-subtle)",doing:"var(--color-secondary-dark)",done:"var(--color-cta)",rework:"var(--color-secondary-dark)"};function Eb(e,t,n){return e==="doing"&&t<n?"stuck":e}function nW(e,t){const n=Math.floor(e/t),i=e%t;return{x:(n%2===0?i:t-1-i)*qA,y:n*eW}}function iW(e,t,n){const i=Math.floor(e/n),a=Math.floor(t/n);return i===a?i%2===0?{sourceHandle:"r-s",targetHandle:"l-t"}:{sourceHandle:"l-s",targetHandle:"r-t"}:{sourceHandle:"b-s",targetHandle:"t-t"}}function rW(e){return e==="done"?{animated:!1,style:{stroke:"var(--color-cta)",strokeWidth:2.5}}:e==="doing"?{animated:!0,style:{stroke:"var(--color-secondary-dark)",strokeWidth:3}}:e==="stuck"?{animated:!1,style:{stroke:"var(--color-crashed)",strokeWidth:2.5,strokeDasharray:"6 4"}}:{animated:!1,style:{stroke:"var(--color-accent-yellow)",strokeWidth:2.5,strokeDasharray:"6 4"}}}const HA=158,QS=nv+60,WS=HA+28,XS=40;function aW({cards:e,taskMeta:t,view:n,onSelect:i}){const a=j.useRef(null),[l,o]=j.useState(4),d=xp(),[f,h,g]=xQ([]),[m,y]=vQ([]),b=j.useRef("");return j.useEffect(()=>{const k=a.current;if(!k)return;const v=new ResizeObserver(N=>{var C;const E=((C=N[0])==null?void 0:C.contentRect.width)??800;o(Math.max(1,Math.min(8,Math.floor((E-40)/qA))))});return v.observe(k),()=>v.disconnect()},[]),j.useEffect(()=>{const k=[...e].sort((T,R)=>T.seq-R.seq),v=`${n}:${l}:${k.length}`,N=b.current!==v;b.current=v;const E=new Map,C=(T,R)=>{var O;if(n==="lane"){const $=((O=t.get(T.taskId))==null?void 0:O.order)??0,I=E.get(T.taskId)??0;return E.set(T.taskId,I+1),{x:$*QS,y:I*WS}}return nW(R,l)},S=[];if(n==="lane"){const T=new Map;for(const R of k)T.set(R.taskId,(T.get(R.taskId)??0)+1);for(const[R,O]of T){const $=t.get(R),I=($==null?void 0:$.order)??0;S.push({id:`lane-${R}`,type:"laneBox",position:{x:I*QS-16,y:-XS},data:{label:$!=null&&$.title?`T${R} · ${$.title}`:`T${R}`,color:($==null?void 0:$.color)??"var(--color-bg-cream)"},style:{width:nv+32,height:XS+(O-1)*WS+HA+14},draggable:!1,selectable:!1,zIndex:0})}}const _=k.length?k[k.length-1].seq:0;h(T=>{const R=new Map(T.map($=>[$.id,$])),O=k.map(($,I)=>{const q=t.get($.taskId),F={seq:$.seq,title:$.title,skills:$.skills??[],taskLabel:`T${$.taskId}`,status:Eb($.status,$.seq,_),color:(q==null?void 0:q.color)??"var(--color-bg-cream)"},Y=String($.seq),D=R.get(Y),K=C($,I);return{...D&&!N?{...D,data:F}:{id:Y,type:"card",position:K,data:F},zIndex:1}});return[...S,...O]});const M=[];for(let T=1;T<k.length;T++){const R=k[T-1],O=k[T];if(!R||!O)continue;const $=n==="lane"?R.taskId===O.taskId?{sourceHandle:"b-s",targetHandle:"t-t"}:{sourceHandle:"r-s",targetHandle:"l-t"}:iW(T-1,T,l);M.push({id:`e${R.seq}-${O.seq}`,source:String(R.seq),target:String(O.seq),...$,...rW(Eb(O.status,O.seq,_))})}y(M),N&&requestAnimationFrame(()=>d.fitView({padding:.2,maxZoom:1.1,duration:300}))},[e,l,t,n,h,y,d]),c.jsx("div",{ref:a,className:"w-full h-full",children:c.jsxs(bQ,{nodes:f,edges:m,onNodesChange:g,nodeTypes:JQ,onNodeClick:(k,v)=>i(Number(v.id)),fitView:!0,fitViewOptions:{padding:.2,maxZoom:1.1},proOptions:{hideAttribution:!0},minZoom:.15,children:[c.jsx(NQ,{variant:pa.Dots,gap:20,size:1.5,color:"var(--color-border-light)"}),c.jsx(DQ,{showInteractive:!1})]})})}function sW(){var I,q,F;const e=Be(),t=Gt(),{alert:n}=un(),a=(((I=Ye({queryKey:["projects"],queryFn:Es,refetchInterval:3e3}).data)==null?void 0:I.data)??[]).filter(Y=>Y.pipelineMode==="smartArrange"),l=a.map(Y=>Y.name),[o,d]=j.useState(()=>localStorage.getItem("arrange.project")??""),f=o&&l.includes(o)?o:l[0]??"";j.useEffect(()=>{o&&localStorage.setItem("arrange.project",o)},[o]);const h=a.find(Y=>Y.name===f),g=(h==null?void 0:h.pipelineStatus)==="running",m=Ye({queryKey:["smartarrange",f],queryFn:()=>YQ(f),enabled:!!f,refetchInterval:3e3}),y=Ct({mutationFn:()=>QQ(f),onSuccess:()=>t.invalidateQueries({queryKey:["smartarrange",f]}),onError:Y=>void n({title:e("arrange.approveErr"),body:Y instanceof Error?Y.message:String(Y)})}),b=Ct({mutationFn:()=>y2(f),onSuccess:()=>t.invalidateQueries({queryKey:["projects"]}),onError:Y=>void n({title:e("arrange.startErr"),body:Y instanceof Error?Y.message:String(Y)})}),k=Ct({mutationFn:()=>b2(f),onSuccess:()=>t.invalidateQueries({queryKey:["projects"]}),onError:Y=>void n({title:e("arrange.startErr"),body:Y instanceof Error?Y.message:String(Y)})}),v=(q=m.data)==null?void 0:q.plan,N=j.useMemo(()=>{var Y;return((Y=m.data)==null?void 0:Y.cards)??[]},[(F=m.data)==null?void 0:F.cards]),[E,C]=j.useState(()=>localStorage.getItem("arrange.view")==="lane"?"lane":"free");j.useEffect(()=>{localStorage.setItem("arrange.view",E)},[E]);const S=j.useMemo(()=>{const Y=new Map;return((v==null?void 0:v.tasks)??[]).forEach((D,K)=>Y.set(D.id,{order:K,status:D.status,color:YS(D.id,K),title:D.title})),Y},[v==null?void 0:v.tasks]),[_,M]=j.useState(()=>localStorage.getItem("arrange.panel")!=="0");j.useEffect(()=>{localStorage.setItem("arrange.panel",_?"1":"0")},[_]);const[T,R]=j.useState(null),O=j.useMemo(()=>N.find(Y=>Y.seq===T),[N,T]),$=N.length?Math.max(...N.map(Y=>Y.seq)):0;return c.jsxs("div",{className:"flex flex-col gap-4 h-full min-h-0",children:[c.jsxs("header",{className:"flex items-center justify-between gap-3 flex-wrap shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-3xl font-bold",children:e("arrange.h1")}),f&&c.jsxs("div",{className:"flex items-center gap-2",children:[g?c.jsxs("button",{className:"nb-btn nb-btn-yellow",style:{padding:"6px 12px",fontSize:12},onClick:()=>k.mutate(),disabled:k.isPending,type:"button","aria-label":e("arrange.stop"),children:[k.isPending?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(Ub,{size:12,strokeWidth:3}),e("arrange.stop")]}):c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 12px",fontSize:12},onClick:()=>b.mutate(),disabled:b.isPending,type:"button","aria-label":e("arrange.start"),children:[b.isPending?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(Yu,{size:12,strokeWidth:3}),e("arrange.start")]}),v&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"nb-status",style:{background:"var(--color-bg-cream)",color:"var(--color-text)"},children:v.status}),c.jsxs("span",{className:"text-sm text-[var(--color-text-muted)]",children:["round ",v.round,"/",v.maxRounds]}),v.status==="awaiting-approval"&&c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 12px",fontSize:12},onClick:()=>y.mutate(),disabled:y.isPending,type:"button","aria-label":e("arrange.approve"),children:[y.isPending?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(fh,{size:12,strokeWidth:2.5}),e("arrange.approve")]})]})]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[v&&c.jsxs("button",{className:"nb-btn",style:{padding:"6px 10px",fontSize:12},onClick:()=>C(E==="free"?"lane":"free"),type:"button","aria-label":e("arrange.view"),children:[E==="lane"?c.jsx(t3,{size:14,strokeWidth:2.5}):c.jsx(YN,{size:14,strokeWidth:2.5}),e(E==="lane"?"arrange.viewLane":"arrange.viewFree")]}),c.jsxs("select",{className:"nb-input",style:{maxWidth:240},value:f,onChange:Y=>d(Y.target.value),"aria-label":e("arrange.project"),children:[l.length===0&&c.jsx("option",{value:"",children:"—"}),l.map(Y=>c.jsx("option",{value:Y,children:Y},Y))]})]})]}),v?c.jsxs("div",{className:"flex gap-4 flex-1 min-h-0",children:[c.jsxs("div",{className:"relative flex-1 min-h-0 rounded-2xl border-[3px] border-[var(--color-text)] overflow-hidden bg-[var(--color-bg-soft)]",style:{boxShadow:"4px 4px 0 var(--color-text)"},children:[N.length===0?c.jsx("div",{className:"absolute inset-0 grid place-items-center p-6",children:v.status==="running"?c.jsxs("div",{className:"flex flex-col items-center gap-3 text-[var(--color-text-muted)]",children:[c.jsx(Xe,{size:28,strokeWidth:3,className:"animate-spin"}),c.jsx("p",{className:"text-sm",children:e("arrange.orchestrating")})]}):c.jsx("p",{className:"text-[var(--color-text-muted)] text-sm text-center max-w-sm",children:e("arrange.noCards")})}):c.jsx(PA,{children:c.jsx(aW,{cards:N,taskMeta:S,view:E,onSelect:R})}),!_&&c.jsxs("button",{className:"nb-btn absolute right-3 top-3 z-10",style:{padding:"6px 10px",fontSize:12},onClick:()=>M(!0),type:"button","aria-label":e("arrange.expand"),children:[c.jsx(Zo,{size:14,strokeWidth:3,className:"rotate-180"}),e("arrange.tasks")]})]}),_&&c.jsxs("aside",{className:"w-72 shrink-0 nb-card overflow-hidden flex flex-col gap-2 min-h-0",style:{padding:12},children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold",children:e("arrange.tasks")}),c.jsx("button",{className:"nb-btn",style:{padding:"2px 6px"},onClick:()=>M(!1),type:"button","aria-label":e("arrange.collapse"),children:c.jsx(BL,{size:14,strokeWidth:2.5})})]}),c.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:v.tasks.length===0?c.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-10 text-[var(--color-text-muted)]",children:[c.jsx(Xe,{size:22,strokeWidth:3,className:"animate-spin"}),c.jsx("p",{className:"text-xs text-center",children:e("arrange.planning")})]}):c.jsx("ul",{className:"flex flex-col gap-2",children:v.tasks.map((Y,D)=>c.jsxs("li",{className:"rounded-lg border-2 border-[var(--color-text)] p-2",style:{background:YS(Y.id,D)},children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"w-2.5 h-2.5 rounded-full inline-block shrink-0 border border-[var(--color-text)]",style:{background:tW[Y.status]??"gray"}}),c.jsxs("span",{className:"font-bold text-xs text-[var(--color-text)]",children:["T",Y.id]}),c.jsxs("span",{className:"text-[11px] ml-auto font-[family-name:var(--font-mono)] text-[var(--color-text)]",children:[Y.cardSeqs.length," ",e("arrange.cardsCount")]})]}),c.jsx("p",{className:"text-xs text-[var(--color-text)] mt-1 leading-snug",children:Y.title})]},Y.id))})})]})]}):c.jsx("section",{className:"nb-card",children:g?c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(Xe,{size:18,strokeWidth:3,className:"animate-spin"}),c.jsx("p",{className:"text-sm font-bold",children:e("arrange.starting")})]}):c.jsx("p",{className:"text-[var(--color-text-muted)] text-sm",children:e("arrange.none")})}),O&&c.jsx(XQ,{card:O,status:Eb(O.status,O.seq,$),onClose:()=>R(null)})]})}function lW(){const e=Be();return c.jsxs("div",{className:"nb-card max-w-2xl mt-12",children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold mb-2",children:e("notFound.title")}),c.jsx("p",{className:"text-[var(--color-text-muted)] mb-6",children:e("notFound.body")}),c.jsx(vs,{to:"/",className:"nb-btn nb-btn-mint inline-flex",children:e("notFound.home")})]})}function oW(){return c.jsx(pI,{children:c.jsx(qO,{children:c.jsxs(Cn,{element:c.jsx(fI,{}),children:[c.jsx(Cn,{index:!0,element:c.jsx($O,{to:"/projects",replace:!0})}),c.jsx(Cn,{path:"/projects",element:c.jsx(Ck,{})}),c.jsx(Cn,{path:"/projects/new",element:c.jsx(g2,{})}),c.jsx(Cn,{path:"/projects/:name",element:c.jsx(Ck,{})}),c.jsx(Cn,{path:"/board",element:c.jsx(Q4,{})}),c.jsx(Cn,{path:"/workers",element:c.jsx(dP,{})}),c.jsx(Cn,{path:"/skills",element:c.jsx(A8,{})}),c.jsx(Cn,{path:"/prompts",element:c.jsx(L8,{})}),c.jsx(Cn,{path:"/system",element:c.jsx($8,{})}),c.jsx(Cn,{path:"/processes",element:c.jsx(hq,{})}),c.jsx(Cn,{path:"/audit",element:c.jsx(yq,{})}),c.jsx(Cn,{path:"/chat",element:c.jsx(OE,{})}),c.jsx(Cn,{path:"/chat/:sessionId",element:c.jsx(OE,{})}),c.jsx(Cn,{path:"/memory",element:c.jsx(vq,{})}),c.jsx(Cn,{path:"/plugins",element:c.jsx(Cq,{})}),c.jsx(Cn,{path:"/arrange",element:c.jsx(sW,{})}),c.jsx(Cn,{path:"*",element:c.jsx(lW,{})})]})})})}hI();I3();const cW=new TD({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1}}}),KA=document.getElementById("root");if(!KA)throw new Error("#root not found");aD.createRoot(KA).render(c.jsx(j.StrictMode,{children:c.jsx(O3,{children:c.jsx(MD,{client:cW,children:c.jsx(pR,{children:c.jsx(SI,{children:c.jsx(oW,{})})})})})}));