@coralai/sps-cli 0.58.39 → 0.58.41

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,686 @@
1
+ var sD=Object.defineProperty;var P1=e=>{throw TypeError(e)};var lD=(e,t,n)=>t in e?sD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var B1=(e,t,n)=>lD(e,typeof t!="symbol"?t+"":t,n),Sg=(e,t,n)=>t.has(e)||P1("Cannot "+n);var X=(e,t,n)=>(Sg(e,t,"read from private field"),n?n.call(e):t.get(e)),Ye=(e,t,n)=>t.has(e)?P1("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ie=(e,t,n,i)=>(Sg(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n),dt=(e,t,n)=>(Sg(e,t,"access private method"),n);var wf=(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 Hu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ng={exports:{}},Zc={};/**
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 $1;function oD(){if($1)return Zc;$1=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 Zc.Fragment=t,Zc.jsx=n,Zc.jsxs=n,Zc}var U1;function cD(){return U1||(U1=1,Ng.exports=oD()),Ng.exports}var c=cD(),_g={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 F1;function uD(){if(F1)return at;F1=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"),p=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,S={};function E(z,V,P){this.props=z,this.context=V,this.refs=S,this.updater=P||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 N(z,V,P){this.props=z,this.context=V,this.refs=S,this.updater=P||k}var _=N.prototype=new C;_.constructor=N,v(_,E.prototype),_.isPureReactComponent=!0;var T=Array.isArray;function M(){}var O={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function B(z,V,P){var le=P.ref;return{$$typeof:e,type:z,key:V,ref:le!==void 0?le:null,props:P}}function U(z,V){return B(z.type,V,z.props)}function K(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function q(z){var V={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(P){return V[P]})}var Y=/\/+/g;function D(z,V){return typeof z=="object"&&z!==null&&z.key!=null?q(""+z.key):V.toString(36)}function F(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(M,M):(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 I(z,V,P,le,xe){var ke=typeof z;(ke==="undefined"||ke==="boolean")&&(z=null);var Ne=!1;if(z===null)Ne=!0;else switch(ke){case"bigint":case"string":case"number":Ne=!0;break;case"object":switch(z.$$typeof){case e:case t:Ne=!0;break;case g:return Ne=z._init,I(Ne(z._payload),V,P,le,xe)}}if(Ne)return xe=xe(z),Ne=le===""?"."+D(z,0):le,T(xe)?(P="",Ne!=null&&(P=Ne.replace(Y,"$&/")+"/"),I(xe,V,P,"",function(ue){return ue})):xe!=null&&(K(xe)&&(xe=U(xe,P+(xe.key==null||z&&z.key===xe.key?"":(""+xe.key).replace(Y,"$&/")+"/")+Ne)),V.push(xe)),1;Ne=0;var se=le===""?".":le+":";if(T(z))for(var ve=0;ve<z.length;ve++)le=z[ve],ke=se+D(le,ve),Ne+=I(le,V,P,ke,xe);else if(ve=b(z),typeof ve=="function")for(z=ve.call(z),ve=0;!(le=z.next()).done;)le=le.value,ke=se+D(le,ve++),Ne+=I(le,V,P,ke,xe);else if(ke==="object"){if(typeof z.then=="function")return I(F(z),V,P,le,xe);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 Ne}function H(z,V,P){if(z==null)return z;var le=[],xe=0;return I(z,le,"","",function(ke){return V.call(P,ke,xe++)}),le}function W(z){if(z._status===-1){var V=z._result;V=V(),V.then(function(P){(z._status===0||z._status===-1)&&(z._status=1,z._result=P)},function(P){(z._status===0||z._status===-1)&&(z._status=2,z._result=P)}),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,P){H(z,function(){V.apply(this,arguments)},P)},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(!K(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=N,at.StrictMode=i,at.Suspense=f,at.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,at.__COMPILER_RUNTIME={__proto__:null,c:function(z){return O.H.useMemoCache(z)}},at.cache=function(z){return function(){return z.apply(null,arguments)}},at.cacheSignal=function(){return null},at.cloneElement=function(z,V,P){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var le=v({},z.props),xe=z.key;if(V!=null)for(ke in V.key!==void 0&&(xe=""+V.key),V)!R.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=P;else if(1<ke){for(var Ne=Array(ke),se=0;se<ke;se++)Ne[se]=arguments[se+2];le.children=Ne}return B(z.type,xe,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,P){var le,xe={},ke=null;if(V!=null)for(le in V.key!==void 0&&(ke=""+V.key),V)R.call(V,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(xe[le]=V[le]);var Ne=arguments.length-2;if(Ne===1)xe.children=P;else if(1<Ne){for(var se=Array(Ne),ve=0;ve<Ne;ve++)se[ve]=arguments[ve+2];xe.children=se}if(z&&z.defaultProps)for(le in Ne=z.defaultProps,Ne)xe[le]===void 0&&(xe[le]=Ne[le]);return B(z,ke,xe)},at.createRef=function(){return{current:null}},at.forwardRef=function(z){return{$$typeof:d,render:z}},at.isValidElement=K,at.lazy=function(z){return{$$typeof:g,_payload:{_status:-1,_result:z},_init:W}},at.memo=function(z,V){return{$$typeof:p,type:z,compare:V===void 0?null:V}},at.startTransition=function(z){var V=O.T,P={};O.T=P;try{var le=z(),xe=O.S;xe!==null&&xe(P,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(M,G)}catch(ke){G(ke)}finally{V!==null&&P.types!==null&&(V.types=P.types),O.T=V}},at.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},at.use=function(z){return O.H.use(z)},at.useActionState=function(z,V,P){return O.H.useActionState(z,V,P)},at.useCallback=function(z,V){return O.H.useCallback(z,V)},at.useContext=function(z){return O.H.useContext(z)},at.useDebugValue=function(){},at.useDeferredValue=function(z,V){return O.H.useDeferredValue(z,V)},at.useEffect=function(z,V){return O.H.useEffect(z,V)},at.useEffectEvent=function(z){return O.H.useEffectEvent(z)},at.useId=function(){return O.H.useId()},at.useImperativeHandle=function(z,V,P){return O.H.useImperativeHandle(z,V,P)},at.useInsertionEffect=function(z,V){return O.H.useInsertionEffect(z,V)},at.useLayoutEffect=function(z,V){return O.H.useLayoutEffect(z,V)},at.useMemo=function(z,V){return O.H.useMemo(z,V)},at.useOptimistic=function(z,V){return O.H.useOptimistic(z,V)},at.useReducer=function(z,V,P){return O.H.useReducer(z,V,P)},at.useRef=function(z){return O.H.useRef(z)},at.useState=function(z){return O.H.useState(z)},at.useSyncExternalStore=function(z,V,P){return O.H.useSyncExternalStore(z,V,P)},at.useTransition=function(){return O.H.useTransition()},at.version="19.2.5",at}var q1;function Ku(){return q1||(q1=1,_g.exports=uD()),_g.exports}var j=Ku();const dD=Hu(j);var jg={exports:{}},Jc={},Cg={exports:{}},Ag={};/**
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 H1;function fD(){return H1||(H1=1,(function(e){function t(I,H){var W=I.length;I.push(H);e:for(;0<W;){var G=W-1>>>1,L=I[G];if(0<a(L,H))I[G]=H,I[W]=L,W=G;else break e}}function n(I){return I.length===0?null:I[0]}function i(I){if(I.length===0)return null;var H=I[0],W=I.pop();if(W!==H){I[0]=W;e:for(var G=0,L=I.length,z=L>>>1;G<z;){var V=2*(G+1)-1,P=I[V],le=V+1,xe=I[le];if(0>a(P,W))le<L&&0>a(xe,P)?(I[G]=xe,I[le]=W,G=le):(I[G]=P,I[V]=W,G=V);else if(le<L&&0>a(xe,W))I[G]=xe,I[le]=W,G=le;else break e}}return H}function a(I,H){var W=I.sortIndex-H.sortIndex;return W!==0?W:I.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=[],p=[],g=1,m=null,y=3,b=!1,k=!1,v=!1,S=!1,E=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function _(I){for(var H=n(p);H!==null;){if(H.callback===null)i(p);else if(H.startTime<=I)i(p),H.sortIndex=H.expirationTime,t(f,H);else break;H=n(p)}}function T(I){if(v=!1,_(I),!k)if(n(f)!==null)k=!0,M||(M=!0,q());else{var H=n(p);H!==null&&F(T,H.startTime-I)}}var M=!1,O=-1,R=5,B=-1;function U(){return S?!0:!(e.unstable_now()-B<R)}function K(){if(S=!1,M){var I=e.unstable_now();B=I;var H=!0;try{e:{k=!1,v&&(v=!1,C(O),O=-1),b=!0;var W=y;try{t:{for(_(I),m=n(f);m!==null&&!(m.expirationTime>I&&U());){var G=m.callback;if(typeof G=="function"){m.callback=null,y=m.priorityLevel;var L=G(m.expirationTime<=I);if(I=e.unstable_now(),typeof L=="function"){m.callback=L,_(I),H=!0;break t}m===n(f)&&i(f),_(I)}else i(f);m=n(f)}if(m!==null)H=!0;else{var z=n(p);z!==null&&F(T,z.startTime-I),H=!1}}break e}finally{m=null,y=W,b=!1}H=void 0}}finally{H?q():M=!1}}}var q;if(typeof N=="function")q=function(){N(K)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,D=Y.port2;Y.port1.onmessage=K,q=function(){D.postMessage(null)}}else q=function(){E(K,0)};function F(I,H){O=E(function(){I(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(I){I.callback=null},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(I){switch(y){case 1:case 2:case 3:var H=3;break;default:H=y}var W=y;y=H;try{return I()}finally{y=W}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(I,H){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var W=y;y=I;try{return H()}finally{y=W}},e.unstable_scheduleCallback=function(I,H,W){var G=e.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?G+W:G):W=G,I){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=W+L,I={id:g++,callback:H,priorityLevel:I,startTime:W,expirationTime:L,sortIndex:-1},W>G?(I.sortIndex=W,t(p,I),n(f)===null&&I===n(p)&&(v?(C(O),O=-1):v=!0,F(T,W-G))):(I.sortIndex=L,t(f,I),k||b||(k=!0,M||(M=!0,q()))),I},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(I){var H=y;return function(){var W=y;y=H;try{return I.apply(this,arguments)}finally{y=W}}}})(Ag)),Ag}var K1;function pD(){return K1||(K1=1,Cg.exports=fD()),Cg.exports}var Tg={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 G1;function hD(){if(G1)return Hn;G1=1;var e=Ku();function t(f){var p="https://react.dev/errors/"+f;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)p+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+f+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(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,p,g){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:m==null?null:""+m,children:f,containerInfo:p,implementation:g}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(f,p){if(f==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Hn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Hn.createPortal=function(f,p){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return l(f,p,null,g)},Hn.flushSync=function(f){var p=o.T,g=i.p;try{if(o.T=null,i.p=2,f)return f()}finally{o.T=p,i.p=g,i.d.f()}},Hn.preconnect=function(f,p){typeof f=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,i.d.C(f,p))},Hn.prefetchDNS=function(f){typeof f=="string"&&i.d.D(f)},Hn.preinit=function(f,p){if(typeof f=="string"&&p&&typeof p.as=="string"){var g=p.as,m=d(g,p.crossOrigin),y=typeof p.integrity=="string"?p.integrity:void 0,b=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;g==="style"?i.d.S(f,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:m,integrity:y,fetchPriority:b}):g==="script"&&i.d.X(f,{crossOrigin:m,integrity:y,fetchPriority:b,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Hn.preinitModule=function(f,p){if(typeof f=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var g=d(p.as,p.crossOrigin);i.d.M(f,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&i.d.M(f)},Hn.preload=function(f,p){if(typeof f=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var g=p.as,m=d(g,p.crossOrigin);i.d.L(f,g,{crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Hn.preloadModule=function(f,p){if(typeof f=="string")if(p){var g=d(p.as,p.crossOrigin);i.d.m(f,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else i.d.m(f)},Hn.requestFormReset=function(f){i.d.r(f)},Hn.unstable_batchedUpdates=function(f,p){return f(p)},Hn.useFormState=function(f,p,g){return o.H.useFormState(f,p,g)},Hn.useFormStatus=function(){return o.H.useHostTransitionStatus()},Hn.version="19.2.5",Hn}var V1;function bN(){if(V1)return Tg.exports;V1=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(),Tg.exports=hD(),Tg.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 Y1;function mD(){if(Y1)return Jc;Y1=1;var e=pD(),t=Ku(),n=bN();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 p(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,h=s;;){var x=u.return;if(x===null)break;var w=x.alternate;if(w===null){if(h=x.return,h!==null){u=h;continue}break}if(x.child===w.child){for(w=x.child;w;){if(w===u)return f(x),r;if(w===h)return f(x),s;w=w.sibling}throw Error(i(188))}if(u.return!==h.return)u=x,h=w;else{for(var A=!1,$=x.child;$;){if($===u){A=!0,u=x,h=w;break}if($===h){A=!0,h=x,u=w;break}$=$.sibling}if(!A){for($=w.child;$;){if($===u){A=!0,u=w,h=x;break}if($===h){A=!0,h=w,u=x;break}$=$.sibling}if(!A)throw Error(i(189))}}if(u.alternate!==h)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"),S=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),N=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function q(r){return r===null||typeof r!="object"?null:(r=K&&r[K]||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 S:return"StrictMode";case T:return"Suspense";case M:return"SuspenseList";case B:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case k:return"Portal";case N: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 O:return s=r.displayName||null,s!==null?s:D(r.type)||"Memo";case R:s=r._payload,r=r._init;try{return D(r(s))}catch{}}return null}var F=Array.isArray,I=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,W={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 P(r,s){L++,G[L]=r.current,r.current=s}var le=z(null),xe=z(null),ke=z(null),Ne=z(null);function se(r,s){switch(P(ke,s),P(xe,r),P(le,null),s.nodeType){case 9:case 11:r=(r=s.documentElement)&&(r=r.namespaceURI)?l1(r):0;break;default:if(r=s.tagName,s=s.namespaceURI)s=l1(s),r=o1(s,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}V(le),P(le,r)}function ve(){V(le),V(xe),V(ke)}function ue(r){r.memoizedState!==null&&P(Ne,r);var s=le.current,u=o1(s,r.type);s!==u&&(P(xe,r),P(le,u))}function J(r){xe.current===r&&(V(le),V(xe)),Ne.current===r&&(V(Ne),Yc._currentValue=W)}var we,re;function Ce(r){if(we===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);we=s&&s[1]||"",re=-1<u.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+we+r+re}var Me=!1;function _e(r,s){if(!r||Me)return"";Me=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(s){var Ee=function(){throw Error()};if(Object.defineProperty(Ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ee,[])}catch(fe){var oe=fe}Reflect.construct(r,[],Ee)}else{try{Ee.call()}catch(fe){oe=fe}r.call(Ee.prototype)}}else{try{throw Error()}catch(fe){oe=fe}(Ee=r())&&typeof Ee.catch=="function"&&Ee.catch(function(){})}}catch(fe){if(fe&&oe&&typeof fe.stack=="string")return[fe.stack,oe.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var x=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");x&&x.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=h.DetermineComponentFrameRoot(),A=w[0],$=w[1];if(A&&$){var Q=A.split(`
44
+ `),ae=$.split(`
45
+ `);for(x=h=0;h<Q.length&&!Q[h].includes("DetermineComponentFrameRoot");)h++;for(;x<ae.length&&!ae[x].includes("DetermineComponentFrameRoot");)x++;if(h===Q.length||x===ae.length)for(h=Q.length-1,x=ae.length-1;1<=h&&0<=x&&Q[h]!==ae[x];)x--;for(;1<=h&&0<=x;h--,x--)if(Q[h]!==ae[x]){if(h!==1||x!==1)do if(h--,x--,0>x||Q[h]!==ae[x]){var he=`
46
+ `+Q[h].replace(" at new "," at ");return r.displayName&&he.includes("<anonymous>")&&(he=he.replace("<anonymous>",r.displayName)),he}while(1<=h&&0<=x);break}}}finally{Me=!1,Error.prepareStackTrace=u}return(u=r?r.displayName||r.name:"")?Ce(u):""}function Qe(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 _e(r.type,!1);case 11:return _e(r.type.render,!1);case 1:return _e(r.type,!0);case 31:return Ce("Activity");default:return""}}function Ue(r){try{var s="",u=null;do s+=Qe(r,u),u=r,r=r.return;while(r);return s}catch(h){return`
47
+ Error generating stack: `+h.message+`
48
+ `+h.stack}}var ce=Object.prototype.hasOwnProperty,be=e.unstable_scheduleCallback,ge=e.unstable_cancelCallback,pe=e.unstable_shouldYield,Se=e.unstable_requestPaint,je=e.unstable_now,He=e.unstable_getCurrentPriorityLevel,te=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 Wt(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 h=r.pendingLanes;if(h===0)return 0;var x=0,w=r.suspendedLanes,A=r.pingedLanes;r=r.warmLanes;var $=h&134217727;return $!==0?(h=$&~w,h!==0?x=Un(h):(A&=$,A!==0?x=Un(A):u||(u=$&~r,u!==0&&(x=Un(u))))):($=h&~w,$!==0?x=Un($):A!==0?x=Un(A):u||(u=h&~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 me(r,s){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&s)===0}function Oe(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 qt(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 $e(r,s,u,h,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 $=r.entanglements,Q=r.expirationTimes,ae=r.hiddenUpdates;for(u=A&~u;0<u;){var he=31-yt(u),Ee=1<<he;$[he]=0,Q[he]=-1;var oe=ae[he];if(oe!==null)for(ae[he]=null,he=0;he<oe.length;he++){var fe=oe[he];fe!==null&&(fe.lane&=-536870913)}u&=~Ee}h!==0&&ze(r,h,0),w!==0&&x===0&&r.tag!==0&&(r.suspendedLanes|=w&~(A&~s))}function ze(r,s,u){r.pendingLanes|=s,r.suspendedLanes&=~s;var h=31-yt(s);r.entangledLanes|=s,r.entanglements[h]=r.entanglements[h]|1073741824|u&261930}function et(r,s){var u=r.entangledLanes|=s;for(r=r.entanglements;u;){var h=31-yt(u),x=1<<h;x&s|r[h]&s&&(r[h]|=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:M1(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,Xi="__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[Xi]||u[an]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(r=m1(r);r!==null;){if(u=r[an])return u;r=m1(r)}return s}r=u,u=r.parentNode}return null}function Zi(r){if(r=r[an]||r[Xi]){var s=r.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return r}return null}function Ji(r){var s=r.tag;if(s===5||s===26||s===27||s===6)return r.stateNode;throw Error(i(33))}function xr(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 er(r,s){Ae(r,s),Ae(r+"Capture",s)}function Ae(r,s){for(Ur[r]=s,r=0;r<s.length;r++)jl.add(s[r])}var Ge=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]*$"),pt={},_t={};function sn(r){return ce.call(_t,r)?!0:ce.call(pt,r)?!1:Ge.test(r)?_t[r]=!0:(pt[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 h=s.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){r.removeAttribute(s);return}}r.setAttribute(s,""+u)}}function Wn(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,h){if(h===null)r.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(u);return}r.setAttributeNS(s,u,""+h)}}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 Qn(r){var s=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Cl(r,s,u){var h=Object.getOwnPropertyDescriptor(r.constructor.prototype,s);if(!r.hasOwnProperty(s)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var x=h.get,w=h.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:h.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=Qn(r)?"checked":"value";r._valueTracker=Cl(r,s,""+r[s])}}function vr(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var u=s.getValue(),h="";return r&&(h=Qn(r)?r.checked?"true":"false":r.value),r=h,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,h,x,w,A,$){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)):h!=null&&r.removeAttribute("value"),x==null&&w!=null&&(r.defaultChecked=!!w),x!=null&&(r.checked=x&&typeof x!="function"&&typeof x!="symbol"),$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?r.name=""+zt($):r.removeAttribute("name")}function tr(r,s,u,h,x,w,A,$){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,$||s===r.value||(r.value=s),r.defaultValue=s}h=h??x,h=typeof h!="function"&&typeof h!="symbol"&&!!h,r.checked=$?r.checked:!!h,r.defaultChecked=!!h,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 jn(r,s,u,h){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&&h&&(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,h&&(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,h){if(s==null){if(h!=null){if(u!=null)throw Error(i(92));if(F(h)){if(1<h.length)throw Error(i(93));h=h[0]}u=h}u==null&&(u=""),s=u}u=zt(s),r.defaultValue=u,h=r.textContent,h===u&&h!==""&&h!==null&&(r.value=h),_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 ud=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 h=s.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?h?r.setProperty(s,""):s==="float"?r.cssFloat="":r[s]="":h?r.setProperty(s,u):typeof u!="number"||u===0||ud.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 h in u)!u.hasOwnProperty(h)||s!=null&&s.hasOwnProperty(h)||(h.indexOf("--")===0?r.setProperty(h,""):h==="float"?r.cssFloat="":r[h]="");for(var x in s)h=s[x],s.hasOwnProperty(x)&&u[x]!==h&&xn(r,x,h)}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"]]),cc=/^[\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 cc.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function De(){}var Fe=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=Zi(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 h=u[s];if(h!==r&&h.form===r.form){var x=h[Tn]||null;if(!x)throw Error(i(90));Cs(h,x.value,x.defaultValue,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name)}}for(s=0;s<u.length;s++)h=u[s],h.form===r.form&&vr(h)}break e;case"textarea":As(r,u.value,u.defaultValue);break e;case"select":s=u.value,s!=null&&jn(r,!!u.multiple,s,!1)}}}var uc=!1;function dd(r,s,u){if(uc)return r(s,u);uc=!0;try{var h=r(s);return h}finally{if(uc=!1,(bt!==null||ln!==null)&&(Zd(),bt&&(s=bt,r=ln,ln=bt=null,Di(s),r)))for(s=0;s<r.length;s++)Di(r[s])}}function dc(r,s){var u=r.stateNode;if(u===null)return null;var h=u[Tn]||null;if(h===null)return null;u=h[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":(h=!h.disabled)||(r=r.type,h=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!h;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"),Sh=!1;if(qr)try{var fc={};Object.defineProperty(fc,"passive",{get:function(){Sh=!0}}),window.addEventListener("test",fc,fc),window.removeEventListener("test",fc,fc)}catch{Sh=!1}var Ma=null,Nh=null,fd=null;function ov(){if(fd)return fd;var r,s=Nh,u=s.length,h,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(h=1;h<=A&&s[u-h]===x[w-h];h++);return fd=x.slice(r,1<h?1-h:void 0)}function pd(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 hd(){return!0}function cv(){return!1}function ii(r){function s(u,h,x,w,A){this._reactName=u,this._targetInst=x,this.type=h,this.nativeEvent=w,this.target=A,this.currentTarget=null;for(var $ in r)r.hasOwnProperty($)&&(u=r[$],this[$]=u?u(w):w[$]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?hd:cv,this.isPropagationStopped=cv,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=hd)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=hd)},persist:function(){},isPersistent:hd}),s}var Ts={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},md=ii(Ts),pc=m({},Ts,{view:0,detail:0}),rT=ii(pc),_h,jh,hc,gd=m({},pc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ah,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"?(_h=r.screenX-hc.screenX,jh=r.screenY-hc.screenY):jh=_h=0,hc=r),_h)},movementY:function(r){return"movementY"in r?r.movementY:jh}}),uv=ii(gd),aT=m({},gd,{dataTransfer:0}),sT=ii(aT),lT=m({},pc,{relatedTarget:0}),Ch=ii(lT),oT=m({},Ts,{animationName:0,elapsedTime:0,pseudoElement:0}),cT=ii(oT),uT=m({},Ts,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),dT=ii(uT),fT=m({},Ts,{data:0}),dv=ii(fT),pT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},hT={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"},mT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gT(r){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(r):(r=mT[r])?!!s[r]:!1}function Ah(){return gT}var yT=m({},pc,{key:function(r){if(r.key){var s=pT[r.key]||r.key;if(s!=="Unidentified")return s}return r.type==="keypress"?(r=pd(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?hT[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ah,charCode:function(r){return r.type==="keypress"?pd(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?pd(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),bT=ii(yT),xT=m({},gd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fv=ii(xT),vT=m({},pc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ah}),wT=ii(vT),kT=m({},Ts,{propertyName:0,elapsedTime:0,pseudoElement:0}),ET=ii(kT),ST=m({},gd,{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}),NT=ii(ST),_T=m({},Ts,{newState:0,oldState:0}),jT=ii(_T),CT=[9,13,27,32],Th=qr&&"CompositionEvent"in window,mc=null;qr&&"documentMode"in document&&(mc=document.documentMode);var AT=qr&&"TextEvent"in window&&!mc,pv=qr&&(!Th||mc&&8<mc&&11>=mc),hv=" ",mv=!1;function gv(r,s){switch(r){case"keyup":return CT.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yv(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ml=!1;function TT(r,s){switch(r){case"compositionend":return yv(s);case"keypress":return s.which!==32?null:(mv=!0,hv);case"textInput":return r=s.data,r===hv&&mv?null:r;default:return null}}function MT(r,s){if(Ml)return r==="compositionend"||!Th&&gv(r,s)?(r=ov(),fd=Nh=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 pv&&s.locale!=="ko"?null:s.data;default:return null}}var DT={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 bv(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s==="input"?!!DT[r.type]:s==="textarea"}function xv(r,s,u,h){bt?ln?ln.push(h):ln=[h]:bt=h,s=sf(s,"onChange"),0<s.length&&(u=new md("onChange","change",null,u,h),r.push({event:u,listeners:s}))}var gc=null,yc=null;function OT(r){t1(r,0)}function yd(r){var s=Ji(r);if(vr(s))return r}function vv(r,s){if(r==="change")return s}var wv=!1;if(qr){var Mh;if(qr){var Dh="oninput"in document;if(!Dh){var kv=document.createElement("div");kv.setAttribute("oninput","return;"),Dh=typeof kv.oninput=="function"}Mh=Dh}else Mh=!1;wv=Mh&&(!document.documentMode||9<document.documentMode)}function Ev(){gc&&(gc.detachEvent("onpropertychange",Sv),yc=gc=null)}function Sv(r){if(r.propertyName==="value"&&yd(yc)){var s=[];xv(s,yc,r,lt(r)),dd(OT,s)}}function RT(r,s,u){r==="focusin"?(Ev(),gc=s,yc=u,gc.attachEvent("onpropertychange",Sv)):r==="focusout"&&Ev()}function LT(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return yd(yc)}function IT(r,s){if(r==="click")return yd(s)}function zT(r,s){if(r==="input"||r==="change")return yd(s)}function PT(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var gi=typeof Object.is=="function"?Object.is:PT;function bc(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),h=Object.keys(s);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var x=u[h];if(!ce.call(s,x)||!gi(r[x],s[x]))return!1}return!0}function Nv(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function _v(r,s){var u=Nv(r);r=0;for(var h;u;){if(u.nodeType===3){if(h=r+u.textContent.length,r<=s&&h>=s)return{node:u,offset:s-r};r=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Nv(u)}}function jv(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?jv(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function Cv(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 Oh(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 BT=qr&&"documentMode"in document&&11>=document.documentMode,Dl=null,Rh=null,xc=null,Lh=!1;function Av(r,s,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Lh||Dl==null||Dl!==ja(h)||(h=Dl,"selectionStart"in h&&Oh(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),xc&&bc(xc,h)||(xc=h,h=sf(Rh,"onSelect"),0<h.length&&(s=new md("onSelect","select",null,s,u),r.push({event:s,listeners:h}),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")},Ih={},Tv={};qr&&(Tv=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(Ih[r])return Ih[r];if(!Ol[r])return r;var s=Ol[r],u;for(u in s)if(s.hasOwnProperty(u)&&u in Tv)return Ih[r]=s[u];return r}var Mv=Ds("animationend"),Dv=Ds("animationiteration"),Ov=Ds("animationstart"),$T=Ds("transitionrun"),UT=Ds("transitionstart"),FT=Ds("transitioncancel"),Rv=Ds("transitionend"),Lv=new Map,zh="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(" ");zh.push("scrollEnd");function nr(r,s){Lv.set(r,s),er(s,[r])}var bd=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,Ph=0;function xd(){for(var r=Rl,s=Ph=Rl=0;s<r;){var u=Oi[s];Oi[s++]=null;var h=Oi[s];Oi[s++]=null;var x=Oi[s];Oi[s++]=null;var w=Oi[s];if(Oi[s++]=null,h!==null&&x!==null){var A=h.pending;A===null?x.next=x:(x.next=A.next,A.next=x),h.pending=x}w!==0&&Iv(u,x,w)}}function vd(r,s,u,h){Oi[Rl++]=r,Oi[Rl++]=s,Oi[Rl++]=u,Oi[Rl++]=h,Ph|=h,r.lanes|=h,r=r.alternate,r!==null&&(r.lanes|=h)}function Bh(r,s,u,h){return vd(r,s,u,h),wd(r)}function Os(r,s){return vd(r,null,null,s),wd(r)}function Iv(r,s,u){r.lanes|=u;var h=r.alternate;h!==null&&(h.lanes|=u);for(var x=!1,w=r.return;w!==null;)w.childLanes|=u,h=w.alternate,h!==null&&(h.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,h=r[x],h===null?r[x]=[s]:h.push(s),s.lane=u|536870912),w):null}function wd(r){if(50<Uc)throw Uc=0,Ym=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 qT(r,s,u,h){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=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yi(r,s,u,h){return new qT(r,s,u,h)}function $h(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 zv(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 kd(r,s,u,h,x,w){var A=0;if(h=r,typeof r=="function")$h(r)&&(A=1);else if(typeof r=="string")A=YM(r,u,le.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case B:return r=yi(31,u,s,x),r.elementType=B,r.lanes=w,r;case v:return Rs(u.children,x,w,s);case S:A=8,x|=24;break;case E:return r=yi(12,u,s,x|2),r.elementType=E,r.lanes=w,r;case T:return r=yi(13,u,s,x),r.elementType=T,r.lanes=w,r;case M:return r=yi(19,u,s,x),r.elementType=M,r.lanes=w,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case N:A=10;break e;case C:A=9;break e;case _:A=11;break e;case O:A=14;break e;case R:A=16,h=null;break e}A=29,u=Error(i(130,r===null?"null":typeof r,"")),h=null}return s=yi(A,u,s,x),s.elementType=r,s.type=h,s.lanes=w,s}function Rs(r,s,u,h){return r=yi(7,r,h,s),r.lanes=u,r}function Uh(r,s,u){return r=yi(6,r,null,s),r.lanes=u,r}function Pv(r){var s=yi(18,null,null,0);return s.stateNode=r,s}function Fh(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 Bv=new WeakMap;function Ri(r,s){if(typeof r=="object"&&r!==null){var u=Bv.get(r);return u!==void 0?u:(s={value:r,source:s,stack:Ue(s)},Bv.set(r,s),s)}return{value:r,source:s,stack:Ue(s)}}var Il=[],zl=0,Ed=null,vc=0,Li=[],Ii=0,Da=null,wr=1,kr="";function Kr(r,s){Il[zl++]=vc,Il[zl++]=Ed,Ed=r,vc=s}function $v(r,s,u){Li[Ii++]=wr,Li[Ii++]=kr,Li[Ii++]=Da,Da=r;var h=wr;r=kr;var x=32-yt(h)-1;h&=~(1<<x),u+=1;var w=32-yt(s)+x;if(30<w){var A=x-x%5;w=(h&(1<<A)-1).toString(32),h>>=A,x-=A,wr=1<<32-yt(s)+x|u<<x|h,kr=w+r}else wr=1<<w|u<<x|h,kr=r}function qh(r){r.return!==null&&(Kr(r,1),$v(r,1,0))}function Hh(r){for(;r===Ed;)Ed=Il[--zl],Il[zl]=null,vc=Il[--zl],Il[zl]=null;for(;r===Da;)Da=Li[--Ii],Li[Ii]=null,kr=Li[--Ii],Li[Ii]=null,wr=Li[--Ii],Li[Ii]=null}function Uv(r,s){Li[Ii++]=wr,Li[Ii++]=kr,Li[Ii++]=Da,wr=s.id,kr=s.overflow,Da=r}var In=null,Qt=null,wt=!1,Oa=null,zi=!1,Kh=Error(i(519));function Ra(r){var s=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw wc(Ri(s,r)),Kh}function Fv(r){var s=r.stateNode,u=r.type,h=r.memoizedProps;switch(s[an]=r,s[Tn]=h,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<qc.length;u++)mt(qc[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),tr(s,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":mt("invalid",s);break;case"textarea":mt("invalid",s),Tl(s,h.value,h.defaultValue,h.children)}u=h.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||s.textContent===""+u||h.suppressHydrationWarning===!0||a1(s.textContent,u)?(h.popover!=null&&(mt("beforetoggle",s),mt("toggle",s)),h.onScroll!=null&&mt("scroll",s),h.onScrollEnd!=null&&mt("scrollend",s),h.onClick!=null&&(s.onclick=De),s=!0):s=!1,s||Ra(r,!0)}function qv(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 qv(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")||cg(r.type,r.memoizedProps)),u=!u),u&&Qt&&Ra(r),qv(r),s===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));Qt=h1(r)}else if(s===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));Qt=h1(r)}else s===27?(s=Qt,Ya(r.type)?(r=hg,hg=null,Qt=r):Qt=s):Qt=In?Bi(r.stateNode.nextSibling):null;return!0}function Ls(){Qt=In=null,wt=!1}function Gh(){var r=Oa;return r!==null&&(li===null?li=r:li.push.apply(li,r),Oa=null),r}function wc(r){Oa===null?Oa=[r]:Oa.push(r)}var Vh=z(null),Is=null,Gr=null;function La(r,s,u){P(Vh,s._currentValue),s._currentValue=u}function Vr(r){r._currentValue=Vh.current,V(Vh)}function Yh(r,s,u){for(;r!==null;){var h=r.alternate;if((r.childLanes&s)!==s?(r.childLanes|=s,h!==null&&(h.childLanes|=s)):h!==null&&(h.childLanes&s)!==s&&(h.childLanes|=s),r===u)break;r=r.return}}function Wh(r,s,u,h){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 $=w;w=x;for(var Q=0;Q<s.length;Q++)if($.context===s[Q]){w.lanes|=u,$=w.alternate,$!==null&&($.lanes|=u),Yh(w.return,u,r),h||(A=null);break e}w=$.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),Yh(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,h){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 $=x.type;gi(x.pendingProps.value,A.value)||(r!==null?r.push($):r=[$])}}else if(x===Ne.current){if(A=x.alternate,A===null)throw Error(i(387));A.memoizedState.memoizedState!==x.memoizedState.memoizedState&&(r!==null?r.push(Yc):r=[Yc])}x=x.return}r!==null&&Wh(s,r,u,h),s.flags|=262144}function Sd(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 Hv(Is,r)}function Nd(r,s){return Is===null&&zs(r),Hv(r,s)}function Hv(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 HT=typeof AbortController<"u"?AbortController:function(){var r=[],s=this.signal={aborted:!1,addEventListener:function(u,h){r.push(h)}};this.abort=function(){s.aborted=!0,r.forEach(function(u){return u()})}},KT=e.unstable_scheduleCallback,GT=e.unstable_NormalPriority,vn={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Qh(){return{controller:new HT,data:new Map,refCount:0}}function kc(r){r.refCount--,r.refCount===0&&KT(GT,function(){r.controller.abort()})}var Ec=null,Xh=0,$l=0,Ul=null;function VT(r,s){if(Ec===null){var u=Ec=[];Xh=0,$l=eg(),Ul={status:"pending",value:void 0,then:function(h){u.push(h)}}}return Xh++,s.then(Kv,Kv),s}function Kv(){if(--Xh===0&&Ec!==null){Ul!==null&&(Ul.status="fulfilled");var r=Ec;Ec=null,$l=0,Ul=null;for(var s=0;s<r.length;s++)(0,r[s])()}}function YT(r,s){var u=[],h={status:"pending",value:null,reason:null,then:function(x){u.push(x)}};return r.then(function(){h.status="fulfilled",h.value=s;for(var x=0;x<u.length;x++)(0,u[x])(s)},function(x){for(h.status="rejected",h.reason=x,x=0;x<u.length;x++)(0,u[x])(void 0)}),h}var Gv=I.S;I.S=function(r,s){Aw=je(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&VT(r,s),Gv!==null&&Gv(r,s)};var Ps=z(null);function Zh(){var r=Ps.current;return r!==null?r:Ht.pooledCache}function _d(r,s){s===null?P(Ps,Ps.current):P(Ps,s.pool)}function Vv(){var r=Zh();return r===null?null:{parent:vn._currentValue,pool:r}}var Fl=Error(i(460)),Jh=Error(i(474)),jd=Error(i(542)),Cd={then:function(){}};function Yv(r){return r=r.status,r==="fulfilled"||r==="rejected"}function Wv(r,s,u){switch(u=r[u],u===void 0?r.push(s):u!==s&&(s.then(De,De),s=u),s.status){case"fulfilled":return s.value;case"rejected":throw r=s.reason,Xv(r),r;default:if(typeof s.status=="string")s.then(De,De);else{if(r=Ht,r!==null&&100<r.shellSuspendCounter)throw Error(i(482));r=s,r.status="pending",r.then(function(h){if(s.status==="pending"){var x=s;x.status="fulfilled",x.value=h}},function(h){if(s.status==="pending"){var x=s;x.status="rejected",x.reason=h}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw r=s.reason,Xv(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 Qv(){if($s===null)throw Error(i(459));var r=$s;return $s=null,r}function Xv(r){if(r===Fl||r===jd)throw Error(i(483))}var ql=null,Sc=0;function Ad(r){var s=Sc;return Sc+=1,ql===null&&(ql=[]),Wv(ql,r,s)}function Nc(r,s){s=s.props.ref,r.ref=s!==void 0?s:null}function Td(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 Zv(r){function s(ne,ee){if(r){var ie=ne.deletions;ie===null?(ne.deletions=[ee],ne.flags|=16):ie.push(ee)}}function u(ne,ee){if(!r)return null;for(;ee!==null;)s(ne,ee),ee=ee.sibling;return null}function h(ne){for(var ee=new Map;ne!==null;)ne.key!==null?ee.set(ne.key,ne):ee.set(ne.index,ne),ne=ne.sibling;return ee}function x(ne,ee){return ne=Hr(ne,ee),ne.index=0,ne.sibling=null,ne}function w(ne,ee,ie){return ne.index=ie,r?(ie=ne.alternate,ie!==null?(ie=ie.index,ie<ee?(ne.flags|=67108866,ee):ie):(ne.flags|=67108866,ee)):(ne.flags|=1048576,ee)}function A(ne){return r&&ne.alternate===null&&(ne.flags|=67108866),ne}function $(ne,ee,ie,ye){return ee===null||ee.tag!==6?(ee=Uh(ie,ne.mode,ye),ee.return=ne,ee):(ee=x(ee,ie),ee.return=ne,ee)}function Q(ne,ee,ie,ye){var We=ie.type;return We===v?he(ne,ee,ie.props.children,ye,ie.key):ee!==null&&(ee.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===R&&Bs(We)===ee.type)?(ee=x(ee,ie.props),Nc(ee,ie),ee.return=ne,ee):(ee=kd(ie.type,ie.key,ie.props,null,ne.mode,ye),Nc(ee,ie),ee.return=ne,ee)}function ae(ne,ee,ie,ye){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==ie.containerInfo||ee.stateNode.implementation!==ie.implementation?(ee=Fh(ie,ne.mode,ye),ee.return=ne,ee):(ee=x(ee,ie.children||[]),ee.return=ne,ee)}function he(ne,ee,ie,ye,We){return ee===null||ee.tag!==7?(ee=Rs(ie,ne.mode,ye,We),ee.return=ne,ee):(ee=x(ee,ie),ee.return=ne,ee)}function Ee(ne,ee,ie){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ee=Uh(""+ee,ne.mode,ie),ee.return=ne,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:return ie=kd(ee.type,ee.key,ee.props,null,ne.mode,ie),Nc(ie,ee),ie.return=ne,ie;case k:return ee=Fh(ee,ne.mode,ie),ee.return=ne,ee;case R:return ee=Bs(ee),Ee(ne,ee,ie)}if(F(ee)||q(ee))return ee=Rs(ee,ne.mode,ie,null),ee.return=ne,ee;if(typeof ee.then=="function")return Ee(ne,Ad(ee),ie);if(ee.$$typeof===N)return Ee(ne,Nd(ne,ee),ie);Td(ne,ee)}return null}function oe(ne,ee,ie,ye){var We=ee!==null?ee.key:null;if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return We!==null?null:$(ne,ee,""+ie,ye);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case b:return ie.key===We?Q(ne,ee,ie,ye):null;case k:return ie.key===We?ae(ne,ee,ie,ye):null;case R:return ie=Bs(ie),oe(ne,ee,ie,ye)}if(F(ie)||q(ie))return We!==null?null:he(ne,ee,ie,ye,null);if(typeof ie.then=="function")return oe(ne,ee,Ad(ie),ye);if(ie.$$typeof===N)return oe(ne,ee,Nd(ne,ie),ye);Td(ne,ie)}return null}function fe(ne,ee,ie,ye,We){if(typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint")return ne=ne.get(ie)||null,$(ee,ne,""+ye,We);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case b:return ne=ne.get(ye.key===null?ie:ye.key)||null,Q(ee,ne,ye,We);case k:return ne=ne.get(ye.key===null?ie:ye.key)||null,ae(ee,ne,ye,We);case R:return ye=Bs(ye),fe(ne,ee,ie,ye,We)}if(F(ye)||q(ye))return ne=ne.get(ie)||null,he(ee,ne,ye,We,null);if(typeof ye.then=="function")return fe(ne,ee,ie,Ad(ye),We);if(ye.$$typeof===N)return fe(ne,ee,ie,Nd(ee,ye),We);Td(ee,ye)}return null}function Be(ne,ee,ie,ye){for(var We=null,jt=null,qe=ee,ut=ee=0,vt=null;qe!==null&&ut<ie.length;ut++){qe.index>ut?(vt=qe,qe=null):vt=qe.sibling;var Ct=oe(ne,qe,ie[ut],ye);if(Ct===null){qe===null&&(qe=vt);break}r&&qe&&Ct.alternate===null&&s(ne,qe),ee=w(Ct,ee,ut),jt===null?We=Ct:jt.sibling=Ct,jt=Ct,qe=vt}if(ut===ie.length)return u(ne,qe),wt&&Kr(ne,ut),We;if(qe===null){for(;ut<ie.length;ut++)qe=Ee(ne,ie[ut],ye),qe!==null&&(ee=w(qe,ee,ut),jt===null?We=qe:jt.sibling=qe,jt=qe);return wt&&Kr(ne,ut),We}for(qe=h(qe);ut<ie.length;ut++)vt=fe(qe,ne,ut,ie[ut],ye),vt!==null&&(r&&vt.alternate!==null&&qe.delete(vt.key===null?ut:vt.key),ee=w(vt,ee,ut),jt===null?We=vt:jt.sibling=vt,jt=vt);return r&&qe.forEach(function(Ja){return s(ne,Ja)}),wt&&Kr(ne,ut),We}function tt(ne,ee,ie,ye){if(ie==null)throw Error(i(151));for(var We=null,jt=null,qe=ee,ut=ee=0,vt=null,Ct=ie.next();qe!==null&&!Ct.done;ut++,Ct=ie.next()){qe.index>ut?(vt=qe,qe=null):vt=qe.sibling;var Ja=oe(ne,qe,Ct.value,ye);if(Ja===null){qe===null&&(qe=vt);break}r&&qe&&Ja.alternate===null&&s(ne,qe),ee=w(Ja,ee,ut),jt===null?We=Ja:jt.sibling=Ja,jt=Ja,qe=vt}if(Ct.done)return u(ne,qe),wt&&Kr(ne,ut),We;if(qe===null){for(;!Ct.done;ut++,Ct=ie.next())Ct=Ee(ne,Ct.value,ye),Ct!==null&&(ee=w(Ct,ee,ut),jt===null?We=Ct:jt.sibling=Ct,jt=Ct);return wt&&Kr(ne,ut),We}for(qe=h(qe);!Ct.done;ut++,Ct=ie.next())Ct=fe(qe,ne,ut,Ct.value,ye),Ct!==null&&(r&&Ct.alternate!==null&&qe.delete(Ct.key===null?ut:Ct.key),ee=w(Ct,ee,ut),jt===null?We=Ct:jt.sibling=Ct,jt=Ct);return r&&qe.forEach(function(aD){return s(ne,aD)}),wt&&Kr(ne,ut),We}function $t(ne,ee,ie,ye){if(typeof ie=="object"&&ie!==null&&ie.type===v&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case b:e:{for(var We=ie.key;ee!==null;){if(ee.key===We){if(We=ie.type,We===v){if(ee.tag===7){u(ne,ee.sibling),ye=x(ee,ie.props.children),ye.return=ne,ne=ye;break e}}else if(ee.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===R&&Bs(We)===ee.type){u(ne,ee.sibling),ye=x(ee,ie.props),Nc(ye,ie),ye.return=ne,ne=ye;break e}u(ne,ee);break}else s(ne,ee);ee=ee.sibling}ie.type===v?(ye=Rs(ie.props.children,ne.mode,ye,ie.key),ye.return=ne,ne=ye):(ye=kd(ie.type,ie.key,ie.props,null,ne.mode,ye),Nc(ye,ie),ye.return=ne,ne=ye)}return A(ne);case k:e:{for(We=ie.key;ee!==null;){if(ee.key===We)if(ee.tag===4&&ee.stateNode.containerInfo===ie.containerInfo&&ee.stateNode.implementation===ie.implementation){u(ne,ee.sibling),ye=x(ee,ie.children||[]),ye.return=ne,ne=ye;break e}else{u(ne,ee);break}else s(ne,ee);ee=ee.sibling}ye=Fh(ie,ne.mode,ye),ye.return=ne,ne=ye}return A(ne);case R:return ie=Bs(ie),$t(ne,ee,ie,ye)}if(F(ie))return Be(ne,ee,ie,ye);if(q(ie)){if(We=q(ie),typeof We!="function")throw Error(i(150));return ie=We.call(ie),tt(ne,ee,ie,ye)}if(typeof ie.then=="function")return $t(ne,ee,Ad(ie),ye);if(ie.$$typeof===N)return $t(ne,ee,Nd(ne,ie),ye);Td(ne,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,ee!==null&&ee.tag===6?(u(ne,ee.sibling),ye=x(ee,ie),ye.return=ne,ne=ye):(u(ne,ee),ye=Uh(ie,ne.mode,ye),ye.return=ne,ne=ye),A(ne)):u(ne,ee)}return function(ne,ee,ie,ye){try{Sc=0;var We=$t(ne,ee,ie,ye);return ql=null,We}catch(qe){if(qe===Fl||qe===jd)throw qe;var jt=yi(29,qe,null,ne.mode);return jt.lanes=ye,jt.return=ne,jt}finally{}}}var Us=Zv(!0),Jv=Zv(!1),Ia=!1;function em(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function tm(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 h=r.updateQueue;if(h===null)return null;if(h=h.shared,(Tt&2)!==0){var x=h.pending;return x===null?s.next=s:(s.next=x.next,x.next=s),h.pending=s,s=wd(r),Iv(r,null,u),s}return vd(r,h,s,u),wd(r)}function _c(r,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194048)!==0)){var h=s.lanes;h&=r.pendingLanes,u|=h,s.lanes=u,et(r,u)}}function nm(r,s){var u=r.updateQueue,h=r.alternate;if(h!==null&&(h=h.updateQueue,u===h)){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:h.baseState,firstBaseUpdate:x,lastBaseUpdate:w,shared:h.shared,callbacks:h.callbacks},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=s:r.next=s,u.lastBaseUpdate=s}var im=!1;function jc(){if(im){var r=Ul;if(r!==null)throw r}}function Cc(r,s,u,h){im=!1;var x=r.updateQueue;Ia=!1;var w=x.firstBaseUpdate,A=x.lastBaseUpdate,$=x.shared.pending;if($!==null){x.shared.pending=null;var Q=$,ae=Q.next;Q.next=null,A===null?w=ae:A.next=ae,A=Q;var he=r.alternate;he!==null&&(he=he.updateQueue,$=he.lastBaseUpdate,$!==A&&($===null?he.firstBaseUpdate=ae:$.next=ae,he.lastBaseUpdate=Q))}if(w!==null){var Ee=x.baseState;A=0,he=ae=Q=null,$=w;do{var oe=$.lane&-536870913,fe=oe!==$.lane;if(fe?(xt&oe)===oe:(h&oe)===oe){oe!==0&&oe===$l&&(im=!0),he!==null&&(he=he.next={lane:0,tag:$.tag,payload:$.payload,callback:null,next:null});e:{var Be=r,tt=$;oe=s;var $t=u;switch(tt.tag){case 1:if(Be=tt.payload,typeof Be=="function"){Ee=Be.call($t,Ee,oe);break e}Ee=Be;break e;case 3:Be.flags=Be.flags&-65537|128;case 0:if(Be=tt.payload,oe=typeof Be=="function"?Be.call($t,Ee,oe):Be,oe==null)break e;Ee=m({},Ee,oe);break e;case 2:Ia=!0}}oe=$.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:$.tag,payload:$.payload,callback:$.callback,next:null},he===null?(ae=he=fe,Q=Ee):he=he.next=fe,A|=oe;if($=$.next,$===null){if($=x.shared.pending,$===null)break;fe=$,$=fe.next,fe.next=null,x.lastBaseUpdate=fe,x.shared.pending=null}}while(!0);he===null&&(Q=Ee),x.baseState=Q,x.firstBaseUpdate=ae,x.lastBaseUpdate=he,w===null&&(x.shared.lanes=0),qa|=A,r.lanes=A,r.memoizedState=Ee}}function e0(r,s){if(typeof r!="function")throw Error(i(191,r));r.call(s)}function t0(r,s){var u=r.callbacks;if(u!==null)for(r.callbacks=null,r=0;r<u.length;r++)e0(u[r],s)}var Hl=z(null),Md=z(0);function n0(r,s){r=na,P(Md,r),P(Hl,s),na=r|s.baseLanes}function rm(){P(Md,na),P(Hl,Hl.current)}function am(){na=Md.current,V(Hl),V(Md)}var bi=z(null),Pi=null;function Ba(r){var s=r.alternate;P(yn,yn.current&1),P(bi,r),Pi===null&&(s===null||Hl.current!==null||s.memoizedState!==null)&&(Pi=r)}function sm(r){P(yn,yn.current),P(bi,r),Pi===null&&(Pi=r)}function i0(r){r.tag===22?(P(yn,yn.current),P(bi,r),Pi===null&&(Pi=r)):$a()}function $a(){P(yn,yn.current),P(bi,bi.current)}function xi(r){V(bi),Pi===r&&(Pi=null),V(yn)}var yn=z(0);function Dd(r){for(var s=r;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||fg(u)||pg(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,Od=!1,Kl=!1,Fs=!1,Rd=0,Ac=0,Gl=null,WT=0;function pn(){throw Error(i(321))}function lm(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 om(r,s,u,h,x,w){return Yr=w,ot=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,I.H=r===null||r.memoizedState===null?$0:Em,Fs=!1,w=u(h,x),Fs=!1,Kl&&(w=a0(s,u,h,x)),r0(r),w}function r0(r){I.H=Dc;var s=Pt!==null&&Pt.next!==null;if(Yr=0,wn=Pt=ot=null,Od=!1,Ac=0,Gl=null,s)throw Error(i(300));r===null||kn||(r=r.dependencies,r!==null&&Sd(r)&&(kn=!0))}function a0(r,s,u,h){ot=r;var x=0;do{if(Kl&&(Gl=null),Ac=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)}I.H=U0,w=s(u,h)}while(Kl);return w}function QT(){var r=I.H,s=r.useState()[0];return s=typeof s.then=="function"?Tc(s):s,r=r.useState()[0],(Pt!==null?Pt.memoizedState:null)!==r&&(ot.flags|=1024),s}function cm(){var r=Rd!==0;return Rd=0,r}function um(r,s,u){s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~u}function dm(r){if(Od){for(r=r.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Od=!1}Yr=0,wn=Pt=ot=null,Kl=!1,Ac=Rd=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 bn(){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 Ld(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Tc(r){var s=Ac;return Ac+=1,Gl===null&&(Gl=[]),r=Wv(Gl,r,s),s=ot,(wn===null?s.memoizedState:wn.next)===null&&(s=s.alternate,I.H=s===null||s.memoizedState===null?$0:Em),r}function Id(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Tc(r);if(r.$$typeof===N)return zn(r)}throw Error(i(438,String(r)))}function fm(r){var s=null,u=ot.updateQueue;if(u!==null&&(s=u.memoCache),s==null){var h=ot.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(s={data:h.data.map(function(x){return x.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),u===null&&(u=Ld(),ot.updateQueue=u),u.memoCache=s,u=s.data[s.index],u===void 0)for(u=s.data[s.index]=Array(r),h=0;h<r;h++)u[h]=U;return s.index++,u}function Wr(r,s){return typeof s=="function"?s(r):s}function zd(r){var s=bn();return pm(s,Pt,r)}function pm(r,s,u){var h=r.queue;if(h===null)throw Error(i(311));h.lastRenderedReducer=u;var x=r.baseQueue,w=h.pending;if(w!==null){if(x!==null){var A=x.next;x.next=w.next,w.next=A}s.baseQueue=x=w,h.pending=null}if(w=r.baseState,x===null)r.memoizedState=w;else{s=x.next;var $=A=null,Q=null,ae=s,he=!1;do{var Ee=ae.lane&-536870913;if(Ee!==ae.lane?(xt&Ee)===Ee:(Yr&Ee)===Ee){var oe=ae.revertLane;if(oe===0)Q!==null&&(Q=Q.next={lane:0,revertLane:0,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),Ee===$l&&(he=!0);else if((Yr&oe)===oe){ae=ae.next,oe===$l&&(he=!0);continue}else Ee={lane:0,revertLane:ae.revertLane,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},Q===null?($=Q=Ee,A=w):Q=Q.next=Ee,ot.lanes|=oe,qa|=oe;Ee=ae.action,Fs&&u(w,Ee),w=ae.hasEagerState?ae.eagerState:u(w,Ee)}else oe={lane:Ee,revertLane:ae.revertLane,gesture:ae.gesture,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},Q===null?($=Q=oe,A=w):Q=Q.next=oe,ot.lanes|=Ee,qa|=Ee;ae=ae.next}while(ae!==null&&ae!==s);if(Q===null?A=w:Q.next=$,!gi(w,r.memoizedState)&&(kn=!0,he&&(u=Ul,u!==null)))throw u;r.memoizedState=w,r.baseState=A,r.baseQueue=Q,h.lastRenderedState=w}return x===null&&(h.lanes=0),[r.memoizedState,h.dispatch]}function hm(r){var s=bn(),u=s.queue;if(u===null)throw Error(i(311));u.lastRenderedReducer=r;var h=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,h]}function s0(r,s,u){var h=ot,x=bn(),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,ym(c0.bind(null,h,x,r),[r]),x.getSnapshot!==s||A||wn!==null&&wn.memoizedState.tag&1){if(h.flags|=2048,Vl(9,{destroy:void 0},o0.bind(null,h,x,u,s),null),Ht===null)throw Error(i(349));w||(Yr&127)!==0||l0(h,s,u)}return u}function l0(r,s,u){r.flags|=16384,r={getSnapshot:s,value:u},s=ot.updateQueue,s===null?(s=Ld(),ot.updateQueue=s,s.stores=[r]):(u=s.stores,u===null?s.stores=[r]:u.push(r))}function o0(r,s,u,h){s.value=u,s.getSnapshot=h,u0(s)&&d0(r)}function c0(r,s,u){return u(function(){u0(s)&&d0(r)})}function u0(r){var s=r.getSnapshot;r=r.value;try{var u=s();return!gi(r,u)}catch{return!0}}function d0(r){var s=Os(r,2);s!==null&&oi(s,r,2)}function mm(r){var s=Xn();if(typeof r=="function"){var u=r;if(r=u(),Fs){Wt(!0);try{u()}finally{Wt(!1)}}}return s.memoizedState=s.baseState=r,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wr,lastRenderedState:r},s}function f0(r,s,u,h){return r.baseState=u,pm(r,Pt,typeof h=="function"?h:Wr)}function XT(r,s,u,h,x){if($d(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)}};I.T!==null?u(!0):w.isTransition=!1,h(w),u=s.pending,u===null?(w.next=s.pending=w,p0(s,w)):(w.next=u.next,s.pending=u.next=w)}}function p0(r,s){var u=s.action,h=s.payload,x=r.state;if(s.isTransition){var w=I.T,A={};I.T=A;try{var $=u(x,h),Q=I.S;Q!==null&&Q(A,$),h0(r,s,$)}catch(ae){gm(r,s,ae)}finally{w!==null&&A.types!==null&&(w.types=A.types),I.T=w}}else try{w=u(x,h),h0(r,s,w)}catch(ae){gm(r,s,ae)}}function h0(r,s,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){m0(r,s,h)},function(h){return gm(r,s,h)}):m0(r,s,u)}function m0(r,s,u){s.status="fulfilled",s.value=u,g0(s),r.state=u,s=r.pending,s!==null&&(u=s.next,u===s?r.pending=null:(u=u.next,s.next=u,p0(r,u)))}function gm(r,s,u){var h=r.pending;if(r.pending=null,h!==null){h=h.next;do s.status="rejected",s.reason=u,g0(s),s=s.next;while(s!==h)}r.action=null}function g0(r){r=r.listeners;for(var s=0;s<r.length;s++)(0,r[s])()}function y0(r,s){return s}function b0(r,s){if(wt){var u=Ht.formState;if(u!==null){e:{var h=ot;if(wt){if(Qt){t:{for(var x=Qt,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){Qt=Bi(x.nextSibling),h=x.data==="F!";break e}}Ra(h)}h=!1}h&&(s=u[0])}}return u=Xn(),u.memoizedState=u.baseState=s,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:y0,lastRenderedState:s},u.queue=h,u=z0.bind(null,ot,h),h.dispatch=u,h=mm(!1),w=km.bind(null,ot,!1,h.queue),h=Xn(),x={state:s,dispatch:null,action:r,pending:null},h.queue=x,u=XT.bind(null,ot,x,w,u),x.dispatch=u,h.memoizedState=r,[s,u,!1]}function x0(r){var s=bn();return v0(s,Pt,r)}function v0(r,s,u){if(s=pm(r,s,y0)[0],r=zd(Wr)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var h=Tc(s)}catch(A){throw A===Fl?jd:A}else h=s;s=bn();var x=s.queue,w=x.dispatch;return u!==s.memoizedState&&(ot.flags|=2048,Vl(9,{destroy:void 0},ZT.bind(null,x,u),null)),[h,w,r]}function ZT(r,s){r.action=s}function w0(r){var s=bn(),u=Pt;if(u!==null)return v0(s,u,r);bn(),s=s.memoizedState,u=bn();var h=u.queue.dispatch;return u.memoizedState=r,[s,h,!1]}function Vl(r,s,u,h){return r={tag:r,create:u,deps:h,inst:s,next:null},s=ot.updateQueue,s===null&&(s=Ld(),ot.updateQueue=s),u=s.lastEffect,u===null?s.lastEffect=r.next=r:(h=u.next,u.next=r,r.next=h,s.lastEffect=r),r}function k0(){return bn().memoizedState}function Pd(r,s,u,h){var x=Xn();ot.flags|=r,x.memoizedState=Vl(1|s,{destroy:void 0},u,h===void 0?null:h)}function Bd(r,s,u,h){var x=bn();h=h===void 0?null:h;var w=x.memoizedState.inst;Pt!==null&&h!==null&&lm(h,Pt.memoizedState.deps)?x.memoizedState=Vl(s,w,u,h):(ot.flags|=r,x.memoizedState=Vl(1|s,w,u,h))}function E0(r,s){Pd(8390656,8,r,s)}function ym(r,s){Bd(2048,8,r,s)}function JT(r){ot.flags|=4;var s=ot.updateQueue;if(s===null)s=Ld(),ot.updateQueue=s,s.events=[r];else{var u=s.events;u===null?s.events=[r]:u.push(r)}}function S0(r){var s=bn().memoizedState;return JT({ref:s,nextImpl:r}),function(){if((Tt&2)!==0)throw Error(i(440));return s.impl.apply(void 0,arguments)}}function N0(r,s){return Bd(4,2,r,s)}function _0(r,s){return Bd(4,4,r,s)}function j0(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 C0(r,s,u){u=u!=null?u.concat([r]):null,Bd(4,4,j0.bind(null,s,r),u)}function bm(){}function A0(r,s){var u=bn();s=s===void 0?null:s;var h=u.memoizedState;return s!==null&&lm(s,h[1])?h[0]:(u.memoizedState=[r,s],r)}function T0(r,s){var u=bn();s=s===void 0?null:s;var h=u.memoizedState;if(s!==null&&lm(s,h[1]))return h[0];if(h=r(),Fs){Wt(!0);try{r()}finally{Wt(!1)}}return u.memoizedState=[h,s],h}function xm(r,s,u){return u===void 0||(Yr&1073741824)!==0&&(xt&261930)===0?r.memoizedState=s:(r.memoizedState=u,r=Mw(),ot.lanes|=r,qa|=r,u)}function M0(r,s,u,h){return gi(u,s)?u:Hl.current!==null?(r=xm(r,u,h),gi(r,s)||(kn=!0),r):(Yr&42)===0||(Yr&1073741824)!==0&&(xt&261930)===0?(kn=!0,r.memoizedState=u):(r=Mw(),ot.lanes|=r,qa|=r,s)}function D0(r,s,u,h,x){var w=H.p;H.p=w!==0&&8>w?w:8;var A=I.T,$={};I.T=$,km(r,!1,s,u);try{var Q=x(),ae=I.S;if(ae!==null&&ae($,Q),Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var he=YT(Q,h);Mc(r,s,he,ki(r))}else Mc(r,s,h,ki(r))}catch(Ee){Mc(r,s,{then:function(){},status:"rejected",reason:Ee},ki())}finally{H.p=w,A!==null&&$.types!==null&&(A.types=$.types),I.T=A}}function eM(){}function vm(r,s,u,h){if(r.tag!==5)throw Error(i(476));var x=O0(r).queue;D0(r,x,s,W,u===null?eM:function(){return R0(r),u(h)})}function O0(r){var s=r.memoizedState;if(s!==null)return s;s={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wr,lastRenderedState:W},next:null};var u={};return s.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wr,lastRenderedState:u},next:null},r.memoizedState=s,r=r.alternate,r!==null&&(r.memoizedState=s),s}function R0(r){var s=O0(r);s.next===null&&(s=r.alternate.memoizedState),Mc(r,s.next.queue,{},ki())}function wm(){return zn(Yc)}function L0(){return bn().memoizedState}function I0(){return bn().memoizedState}function tM(r){for(var s=r.return;s!==null;){switch(s.tag){case 24:case 3:var u=ki();r=za(u);var h=Pa(s,r,u);h!==null&&(oi(h,s,u),_c(h,s,u)),s={cache:Qh()},r.payload=s;return}s=s.return}}function nM(r,s,u){var h=ki();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},$d(r)?P0(s,u):(u=Bh(r,s,u,h),u!==null&&(oi(u,r,h),B0(u,s,h)))}function z0(r,s,u){var h=ki();Mc(r,s,u,h)}function Mc(r,s,u,h){var x={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if($d(r))P0(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,$=w(A,u);if(x.hasEagerState=!0,x.eagerState=$,gi($,A))return vd(r,s,x,0),Ht===null&&xd(),!1}catch{}finally{}if(u=Bh(r,s,x,h),u!==null)return oi(u,r,h),B0(u,s,h),!0}return!1}function km(r,s,u,h){if(h={lane:2,revertLane:eg(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},$d(r)){if(s)throw Error(i(479))}else s=Bh(r,u,h,2),s!==null&&oi(s,r,2)}function $d(r){var s=r.alternate;return r===ot||s!==null&&s===ot}function P0(r,s){Kl=Od=!0;var u=r.pending;u===null?s.next=s:(s.next=u.next,u.next=s),r.pending=s}function B0(r,s,u){if((u&4194048)!==0){var h=s.lanes;h&=r.pendingLanes,u|=h,s.lanes=u,et(r,u)}}var Dc={readContext:zn,use:Id,useCallback:pn,useContext:pn,useEffect:pn,useImperativeHandle:pn,useLayoutEffect:pn,useInsertionEffect:pn,useMemo:pn,useReducer:pn,useRef:pn,useState:pn,useDebugValue:pn,useDeferredValue:pn,useTransition:pn,useSyncExternalStore:pn,useId:pn,useHostTransitionStatus:pn,useFormState:pn,useActionState:pn,useOptimistic:pn,useMemoCache:pn,useCacheRefresh:pn};Dc.useEffectEvent=pn;var $0={readContext:zn,use:Id,useCallback:function(r,s){return Xn().memoizedState=[r,s===void 0?null:s],r},useContext:zn,useEffect:E0,useImperativeHandle:function(r,s,u){u=u!=null?u.concat([r]):null,Pd(4194308,4,j0.bind(null,s,r),u)},useLayoutEffect:function(r,s){return Pd(4194308,4,r,s)},useInsertionEffect:function(r,s){Pd(4,2,r,s)},useMemo:function(r,s){var u=Xn();s=s===void 0?null:s;var h=r();if(Fs){Wt(!0);try{r()}finally{Wt(!1)}}return u.memoizedState=[h,s],h},useReducer:function(r,s,u){var h=Xn();if(u!==void 0){var x=u(s);if(Fs){Wt(!0);try{u(s)}finally{Wt(!1)}}}else x=s;return h.memoizedState=h.baseState=x,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:x},h.queue=r,r=r.dispatch=nM.bind(null,ot,r),[h.memoizedState,r]},useRef:function(r){var s=Xn();return r={current:r},s.memoizedState=r},useState:function(r){r=mm(r);var s=r.queue,u=z0.bind(null,ot,s);return s.dispatch=u,[r.memoizedState,u]},useDebugValue:bm,useDeferredValue:function(r,s){var u=Xn();return xm(u,r,s)},useTransition:function(){var r=mm(!1);return r=D0.bind(null,ot,r.queue,!0,!1),Xn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,s,u){var h=ot,x=Xn();if(wt){if(u===void 0)throw Error(i(407));u=u()}else{if(u=s(),Ht===null)throw Error(i(349));(xt&127)!==0||l0(h,s,u)}x.memoizedState=u;var w={value:u,getSnapshot:s};return x.queue=w,E0(c0.bind(null,h,w,r),[r]),h.flags|=2048,Vl(9,{destroy:void 0},o0.bind(null,h,w,u,s),null),u},useId:function(){var r=Xn(),s=Ht.identifierPrefix;if(wt){var u=kr,h=wr;u=(h&~(1<<32-yt(h)-1)).toString(32)+u,s="_"+s+"R_"+u,u=Rd++,0<u&&(s+="H"+u.toString(32)),s+="_"}else u=WT++,s="_"+s+"r_"+u.toString(32)+"_";return r.memoizedState=s},useHostTransitionStatus:wm,useFormState:b0,useActionState:b0,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=km.bind(null,ot,!0,u),u.dispatch=s,[r,s]},useMemoCache:fm,useCacheRefresh:function(){return Xn().memoizedState=tM.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)}}},Em={readContext:zn,use:Id,useCallback:A0,useContext:zn,useEffect:ym,useImperativeHandle:C0,useInsertionEffect:N0,useLayoutEffect:_0,useMemo:T0,useReducer:zd,useRef:k0,useState:function(){return zd(Wr)},useDebugValue:bm,useDeferredValue:function(r,s){var u=bn();return M0(u,Pt.memoizedState,r,s)},useTransition:function(){var r=zd(Wr)[0],s=bn().memoizedState;return[typeof r=="boolean"?r:Tc(r),s]},useSyncExternalStore:s0,useId:L0,useHostTransitionStatus:wm,useFormState:x0,useActionState:x0,useOptimistic:function(r,s){var u=bn();return f0(u,Pt,r,s)},useMemoCache:fm,useCacheRefresh:I0};Em.useEffectEvent=S0;var U0={readContext:zn,use:Id,useCallback:A0,useContext:zn,useEffect:ym,useImperativeHandle:C0,useInsertionEffect:N0,useLayoutEffect:_0,useMemo:T0,useReducer:hm,useRef:k0,useState:function(){return hm(Wr)},useDebugValue:bm,useDeferredValue:function(r,s){var u=bn();return Pt===null?xm(u,r,s):M0(u,Pt.memoizedState,r,s)},useTransition:function(){var r=hm(Wr)[0],s=bn().memoizedState;return[typeof r=="boolean"?r:Tc(r),s]},useSyncExternalStore:s0,useId:L0,useHostTransitionStatus:wm,useFormState:w0,useActionState:w0,useOptimistic:function(r,s){var u=bn();return Pt!==null?f0(u,Pt,r,s):(u.baseState=r,[r,u.queue.dispatch])},useMemoCache:fm,useCacheRefresh:I0};U0.useEffectEvent=S0;function Sm(r,s,u,h){s=r.memoizedState,u=u(h,s),u=u==null?s:m({},s,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}var Nm={enqueueSetState:function(r,s,u){r=r._reactInternals;var h=ki(),x=za(h);x.payload=s,u!=null&&(x.callback=u),s=Pa(r,x,h),s!==null&&(oi(s,r,h),_c(s,r,h))},enqueueReplaceState:function(r,s,u){r=r._reactInternals;var h=ki(),x=za(h);x.tag=1,x.payload=s,u!=null&&(x.callback=u),s=Pa(r,x,h),s!==null&&(oi(s,r,h),_c(s,r,h))},enqueueForceUpdate:function(r,s){r=r._reactInternals;var u=ki(),h=za(u);h.tag=2,s!=null&&(h.callback=s),s=Pa(r,h,u),s!==null&&(oi(s,r,u),_c(s,r,u))}};function F0(r,s,u,h,x,w,A){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(h,w,A):s.prototype&&s.prototype.isPureReactComponent?!bc(u,h)||!bc(x,w):!0}function q0(r,s,u,h){r=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,h),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,h),s.state!==r&&Nm.enqueueReplaceState(s,s.state,null)}function qs(r,s){var u=s;if("ref"in s){u={};for(var h in s)h!=="ref"&&(u[h]=s[h])}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 H0(r){bd(r)}function K0(r){console.error(r)}function G0(r){bd(r)}function Ud(r,s){try{var u=r.onUncaughtError;u(s.value,{componentStack:s.stack})}catch(h){setTimeout(function(){throw h})}}function V0(r,s,u){try{var h=r.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function _m(r,s,u){return u=za(u),u.tag=3,u.payload={element:null},u.callback=function(){Ud(r,s)},u}function Y0(r){return r=za(r),r.tag=3,r}function W0(r,s,u,h){var x=u.type.getDerivedStateFromError;if(typeof x=="function"){var w=h.value;r.payload=function(){return x(w)},r.callback=function(){V0(s,u,h)}}var A=u.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(r.callback=function(){V0(s,u,h),typeof x!="function"&&(Ha===null?Ha=new Set([this]):Ha.add(this));var $=h.stack;this.componentDidCatch(h.value,{componentStack:$!==null?$:""})})}function iM(r,s,u,h,x){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.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?Jd():u.alternate===null&&hn===0&&(hn=3),u.flags&=-257,u.flags|=65536,u.lanes=x,h===Cd?u.flags|=16384:(s=u.updateQueue,s===null?u.updateQueue=new Set([h]):s.add(h),Xm(r,h,x)),!1;case 22:return u.flags|=65536,h===Cd?u.flags|=16384:(s=u.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([h])},u.updateQueue=s):(u=s.retryQueue,u===null?s.retryQueue=new Set([h]):u.add(h)),Xm(r,h,x)),!1}throw Error(i(435,u.tag))}return Xm(r,h,x),Jd(),!1}if(wt)return s=bi.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=x,h!==Kh&&(r=Error(i(422),{cause:h}),wc(Ri(r,u)))):(h!==Kh&&(s=Error(i(423),{cause:h}),wc(Ri(s,u))),r=r.current.alternate,r.flags|=65536,x&=-x,r.lanes|=x,h=Ri(h,u),x=_m(r.stateNode,h,x),nm(r,x),hn!==4&&(hn=2)),!1;var w=Error(i(520),{cause:h});if(w=Ri(w,u),$c===null?$c=[w]:$c.push(w),hn!==4&&(hn=2),s===null)return!0;h=Ri(h,u),u=s;do{switch(u.tag){case 3:return u.flags|=65536,r=x&-x,u.lanes|=r,r=_m(u.stateNode,h,r),nm(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=Y0(x),W0(x,r,u,h),nm(u,x),!1}u=u.return}while(u!==null);return!1}var jm=Error(i(461)),kn=!1;function Pn(r,s,u,h){s.child=r===null?Jv(s,null,u,h):Us(s,r.child,u,h)}function Q0(r,s,u,h,x){u=u.render;var w=s.ref;if("ref"in h){var A={};for(var $ in h)$!=="ref"&&(A[$]=h[$])}else A=h;return zs(s),h=om(r,s,u,A,w,x),$=cm(),r!==null&&!kn?(um(r,s,x),Qr(r,s,x)):(wt&&$&&qh(s),s.flags|=1,Pn(r,s,h,x),s.child)}function X0(r,s,u,h,x){if(r===null){var w=u.type;return typeof w=="function"&&!$h(w)&&w.defaultProps===void 0&&u.compare===null?(s.tag=15,s.type=w,Z0(r,s,w,h,x)):(r=kd(u.type,null,h,s,s.mode,x),r.ref=s.ref,r.return=s,s.child=r)}if(w=r.child,!Lm(r,x)){var A=w.memoizedProps;if(u=u.compare,u=u!==null?u:bc,u(A,h)&&r.ref===s.ref)return Qr(r,s,x)}return s.flags|=1,r=Hr(w,h),r.ref=s.ref,r.return=s,s.child=r}function Z0(r,s,u,h,x){if(r!==null){var w=r.memoizedProps;if(bc(w,h)&&r.ref===s.ref)if(kn=!1,s.pendingProps=h=w,Lm(r,x))(r.flags&131072)!==0&&(kn=!0);else return s.lanes=r.lanes,Qr(r,s,x)}return Cm(r,s,u,h,x)}function J0(r,s,u,h){var x=h.children,w=r!==null?r.memoizedState:null;if(r===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((s.flags&128)!==0){if(w=w!==null?w.baseLanes|u:u,r!==null){for(h=s.child=r.child,x=0;h!==null;)x=x|h.lanes|h.childLanes,h=h.sibling;h=x&~w}else h=0,s.child=null;return ew(r,s,w,u,h)}if((u&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},r!==null&&_d(s,w!==null?w.cachePool:null),w!==null?n0(s,w):rm(),i0(s);else return h=s.lanes=536870912,ew(r,s,w!==null?w.baseLanes|u:u,u,h)}else w!==null?(_d(s,w.cachePool),n0(s,w),$a(),s.memoizedState=null):(r!==null&&_d(s,null),rm(),$a());return Pn(r,s,x,u),s.child}function Oc(r,s){return r!==null&&r.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function ew(r,s,u,h,x){var w=Zh();return w=w===null?null:{parent:vn._currentValue,pool:w},s.memoizedState={baseLanes:u,cachePool:w},r!==null&&_d(s,null),rm(),i0(s),r!==null&&Bl(r,s,h,!0),s.childLanes=x,null}function Fd(r,s){return s=Hd({mode:s.mode,children:s.children},r.mode),s.ref=r.ref,r.child=s,s.return=r,s}function tw(r,s,u){return Us(s,r.child,null,u),r=Fd(s,s.pendingProps),r.flags|=2,xi(s),s.memoizedState=null,r}function rM(r,s,u){var h=s.pendingProps,x=(s.flags&128)!==0;if(s.flags&=-129,r===null){if(wt){if(h.mode==="hidden")return r=Fd(s,h),s.lanes=536870912,Oc(null,r);if(sm(s),(r=Qt)?(r=p1(r,zi),r=r!==null&&r.data==="&"?r:null,r!==null&&(s.memoizedState={dehydrated:r,treeContext:Da!==null?{id:wr,overflow:kr}:null,retryLane:536870912,hydrationErrors:null},u=Pv(r),u.return=s,s.child=u,In=s,Qt=null)):r=null,r===null)throw Ra(s);return s.lanes=536870912,null}return Fd(s,h)}var w=r.memoizedState;if(w!==null){var A=w.dehydrated;if(sm(s),x)if(s.flags&256)s.flags&=-257,s=tw(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(h=Ht,h!==null&&(A=rn(h,u),A!==0&&A!==w.retryLane))throw w.retryLane=A,Os(r,A),oi(h,r,A),jm;Jd(),s=tw(r,s,u)}else r=w.treeContext,Qt=Bi(A.nextSibling),In=s,wt=!0,Oa=null,zi=!1,r!==null&&Uv(s,r),s=Fd(s,h),s.flags|=4096;return s}return r=Hr(r.child,{mode:h.mode,children:h.children}),r.ref=s.ref,s.child=r,r.return=s,r}function qd(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 Cm(r,s,u,h,x){return zs(s),u=om(r,s,u,h,void 0,x),h=cm(),r!==null&&!kn?(um(r,s,x),Qr(r,s,x)):(wt&&h&&qh(s),s.flags|=1,Pn(r,s,u,x),s.child)}function nw(r,s,u,h,x,w){return zs(s),s.updateQueue=null,u=a0(s,h,u,x),r0(r),h=cm(),r!==null&&!kn?(um(r,s,w),Qr(r,s,w)):(wt&&h&&qh(s),s.flags|=1,Pn(r,s,u,w),s.child)}function iw(r,s,u,h,x){if(zs(s),s.stateNode===null){var w=Ll,A=u.contextType;typeof A=="object"&&A!==null&&(w=zn(A)),w=new u(h,w),s.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=Nm,s.stateNode=w,w._reactInternals=s,w=s.stateNode,w.props=h,w.state=s.memoizedState,w.refs={},em(s),A=u.contextType,w.context=typeof A=="object"&&A!==null?zn(A):Ll,w.state=s.memoizedState,A=u.getDerivedStateFromProps,typeof A=="function"&&(Sm(s,u,A,h),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&&Nm.enqueueReplaceState(w,w.state,null),Cc(s,h,w,x),jc(),w.state=s.memoizedState),typeof w.componentDidMount=="function"&&(s.flags|=4194308),h=!0}else if(r===null){w=s.stateNode;var $=s.memoizedProps,Q=qs(u,$);w.props=Q;var ae=w.context,he=u.contextType;A=Ll,typeof he=="object"&&he!==null&&(A=zn(he));var Ee=u.getDerivedStateFromProps;he=typeof Ee=="function"||typeof w.getSnapshotBeforeUpdate=="function",$=s.pendingProps!==$,he||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||($||ae!==A)&&q0(s,w,h,A),Ia=!1;var oe=s.memoizedState;w.state=oe,Cc(s,h,w,x),jc(),ae=s.memoizedState,$||oe!==ae||Ia?(typeof Ee=="function"&&(Sm(s,u,Ee,h),ae=s.memoizedState),(Q=Ia||F0(s,u,Q,h,oe,ae,A))?(he||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=h,s.memoizedState=ae),w.props=h,w.state=ae,w.context=A,h=Q):(typeof w.componentDidMount=="function"&&(s.flags|=4194308),h=!1)}else{w=s.stateNode,tm(r,s),A=s.memoizedProps,he=qs(u,A),w.props=he,Ee=s.pendingProps,oe=w.context,ae=u.contextType,Q=Ll,typeof ae=="object"&&ae!==null&&(Q=zn(ae)),$=u.getDerivedStateFromProps,(ae=typeof $=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(A!==Ee||oe!==Q)&&q0(s,w,h,Q),Ia=!1,oe=s.memoizedState,w.state=oe,Cc(s,h,w,x),jc();var fe=s.memoizedState;A!==Ee||oe!==fe||Ia||r!==null&&r.dependencies!==null&&Sd(r.dependencies)?(typeof $=="function"&&(Sm(s,u,$,h),fe=s.memoizedState),(he=Ia||F0(s,u,he,h,oe,fe,Q)||r!==null&&r.dependencies!==null&&Sd(r.dependencies))?(ae||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(h,fe,Q),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(h,fe,Q)),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=h,s.memoizedState=fe),w.props=h,w.state=fe,w.context=Q,h=he):(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),h=!1)}return w=h,qd(r,s),h=(s.flags&128)!==0,w||h?(w=s.stateNode,u=h&&typeof u.getDerivedStateFromError!="function"?null:w.render(),s.flags|=1,r!==null&&h?(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=Qr(r,s,x),r}function rw(r,s,u,h){return Ls(),s.flags|=256,Pn(r,s,u,h),s.child}var Am={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Tm(r){return{baseLanes:r,cachePool:Vv()}}function Mm(r,s,u){return r=r!==null?r.childLanes&~u:0,s&&(r|=wi),r}function aw(r,s,u){var h=s.pendingProps,x=!1,w=(s.flags&128)!==0,A;if((A=w)||(A=r!==null&&r.memoizedState===null?!1:(yn.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=Qt)?(r=p1(r,zi),r=r!==null&&r.data!=="&"?r:null,r!==null&&(s.memoizedState={dehydrated:r,treeContext:Da!==null?{id:wr,overflow:kr}:null,retryLane:536870912,hydrationErrors:null},u=Pv(r),u.return=s,s.child=u,In=s,Qt=null)):r=null,r===null)throw Ra(s);return pg(r)?s.lanes=32:s.lanes=536870912,null}var $=h.children;return h=h.fallback,x?($a(),x=s.mode,$=Hd({mode:"hidden",children:$},x),h=Rs(h,x,u,null),$.return=s,h.return=s,$.sibling=h,s.child=$,h=s.child,h.memoizedState=Tm(u),h.childLanes=Mm(r,A,u),s.memoizedState=Am,Oc(null,h)):(Ba(s),Dm(s,$))}var Q=r.memoizedState;if(Q!==null&&($=Q.dehydrated,$!==null)){if(w)s.flags&256?(Ba(s),s.flags&=-257,s=Om(r,s,u)):s.memoizedState!==null?($a(),s.child=r.child,s.flags|=128,s=null):($a(),$=h.fallback,x=s.mode,h=Hd({mode:"visible",children:h.children},x),$=Rs($,x,u,null),$.flags|=2,h.return=s,$.return=s,h.sibling=$,s.child=h,Us(s,r.child,null,u),h=s.child,h.memoizedState=Tm(u),h.childLanes=Mm(r,A,u),s.memoizedState=Am,s=Oc(null,h));else if(Ba(s),pg($)){if(A=$.nextSibling&&$.nextSibling.dataset,A)var ae=A.dgst;A=ae,h=Error(i(419)),h.stack="",h.digest=A,wc({value:h,source:null,stack:null}),s=Om(r,s,u)}else if(kn||Bl(r,s,u,!1),A=(u&r.childLanes)!==0,kn||A){if(A=Ht,A!==null&&(h=rn(A,u),h!==0&&h!==Q.retryLane))throw Q.retryLane=h,Os(r,h),oi(A,r,h),jm;fg($)||Jd(),s=Om(r,s,u)}else fg($)?(s.flags|=192,s.child=r.child,s=null):(r=Q.treeContext,Qt=Bi($.nextSibling),In=s,wt=!0,Oa=null,zi=!1,r!==null&&Uv(s,r),s=Dm(s,h.children),s.flags|=4096);return s}return x?($a(),$=h.fallback,x=s.mode,Q=r.child,ae=Q.sibling,h=Hr(Q,{mode:"hidden",children:h.children}),h.subtreeFlags=Q.subtreeFlags&65011712,ae!==null?$=Hr(ae,$):($=Rs($,x,u,null),$.flags|=2),$.return=s,h.return=s,h.sibling=$,s.child=h,Oc(null,h),h=s.child,$=r.child.memoizedState,$===null?$=Tm(u):(x=$.cachePool,x!==null?(Q=vn._currentValue,x=x.parent!==Q?{parent:Q,pool:Q}:x):x=Vv(),$={baseLanes:$.baseLanes|u,cachePool:x}),h.memoizedState=$,h.childLanes=Mm(r,A,u),s.memoizedState=Am,Oc(r.child,h)):(Ba(s),u=r.child,r=u.sibling,u=Hr(u,{mode:"visible",children:h.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 Dm(r,s){return s=Hd({mode:"visible",children:s},r.mode),s.return=r,r.child=s}function Hd(r,s){return r=yi(22,r,null,s),r.lanes=0,r}function Om(r,s,u){return Us(s,r.child,null,u),r=Dm(s,s.pendingProps.children),r.flags|=2,s.memoizedState=null,r}function sw(r,s,u){r.lanes|=s;var h=r.alternate;h!==null&&(h.lanes|=s),Yh(r.return,s,u)}function Rm(r,s,u,h,x,w){var A=r.memoizedState;A===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:x,treeForkCount:w}:(A.isBackwards=s,A.rendering=null,A.renderingStartTime=0,A.last=h,A.tail=u,A.tailMode=x,A.treeForkCount=w)}function lw(r,s,u){var h=s.pendingProps,x=h.revealOrder,w=h.tail;h=h.children;var A=yn.current,$=(A&2)!==0;if($?(A=A&1|2,s.flags|=128):A&=1,P(yn,A),Pn(r,s,h,u),h=wt?vc:0,!$&&r!==null&&(r.flags&128)!==0)e:for(r=s.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&sw(r,u,s);else if(r.tag===19)sw(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&&Dd(r)===null&&(x=u),u=u.sibling;u=x,u===null?(x=s.child,s.child=null):(x=u.sibling,u.sibling=null),Rm(s,!1,x,u,w,h);break;case"backwards":case"unstable_legacy-backwards":for(u=null,x=s.child,s.child=null;x!==null;){if(r=x.alternate,r!==null&&Dd(r)===null){s.child=x;break}r=x.sibling,x.sibling=u,u=x,x=r}Rm(s,!0,u,null,w,h);break;case"together":Rm(s,!1,null,null,void 0,h);break;default:s.memoizedState=null}return s.child}function Qr(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 Lm(r,s){return(r.lanes&s)!==0?!0:(r=r.dependencies,!!(r!==null&&Sd(r)))}function aM(r,s,u){switch(s.tag){case 3:se(s,s.stateNode.containerInfo),La(s,vn,r.memoizedState.cache),Ls();break;case 27:case 5:ue(s);break;case 4:se(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,sm(s),null;break;case 13:var h=s.memoizedState;if(h!==null)return h.dehydrated!==null?(Ba(s),s.flags|=128,null):(u&s.child.childLanes)!==0?aw(r,s,u):(Ba(s),r=Qr(r,s,u),r!==null?r.sibling:null);Ba(s);break;case 19:var x=(r.flags&128)!==0;if(h=(u&s.childLanes)!==0,h||(Bl(r,s,u,!1),h=(u&s.childLanes)!==0),x){if(h)return lw(r,s,u);s.flags|=128}if(x=s.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),P(yn,yn.current),h)break;return null;case 22:return s.lanes=0,J0(r,s,u,s.pendingProps);case 24:La(s,vn,r.memoizedState.cache)}return Qr(r,s,u)}function ow(r,s,u){if(r!==null)if(r.memoizedProps!==s.pendingProps)kn=!0;else{if(!Lm(r,u)&&(s.flags&128)===0)return kn=!1,aM(r,s,u);kn=(r.flags&131072)!==0}else kn=!1,wt&&(s.flags&1048576)!==0&&$v(s,vc,s.index);switch(s.lanes=0,s.tag){case 16:e:{var h=s.pendingProps;if(r=Bs(s.elementType),s.type=r,typeof r=="function")$h(r)?(h=qs(r,h),s.tag=1,s=iw(null,s,r,h,u)):(s.tag=0,s=Cm(null,s,r,h,u));else{if(r!=null){var x=r.$$typeof;if(x===_){s.tag=11,s=Q0(null,s,r,h,u);break e}else if(x===O){s.tag=14,s=X0(null,s,r,h,u);break e}}throw s=D(r)||r,Error(i(306,s,""))}}return s;case 0:return Cm(r,s,s.type,s.pendingProps,u);case 1:return h=s.type,x=qs(h,s.pendingProps),iw(r,s,h,x,u);case 3:e:{if(se(s,s.stateNode.containerInfo),r===null)throw Error(i(387));h=s.pendingProps;var w=s.memoizedState;x=w.element,tm(r,s),Cc(s,h,null,u);var A=s.memoizedState;if(h=A.cache,La(s,vn,h),h!==w.cache&&Wh(s,[vn],u,!0),jc(),h=A.element,w.isDehydrated)if(w={element:h,isDehydrated:!1,cache:A.cache},s.updateQueue.baseState=w,s.memoizedState=w,s.flags&256){s=rw(r,s,h,u);break e}else if(h!==x){x=Ri(Error(i(424)),s),wc(x),s=rw(r,s,h,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(Qt=Bi(r.firstChild),In=s,wt=!0,Oa=null,zi=!0,u=Jv(s,null,h,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Ls(),h===x){s=Qr(r,s,u);break e}Pn(r,s,h,u)}s=s.child}return s;case 26:return qd(r,s),r===null?(u=x1(s.type,null,s.pendingProps,null))?s.memoizedState=u:wt||(u=s.type,r=s.pendingProps,h=lf(ke.current).createElement(u),h[an]=s,h[Tn]=r,Bn(h,u,r),fn(h),s.stateNode=h):s.memoizedState=x1(s.type,r.memoizedProps,s.pendingProps,r.memoizedState),null;case 27:return ue(s),r===null&&wt&&(h=s.stateNode=g1(s.type,s.pendingProps,ke.current),In=s,zi=!0,x=Qt,Ya(s.type)?(hg=x,Qt=Bi(h.firstChild)):Qt=x),Pn(r,s,s.pendingProps.children,u),qd(r,s),r===null&&(s.flags|=4194304),s.child;case 5:return r===null&&wt&&((x=h=Qt)&&(h=LM(h,s.type,s.pendingProps,zi),h!==null?(s.stateNode=h,In=s,Qt=Bi(h.firstChild),zi=!1,x=!0):x=!1),x||Ra(s)),ue(s),x=s.type,w=s.pendingProps,A=r!==null?r.memoizedProps:null,h=w.children,cg(x,w)?h=null:A!==null&&cg(x,A)&&(s.flags|=32),s.memoizedState!==null&&(x=om(r,s,QT,null,null,u),Yc._currentValue=x),qd(r,s),Pn(r,s,h,u),s.child;case 6:return r===null&&wt&&((r=u=Qt)&&(u=IM(u,s.pendingProps,zi),u!==null?(s.stateNode=u,In=s,Qt=null,r=!0):r=!1),r||Ra(s)),null;case 13:return aw(r,s,u);case 4:return se(s,s.stateNode.containerInfo),h=s.pendingProps,r===null?s.child=Us(s,null,h,u):Pn(r,s,h,u),s.child;case 11:return Q0(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 h=s.pendingProps,La(s,s.type,h.value),Pn(r,s,h.children,u),s.child;case 9:return x=s.type._context,h=s.pendingProps.children,zs(s),x=zn(x),h=h(x),s.flags|=1,Pn(r,s,h,u),s.child;case 14:return X0(r,s,s.type,s.pendingProps,u);case 15:return Z0(r,s,s.type,s.pendingProps,u);case 19:return lw(r,s,u);case 31:return rM(r,s,u);case 22:return J0(r,s,u,s.pendingProps);case 24:return zs(s),h=zn(vn),r===null?(x=Zh(),x===null&&(x=Ht,w=Qh(),x.pooledCache=w,w.refCount++,w!==null&&(x.pooledCacheLanes|=u),x=w),s.memoizedState={parent:h,cache:x},em(s),La(s,vn,x)):((r.lanes&u)!==0&&(tm(r,s),Cc(s,null,null,u),jc()),x=r.memoizedState,w=s.memoizedState,x.parent!==h?(x={parent:h,cache:h},s.memoizedState=x,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=x),La(s,vn,h)):(h=w.cache,La(s,vn,h),h!==x.cache&&Wh(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 Im(r,s,u,h,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(Lw())r.flags|=8192;else throw $s=Cd,Jh}else r.flags&=-16777217}function cw(r,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!S1(s))if(Lw())r.flags|=8192;else throw $s=Cd,Jh}function Kd(r,s){s!==null&&(r.flags|=4),r.flags&16384&&(s=r.tag!==22?it():536870912,r.lanes|=s,Xl|=s)}function Rc(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 h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?s||r.tail===null?r.tail=null:r.tail.sibling=null:h.sibling=null}}function Xt(r){var s=r.alternate!==null&&r.alternate.child===r.child,u=0,h=0;if(s)for(var x=r.child;x!==null;)u|=x.lanes|x.childLanes,h|=x.subtreeFlags&65011712,h|=x.flags&65011712,x.return=r,x=x.sibling;else for(x=r.child;x!==null;)u|=x.lanes|x.childLanes,h|=x.subtreeFlags,h|=x.flags,x.return=r,x=x.sibling;return r.subtreeFlags|=h,r.childLanes=u,s}function sM(r,s,u){var h=s.pendingProps;switch(Hh(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,h=null,r!==null&&(h=r.memoizedState.cache),s.memoizedState.cache!==h&&(s.flags|=2048),Vr(vn),ve(),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,Gh())),Xt(s),null;case 26:var x=s.type,w=s.memoizedState;return r===null?(Xr(s),w!==null?(Xt(s),cw(s,w)):(Xt(s),Im(s,x,null,h,u))):w?w!==r.memoizedState?(Xr(s),Xt(s),cw(s,w)):(Xt(s),s.flags&=-16777217):(r=r.memoizedProps,r!==h&&Xr(s),Xt(s),Im(s,x,r,h,u)),null;case 27:if(J(s),u=ke.current,x=s.type,r!==null&&s.stateNode!=null)r.memoizedProps!==h&&Xr(s);else{if(!h){if(s.stateNode===null)throw Error(i(166));return Xt(s),null}r=le.current,Pl(s)?Fv(s):(r=g1(x,h,u),s.stateNode=r,Xr(s))}return Xt(s),null;case 5:if(J(s),x=s.type,r!==null&&s.stateNode!=null)r.memoizedProps!==h&&Xr(s);else{if(!h){if(s.stateNode===null)throw Error(i(166));return Xt(s),null}if(w=le.current,Pl(s))Fv(s);else{var A=lf(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 h.is=="string"?A.createElement("select",{is:h.is}):A.createElement("select"),h.multiple?w.multiple=!0:h.size&&(w.size=h.size);break;default:w=typeof h.is=="string"?A.createElement(x,{is:h.is}):A.createElement(x)}}w[an]=s,w[Tn]=h;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,h),x){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&Xr(s)}}return Xt(s),Im(s,s.type,r===null?null:r.memoizedProps,s.pendingProps,u),null;case 6:if(r&&s.stateNode!=null)r.memoizedProps!==h&&Xr(s);else{if(typeof h!="string"&&s.stateNode===null)throw Error(i(166));if(r=ke.current,Pl(s)){if(r=s.stateNode,u=s.memoizedProps,h=null,x=In,x!==null)switch(x.tag){case 27:case 5:h=x.memoizedProps}r[an]=s,r=!!(r.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||a1(r.nodeValue,u)),r||Ra(s,!0)}else r=lf(r).createTextNode(h),r[an]=s,s.stateNode=r}return Xt(s),null;case 31:if(u=s.memoizedState,r===null||r.memoizedState!==null){if(h=Pl(s),u!==null){if(r===null){if(!h)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=Gh(),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(h=s.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(x=Pl(s),h!==null&&h.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=Gh(),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=h!==null,r=r!==null&&r.memoizedState!==null,u&&(h=s.child,x=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(x=h.alternate.memoizedState.cachePool.pool),w=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(w=h.memoizedState.cachePool.pool),w!==x&&(h.flags|=2048)),u!==r&&u&&(s.child.flags|=8192),Kd(s,s.updateQueue),Xt(s),null);case 4:return ve(),r===null&&rg(s.stateNode.containerInfo),Xt(s),null;case 10:return Vr(s.type),Xt(s),null;case 19:if(V(yn),h=s.memoizedState,h===null)return Xt(s),null;if(x=(s.flags&128)!==0,w=h.rendering,w===null)if(x)Rc(h,!1);else{if(hn!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(w=Dd(r),w!==null){for(s.flags|=128,Rc(h,!1),r=w.updateQueue,s.updateQueue=r,Kd(s,r),s.subtreeFlags=0,r=u,u=s.child;u!==null;)zv(u,r),u=u.sibling;return P(yn,yn.current&1|2),wt&&Kr(s,h.treeForkCount),s.child}r=r.sibling}h.tail!==null&&je()>Qd&&(s.flags|=128,x=!0,Rc(h,!1),s.lanes=4194304)}else{if(!x)if(r=Dd(w),r!==null){if(s.flags|=128,x=!0,r=r.updateQueue,s.updateQueue=r,Kd(s,r),Rc(h,!0),h.tail===null&&h.tailMode==="hidden"&&!w.alternate&&!wt)return Xt(s),null}else 2*je()-h.renderingStartTime>Qd&&u!==536870912&&(s.flags|=128,x=!0,Rc(h,!1),s.lanes=4194304);h.isBackwards?(w.sibling=s.child,s.child=w):(r=h.last,r!==null?r.sibling=w:s.child=w,h.last=w)}return h.tail!==null?(r=h.tail,h.rendering=r,h.tail=r.sibling,h.renderingStartTime=je(),r.sibling=null,u=yn.current,P(yn,x?u&1|2:u&1),wt&&Kr(s,h.treeForkCount),r):(Xt(s),null);case 22:case 23:return xi(s),am(),h=s.memoizedState!==null,r!==null?r.memoizedState!==null!==h&&(s.flags|=8192):h&&(s.flags|=8192),h?(u&536870912)!==0&&(s.flags&128)===0&&(Xt(s),s.subtreeFlags&6&&(s.flags|=8192)):Xt(s),u=s.updateQueue,u!==null&&Kd(s,u.retryQueue),u=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),h=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),h!==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 lM(r,s){switch(Hh(s),s.tag){case 1:return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return Vr(vn),ve(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 26:case 27:case 5:return J(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(yn),null;case 4:return ve(),null;case 10:return Vr(s.type),null;case 22:case 23:return xi(s),am(),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 uw(r,s){switch(Hh(s),s.tag){case 3:Vr(vn),ve();break;case 26:case 27:case 5:J(s);break;case 4:ve();break;case 31:s.memoizedState!==null&&xi(s);break;case 13:xi(s);break;case 19:V(yn);break;case 10:Vr(s.type);break;case 22:case 23:xi(s),am(),r!==null&&V(Ps);break;case 24:Vr(vn)}}function Lc(r,s){try{var u=s.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var x=h.next;u=x;do{if((u.tag&r)===r){h=void 0;var w=u.create,A=u.inst;h=w(),A.destroy=h}u=u.next}while(u!==x)}}catch($){It(s,s.return,$)}}function Ua(r,s,u){try{var h=s.updateQueue,x=h!==null?h.lastEffect:null;if(x!==null){var w=x.next;h=w;do{if((h.tag&r)===r){var A=h.inst,$=A.destroy;if($!==void 0){A.destroy=void 0,x=s;var Q=u,ae=$;try{ae()}catch(he){It(x,Q,he)}}}h=h.next}while(h!==w)}}catch(he){It(s,s.return,he)}}function dw(r){var s=r.updateQueue;if(s!==null){var u=r.stateNode;try{t0(s,u)}catch(h){It(r,r.return,h)}}}function fw(r,s,u){u.props=qs(r.type,r.memoizedProps),u.state=r.memoizedState;try{u.componentWillUnmount()}catch(h){It(r,s,h)}}function Ic(r,s){try{var u=r.ref;if(u!==null){switch(r.tag){case 26:case 27:case 5:var h=r.stateNode;break;case 30:h=r.stateNode;break;default:h=r.stateNode}typeof u=="function"?r.refCleanup=u(h):u.current=h}}catch(x){It(r,s,x)}}function Er(r,s){var u=r.ref,h=r.refCleanup;if(u!==null)if(typeof h=="function")try{h()}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 pw(r){var s=r.type,u=r.memoizedProps,h=r.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(x){It(r,r.return,x)}}function zm(r,s,u){try{var h=r.stateNode;AM(h,r.type,u,s),h[Tn]=s}catch(x){It(r,r.return,x)}}function hw(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Ya(r.type)||r.tag===4}function Pm(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||hw(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 Bm(r,s,u){var h=r.tag;if(h===5||h===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=De));else if(h!==4&&(h===27&&Ya(r.type)&&(u=r.stateNode,s=null),r=r.child,r!==null))for(Bm(r,s,u),r=r.sibling;r!==null;)Bm(r,s,u),r=r.sibling}function Gd(r,s,u){var h=r.tag;if(h===5||h===6)r=r.stateNode,s?u.insertBefore(r,s):u.appendChild(r);else if(h!==4&&(h===27&&Ya(r.type)&&(u=r.stateNode),r=r.child,r!==null))for(Gd(r,s,u),r=r.sibling;r!==null;)Gd(r,s,u),r=r.sibling}function mw(r){var s=r.stateNode,u=r.memoizedProps;try{for(var h=r.type,x=s.attributes;x.length;)s.removeAttributeNode(x[0]);Bn(s,h,u),s[an]=r,s[Tn]=u}catch(w){It(r,r.return,w)}}var Zr=!1,En=!1,$m=!1,gw=typeof WeakSet=="function"?WeakSet:Set,Dn=null;function oM(r,s){if(r=r.containerInfo,lg=hf,r=Cv(r),Oh(r)){if("selectionStart"in r)var u={start:r.selectionStart,end:r.selectionEnd};else e:{u=(u=r.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var x=h.anchorOffset,w=h.focusNode;h=h.focusOffset;try{u.nodeType,w.nodeType}catch{u=null;break e}var A=0,$=-1,Q=-1,ae=0,he=0,Ee=r,oe=null;t:for(;;){for(var fe;Ee!==u||x!==0&&Ee.nodeType!==3||($=A+x),Ee!==w||h!==0&&Ee.nodeType!==3||(Q=A+h),Ee.nodeType===3&&(A+=Ee.nodeValue.length),(fe=Ee.firstChild)!==null;)oe=Ee,Ee=fe;for(;;){if(Ee===r)break t;if(oe===u&&++ae===x&&($=A),oe===w&&++he===h&&(Q=A),(fe=Ee.nextSibling)!==null)break;Ee=oe,oe=Ee.parentNode}Ee=fe}u=$===-1||Q===-1?null:{start:$,end:Q}}else u=null}u=u||{start:0,end:0}}else u=null;for(og={focusedElem:r,selectionRange:u},hf=!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,h=u.stateNode;try{var Be=qs(u.type,x);r=h.getSnapshotBeforeUpdate(Be,w),h.__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)dg(r);else if(u===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":dg(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 yw(r,s,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:ea(r,u),h&4&&Lc(5,u);break;case 1:if(ea(r,u),h&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)}}h&64&&dw(u),h&512&&Ic(u,u.return);break;case 3:if(ea(r,u),h&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{t0(r,s)}catch(A){It(u,u.return,A)}}break;case 27:s===null&&h&4&&mw(u);case 26:case 5:ea(r,u),s===null&&h&4&&pw(u),h&512&&Ic(u,u.return);break;case 12:ea(r,u);break;case 31:ea(r,u),h&4&&vw(r,u);break;case 13:ea(r,u),h&4&&ww(r,u),h&64&&(r=u.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(u=yM.bind(null,u),zM(r,u))));break;case 22:if(h=u.memoizedState!==null||Zr,!h){s=s!==null&&s.memoizedState!==null||En,x=Zr;var w=En;Zr=h,(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 bw(r){var s=r.alternate;s!==null&&(r.alternate=null,bw(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;)xw(r,s,u),u=u.sibling}function xw(r,s,u){if(Mt&&typeof Mt.onCommitFiberUnmount=="function")try{Mt.onCommitFiberUnmount(dn,u)}catch{}switch(u.tag){case 26:En||Er(u,s),Jr(r,s,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:En||Er(u,s);var h=Zt,x=ri;Ya(u.type)&&(Zt=u.stateNode,ri=!1),Jr(r,s,u),Kc(u.stateNode),Zt=h,ri=x;break;case 5:En||Er(u,s);case 6:if(h=Zt,x=ri,Zt=null,Jr(r,s,u),Zt=h,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,d1(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,u.stateNode),ao(r)):d1(Zt,u.stateNode));break;case 4:h=Zt,x=ri,Zt=u.stateNode.containerInfo,ri=!0,Jr(r,s,u),Zt=h,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||(Er(u,s),h=u.stateNode,typeof h.componentWillUnmount=="function"&&fw(u,s,h)),Jr(r,s,u);break;case 21:Jr(r,s,u);break;case 22:En=(h=En)||u.memoizedState!==null,Jr(r,s,u),En=h;break;default:Jr(r,s,u)}}function vw(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 ww(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 cM(r){switch(r.tag){case 31:case 13:case 19:var s=r.stateNode;return s===null&&(s=r.stateNode=new gw),s;case 22:return r=r.stateNode,s=r._retryCache,s===null&&(s=r._retryCache=new gw),s;default:throw Error(i(435,r.tag))}}function Vd(r,s){var u=cM(r);s.forEach(function(h){if(!u.has(h)){u.add(h);var x=bM.bind(null,r,h);h.then(x,x)}})}function ai(r,s){var u=s.deletions;if(u!==null)for(var h=0;h<u.length;h++){var x=u[h],w=r,A=s,$=A;e:for(;$!==null;){switch($.tag){case 27:if(Ya($.type)){Zt=$.stateNode,ri=!1;break e}break;case 5:Zt=$.stateNode,ri=!1;break e;case 3:case 4:Zt=$.stateNode.containerInfo,ri=!0;break e}$=$.return}if(Zt===null)throw Error(i(160));xw(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;)kw(s,r),s=s.sibling}var ir=null;function kw(r,s){var u=r.alternate,h=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:ai(s,r),si(r),h&4&&(Ua(3,r,r.return),Lc(3,r),Ua(5,r,r.return));break;case 1:ai(s,r),si(r),h&512&&(En||u===null||Er(u,u.return)),h&64&&Zr&&(r=r.updateQueue,r!==null&&(h=r.callbacks,h!==null&&(u=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=u===null?h:u.concat(h))));break;case 26:var x=ir;if(ai(s,r),si(r),h&512&&(En||u===null||Er(u,u.return)),h&4){var w=u!==null?u.memoizedState:null;if(h=r.memoizedState,u===null)if(h===null)if(r.stateNode===null){e:{h=r.type,u=r.memoizedProps,x=x.ownerDocument||x;t:switch(h){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(h),x.head.insertBefore(w,x.querySelector("head > title"))),Bn(w,h,u),w[an]=r,fn(w),h=w;break e;case"link":var A=k1("link","href",x).get(h+(u.href||""));if(A){for(var $=0;$<A.length;$++)if(w=A[$],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($,1);break t}}w=x.createElement(h),Bn(w,h,u),x.head.appendChild(w);break;case"meta":if(A=k1("meta","content",x).get(h+(u.content||""))){for($=0;$<A.length;$++)if(w=A[$],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($,1);break t}}w=x.createElement(h),Bn(w,h,u),x.head.appendChild(w);break;default:throw Error(i(468,h))}w[an]=r,fn(w),h=w}r.stateNode=h}else E1(x,r.type,r.stateNode);else r.stateNode=w1(x,h,r.memoizedProps);else w!==h?(w===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):w.count--,h===null?E1(x,r.type,r.stateNode):w1(x,h,r.memoizedProps)):h===null&&r.stateNode!==null&&zm(r,r.memoizedProps,u.memoizedProps)}break;case 27:ai(s,r),si(r),h&512&&(En||u===null||Er(u,u.return)),u!==null&&h&4&&zm(r,r.memoizedProps,u.memoizedProps);break;case 5:if(ai(s,r),si(r),h&512&&(En||u===null||Er(u,u.return)),r.flags&32){x=r.stateNode;try{nt(x,"")}catch(Be){It(r,r.return,Be)}}h&4&&r.stateNode!=null&&(x=r.memoizedProps,zm(r,x,u!==null?u.memoizedProps:x)),h&1024&&($m=!0);break;case 6:if(ai(s,r),si(r),h&4){if(r.stateNode===null)throw Error(i(162));h=r.memoizedProps,u=r.stateNode;try{u.nodeValue=h}catch(Be){It(r,r.return,Be)}}break;case 3:if(uf=null,x=ir,ir=of(s.containerInfo),ai(s,r),ir=x,si(r),h&4&&u!==null&&u.memoizedState.isDehydrated)try{ao(s.containerInfo)}catch(Be){It(r,r.return,Be)}$m&&($m=!1,Ew(r));break;case 4:h=ir,ir=of(r.stateNode.containerInfo),ai(s,r),si(r),ir=h;break;case 12:ai(s,r),si(r);break;case 31:ai(s,r),si(r),h&4&&(h=r.updateQueue,h!==null&&(r.updateQueue=null,Vd(r,h)));break;case 13:ai(s,r),si(r),r.child.flags&8192&&r.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Wd=je()),h&4&&(h=r.updateQueue,h!==null&&(r.updateQueue=null,Vd(r,h)));break;case 22:x=r.memoizedState!==null;var Q=u!==null&&u.memoizedState!==null,ae=Zr,he=En;if(Zr=ae||x,En=he||Q,ai(s,r),En=he,Zr=ae,si(r),h&8192)e:for(s=r.stateNode,s._visibility=x?s._visibility&-2:s._visibility|1,x&&(u===null||Q||Zr||En||Hs(r)),u=null,s=r;;){if(s.tag===5||s.tag===26){if(u===null){Q=u=s;try{if(w=Q.stateNode,x)A=w.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{$=Q.stateNode;var Ee=Q.memoizedProps.style,oe=Ee!=null&&Ee.hasOwnProperty("display")?Ee.display:null;$.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(Be){It(Q,Q.return,Be)}}}else if(s.tag===6){if(u===null){Q=s;try{Q.stateNode.nodeValue=x?"":Q.memoizedProps}catch(Be){It(Q,Q.return,Be)}}}else if(s.tag===18){if(u===null){Q=s;try{var fe=Q.stateNode;x?f1(fe,!0):f1(Q.stateNode,!1)}catch(Be){It(Q,Q.return,Be)}}}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}h&4&&(h=r.updateQueue,h!==null&&(u=h.retryQueue,u!==null&&(h.retryQueue=null,Vd(r,u))));break;case 19:ai(s,r),si(r),h&4&&(h=r.updateQueue,h!==null&&(r.updateQueue=null,Vd(r,h)));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,h=r.return;h!==null;){if(hw(h)){u=h;break}h=h.return}if(u==null)throw Error(i(160));switch(u.tag){case 27:var x=u.stateNode,w=Pm(r);Gd(r,w,x);break;case 5:var A=u.stateNode;u.flags&32&&(nt(A,""),u.flags&=-33);var $=Pm(r);Gd(r,$,A);break;case 3:case 4:var Q=u.stateNode.containerInfo,ae=Pm(r);Bm(r,ae,Q);break;default:throw Error(i(161))}}catch(he){It(r,r.return,he)}r.flags&=-3}s&4096&&(r.flags&=-4097)}function Ew(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var s=r;Ew(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;)yw(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:Er(s,s.return);var u=s.stateNode;typeof u.componentWillUnmount=="function"&&fw(s,s.return,u),Hs(s);break;case 27:Kc(s.stateNode);case 26:case 5:Er(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 h=s.alternate,x=r,w=s,A=w.flags;switch(w.tag){case 0:case 11:case 15:ta(x,w,u),Lc(4,w);break;case 1:if(ta(x,w,u),h=w,x=h.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(ae){It(h,h.return,ae)}if(h=w,x=h.updateQueue,x!==null){var $=h.stateNode;try{var Q=x.shared.hiddenCallbacks;if(Q!==null)for(x.shared.hiddenCallbacks=null,x=0;x<Q.length;x++)e0(Q[x],$)}catch(ae){It(h,h.return,ae)}}u&&A&64&&dw(w),Ic(w,w.return);break;case 27:mw(w);case 26:case 5:ta(x,w,u),u&&h===null&&A&4&&pw(w),Ic(w,w.return);break;case 12:ta(x,w,u);break;case 31:ta(x,w,u),u&&A&4&&vw(x,w);break;case 13:ta(x,w,u),u&&A&4&&ww(x,w);break;case 22:w.memoizedState===null&&ta(x,w,u),Ic(w,w.return);break;case 30:break;default:ta(x,w,u)}s=s.sibling}}function Um(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&&kc(u))}function Fm(r,s){r=null,s.alternate!==null&&(r=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==r&&(s.refCount++,r!=null&&kc(r))}function rr(r,s,u,h){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)Sw(r,s,u,h),s=s.sibling}function Sw(r,s,u,h){var x=s.flags;switch(s.tag){case 0:case 11:case 15:rr(r,s,u,h),x&2048&&Lc(9,s);break;case 1:rr(r,s,u,h);break;case 3:rr(r,s,u,h),x&2048&&(r=null,s.alternate!==null&&(r=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==r&&(s.refCount++,r!=null&&kc(r)));break;case 12:if(x&2048){rr(r,s,u,h),r=s.stateNode;try{var w=s.memoizedProps,A=w.id,$=w.onPostCommit;typeof $=="function"&&$(A,s.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(Q){It(s,s.return,Q)}}else rr(r,s,u,h);break;case 31:rr(r,s,u,h);break;case 13:rr(r,s,u,h);break;case 23:break;case 22:w=s.stateNode,A=s.alternate,s.memoizedState!==null?w._visibility&2?rr(r,s,u,h):zc(r,s):w._visibility&2?rr(r,s,u,h):(w._visibility|=2,Yl(r,s,u,h,(s.subtreeFlags&10256)!==0||!1)),x&2048&&Um(A,s);break;case 24:rr(r,s,u,h),x&2048&&Fm(s.alternate,s);break;default:rr(r,s,u,h)}}function Yl(r,s,u,h,x){for(x=x&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var w=r,A=s,$=u,Q=h,ae=A.flags;switch(A.tag){case 0:case 11:case 15:Yl(w,A,$,Q,x),Lc(8,A);break;case 23:break;case 22:var he=A.stateNode;A.memoizedState!==null?he._visibility&2?Yl(w,A,$,Q,x):zc(w,A):(he._visibility|=2,Yl(w,A,$,Q,x)),x&&ae&2048&&Um(A.alternate,A);break;case 24:Yl(w,A,$,Q,x),x&&ae&2048&&Fm(A.alternate,A);break;default:Yl(w,A,$,Q,x)}s=s.sibling}}function zc(r,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var u=r,h=s,x=h.flags;switch(h.tag){case 22:zc(u,h),x&2048&&Um(h.alternate,h);break;case 24:zc(u,h),x&2048&&Fm(h.alternate,h);break;default:zc(u,h)}s=s.sibling}}var Pc=8192;function Wl(r,s,u){if(r.subtreeFlags&Pc)for(r=r.child;r!==null;)Nw(r,s,u),r=r.sibling}function Nw(r,s,u){switch(r.tag){case 26:Wl(r,s,u),r.flags&Pc&&r.memoizedState!==null&&WM(u,ir,r.memoizedState,r.memoizedProps);break;case 5:Wl(r,s,u);break;case 3:case 4:var h=ir;ir=of(r.stateNode.containerInfo),Wl(r,s,u),ir=h;break;case 22:r.memoizedState===null&&(h=r.alternate,h!==null&&h.memoizedState!==null?(h=Pc,Pc=16777216,Wl(r,s,u),Pc=h):Wl(r,s,u));break;default:Wl(r,s,u)}}function _w(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 Bc(r){var s=r.deletions;if((r.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var h=s[u];Dn=h,Cw(h,r)}_w(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)jw(r),r=r.sibling}function jw(r){switch(r.tag){case 0:case 11:case 15:Bc(r),r.flags&2048&&Ua(9,r,r.return);break;case 3:Bc(r);break;case 12:Bc(r);break;case 22:var s=r.stateNode;r.memoizedState!==null&&s._visibility&2&&(r.return===null||r.return.tag!==13)?(s._visibility&=-3,Yd(r)):Bc(r);break;default:Bc(r)}}function Yd(r){var s=r.deletions;if((r.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var h=s[u];Dn=h,Cw(h,r)}_w(r)}for(r=r.child;r!==null;){switch(s=r,s.tag){case 0:case 11:case 15:Ua(8,s,s.return),Yd(s);break;case 22:u=s.stateNode,u._visibility&2&&(u._visibility&=-3,Yd(s));break;default:Yd(s)}r=r.sibling}}function Cw(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 h=u.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:kc(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,Dn=h;else e:for(u=r;Dn!==null;){h=Dn;var x=h.sibling,w=h.return;if(bw(h),h===u){Dn=null;break e}if(x!==null){x.return=w,Dn=x;break e}Dn=w}}}var uM={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}},dM=typeof WeakMap=="function"?WeakMap:Map,Tt=0,Ht=null,ht=null,xt=0,Lt=0,vi=null,Fa=!1,Ql=!1,qm=!1,na=0,hn=0,qa=0,Ks=0,Hm=0,wi=0,Xl=0,$c=null,li=null,Km=!1,Wd=0,Aw=0,Qd=1/0,Xd=null,Ha=null,Cn=0,Ka=null,Zl=null,ia=0,Gm=0,Vm=null,Tw=null,Uc=0,Ym=null;function ki(){return(Tt&2)!==0&&xt!==0?xt&-xt:I.T!==null?eg():ka()}function Mw(){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===Ht&&(Lt===2||Lt===9)||r.cancelPendingCommit!==null)&&(Jl(r,0),Ga(r,xt,wi,!1)),Ot(r,u),((Tt&2)===0||r!==Ht)&&(r===Ht&&((Tt&2)===0&&(Ks|=u),hn===4&&Ga(r,xt,wi,!1)),Sr(r))}function Dw(r,s,u){if((Tt&6)!==0)throw Error(i(327));var h=!u&&(s&127)===0&&(s&r.expiredLanes)===0||me(r,s),x=h?hM(r,s):Qm(r,s,!0),w=h;do{if(x===0){Ql&&!h&&Ga(r,s,0,!1);break}else{if(u=r.current.alternate,w&&!fM(u)){x=Qm(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 $=r;x=$c;var Q=$.current.memoizedState.isDehydrated;if(Q&&(Jl($,A).flags|=256),A=Qm($,A,!1),A!==2){if(qm&&!Q){$.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(h=r,w=x,w){case 0:case 1:throw Error(i(345));case 4:if((s&4194048)!==s)break;case 6:Ga(h,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=Wd+300-je(),10<x)){if(Ga(h,s,wi,!Fa),Z(h,0,!0)!==0)break e;ia=s,h.timeoutHandle=c1(Ow.bind(null,h,u,li,Xd,Km,s,wi,Ks,Xl,Fa,w,"Throttled",-0,0),x);break e}Ow(h,u,li,Xd,Km,s,wi,Ks,Xl,Fa,w,null,-0,0)}}break}while(!0);Sr(r)}function Ow(r,s,u,h,x,w,A,$,Q,ae,he,Ee,oe,fe){if(r.timeoutHandle=-1,Ee=s.subtreeFlags,Ee&8192||(Ee&16785408)===16785408){Ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:De},Nw(s,w,Ee);var Be=(w&62914560)===w?Wd-je():(w&4194048)===w?Aw-je():0;if(Be=QM(Ee,Be),Be!==null){ia=w,r.cancelPendingCommit=Be(Uw.bind(null,r,s,w,u,h,x,A,$,Q,he,Ee,null,oe,fe)),Ga(r,w,A,!ae);return}}Uw(r,s,w,u,h,x,A,$,Q)}function fM(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 h=0;h<u.length;h++){var x=u[h],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,h){s&=~Hm,s&=~Ks,r.suspendedLanes|=s,r.pingedLanes&=~s,h&&(r.warmLanes|=s),h=r.expirationTimes;for(var x=s;0<x;){var w=31-yt(x),A=1<<w;h[w]=-1,x&=~A}u!==0&&ze(r,u,s)}function Zd(){return(Tt&6)===0?(Fc(0),!1):!0}function Wm(){if(ht!==null){if(Lt===0)var r=ht.return;else r=ht,Gr=Is=null,dm(r),ql=null,Sc=0,r=ht;for(;r!==null;)uw(r.alternate,r),r=r.return;ht=null}}function Jl(r,s){var u=r.timeoutHandle;u!==-1&&(r.timeoutHandle=-1,DM(u)),u=r.cancelPendingCommit,u!==null&&(r.cancelPendingCommit=null,u()),ia=0,Wm(),Ht=r,ht=u=Hr(r.current,null),xt=s,Lt=0,vi=null,Fa=!1,Ql=me(r,s),qm=!1,Xl=wi=Hm=Ks=qa=hn=0,li=$c=null,Km=!1,(s&8)!==0&&(s|=s&32);var h=r.entangledLanes;if(h!==0)for(r=r.entanglements,h&=s;0<h;){var x=31-yt(h),w=1<<x;s|=r[x],h&=~w}return na=s,xd(),u}function Rw(r,s){ot=null,I.H=Dc,s===Fl||s===jd?(s=Qv(),Lt=3):s===Jh?(s=Qv(),Lt=4):Lt=s===jm?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,vi=s,ht===null&&(hn=1,Ud(r,Ri(s,r.current)))}function Lw(){var r=bi.current;return r===null?!0:(xt&4194048)===xt?Pi===null:(xt&62914560)===xt||(xt&536870912)!==0?r===Pi:!1}function Iw(){var r=I.H;return I.H=Dc,r===null?Dc:r}function zw(){var r=I.A;return I.A=uM,r}function Jd(){hn=4,Fa||(xt&4194048)!==xt&&bi.current!==null||(Ql=!0),(qa&134217727)===0&&(Ks&134217727)===0||Ht===null||Ga(Ht,xt,wi,!1)}function Qm(r,s,u){var h=Tt;Tt|=2;var x=Iw(),w=zw();(Ht!==r||xt!==s)&&(Xd=null,Jl(r,s)),s=!1;var A=hn;e:do try{if(Lt!==0&&ht!==null){var $=ht,Q=vi;switch(Lt){case 8:Wm(),A=6;break e;case 3:case 2:case 9:case 6:bi.current===null&&(s=!0);var ae=Lt;if(Lt=0,vi=null,eo(r,$,Q,ae),u&&Ql){A=0;break e}break;default:ae=Lt,Lt=0,vi=null,eo(r,$,Q,ae)}}pM(),A=hn;break}catch(he){Rw(r,he)}while(!0);return s&&r.shellSuspendCounter++,Gr=Is=null,Tt=h,I.H=x,I.A=w,ht===null&&(Ht=null,xt=0,xd()),A}function pM(){for(;ht!==null;)Pw(ht)}function hM(r,s){var u=Tt;Tt|=2;var h=Iw(),x=zw();Ht!==r||xt!==s?(Xd=null,Qd=je()+500,Jl(r,s)):Ql=me(r,s);e:do try{if(Lt!==0&&ht!==null){s=ht;var w=vi;t:switch(Lt){case 1:Lt=0,vi=null,eo(r,s,w,1);break;case 2:case 9:if(Yv(w)){Lt=0,vi=null,Bw(s);break}s=function(){Lt!==2&&Lt!==9||Ht!==r||(Lt=7),Sr(r)},w.then(s,s);break e;case 3:Lt=7;break e;case 4:Lt=5;break e;case 7:Yv(w)?(Lt=0,vi=null,Bw(s)):(Lt=0,vi=null,eo(r,s,w,7));break;case 5:var A=null;switch(ht.tag){case 26:A=ht.memoizedState;case 5:case 27:var $=ht;if(A?S1(A):$.stateNode.complete){Lt=0,vi=null;var Q=$.sibling;if(Q!==null)ht=Q;else{var ae=$.return;ae!==null?(ht=ae,ef(ae)):ht=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:Wm(),hn=6;break e;default:throw Error(i(462))}}mM();break}catch(he){Rw(r,he)}while(!0);return Gr=Is=null,I.H=h,I.A=x,Tt=u,ht!==null?0:(Ht=null,xt=0,xd(),hn)}function mM(){for(;ht!==null&&!pe();)Pw(ht)}function Pw(r){var s=ow(r.alternate,r,na);r.memoizedProps=r.pendingProps,s===null?ef(r):ht=s}function Bw(r){var s=r,u=s.alternate;switch(s.tag){case 15:case 0:s=nw(u,s,s.pendingProps,s.type,void 0,xt);break;case 11:s=nw(u,s,s.pendingProps,s.type.render,s.ref,xt);break;case 5:dm(s);default:uw(u,s),s=ht=zv(s,na),s=ow(u,s,na)}r.memoizedProps=r.pendingProps,s===null?ef(r):ht=s}function eo(r,s,u,h){Gr=Is=null,dm(s),ql=null,Sc=0;var x=s.return;try{if(iM(r,x,s,u,xt)){hn=1,Ud(r,Ri(u,r.current)),ht=null;return}}catch(w){if(x!==null)throw ht=x,w;hn=1,Ud(r,Ri(u,r.current)),ht=null;return}s.flags&32768?(wt||h===1?r=!0:Ql||(xt&536870912)!==0?r=!1:(Fa=r=!0,(h===2||h===9||h===3||h===6)&&(h=bi.current,h!==null&&h.tag===13&&(h.flags|=16384))),$w(s,r)):ef(s)}function ef(r){var s=r;do{if((s.flags&32768)!==0){$w(s,Fa);return}r=s.return;var u=sM(s.alternate,s,na);if(u!==null){ht=u;return}if(s=s.sibling,s!==null){ht=s;return}ht=s=r}while(s!==null);hn===0&&(hn=5)}function $w(r,s){do{var u=lM(r.alternate,r);if(u!==null){u.flags&=32767,ht=u;return}if(u=r.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!s&&(r=r.sibling,r!==null)){ht=r;return}ht=r=u}while(r!==null);hn=6,ht=null}function Uw(r,s,u,h,x,w,A,$,Q){r.cancelPendingCommit=null;do tf();while(Cn!==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|=Ph,$e(r,u,w,A,$,Q),r===Ht&&(ht=Ht=null,xt=0),Zl=s,Ka=r,ia=u,Gm=w,Vm=x,Tw=h,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,xM(Le,function(){return Gw(),null})):(r.callbackNode=null,r.callbackPriority=0),h=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||h){h=I.T,I.T=null,x=H.p,H.p=2,A=Tt,Tt|=4;try{oM(r,s,u)}finally{Tt=A,H.p=x,I.T=h}}Cn=1,Fw(),qw(),Hw()}}function Fw(){if(Cn===1){Cn=0;var r=Ka,s=Zl,u=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||u){u=I.T,I.T=null;var h=H.p;H.p=2;var x=Tt;Tt|=4;try{kw(s,r);var w=og,A=Cv(r.containerInfo),$=w.focusedElem,Q=w.selectionRange;if(A!==$&&$&&$.ownerDocument&&jv($.ownerDocument.documentElement,$)){if(Q!==null&&Oh($)){var ae=Q.start,he=Q.end;if(he===void 0&&(he=ae),"selectionStart"in $)$.selectionStart=ae,$.selectionEnd=Math.min(he,$.value.length);else{var Ee=$.ownerDocument||document,oe=Ee&&Ee.defaultView||window;if(oe.getSelection){var fe=oe.getSelection(),Be=$.textContent.length,tt=Math.min(Q.start,Be),$t=Q.end===void 0?tt:Math.min(Q.end,Be);!fe.extend&&tt>$t&&(A=$t,$t=tt,tt=A);var ne=_v($,tt),ee=_v($,$t);if(ne&&ee&&(fe.rangeCount!==1||fe.anchorNode!==ne.node||fe.anchorOffset!==ne.offset||fe.focusNode!==ee.node||fe.focusOffset!==ee.offset)){var ie=Ee.createRange();ie.setStart(ne.node,ne.offset),fe.removeAllRanges(),tt>$t?(fe.addRange(ie),fe.extend(ee.node,ee.offset)):(ie.setEnd(ee.node,ee.offset),fe.addRange(ie))}}}}for(Ee=[],fe=$;fe=fe.parentNode;)fe.nodeType===1&&Ee.push({element:fe,left:fe.scrollLeft,top:fe.scrollTop});for(typeof $.focus=="function"&&$.focus(),$=0;$<Ee.length;$++){var ye=Ee[$];ye.element.scrollLeft=ye.left,ye.element.scrollTop=ye.top}}hf=!!lg,og=lg=null}finally{Tt=x,H.p=h,I.T=u}}r.current=s,Cn=2}}function qw(){if(Cn===2){Cn=0;var r=Ka,s=Zl,u=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||u){u=I.T,I.T=null;var h=H.p;H.p=2;var x=Tt;Tt|=4;try{yw(r,s.alternate,s)}finally{Tt=x,H.p=h,I.T=u}}Cn=3}}function Hw(){if(Cn===4||Cn===3){Cn=0,Se();var r=Ka,s=Zl,u=ia,h=Tw;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?Cn=5:(Cn=0,Zl=Ka=null,Kw(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(h!==null){s=I.T,x=H.p,H.p=2,I.T=null;try{for(var w=r.onRecoverableError,A=0;A<h.length;A++){var $=h[A];w($.value,{componentStack:$.stack})}}finally{I.T=s,H.p=x}}(ia&3)!==0&&tf(),Sr(r),x=r.pendingLanes,(u&261930)!==0&&(x&42)!==0?r===Ym?Uc++:(Uc=0,Ym=r):Uc=0,Fc(0)}}function Kw(r,s){(r.pooledCacheLanes&=s)===0&&(s=r.pooledCache,s!=null&&(r.pooledCache=null,kc(s)))}function tf(){return Fw(),qw(),Hw(),Gw()}function Gw(){if(Cn!==5)return!1;var r=Ka,s=Gm;Gm=0;var u=Qi(ia),h=I.T,x=H.p;try{H.p=32>u?32:u,I.T=null,u=Vm,Vm=null;var w=Ka,A=ia;if(Cn=0,Zl=Ka=null,ia=0,(Tt&6)!==0)throw Error(i(331));var $=Tt;if(Tt|=4,jw(w.current),Sw(w,w.current,A,u),Tt=$,Fc(0,!1),Mt&&typeof Mt.onPostCommitFiberRoot=="function")try{Mt.onPostCommitFiberRoot(dn,w)}catch{}return!0}finally{H.p=x,I.T=h,Kw(r,s)}}function Vw(r,s,u){s=Ri(u,s),s=_m(r.stateNode,s,2),r=Pa(r,s,2),r!==null&&(Ot(r,2),Sr(r))}function It(r,s,u){if(r.tag===3)Vw(r,r,u);else for(;s!==null;){if(s.tag===3){Vw(s,r,u);break}else if(s.tag===1){var h=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Ha===null||!Ha.has(h))){r=Ri(u,r),u=Y0(2),h=Pa(s,u,2),h!==null&&(W0(u,h,s,r),Ot(h,2),Sr(h));break}}s=s.return}}function Xm(r,s,u){var h=r.pingCache;if(h===null){h=r.pingCache=new dM;var x=new Set;h.set(s,x)}else x=h.get(s),x===void 0&&(x=new Set,h.set(s,x));x.has(u)||(qm=!0,x.add(u),r=gM.bind(null,r,s,u),s.then(r,r))}function gM(r,s,u){var h=r.pingCache;h!==null&&h.delete(s),r.pingedLanes|=r.suspendedLanes&u,r.warmLanes&=~u,Ht===r&&(xt&u)===u&&(hn===4||hn===3&&(xt&62914560)===xt&&300>je()-Wd?(Tt&2)===0&&Jl(r,0):Hm|=u,Xl===xt&&(Xl=0)),Sr(r)}function Yw(r,s){s===0&&(s=it()),r=Os(r,s),r!==null&&(Ot(r,s),Sr(r))}function yM(r){var s=r.memoizedState,u=0;s!==null&&(u=s.retryLane),Yw(r,u)}function bM(r,s){var u=0;switch(r.tag){case 31:case 13:var h=r.stateNode,x=r.memoizedState;x!==null&&(u=x.retryLane);break;case 19:h=r.stateNode;break;case 22:h=r.stateNode._retryCache;break;default:throw Error(i(314))}h!==null&&h.delete(s),Yw(r,u)}function xM(r,s){return be(r,s)}var nf=null,to=null,Zm=!1,rf=!1,Jm=!1,Va=0;function Sr(r){r!==to&&r.next===null&&(to===null?nf=to=r:to=to.next=r),rf=!0,Zm||(Zm=!0,wM())}function Fc(r,s){if(!Jm&&rf){Jm=!0;do for(var u=!1,h=nf;h!==null;){if(r!==0){var x=h.pendingLanes;if(x===0)var w=0;else{var A=h.suspendedLanes,$=h.pingedLanes;w=(1<<31-yt(42|r)+1)-1,w&=x&~(A&~$),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(u=!0,Zw(h,w))}else w=xt,w=Z(h,h===Ht?w:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(w&3)===0||me(h,w)||(u=!0,Zw(h,w));h=h.next}while(u);Jm=!1}}function vM(){Ww()}function Ww(){rf=Zm=!1;var r=0;Va!==0&&MM()&&(r=Va);for(var s=je(),u=null,h=nf;h!==null;){var x=h.next,w=Qw(h,s);w===0?(h.next=null,u===null?nf=x:u.next=x,x===null&&(to=u)):(u=h,(r!==0||(w&3)!==0)&&(rf=!0)),h=x}Cn!==0&&Cn!==5||Fc(r),Va!==0&&(Va=0)}function Qw(r,s){for(var u=r.suspendedLanes,h=r.pingedLanes,x=r.expirationTimes,w=r.pendingLanes&-62914561;0<w;){var A=31-yt(w),$=1<<A,Q=x[A];Q===-1?(($&u)===0||($&h)!==0)&&(x[A]=Oe($,s)):Q<=s&&(r.expiredLanes|=$),w&=~$}if(s=Ht,u=xt,u=Z(r,r===s?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),h=r.callbackNode,u===0||r===s&&(Lt===2||Lt===9)||r.cancelPendingCommit!==null)return h!==null&&h!==null&&ge(h),r.callbackNode=null,r.callbackPriority=0;if((u&3)===0||me(r,u)){if(s=u&-u,s===r.callbackPriority)return s;switch(h!==null&&ge(h),Qi(u)){case 2:case 8:u=de;break;case 32:u=Le;break;case 268435456:u=rt;break;default:u=Le}return h=Xw.bind(null,r),u=be(u,h),r.callbackPriority=s,r.callbackNode=u,s}return h!==null&&h!==null&&ge(h),r.callbackPriority=2,r.callbackNode=null,2}function Xw(r,s){if(Cn!==0&&Cn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var u=r.callbackNode;if(tf()&&r.callbackNode!==u)return null;var h=xt;return h=Z(r,r===Ht?h:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),h===0?null:(Dw(r,h,s),Qw(r,je()),r.callbackNode!=null&&r.callbackNode===u?Xw.bind(null,r):null)}function Zw(r,s){if(tf())return null;Dw(r,s,!0)}function wM(){OM(function(){(Tt&6)!==0?be(te,vM):Ww()})}function eg(){if(Va===0){var r=$l;r===0&&(r=Pr,Pr<<=1,(Pr&261888)===0&&(Pr=256)),Va=r}return Va}function Jw(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Ta(""+r)}function e1(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 kM(r,s,u,h,x){if(s==="submit"&&u&&u.stateNode===x){var w=Jw((x[Tn]||null).action),A=h.submitter;A&&(s=(s=A[Tn]||null)?Jw(s.formAction):A.getAttribute("formAction"),s!==null&&(w=s,A=null));var $=new md("action","action",null,h,x);r.push({event:$,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(Va!==0){var Q=A?e1(x,A):new FormData(x);vm(u,{pending:!0,data:Q,method:x.method,action:w},null,Q)}}else typeof w=="function"&&($.preventDefault(),Q=A?e1(x,A):new FormData(x),vm(u,{pending:!0,data:Q,method:x.method,action:w},w,Q))},currentTarget:x}]})}}for(var tg=0;tg<zh.length;tg++){var ng=zh[tg],EM=ng.toLowerCase(),SM=ng[0].toUpperCase()+ng.slice(1);nr(EM,"on"+SM)}nr(Mv,"onAnimationEnd"),nr(Dv,"onAnimationIteration"),nr(Ov,"onAnimationStart"),nr("dblclick","onDoubleClick"),nr("focusin","onFocus"),nr("focusout","onBlur"),nr($T,"onTransitionRun"),nr(UT,"onTransitionStart"),nr(FT,"onTransitionCancel"),nr(Rv,"onTransitionEnd"),Ae("onMouseEnter",["mouseout","mouseover"]),Ae("onMouseLeave",["mouseout","mouseover"]),Ae("onPointerEnter",["pointerout","pointerover"]),Ae("onPointerLeave",["pointerout","pointerover"]),er("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),er("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),er("onBeforeInput",["compositionend","keypress","textInput","paste"]),er("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),er("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),er("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qc="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(" "),NM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(qc));function t1(r,s){s=(s&4)!==0;for(var u=0;u<r.length;u++){var h=r[u],x=h.event;h=h.listeners;e:{var w=void 0;if(s)for(var A=h.length-1;0<=A;A--){var $=h[A],Q=$.instance,ae=$.currentTarget;if($=$.listener,Q!==w&&x.isPropagationStopped())break e;w=$,x.currentTarget=ae;try{w(x)}catch(he){bd(he)}x.currentTarget=null,w=Q}else for(A=0;A<h.length;A++){if($=h[A],Q=$.instance,ae=$.currentTarget,$=$.listener,Q!==w&&x.isPropagationStopped())break e;w=$,x.currentTarget=ae;try{w(x)}catch(he){bd(he)}x.currentTarget=null,w=Q}}}}function mt(r,s){var u=s[Sa];u===void 0&&(u=s[Sa]=new Set);var h=r+"__bubble";u.has(h)||(n1(s,r,2,!1),u.add(h))}function ig(r,s,u){var h=0;s&&(h|=4),n1(u,r,h,s)}var af="_reactListening"+Math.random().toString(36).slice(2);function rg(r){if(!r[af]){r[af]=!0,jl.forEach(function(u){u!=="selectionchange"&&(NM.has(u)||ig(u,!1,r),ig(u,!0,r))});var s=r.nodeType===9?r:r.ownerDocument;s===null||s[af]||(s[af]=!0,ig("selectionchange",!1,s))}}function n1(r,s,u,h){switch(M1(s)){case 2:var x=JM;break;case 8:x=eD;break;default:x=xg}u=x.bind(null,s,u,r),x=void 0,!Sh||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(x=!0),h?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 ag(r,s,u,h,x){var w=h;if((s&1)===0&&(s&2)===0&&h!==null)e:for(;;){if(h===null)return;var A=h.tag;if(A===3||A===4){var $=h.stateNode.containerInfo;if($===x)break;if(A===4)for(A=h.return;A!==null;){var Q=A.tag;if((Q===3||Q===4)&&A.stateNode.containerInfo===x)return;A=A.return}for(;$!==null;){if(A=Ln($),A===null)return;if(Q=A.tag,Q===5||Q===6||Q===26||Q===27){h=w=A;continue e}$=$.parentNode}}h=h.return}dd(function(){var ae=w,he=lt(u),Ee=[];e:{var oe=Lv.get(r);if(oe!==void 0){var fe=md,Be=r;switch(r){case"keypress":if(pd(u)===0)break e;case"keydown":case"keyup":fe=bT;break;case"focusin":Be="focus",fe=Ch;break;case"focusout":Be="blur",fe=Ch;break;case"beforeblur":case"afterblur":fe=Ch;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=uv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=sT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=wT;break;case Mv:case Dv:case Ov:fe=cT;break;case Rv:fe=ET;break;case"scroll":case"scrollend":fe=rT;break;case"wheel":fe=NT;break;case"copy":case"cut":case"paste":fe=dT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=fv;break;case"toggle":case"beforetoggle":fe=jT}var tt=(s&4)!==0,$t=!tt&&(r==="scroll"||r==="scrollend"),ne=tt?oe!==null?oe+"Capture":null:oe;tt=[];for(var ee=ae,ie;ee!==null;){var ye=ee;if(ie=ye.stateNode,ye=ye.tag,ye!==5&&ye!==26&&ye!==27||ie===null||ne===null||(ye=dc(ee,ne),ye!=null&&tt.push(Hc(ee,ye,ie))),$t)break;ee=ee.return}0<tt.length&&(oe=new fe(oe,Be,null,u,he),Ee.push({event:oe,listeners:tt}))}}if((s&7)===0){e:{if(oe=r==="mouseover"||r==="pointerover",fe=r==="mouseout"||r==="pointerout",oe&&u!==Fe&&(Be=u.relatedTarget||u.fromElement)&&(Ln(Be)||Be[Xi]))break e;if((fe||oe)&&(oe=he.window===he?he:(oe=he.ownerDocument)?oe.defaultView||oe.parentWindow:window,fe?(Be=u.relatedTarget||u.toElement,fe=ae,Be=Be?Ln(Be):null,Be!==null&&($t=l(Be),tt=Be.tag,Be!==$t||tt!==5&&tt!==27&&tt!==6)&&(Be=null)):(fe=null,Be=ae),fe!==Be)){if(tt=uv,ye="onMouseLeave",ne="onMouseEnter",ee="mouse",(r==="pointerout"||r==="pointerover")&&(tt=fv,ye="onPointerLeave",ne="onPointerEnter",ee="pointer"),$t=fe==null?oe:Ji(fe),ie=Be==null?oe:Ji(Be),oe=new tt(ye,ee+"leave",fe,u,he),oe.target=$t,oe.relatedTarget=ie,ye=null,Ln(he)===ae&&(tt=new tt(ne,ee+"enter",Be,u,he),tt.target=ie,tt.relatedTarget=$t,ye=tt),$t=ye,fe&&Be)t:{for(tt=_M,ne=fe,ee=Be,ie=0,ye=ne;ye;ye=tt(ye))ie++;ye=0;for(var We=ee;We;We=tt(We))ye++;for(;0<ie-ye;)ne=tt(ne),ie--;for(;0<ye-ie;)ee=tt(ee),ye--;for(;ie--;){if(ne===ee||ee!==null&&ne===ee.alternate){tt=ne;break t}ne=tt(ne),ee=tt(ee)}tt=null}else tt=null;fe!==null&&i1(Ee,oe,fe,tt,!1),Be!==null&&$t!==null&&i1(Ee,$t,Be,tt,!0)}}e:{if(oe=ae?Ji(ae):window,fe=oe.nodeName&&oe.nodeName.toLowerCase(),fe==="select"||fe==="input"&&oe.type==="file")var jt=vv;else if(bv(oe))if(wv)jt=zT;else{jt=LT;var qe=RT}else fe=oe.nodeName,!fe||fe.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?ae&&Aa(ae.elementType)&&(jt=vv):jt=IT;if(jt&&(jt=jt(r,ae))){xv(Ee,jt,u,he);break e}qe&&qe(r,oe,ae),r==="focusout"&&ae&&oe.type==="number"&&ae.memoizedProps.value!=null&&Ca(oe,"number",oe.value)}switch(qe=ae?Ji(ae):window,r){case"focusin":(bv(qe)||qe.contentEditable==="true")&&(Dl=qe,Rh=ae,xc=null);break;case"focusout":xc=Rh=Dl=null;break;case"mousedown":Lh=!0;break;case"contextmenu":case"mouseup":case"dragend":Lh=!1,Av(Ee,u,he);break;case"selectionchange":if(BT)break;case"keydown":case"keyup":Av(Ee,u,he)}var ut;if(Th)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?gv(r,u)&&(vt="onCompositionEnd"):r==="keydown"&&u.keyCode===229&&(vt="onCompositionStart");vt&&(pv&&u.locale!=="ko"&&(Ml||vt!=="onCompositionStart"?vt==="onCompositionEnd"&&Ml&&(ut=ov()):(Ma=he,Nh="value"in Ma?Ma.value:Ma.textContent,Ml=!0)),qe=sf(ae,vt),0<qe.length&&(vt=new dv(vt,r,null,u,he),Ee.push({event:vt,listeners:qe}),ut?vt.data=ut:(ut=yv(u),ut!==null&&(vt.data=ut)))),(ut=AT?TT(r,u):MT(r,u))&&(vt=sf(ae,"onBeforeInput"),0<vt.length&&(qe=new dv("onBeforeInput","beforeinput",null,u,he),Ee.push({event:qe,listeners:vt}),qe.data=ut)),kM(Ee,r,ae,u,he)}t1(Ee,s)})}function Hc(r,s,u){return{instance:r,listener:s,currentTarget:u}}function sf(r,s){for(var u=s+"Capture",h=[];r!==null;){var x=r,w=x.stateNode;if(x=x.tag,x!==5&&x!==26&&x!==27||w===null||(x=dc(r,u),x!=null&&h.unshift(Hc(r,x,w)),x=dc(r,s),x!=null&&h.push(Hc(r,x,w))),r.tag===3)return h;r=r.return}return[]}function _M(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function i1(r,s,u,h,x){for(var w=s._reactName,A=[];u!==null&&u!==h;){var $=u,Q=$.alternate,ae=$.stateNode;if($=$.tag,Q!==null&&Q===h)break;$!==5&&$!==26&&$!==27||ae===null||(Q=ae,x?(ae=dc(u,w),ae!=null&&A.unshift(Hc(u,ae,Q))):x||(ae=dc(u,w),ae!=null&&A.push(Hc(u,ae,Q)))),u=u.return}A.length!==0&&r.push({event:s,listeners:A})}var jM=/\r\n?/g,CM=/\u0000|\uFFFD/g;function r1(r){return(typeof r=="string"?r:""+r).replace(jM,`
49
+ `).replace(CM,"")}function a1(r,s){return s=r1(s),r1(r)===s}function Bt(r,s,u,h,x,w){switch(u){case"children":typeof h=="string"?s==="body"||s==="textarea"&&h===""||nt(r,h):(typeof h=="number"||typeof h=="bigint")&&s!=="body"&&nt(r,""+h);break;case"className":Wn(r,"class",h);break;case"tabIndex":Wn(r,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":Wn(r,u,h);break;case"style":Rt(r,h,w);break;case"data":if(s!=="object"){Wn(r,"data",h);break}case"src":case"href":if(h===""&&(s!=="a"||u!=="href")){r.removeAttribute(u);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){r.removeAttribute(u);break}h=Ta(""+h),r.setAttribute(u,h);break;case"action":case"formAction":if(typeof h=="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(h==null||typeof h=="symbol"||typeof h=="boolean"){r.removeAttribute(u);break}h=Ta(""+h),r.setAttribute(u,h);break;case"onClick":h!=null&&(r.onclick=De);break;case"onScroll":h!=null&&mt("scroll",r);break;case"onScrollEnd":h!=null&&mt("scrollend",r);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(i(61));if(u=h.__html,u!=null){if(x.children!=null)throw Error(i(60));r.innerHTML=u}}break;case"multiple":r.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":r.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){r.removeAttribute("xlink:href");break}u=Ta(""+h),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":h!=null&&typeof h!="function"&&typeof h!="symbol"?r.setAttribute(u,""+h):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":h&&typeof h!="function"&&typeof h!="symbol"?r.setAttribute(u,""):r.removeAttribute(u);break;case"capture":case"download":h===!0?r.setAttribute(u,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?r.setAttribute(u,h):r.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?r.setAttribute(u,h):r.removeAttribute(u);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?r.removeAttribute(u):r.setAttribute(u,h);break;case"popover":mt("beforetoggle",r),mt("toggle",r),Mn(r,"popover",h);break;case"xlinkActuate":Fn(r,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":Fn(r,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":Fn(r,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":Fn(r,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":Fn(r,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":Fn(r,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":Fn(r,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":Fn(r,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":Fn(r,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":Mn(r,"is",h);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,h))}}function sg(r,s,u,h,x,w){switch(u){case"style":Rt(r,h,w);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(i(61));if(u=h.__html,u!=null){if(x.children!=null)throw Error(i(60));r.innerHTML=u}}break;case"children":typeof h=="string"?nt(r,h):(typeof h=="number"||typeof h=="bigint")&&nt(r,""+h);break;case"onScroll":h!=null&&mt("scroll",r);break;case"onScrollEnd":h!=null&&mt("scrollend",r);break;case"onClick":h!=null&&(r.onclick=De);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 h=="function")){typeof w!="function"&&w!==null&&(u in r?r[u]=null:r.hasAttribute(u)&&r.removeAttribute(u)),r.addEventListener(s,h,x);break e}u in r?r[u]=h:h===!0?r.setAttribute(u,""):Mn(r,u,h)}}}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 h=!1,x=!1,w;for(w in u)if(u.hasOwnProperty(w)){var A=u[w];if(A!=null)switch(w){case"src":h=!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),h&&Bt(r,s,"src",u.src,u,null);return;case"input":mt("invalid",r);var $=w=A=x=null,Q=null,ae=null;for(h in u)if(u.hasOwnProperty(h)){var he=u[h];if(he!=null)switch(h){case"name":x=he;break;case"type":A=he;break;case"checked":Q=he;break;case"defaultChecked":ae=he;break;case"value":w=he;break;case"defaultValue":$=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(i(137,s));break;default:Bt(r,s,h,he,u,null)}}tr(r,w,$,Q,ae,A,x,!1);return;case"select":mt("invalid",r),h=A=w=null;for(x in u)if(u.hasOwnProperty(x)&&($=u[x],$!=null))switch(x){case"value":w=$;break;case"defaultValue":A=$;break;case"multiple":h=$;default:Bt(r,s,x,$,u,null)}s=w,u=A,r.multiple=!!h,s!=null?jn(r,!!h,s,!1):u!=null&&jn(r,!!h,u,!0);return;case"textarea":mt("invalid",r),w=x=h=null;for(A in u)if(u.hasOwnProperty(A)&&($=u[A],$!=null))switch(A){case"value":h=$;break;case"defaultValue":x=$;break;case"children":w=$;break;case"dangerouslySetInnerHTML":if($!=null)throw Error(i(91));break;default:Bt(r,s,A,$,u,null)}Tl(r,h,x,w);return;case"option":for(Q in u)if(u.hasOwnProperty(Q)&&(h=u[Q],h!=null))switch(Q){case"selected":r.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:Bt(r,s,Q,h,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(h=0;h<qc.length;h++)mt(qc[h],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(ae in u)if(u.hasOwnProperty(ae)&&(h=u[ae],h!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,s));default:Bt(r,s,ae,h,u,null)}return;default:if(Aa(s)){for(he in u)u.hasOwnProperty(he)&&(h=u[he],h!==void 0&&sg(r,s,he,h,u,void 0));return}}for($ in u)u.hasOwnProperty($)&&(h=u[$],h!=null&&Bt(r,s,$,h,u,null))}function AM(r,s,u,h){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,$=null,Q=null,ae=null,he=null;for(fe in u){var Ee=u[fe];if(u.hasOwnProperty(fe)&&Ee!=null)switch(fe){case"checked":break;case"value":break;case"defaultValue":Q=Ee;default:h.hasOwnProperty(fe)||Bt(r,s,fe,null,h,Ee)}}for(var oe in h){var fe=h[oe];if(Ee=u[oe],h.hasOwnProperty(oe)&&(fe!=null||Ee!=null))switch(oe){case"type":w=fe;break;case"name":x=fe;break;case"checked":ae=fe;break;case"defaultChecked":he=fe;break;case"value":A=fe;break;case"defaultValue":$=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(i(137,s));break;default:fe!==Ee&&Bt(r,s,oe,fe,h,Ee)}}Cs(r,A,$,Q,ae,he,w,x);return;case"select":fe=A=$=oe=null;for(w in u)if(Q=u[w],u.hasOwnProperty(w)&&Q!=null)switch(w){case"value":break;case"multiple":fe=Q;default:h.hasOwnProperty(w)||Bt(r,s,w,null,h,Q)}for(x in h)if(w=h[x],Q=u[x],h.hasOwnProperty(x)&&(w!=null||Q!=null))switch(x){case"value":oe=w;break;case"defaultValue":$=w;break;case"multiple":A=w;default:w!==Q&&Bt(r,s,x,w,h,Q)}s=$,u=A,h=fe,oe!=null?jn(r,!!u,oe,!1):!!h!=!!u&&(s!=null?jn(r,!!u,s,!0):jn(r,!!u,u?[]:"",!1));return;case"textarea":fe=oe=null;for($ in u)if(x=u[$],u.hasOwnProperty($)&&x!=null&&!h.hasOwnProperty($))switch($){case"value":break;case"children":break;default:Bt(r,s,$,null,h,x)}for(A in h)if(x=h[A],w=u[A],h.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,h,w)}As(r,oe,fe);return;case"option":for(var Be in u)if(oe=u[Be],u.hasOwnProperty(Be)&&oe!=null&&!h.hasOwnProperty(Be))switch(Be){case"selected":r.selected=!1;break;default:Bt(r,s,Be,null,h,oe)}for(Q in h)if(oe=h[Q],fe=u[Q],h.hasOwnProperty(Q)&&oe!==fe&&(oe!=null||fe!=null))switch(Q){case"selected":r.selected=oe&&typeof oe!="function"&&typeof oe!="symbol";break;default:Bt(r,s,Q,oe,h,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&&!h.hasOwnProperty(tt)&&Bt(r,s,tt,null,h,oe);for(ae in h)if(oe=h[ae],fe=u[ae],h.hasOwnProperty(ae)&&oe!==fe&&(oe!=null||fe!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(i(137,s));break;default:Bt(r,s,ae,oe,h,fe)}return;default:if(Aa(s)){for(var $t in u)oe=u[$t],u.hasOwnProperty($t)&&oe!==void 0&&!h.hasOwnProperty($t)&&sg(r,s,$t,void 0,h,oe);for(he in h)oe=h[he],fe=u[he],!h.hasOwnProperty(he)||oe===fe||oe===void 0&&fe===void 0||sg(r,s,he,oe,h,fe);return}}for(var ne in u)oe=u[ne],u.hasOwnProperty(ne)&&oe!=null&&!h.hasOwnProperty(ne)&&Bt(r,s,ne,null,h,oe);for(Ee in h)oe=h[Ee],fe=u[Ee],!h.hasOwnProperty(Ee)||oe===fe||oe==null&&fe==null||Bt(r,s,Ee,oe,h,fe)}function s1(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function TM(){if(typeof performance.getEntriesByType=="function"){for(var r=0,s=0,u=performance.getEntriesByType("resource"),h=0;h<u.length;h++){var x=u[h],w=x.transferSize,A=x.initiatorType,$=x.duration;if(w&&$&&s1(A)){for(A=0,$=x.responseEnd,h+=1;h<u.length;h++){var Q=u[h],ae=Q.startTime;if(ae>$)break;var he=Q.transferSize,Ee=Q.initiatorType;he&&s1(Ee)&&(Q=Q.responseEnd,A+=he*(Q<$?1:($-ae)/(Q-ae)))}if(--h,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 lg=null,og=null;function lf(r){return r.nodeType===9?r:r.ownerDocument}function l1(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 o1(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 cg(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 ug=null;function MM(){var r=window.event;return r&&r.type==="popstate"?r===ug?!1:(ug=r,!0):(ug=null,!1)}var c1=typeof setTimeout=="function"?setTimeout:void 0,DM=typeof clearTimeout=="function"?clearTimeout:void 0,u1=typeof Promise=="function"?Promise:void 0,OM=typeof queueMicrotask=="function"?queueMicrotask:typeof u1<"u"?function(r){return u1.resolve(null).then(r).catch(RM)}:c1;function RM(r){setTimeout(function(){throw r})}function Ya(r){return r==="head"}function d1(r,s){var u=s,h=0;do{var x=u.nextSibling;if(r.removeChild(u),x&&x.nodeType===8)if(u=x.data,u==="/$"||u==="/&"){if(h===0){r.removeChild(x),ao(s);return}h--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")h++;else if(u==="html")Kc(r.ownerDocument.documentElement);else if(u==="head"){u=r.ownerDocument.head,Kc(u);for(var w=u.firstChild;w;){var A=w.nextSibling,$=w.nodeName;w[$r]||$==="SCRIPT"||$==="STYLE"||$==="LINK"&&w.rel.toLowerCase()==="stylesheet"||u.removeChild(w),w=A}}else u==="body"&&Kc(r.ownerDocument.body);u=x}while(u);ao(s)}function f1(r,s){var u=r;r=0;do{var h=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||""),h&&h.nodeType===8)if(u=h.data,u==="/$"){if(r===0)break;r--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||r++;u=h}while(u)}function dg(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":dg(u),js(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}r.removeChild(u)}}function LM(r,s,u,h){for(;r.nodeType===1;){var x=u;if(r.nodeName.toLowerCase()!==s.toLowerCase()){if(!h&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(h){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 IM(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 p1(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 fg(r){return r.data==="$?"||r.data==="$~"}function pg(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function zM(r,s){var u=r.ownerDocument;if(r.data==="$~")r._reactRetry=s;else if(r.data!=="$?"||u.readyState!=="loading")s();else{var h=function(){s(),u.removeEventListener("DOMContentLoaded",h)};u.addEventListener("DOMContentLoaded",h),r._reactRetry=h}}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 hg=null;function h1(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 m1(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 g1(r,s,u){switch(s=lf(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 Kc(r){for(var s=r.attributes;s.length;)r.removeAttributeNode(s[0]);js(r)}var $i=new Map,y1=new Set;function of(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var ra=H.d;H.d={f:PM,r:BM,D:$M,C:UM,L:FM,m:qM,X:KM,S:HM,M:GM};function PM(){var r=ra.f(),s=Zd();return r||s}function BM(r){var s=Zi(r);s!==null&&s.tag===5&&s.type==="form"?R0(s):ra.r(r)}var no=typeof document>"u"?null:document;function b1(r,s,u){var h=no;if(h&&typeof s=="string"&&s){var x=qn(s);x='link[rel="'+r+'"][href="'+x+'"]',typeof u=="string"&&(x+='[crossorigin="'+u+'"]'),y1.has(x)||(y1.add(x),r={rel:r,crossOrigin:u,href:s},h.querySelector(x)===null&&(s=h.createElement("link"),Bn(s,"link",r),fn(s),h.head.appendChild(s)))}}function $M(r){ra.D(r),b1("dns-prefetch",r,null)}function UM(r,s){ra.C(r,s),b1("preconnect",r,s)}function FM(r,s,u){ra.L(r,s,u);var h=no;if(h&&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),h.querySelector(x)!==null||s==="style"&&h.querySelector(Gc(w))||s==="script"&&h.querySelector(Vc(w))||(s=h.createElement("link"),Bn(s,"link",r),fn(s),h.head.appendChild(s)))}}function qM(r,s){ra.m(r,s);var u=no;if(u&&r){var h=s&&typeof s.as=="string"?s.as:"script",x='link[rel="modulepreload"][as="'+qn(h)+'"][href="'+qn(r)+'"]',w=x;switch(h){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(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Vc(w)))return}h=u.createElement("link"),Bn(h,"link",r),fn(h),u.head.appendChild(h)}}}function HM(r,s,u){ra.S(r,s,u);var h=no;if(h&&r){var x=xr(h).hoistableStyles,w=io(r);s=s||"default";var A=x.get(w);if(!A){var $={loading:0,preload:null};if(A=h.querySelector(Gc(w)))$.loading=5;else{r=m({rel:"stylesheet",href:r,"data-precedence":s},u),(u=$i.get(w))&&mg(r,u);var Q=A=h.createElement("link");fn(Q),Bn(Q,"link",r),Q._p=new Promise(function(ae,he){Q.onload=ae,Q.onerror=he}),Q.addEventListener("load",function(){$.loading|=1}),Q.addEventListener("error",function(){$.loading|=2}),$.loading|=4,cf(A,s,h)}A={type:"stylesheet",instance:A,count:1,state:$},x.set(w,A)}}}function KM(r,s){ra.X(r,s);var u=no;if(u&&r){var h=xr(u).hoistableScripts,x=ro(r),w=h.get(x);w||(w=u.querySelector(Vc(x)),w||(r=m({src:r,async:!0},s),(s=$i.get(x))&&gg(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},h.set(x,w))}}function GM(r,s){ra.M(r,s);var u=no;if(u&&r){var h=xr(u).hoistableScripts,x=ro(r),w=h.get(x);w||(w=u.querySelector(Vc(x)),w||(r=m({src:r,async:!0,type:"module"},s),(s=$i.get(x))&&gg(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},h.set(x,w))}}function x1(r,s,u,h){var x=(x=ke.current)?of(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=xr(x).hoistableStyles,h=u.get(s),h||(h={type:"style",instance:null,count:0,state:null},u.set(s,h)),h):{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=xr(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(Gc(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||VM(x,r,u,A.state))),s&&h===null)throw Error(i(528,""));return A}if(s&&h!==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=xr(x).hoistableScripts,h=u.get(s),h||(h={type:"script",instance:null,count:0,state:null},u.set(s,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,r))}}function io(r){return'href="'+qn(r)+'"'}function Gc(r){return'link[rel="stylesheet"]['+r+"]"}function v1(r){return m({},r,{"data-precedence":r.precedence,precedence:null})}function VM(r,s,u,h){r.querySelector('link[rel="preload"][as="style"]['+s+"]")?h.loading=1:(s=r.createElement("link"),h.preload=s,s.addEventListener("load",function(){return h.loading|=1}),s.addEventListener("error",function(){return h.loading|=2}),Bn(s,"link",u),fn(s),r.head.appendChild(s))}function ro(r){return'[src="'+qn(r)+'"]'}function Vc(r){return"script[async]"+r}function w1(r,s,u){if(s.count++,s.instance===null)switch(s.type){case"style":var h=r.querySelector('style[data-href~="'+qn(u.href)+'"]');if(h)return s.instance=h,fn(h),h;var x=m({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(r.ownerDocument||r).createElement("style"),fn(h),Bn(h,"style",x),cf(h,u.precedence,r),s.instance=h;case"stylesheet":x=io(u.href);var w=r.querySelector(Gc(x));if(w)return s.state.loading|=4,s.instance=w,fn(w),w;h=v1(u),(x=$i.get(x))&&mg(h,x),w=(r.ownerDocument||r).createElement("link"),fn(w);var A=w;return A._p=new Promise(function($,Q){A.onload=$,A.onerror=Q}),Bn(w,"link",h),s.state.loading|=4,cf(w,u.precedence,r),s.instance=w;case"script":return w=ro(u.src),(x=r.querySelector(Vc(w)))?(s.instance=x,fn(x),x):(h=u,(x=$i.get(w))&&(h=m({},u),gg(h,x)),r=r.ownerDocument||r,x=r.createElement("script"),fn(x),Bn(x,"link",h),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&&(h=s.instance,s.state.loading|=4,cf(h,u.precedence,r));return s.instance}function cf(r,s,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=h.length?h[h.length-1]:null,w=x,A=0;A<h.length;A++){var $=h[A];if($.dataset.precedence===s)w=$;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 mg(r,s){r.crossOrigin==null&&(r.crossOrigin=s.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=s.referrerPolicy),r.title==null&&(r.title=s.title)}function gg(r,s){r.crossOrigin==null&&(r.crossOrigin=s.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=s.referrerPolicy),r.integrity==null&&(r.integrity=s.integrity)}var uf=null;function k1(r,s,u){if(uf===null){var h=new Map,x=uf=new Map;x.set(u,h)}else x=uf,h=x.get(u),h||(h=new Map,x.set(u,h));if(h.has(r))return h;for(h.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 $=h.get(A);$?$.push(w):h.set(A,[w])}}return h}function E1(r,s,u){r=r.ownerDocument||r,r.head.insertBefore(u,s==="title"?r.querySelector("head > title"):null)}function YM(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 S1(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function WM(r,s,u,h){if(u.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var x=io(h.href),w=s.querySelector(Gc(x));if(w){s=w._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(r.count++,r=df.bind(r),s.then(r,r)),u.state.loading|=4,u.instance=w,fn(w);return}w=s.ownerDocument||s,h=v1(h),(x=$i.get(x))&&mg(h,x),w=w.createElement("link"),fn(w);var A=w;A._p=new Promise(function($,Q){A.onload=$,A.onerror=Q}),Bn(w,"link",h),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=df.bind(r),s.addEventListener("load",u),s.addEventListener("error",u))}}var yg=0;function QM(r,s){return r.stylesheets&&r.count===0&&pf(r,r.stylesheets),0<r.count||0<r.imgCount?function(u){var h=setTimeout(function(){if(r.stylesheets&&pf(r,r.stylesheets),r.unsuspend){var w=r.unsuspend;r.unsuspend=null,w()}},6e4+s);0<r.imgBytes&&yg===0&&(yg=62500*TM());var x=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&pf(r,r.stylesheets),r.unsuspend)){var w=r.unsuspend;r.unsuspend=null,w()}},(r.imgBytes>yg?50:800)+s);return r.unsuspend=u,function(){r.unsuspend=null,clearTimeout(h),clearTimeout(x)}}:null}function df(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)pf(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var ff=null;function pf(r,s){r.stylesheets=null,r.unsuspend!==null&&(r.count++,ff=new Map,s.forEach(XM,r),ff=null,df.call(r))}function XM(r,s){if(!(s.state.loading&4)){var u=ff.get(r);if(u)var h=u.get(null);else{u=new Map,ff.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),h=A)}h&&u.set(null,h)}x=s.instance,A=x.getAttribute("data-precedence"),w=u.get(A)||h,w===h&&u.set(null,x),u.set(A,x),this.count++,h=df.bind(this),x.addEventListener("load",h),x.addEventListener("error",h),w?w.parentNode.insertBefore(x,w.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(x,r.firstChild)),s.state.loading|=4}}var Yc={$$typeof:N,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function ZM(r,s,u,h,x,w,A,$,Q){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=qt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qt(0),this.hiddenUpdates=qt(null),this.identifierPrefix=h,this.onUncaughtError=x,this.onCaughtError=w,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Q,this.incompleteTransitions=new Map}function N1(r,s,u,h,x,w,A,$,Q,ae,he,Ee){return r=new ZM(r,s,u,A,Q,ae,he,Ee,$),s=1,w===!0&&(s|=24),w=yi(3,null,null,s),r.current=w,w.stateNode=r,s=Qh(),s.refCount++,r.pooledCache=s,s.refCount++,w.memoizedState={element:h,isDehydrated:u,cache:s},em(w),r}function _1(r){return r?(r=Ll,r):Ll}function j1(r,s,u,h,x,w){x=_1(x),h.context===null?h.context=x:h.pendingContext=x,h=za(s),h.payload={element:u},w=w===void 0?null:w,w!==null&&(h.callback=w),u=Pa(r,h,s),u!==null&&(oi(u,r,s),_c(u,r,s))}function C1(r,s){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var u=r.retryLane;r.retryLane=u!==0&&u<s?u:s}}function bg(r,s){C1(r,s),(r=r.alternate)&&C1(r,s)}function A1(r){if(r.tag===13||r.tag===31){var s=Os(r,67108864);s!==null&&oi(s,r,67108864),bg(r,67108864)}}function T1(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),bg(r,s)}}var hf=!0;function JM(r,s,u,h){var x=I.T;I.T=null;var w=H.p;try{H.p=2,xg(r,s,u,h)}finally{H.p=w,I.T=x}}function eD(r,s,u,h){var x=I.T;I.T=null;var w=H.p;try{H.p=8,xg(r,s,u,h)}finally{H.p=w,I.T=x}}function xg(r,s,u,h){if(hf){var x=vg(h);if(x===null)ag(r,s,h,mf,u),D1(r,h);else if(nD(x,r,s,u,h))h.stopPropagation();else if(D1(r,h),s&4&&-1<tD.indexOf(r)){for(;x!==null;){var w=Zi(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 $=w;for($.pendingLanes|=2,$.entangledLanes|=2;A;){var Q=1<<31-yt(A);$.entanglements[1]|=Q,A&=~Q}Sr(w),(Tt&6)===0&&(Qd=je()+500,Fc(0))}}break;case 31:case 13:$=Os(w,2),$!==null&&oi($,w,2),Zd(),bg(w,2)}if(w=vg(h),w===null&&ag(r,s,h,mf,u),w===x)break;x=w}x!==null&&h.stopPropagation()}else ag(r,s,h,null,u)}}function vg(r){return r=lt(r),wg(r)}var mf=null;function wg(r){if(mf=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 mf=r,null}function M1(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(He()){case te:return 2;case de:return 8;case Le:case Ze:return 32;case rt:return 268435456;default:return 32}default:return 32}}var kg=!1,Wa=null,Qa=null,Xa=null,Wc=new Map,Qc=new Map,Za=[],tD="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 D1(r,s){switch(r){case"focusin":case"focusout":Wa=null;break;case"dragenter":case"dragleave":Qa=null;break;case"mouseover":case"mouseout":Xa=null;break;case"pointerover":case"pointerout":Wc.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qc.delete(s.pointerId)}}function Xc(r,s,u,h,x,w){return r===null||r.nativeEvent!==w?(r={blockedOn:s,domEventName:u,eventSystemFlags:h,nativeEvent:w,targetContainers:[x]},s!==null&&(s=Zi(s),s!==null&&A1(s)),r):(r.eventSystemFlags|=h,s=r.targetContainers,x!==null&&s.indexOf(x)===-1&&s.push(x),r)}function nD(r,s,u,h,x){switch(s){case"focusin":return Wa=Xc(Wa,r,s,u,h,x),!0;case"dragenter":return Qa=Xc(Qa,r,s,u,h,x),!0;case"mouseover":return Xa=Xc(Xa,r,s,u,h,x),!0;case"pointerover":var w=x.pointerId;return Wc.set(w,Xc(Wc.get(w)||null,r,s,u,h,x)),!0;case"gotpointercapture":return w=x.pointerId,Qc.set(w,Xc(Qc.get(w)||null,r,s,u,h,x)),!0}return!1}function O1(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(){T1(u)});return}}else if(s===31){if(s=d(u),s!==null){r.blockedOn=s,Ea(r.priority,function(){T1(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 gf(r){if(r.blockedOn!==null)return!1;for(var s=r.targetContainers;0<s.length;){var u=vg(r.nativeEvent);if(u===null){u=r.nativeEvent;var h=new u.constructor(u.type,u);Fe=h,u.target.dispatchEvent(h),Fe=null}else return s=Zi(u),s!==null&&A1(s),r.blockedOn=u,!1;s.shift()}return!0}function R1(r,s,u){gf(r)&&u.delete(s)}function iD(){kg=!1,Wa!==null&&gf(Wa)&&(Wa=null),Qa!==null&&gf(Qa)&&(Qa=null),Xa!==null&&gf(Xa)&&(Xa=null),Wc.forEach(R1),Qc.forEach(R1)}function yf(r,s){r.blockedOn===s&&(r.blockedOn=null,kg||(kg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,iD)))}var bf=null;function L1(r){bf!==r&&(bf=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){bf===r&&(bf=null);for(var s=0;s<r.length;s+=3){var u=r[s],h=r[s+1],x=r[s+2];if(typeof h!="function"){if(wg(h||u)===null)continue;break}var w=Zi(u);w!==null&&(r.splice(s,3),s-=3,vm(w,{pending:!0,data:x,method:u.method,action:h},h,x))}}))}function ao(r){function s(Q){return yf(Q,r)}Wa!==null&&yf(Wa,r),Qa!==null&&yf(Qa,r),Xa!==null&&yf(Xa,r),Wc.forEach(s),Qc.forEach(s);for(var u=0;u<Za.length;u++){var h=Za[u];h.blockedOn===r&&(h.blockedOn=null)}for(;0<Za.length&&(u=Za[0],u.blockedOn===null);)O1(u),u.blockedOn===null&&Za.shift();if(u=(r.ownerDocument||r).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var x=u[h],w=u[h+1],A=x[Tn]||null;if(typeof w=="function")A||L1(u);else if(A){var $=null;if(w&&w.hasAttribute("formAction")){if(x=w,A=w[Tn]||null)$=A.formAction;else if(wg(x)!==null)continue}else $=A.action;typeof $=="function"?u[h+1]=$:(u.splice(h,3),h-=3),L1(u)}}}function I1(){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),h||setTimeout(u,20)}function u(){if(!h&&!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 h=!1,x=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(u,100),function(){h=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),x!==null&&(x(),x=null)}}}function Eg(r){this._internalRoot=r}xf.prototype.render=Eg.prototype.render=function(r){var s=this._internalRoot;if(s===null)throw Error(i(409));var u=s.current,h=ki();j1(u,h,r,s,null,null)},xf.prototype.unmount=Eg.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var s=r.containerInfo;j1(r.current,2,null,r,null,null),Zd(),s[Xi]=null}};function xf(r){this._internalRoot=r}xf.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&&O1(r)}};var z1=t.version;if(z1!=="19.2.5")throw Error(i(527,z1,"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=p(s),r=r!==null?g(r):null,r=r===null?null:r.stateNode,r};var rD={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vf.isDisabled&&vf.supportsFiber)try{dn=vf.inject(rD),Mt=vf}catch{}}return Jc.createRoot=function(r,s){if(!a(r))throw Error(i(299));var u=!1,h="",x=H0,w=K0,A=G0;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(h=s.identifierPrefix),s.onUncaughtError!==void 0&&(x=s.onUncaughtError),s.onCaughtError!==void 0&&(w=s.onCaughtError),s.onRecoverableError!==void 0&&(A=s.onRecoverableError)),s=N1(r,1,!1,null,null,u,h,null,x,w,A,I1),r[Xi]=s.current,rg(r),new Eg(s)},Jc.hydrateRoot=function(r,s,u){if(!a(r))throw Error(i(299));var h=!1,x="",w=H0,A=K0,$=G0,Q=null;return u!=null&&(u.unstable_strictMode===!0&&(h=!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.onRecoverableError),u.formState!==void 0&&(Q=u.formState)),s=N1(r,1,!0,s,u??null,h,x,Q,w,A,$,I1),s.context=_1(null),u=s.current,h=ki(),h=Vt(h),x=za(h),x.callback=null,Pa(u,x,h),u=h,s.current.lanes=u,Ot(s,u),Sr(s),r[Xi]=s.current,rg(r),new xf(s)},Jc.version="19.2.5",Jc}var W1;function gD(){if(W1)return jg.exports;W1=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(),jg.exports=mD(),jg.exports}var yD=gD(),Wo=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,Co,lN,bD=(lN=class extends Wo{constructor(){super();Ye(this,el);Ye(this,cs);Ye(this,Co);Ie(this,Co,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,Co))}onUnsubscribe(){var t;this.hasListeners()||((t=X(this,cs))==null||t.call(this),Ie(this,cs,void 0))}setEventListener(t){var n;Ie(this,Co,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,Co=new WeakMap,lN),Cb=new bD,xD={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},us,jb,oN,vD=(oN=class{constructor(){Ye(this,us,xD);Ye(this,jb,!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,jb=new WeakMap,oN),Ws=new vD;function wD(e){setTimeout(e,0)}var kD=typeof window>"u"||"Deno"in globalThis;function ei(){}function ED(e,t){return typeof e=="function"?e(t):e}function jy(e){return typeof e=="number"&&e>=0&&e!==1/0}function xN(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 Q1(e,t){const{type:n="all",exact:i,fetchStatus:a,predicate:l,queryKey:o,stale:d}=e;if(o){if(i){if(t.queryHash!==Ab(o,t.options))return!1}else if(!vu(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 X1(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(!vu(t.options.mutationKey,l))return!1}return!(i&&t.state.status!==i||a&&!a(t))}function Ab(e,t){return((t==null?void 0:t.queryKeyHashFn)||dl)(e)}function dl(e){return JSON.stringify(e,(t,n)=>Cy(n)?Object.keys(n).sort().reduce((i,a)=>(i[a]=n[a],i),{}):n)}function vu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>vu(e[n],t[n])):!1}var SD=Object.prototype.hasOwnProperty;function vN(e,t,n=0){if(e===t)return e;if(n>500)return t;const i=Z1(e)&&Z1(t);if(!i&&!(Cy(e)&&Cy(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 p=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:SD.call(e,m))&&p++;continue}if(y===null||b===null||typeof y!="object"||typeof b!="object"){f[m]=b;continue}const k=vN(y,b,n+1);f[m]=k,k===y&&p++}return l===d&&p===l?e:f}function dp(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 Z1(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Cy(e){if(!J1(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!J1(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function J1(e){return Object.prototype.toString.call(e)==="[object Object]"}function ND(e){return new Promise(t=>{Ws.setTimeout(t,e)})}function Ay(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?vN(e,t):t}function _D(e,t,n=0){const i=[...e,t];return n&&i.length>n?i.slice(1):i}function jD(e,t,n=0){const i=[t,...e];return n&&i.length>n?i.slice(0,-1):i}var Tb=Symbol();function wN(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Tb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Mb(e,t){return typeof e=="function"?e(...t):!!e}function CD(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 wu=(()=>{let e=()=>kD;return{isServer(){return e()},setIsServer(t){e=t}}})();function Ty(){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 AD=wD;function TD(){let e=[],t=0,n=d=>{d()},i=d=>{d()},a=AD;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=TD(),Ao,ds,To,cN,MD=(cN=class extends Wo{constructor(){super();Ye(this,Ao,!0);Ye(this,ds);Ye(this,To);Ie(this,To,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,To))}onUnsubscribe(){var t;this.hasListeners()||((t=X(this,ds))==null||t.call(this),Ie(this,ds,void 0))}setEventListener(t){var n;Ie(this,To,t),(n=X(this,ds))==null||n.call(this),Ie(this,ds,t(this.setOnline.bind(this)))}setOnline(t){X(this,Ao)!==t&&(Ie(this,Ao,t),this.listeners.forEach(i=>{i(t)}))}isOnline(){return X(this,Ao)}},Ao=new WeakMap,ds=new WeakMap,To=new WeakMap,cN),fp=new MD;function DD(e){return Math.min(1e3*2**e,3e4)}function kN(e){return(e??"online")==="online"?fp.isOnline():!0}var My=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function EN(e){let t=!1,n=0,i;const a=Ty(),l=()=>a.status!=="pending",o=v=>{var S;if(!l()){const E=new My(v);y(E),(S=e.onCancel)==null||S.call(e,E)}},d=()=>{t=!0},f=()=>{t=!1},p=()=>Cb.isFocused()&&(e.networkMode==="always"||fp.isOnline())&&e.canRun(),g=()=>kN(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 S;i=E=>{(l()||p())&&v(E)},(S=e.onPause)==null||S.call(e)}).then(()=>{var v;i=void 0,l()||(v=e.onContinue)==null||v.call(e)}),k=()=>{if(l())return;let v;const S=n===0?e.initialPromise:void 0;try{v=S??e.fn()}catch(E){v=Promise.reject(E)}Promise.resolve(v).then(m).catch(E=>{var M;if(l())return;const C=e.retry??(wu.isServer()?0:3),N=e.retryDelay??DD,_=typeof N=="function"?N(n,E):N,T=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,E);if(t||!T){y(E);return}n++,(M=e.onFail)==null||M.call(e,n,E),ND(_).then(()=>p()?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,uN,SN=(uN=class{constructor(){Ye(this,tl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),jy(this.gcTime)&&Ie(this,tl,Ws.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(wu.isServer()?1/0:300*1e3))}clearGcTimeout(){X(this,tl)!==void 0&&(Ws.clearTimeout(X(this,tl)),Ie(this,tl,void 0))}},tl=new WeakMap,uN),nl,Mo,Fi,il,On,Bu,rl,Si,NN,sa,dN,OD=(dN=class extends SN{constructor(t){super();Ye(this,Si);Ye(this,nl);Ye(this,Mo);Ye(this,Fi);Ye(this,il);Ye(this,On);Ye(this,Bu);Ye(this,rl);Ie(this,rl,!1),Ie(this,Bu,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,tk(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,Bu),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=tk(this.options);n.data!==void 0&&(this.setState(ek(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=Ay(this.state.data,t,this.options);return dt(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){dt(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===Tb||!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:!xN(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)||dt(this,Si,NN).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||dt(this,Si,sa).call(this,{type:"invalidate"})}async fetch(t,n){var f,p,g,m,y,b,k,v,S,E,C,N;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(T=>T.options.queryFn);_&&this.setOptions(_.options)}const i=new AbortController,a=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(Ie(this,rl,!0),i.signal)})},l=()=>{const _=wN(this.options,n),M=(()=>{const O={client:X(this,il),queryKey:this.queryKey,meta:this.meta};return a(O),O})();return Ie(this,rl,!1),this.options.persister?this.options.persister(_,M,this):_(M)},d=(()=>{const _={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:X(this,il),state:this.state,fetchFn:l};return a(_),_})();(p=this.options.behavior)==null||p.onFetch(d,this),Ie(this,Mo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=d.fetchOptions)==null?void 0:g.meta))&&dt(this,Si,sa).call(this,{type:"fetch",meta:(m=d.fetchOptions)==null?void 0:m.meta}),Ie(this,On,EN({initialPromise:n==null?void 0:n.initialPromise,fn:d.fetchFn,onCancel:_=>{_ instanceof My&&_.revert&&this.setState({...X(this,Mo),fetchStatus:"idle"}),i.abort()},onFail:(_,T)=>{dt(this,Si,sa).call(this,{type:"failed",failureCount:_,error:T})},onPause:()=>{dt(this,Si,sa).call(this,{type:"pause"})},onContinue:()=>{dt(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 My){if(_.silent)return X(this,On).promise;if(_.revert){if(this.state.data===void 0)throw _;return this.state.data}}throw dt(this,Si,sa).call(this,{type:"error",error:_}),(E=(S=X(this,Fi).config).onError)==null||E.call(S,_,this),(N=(C=X(this,Fi).config).onSettled)==null||N.call(C,this.state.data,_,this),_}finally{this.scheduleGc()}}},nl=new WeakMap,Mo=new WeakMap,Fi=new WeakMap,il=new WeakMap,On=new WeakMap,Bu=new WeakMap,rl=new WeakMap,Si=new WeakSet,NN=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,..._N(i.data,this.options),fetchMeta:t.meta??null};case"success":const a={...i,...ek(t.data,t.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ie(this,Mo,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})})},dN);function _N(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:kN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function ek(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function tk(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,$u,Zn,al,Do,la,fs,Uu,Oo,Ro,sl,ll,ps,Lo,Dt,cu,Dy,Oy,Ry,Ly,Iy,zy,Py,jN,fN,RD=(fN=class extends Wo{constructor(t,n){super();Ye(this,Dt);Ye(this,ui);Ye(this,kt);Ye(this,$u);Ye(this,Zn);Ye(this,al);Ye(this,Do);Ye(this,la);Ye(this,fs);Ye(this,Uu);Ye(this,Oo);Ye(this,Ro);Ye(this,sl);Ye(this,ll);Ye(this,ps);Ye(this,Lo,new Set);this.options=n,Ie(this,ui,t),Ie(this,fs,null),Ie(this,la,Ty()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(X(this,kt).addObserver(this),nk(X(this,kt),this.options)?dt(this,Dt,cu).call(this):this.updateResult(),dt(this,Dt,Ly).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return By(X(this,kt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return By(X(this,kt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,dt(this,Dt,Iy).call(this),dt(this,Dt,zy).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");dt(this,Dt,Py).call(this),X(this,kt).setOptions(this.options),n._defaulted&&!dp(this.options,n)&&X(this,ui).getQueryCache().notify({type:"observerOptionsUpdated",query:X(this,kt),observer:this});const a=this.hasListeners();a&&ik(X(this,kt),i,this.options,n)&&dt(this,Dt,cu).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)))&&dt(this,Dt,Dy).call(this);const l=dt(this,Dt,Oy).call(this);a&&(X(this,kt)!==i||qi(this.options.enabled,X(this,kt))!==qi(n.enabled,X(this,kt))||l!==X(this,ps))&&dt(this,Dt,Ry).call(this,l)}getOptimisticResult(t){const n=X(this,ui).getQueryCache().build(X(this,ui),t),i=this.createResult(n,t);return ID(this,i)&&(Ie(this,Zn,i),Ie(this,Do,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,Lo).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 dt(this,Dt,cu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),X(this,Zn)))}createResult(t,n){var B;const i=X(this,kt),a=this.options,l=X(this,Zn),o=X(this,al),d=X(this,Do),p=t!==i?t.state:X(this,$u),{state:g}=t;let m={...g},y=!1,b;if(n._optimisticResults){const U=this.hasListeners(),K=!U&&nk(t,n),q=U&&ik(t,i,n,a);(K||q)&&(m={...m,..._N(g.data,t.options)}),n._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:k,errorUpdatedAt:v,status:S}=m;b=m.data;let E=!1;if(n.placeholderData!==void 0&&b===void 0&&S==="pending"){let U;l!=null&&l.isPlaceholderData&&n.placeholderData===(d==null?void 0:d.placeholderData)?(U=l.data,E=!0):U=typeof n.placeholderData=="function"?n.placeholderData((B=X(this,Ro))==null?void 0:B.state.data,X(this,Ro)):n.placeholderData,U!==void 0&&(S="success",b=Ay(l==null?void 0:l.data,U,n),y=!0)}if(n.select&&b!==void 0&&!E)if(l&&b===(o==null?void 0:o.data)&&n.select===X(this,Uu))b=X(this,Oo);else try{Ie(this,Uu,n.select),b=n.select(b),b=Ay(l==null?void 0:l.data,b,n),Ie(this,Oo,b),Ie(this,fs,null)}catch(U){Ie(this,fs,U)}X(this,fs)&&(k=X(this,fs),b=X(this,Oo),v=Date.now(),S="error");const C=m.fetchStatus==="fetching",N=S==="pending",_=S==="error",T=N&&C,M=b!==void 0,R={status:S,fetchStatus:m.fetchStatus,isPending:N,isSuccess:S==="success",isError:_,isInitialLoading:T,isLoading:T,data:b,dataUpdatedAt:m.dataUpdatedAt,error:k,errorUpdatedAt:v,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:m.dataUpdateCount>p.dataUpdateCount||m.errorUpdateCount>p.errorUpdateCount,isFetching:C,isRefetching:C&&!N,isLoadingError:_&&!M,isPaused:m.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:_&&M,isStale:Db(t,n),refetch:this.refetch,promise:X(this,la),isEnabled:qi(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const U=R.data!==void 0,K=R.status==="error"&&!U,q=F=>{K?F.reject(R.error):U&&F.resolve(R.data)},Y=()=>{const F=Ie(this,la,R.promise=Ty());q(F)},D=X(this,la);switch(D.status){case"pending":t.queryHash===i.queryHash&&q(D);break;case"fulfilled":(K||R.data!==D.value)&&Y();break;case"rejected":(!K||R.error!==D.reason)&&Y();break}}return R}updateResult(){const t=X(this,Zn),n=this.createResult(X(this,kt),this.options);if(Ie(this,al,X(this,kt).state),Ie(this,Do,this.options),X(this,al).data!==void 0&&Ie(this,Ro,X(this,kt)),dp(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,Lo).size)return!0;const o=new Set(l??X(this,Lo));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)})};dt(this,Dt,jN).call(this,{listeners:i()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&dt(this,Dt,Ly).call(this)}},ui=new WeakMap,kt=new WeakMap,$u=new WeakMap,Zn=new WeakMap,al=new WeakMap,Do=new WeakMap,la=new WeakMap,fs=new WeakMap,Uu=new WeakMap,Oo=new WeakMap,Ro=new WeakMap,sl=new WeakMap,ll=new WeakMap,ps=new WeakMap,Lo=new WeakMap,Dt=new WeakSet,cu=function(t){dt(this,Dt,Py).call(this);let n=X(this,kt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(ei)),n},Dy=function(){dt(this,Dt,Iy).call(this);const t=bs(this.options.staleTime,X(this,kt));if(wu.isServer()||X(this,Zn).isStale||!jy(t))return;const i=xN(X(this,Zn).dataUpdatedAt,t)+1;Ie(this,sl,Ws.setTimeout(()=>{X(this,Zn).isStale||this.updateResult()},i))},Oy=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(X(this,kt)):this.options.refetchInterval)??!1},Ry=function(t){dt(this,Dt,zy).call(this),Ie(this,ps,t),!(wu.isServer()||qi(this.options.enabled,X(this,kt))===!1||!jy(X(this,ps))||X(this,ps)===0)&&Ie(this,ll,Ws.setInterval(()=>{(this.options.refetchIntervalInBackground||Cb.isFocused())&&dt(this,Dt,cu).call(this)},X(this,ps)))},Ly=function(){dt(this,Dt,Dy).call(this),dt(this,Dt,Ry).call(this,dt(this,Dt,Oy).call(this))},Iy=function(){X(this,sl)!==void 0&&(Ws.clearTimeout(X(this,sl)),Ie(this,sl,void 0))},zy=function(){X(this,ll)!==void 0&&(Ws.clearInterval(X(this,ll)),Ie(this,ll,void 0))},Py=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,$u,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},jN=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"})})},fN);function LD(e,t){return qi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function nk(e,t){return LD(e,t)||e.state.data!==void 0&&By(e,t,t.refetchOnMount)}function By(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&&Db(e,t)}return!1}function ik(e,t,n,i){return(e!==t||qi(i.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Db(e,n)}function Db(e,t){return qi(t.enabled,e)!==!1&&e.isStaleByTime(bs(t.staleTime,e))}function ID(e,t){return!dp(e.getCurrentResult(),t)}function rk(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 p=async()=>{let v=!1;const S=N=>{CD(N,()=>t.signal,()=>v=!0)},E=wN(t.options,t.fetchOptions),C=async(N,_,T)=>{if(v)return Promise.reject();if(_==null&&N.pages.length)return Promise.resolve(N);const O=(()=>{const K={client:t.client,queryKey:t.queryKey,pageParam:_,direction:T?"backward":"forward",meta:t.options.meta};return S(K),K})(),R=await E(O),{maxPages:B}=t.options,U=T?jD:_D;return{pages:U(N.pages,R,B),pageParams:U(N.pageParams,_,B)}};if(a&&l.length){const N=a==="backward",_=N?zD:ak,T={pages:l,pageParams:o},M=_(i,T);d=await C(T,M,N)}else{const N=e??l.length;do{const _=f===0?o[0]??i.initialPageParam:ak(i,d);if(f>0&&_==null)break;d=await C(d,_),f++}while(f<N)}return d};t.options.persister?t.fetchFn=()=>{var v,S;return(S=(v=t.options).persister)==null?void 0:S.call(v,p,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=p}}}function ak(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 zD(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 Fu,Cr,Kn,ol,Ar,ss,pN,PD=(pN=class extends SN{constructor(t){super();Ye(this,Ar);Ye(this,Fu);Ye(this,Cr);Ye(this,Kn);Ye(this,ol);Ie(this,Fu,t.client),this.mutationId=t.mutationId,Ie(this,Kn,t.mutationCache),Ie(this,Cr,[]),this.state=t.state||CN(),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,Cr).includes(t)||(X(this,Cr).push(t),this.clearGcTimeout(),X(this,Kn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ie(this,Cr,X(this,Cr).filter(n=>n!==t)),this.scheduleGc(),X(this,Kn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){X(this,Cr).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,p,g,m,y,b,k,v,S,E,C,N,_,T,M,O;const n=()=>{dt(this,Ar,ss).call(this,{type:"continue"})},i={client:X(this,Fu),meta:this.options.meta,mutationKey:this.options.mutationKey};Ie(this,ol,EN({fn:()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(new Error("No mutationFn found")),onFail:(R,B)=>{dt(this,Ar,ss).call(this,{type:"failed",failureCount:R,error:B})},onPause:()=>{dt(this,Ar,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{dt(this,Ar,ss).call(this,{type:"pending",variables:t,isPaused:l}),X(this,Kn).config.onMutate&&await X(this,Kn).config.onMutate(t,this,i);const B=await((d=(o=this.options).onMutate)==null?void 0:d.call(o,t,i));B!==this.state.context&&dt(this,Ar,ss).call(this,{type:"pending",context:B,variables:t,isPaused:l})}const R=await X(this,ol).start();return await((p=(f=X(this,Kn).config).onSuccess)==null?void 0:p.call(f,R,t,this.state.context,this,i)),await((m=(g=this.options).onSuccess)==null?void 0:m.call(g,R,t,this.state.context,i)),await((b=(y=X(this,Kn).config).onSettled)==null?void 0:b.call(y,R,null,this.state.variables,this.state.context,this,i)),await((v=(k=this.options).onSettled)==null?void 0:v.call(k,R,null,t,this.state.context,i)),dt(this,Ar,ss).call(this,{type:"success",data:R}),R}catch(R){try{await((E=(S=X(this,Kn).config).onError)==null?void 0:E.call(S,R,t,this.state.context,this,i))}catch(B){Promise.reject(B)}try{await((N=(C=this.options).onError)==null?void 0:N.call(C,R,t,this.state.context,i))}catch(B){Promise.reject(B)}try{await((T=(_=X(this,Kn).config).onSettled)==null?void 0:T.call(_,void 0,R,this.state.variables,this.state.context,this,i))}catch(B){Promise.reject(B)}try{await((O=(M=this.options).onSettled)==null?void 0:O.call(M,void 0,R,t,this.state.context,i))}catch(B){Promise.reject(B)}throw dt(this,Ar,ss).call(this,{type:"error",error:R}),R}finally{X(this,Kn).runNext(this)}}},Fu=new WeakMap,Cr=new WeakMap,Kn=new WeakMap,ol=new WeakMap,Ar=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,Cr).forEach(i=>{i.onMutationUpdate(t)}),X(this,Kn).notify({mutation:this,type:"updated",action:t})})},pN);function CN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var oa,sr,qu,hN,BD=(hN=class extends Wo{constructor(t={}){super();Ye(this,oa);Ye(this,sr);Ye(this,qu);this.config=t,Ie(this,oa,new Set),Ie(this,sr,new Map),Ie(this,qu,0)}build(t,n,i){const a=new PD({client:t,mutationCache:this,mutationId:++wf(this,qu)._,options:t.defaultMutationOptions(n),state:i});return this.add(a),a}add(t){X(this,oa).add(t);const n=kf(t);if(typeof n=="string"){const i=X(this,sr).get(n);i?i.push(t):X(this,sr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(X(this,oa).delete(t)){const n=kf(t);if(typeof n=="string"){const i=X(this,sr).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,sr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=kf(t);if(typeof n=="string"){const i=X(this,sr).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=kf(t);if(typeof n=="string"){const a=(i=X(this,sr).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,sr).clear()})}getAll(){return Array.from(X(this,oa))}find(t){const n={exact:!0,...t};return this.getAll().find(i=>X1(n,i))}findAll(t={}){return this.getAll().filter(n=>X1(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,sr=new WeakMap,qu=new WeakMap,hN);function kf(e){var t;return(t=e.options.scope)==null?void 0:t.id}var ca,hs,di,ua,ma,Xf,$y,mN,$D=(mN=class extends Wo{constructor(n,i){super();Ye(this,ma);Ye(this,ca);Ye(this,hs);Ye(this,di);Ye(this,ua);Ie(this,ca,n),this.setOptions(i),this.bindMethods(),dt(this,ma,Xf).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),dp(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){dt(this,ma,Xf).call(this),dt(this,ma,$y).call(this,n)}getCurrentResult(){return X(this,hs)}reset(){var n;(n=X(this,di))==null||n.removeObserver(this),Ie(this,di,void 0),dt(this,ma,Xf).call(this),dt(this,ma,$y).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,hs=new WeakMap,di=new WeakMap,ua=new WeakMap,ma=new WeakSet,Xf=function(){var i;const n=((i=X(this,di))==null?void 0:i.state)??CN();Ie(this,hs,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},$y=function(n){An.batch(()=>{var i,a,l,o,d,f,p,g;if(X(this,ua)&&this.hasListeners()){const m=X(this,hs).variables,y=X(this,hs).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=(p=X(this,ua)).onSettled)==null||g.call(p,void 0,n.error,m,y,b)}catch(k){Promise.reject(k)}}}this.listeners.forEach(m=>{m(X(this,hs))})})},mN),Tr,gN,UD=(gN=class extends Wo{constructor(t={}){super();Ye(this,Tr);this.config=t,Ie(this,Tr,new Map)}build(t,n,i){const a=n.queryKey,l=n.queryHash??Ab(a,n);let o=this.get(l);return o||(o=new OD({client:t,queryKey:a,queryHash:l,options:t.defaultQueryOptions(n),state:i,defaultOptions:t.getQueryDefaults(a)}),this.add(o)),o}add(t){X(this,Tr).has(t.queryHash)||(X(this,Tr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=X(this,Tr).get(t.queryHash);n&&(t.destroy(),n===t&&X(this,Tr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){An.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return X(this,Tr).get(t)}getAll(){return[...X(this,Tr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(i=>Q1(n,i))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(i=>Q1(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()})})}},Tr=new WeakMap,gN),mn,ms,gs,Io,zo,ys,Po,Bo,yN,FD=(yN=class{constructor(e={}){Ye(this,mn);Ye(this,ms);Ye(this,gs);Ye(this,Io);Ye(this,zo);Ye(this,ys);Ye(this,Po);Ye(this,Bo);Ie(this,mn,e.queryCache||new UD),Ie(this,ms,e.mutationCache||new BD),Ie(this,gs,e.defaultOptions||{}),Ie(this,Io,new Map),Ie(this,zo,new Map),Ie(this,ys,0)}mount(){wf(this,ys)._++,X(this,ys)===1&&(Ie(this,Po,Cb.subscribe(async e=>{e&&(await this.resumePausedMutations(),X(this,mn).onFocus())})),Ie(this,Bo,fp.subscribe(async e=>{e&&(await this.resumePausedMutations(),X(this,mn).onOnline())})))}unmount(){var e,t;wf(this,ys)._--,X(this,ys)===0&&((e=X(this,Po))==null||e.call(this),Ie(this,Po,void 0),(t=X(this,Bo))==null||t.call(this),Ie(this,Bo,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=ED(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=rk(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ei).catch(ei)}ensureInfiniteQueryData(e){return e.behavior=rk(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return fp.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,Io).set(dl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...X(this,Io).values()],n={};return t.forEach(i=>{vu(e,i.queryKey)&&Object.assign(n,i.defaultOptions)}),n}setMutationDefaults(e,t){X(this,zo).set(dl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...X(this,zo).values()],n={};return t.forEach(i=>{vu(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=Ab(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===Tb&&(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,Io=new WeakMap,zo=new WeakMap,ys=new WeakMap,Po=new WeakMap,Bo=new WeakMap,yN),AN=j.createContext(void 0),Ft=e=>{const t=j.useContext(AN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},qD=({client:e,children:t})=>(j.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(AN.Provider,{value:e,children:t})),TN=j.createContext(!1),HD=()=>j.useContext(TN);TN.Provider;function KD(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var GD=j.createContext(KD()),VD=()=>j.useContext(GD),YD=(e,t,n)=>{const i=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Mb(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||i)&&(t.isReset()||(e.retryOnMount=!1))},WD=e=>{j.useEffect(()=>{e.clearReset()},[e])},QD=({result:e,errorResetBoundary:t,throwOnError:n,query:i,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(a&&e.data===void 0||Mb(n,[e.error,i])),XD=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))}},ZD=(e,t)=>e.isLoading&&e.isFetching&&!t,JD=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,sk=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function eO(e,t,n){var y,b,k,v;const i=HD(),a=VD(),l=Ft(),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",XD(o),YD(o,a,d),WD(a);const f=!l.getQueryCache().get(o.queryHash),[p]=j.useState(()=>new t(l,o)),g=p.getOptimisticResult(o),m=!i&&e.subscribed!==!1;if(j.useSyncExternalStore(j.useCallback(S=>{const E=m?p.subscribe(An.batchCalls(S)):ei;return p.updateResult(),E},[p,m]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),j.useEffect(()=>{p.setOptions(o)},[o,p]),JD(o,g))throw sk(o,p,a);if(QD({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&&!wu.isServer()&&ZD(g,i)){const S=f?sk(o,p,a):d==null?void 0:d.promise;S==null||S.catch(ei).finally(()=>{p.updateResult()})}return o.notifyOnChangeProps?g:p.trackResult(g)}function Ve(e,t){return eO(e,RD)}function Et(e,t){const n=Ft(),[i]=j.useState(()=>new $D(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&&Mb(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 lk="popstate";function ok(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function tO(e={}){function t(i,a){var p;let l=(p=a.state)==null?void 0:p.masked,{pathname:o,search:d,hash:f}=l||i.location;return Uy("",{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:ku(a)}return iO(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 nO(){return Math.random().toString(36).substring(2,10)}function ck(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 Uy(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||nO(),unstable_mask:a}}function ku({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 iO(e,t,n,i={}){let{window:a=document.defaultView,v5Compat:l=!1}=i,o=a.history,d="POP",f=null,p=g();p==null&&(p=0,o.replaceState({...o.state,idx:p},""));function g(){return(o.state||{idx:null}).idx}function m(){d="POP";let S=g(),E=S==null?null:S-p;p=S,f&&f({action:d,location:v.location,delta:E})}function y(S,E){d="PUSH";let C=ok(S)?S:Uy(v.location,S,E);p=g()+1;let N=ck(C,p),_=v.createHref(C.unstable_mask||C);try{o.pushState(N,"",_)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;a.location.assign(_)}l&&f&&f({action:d,location:v.location,delta:1})}function b(S,E){d="REPLACE";let C=ok(S)?S:Uy(v.location,S,E);p=g();let N=ck(C,p),_=v.createHref(C.unstable_mask||C);o.replaceState(N,"",_),l&&f&&f({action:d,location:v.location,delta:0})}function k(S){return rO(S)}let v={get action(){return d},get location(){return e(a,o)},listen(S){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(lk,m),f=S,()=>{a.removeEventListener(lk,m),f=null}},createHref(S){return t(a,S)},createURL:k,encodeLocation(S){let E=k(S);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:y,replace:b,go(S){return o.go(S)}};return v}function rO(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:ku(e);return i=i.replace(/ $/,"%20"),!t&&i.startsWith("//")&&(i=n+i),new URL(i,n)}function MN(e,t,n="/"){return aO(e,t,n,!1)}function aO(e,t,n,i){let a=typeof t=="string"?Qo(t):t,l=ga(a.pathname||"/",n);if(l==null)return null;let o=DN(e);sO(o);let d=null;for(let f=0;d==null&&f<o.length;++f){let p=yO(l);d=mO(o[f],p,i)}return d}function DN(e,t=[],n=[],i="",a=!1){let l=(o,d,f=a,p)=>{let g={relativePath:p===void 0?o.path||"":p,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=dr([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}".`),DN(o.children,t,y,m,f)),!(o.path==null&&!o.index)&&t.push({path:m,score:pO(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 p of ON(o.path))l(o,d,!0,p)}),t}function ON(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=ON(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 sO(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:hO(t.routesMeta.map(i=>i.childrenIndex),n.routesMeta.map(i=>i.childrenIndex)))}var lO=/^:[\w-]+$/,oO=3,cO=2,uO=1,dO=10,fO=-2,uk=e=>e==="*";function pO(e,t){let n=e.split("/"),i=n.length;return n.some(uk)&&(i+=fO),t&&(i+=cO),n.filter(a=>!uk(a)).reduce((a,l)=>a+(lO.test(l)?oO:l===""?uO:dO),i)}function hO(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 mO(e,t,n=!1){let{routesMeta:i}=e,a={},l="/",o=[];for(let d=0;d<i.length;++d){let f=i[d],p=d===i.length-1,g=l==="/"?t:t.slice(l.length)||"/",m=pp({path:f.relativePath,caseSensitive:f.caseSensitive,end:p},g),y=f.route;if(!m&&p&&n&&!i[i.length-1].route.index&&(m=pp({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},g)),!m)return null;Object.assign(a,m.params),o.push({params:a,pathname:dr([l,m.pathname]),pathnameBase:wO(dr([l,m.pathnameBase])),route:y}),m.pathnameBase!=="/"&&(l=dr([l,m.pathnameBase]))}return o}function pp(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,i]=gO(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((p,{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?p[g]=void 0:p[g]=(b||"").replace(/%2F/g,"/"),p},{}),pathname:l,pathnameBase:o,pattern:e}}function gO(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,p,g)=>{if(i.push({paramName:d,isOptional:f!=null}),f){let m=g.charAt(p+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 yO(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 bO=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function xO(e,t="/"){let{pathname:n,search:i="",hash:a=""}=typeof e=="string"?Qo(e):e,l;return n?(n=RN(n),n.startsWith("/")?l=dk(n.substring(1),"/"):l=dk(n,t)):l=t,{pathname:l,search:kO(i),hash:EO(a)}}function dk(e,t){let n=hp(t).split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Mg(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 vO(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ob(e){let t=vO(e);return t.map((n,i)=>i===t.length-1?n.pathname:n.pathnameBase)}function $p(e,t,n,i=!1){let a;typeof e=="string"?a=Qo(e):(a={...e},Jt(!a.pathname||!a.pathname.includes("?"),Mg("?","pathname","search",a)),Jt(!a.pathname||!a.pathname.includes("#"),Mg("#","pathname","hash",a)),Jt(!a.search||!a.search.includes("#"),Mg("#","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=xO(a,d),p=o&&o!=="/"&&o.endsWith("/"),g=(l||o===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(p||g)&&(f.pathname+="/"),f}var RN=e=>e.replace(/\/\/+/g,"/"),dr=e=>RN(e.join("/")),hp=e=>e.replace(/\/+$/,""),wO=e=>hp(e).replace(/^\/*/,"/"),kO=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,EO=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,SO=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 NO(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function _O(e){let t=e.map(n=>n.route.path).filter(Boolean);return dr(t)||"/"}var LN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function IN(e,t){let n=e;if(typeof n!="string"||!bO.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let i=n,a=!1;if(LN)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 zN=["POST","PUT","PATCH","DELETE"];new Set(zN);var jO=["GET",...zN];new Set(jO);var Xo=j.createContext(null);Xo.displayName="DataRouter";var Up=j.createContext(null);Up.displayName="DataRouterState";var PN=j.createContext(!1);function CO(){return j.useContext(PN)}var BN=j.createContext({isTransitioning:!1});BN.displayName="ViewTransition";var AO=j.createContext(new Map);AO.displayName="Fetchers";var TO=j.createContext(null);TO.displayName="Await";var Ai=j.createContext(null);Ai.displayName="Navigation";var Gu=j.createContext(null);Gu.displayName="Location";var Wi=j.createContext({outlet:null,matches:[],isDataRoute:!1});Wi.displayName="Route";var Rb=j.createContext(null);Rb.displayName="RouteError";var $N="REACT_ROUTER_ERROR",MO="REDIRECT",DO="ROUTE_ERROR_RESPONSE";function OO(e){if(e.startsWith(`${$N}:${MO}:{`))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 RO(e){if(e.startsWith(`${$N}:${DO}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new SO(t.status,t.statusText,t.data)}catch{}}function LO(e,{relative:t}={}){Jt(Zo(),"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}=Vu(e,{relative:t}),d=l;return n!=="/"&&(d=l==="/"?n:dr([n,l])),i.createHref({pathname:d,search:o,hash:a})}function Zo(){return j.useContext(Gu)!=null}function hr(){return Jt(Zo(),"useLocation() may be used only in the context of a <Router> component."),j.useContext(Gu).location}var UN="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function FN(e){j.useContext(Ai).static||j.useLayoutEffect(e)}function ks(){let{isDataRoute:e}=j.useContext(Wi);return e?QO():IO()}function IO(){Jt(Zo(),"useNavigate() may be used only in the context of a <Router> component.");let e=j.useContext(Xo),{basename:t,navigator:n}=j.useContext(Ai),{matches:i}=j.useContext(Wi),{pathname:a}=hr(),l=JSON.stringify(Ob(i)),o=j.useRef(!1);return FN(()=>{o.current=!0}),j.useCallback((f,p={})=>{if(Gi(o.current,UN),!o.current)return;if(typeof f=="number"){n.go(f);return}let g=$p(f,JSON.parse(l),a,p.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:dr([t,g.pathname])),(p.replace?n.replace:n.push)(g,p.state,p)},[t,n,l,a,e])}var zO=j.createContext(null);function PO(e){let t=j.useContext(Wi).outlet;return j.useMemo(()=>t&&j.createElement(zO.Provider,{value:e},t),[t,e])}function Lb(){let{matches:e}=j.useContext(Wi),t=e[e.length-1];return(t==null?void 0:t.params)??{}}function Vu(e,{relative:t}={}){let{matches:n}=j.useContext(Wi),{pathname:i}=hr(),a=JSON.stringify(Ob(n));return j.useMemo(()=>$p(e,JSON.parse(a),i,t==="path"),[e,a,i,t])}function BO(e,t){return qN(e,t)}function qN(e,t,n){var S;Jt(Zo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=j.useContext(Ai),{matches:a}=j.useContext(Wi),l=a[a.length-1],o=l?l.params:{},d=l?l.pathname:"/",f=l?l.pathnameBase:"/",p=l&&l.route;{let E=p&&p.path||"";KN(d,!p||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=hr(),m;if(t){let E=typeof t=="string"?Qo(t):t;Jt(f==="/"||((S=E.pathname)==null?void 0:S.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=MN(e,{pathname:b});Gi(p||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=HO(k&&k.map(E=>Object.assign({},E,{params:Object.assign({},o,E.params),pathname:dr([f,i.encodeLocation?i.encodeLocation(E.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?f:dr([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(Gu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...m},navigationType:"POP"}},v):v}function $O(){let e=WO(),t=NO(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 UO=j.createElement($O,null),HN=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=RO(e.digest);n&&(e=n)}let t=e!==void 0?j.createElement(Wi.Provider,{value:this.props.routeContext},j.createElement(Rb.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?j.createElement(FO,{error:e},t):t}};HN.contextType=PN;var Dg=new WeakMap;function FO({children:e,error:t}){let{basename:n}=j.useContext(Ai);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let i=OO(t.digest);if(i){let a=Dg.get(t);if(a)throw a;let l=IN(i.location,n);if(LN&&!Dg.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 Dg.set(t,o),o}return j.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function qO({routeContext:e,match:t,children:n}){let i=j.useContext(Xo);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),j.createElement(Wi.Provider,{value:e},n)}function HO(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,p=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:_O(i.matches),errorInfo:m})}:void 0;return a.reduceRight((g,m,y)=>{let b,k=!1,v=null,S=null;i&&(b=l&&m.route.id?l[m.route.id]:void 0,v=m.route.errorElement||UO,o&&(d<0&&y===0?(KN("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,S=null):d===y&&(k=!0,S=m.route.hydrateFallbackElement||null)));let E=t.concat(a.slice(0,y+1)),C=()=>{let N;return b?N=v:k?N=S:m.route.Component?N=j.createElement(m.route.Component,null):m.route.element?N=m.route.element:N=g,j.createElement(qO,{match:m,routeContext:{outlet:g,matches:E,isDataRoute:i!=null},children:N})};return i&&(m.route.ErrorBoundary||m.route.errorElement||y===0)?j.createElement(HN,{location:i.location,revalidation:i.revalidation,component:v,error:b,children:C(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:p}):C()},null)}function Ib(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function KO(e){let t=j.useContext(Xo);return Jt(t,Ib(e)),t}function GO(e){let t=j.useContext(Up);return Jt(t,Ib(e)),t}function VO(e){let t=j.useContext(Wi);return Jt(t,Ib(e)),t}function zb(e){let t=VO(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 YO(){return zb("useRouteId")}function WO(){var i;let e=j.useContext(Rb),t=GO("useRouteError"),n=zb("useRouteError");return e!==void 0?e:(i=t.errors)==null?void 0:i[n]}function QO(){let{router:e}=KO("useNavigate"),t=zb("useNavigate"),n=j.useRef(!1);return FN(()=>{n.current=!0}),j.useCallback(async(a,l={})=>{Gi(n.current,UN),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...l}))},[e,t])}var fk={};function KN(e,t,n){!t&&!fk[e]&&(fk[e]=!0,Gi(!1,n))}j.memo(XO);function XO({routes:e,future:t,state:n,isStatic:i,onError:a}){return qN(e,void 0,{state:n,isStatic:i,onError:a})}function ZO({to:e,replace:t,state:n,relative:i}){Jt(Zo(),"<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(Wi),{pathname:o}=hr(),d=ks(),f=$p(e,Ob(l),o,i==="path"),p=JSON.stringify(f);return j.useEffect(()=>{d(JSON.parse(p),{replace:t,state:n,relative:i})},[d,p,i,t,n]),null}function JO(e){return PO(e.context)}function Sn(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 eR({basename:e="/",children:t=null,location:n,navigationType:i="POP",navigator:a,static:l=!1,unstable_useTransitions:o}){Jt(!Zo(),"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:p="/",search:g="",hash:m="",state:y=null,key:b="default",unstable_mask:k}=n,v=j.useMemo(()=>{let S=ga(p,d);return S==null?null:{location:{pathname:S,search:g,hash:m,state:y,key:b,unstable_mask:k},navigationType:i}},[d,p,g,m,y,b,i,k]);return Gi(v!=null,`<Router basename="${d}"> is not able to match the URL "${p}${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(Gu.Provider,{children:t,value:v}))}function tR({children:e,location:t}){return BO(Fy(e),t)}function Fy(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,Fy(i.props.children,l));return}Jt(i.type===Sn,`[${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=Fy(i.props.children,l)),n.push(o)}),n}var Zf="get",Jf="application/x-www-form-urlencoded";function Fp(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function nR(e){return Fp(e)&&e.tagName.toLowerCase()==="button"}function iR(e){return Fp(e)&&e.tagName.toLowerCase()==="form"}function rR(e){return Fp(e)&&e.tagName.toLowerCase()==="input"}function aR(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function sR(e,t){return e.button===0&&(!t||t==="_self")&&!aR(e)}function qy(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 lR(e,t){let n=qy(e);return t&&t.forEach((i,a)=>{n.has(a)||t.getAll(a).forEach(l=>{n.append(a,l)})}),n}var Ef=null;function oR(){if(Ef===null)try{new FormData(document.createElement("form"),0),Ef=!1}catch{Ef=!0}return Ef}var cR=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Og(e){return e!=null&&!cR.has(e)?(Gi(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Jf}"`),null):e}function uR(e,t){let n,i,a,l,o;if(iR(e)){let d=e.getAttribute("action");i=d?ga(d,t):null,n=e.getAttribute("method")||Zf,a=Og(e.getAttribute("enctype"))||Jf,l=new FormData(e)}else if(nR(e)||rR(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")||Zf,a=Og(e.getAttribute("formenctype"))||Og(d.getAttribute("enctype"))||Jf,l=new FormData(d,e),!oR()){let{name:p,type:g,value:m}=e;if(g==="image"){let y=p?`${p}.`:"";l.append(`${y}x`,"0"),l.append(`${y}y`,"0")}else p&&l.append(p,m)}}else{if(Fp(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Zf,i=null,a=Jf,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 Pb(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function GN(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=`${hp(t)}/_root.${i}`:a.pathname=`${hp(a.pathname)}.${i}`,a}async function dR(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 fR(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 pR(e,t,n){let i=await Promise.all(e.map(async a=>{let l=t.routes[a.route.id];if(l){let o=await dR(l,n);return o.links?o.links():[]}return[]}));return yR(i.flat(1).filter(fR).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function pk(e,t,n,i,a,l){let o=(f,p)=>n[p]?f.route.id!==n[p].route.id:!0,d=(f,p)=>{var g;return n[p].pathname!==f.pathname||((g=n[p].route.path)==null?void 0:g.endsWith("*"))&&n[p].params["*"]!==f.params["*"]};return l==="assets"?t.filter((f,p)=>o(f,p)||d(f,p)):l==="data"?t.filter((f,p)=>{var m;let g=i.routes[f.route.id];if(!g||!g.hasLoader)return!1;if(o(f,p)||d(f,p))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 hR(e,t,{includeHydrateFallback:n}={}){return mR(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 mR(e){return[...new Set(e)]}function gR(e){let t={},n=Object.keys(e).sort();for(let i of n)t[i]=e[i];return t}function yR(e,t){let n=new Set;return new Set(t),e.reduce((i,a)=>{let l=JSON.stringify(gR(a));return n.has(l)||(n.add(l),i.push({key:l,link:a})),i},[])}function Bb(){let e=j.useContext(Xo);return Pb(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function bR(){let e=j.useContext(Up);return Pb(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var $b=j.createContext(void 0);$b.displayName="FrameworkContext";function Ub(){let e=j.useContext($b);return Pb(e,"You must render this element inside a <HydratedRouter> element"),e}function xR(e,t){let n=j.useContext($b),[i,a]=j.useState(!1),[l,o]=j.useState(!1),{onFocus:d,onBlur:f,onMouseEnter:p,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)})},S=new IntersectionObserver(v,{threshold:.5});return y.current&&S.observe(y.current),()=>{S.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:eu(d,b),onBlur:eu(f,k),onMouseEnter:eu(p,b),onMouseLeave:eu(g,k),onTouchStart:eu(m,b)}]:[!1,y,{}]}function eu(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function vR({page:e,...t}){let n=CO(),{router:i}=Bb(),a=j.useMemo(()=>MN(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?n?j.createElement(kR,{page:e,matches:a,...t}):j.createElement(ER,{page:e,matches:a,...t}):null}function wR(e){let{manifest:t,routeModules:n}=Ub(),[i,a]=j.useState([]);return j.useEffect(()=>{let l=!1;return pR(e,t,n).then(o=>{l||a(o)}),()=>{l=!0}},[e,t,n]),i}function kR({page:e,matches:t,...n}){let i=hr(),{future:a}=Ub(),{basename:l}=Bb(),o=j.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let d=GN(e,l,a.unstable_trailingSlashAwareDataRequests,"rsc"),f=!1,p=[];for(let g of t)typeof g.route.shouldRevalidate=="function"?f=!0:p.push(g.route.id);return f&&p.length>0&&d.searchParams.set("_routes",p.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 ER({page:e,matches:t,...n}){let i=hr(),{future:a,manifest:l,routeModules:o}=Ub(),{basename:d}=Bb(),{loaderData:f,matches:p}=bR(),g=j.useMemo(()=>pk(e,t,p,l,i,"data"),[e,t,p,l,i]),m=j.useMemo(()=>pk(e,t,p,l,i,"assets"),[e,t,p,l,i]),y=j.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let v=new Set,S=!1;if(t.forEach(C=>{var _;let N=l.routes[C.route.id];!N||!N.hasLoader||(!g.some(T=>T.route.id===C.route.id)&&C.route.id in f&&((_=o[C.route.id])!=null&&_.shouldRevalidate)||N.hasClientLoader?S=!0:v.add(C.route.id))}),v.size===0)return[];let E=GN(e,d,a.unstable_trailingSlashAwareDataRequests,"data");return S&&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(()=>hR(m,l),[m,l]),k=wR(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:S})=>j.createElement("link",{key:v,nonce:n.nonce,...S,crossOrigin:S.crossOrigin??n.crossOrigin})))}function SR(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var NR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{NR&&(window.__reactRouterVersion="7.14.2")}catch{}function _R({basename:e,children:t,unstable_useTransitions:n,window:i}){let a=j.useRef();a.current==null&&(a.current=tO({window:i,v5Compat:!0}));let l=a.current,[o,d]=j.useState({action:l.action,location:l.location}),f=j.useCallback(p=>{n===!1?d(p):j.startTransition(()=>d(p))},[n]);return j.useLayoutEffect(()=>l.listen(f),[l,f]),j.createElement(eR,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:l,unstable_useTransitions:n})}var VN=/^(?:[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:p,to:g,preventScrollReset:m,viewTransition:y,unstable_defaultShouldRevalidate:b,...k},v){let{basename:S,navigator:E,unstable_useTransitions:C}=j.useContext(Ai),N=typeof g=="string"&&VN.test(g),_=IN(g,S);g=_.to;let T=LO(g,{relative:a}),M=hr(),O=null;if(d){let F=$p(d,[],M.unstable_mask?M.unstable_mask.pathname:"/",!0);S!=="/"&&(F.pathname=F.pathname==="/"?S:dr([S,F.pathname])),O=E.createHref(F)}let[R,B,U]=xR(i,k),K=AR(g,{replace:o,unstable_mask:d,state:f,target:p,preventScrollReset:m,relative:a,viewTransition:y,unstable_defaultShouldRevalidate:b,unstable_useTransitions:C});function q(F){t&&t(F),F.defaultPrevented||K(F)}let Y=!(_.isExternal||l),D=j.createElement("a",{...k,...U,href:(Y?O:void 0)||_.absoluteURL||T,onClick:Y?q:t,ref:SR(v,B),target:p,"data-discover":!N&&n==="render"?"true":void 0});return R&&!N?j.createElement(j.Fragment,null,D,j.createElement(vR,{page:T})):D});vs.displayName="Link";var YN=j.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:i="",end:a=!1,style:l,to:o,viewTransition:d,children:f,...p},g){let m=Vu(o,{relative:p.relative}),y=hr(),b=j.useContext(Up),{navigator:k,basename:v}=j.useContext(Ai),S=b!=null&&RR(m)&&d===!0,E=k.encodeLocation?k.encodeLocation(m).pathname:m.pathname,C=y.pathname,N=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(C=C.toLowerCase(),N=N?N.toLowerCase():null,E=E.toLowerCase()),N&&v&&(N=ga(N,v)||N);const _=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let T=C===E||!a&&C.startsWith(E)&&C.charAt(_)==="/",M=N!=null&&(N===E||!a&&N.startsWith(E)&&N.charAt(E.length)==="/"),O={isActive:T,isPending:M,isTransitioning:S},R=T?t:void 0,B;typeof i=="function"?B=i(O):B=[i,T?"active":null,M?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let U=typeof l=="function"?l(O):l;return j.createElement(vs,{...p,"aria-current":R,className:B,ref:g,style:U,to:o,viewTransition:d},typeof f=="function"?f(O):f)});YN.displayName="NavLink";var jR=j.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:i,replace:a,state:l,method:o=Zf,action:d,onSubmit:f,relative:p,preventScrollReset:g,viewTransition:m,unstable_defaultShouldRevalidate:y,...b},k)=>{let{unstable_useTransitions:v}=j.useContext(Ai),S=DR(),E=OR(d,{relative:p}),C=o.toLowerCase()==="get"?"get":"post",N=typeof d=="string"&&VN.test(d),_=T=>{if(f&&f(T),T.defaultPrevented)return;T.preventDefault();let M=T.nativeEvent.submitter,O=(M==null?void 0:M.getAttribute("formmethod"))||o,R=()=>S(M||T.currentTarget,{fetcherKey:t,method:O,navigate:n,replace:a,state:l,relative:p,preventScrollReset:g,viewTransition:m,unstable_defaultShouldRevalidate:y});v&&n!==!1?j.startTransition(()=>R()):R()};return j.createElement("form",{ref:k,method:C,action:E,onSubmit:i?f:_,...b,"data-discover":!N&&e==="render"?"true":void 0})});jR.displayName="Form";function CR(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function WN(e){let t=j.useContext(Xo);return Jt(t,CR(e)),t}function AR(e,{target:t,replace:n,unstable_mask:i,state:a,preventScrollReset:l,relative:o,viewTransition:d,unstable_defaultShouldRevalidate:f,unstable_useTransitions:p}={}){let g=ks(),m=hr(),y=Vu(e,{relative:o});return j.useCallback(b=>{if(sR(b,t)){b.preventDefault();let k=n!==void 0?n:ku(m)===ku(y),v=()=>g(e,{replace:k,unstable_mask:i,state:a,preventScrollReset:l,relative:o,viewTransition:d,unstable_defaultShouldRevalidate:f});p?j.startTransition(()=>v()):v()}},[m,g,y,n,i,a,t,e,l,o,d,f,p])}function QN(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(qy(e)),n=j.useRef(!1),i=hr(),a=j.useMemo(()=>lR(i.search,n.current?null:t.current),[i.search]),l=ks(),o=j.useCallback((d,f)=>{const p=qy(typeof d=="function"?d(new URLSearchParams(a)):d);n.current=!0,l("?"+p,f)},[l,a]);return[a,o]}var TR=0,MR=()=>`__${String(++TR)}__`;function DR(){let{router:e}=WN("useSubmit"),{basename:t}=j.useContext(Ai),n=YO(),i=e.fetch,a=e.navigate;return j.useCallback(async(l,o={})=>{let{action:d,method:f,encType:p,formData:g,body:m}=uR(l,t);if(o.navigate===!1){let y=o.fetcherKey||MR();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||p,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||p,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[i,a,t,n])}function OR(e,{relative:t}={}){let{basename:n}=j.useContext(Ai),i=j.useContext(Wi);Jt(i,"useFormAction must be used inside a RouteContext");let[a]=i.matches.slice(-1),l={...Vu(e||".",{relative:t})},o=hr();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:dr([n,l.pathname])),ku(l)}function RR(e,{relative:t}={}){let n=j.useContext(BN);Jt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=WN("useViewTransitionState"),a=Vu(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 pp(a.pathname,o)!=null||pp(a.pathname,l)!=null}bN();/**
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 LR=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),IR=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,i)=>i?i.toUpperCase():n.toLowerCase()),hk=e=>{const t=IR(e);return t.charAt(0).toUpperCase()+t.slice(1)},XN=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim(),zR=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 PR={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 BR=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,...PR,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:XN("lucide",a),...!l&&!zR(d)&&{"aria-hidden":"true"},...d},[...o.map(([p,g])=>j.createElement(p,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 Re=(e,t)=>{const n=j.forwardRef(({className:i,...a},l)=>j.createElement(BR,{ref:l,iconNode:t,className:XN(`lucide-${LR(hk(e))}`,`lucide-${e}`,i),...a}));return n.displayName=hk(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 $R=[["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"}]],qp=Re("activity",$R);/**
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 UR=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],FR=Re("arrow-down",UR);/**
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 qR=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],ZN=Re("arrow-left",qR);/**
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 HR=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],JN=Re("arrow-up",HR);/**
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 KR=[["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"}]],GR=Re("book-lock",KR);/**
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 VR=[["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"}]],YR=Re("brain",VR);/**
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 WR=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],QR=Re("check",WR);/**
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 XR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Yu=Re("chevron-down",XR);/**
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 ZR=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Jo=Re("chevron-right",ZR);/**
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 JR=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],eL=Re("chevron-up",JR);/**
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 tL=[["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"}]],Eu=Re("circle-alert",tL);/**
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 nL=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],mp=Re("circle-check-big",nL);/**
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 iL=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Su=Re("circle-check",iL);/**
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 rL=[["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"}]],e_=Re("circle-x",rL);/**
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 aL=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],t_=Re("clock",aL);/**
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 sL=[["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"}]],n_=Re("copy",sL);/**
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 lL=[["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"}]],gp=Re("cpu",lL);/**
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 oL=[["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"}]],Hp=Re("download",oL);/**
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 cL=[["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"}]],uL=Re("external-link",cL);/**
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 dL=[["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"}]],fL=Re("eye",dL);/**
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 pL=[["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"}]],mk=Re("file-code",pL);/**
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 hL=[["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"}]],Wu=Re("file-text",hL);/**
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 mL=[["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"}]],gL=Re("folder-git-2",mL);/**
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 yL=[["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"}]],i_=Re("folder-open",yL);/**
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 bL=[["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"}]],xL=Re("folder-plus",bL);/**
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 vL=[["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"}]],yp=Re("folder",vL);/**
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 wL=[["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"}]],kL=Re("funnel",wL);/**
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 EL=[["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"}]],SL=Re("git-branch",EL);/**
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 NL=[["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"}]],_L=Re("git-pull-request-arrow",NL);/**
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 jL=[["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"}]],CL=Re("globe",jL);/**
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 AL=[["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"}]],TL=Re("hammer",AL);/**
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 ML=[["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"}]],DL=Re("history",ML);/**
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 OL=[["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"}]],RL=Re("house",OL);/**
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 LL=[["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"}]],IL=Re("image",LL);/**
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 zL=[["path",{d:"M5 3v14",key:"9nsxs2"}],["path",{d:"M12 3v8",key:"1h2ygw"}],["path",{d:"M19 3v18",key:"1sk56x"}]],PL=Re("kanban",zL);/**
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 BL=[["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"}]],$L=Re("key-round",BL);/**
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 UL=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],FL=Re("languages",UL);/**
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 qL=[["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"}]],r_=Re("layout-grid",qL);/**
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 HL=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Xe=Re("loader-circle",HL);/**
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 KL=[["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"}]],gk=Re("message-circle",KL);/**
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 GL=[["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"}]],a_=Re("message-square",GL);/**
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 VL=[["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"}]],YL=Re("moon",VL);/**
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 WL=[["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"}]],s_=Re("network",WL);/**
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 QL=[["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"}]],l_=Re("notebook-pen",QL);/**
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 XL=[["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"}]],ZL=Re("panel-right-close",XL);/**
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 JL=[["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"}]],e3=Re("paperclip",JL);/**
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 t3=[["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"}]],n3=Re("pause",t3);/**
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 i3=[["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"}]],Kp=Re("pen-line",i3);/**
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 r3=[["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"}]],o_=Re("pencil",r3);/**
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 a3=[["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"}]],Qu=Re("play",a3);/**
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 s3=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],hi=Re("plus",s3);/**
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 l3=[["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"}]],o3=Re("puzzle",l3);/**
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 c3=[["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"}]],c_=Re("radio",c3);/**
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 u3=[["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=Re("refresh-cw",u3);/**
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 d3=[["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"}]],Fb=Re("rotate-ccw",d3);/**
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 f3=[["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"}]],p3=Re("rows-3",f3);/**
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 h3=[["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"}]],mr=Re("save",h3);/**
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 m3=[["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"}]],qb=Re("scroll-text",m3);/**
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 g3=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],fl=Re("search",g3);/**
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 y3=[["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"}]],u_=Re("settings",y3);/**
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 b3=[["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"}]],d_=Re("shield-check",b3);/**
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 x3=[["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"}]],v3=Re("skull",x3);/**
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 w3=[["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"}]],pl=Re("sparkles",w3);/**
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 k3=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Hb=Re("square",k3);/**
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 E3=[["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"}]],f_=Re("star",E3);/**
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 S3=[["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"}]],N3=Re("sun",S3);/**
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 _3=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],p_=Re("terminal",_3);/**
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 j3=[["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"}]],C3=Re("timer-reset",j3);/**
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 A3=[["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"}]],T3=Re("timer",A3);/**
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 M3=[["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"}]],Vi=Re("trash-2",M3);/**
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 D3=[["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"}]],O3=Re("triangle-alert",D3);/**
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 R3=[["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"}]],h_=Re("upload",R3);/**
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 L3=[["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"}]],m_=Re("users",L3);/**
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 I3=[["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"}]],Kb=Re("workflow",I3);/**
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 z3=[["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"}]],g_=Re("wrench",z3);/**
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 P3=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],gn=Re("x",P3);/**
461
+ * @license lucide-react v0.544.0 - ISC
462
+ *
463
+ * This source code is licensed under the ISC license.
464
+ * See the LICENSE file in the root directory of this source tree.
465
+ */const B3=[["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"}]],$3=Re("zap",B3),U3={"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:
466
+ {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.domain":"domain","skills.category.persona":"persona","skills.category.workflow":"workflow","skills.category.engine":"engine","skills.category.genre":"genre","skills.category.platform":"platform","skills.category.review":"review","skills.category.meta":"meta","skills.category.other":"other","skills.tags.title":"Tags","skills.tags.clear":"Clear","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","skillDetail.edit":"Edit","skillDetail.translate":"ZH/EN","skillDetail.delete":"Delete","skillDetail.save":"Save","skillDetail.cancel":"Cancel","skillDetail.translating":"Translating…","skillDetail.saving":"Saving…","skillDetail.editHint":"Edit the raw SKILL.md (incl. frontmatter). After saving, run `sps skill lint` to check the taxonomy & format.","skillDetail.deleteConfirm":'Delete "{name}" from the library? The whole directory is removed — this cannot be undone.',"skillDetail.translateFailed":"Translate failed: {detail}","skillDetail.saveFailed":"Save failed: {detail}","skillDetail.deleteFailed":"Delete failed: {detail}","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:
467
+ {cmd}`,"system.upgrade.copy.fail.title":"Copy failed","system.upgrade.copy.fail.body":`Copy manually:
468
+ {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}
469
+ {path}
470
+ Click to preview`,"chat.attachment.previewSimpleTooltip":`{name}
471
+ 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.viewPrompt":"View prompt","cardModal.prompt.title":"Worker prompt (preview)","cardModal.prompt.loading":"Rebuilding prompt…","cardModal.prompt.error":"Failed: {detail}","cardModal.prompt.copy":"Copy","cardModal.prompt.copied":"Copied","cardModal.prompt.metaSkills":"skills: {skills}","cardModal.prompt.metaMemory":"memory block","cardModal.prompt.metaGit":"git mode","cardModal.prompt.metaNonGit":"non-git","cardModal.prompt.nativeTitle":"Also read natively by claude (not in this string):","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…"},F3={"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":`项目已删除。同时清理了:
472
+ {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.domain":"领域","skills.category.persona":"角色","skills.category.workflow":"流程","skills.category.engine":"引擎","skills.category.genre":"品类","skills.category.platform":"平台","skills.category.review":"审核","skills.category.meta":"工具","skills.category.other":"其它","skills.tags.title":"标签","skills.tags.clear":"清除","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":"收起","skillDetail.edit":"编辑","skillDetail.translate":"中英转换","skillDetail.delete":"删除","skillDetail.save":"保存","skillDetail.cancel":"取消","skillDetail.translating":"翻译中…","skillDetail.saving":"保存中…","skillDetail.editHint":"直接编辑整份 SKILL.md(含 frontmatter)。保存后建议跑 `sps skill lint` 校验三轴与格式。","skillDetail.deleteConfirm":"确定从库中删除「{name}」?整目录会被移除,此操作不可撤销。","skillDetail.translateFailed":"翻译失败:{detail}","skillDetail.saveFailed":"保存失败:{detail}","skillDetail.deleteFailed":"删除失败:{detail}","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":`粘贴到终端运行即可:
473
+ {cmd}`,"system.upgrade.copy.fail.title":"复制失败","system.upgrade.copy.fail.body":`请手动复制:
474
+ {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}
475
+ {path}
476
+ 点击预览`,"chat.attachment.previewSimpleTooltip":`{name}
477
+ 点击放大`,"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.viewPrompt":"查看 prompt","cardModal.prompt.title":"注入 worker 的提示词(预览)","cardModal.prompt.loading":"重建提示词中…","cardModal.prompt.error":"获取失败:{detail}","cardModal.prompt.copy":"复制","cardModal.prompt.copied":"已复制","cardModal.prompt.metaSkills":"skills:{skills}","cardModal.prompt.metaMemory":"记忆块","cardModal.prompt.metaGit":"git 模式","cardModal.prompt.metaNonGit":"非 git","cardModal.prompt.nativeTitle":"claude 另原生读入(不在本串里):","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":"高亮文件…"},y_=j.createContext(null),b_="sps-console-lang";function q3(){if(typeof window>"u")return"en";try{const e=window.localStorage.getItem(b_);if(e==="en"||e==="zh")return e}catch{}return"en"}function H3(e){try{window.localStorage.setItem(b_,e)}catch{}}function K3({children:e}){const[t,n]=j.useState(()=>q3());j.useEffect(()=>{typeof document<"u"&&(document.documentElement.lang=t==="zh"?"zh-CN":"en")},[t]);const i=j.useCallback(o=>{n(o),H3(o)},[]),a=j.useMemo(()=>{const o=t==="zh"?F3:U3;return(d,f)=>{let p=o[d]??d;if(f)for(const[g,m]of Object.entries(f))m!==void 0&&(p=p.replace(`{${g}}`,String(m)));return p}},[t]),l=j.useMemo(()=>({lang:t,setLang:i,t:a}),[t,i,a]);return c.jsx(y_.Provider,{value:l,children:e})}function x_(){const e=j.useContext(y_);if(!e)throw new Error("useLang must be used inside I18nProvider");return e}function Pe(){return x_().t}function G3(){const{lang:e,setLang:t,t:n}=x_();return c.jsxs("div",{role:"group","aria-label":n("lang.toggle.aria"),className:"dimension-segmented flex-1 min-w-0",children:[c.jsx(yk,{active:e==="en",onClick:()=>t("en"),label:n("lang.en"),ariaLabel:"English"}),c.jsx(yk,{active:e==="zh",onClick:()=>t("zh"),label:n("lang.zh"),ariaLabel:"中文"})]})}function yk({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 v_="sps-console-theme";function w_(){if(typeof window>"u")return"dark";try{const e=window.localStorage.getItem(v_);if(e==="dark"||e==="light")return e}catch{}return"dark"}function Hy(e){typeof document>"u"||(document.documentElement.dataset.theme=e)}function V3(e){try{window.localStorage.setItem(v_,e)}catch{}}function Y3(){const e=w_();return Hy(e),e}const W3=["dark","light"];function Q3(){const e=Pe(),[t,n]=j.useState(()=>w_());j.useEffect(()=>{Hy(t)},[t]);const i=j.useCallback(a=>{n(a),V3(a),Hy(a)},[]);return c.jsx("div",{role:"group","aria-label":e("theme.toggle.aria"),className:"dimension-segmented shrink-0",children:W3.map(a=>{const l=t===a,o=a==="dark"?YL:N3;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 X3=[{to:"/chat",labelKey:"nav.chat",icon:a_},{to:"/projects",labelKey:"nav.projects",icon:r_},{to:"/board",labelKey:"nav.board",icon:PL},{to:"/workers",labelKey:"nav.workers",icon:m_},{to:"/skills",labelKey:"nav.skills",icon:CL},{to:"/prompts",labelKey:"nav.prompts",icon:l_},{to:"/arrange",labelKey:"nav.arrange",icon:Kb},{to:"/plugins",labelKey:"nav.plugins",icon:o3},{to:"/system",labelKey:"nav.system",icon:u_},{to:"/processes",labelKey:"nav.processes",icon:gp},{to:"/audit",labelKey:"nav.audit",icon:qb},{to:"/memory",labelKey:"nav.memory",icon:YR}];function Z3(){const e=Pe();return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"shrink-0 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(pl,{size:20,strokeWidth:2.5}),e("app.title")]}),c.jsx("nav",{className:"flex flex-1 min-h-0 flex-col gap-0.5 mt-2 overflow-y-auto pr-1","aria-label":e("nav.aria"),children:X3.map(t=>{const n=t.icon;return c.jsxs(YN,{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:"shrink-0 pt-3 flex items-center gap-2",children:[c.jsx(G3,{}),c.jsx(Q3,{})]})]})}class J3 extends Error{constructor(t,n,i){super(n),this.status=t,this.detail=i,this.name="ApiError"}}async function Gb(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 J3(e.status,i,n)}async function ct(e){const t=await fetch(e,{headers:{Accept:"application/json"}});if(!t.ok)throw await Gb(t);return await t.json()}async function gr(e,t){return E_("POST",e,t)}async function Vb(e,t){return E_("PUT",e,t)}async function k_(e){const t=await fetch(e,{method:"DELETE",headers:{Accept:"application/json"}});if(!t.ok)throw await Gb(t)}async function E_(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 Gb(i);return await i.json()}function S_(){return ct("/api/system/info")}function eI(){return ct("/api/system/env")}function tI(){return ct("/api/system/env/raw")}async function nI(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 iI(){return ct("/api/system/memory")}async function rI(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 Yb(){return ct("/api/system/agents")}async function aI(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 sI(){return ct("/api/system/latest-version")}async function lI(){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 oI(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 ct("/api/projects")}function cI(e){return ct(`/api/projects/${encodeURIComponent(e)}`)}async function uI(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 dI(e){return ct(`/api/projects/${encodeURIComponent(e)}/conf`)}async function fI(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 pI(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 hI(e){return ct(`/api/projects/${encodeURIComponent(e)}/pipelines`)}async function mI(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 gI(e,t){return ct(`/api/projects/${encodeURIComponent(e)}/pipelines/${encodeURIComponent(t)}`)}async function yI(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 bI(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 xI(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 vI(){var f;const e=Pe(),t=Ve({queryKey:["system-info"],queryFn:S_,refetchInterval:3e4}),n=Ve({queryKey:["projects"],queryFn:Es,refetchInterval:1e4}),i=kI(),a=!t.isError,l=((f=n.data)==null?void 0:f.data)??[],o=l.filter(p=>p.pipelineStatus==="running").length,d=l.reduce((p,g)=>p+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(wI,{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(qp,{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(c_,{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 wI({state:e}){const t=Pe();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(Eu,{size:9,strokeWidth:2.5}),t("status.sse.down")]})}function kI(){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 bk({contentMode:e="workspace"}){const t=e==="workspace"?"overflow-hidden":"overflow-auto";return c.jsxs("div",{className:"grid grid-cols-[240px_1fr] grid-rows-[minmax(0,1fr)_40px] h-dvh overflow-hidden",children:[c.jsx("aside",{className:"row-start-1 min-h-0 overflow-hidden border-r-[3px] border-[var(--color-text)] bg-[var(--color-bg)] p-4 flex flex-col",children:c.jsx(Z3,{})}),c.jsx("main",{className:["row-start-1 min-h-0 p-6 flex flex-col gap-4",t].join(" "),children:c.jsx(JO,{})}),c.jsx("footer",{className:"col-span-2 row-start-2 border-t-[3px] border-[var(--color-text)] bg-[var(--color-bg)]",children:c.jsx(vI,{})})]})}function Ky(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 EI(){typeof window>"u"||(window.addEventListener("error",e=>{Ky(e.error??e.message??"unknown error","window.error")}),window.addEventListener("unhandledrejection",e=>{const t=e.reason;Ky(t instanceof Error?t:String(t),"unhandledrejection")}))}class SI extends j.Component{constructor(){super(...arguments);B1(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,i){var a;Ky(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 Wb(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 Sf=e=>e.lastActivityAt?Date.parse(e.lastActivityAt):0;function N_(e,t){const n=[...e];return t==="name"?n.sort((i,a)=>i.name.localeCompare(a.name)):t==="date"?n.sort((i,a)=>Sf(a)-Sf(i)):n.sort((i,a)=>{const l=i.pipelineStatus==="running"?1:0,o=a.pipelineStatus==="running"?1:0;return l!==o?o-l:Sf(a)-Sf(i)})}function NI(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 _I(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),ct(`/api/logs?${t}`)}function jI(e){return ct(`/api/logs/sources?project=${encodeURIComponent(e)}`)}const CI=["error","warn","info","debug"],AI=["error","warn","info"];function TI({project:e,initialWorker:t}){const n=Pe(),i=t??"",[a,l]=j.useState([]),[o,d]=j.useState(!1),[f,p]=j.useState(!0),[g,m]=j.useState(()=>new Set(AI)),[y,b]=j.useState(""),[k,v]=j.useState("live"),[S,E]=j.useState(()=>{const q=new Date(Date.now()-36e5),Y=D=>String(D).padStart(2,"0");return`${q.getFullYear()}-${Y(q.getMonth()+1)}-${Y(q.getDate())}T${Y(q.getHours())}:${Y(q.getMinutes())}`}),C=j.useRef(null),[N,_]=j.useState(""),{data:T}=Ve({queryKey:["log-sources",e],queryFn:()=>jI(e),enabled:!!e,refetchInterval:5e3}),M=j.useMemo(()=>(T==null?void 0:T.sources)??[],[T]),O=M.find(q=>q.key===N)??(i?M.find(q=>q.worker===Number(i)):void 0)??M.find(q=>q.kind==="pipeline")??M[0],R=O==null?void 0:O.file;j.useEffect(()=>{l([])},[e,R]);const{data:B,refetch:U}=Ve({queryKey:["logs",e,R,k,k==="history"?S:"live"],queryFn:()=>_I({project:e,file:R,limit:k==="history"?2e3:500,since:k==="history"?new Date(S).toISOString():void 0}),enabled:!!e,refetchInterval:k==="live"&&!o?2500:!1});j.useEffect(()=>{B!=null&&B.data&&l(B.data)},[B]),j.useEffect(()=>{if(!f)return;const q=C.current;q&&(q.scrollTop=q.scrollHeight)},[a,f]);const K=j.useMemo(()=>{const q=y.toLowerCase();return a.filter(Y=>!(!g.has(Y.level)||q&&!Y.msg.toLowerCase().includes(q)))},[a,g,y]);return c.jsxs("div",{className:"flex h-full min-h-0 max-w-full flex-col gap-3",children:[M.length>0&&c.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 flex-wrap",children:[M.filter(q=>q.worker==null).map(q=>c.jsx(xk,{s:q,active:(O==null?void 0:O.key)===q.key,onClick:()=>_(q.key)},q.key)),c.jsx("div",{className:"ml-auto flex items-center gap-1.5 flex-wrap",children:M.filter(q=>q.worker!=null).map(q=>c.jsx(xk,{s:q,active:(O==null?void 0:O.key)===q.key,onClick:()=>_(q.key)},q.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(c_,{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(DL,{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:S,onChange:q=>E(q.target.value),"aria-label":n("logs.history.startAria")}),c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 12px",fontSize:12},onClick:()=>U(),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:q=>b(q.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:CI.map(q=>c.jsx(MI,{level:q,enabled:g.has(q),onToggle:()=>{m(Y=>{const D=new Set(Y);return D.has(q)?D.delete(q):D.add(q),D})}},q))}),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:()=>p(q=>!q),type:"button",children:f?"✓ Auto-scroll":"Auto-scroll"}),c.jsx("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>d(q=>!q),type:"button",children:o?c.jsxs(c.Fragment,{children:[c.jsx(Qu,{size:12,strokeWidth:3})," Resume"]}):c.jsxs(c.Fragment,{children:[c.jsx(n3,{size:12,strokeWidth:3})," Pause"]})})]}),c.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>{const q=new Blob([K.map(F=>F.raw).join(`
478
+ `)],{type:"text/plain"}),Y=URL.createObjectURL(q),D=document.createElement("a");D.href=Y,D.download=`${e}-log-${Date.now()}.log`,D.click(),URL.revokeObjectURL(Y)},type:"button",children:[c.jsx(Hp,{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-surface-soft 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:[(B==null?void 0:B.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:q=>{const Y=q.currentTarget;!(Y.scrollHeight-Y.scrollTop-Y.clientHeight<40)&&f&&p(!1)},children:[K.map((q,Y)=>c.jsx(DI,{line:q},Y)),K.length===0&&c.jsx("div",{className:"text-center py-12 text-[var(--color-text-subtle)]",children:n("logs.empty.match")})]})]})]})}function MI({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 DI({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 xk({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 OI({title:e,body:t,confirm:n,cancel:i,onConfirm:a,onCancel:l,danger:o}){const d=Pe();return j.useEffect(()=>{const f=p=>{p.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 __=j.createContext(null);function RI({children:e}){const t=Pe(),[n,i]=j.useState(null),a=j.useCallback(d=>new Promise(f=>{i({kind:"confirm",opts:d,resolve:p=>{i(null),f(p)}})}),[]),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:p=>{i(null),f(p)}})}),[]);return c.jsxs(__.Provider,{value:{confirm:a,alert:l,prompt:o},children:[e,(n==null?void 0:n.kind)==="confirm"&&c.jsx(OI,{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(LI,{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(II,{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(__);if(!e)throw new Error("useDialog must be used inside <DialogProvider>");return e}function LI({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 II({title:e,body:t,placeholder:n,defaultValue:i,confirm:a,cancel:l,onConfirm:o,onCancel:d}){const[f,p]=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=>p(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 Qb=Symbol.for("yaml.alias"),Gy=Symbol.for("yaml.document"),xs=Symbol.for("yaml.map"),j_=Symbol.for("yaml.pair"),Lr=Symbol.for("yaml.scalar"),ec=Symbol.for("yaml.seq"),Yi=Symbol.for("yaml.node.type"),Ss=e=>!!e&&typeof e=="object"&&e[Yi]===Qb,wl=e=>!!e&&typeof e=="object"&&e[Yi]===Gy,tc=e=>!!e&&typeof e=="object"&&e[Yi]===xs,en=e=>!!e&&typeof e=="object"&&e[Yi]===j_,Gt=e=>!!e&&typeof e=="object"&&e[Yi]===Lr,nc=e=>!!e&&typeof e=="object"&&e[Yi]===ec;function on(e){if(e&&typeof e=="object")switch(e[Yi]){case xs:case ec:return!0}return!1}function cn(e){if(e&&typeof e=="object")switch(e[Yi]){case Qb:case xs:case Lr:case ec:return!0}return!1}const C_=e=>(Gt(e)||on(e))&&!!e.anchor,fi=Symbol("break visit"),A_=Symbol("skip children"),Or=Symbol("remove node");function kl(e,t){const n=T_(t);wl(e)?go(null,e.contents,n,Object.freeze([e]))===Or&&(e.contents=null):go(null,e,n,Object.freeze([]))}kl.BREAK=fi;kl.SKIP=A_;kl.REMOVE=Or;function go(e,t,n,i){const a=M_(e,t,n,i);if(cn(a)||en(a))return D_(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===Or&&(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===Or&&(t.key=null);const o=go("value",t.value,n,i);if(o===fi)return fi;o===Or&&(t.value=null)}}return a}async function Gp(e,t){const n=T_(t);wl(e)?await yo(null,e.contents,n,Object.freeze([e]))===Or&&(e.contents=null):await yo(null,e,n,Object.freeze([]))}Gp.BREAK=fi;Gp.SKIP=A_;Gp.REMOVE=Or;async function yo(e,t,n,i){const a=await M_(e,t,n,i);if(cn(a)||en(a))return D_(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===Or&&(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===Or&&(t.key=null);const o=await yo("value",t.value,n,i);if(o===fi)return fi;o===Or&&(t.value=null)}}return a}function T_(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 M_(e,t,n,i){var a,l,o,d,f;if(typeof n=="function")return n(e,t,i);if(tc(t))return(a=n.Map)==null?void 0:a.call(n,e,t,i);if(nc(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(Gt(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 D_(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 zI={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},PI=e=>e.replace(/[!,[\]{}]/g,t=>zI[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+PI(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(`
479
+ `)}}ti.defaultYaml={explicit:!1,version:"1.2"};ti.defaultTags={"!!":"tag:yaml.org,2002:"};function O_(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 R_(e){const t=new Set;return kl(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function L_(e,t){for(let n=1;;++n){const i=`${e}${n}`;if(!t.has(i))return i}}function BI(e,t){const n=[],i=new Map;let a=null;return{onAnchor:l=>{n.push(l),a??(a=R_(e));const o=L_(t,a);return a.add(o),o},setAnchors:()=>{for(const l of n){const o=i.get(l);if(typeof o=="object"&&o.anchor&&(Gt(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||!C_(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 Xb{constructor(t){Object.defineProperty(this,Yi,{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:p}of o.anchors.values())a(p,f);return typeof l=="function"?bo(l,{"":d},"",d):d}}class Vp extends Xb{constructor(t){super(Qb),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)||C_(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=ep(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(O_(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 ep(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=ep(e,a,n);l>i&&(i=l)}return i}else if(en(t)){const i=ep(e,t.key,n),a=ep(e,t.value,n);return Math.max(i,a)}return 1}const I_=e=>!e||typeof e!="function"&&typeof e!="object";class st extends Xb{constructor(t){super(Lr),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 $I="tag:yaml.org,2002:";function UI(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 Nu(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 Vp(f.anchor);f={anchor:null,node:null},d.set(e,f)}t!=null&&t.startsWith("!!")&&(t=$I+t.slice(2));let p=UI(e,t,o.tags);if(!p){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const k=new st(e);return f&&(f.node=k),k}p=e instanceof Map?o[xs]:Symbol.iterator in Object(e)?o[ec]:o[xs]}l&&(l(p),delete n.onTagObj);const g=p!=null&&p.createNode?p.createNode(n.schema,e,n):typeof((b=p==null?void 0:p.nodeClass)==null?void 0:b.from)=="function"?p.nodeClass.from(n.schema,e,n):new st(e);return t?g.tag=t:p.default||(g.tag=p.tag),f&&(f.node=g),g}function bp(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 Nu(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 uu=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class z_ extends Xb{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(uu(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,bp(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&&Gt(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&&Gt(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,bp(this.schema,a,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${a}`)}}}const FI=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function da(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Qs=(e,t,n)=>e.endsWith(`
480
+ `)?da(n,t):n.includes(`
481
+ `)?`
482
+ `+da(n,t):(e.endsWith(" ")?"":" ")+n,P_="flow",Vy="block",tp="quoted";function Yp(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 p=[],g={};let m=a-t.length;typeof i=="number"&&(i>a-Math.max(2,l)?p.push(0):m=a-i);let y,b,k=!1,v=-1,S=-1,E=-1;n===Vy&&(v=vk(e,v,t.length),v!==-1&&(m=v+f));for(let N;N=e[v+=1];){if(n===tp&&N==="\\"){switch(S=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(N===`
483
+ `)n===Vy&&(v=vk(e,v,t.length)),m=v+t.length+f,y=void 0;else{if(N===" "&&b&&b!==" "&&b!==`
484
+ `&&b!==" "){const _=e[v+1];_&&_!==" "&&_!==`
485
+ `&&_!==" "&&(y=v)}if(v>=m)if(y)p.push(y),m=y+f,y=void 0;else if(n===tp){for(;b===" "||b===" ";)b=N,N=e[v+=1],k=!0;const _=v>E+1?v-2:S-1;if(g[_])return e;p.push(_),g[_]=!0,m=_+f,y=void 0}else k=!0}b=N}if(k&&d&&d(),p.length===0)return e;o&&o();let C=e.slice(0,p[0]);for(let N=0;N<p.length;++N){const _=p[N],T=p[N+1]||e.length;_===0?C=`
486
+ ${t}${e.slice(0,T)}`:(n===tp&&g[_]&&(C+=`${e[_]}\\`),C+=`
487
+ ${t}${e.slice(_+1,T)}`)}return C}function vk(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!==`
488
+ `);i=t,a=t+1,l=e[a]}return i}const Wp=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Qp=e=>/^(%|---|\.\.\.)/m.test(e);function qI(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]===`
489
+ `){if(l-o>i)return!0;if(o=l+1,a-o<=i)return!1}return!0}function pu(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:i}=t,a=t.options.doubleQuotedMinMultiLineLength,l=t.indent||(Qp(e)?" ":"");let o="",d=0;for(let f=0,p=n[f];p;p=n[++f])if(p===" "&&n[f+1]==="\\"&&n[f+2]==="n"&&(o+=n.slice(d,f)+"\\ ",f+=1,d=f,p="\\"),p==="\\")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)+`
490
+
491
+ `;n[f+2]==="\\"&&n[f+3]==="n"&&n[f+4]!=='"';)o+=`
492
+ `,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:Yp(o,l,tp,Wp(t,!1))}function Yy(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
493
+ `)||/[ \t]\n|\n[ \t]/.test(e))return pu(e,t);const n=t.indent||(Qp(e)?" ":""),i="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
494
+ ${n}`)+"'";return t.implicitKey?i:Yp(i,n,P_,Wp(t,!1))}function xo(e,t){const{singleQuote:n}=t.options;let i;if(n===!1)i=pu;else{const a=e.includes('"'),l=e.includes("'");a&&!l?i=Yy:l&&!a?i=pu:i=n?Yy:pu}return i(e,t)}let Wy;try{Wy=new RegExp(`(^|(?<!
495
+ ))
496
+ +(?!
497
+ |$)`,"g")}catch{Wy=/\n+(?!\n|$)/g}function np({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 p=i.indent||(i.forceBlockIndent||Qp(n)?" ":""),g=o==="literal"?!0:o==="folded"||t===st.BLOCK_FOLDED?!1:t===st.BLOCK_LITERAL?!0:!qI(n,f,p.length);if(!n)return g?`|
498
+ `:`>
499
+ `;let m,y;for(y=n.length;y>0;--y){const T=n[y-1];if(T!==`
500
+ `&&T!==" "&&T!==" ")break}let b=n.substring(y);const k=b.indexOf(`
501
+ `);k===-1?m="-":n===b||k!==b.length-1?(m="+",l&&l()):m="",b&&(n=n.slice(0,-b.length),b[b.length-1]===`
502
+ `&&(b=b.slice(0,-1)),b=b.replace(Wy,`$&${p}`));let v=!1,S,E=-1;for(S=0;S<n.length;++S){const T=n[S];if(T===" ")v=!0;else if(T===`
503
+ `)E=S;else break}let C=n.substring(0,E<S?E+1:S);C&&(n=n.substring(C.length),C=C.replace(/\n+/g,`$&${p}`));let _=(v?p?"2":"1":"")+m;if(e&&(_+=" "+d(e.replace(/ ?[\r\n]+/g," ")),a&&a()),!g){const T=n.replace(/\n+/g,`
504
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${p}`);let M=!1;const O=Wp(i,!0);o!=="folded"&&t!==st.BLOCK_FOLDED&&(O.onOverflow=()=>{M=!0});const R=Yp(`${C}${T}${b}`,p,Vy,O);if(!M)return`>${_}
505
+ ${p}${R}`}return n=n.replace(/\n+/g,`$&${p}`),`|${_}
506
+ ${p}${C}${n}${b}`}function HI(e,t,n,i){const{type:a,value:l}=e,{actualString:o,implicitKey:d,indent:f,indentStep:p,inFlow:g}=t;if(d&&l.includes(`
507
+ `)||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(`
508
+ `)?xo(l,t):np(e,t,n,i);if(!d&&!g&&a!==st.PLAIN&&l.includes(`
509
+ `))return np(e,t,n,i);if(Qp(l)){if(f==="")return t.forceBlockIndent=!0,np(e,t,n,i);if(d&&f===p)return xo(l,t)}const m=l.replace(/\n+/g,`$&
510
+ ${f}`);if(o){const y=v=>{var S;return v.default&&v.tag!=="tag:yaml.org,2002:str"&&((S=v.test)==null?void 0:S.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:Yp(m,f,P_,Wp(t,!1))}function Xu(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):np(o,t,n,i);case st.QUOTE_DOUBLE:return pu(o.value,t);case st.QUOTE_SINGLE:return Yy(o.value,t);case st.PLAIN:return HI(o,t,n,i);default:return null}};let p=f(d);if(p===null){const{defaultKeyType:g,defaultStringType:m}=t.options,y=a&&g||m;if(p=f(y),p===null)throw new Error(`Unsupported default string type ${y}`)}return p}function B_(e,t){const n=Object.assign({blockQuote:!0,commentString:FI,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 KI(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(Gt(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 GI(e,t,{anchors:n,doc:i}){if(!i.directives)return"";const a=[],l=(Gt(e)||on(e))&&e.anchor;l&&O_(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 $o(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:p=>a=p});a??(a=KI(t.doc.schema.tags,l));const o=GI(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):Gt(l)?Xu(l,t,n,i):l.toString(t,n,i);return o?Gt(l)||d[0]==="{"||d[0]==="["?`${o} ${d}`:`${o}
511
+ ${t.indent}${d}`:d}function VI({key:e,value:t},n,i,a){const{allNullValues:l,doc:o,indent:d,indentStep:f,options:{commentString:p,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 O="With simple keys, collection cannot be used as a key value";throw new Error(O)}}let b=!m&&(!e||y&&t==null&&!n.inFlow||on(e)||(Gt(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,S=$o(e,n,()=>k=!0,()=>v=!0);if(!b&&!n.inFlow&&S.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(),S===""?"?":b?`? ${S}`:S}else if(l&&!m||t==null&&b)return S=`? ${S}`,y&&!k?S+=Qs(S,n.indent,p(y)):v&&a&&a(),S;k&&(y=null),b?(y&&(S+=Qs(S,n.indent,p(y))),S=`? ${S}
512
+ ${d}:`):(S=`${S}:`,y&&(S+=Qs(S,n.indent,p(y))));let E,C,N;cn(t)?(E=!!t.spaceBefore,C=t.commentBefore,N=t.comment):(E=!1,C=null,N=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!b&&!y&&Gt(t)&&(n.indentAtStart=S.length+1),v=!1,!g&&f.length>=2&&!n.inFlow&&!b&&nc(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let _=!1;const T=$o(t,n,()=>_=!0,()=>v=!0);let M=" ";if(y||E||C){if(M=E?`
513
+ `:"",C){const O=p(C);M+=`
514
+ ${da(O,n.indent)}`}T===""&&!n.inFlow?M===`
515
+ `&&N&&(M=`
516
+
517
+ `):M+=`
518
+ ${n.indent}`}else if(!b&&on(t)){const O=T[0],R=T.indexOf(`
519
+ `),B=R!==-1,U=n.inFlow??t.flow??t.items.length===0;if(B||!U){let K=!1;if(B&&(O==="&"||O==="!")){let q=T.indexOf(" ");O==="&"&&q!==-1&&q<R&&T[q+1]==="!"&&(q=T.indexOf(" ",q+1)),(q===-1||R<q)&&(K=!0)}K||(M=`
520
+ ${n.indent}`)}}else(T===""||T[0]===`
521
+ `)&&(M="");return S+=M+T,n.inFlow?_&&i&&i():N&&!_?S+=Qs(S,n.indent,p(N)):v&&a&&a(),S}function $_(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Nf="<<",pa={identify:e=>e===Nf||typeof e=="symbol"&&e.description===Nf,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new st(Symbol(Nf)),{addToJSMap:U_}),stringify:()=>Nf},YI=(e,t)=>(pa.identify(t)||Gt(t)&&(!t.type||t.type===st.PLAIN)&&pa.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===pa.tag&&n.default));function U_(e,t,n){if(n=e&&Ss(n)?n.resolve(e.doc):n,nc(n))for(const i of n.items)Rg(e,t,i);else if(Array.isArray(n))for(const i of n)Rg(e,t,i);else Rg(e,t,n)}function Rg(e,t,n){const i=e&&Ss(n)?n.resolve(e.doc):n;if(!tc(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 F_(e,t,{key:n,value:i}){if(cn(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(YI(e,n))U_(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=WI(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 WI(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(cn(e)&&(n!=null&&n.doc)){const i=B_(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)+'..."'),$_(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 Zb(e,t,n){const i=Nu(e,void 0,n),a=Nu(t,void 0,n);return new Vn(i,a)}class Vn{constructor(t,n=null){Object.defineProperty(this,Yi,{value:j_}),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 F_(n,i,this)}toString(t,n,i){return t!=null&&t.doc?VI(this,t,n,i):JSON.stringify(this)}}function q_(e,t,n){return(t.inFlow??e.flow?XI:QI)(e,t,n)}function QI({comment:e,items:t},n,{blockItemPrefix:i,flowChars:a,itemIndent:l,onChompKeep:o,onComment:d}){const{indent:f,options:{commentString:p}}=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 S=null;if(cn(v))!m&&v.spaceBefore&&y.push(""),xp(n,y,v.commentBefore,m),v.comment&&(S=v.comment);else if(en(v)){const C=cn(v.key)?v.key:null;C&&(!m&&C.spaceBefore&&y.push(""),xp(n,y,C.commentBefore,m))}m=!1;let E=$o(v,g,()=>S=null,()=>m=!0);S&&(E+=Qs(E,l,p(S))),m&&S&&(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?`
522
+ ${f}${v}`:`
523
+ `}}return e?(b+=`
524
+ `+da(p(e),f),d&&d()):m&&o&&o(),b}function XI({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 p=!1,g=0;const m=[];for(let k=0;k<e.length;++k){const v=e[k];let S=null;if(cn(v))v.spaceBefore&&m.push(""),xp(t,m,v.commentBefore,!1),v.comment&&(S=v.comment);else if(en(v)){const C=cn(v.key)?v.key:null;C&&(C.spaceBefore&&m.push(""),xp(t,m,C.commentBefore,!1),C.comment&&(p=!0));const N=cn(v.value)?v.value:null;N?(N.comment&&(S=N.comment),N.commentBefore&&(p=!0)):v.value==null&&(C!=null&&C.comment)&&(S=C.comment)}S&&(p=!0);let E=$o(v,f,()=>S=null);p||(p=m.length>g||E.includes(`
525
+ `)),k<e.length-1?E+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(p||(p=m.reduce((C,N)=>C+N.length+2,2)+(E.length+2)>t.options.lineWidth)),p&&(E+=",")),S&&(E+=Qs(E,i,d(S))),m.push(E),g=m.length}const{start:y,end:b}=n;if(m.length===0)return y+b;if(!p){const k=m.reduce((v,S)=>v+S.length+2,2);p=t.options.lineWidth>0&&k>t.options.lineWidth}if(p){let k=y;for(const v of m)k+=v?`
526
+ ${l}${a}${v}`:`
527
+ `;return`${k}
528
+ ${a}${b}`}else return`${y}${o}${m.join(" ")}${o}${b}`}function xp({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=Gt(t)?t.value:t;for(const i of e)if(en(i)&&(i.key===t||i.key===n||Gt(i.key)&&i.key.value===n))return i}class Ni extends z_{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,p)=>{if(typeof l=="function")p=l.call(n,f,p);else if(Array.isArray(l)&&!l.includes(f))return;(p!==void 0||a)&&o.items.push(Zb(f,p,i))};if(n instanceof Map)for(const[f,p]of n)d(f,p);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`);Gt(a.value)&&I_(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&&Gt(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)F_(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})),q_(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:n})}}const ic={collection:"map",default:!0,nodeClass:Ni,tag:"tag:yaml.org,2002:map",resolve(e,t){return tc(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Ni.from(e,t,n)};class ws extends z_{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(ec,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=_f(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const i=_f(t);if(typeof i!="number")return;const a=this.items[i];return!n&&Gt(a)?a.value:a}has(t){const n=_f(t);return typeof n=="number"&&n<this.items.length}set(t,n){const i=_f(t);if(typeof i!="number")throw new Error(`Expected a valid index, not ${t}.`);const a=this.items[i];Gt(a)&&I_(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?q_(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(Nu(d,void 0,i))}}return l}}function _f(e){let t=Gt(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const rc={collection:"seq",default:!0,nodeClass:ws,tag:"tag:yaml.org,2002:seq",resolve(e,t){return nc(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>ws.from(e,t,n)},Xp={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),Xu(e,t,n,i)}},Zp={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"&&Zp.test.test(e)?e:t.options.nullStr},Jb={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&&Jb.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 yr({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 H_={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:yr},K_={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():yr(e)}},G_={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:yr},Jp=e=>typeof e=="bigint"||Number.isInteger(e),ex=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function V_(e,t,n){const{value:i}=e;return Jp(i)&&i>=0?n+i.toString(t):yr(e)}const Y_={identify:e=>Jp(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>ex(e,2,8,n),stringify:e=>V_(e,8,"0o")},W_={identify:Jp,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>ex(e,0,10,n),stringify:yr},Q_={identify:e=>Jp(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>ex(e,2,16,n),stringify:e=>V_(e,16,"0x")},ZI=[ic,rc,Xp,Zp,Jb,Y_,W_,Q_,H_,K_,G_];function wk(e){return typeof e=="bigint"||Number.isInteger(e)}const jf=({value:e})=>JSON.stringify(e),JI=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:jf},{identify:e=>e==null,createNode:()=>new st(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:jf},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:jf},{identify:wk,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})=>wk(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:jf}],ez={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},tz=[ic,rc].concat(JI,ez),tx={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 p=0;p<o.length;++p)f+=String.fromCharCode(o[p]);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),p=Math.ceil(d.length/f),g=new Array(p);for(let m=0,y=0;m<p;++m,y+=f)g[m]=d.substr(y,f);d=g.join(t===st.BLOCK_LITERAL?`
529
+ `:" ")}return Xu({comment:e,type:t,value:d},i,a,l)}};function X_(e,t){if(nc(e))for(let n=0;n<e.items.length;++n){let i=e.items[n];if(!en(i)){if(tc(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}
530
+ ${a.key.commentBefore}`:i.commentBefore),i.comment){const l=a.value??a.key;l.comment=l.comment?`${i.comment}
531
+ ${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 Z_(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 p=Object.keys(o);if(p.length===1)d=p[0],f=o[d];else throw new TypeError(`Expected tuple with one key, not ${p.length} keys`)}else d=o;a.items.push(Zb(d,f,n))}return a}const nx={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:X_,createNode:Z_};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=Z_(t,n,i),l=new this;return l.items=a.items,l}}ko.tag="tag:yaml.org,2002:omap";const ix={collection:"seq",identify:e=>e instanceof Map,nodeClass:ko,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=X_(e,t),i=[];for(const{key:a}of n.items)Gt(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 J_({value:e,source:t},n){return t&&(e?e2:t2).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const e2={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:J_},t2={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:J_},nz={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:yr},iz={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():yr(e)}},rz={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:yr},Zu=e=>typeof e=="bigint"||Number.isInteger(e);function eh(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 rx(e,t,n){const{value:i}=e;if(Zu(i)){const a=i.toString(t);return i<0?"-"+n+a.substr(1):n+a}return yr(e)}const az={identify:Zu,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>eh(e,2,2,n),stringify:e=>rx(e,2,"0b")},sz={identify:Zu,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>eh(e,1,8,n),stringify:e=>rx(e,8,"0")},lz={identify:Zu,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>eh(e,0,10,n),stringify:yr},oz={identify:Zu,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>eh(e,2,16,n),stringify:e=>rx(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)?Gt(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(Zb(o,null,i));return l}}Eo.tag="tag:yaml.org,2002:set";const ax={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(tc(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 sx(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 n2(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return yr(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 i2={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})=>sx(e,n),stringify:n2},r2={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=>sx(e,!1),stringify:n2},th={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(th.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 p=Date.UTC(n,i-1,a,l||0,o||0,d||0,f);const g=t[8];if(g&&g!=="Z"){let m=sx(g,!1);Math.abs(m)<30&&(m*=60),p-=6e4*m}return new Date(p)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},kk=[ic,rc,Xp,Zp,e2,t2,az,sz,lz,oz,nz,iz,rz,tx,pa,ix,nx,ax,i2,r2,th],Ek=new Map([["core",ZI],["failsafe",[ic,rc,Xp]],["json",tz],["yaml11",kk],["yaml-1.1",kk]]),Sk={binary:tx,bool:Jb,float:G_,floatExp:K_,floatNaN:H_,floatTime:r2,int:W_,intHex:Q_,intOct:Y_,intTime:i2,map:ic,merge:pa,null:Zp,omap:ix,pairs:nx,seq:rc,set:ax,timestamp:th},cz={"tag:yaml.org,2002:binary":tx,"tag:yaml.org,2002:merge":pa,"tag:yaml.org,2002:omap":ix,"tag:yaml.org,2002:pairs":nx,"tag:yaml.org,2002:set":ax,"tag:yaml.org,2002:timestamp":th};function Lg(e,t,n){const i=Ek.get(t);if(i&&!e)return n&&!i.includes(pa)?i.concat(pa):i.slice();let a=i;if(!a)if(Array.isArray(e))a=[];else{const l=Array.from(Ek.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(pa)),a.reduce((l,o)=>{const d=typeof o=="string"?Sk[o]:o;if(!d){const f=JSON.stringify(o),p=Object.keys(Sk).map(g=>JSON.stringify(g)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${p}`)}return l.includes(d)||l.push(d),l},[])}const uz=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;let a2=class s2{constructor({compat:t,customTags:n,merge:i,resolveKnownTags:a,schema:l,sortMapEntries:o,toStringDefaults:d}){this.compat=Array.isArray(t)?Lg(t,"compat"):t?Lg(null,t):null,this.name=typeof l=="string"&&l||"core",this.knownTags=a?cz:{},this.tags=Lg(n,this.name,i),this.toStringOptions=d??null,Object.defineProperty(this,xs,{value:ic}),Object.defineProperty(this,Lr,{value:Xp}),Object.defineProperty(this,ec,{value:rc}),this.sortMapEntries=typeof o=="function"?o:o===!0?uz:null}clone(){const t=Object.create(s2.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function dz(e,t){var f;const n=[];let i=t.directives===!0;if(t.directives!==!1&&e.directives){const p=e.directives.toString(e);p?(n.push(p),i=!0):e.directives.docStart&&(i=!0)}i&&n.push("---");const a=B_(e,t),{commentString:l}=a.options;if(e.commentBefore){n.length!==1&&n.unshift("");const p=l(e.commentBefore);n.unshift(da(p,""))}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 p=d?void 0:()=>o=!0;let g=$o(e.contents,a,()=>d=null,p);d&&(g+=Qs(g,"",l(d))),(g[0]==="|"||g[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${g}`:n.push(g)}else n.push($o(e.contents,a));if((f=e.directives)!=null&&f.docEnd)if(e.comment){const p=l(e.comment);p.includes(`
532
+ `)?(n.push("..."),n.push(da(p,""))):n.push(`... ${p}`)}else n.push("...");else{let p=e.comment;p&&o&&(p=p.replace(/^\n+/,"")),p&&((!o||d)&&n[n.length-1]!==""&&n.push(""),n.push(da(l(p),"")))}return n.join(`
533
+ `)+`
534
+ `}class ac{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Yi,{value:Gy});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(ac.prototype,{[Yi]:{value:Gy}});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=R_(this);t.anchor=!n||i.has(n)?L_(n||"a",i):n}return new Vp(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 S=C=>typeof C=="number"||C instanceof String||C instanceof Number,E=n.filter(S).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:p,tag:g}=i??{},{onAnchor:m,setAnchors:y,sourceObjects:b}=BI(this,o||"a"),k={aliasDuplicateObjects:l??!0,keepUndefined:f??!1,onAnchor:m,onTagObj:p,replacer:a,schema:this.schema,sourceObjects:b},v=Nu(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 uu(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 uu(t)?!n&&Gt(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 uu(t)?this.contents!==void 0:on(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=bp(this.schema,[t],n):so(this.contents)&&this.contents.set(t,n)}setIn(t,n){uu(t)?this.contents=n:this.contents==null?this.contents=bp(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 a2(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:p,res:g}of d.anchors.values())l(g,p);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 dz(this,t)}}function so(e){if(on(e))return!0;throw new Error("Expected a YAML collection as document contents")}class lx extends Error{constructor(t,n,i,a){super(),this.name=t,this.code=i,this.message=a,this.pos=n}}class Zs extends lx{constructor(t,n,i){super("YAMLParseError",t,n,i)}}class l2 extends lx{constructor(t,n,i){super("YAMLWarning",t,n,i)}}const vp=(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)+`…
535
+ `),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 p=" ".repeat(l)+"^".repeat(d);n.message+=`:
536
+
537
+ ${o}
538
+ ${p}
539
+ `}};function Uo(e,{flow:t,indicator:n,next:i,offset:a,onError:l,parentIndent:o,startOnNewline:d}){let f=!1,p=d,g=d,m="",y="",b=!1,k=!1,v=null,S=null,E=null,C=null,N=null,_=null,T=null;for(const R of e)switch(k&&(R.type!=="space"&&R.type!=="newline"&&R.type!=="comma"&&l(R.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),k=!1),v&&(p&&R.type!=="comment"&&R.type!=="newline"&&l(v,"TAB_AS_INDENT","Tabs are not allowed as indentation"),v=null),R.type){case"space":!t&&(n!=="doc-start"||(i==null?void 0:i.type)!=="flow-collection")&&R.source.includes(" ")&&(v=R),g=!0;break;case"comment":{g||l(R,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const B=R.source.substring(1)||" ";m?m+=y+B:m=B,y="",p=!1;break}case"newline":p?m?m+=R.source:(!_||n!=="seq-item-ind")&&(f=!0):y+=R.source,p=!0,b=!0,(S||E)&&(C=R),g=!0;break;case"anchor":S&&l(R,"MULTIPLE_ANCHORS","A node can have at most one anchor"),R.source.endsWith(":")&&l(R.offset+R.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),S=R,T??(T=R.offset),p=!1,g=!1,k=!0;break;case"tag":{E&&l(R,"MULTIPLE_TAGS","A node can have at most one tag"),E=R,T??(T=R.offset),p=!1,g=!1,k=!0;break}case n:(S||E)&&l(R,"BAD_PROP_ORDER",`Anchors and tags must be after the ${R.source} indicator`),_&&l(R,"UNEXPECTED_TOKEN",`Unexpected ${R.source} in ${t??"collection"}`),_=R,p=n==="seq-item-ind"||n==="explicit-key-ind",g=!1;break;case"comma":if(t){N&&l(R,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),N=R,p=!1,g=!1;break}default:l(R,"UNEXPECTED_TOKEN",`Unexpected ${R.type} token`),p=!1,g=!1}const M=e[e.length-1],O=M?M.offset+M.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&&(p&&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:N,found:_,spaceBefore:f,comment:m,hasNewline:b,anchor:S,tag:E,newlineAfterProp:C,end:O,start:T??O}}function _u(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
540
+ `))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(_u(t.key)||_u(t.value))return!0}return!1;default:return!0}}function Qy(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const i=t.end[0];i.indent===e&&(i.source==="]"||i.source==="}")&&_u(t)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function o2(e,t,n){const{uniqueKeys:i}=e.options;if(i===!1)return!1;const a=typeof i=="function"?i:(l,o)=>l===o||Gt(l)&&Gt(o)&&l.value===o.value;return t.some(l=>a(l.key,n))}const Nk="All mapping items must start at the same column";function fz({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,p=null;for(const m of i.items){const{start:y,key:b,sep:k,value:v}=m,S=Uo(y,{indicator:"explicit-key-ind",next:b??(k==null?void 0:k[0]),offset:f,onError:a,parentIndent:i.indent,startOnNewline:!0}),E=!S.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",Nk)),!S.anchor&&!S.tag&&!k){p=S.end,S.comment&&(d.comment?d.comment+=`
541
+ `+S.comment:d.comment=S.comment);continue}(S.newlineAfterProp||_u(b))&&a(b??y[y.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((g=S.found)==null?void 0:g.indent)!==i.indent&&a(f,"BAD_INDENT",Nk);n.atKey=!0;const C=S.end,N=b?e(n,b,S,a):t(n,C,y,null,S,a);n.schema.compat&&Qy(i.indent,b,a),n.atKey=!1,o2(n,d.items,N)&&a(C,"DUPLICATE_KEY","Map keys must be unique");const _=Uo(k??[],{indicator:"map-value-ind",next:v,offset:N.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&&S.start<_.found.offset-1024&&a(N.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const T=v?e(n,v,_,a):t(n,f,k,null,_,a);n.schema.compat&&Qy(i.indent,v,a),f=T.range[2];const M=new Vn(N,T);n.options.keepSourceTokens&&(M.srcToken=m),d.items.push(M)}else{E&&a(N.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(N.comment?N.comment+=`
542
+ `+_.comment:N.comment=_.comment);const T=new Vn(N);n.options.keepSourceTokens&&(T.srcToken=m),d.items.push(T)}}return p&&p<f&&a(p,"IMPOSSIBLE","Map comment with trailing content"),d.range=[i.offset,f,p??f],d}function pz({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,p=null;for(const{start:g,value:m}of i.items){const y=Uo(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{p=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&&Qy(i.indent,m,a),f=b.range[2],d.items.push(b)}return d.range=[i.offset,f,p??f],d}function Ju(e,t,n,i){let a="";if(e){let l=!1,o="";for(const d of e){const{source:f,type:p}=d;switch(p){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 ${p} at node end`)}t+=f.length}}return{comment:a,offset:t}}const Ig="Block collections are not allowed within flow collections",zg=e=>e&&(e.type==="block-map"||e.type==="block-seq");function hz({composeNode:e,composeEmptyNode:t},n,i,a,l){var S;const o=i.start.source==="{",d=o?"flow map":"flow sequence",f=(l==null?void 0:l.nodeClass)??(o?Ni:ws),p=new f(n.schema);p.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:N,key:_,sep:T,value:M}=C,O=Uo(N,{flow:d,indicator:"explicit-key-ind",next:_??(T==null?void 0:T[0]),offset:m,onError:a,parentIndent:i.indent,startOnNewline:!1});if(!O.found){if(!O.anchor&&!O.tag&&!T&&!M){E===0&&O.comma?a(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${d}`):E<i.items.length-1&&a(O.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${d}`),O.comment&&(p.comment?p.comment+=`
543
+ `+O.comment:p.comment=O.comment),m=O.end;continue}!o&&n.options.strict&&_u(_)&&a(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(E===0)O.comma&&a(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${d}`);else if(O.comma||a(O.start,"MISSING_CHAR",`Missing , between ${d} items`),O.comment){let R="";e:for(const B of N)switch(B.type){case"comma":case"space":break;case"comment":R=B.source.substring(1);break e;default:break e}if(R){let B=p.items[p.items.length-1];en(B)&&(B=B.value??B.key),B.comment?B.comment+=`
544
+ `+R:B.comment=R,O.comment=O.comment.substring(R.length+1)}}if(!o&&!T&&!O.found){const R=M?e(n,M,O,a):t(n,O.end,T,null,O,a);p.items.push(R),m=R.range[2],zg(M)&&a(R.range,"BLOCK_IN_FLOW",Ig)}else{n.atKey=!0;const R=O.end,B=_?e(n,_,O,a):t(n,R,N,null,O,a);zg(_)&&a(B.range,"BLOCK_IN_FLOW",Ig),n.atKey=!1;const U=Uo(T??[],{flow:d,indicator:"map-value-ind",next:M,offset:B.range[2],onError:a,parentIndent:i.indent,startOnNewline:!1});if(U.found){if(!o&&!O.found&&n.options.strict){if(T)for(const Y of T){if(Y===U.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}}O.start<U.found.offset-1024&&a(U.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else M&&("source"in M&&((S=M.source)==null?void 0:S[0])===":"?a(M,"MISSING_CHAR",`Missing space after : in ${d}`):a(U.start,"MISSING_CHAR",`Missing , or : between ${d} items`));const K=M?e(n,M,U,a):U.found?t(n,U.end,T,null,U,a):null;K?zg(M)&&a(K.range,"BLOCK_IN_FLOW",Ig):U.comment&&(B.comment?B.comment+=`
545
+ `+U.comment:B.comment=U.comment);const q=new Vn(B,K);if(n.options.keepSourceTokens&&(q.srcToken=C),o){const Y=p;o2(n,Y.items,B)&&a(R,"DUPLICATE_KEY","Map keys must be unique"),Y.items.push(q)}else{const Y=new Ni(n.schema);Y.flow=!0,Y.items.push(q);const D=(K??B).range;Y.range=[B.range[0],D[1],D[2]],p.items.push(Y)}m=K?K.range[2]:U.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=Ju(k,v,n.options.strict,a);E.comment&&(p.comment?p.comment+=`
546
+ `+E.comment:p.comment=E.comment),p.range=[i.offset,v,E.offset]}else p.range=[i.offset,v,v];return p}function Pg(e,t,n,i,a,l){const o=n.type==="block-map"?fz(e,t,n,i,l):n.type==="block-seq"?pz(e,t,n,i,l):hz(e,t,n,i,l),d=o.constructor;return a==="!"||a===d.tagName?(o.tag=d.tagName,o):(a&&(o.tag=a),o)}function mz(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 Pg(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),Pg(e,t,n,a,o)}const p=Pg(e,t,n,a,o,f),g=((y=f.resolve)==null?void 0:y.call(f,p,b=>a(l,"TAG_RESOLVE_FAILED",b),t.options))??p,m=cn(g)?g:new st(g);return m.range=p.range,m.tag=o,f!=null&&f.format&&(m.format=f.format),m}function c2(e,t,n){const i=t.offset,a=gz(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?yz(t.source):[];let d=o.length;for(let v=o.length-1;v>=0;--v){const S=o[v][1];if(S===""||S==="\r")d=v;else break}if(d===0){const v=a.chomp==="+"&&o.length>0?`
547
+ `.repeat(Math.max(1,o.length-1)):"";let S=i+a.length;return t.source&&(S+=t.source.length),{value:v,type:l,comment:a.comment,range:[i,S,S]}}let f=t.indent+a.indent,p=t.offset+a.length,g=0;for(let v=0;v<d;++v){const[S,E]=o[v];if(E===""||E==="\r")a.indent===0&&S.length>f&&(f=S.length);else{S.length<f&&n(p+S.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),a.indent===0&&(f=S.length),g=v,f===0&&!e.atRoot&&n(p,"BAD_INDENT","Block scalar values in collections must be indented");break}p+=S.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)+`
548
+ `;for(let v=g;v<d;++v){let[S,E]=o[v];p+=S.length+E.length+1;const C=E[E.length-1]==="\r";if(C&&(E=E.slice(0,-1)),E&&S.length<f){const _=`Block scalar lines must not be less indented than their ${a.indent?"explicit indentation indicator":"first line"}`;n(p-E.length-(C?2:1),"BAD_INDENT",_),S=""}l===st.BLOCK_LITERAL?(m+=y+S.slice(f)+E,y=`
549
+ `):S.length>f||E[0]===" "?(y===" "?y=`
550
+ `:!b&&y===`
551
+ `&&(y=`
552
+
553
+ `),m+=y+S.slice(f)+E,y=`
554
+ `,b=!0):E===""?y===`
555
+ `?m+=`
556
+ `:y=`
557
+ `:(m+=y+E,y=" ",b=!1)}switch(a.chomp){case"-":break;case"+":for(let v=d;v<o.length;++v)m+=`
558
+ `+o[v][0].slice(f);m[m.length-1]!==`
559
+ `&&(m+=`
560
+ `);break;default:m+=`
561
+ `}const k=i+a.length+t.source.length;return{value:m,type:l,comment:a.comment,range:[i,k,k]}}function gz({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 p=!1,g="",m=a.length;for(let y=1;y<t.length;++y){const b=t[y];switch(b.type){case"space":p=!0;case"newline":m+=b.source.length;break;case"comment":n&&!p&&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 yz(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 u2(e,t,n){const{offset:i,type:a,source:l,end:o}=e;let d,f;const p=(y,b,k)=>n(i+y,b,k);switch(a){case"scalar":d=st.PLAIN,f=bz(l,p);break;case"single-quoted-scalar":d=st.QUOTE_SINGLE,f=xz(l,p);break;case"double-quoted-scalar":d=st.QUOTE_DOUBLE,f=vz(l,p);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=Ju(o,g,t,n);return{value:f,type:d,comment:m.comment,range:[i,g,m.offset]}}function bz(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}`),d2(e)}function xz(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),d2(e.slice(1,-1)).replace(/''/g,"'")}function d2(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
562
+ `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
563
+ `,"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===`
564
+ `?a+=l:l=`
565
+ `:(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 vz(e,t){let n="";for(let i=1;i<e.length-1;++i){const a=e[i];if(!(a==="\r"&&e[i+1]===`
566
+ `))if(a===`
567
+ `){const{fold:l,offset:o}=wz(e,i);n+=l,i=o}else if(a==="\\"){let l=e[++i];const o=kz[l];if(o)n+=o;else if(l===`
568
+ `)for(l=e[i+1];l===" "||l===" ";)l=e[++i+1];else if(l==="\r"&&e[i+1]===`
569
+ `)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+=Ez(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!==`
570
+ `&&!(o==="\r"&&e[i+2]===`
571
+ `)&&(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 wz(e,t){let n="",i=e[t+1];for(;(i===" "||i===" "||i===`
572
+ `||i==="\r")&&!(i==="\r"&&e[t+2]!==`
573
+ `);)i===`
574
+ `&&(n+=`
575
+ `),t+=1,i=e[t+1];return n||(n=" "),{fold:n,offset:t}}const kz={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
576
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Ez(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 f2(e,t,n,i){const{value:a,type:l,comment:o,range:d}=t.type==="block-scalar"?c2(e,t,i):u2(t,e.options.strict,i),f=n?e.directives.tagName(n.source,m=>i(n,"TAG_RESOLVE_FAILED",m)):null;let p;e.options.stringKeys&&e.atKey?p=e.schema[Lr]:f?p=Sz(e.schema,a,f,n,i):t.type==="scalar"?p=Nz(e,a,t,i):p=e.schema[Lr];let g;try{const m=p.resolve(a,y=>i(n??t,"TAG_RESOLVE_FAILED",y),e.options);g=Gt(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),p.format&&(g.format=p.format),o&&(g.comment=o),g}function Sz(e,t,n,i,a){var d;if(n==="!")return e[Lr];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[Lr])}function Nz({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[Lr];if(n.compat){const d=n.compat.find(f=>{var p;return f.default&&((p=f.test)==null?void 0:p.test(i))})??n[Lr];if(o.tag!==d.tag){const f=t.tagString(o.tag),p=t.tagString(d.tag),g=`Value may be parsed as either ${f} or ${p}`;l(a,"TAG_RESOLVE_FAILED",g,!0)}}return o}function _z(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 jz={composeNode:p2,composeEmptyNode:ox};function p2(e,t,n,i){const a=e.atKey,{spaceBefore:l,comment:o,anchor:d,tag:f}=n;let p,g=!0;switch(t.type){case"alias":p=Cz(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":p=f2(e,t,f,i),d&&(p.anchor=d.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{p=mz(jz,e,t,n,i),d&&(p.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 p??(p=ox(e,t.offset,void 0,null,n,i)),d&&p.anchor===""&&i(d,"BAD_ALIAS","Anchor cannot be an empty string"),a&&e.options.stringKeys&&(!Gt(p)||typeof p.value!="string"||p.tag&&p.tag!=="tag:yaml.org,2002:str")&&i(f??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),l&&(p.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?p.comment=o:p.commentBefore=o),e.options.keepSourceTokens&&g&&(p.srcToken=t),p}function ox(e,t,n,i,{spaceBefore:a,comment:l,anchor:o,tag:d,end:f},p){const g={type:"scalar",offset:_z(t,n,i),indent:-1,source:""},m=f2(e,g,d,p);return o&&(m.anchor=o.source.substring(1),m.anchor===""&&p(o,"BAD_ALIAS","Anchor cannot be an empty string")),a&&(m.spaceBefore=!0),l&&(m.comment=l,m.range[2]=f),m}function Cz({options:e},{offset:t,source:n,end:i},a){const l=new Vp(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=Ju(i,o,e.strict,a);return l.range=[t,o,d.offset],d.comment&&(l.comment=d.comment),l}function Az(e,t,{offset:n,start:i,value:a,end:l},o){const d=Object.assign({_directives:t},e),f=new ac(void 0,d),p={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},g=Uo(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?p2(p,a,g,o):ox(p,g.end,i,null,g,o);const m=f.contents.range[2],y=Ju(l,m,!1,o);return y.comment&&(f.comment=y.comment),f.range=[n,m,y.offset],f}function tu(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 _k(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?`
577
+
578
+ `:`
579
+ `)+(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 cx{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,a,l)=>{const o=tu(n);l?this.warnings.push(new l2(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}=_k(this.prelude);if(i){const l=t.contents;if(n)t.comment=t.comment?`${t.comment}
580
+ ${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}
581
+ ${d}`:i}else{const o=l.commentBefore;l.commentBefore=o?`${i}
582
+ ${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:_k(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=tu(t);l[0]+=n,this.onError(l,"BAD_DIRECTIVE",i,a)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=Az(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(tu(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(tu(t),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;const n=Ju(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}
583
+ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Zs(tu(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 ac(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 Tz(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 u2(e,t,i);case"block-scalar":return c2({options:{strict:t}},e,i)}}return null}function Mz(e,t){const{implicitKey:n=!1,indent:i,inFlow:a=!1,offset:l=-1,type:o="PLAIN"}=t,d=Xu({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:`
584
+ `}];switch(d[0]){case"|":case">":{const p=d.indexOf(`
585
+ `),g=d.substring(0,p),m=d.substring(p+1)+`
586
+ `,y=[{type:"block-scalar-header",offset:l,indent:i,source:g}];return h2(y,f)||y.push({type:"newline",offset:-1,indent:i,source:`
587
+ `}),{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 Dz(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 p=e.props[0];if(p.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=p.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}const f=Xu({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">":Oz(e,f);break;case'"':Bg(e,f,"double-quoted-scalar");break;case"'":Bg(e,f,"single-quoted-scalar");break;default:Bg(e,f,"scalar")}}function Oz(e,t){const n=t.indexOf(`
588
+ `),i=t.substring(0,n),a=t.substring(n+1)+`
589
+ `;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}];h2(d,"end"in e?e.end:void 0)||d.push({type:"newline",offset:-1,indent:o,source:`
590
+ `});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 h2(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 Bg(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:`
591
+ `};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 Rz=e=>"type"in e?wp(e):ip(e);function wp(e){switch(e.type){case"block-scalar":{let t="";for(const n of e.props)t+=wp(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(const n of e.items)t+=ip(n);return t}case"flow-collection":{let t=e.start.source;for(const n of e.items)t+=ip(n);for(const n of e.end)t+=n.source;return t}case"document":{let t=ip(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 ip({start:e,key:t,sep:n,value:i}){let a="";for(const l of e)a+=l.source;if(t&&(a+=wp(t)),n)for(const l of n)a+=l.source;return i&&(a+=wp(i)),a}const Xy=Symbol("break visit"),Lz=Symbol("skip children"),m2=Symbol("remove item");function hl(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),g2(Object.freeze([]),e,t)}hl.BREAK=Xy;hl.SKIP=Lz;hl.REMOVE=m2;hl.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};hl.parentCollection=(e,t)=>{const n=hl.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 g2(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=g2(Object.freeze(e.concat([[a,o]])),l.items[o],n);if(typeof d=="number")o=d-1;else{if(d===Xy)return Xy;d===m2&&(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 nh="\uFEFF",ih="",rh="",ju="",Iz=e=>!!e&&"items"in e,zz=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function Pz(e){switch(e){case nh:return"<BOM>";case ih:return"<DOC>";case rh:return"<FLOW_END>";case ju:return"<SCALAR>";default:return JSON.stringify(e)}}function y2(e){switch(e){case nh:return"byte-order-mark";case ih:return"doc-mode";case rh:return"flow-error-end";case ju:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
592
+ `:case`\r
593
+ `: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 Bz=Object.freeze(Object.defineProperty({__proto__:null,BOM:nh,DOCUMENT:ih,FLOW_END:rh,SCALAR:ju,createScalarToken:Mz,isCollection:Iz,isScalar:zz,prettyToken:Pz,resolveAsScalar:Tz,setScalarValue:Dz,stringify:Rz,tokenType:y2,visit:hl},Symbol.toStringTag,{value:"Module"}));function ar(e){switch(e){case void 0:case" ":case`
594
+ `:case"\r":case" ":return!0;default:return!1}}const jk=new Set("0123456789ABCDEFabcdef"),$z=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Cf=new Set(",[]{}"),Uz=new Set(` ,[]{}
595
+ \r `),$g=e=>!e||Uz.has(e);class b2{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===`
596
+ `?!0:n==="\r"?this.buffer[t+1]===`
597
+ `:!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===`
598
+ `||!a&&!this.atEnd)return t+i+1}return n===`
599
+ `||i>=this.indentNext||!n&&!this.atEnd?t+i:-1}if(n==="-"||n==="."){const i=this.buffer.substr(t,3);if((i==="---"||i==="...")&&ar(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(`
600
+ `,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]===nh&&(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 ih,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==="...")&&ar(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&&!ar(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===":")&&ar(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($g),"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("..."))&&ar(a[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(a[0]==="]"||a[0]==="}")))return this.flowLevel=0,yield rh,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($g),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||ar(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(`
601
+ `,this.pos);if(a!==-1){for(;a!==-1;){const l=this.continueScalar(a+1);if(l===-1)break;a=i.indexOf(`
602
+ `,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=>ar(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`
603
+ `:t=l,n=0;break;case"\r":{const o=this.buffer[l+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
604
+ `)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(`
605
+ `,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===`
606
+ `;)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===`
607
+ `&&l>=this.pos&&l+1+n>d)t=l;else break}while(!0);return yield ju,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(ar(l)||t&&Cf.has(l))break;n=i}else if(ar(a)){let l=this.buffer[i+1];if(a==="\r"&&(l===`
608
+ `?(i+=1,a=`
609
+ `,l=this.buffer[i+1]):n=i),l==="#"||t&&Cf.has(l))break;if(a===`
610
+ `){const o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(t&&Cf.has(a))break;n=i}return!a&&!this.atEnd?this.setNext("plain-scalar"):(yield ju,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($g))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(ar(n)||t&&Cf.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(;!ar(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($z.has(n))n=this.buffer[++t];else if(n==="%"&&jk.has(this.buffer[t+1])&&jk.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===`
611
+ `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
612
+ `?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 x2{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 Ck(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 v2(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 Af(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 Ak(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,v2(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 ux{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 b2,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=y2(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"&&Ak(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&&Ck(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":{Ck(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=Af(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(`
613
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
614
+ `,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 p=n.sep[f];switch(p.type){case"newline":d.push(f);break;case"space":break;case"comment":p.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(v2(n.key)&&!ls(n.sep,"newline")){const d=lo(n.start),f=n.key,p=n.sep;p.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:p}]})}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=Af(i),l=lo(a);Ak(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(`
615
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
616
+ `,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=Af(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=Af(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 w2(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new x2||null,prettyErrors:t}}function Fz(e,t={}){const{lineCounter:n,prettyErrors:i}=w2(t),a=new ux(n==null?void 0:n.addNewLine),l=new cx(t),o=Array.from(l.compose(a.parse(e)));if(i&&n)for(const d of o)d.errors.forEach(vp(e,n)),d.warnings.forEach(vp(e,n));return o.length>0?o:Object.assign([],{empty:!0},l.streamInfo())}function k2(e,t={}){const{lineCounter:n,prettyErrors:i}=w2(t),a=new ux(n==null?void 0:n.addNewLine),l=new cx(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(vp(e,n)),o.warnings.forEach(vp(e,n))),o}function qz(e,t,n){let i;typeof t=="function"?i=t:n===void 0&&t&&typeof t=="object"&&(n=t);const a=k2(e,n);if(!a)return null;if(a.warnings.forEach(l=>$_(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 Hz(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 ac(e,i,n).toString(n)}const Tk=Object.freeze(Object.defineProperty({__proto__:null,Alias:Vp,CST:Bz,Composer:cx,Document:ac,Lexer:b2,LineCounter:x2,Pair:Vn,Parser:ux,Scalar:st,Schema:a2,YAMLError:lx,YAMLMap:Ni,YAMLParseError:Zs,YAMLSeq:ws,YAMLWarning:l2,isAlias:Ss,isCollection:on,isDocument:wl,isMap:tc,isNode:cn,isPair:en,isScalar:Gt,isSeq:nc,parse:qz,parseAllDocuments:Fz,parseDocument:k2,stringify:Hz,visit:kl,visitAsync:Gp},Symbol.toStringTag,{value:"Module"}));function Kz({projectName:e,file:t,onClose:n,onSaved:i}){const a=Pe(),l=Ft(),{alert:o}=un(),{data:d,isLoading:f,isError:p,error:g,refetch:m}=Ve({queryKey:["pipeline-file",e,t],queryFn:()=>gI(e,t)}),[y,b]=j.useState("structured"),[k,v]=j.useState(null),[S,E]=j.useState(null);j.useEffect(()=>{d&&k===null&&(v(d.content),E(d.etag),d.parseError&&b("yaml"))},[d,k]),j.useEffect(()=>{const O=R=>{R.key==="Escape"&&n()};return window.addEventListener("keydown",O),()=>window.removeEventListener("keydown",O)},[n]);const C=Et({mutationFn:()=>{if(k===null||S===null)throw new Error("no draft");return yI(e,t,k,S)},onSuccess:O=>{E(O.etag),l.invalidateQueries({queryKey:["pipeline-file",e,t]}),l.invalidateQueries({queryKey:["project-pipelines",e]}),i()},onError:O=>{const R=O.status;o({title:a(R===409?"pipelineEditor.error.conflict.title":R===422?"pipelineEditor.error.yaml.title":"pipelineEditor.error.save.title"),body:O instanceof Error?O.message:String(O)})}}),N=k!==null&&d&&k!==d.content,{parsed:_,parseError:T}=j.useMemo(()=>{if(k===null)return{parsed:null,parseError:null};try{return{parsed:Tk.parse(k)??{},parseError:null}}catch(O){return{parsed:null,parseError:O instanceof Error?O.message:String(O)}}},[k]),M=O=>{try{const R=Tk.stringify(O,{lineWidth:0});v(R)}catch(R){o({title:a("pipelineEditor.error.serialize.title"),body:R instanceof Error?R.message:String(R)})}};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(mk,{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,S&&` · etag ${S}`]})]}),c.jsx("button",{className:"nb-btn nb-btn-mint p-2",onClick:n,type:"button","aria-label":a("pipelineEditor.close"),children:c.jsx(gn,{size:14,strokeWidth:3})})]}),f&&c.jsx("p",{className:"text-[var(--color-text-muted)]",children:a("common.loading")}),p&&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:!!T,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)]",T?"opacity-50 cursor-not-allowed":""].join(" "),title:T??void 0,children:[c.jsx(Wu,{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(mk,{size:11,strokeWidth:2.5}),a("pipelineEditor.mode.yaml")]})]}),T&&c.jsxs("div",{className:"flex items-center gap-1 text-xs text-[var(--color-crashed)] font-bold",children:[c.jsx(Eu,{size:12,strokeWidth:2.5}),a("pipelineEditor.parseError.prefix",{detail:T})]}),(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(Gz,{parsed:_,onChange:M}),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:O=>v(O.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:N?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(Su,{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:!N||C.isPending,type:"button","aria-label":a("pipelineEditor.saveAria"),children:[C.isPending?c.jsx(Xe,{size:13,strokeWidth:3,className:"animate-spin"}):c.jsx(mr,{size:13,strokeWidth:3}),a("pipelineEditor.save")]})]})]})]})]})})}function Gz({parsed:e,onChange:t}){const n=Pe(),i=e.stages??[],a=p=>{t({...e,stages:p})},l=()=>{a([...i,{name:`stage-${i.length+1}`,on_complete:"move_card Done"}])},o=p=>{a(i.filter((g,m)=>m!==p))},d=(p,g)=>{const m=[...i],y=p+g;y<0||y>=m.length||([m[p],m[y]]=[m[y],m[p]],a(m))},f=(p,g)=>{a(i.map((m,y)=>y===p?{...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:p=>t({...e,mode:p.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(hi,{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((p,g)=>c.jsx(Vz,{stage:p,index:g,total:i.length,onChange:m=>f(g,m),onRemove:()=>o(g),onMoveUp:()=>d(g,-1),onMoveDown:()=>d(g,1)},g))})]})]})}function Vz({stage:e,index:t,total:n,onChange:i,onRemove:a,onMoveUp:l,onMoveDown:o}){const d=Pe(),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(eL,{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(Yu,{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(Vi,{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:p=>i({name:p.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:p=>i({profile:p.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:p=>i({card_state:p.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:p=>i({timeout:p.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:p=>i({trigger:p.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:p=>i({on_complete:p.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:p=>i({on_fail:{...f,action:p.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:p=>i({on_fail:{...f,comment:p.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:p=>i({on_fail:{...f,halt:p.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 Yz({onCancel:e,onCreate:t,hasActive:n,hasSample:i,isPending:a}){const l=Pe(),[o,d]=j.useState(""),[f,p]=j.useState("blank");j.useEffect(()=>{const S=E=>{E.key==="Escape"&&e()};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[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(gn,{size:14,strokeWidth:3})})]}),c.jsxs("form",{onSubmit:S=>{S.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:S=>d(S.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(Ug,{value:"blank",current:f,label:l("newPipelineDialog.template.blank.label"),desc:l("newPipelineDialog.template.blank.desc"),onSelect:p}),c.jsx(Ug,{value:"sample",current:f,label:l("newPipelineDialog.template.sample.label"),desc:l("newPipelineDialog.template.sample.desc"),onSelect:p,disabled:!i,disabledReason:l("newPipelineDialog.template.sample.unavailable")}),c.jsx(Ug,{value:"active",current:f,label:l("newPipelineDialog.template.active.label"),desc:l("newPipelineDialog.template.active.desc"),onSelect:p,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(hi,{size:13,strokeWidth:3}),l("common.create")]})]})]})]})})}function Ug({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 Wz(e){return ct(`/api/rules/${encodeURIComponent(e)}`)}function Mk(e){return Array.isArray(e)?e.map(t=>String(t).trim()).filter(Boolean):typeof e=="string"?e.split(",").map(t=>t.trim()).filter(Boolean):[]}function Qz(e){return typeof e=="string"&&["language","domain","persona","workflow","engine","genre","platform","review","meta","other"].includes(e)?e:"other"}function rp(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function dx(e){const t=rp(e);return{name:typeof t.name=="string"?t.name:"",category:Qz(t.category),tags:Mk(t.tags),description:typeof t.description=="string"?t.description:"",origin:typeof t.origin=="string"?t.origin:"",linkedProjects:Mk(t.linkedProjects),stateInProject:t.stateInProject==="absent"||t.stateInProject==="linked"||t.stateInProject==="frozen"?t.stateInProject:void 0}}function Xz(e){const t=rp(e);return{...dx(t),body:typeof t.body=="string"?t.body:"",references:Array.isArray(t.references)?t.references.map(i=>{const a=rp(i);return{name:typeof a.name=="string"?a.name:"",lines:typeof a.lines=="number"?a.lines:0}}).filter(i=>i.name):[],linkedProjects:Array.isArray(t.linkedProjects)?t.linkedProjects.map(i=>{const a=rp(i),l=a.state==="frozen"?"frozen":"linked";return{project:typeof a.project=="string"?a.project:"",state:l}}).filter(i=>i.project):[]}}function Zz(e){return{data:Array.isArray(e.data)?e.data.map(dx).filter(t=>t.name):[]}}async function fx(e){const t=e?`?project=${encodeURIComponent(e)}`:"",n=await ct(`/api/skills${t}`);return Zz(n)}async function Jz(e){const t=await ct(`/api/skills/${encodeURIComponent(e)}`);return Xz(t)}function e4(e,t){return ct(`/api/skills/${encodeURIComponent(e)}/references/${encodeURIComponent(t)}`)}async function t4(e,t){const n=await fetch(`/api/skills/${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t})});if(!n.ok)throw new Error(`${n.status}: ${await n.text()}`)}function n4(e){return k_(`/api/skills/${encodeURIComponent(e)}`)}function i4(e){return gr(`/api/skills/${encodeURIComponent(e)}/translate`)}async function r4(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 a4(){return r4("/api/skills/sync")}async function s4(e){const t=await ct(`/api/skills/policy/${encodeURIComponent(e)}`);return{data:{...t.data,skills:Array.isArray(t.data.skills)?t.data.skills.map(dx).filter(n=>n.name):[]}}}function l4(e,t){return Vb(`/api/skills/policy/${encodeURIComponent(e)}`,t)}function o4(){return ct("/api/skills/updates")}function c4(e,t,n){return gr("/api/skills/import",{name:e,files:t,overwrite:n})}function u4(e){return ct(`/api/skills/${encodeURIComponent(e)}/export`)}function d4(e,t){return gr("/api/skills/create",{name:e,intent:t})}function E2(){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 S2({msg:e}){return c.jsx("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:c.jsx("p",{children:e})})}function f4({name:e}){var b,k;const t=Pe(),n=Ft(),{alert:i}=un(),a=Ve({queryKey:["skill-policy",e],queryFn:()=>s4(e),enabled:!!e}),l=(b=a.data)==null?void 0:b.data,[o,d]=j.useState(null),[f,p]=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(S=>S.name)))},[l,o]);const g=Et({mutationFn:v=>l4(e,v),onSuccess:v=>{p(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(E2,{});if(a.isError)return c.jsx(S2,{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(S=>{const E=new Set(S);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(d_,{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(mr,{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(Fb,{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 p4({name:e}){var a;const t=Pe(),n=Ve({queryKey:["rules",e],queryFn:()=>Wz(e),enabled:!!e});if(n.isLoading)return c.jsx(E2,{});if(n.isError)return c.jsx(S2,{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 ah=e=>`/api/projects/${encodeURIComponent(e)}/graph`;function h4(e){return ct(`${ah(e)}/status`)}function m4(e){return ct(`${ah(e)}/data`)}function g4(e){return gr(`${ah(e)}/build`)}function y4(e){return gr(`${ah(e)}/sync`)}const b4={typescript:"#1D4E89",tsx:"#2563EB",javascript:"#B8860B",json:"#6B7280",yaml:"#C2410C"},Tf=e=>b4[e]??"#2D6A4F";function Dk(e){return[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)]}const x4=e=>Math.max(8,Math.min(22,8+e*2.5));function v4(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/1024/1024).toFixed(2)} MB`}function w4(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 k4({name:e,status:t}){var y,b,k,v;const n=Pe(),i=Ve({queryKey:["graph-data",e],queryFn:()=>m4(e)}),[a,l]=j.useState(""),o=j.useRef(null),d=j.useRef(null),f=j.useRef(null),p=j.useRef(null),g=[...new Set((((b=(y=i.data)==null?void 0:y.data)==null?void 0:b.nodes)??[]).map(S=>S.language))];if(j.useEffect(()=>{p.current&&(p.current.search=a.trim().toLowerCase())},[a]),j.useEffect(()=>{var we;const S=(we=i.data)==null?void 0:we.data,E=d.current,C=o.current;if(!S||!S.nodes.length||!E||!C)return;const N=E.getContext("2d");if(!N)return;const _={};for(const re of S.links)_[re.source]=(_[re.source]??0)+1,_[re.target]=(_[re.target]??0)+1;const T=S.nodes.length,M=window.devicePixelRatio||1,O=C.getBoundingClientRect(),R=O.width||800,B=O.height||500,U=Math.min(R,B)*.35+T*1.5,K=S.nodes.map((re,Ce)=>{const Me=2*Math.PI*Ce/Math.max(T,1),_e=_[re.id]??0;return{id:re.id,language:re.language,symbols:re.symbols,deg:_e,name:re.id.split("/").pop()||re.id,x:Math.cos(Me)*U+Math.sin(Ce*12.9898)*43758.5453%1*40,y:Math.sin(Me)*U+Math.sin(Ce*78.233)*12345.678%1*40,vx:0,vy:0,r:x4(_e)}}),q={};for(const re of K)q[re.id]=re;const Y=S.links.map(re=>({source:re.source,target:re.target,weight:re.weight})),D={nodes:K,edges:Y,map:q,panX:R/2,panY:B/2,zoom:1,drag:null,mouseX:0,mouseY:0,raf:null,tick:0,quiet:0,sel:null,search:a.trim().toLowerCase(),fitted:!1};p.current=D;const F=()=>{const re=C.getBoundingClientRect();E.width=re.width*M,E.height=re.height*M,E.style.width=re.width+"px",E.style.height=re.height+"px",N.setTransform(M,0,0,M,0,0)};F();const I=new ResizeObserver(F);I.observe(C);const H=()=>{let re=1/0,Ce=1/0,Me=-1/0,_e=-1/0;for(const be of K)re=Math.min(re,be.x-be.r),Ce=Math.min(Ce,be.y-be.r),Me=Math.max(Me,be.x+be.r),_e=Math.max(_e,be.y+be.r);const Qe=E.width/M,Ue=E.height/M,ce=Math.min(Qe/Math.max(Me-re,1),Ue/Math.max(_e-Ce,1),1.4)*.88;D.zoom=ce,D.panX=Qe/2-(re+Me)/2*ce,D.panY=Ue/2-(Ce+_e)/2*ce},W=()=>{const re=K.length;D.tick++;const Ce=.9-Math.min(.4,D.tick/1500),Me=re>1e3?3e3:re>100?2e3:re>50?1200:800,_e=re>100?.002:.005,Qe=re>1e3?.012:re>100?.005:.01,Ue=re>1e3?6:re>200?12:24;for(let ge=0;ge<re;ge++){const pe=K[ge];let Se=-pe.x*Qe,je=-pe.y*Qe;for(let He=0;He<re;He++){if(ge===He)continue;const te=K[He],de=pe.x-te.x,Le=pe.y-te.y,Ze=de*de+Le*Le||1,rt=Math.sqrt(Ze),At=Me/Ze;Se+=de/rt*At,je+=Le/rt*At}if(pe!==D.drag){let He=(pe.vx+Se)*Ce,te=(pe.vy+je)*Ce;He=Math.max(-Ue,Math.min(Ue,He)),te=Math.max(-Ue,Math.min(Ue,te)),pe.vx=He,pe.vy=te}}for(const ge of Y){const pe=q[ge.source],Se=q[ge.target];if(!pe||!Se)continue;const je=Se.x-pe.x,He=Se.y-pe.y,te=Math.sqrt(je*je+He*He)||1,de=(te-100)*_e,Le=je/te*de,Ze=He/te*de;pe!==D.drag&&(pe.vx+=Le,pe.vy+=Ze),Se!==D.drag&&(Se.vx-=Le,Se.vy-=Ze)}let ce=0;for(const ge of K)ge!==D.drag&&(ge.x+=ge.vx,ge.y+=ge.vy,ce+=ge.vx*ge.vx+ge.vy*ge.vy);(re?Math.sqrt(ce/re):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 re=E.width/M,Ce=E.height/M;N.clearRect(0,0,re,Ce),N.strokeStyle="rgba(45,55,72,0.05)",N.lineWidth=.5;for(let be=0;be<re;be+=24)N.beginPath(),N.moveTo(be,0),N.lineTo(be,Ce),N.stroke();for(let be=0;be<Ce;be+=24)N.beginPath(),N.moveTo(0,be),N.lineTo(re,be),N.stroke();N.save(),N.translate(D.panX,D.panY),N.scale(D.zoom,D.zoom);const Me=D.search,_e=K.length>40;let Qe=null;if(!D.drag){const be=E.getBoundingClientRect(),ge=(D.mouseX-be.left-D.panX)/D.zoom,pe=(D.mouseY-be.top-D.panY)/D.zoom;for(let Se=K.length-1;Se>=0;Se--){const je=K[Se],He=je.x-ge,te=je.y-pe;if(He*He+te*te<je.r*je.r+25){Qe=je.id;break}}}const Ue=D.sel||Qe;for(const be of Y){const ge=q[be.source],pe=q[be.target];if(!ge||!pe)continue;const Se=Me&&!(ge.name.toLowerCase().includes(Me)||pe.name.toLowerCase().includes(Me)),je=Ue&&(be.source===Ue||be.target===Ue),He=pe.x-ge.x,te=pe.y-ge.y,de=Math.sqrt(He*He+te*te)||1,Le=_e?12:18,Ze=(ge.x+pe.x)/2+-te/de*Le,rt=(ge.y+pe.y)/2+He/de*Le,[At,$n,dn]=Dk(Tf(ge.language));let Mt;if(Se?Mt=.05:Ue&&je?Mt=.6:Ue&&!je?Mt=.05:Mt=_e?.14:.24,N.beginPath(),N.moveTo(ge.x,ge.y),N.quadraticCurveTo(Ze,rt,pe.x,pe.y),N.strokeStyle=`rgba(${At},${$n},${dn},${Mt})`,N.lineWidth=je?2+be.weight*.4:1+be.weight*.25,N.stroke(),!_e||je){const Wt=Math.atan2(pe.y-rt,pe.x-Ze),yt=5+N.lineWidth;N.beginPath(),N.moveTo(pe.x-pe.r*Math.cos(Wt),pe.y-pe.r*Math.sin(Wt)),N.lineTo(pe.x-(pe.r+yt)*Math.cos(Wt-.3),pe.y-(pe.r+yt)*Math.sin(Wt-.3)),N.lineTo(pe.x-(pe.r+yt)*Math.cos(Wt+.3),pe.y-(pe.r+yt)*Math.sin(Wt+.3)),N.closePath(),N.fillStyle=`rgba(${At},${$n},${dn},${Se?.05:je?.55:.18})`,N.fill()}}const ce=_e?1.5:.5;for(const be of K){const ge=Tf(be.language),pe=D.sel===be.id,Se=Qe===be.id,je=!Me||be.name.toLowerCase().includes(Me),He=Ue&&be.id!==Ue&&!Y.some(At=>At.source===Ue&&At.target===be.id||At.target===Ue&&At.source===be.id),te=je?He?.2:1:.12;N.save(),N.globalAlpha=te,je&&!He&&(pe||Se||!Me)&&(N.shadowColor=ge,N.shadowBlur=pe?20:Se?16:_e?4:8);const[de,Le,Ze]=Dk(ge),rt=N.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,ge),N.beginPath(),N.arc(be.x,be.y,be.r,0,Math.PI*2),N.fillStyle=rt,N.fill(),N.shadowBlur=0,N.lineWidth=pe?2.5:1,N.strokeStyle=pe?"#111827":"rgba(255,255,255,0.7)",N.stroke(),N.restore(),je&&!He&&(pe||Se||D.zoom>ce)){const At=1/D.zoom;N.save(),N.globalAlpha=te,N.fillStyle="rgba(45,55,72,0.92)",N.font=`${(10*At).toFixed(1)}px 'DM Sans', sans-serif`,N.textAlign="center",N.fillText(be.name,be.x,be.y+be.r+11*At),N.restore()}}N.restore()},L=()=>{if(W(),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,P=0,le=0;const xe=re=>{const Ce=E.getBoundingClientRect();return{x:(re.clientX-Ce.left-D.panX)/D.zoom,y:(re.clientY-Ce.top-D.panY)/D.zoom}},ke=(re,Ce)=>{for(let Me=K.length-1;Me>=0;Me--){const _e=K[Me];if(!_e)continue;const Qe=_e.x-re,Ue=_e.y-Ce;if(Qe*Qe+Ue*Ue<_e.r*_e.r+25)return _e}return null},Ne=re=>{const Ce=xe(re),Me=ke(Ce.x,Ce.y);Me?D.drag=Me:V=!0,P=re.clientX,le=re.clientY,z()},se=re=>{const Ce=re.clientX-P,Me=re.clientY-le;D.drag?(D.drag.x+=Ce/D.zoom,D.drag.y+=Me/D.zoom,D.drag.vx=0,D.drag.vy=0,z()):V&&(D.panX+=Ce,D.panY+=Me,z()),P=re.clientX,le=re.clientY,D.mouseX=re.clientX,D.mouseY=re.clientY;const _e=f.current,Qe=xe(re),Ue=!D.drag&&!V?ke(Qe.x,Qe.y):null;if(_e)if(Ue){const ce=Y.filter(ge=>ge.source===Ue.id||ge.target===Ue.id).length;_e.innerHTML=`<div style="font-weight:700;word-break:break-all">${Ue.id}</div><div style="margin-top:4px;color:#64748b;font-family:var(--font-mono,monospace)"><span style="color:${Tf(Ue.language)}">●</span> ${Ue.language} · ${Ue.symbols} symbols · ${ce} links</div>`;const be=E.getBoundingClientRect();_e.style.left=re.clientX-be.left+14+"px",_e.style.top=re.clientY-be.top+14+"px",_e.style.display="block",E.style.cursor="pointer"}else _e.style.display="none",E.style.cursor=D.drag||V?"grabbing":"grab";z()},ve=re=>{D.drag&&!V?Math.abs(re.clientX-P)>3||(D.sel=D.sel===D.drag.id?null:D.drag.id):V&&Math.abs(re.clientX-P)<3&&Math.abs(re.clientY-le)<3&&(D.sel=null),D.drag=null,V=!1,z()},ue=re=>{re.preventDefault();const Ce=E.getBoundingClientRect(),Me=re.clientX-Ce.left,_e=re.clientY-Ce.top,Qe=re.deltaY>0?.9:1.1,Ue=Math.max(.1,Math.min(5,D.zoom*Qe));D.panX=Me-(Me-D.panX)/D.zoom*Ue,D.panY=_e-(_e-D.panY)/D.zoom*Ue,D.zoom=Ue,z()},J=()=>{f.current&&(f.current.style.display="none")};return E.addEventListener("mousedown",Ne),window.addEventListener("mousemove",se),window.addEventListener("mouseup",ve),E.addEventListener("wheel",ue,{passive:!1}),E.addEventListener("mouseleave",J),()=>{D.raf!=null&&cancelAnimationFrame(D.raf),I.disconnect(),E.removeEventListener("mousedown",Ne),window.removeEventListener("mousemove",se),window.removeEventListener("mouseup",ve),E.removeEventListener("wheel",ue),E.removeEventListener("mouseleave",J),p.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:v4(t.dbSizeBytes)},{label:n("graph.stat.lastBuilt"),value:w4(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 bg-color-bg-soft 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:S=>l(S.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(S=>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:S.label}),c.jsx("span",{className:"font-bold font-[family-name:var(--font-mono)] text-right",children:S.value})]},S.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(S=>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:Tf(S)}}),S]},S))})]}),c.jsx("p",{className:"text-[10px] text-[var(--color-text-subtle)] text-right leading-tight pointer-events-none",children:n("graph.viz.hint")})]})]})}function E4({name:e}){var m,y;const t=Pe(),n=Ft(),i=Ve({queryKey:["graph-status",e],queryFn:()=>h4(e)}),a=()=>{n.invalidateQueries({queryKey:["graph-status",e]}),n.invalidateQueries({queryKey:["graph-data",e]})},l=Et({mutationFn:()=>g4(e),onSuccess:a}),o=Et({mutationFn:()=>y4(e),onSuccess:a}),d=((m=i.data)==null?void 0:m.data)??null,f=l.isPending,p=o.isPending,g=f||p;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(s_,{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:[p?c.jsx(Xe,{size:14,strokeWidth:2.5,className:"animate-spin"}):c.jsx(_L,{size:14,strokeWidth:2.5}),t(p?"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(TL,{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(k4,{name:e,status:d}):c.jsx("div",{className:"nb-card text-sm text-[var(--color-text-muted)]",children:t("graph.empty")})]})}const Ok=["overview","config","pipelines","skills","rules","graph","logs"];function S4({name:e,embedded:t}={}){var v;const n=Pe(),{name:i=""}=Lb(),a=e??i,l=ks(),[o]=QN(),[d,f]=Wb("projectDetail.tab","overview"),p=Ok.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&&Ok.includes(y)&&f(y)},[y]);const k=Ve({queryKey:["project",a],queryFn:()=>cI(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(ZN,{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:p,value:"overview",onSelect:f,icon:gL,children:n("projectDetail.tab.overview")}),c.jsx(ts,{current:p,value:"config",onSelect:f,icon:u_,children:n("projectDetail.tab.config")}),c.jsx(ts,{current:p,value:"pipelines",onSelect:f,icon:Kb,children:n("projectDetail.tab.pipelines")}),c.jsx(ts,{current:p,value:"skills",onSelect:f,icon:d_,children:n("projectDetail.tab.skills")}),c.jsx(ts,{current:p,value:"rules",onSelect:f,icon:GR,children:n("projectDetail.tab.rules")}),c.jsx(ts,{current:p,value:"graph",onSelect:f,icon:s_,children:n("projectDetail.tab.graph")}),c.jsx(ts,{current:p,value:"logs",onSelect:f,icon:qb,children:n("projectDetail.tab.logs")}),c.jsx(ts,{current:p,value:"danger",onSelect:()=>m(!0),icon:Vi,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",p==="logs"?"overflow-hidden":"overflow-y-auto"].join(" "),children:[p==="overview"&&c.jsx(N4,{name:a,data:k.data,loading:k.isLoading}),p==="config"&&c.jsx(_4,{name:a}),p==="pipelines"&&c.jsx(j4,{name:a}),p==="skills"&&c.jsx(f4,{name:a}),p==="rules"&&c.jsx(p4,{name:a}),p==="graph"&&c.jsx(E4,{name:a}),p==="logs"&&c.jsx(TI,{project:a,initialWorker:p==="logs"?b:void 0})]}),g&&c.jsx(C4,{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 N4({name:e,data:t,loading:n}){const i=Pe();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 _4({name:e}){const t=Pe(),n=Ft(),{alert:i}=un(),{data:a,isLoading:l,isError:o,error:d,refetch:f}=Ve({queryKey:["project-conf",e],queryFn:()=>dI(e)}),[p,g]=j.useState(null),[m,y]=j.useState(null);j.useEffect(()=>{a&&p===null&&(g(a.content),y(a.etag))},[a,p]);const b=p!==null&&a!==void 0&&p!==a.content,k=Et({mutationFn:()=>{if(p===null||m===null)throw new Error("no draft");return fI(e,p,m)},onSuccess:v=>{y(v.etag),n.invalidateQueries({queryKey:["project-conf",e]}),n.invalidateQueries({queryKey:["project",e]})},onError:v=>{const S=v.status;i({title:t(S===409?"projectDetail.config.error.conflict.title":"projectDetail.config.error.save.title"),body:S===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(QR,{size:13,strokeWidth:3}):c.jsx(mr,{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:p??"",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 j4({name:e}){const t=Pe(),n=Ft(),{confirm:i,alert:a}=un(),{data:l,isLoading:o}=Ve({queryKey:["project-pipelines",e],queryFn:()=>hI(e)}),[d,f]=j.useState(null),[p,g]=j.useState(!1),m=Et({mutationFn:v=>mI(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=Et({mutationFn:v=>xI(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=Et({mutationFn:v=>bI(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(hi,{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(Kb,{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(Kp,{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(Vi,{size:11,strokeWidth:2.5})})]})]})]},v.name))})]}),d&&c.jsx(Kz,{projectName:e,file:d,onClose:()=>f(null),onSaved:()=>{n.invalidateQueries({queryKey:["project-pipelines",e]})}}),p&&c.jsx(Yz,{hasActive:!!(l!=null&&l.active),hasSample:!0,isPending:b.isPending,onCancel:()=>g(!1),onCreate:(v,S)=>b.mutate({name:v,template:S})})]})}function C4({name:e,repoDir:t,onClose:n}){const i=Pe(),a=ks(),l=Ft(),{alert:o}=un(),[d,f]=j.useState(""),[p,g]=j.useState(!0),m=Et({mutationFn:()=>pI(e,{includeClaudeDir:p}),onSuccess:S=>{l.invalidateQueries({queryKey:["projects"]});const E=S.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(`
617
+ `)}):i("projectDetail.danger.deleted.body")}).then(()=>a("/projects"))},onError:S=>{o({title:i("projectDetail.danger.error"),body:S instanceof Error?S.message:String(S)})}});j.useEffect(()=>{const S=E=>{E.key==="Escape"&&n()};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[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(gn,{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:p,onChange:S=>g(S.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:S=>f(S.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(Vi,{size:14,strokeWidth:3}),i("projectDetail.danger.deleteButton")]})]})]})})}function px(){return ct("/api/providers")}function N2(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 A4(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 T4(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 _2(e){const t=e?`?path=${encodeURIComponent(e)}`:"";return ct(`/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 j2=50*1024*1024;async function D4(e,t){if(t.size>j2)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 Zy(e,t){return`/api/fs/file?${new URLSearchParams({path:t,sessionId:e}).toString()}`}function hx({initialPath:e,onCancel:t,onSelect:n,title:i,mode:a="directory"}){var C,N,_;const l=Pe(),{prompt:o,alert:d}=un(),f=i??l("dirPicker.title.default"),[p,g]=j.useState(e??null),[m,y]=j.useState(null),b=Ve({queryKey:["fs-browse",p],queryFn:()=>_2(p??void 0),staleTime:0,gcTime:0}),k=((C=b.data)==null?void 0:C.path)??p??"",v=((N=b.data)==null?void 0:N.parent)??null,S=((_=b.data)==null?void 0:_.home)??null,E=async()=>{var M;if(!k)return;const T=(M=await o({title:l("dirPicker.newDir"),body:l("dirPicker.newDir.prompt"),placeholder:l("dirPicker.newDir.placeholder"),confirm:l("dirPicker.newDir.create")}))==null?void 0:M.trim();if(T)try{const O=await M4(k,T);g(O.path)}catch(O){d({title:l("dirPicker.newDir.error.title"),body:O instanceof Error?O.message:String(O)})}};return j.useEffect(()=>{const T=M=>{M.key==="Escape"&&(M.preventDefault(),t())};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[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 h-[70vh] min-h-0 overflow-hidden p-5 flex flex-col",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(gn,{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(JN,{size:12,strokeWidth:3})}),c.jsx("button",{type:"button",className:"nb-btn flex-shrink-0",style:{padding:"4px 10px",fontSize:12},onClick:()=>S&&g(S),disabled:!S||b.isLoading,"aria-label":l("dirPicker.home.aria"),title:l("dirPicker.home.title"),children:c.jsx(RL,{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(xL,{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(T=>{const M=(()=>{const B=k.endsWith("/")||k.endsWith("\\")?"":"/";return`${k}${B}${T.name}`})(),O=a==="file"&&m===M,R=T.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",O?"bg-[var(--color-accent-mint)] font-bold":"hover:bg-[var(--color-accent-mint)]"].join(" "),disabled:!R,onClick:()=>{T.isDirectory?(y(null),g(M)):a==="file"&&y(M)},onDoubleClick:()=>{a==="file"&&!T.isDirectory&&n(M)},title:T.isDirectory?l("dirPicker.enter.aria",{name:T.name}):a==="file"?l("dirPicker.pickFile.aria",{name:T.name}):l("dirPicker.fileLocked"),children:[T.isDirectory?c.jsx(yp,{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:T.name}),T.isDirectory&&c.jsx(Jo,{size:12,strokeWidth:2.5,className:"ml-auto flex-shrink-0 text-[var(--color-text-muted)]"})]})},T.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(Su,{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(Su,{size:14,strokeWidth:3}),l("dirPicker.useDir")]})]})]})})}function Mf(e){return(e.replace(/\/+$/,"").split("/").pop()??"").replace(/[^a-zA-Z0-9_-]/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function C2({onCancel:e,onCreated:t,dialogMode:n=!1}={}){var K,q,Y,D,F,I;const i=Pe(),a=ks(),l=Ft(),{alert:o}=un(),d=e??(()=>a("/projects")),[f,p]=j.useState({name:"",projectDir:"",enableGit:!0,createIfMissing:!0,mergeBranch:"main",maxWorkers:"1",ackTimeoutMin:"5",pipelineMode:"pipeline"}),g=f.pipelineMode==="smartArrange",m=Ve({queryKey:["system-agents"],queryFn:Yb}),y=((K=m.data)==null?void 0:K.agents.worker.model)??"",b=((q=m.data)==null?void 0:q.agents.reviewer.model)??"",k=[...new Set((((Y=m.data)==null?void 0:Y.providers.openai)??[]).flatMap(H=>H.models))],v=Ve({queryKey:["providers"],queryFn:px}),S=N2(((D=v.data)==null?void 0:D.anthropic)??[]),E=f.workerModel?`${f.workerProviderId??""}::${f.workerModel}`:"",[C,N]=j.useState(!1),_=Et({mutationFn:H=>uI(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)})}}),T=/^[a-zA-Z0-9_-]+$/.test(f.name),M=T&&f.projectDir.trim()!==""&&!_.isPending,O=f.projectDir.trim(),R=Ve({queryKey:["fs-browse-probe",O],queryFn:()=>_2(O),enabled:O.startsWith("/"),staleTime:0,gcTime:0,retry:!1}),B=R.isSuccess&&(((F=R.data)==null?void 0:F.entries.length)??0)>0,U=R.isError||R.isSuccess&&(((I=R.data)==null?void 0:I.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(ZN,{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(),M&&_.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 W=f.pipelineMode===H;return c.jsxs("button",{type:"button",onClick:()=>p({...f,pipelineMode:H}),"aria-pressed":W,className:["text-left rounded-xl border-2 p-3 transition-all",W?"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=>p({...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 W=H.target.value;if(!W)return p({...f,workerModel:void 0,workerProviderId:void 0});const[G,L]=W.split("::");p({...f,workerModel:L,workerProviderId:G||void 0})},children:[c.jsx("option",{value:"",children:"用全局默认模型"}),S.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=>p({...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=>p({...f,name:H.target.value}),required:!0}),f.name&&!T&&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 W=H.target.value,G=Mf(W),L=Mf(f.projectDir),z=f.name&&f.name!==L;p({...f,projectDir:W,name:z?f.name:G})},required:!0}),c.jsxs("button",{type:"button",className:"nb-btn flex-shrink-0",onClick:()=>N(!0),"aria-label":i("newProject.dir.browseAria"),title:i("newProject.dir.browseAria"),children:[c.jsx(i_,{size:14,strokeWidth:2.5}),i("newProject.dir.browse")]})]}),B&&c.jsx("p",{className:"text-xs mt-1.5 font-bold text-[var(--color-text)]",children:i("newProject.field.dir.adopt")}),U&&O.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=>p({...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=>p({...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=>p({...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=>p({...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=>p({...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=>p({...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=>p({...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=>p({...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=>p({...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:!M,"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(hi,{size:14,strokeWidth:3}),i("common.create")]})})]})]})]}),C&&c.jsx(hx,{title:i("newProject.field.dir.pickerTitle"),initialPath:f.projectDir.trim()||void 0,onCancel:()=>N(!1),onSelect:H=>{const W=Mf(H),G=Mf(f.projectDir),L=f.name&&f.name!==G;p({...f,projectDir:H,name:L?f.name:W}),N(!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 O4({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(C2,{dialogMode:!0,onCancel:e,onCreated:n=>{e(),t(n)}})})})}const Rk="projects.last",R4=["activity","date","name"];function Lk(){const e=Pe(),t=ks(),{name:n}=Lb(),[i,a]=Wb("projects.sort","activity"),[l,o]=j.useState(!1),[d,f]=j.useState(!1),{data:p,isLoading:g,isError:m,error:y,refetch:b}=Ve({queryKey:["projects"],queryFn:Es}),k=T=>t(`/projects/${encodeURIComponent(T)}`),v=p?N_(p.data,i):[],S=i!=="name",{recent:E,older:C}=S?NI(v,T=>T.lastActivityAt):{recent:v,older:[]},N=l?C:C.filter(T=>T.name===n),_=C.length-N.length;return j.useEffect(()=>{if(n)try{localStorage.setItem(Rk,n)}catch{}},[n]),j.useEffect(()=>{if(n||!p)return;let T=null;try{T=localStorage.getItem(Rk)}catch{}T&&p.data.some(M=>M.name===T)&&t(`/projects/${encodeURIComponent(T)}`,{replace:!0})},[n,p,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")})]}):p&&p.data.length===0?c.jsx(P4,{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:p?e("projects.count",{count:p.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(hi,{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:R4.map(T=>c.jsx("button",{type:"button","aria-pressed":i===T,onClick:()=>a(T),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===T?"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.${T}`)},T))}),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(qp,{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(z4,{}):c.jsxs(c.Fragment,{children:[[...E,...N].map(T=>c.jsx(L4,{project:T,selected:T.name===n,onClick:()=>k(T.name)},T.name)),(_>0||l&&C.length>0)&&c.jsx("button",{type:"button",className:"nb-btn text-xs self-start mt-1",onClick:()=>o(T=>!T),"aria-label":l?"收起更早项目":"显示更早项目",children:l?"收起更早":`含更早 (${_})`})]})})]}),c.jsx("div",{className:"flex-1 min-w-0 min-h-0 flex flex-col",children:n?c.jsx(S4,{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(O4,{onClose:()=>f(!1),onCreated:k})]})}function L4({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(I4,{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 I4({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 z4(){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 P4({onNew:e}){const t=Pe(),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(m_,{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(hi,{size:16,strokeWidth:3}),t("projects.new")]})]})]})}function B4({project:e,isPending:t,onCancel:n,onCreate:i}){var N;const a=Pe(),[l,o]=j.useState(""),[d,f]=j.useState(""),[p,g]=j.useState(new Set),[m,y]=j.useState(!1),b=Ve({queryKey:["skills-all",e],queryFn:()=>fx(e)});j.useEffect(()=>{const _=T=>{T.key==="Escape"&&n()};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[n]);const v=l.trim().length>0&&l.trim().length<=200&&!t,S=_=>{const T=new Set(p);T.has(_)?T.delete(_):T.add(_),g(T)},E=()=>{v&&i({title:l.trim(),description:d.trim(),skills:[...p],labels:["AI-PIPELINE"],initialState:m?"Backlog":"Planning"})},C=((N=b.data)==null?void 0:N.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(gn,{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 T=p.has(_.name);return c.jsx("button",{type:"button",onClick:()=>S(_.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",T?"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":T,children:_.name},_.name)})})]})}),p.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:p.size,names:[...p].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(hi,{size:13,strokeWidth:3}),a("common.create")]})]})]})})}function $4(e){return ct(`/api/projects/${encodeURIComponent(e)}/cards`)}function U4(e,t){return ct(`/api/projects/${encodeURIComponent(e)}/cards/${t}`)}function F4(e,t){return ct(`/api/projects/${encodeURIComponent(e)}/cards/${t}/prompt`)}async function sc(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 q4(e,t){return sc(`/api/projects/${encodeURIComponent(e)}/cards/${t}/reset`)}async function H4(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 K4(e,t){return sc(`/api/projects/${encodeURIComponent(e)}/cards/${t}/launch`)}function G4(e,t){const n=typeof t=="string"?{title:t}:t;return sc(`/api/projects/${encodeURIComponent(e)}/cards`,n)}async function V4(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 Y4(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 A2(e){return sc(`/api/projects/${encodeURIComponent(e)}/pipeline/start`)}function T2(e){return sc(`/api/projects/${encodeURIComponent(e)}/pipeline/stop`)}function W4(e,t){return sc(`/api/projects/${encodeURIComponent(e)}/pipeline/reset`,t??{})}function Q4(e){const t=Ft();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 X4=new Set(["python","typescript","golang","rust","kotlin","swift","java"]),Z4=new Set(["frontend","backend","mobile","database","devops"]),J4=new Set(["backend-architect","frontend-developer","code-reviewer","database-optimizer","devops-automator","security-engineer","qa-tester","security","qa","architect","db-opt"]),e5=new Set(["coding-standards","tdd-workflow","git-workflow","architecture-decision-records","debugging-workflow"]);function t5(e){return X4.has(e)?"lang":Z4.has(e)?"end":J4.has(e)?"persona":e5.has(e)?"workflow":"other"}const n5={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 mx({name:e}){const t=n5[t5(e)];return c.jsx("span",{className:"nb-badge",style:{background:t},children:e})}function M2({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 i5({card:e,onClick:t,done:n,draggable:i}){const a=Pe(),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(mx,{name:o},o)),e.labels.filter(o=>o==="NEEDS-FIX").map(o=>c.jsx(M2,{label:o,kind:"warn"},o))]}),e.checklist&&e.checklist.total>0&&c.jsx(r5,{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:a5(e.updatedAt??e.createdAt,a)}),e.branch&&c.jsxs("span",{className:"truncate",children:["· ",e.branch]})]})]})}function r5({stats:e}){const t=Pe();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 a5(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 s5({label:e,bg:t,badgeVars:n,cards:i,onCardClick:a,onDropCard:l}){const o=Pe(),[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:p=>{!l||!p.dataTransfer.types.includes("application/x-sps-card-seq")||(p.preventDefault(),p.dataTransfer.dropEffect="move",d||f(!0))},onDragLeave:()=>f(!1),onDrop:p=>{if(f(!1),!l)return;const g=p.dataTransfer.getData("application/x-sps-card-seq"),m=Number.parseInt(g,10);Number.isFinite(m)&&(p.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(p=>c.jsx(i5,{card:p,onClick:()=>a(p),done:e==="Done",draggable:!!l},p.seq))]})]})}function Jy(e,t){if(!e)return"";const n=e.split(`
618
+ `),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(`
619
+ `).trim()}function Fg(e){return Jy(e,"描述")}function l5({project:e,seq:t,onClose:n,onChanged:i}){var G,L,z,V,P,le,xe,ke,Ne,se,ve;const a=Pe(),l=Ft(),{confirm:o,alert:d}=un(),{data:f,isLoading:p,isError:g,error:m,refetch:y}=Ve({queryKey:["card",e,t],queryFn:()=>U4(e,t)}),[b,k]=j.useState(!1),[v,S]=j.useState(!1),[E,C]=j.useState(""),[N,_]=j.useState(""),[T,M]=j.useState(new Set),[O,R]=j.useState([]),[B,U]=j.useState(""),K=Ve({queryKey:["skills-all",e],queryFn:()=>fx(e),enabled:b}),Y=((L=(G=Ve({queryKey:["projects"],queryFn:Es,refetchInterval:1e4}).data)==null?void 0:G.data.find(ue=>ue.name===e))==null?void 0:L.pipelineStatus)==="running";j.useEffect(()=>{b&&f&&(C(f.title),_(Fg(f.body)),M(new Set(f.skills)),R([...f.labels]))},[b,f]),j.useEffect(()=>{const ue=J=>{J.key==="Escape"&&(b?k(!1):n())};return window.addEventListener("keydown",ue),()=>window.removeEventListener("keydown",ue)},[n,b]);const D=Et({mutationFn:()=>{if(!f)throw new Error("no data");const ue={},J=E.trim();J&&J!==f.title&&(ue.title=J);const we=Fg(f.body);N!==we&&(ue.description=N);const re=[...T].sort(),Ce=[...f.skills].sort();return JSON.stringify(re)!==JSON.stringify(Ce)&&(ue.skills=re),JSON.stringify(O)!==JSON.stringify(f.labels)&&(ue.labels=O),Object.keys(ue).length===0?Promise.resolve({ok:!0,noop:!0}):Y4(e,t,ue)},onSuccess:()=>{l.invalidateQueries({queryKey:["card",e,t]}),l.invalidateQueries({queryKey:["cards",e]}),k(!1),i()},onError:ue=>{d({title:a("cardModal.error.save.title"),body:ue instanceof Error?ue.message:String(ue)})}}),F=j.useMemo(()=>{if(!b||!f)return!1;if(E.trim()!==f.title||N!==Fg(f.body))return!0;const ue=[...T].sort(),J=[...f.skills].sort();return JSON.stringify(ue)!==JSON.stringify(J)||JSON.stringify(O)!==JSON.stringify(f.labels)},[b,f,E,N,T,O]),I=ue=>{const J=new Set(T);J.has(ue)?J.delete(ue):J.add(ue),M(J)},H=()=>{const ue=B.trim();if(ue){if(O.includes(ue)){U("");return}R([...O,ue]),U("")}},W=ue=>{R(O.filter(J=>J!==ue))};return c.jsxs("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:E,onChange:ue=>C(ue.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(Kp,{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(gn,{size:14,strokeWidth:3})})]})]}),p&&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(SL,{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"}),K.isLoading&&c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:a("cardModal.skills.loading")}),K.data&&K.data.data.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1.5",children:K.data.data.map(ue=>{const J=T.has(ue.name);return c.jsx("button",{type:"button",onClick:()=>I(ue.name),"aria-pressed":J,className:["px-2.5 py-1 text-xs font-[family-name:var(--font-mono)] rounded-full border-2 transition-all",J?"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:ue.name},ue.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:[O.map(ue=>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:[ue,c.jsx("button",{type:"button",onClick:()=>W(ue),className:"hover:text-[var(--color-crashed)]","aria-label":a("cardModal.label.removeAria",{label:ue}),children:c.jsx(gn,{size:10,strokeWidth:3})})]},ue)),c.jsx("input",{type:"text",className:"nb-input",style:{padding:"4px 8px",fontSize:12,width:140},placeholder:a("cardModal.label.addPlaceholder"),value:B,onChange:ue=>U(ue.target.value),onKeyDown:ue=>{ue.key==="Enter"&&!ue.nativeEvent.isComposing&&(ue.preventDefault(),H())}}),B&&c.jsx("button",{type:"button",className:"nb-btn",style:{padding:"2px 6px",fontSize:11},onClick:H,"aria-label":a("cardModal.label.addAria"),children:c.jsx(hi,{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(ue=>c.jsx(mx,{name:ue},ue))})]}),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(ue=>c.jsx(M2,{label:ue,kind:ue==="NEEDS-FIX"?"warn":"default"},ue))})]})]}),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:N,onChange:ue=>_(ue.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")})]}),(((ke=f.checklist)==null?void 0:ke.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")," ",((Ne=f.checklist)==null?void 0:Ne.done)??0,"/",((se=f.checklist)==null?void 0:se.total)??0]})}),c.jsx("ul",{className:"text-sm space-y-1",children:(((ve=f.checklist)==null?void 0:ve.items)??[]).map((ue,J)=>c.jsxs("li",{className:`flex items-start gap-2 ${ue.done?"opacity-60 line-through":""}`,children:[c.jsx("span",{children:ue.done?"✓":"○"}),c.jsx("span",{children:ue.text})]},J))})]})]}):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:Jy(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:[((z=f.checklist)==null?void 0:z.done)??0,"/",((V=f.checklist)==null?void 0:V.total)??0]})]}),c.jsx("div",{className:"nb-card bg-[var(--color-bg-cream)] p-3",children:(((P=f.checklist)==null?void 0:P.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:`${((le=f.checklist)==null?void 0:le.percent)??0}%`}})})}),c.jsx("ul",{className:"text-sm space-y-1",children:(((xe=f.checklist)==null?void 0:xe.items)??[]).map((ue,J)=>c.jsxs("li",{className:`flex items-start gap-2 ${ue.done?"opacity-60 line-through":""}`,children:[c.jsx("span",{children:ue.done?"✓":"○"}),c.jsx("span",{children:ue.text})]},J))})]}):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:Jy(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:D.isPending,children:a("common.cancel")}),c.jsxs("button",{className:"nb-btn nb-btn-primary",type:"button",onClick:()=>D.mutate(),disabled:!F||!E.trim()||D.isPending,"aria-label":a("cardDetail.save"),children:[D.isPending?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(mr,{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"||Y,title:f.state==="Done"?a("cardModal.action.launch.disabledDone"):Y?a("cardModal.action.launch.disabledRunning"):void 0,onClick:async()=>{try{await K4(e,t),i()}catch(ue){d({title:a("cardModal.action.launch.error"),body:ue instanceof Error?ue.message:String(ue)})}},children:[c.jsx(Qu,{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 q4(e,t),i(),n()}catch(J){d({title:a("cardModal.action.reset.error"),body:J instanceof Error?J.message:String(J)})}},children:[c.jsx(Fb,{size:14,strokeWidth:2.5}),a("cardModal.action.reset")]}),c.jsxs("button",{className:"nb-btn nb-btn-lilac",type:"button",onClick:()=>S(!0),children:[c.jsx(Wu,{size:14,strokeWidth:2.5}),a("cardModal.action.viewPrompt")]}),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 H4(e,t),i(),n()}catch(we){d({title:a("projectDetail.pipelines.delete.error"),body:we instanceof Error?we.message:String(we)})}},"aria-label":a("cardModal.action.delete"),children:[c.jsx(Vi,{size:14,strokeWidth:2.5}),a("cardModal.action.delete")]})]})})]})]}),v&&c.jsx(o5,{project:e,seq:t,onClose:()=>S(!1)})]})}function o5({project:e,seq:t,onClose:n}){const i=Pe(),[a,l]=j.useState(!1),{data:o,isLoading:d,isError:f,error:p}=Ve({queryKey:["card-prompt",e,t],queryFn:()=>F4(e,t),staleTime:0});j.useEffect(()=>{const m=y=>{y.key==="Escape"&&n()};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[n]);const g=()=>{o!=null&&o.prompt&&navigator.clipboard.writeText(o.prompt).then(()=>{l(!0),setTimeout(()=>l(!1),1500)})};return c.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-50 flex items-start justify-center p-6 bg-black/40 overflow-auto",onClick:n,children:c.jsxs("div",{className:"nb-card mt-8 w-full max-w-4xl",onClick:m=>m.stopPropagation(),children:[c.jsxs("header",{className:"flex items-center justify-between gap-4 mb-3",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold",children:i("cardModal.prompt.title")}),c.jsxs("div",{className:"flex items-center gap-2",children:[(o==null?void 0:o.prompt)&&c.jsxs("button",{className:"nb-btn px-3 py-2 text-sm flex items-center gap-1.5",type:"button",onClick:g,children:[c.jsx(n_,{size:14,strokeWidth:2.5}),i(a?"cardModal.prompt.copied":"cardModal.prompt.copy")]}),c.jsx("button",{className:"nb-btn nb-btn-mint p-2",type:"button",onClick:n,"aria-label":i("skillDetail.close.aria"),children:c.jsx(gn,{size:16,strokeWidth:3})})]})]}),d&&c.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:i("cardModal.prompt.loading")}),f&&c.jsx("p",{className:"text-sm text-[var(--color-crashed)]",children:i("cardModal.prompt.error",{detail:p instanceof Error?p.message:String(p)})}),o&&c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsxs("div",{className:"flex flex-wrap gap-2 text-xs",children:[c.jsx("span",{className:"nb-badge",children:i("cardModal.prompt.metaSkills",{skills:o.meta.skills.length?o.meta.skills.join(", "):"—"})}),o.meta.memoryIncluded&&c.jsx("span",{className:"nb-badge",children:i("cardModal.prompt.metaMemory")}),c.jsx("span",{className:"nb-badge",children:o.meta.git?i("cardModal.prompt.metaGit"):i("cardModal.prompt.metaNonGit")})]}),c.jsx("div",{className:"scroll-frame max-h-[60vh] rounded-lg border-2 border-[var(--color-text)] bg-surface-input",children:c.jsx("pre",{className:"scroll-frame-body max-h-[60vh] p-4 text-xs font-[family-name:var(--font-mono)] whitespace-pre-wrap break-words",children:o.prompt})}),o.meta.nativeContext.length>0&&c.jsxs("div",{className:"text-xs text-[var(--color-text-muted)]",children:[c.jsx("p",{className:"font-bold mb-1",children:i("cardModal.prompt.nativeTitle")}),c.jsx("ul",{className:"list-disc pl-5 flex flex-col gap-0.5",children:o.meta.nativeContext.map(m=>c.jsx("li",{children:m},m))})]}),o.meta.notes.map(m=>c.jsx("p",{className:"text-xs text-[var(--color-text-subtle)] italic",children:m},m))]})]})})}function c5({current:e,onChange:t}){const[n,i]=j.useState(!1),a=j.useRef(null),{data:l}=Ve({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(Yu,{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:N_(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(Qu,{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 u5=[{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)"}}],D2="sps-console:last-board-project";function d5(){if(typeof window>"u")return null;try{return localStorage.getItem(D2)}catch{return null}}function f5(e){if(!(typeof window>"u"))try{localStorage.setItem(D2,e)}catch{}}function p5(){var I,H,W;const e=Pe(),[t,n]=QN(),i=t.get("project"),[a,l]=j.useState(null),[o,d]=j.useState(""),[f,p]=j.useState(()=>new Set),[g,m]=j.useState(()=>new Set),{confirm:y,alert:b}=un();Q4(i);const k=Ve({queryKey:["projects"],queryFn:Es}),v=Ve({queryKey:["cards",i],queryFn:()=>$4(i??""),enabled:!!i,refetchInterval:3e3}),S=Ft(),E=()=>{S.invalidateQueries({queryKey:["cards",i]}),S.invalidateQueries({queryKey:["projects"]}),S.invalidateQueries({queryKey:["pipeline-status",i]})},C=G=>{n({project:G})};j.useEffect(()=>{var L;if(i){f5(i);return}const G=d5();G&&((L=k.data)!=null&&L.data.some(z=>z.name===G))&&n({project:G},{replace:!0})},[i,k.data,n]);const N=Et({mutationFn:()=>A2(i),onSuccess:()=>{E()},onError:G=>{b({title:e("board.action.startError"),body:G instanceof Error?G.message:String(G)})}}),_=Et({mutationFn:()=>T2(i),onSuccess:()=>E(),onError:G=>{b({title:e("board.action.stopError"),body:G instanceof Error?G.message:String(G)})}}),T=Et({mutationFn:()=>W4(i,{all:!0}),onSuccess:()=>E(),onError:G=>{b({title:e("board.action.resetError"),body:G instanceof Error?G.message:String(G)})}}),[M,O]=j.useState(!1),R=Et({mutationFn:G=>G4(i,G),onSuccess:()=>{E(),O(!1)},onError:G=>{b({title:e("board.action.newCard.error"),body:G instanceof Error?G.message:String(G)})}}),B=Et({mutationFn:({seq:G,state:L})=>V4(i,G,L),onMutate:async({seq:G,state:L})=>{await S.cancelQueries({queryKey:["cards",i]});const z=S.getQueryData(["cards",i]);return z&&S.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&&S.setQueryData(["cards",i],z.prev),b({title:e("board.action.moveCard.error"),body:G instanceof Error?G.message:String(G)})},onSettled:()=>{S.invalidateQueries({queryKey:["cards",i]})}}),U=((I=v.data)==null?void 0:I.data)??[],{allSkills:K,allLabels:q}=j.useMemo(()=>{const G=new Set,L=new Set;for(const z of U){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()}},[U]);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=U.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=(W=k.data)==null?void 0:W.data.find(G=>G.name===i),F=(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(c5,{current:i,onChange:C}),c.jsxs("button",{className:F?"nb-btn nb-btn-danger":"nb-btn nb-btn-primary",onClick:()=>F?_.mutate():N.mutate(),disabled:N.isPending||_.isPending,type:"button","aria-label":e(F?"board.action.stopAria":"board.action.startAria"),title:e(F?"board.action.stopAria":"board.action.startAria"),children:[N.isPending||_.isPending?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):F?c.jsx(Hb,{size:14,strokeWidth:3}):c.jsx(Qu,{size:14,strokeWidth:3}),e(F?"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})&&T.mutate()},disabled:T.isPending,children:[T.isPending?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(Fb,{size:14,strokeWidth:2.5}),e("board.action.reset")]}),c.jsxs("button",{className:"nb-btn nb-btn-mint",type:"button",onClick:()=>O(!0),disabled:R.isPending,children:[R.isPending?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(hi,{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(Ik,{label:"skill",options:K,selected:f,onChange:p}),c.jsx(Ik,{label:"label",options:q,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(""),p(new Set),m(new Set)},type:"button","aria-label":e("board.filter.clearAria"),children:[c.jsx(gn,{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(kL,{size:12}),Y.length," / ",U.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:u5.map(G=>c.jsx(s5,{label:e(G.labelKey),bg:G.bg,badgeVars:G.badgeVars,cards:Y.filter(h5(G.state)),onCardClick:L=>l(L.seq),onDropCard:L=>B.mutate({seq:L,state:G.state})},G.state))}),a!==null&&c.jsx(l5,{project:i,seq:a,onClose:()=>l(null),onChanged:E}),M&&c.jsx(B4,{project:i,isPending:R.isPending,onCancel:()=>O(!1),onCreate:G=>R.mutate(G)})]})}function h5(e){return t=>e==="QA"?t.state==="QA"||t.state==="Review":e==="Done"?t.state==="Done"||t.state==="Canceled":t.state===e}function Ik({label:e,options:t,selected:n,onChange:i}){const a=Pe(),[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)},p=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:()=>!p&&o(m=>!m),disabled:p,"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(Yu,{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 m5(){return ct("/api/workers/all")}function g5(e){return ct(`/api/projects/${encodeURIComponent(e)}/workers`)}function y5(e,t){return ct(`/api/projects/${encodeURIComponent(e)}/workers/${t}`)}async function O2(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 zk(e,t){return O2(`/api/projects/${encodeURIComponent(e)}/workers/${t}/kill`)}function b5(e,t,n){return O2(`/api/projects/${encodeURIComponent(e)}/workers/${t}/launch`,n?{seq:n}:void 0)}function gx({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(v3,{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 yx(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 x5(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 bx(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 v5({alerts:e,selected:t,onSelect:n}){const i=Pe();return e.length===0?c.jsxs("div",{className:"nb-card bg-[var(--color-running-bg)] flex items-center gap-3",children:[c.jsx(Su,{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(O3,{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(gx,{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(t_,{size:10,strokeWidth:2.5}),yx(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:bx(a.markerUpdatedAt)})})]},`${a.project}-${a.slot}`)})})]})}function w5({active:e,selected:t,onSelect:n}){const i=Pe();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(qp,{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(gx,{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)] ${x5(a.runtimeMs)}`,children:yx(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 ",bx(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(p_,{size:9,strokeWidth:2.5,className:"inline-block mr-1 align-text-bottom"}),a.lastLogLine.msg]})]},`${a.project}-${a.slot}`)})})]})}function k5({capacity:e,selected:t,onSelect:n}){const i=Pe();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(Pk,{}),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(Pk,{}),c.jsx("tbody",{children:e.map(a=>c.jsx(E5,{capacity:a,selected:(t==null?void 0:t.project)===a.project,onSelect:()=>n(a.project)},a.project))})]})})]})]})}function Pk(){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 E5({capacity:e,selected:t,onSelect:n}){const i=Pe(),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(S5,{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 S5({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:N5(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 N5(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 _5({project:e,initialSlot:t,onChange:n}){var p;const i=Pe(),a=Ve({queryKey:["workers",e],queryFn:()=>g5(e),refetchInterval:3e3}),l=((p=a.data)==null?void 0:p.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(j5,{worker:g,active:g.slot===o,onClick:()=>d(g.slot)},g.slot))})]}),f?c.jsx(C5,{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 j5({worker:e,active:t,onClick:n}){const i=Pe();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(gx,{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 C5({project:e,worker:t,onChange:n}){var y,b;const i=Pe(),{confirm:a,alert:l}=un(),o=t.state==="crashed"||t.state==="stuck",d=Ve({queryKey:["worker-detail",e,t.slot],queryFn:()=>y5(e,t.slot),refetchInterval:3e3}),f=((y=d.data)==null?void 0:y.recentOutput)??[],p=((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:yx(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?bx(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(p_,{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(`
620
+ `)})]}),p.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:p.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:p.map(k=>`${k.ts??""} [${k.level}] ${k.msg}`).join(`
621
+ `)}),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 zk(e,t.slot)}catch{}try{await b5(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(C3,{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 zk(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($3,{size:11,strokeWidth:2.5})," ",i("workers.panel.action.kill")]})]})]})}function A5(){var o;const e=Pe(),t=Ft(),[n,i]=j.useState(null),a=Ve({queryKey:["workers-agg"],queryFn:m5,refetchInterval:5e3});j.useEffect(()=>{if(!a.data)return;const d=a.data.capacity.map(p=>p.project),f=[];for(const p of d){const g=new EventSource(`/stream/projects/${encodeURIComponent(p)}`),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 p of f)p.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(v5,{alerts:a.data.alerts,selected:n,onSelect:(d,f)=>i({project:d,slot:f})}),c.jsx(w5,{active:a.data.active,selected:n,onSelect:(d,f)=>i({project:d,slot:f})}),c.jsx(k5,{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(_5,{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(qp,{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 R2(){return ct("/api/gen/jobs")}function T5(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const M5=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,D5=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,O5={};function Bk(e,t){return(O5.jsx?D5:M5).test(e)}const R5=/[ \t\n\f\r]/g;function L5(e){return typeof e=="object"?e.type==="text"?$k(e.value):!1:$k(e)}function $k(e){return e.replace(R5,"")===""}class ed{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}ed.prototype.normal={};ed.prototype.property={};ed.prototype.space=void 0;function L2(e,t){const n={},i={};for(const a of e)Object.assign(n,a.property),Object.assign(i,a.normal);return new ed(n,i,t)}function eb(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 I5=0;const ft=El(),Nn=El(),tb=El(),Te=El(),Yt=El(),So=El(),Ei=El();function El(){return 2**++I5}const nb=Object.freeze(Object.defineProperty({__proto__:null,boolean:ft,booleanish:Nn,commaOrSpaceSeparated:Ei,commaSeparated:So,number:Te,overloadedBoolean:tb,spaceSeparated:Yt},Symbol.toStringTag,{value:"Module"})),qg=Object.keys(nb);class xx extends mi{constructor(t,n,i,a){let l=-1;if(super(t,n),Uk(this,"space",a),typeof i=="number")for(;++l<qg.length;){const o=qg[l];Uk(this,qg[l],(i&nb[o])===nb[o])}}}xx.prototype.defined=!0;function Uk(e,t,n){n&&(e[t]=n)}function lc(e){const t={},n={};for(const[i,a]of Object.entries(e.properties)){const l=new xx(i,e.transform(e.attributes||{},i),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(l.mustUseProperty=!0),t[i]=l,n[eb(i)]=i,n[eb(l.attribute)]=i}return new ed(t,n,e.space)}const I2=lc({properties:{ariaActiveDescendant:null,ariaAtomic:Nn,ariaAutoComplete:null,ariaBusy:Nn,ariaChecked:Nn,ariaColCount:Te,ariaColIndex:Te,ariaColSpan:Te,ariaControls:Yt,ariaCurrent:null,ariaDescribedBy:Yt,ariaDetails:null,ariaDisabled:Nn,ariaDropEffect:Yt,ariaErrorMessage:null,ariaExpanded:Nn,ariaFlowTo:Yt,ariaGrabbed:Nn,ariaHasPopup:null,ariaHidden:Nn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Yt,ariaLevel:Te,ariaLive:null,ariaModal:Nn,ariaMultiLine:Nn,ariaMultiSelectable:Nn,ariaOrientation:null,ariaOwns:Yt,ariaPlaceholder:null,ariaPosInSet:Te,ariaPressed:Nn,ariaReadOnly:Nn,ariaRelevant:null,ariaRequired:Nn,ariaRoleDescription:Yt,ariaRowCount:Te,ariaRowIndex:Te,ariaRowSpan:Te,ariaSelected:Nn,ariaSetSize:Te,ariaSort:null,ariaValueMax:Te,ariaValueMin:Te,ariaValueNow:Te,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function z2(e,t){return t in e?e[t]:t}function P2(e,t){return z2(e,t.toLowerCase())}const z5=lc({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:ft,allowPaymentRequest:ft,allowUserMedia:ft,alt:null,as:null,async:ft,autoCapitalize:null,autoComplete:Yt,autoFocus:ft,autoPlay:ft,blocking:Yt,capture:null,charSet:null,checked:ft,cite:null,className:Yt,cols:Te,colSpan:null,content:null,contentEditable:Nn,controls:ft,controlsList:Yt,coords:Te|So,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ft,defer:ft,dir:null,dirName:null,disabled:ft,download:tb,draggable:Nn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ft,formTarget:null,headers:Yt,height:Te,hidden:tb,high:Te,href:null,hrefLang:null,htmlFor:Yt,httpEquiv:Yt,id:null,imageSizes:null,imageSrcSet:null,inert:ft,inputMode:null,integrity:null,is:null,isMap:ft,itemId:null,itemProp:Yt,itemRef:Yt,itemScope:ft,itemType:Yt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ft,low:Te,manifest:null,max:null,maxLength:Te,media:null,method:null,min:null,minLength:Te,multiple:ft,muted:ft,name:null,nonce:null,noModule:ft,noValidate:ft,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:ft,optimum:Te,pattern:null,ping:Yt,placeholder:null,playsInline:ft,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ft,referrerPolicy:null,rel:Yt,required:ft,reversed:ft,rows:Te,rowSpan:Te,sandbox:Yt,scope:null,scoped:ft,seamless:ft,selected:ft,shadowRootClonable:ft,shadowRootDelegatesFocus:ft,shadowRootMode:null,shape:null,size:Te,sizes:null,slot:null,span:Te,spellCheck:Nn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Te,step:null,style:null,tabIndex:Te,target:null,title:null,translate:null,type:null,typeMustMatch:ft,useMap:null,value:Nn,width:Te,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Yt,axis:null,background:null,bgColor:null,border:Te,borderColor:null,bottomMargin:Te,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ft,declare:ft,event:null,face:null,frame:null,frameBorder:null,hSpace:Te,leftMargin:Te,link:null,longDesc:null,lowSrc:null,marginHeight:Te,marginWidth:Te,noResize:ft,noHref:ft,noShade:ft,noWrap:ft,object:null,profile:null,prompt:null,rev:null,rightMargin:Te,rules:null,scheme:null,scrolling:Nn,standby:null,summary:null,text:null,topMargin:Te,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Te,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ft,disableRemotePlayback:ft,prefix:null,property:null,results:Te,security:null,unselectable:null},space:"html",transform:P2}),P5=lc({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:Te,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Te,amplitude:Te,arabicForm:null,ascent:Te,attributeName:null,attributeType:null,azimuth:Te,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Te,by:null,calcMode:null,capHeight:Te,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:Te,diffuseConstant:Te,direction:null,display:null,dur:null,divisor:Te,dominantBaseline:null,download:ft,dx:null,dy:null,edgeMode:null,editable:null,elevation:Te,enableBackground:null,end:null,event:null,exponent:Te,externalResourcesRequired:null,fill:null,fillOpacity:Te,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:Te,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Te,horizOriginX:Te,horizOriginY:Te,id:null,ideographic:Te,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Te,k:Te,k1:Te,k2:Te,k3:Te,k4:Te,kernelMatrix:Ei,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Te,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:Te,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:Te,overlineThickness:Te,paintOrder:null,panose1:null,path:null,pathLength:Te,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Yt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Te,pointsAtY:Te,pointsAtZ:Te,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:Te,specularExponent:Te,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Te,strikethroughThickness:Te,string:null,stroke:null,strokeDashArray:Ei,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Te,strokeOpacity:Te,strokeWidth:null,style:null,surfaceScale:Te,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ei,tabIndex:Te,tableValues:null,target:null,targetX:Te,targetY:Te,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:Te,underlineThickness:Te,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Te,values:null,vAlphabetic:Te,vMathematical:Te,vectorEffect:null,vHanging:Te,vIdeographic:Te,version:null,vertAdvY:Te,vertOriginX:Te,vertOriginY:Te,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Te,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:z2}),B2=lc({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()}}),$2=lc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:P2}),U2=lc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),B5={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"},$5=/[A-Z]/g,Fk=/-[a-z]/g,U5=/^data[-\w.:]+$/i;function F5(e,t){const n=eb(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"&&U5.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(Fk,H5);i="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!Fk.test(l)){let o=l.replace($5,q5);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}a=xx}return new a(i,t)}function q5(e){return"-"+e.toLowerCase()}function H5(e){return e.charAt(1).toUpperCase()}const K5=L2([I2,z5,B2,$2,U2],"html"),vx=L2([I2,P5,B2,$2,U2],"svg");function G5(e){return e.join(" ").trim()}var oo={},Hg,qk;function V5(){if(qk)return Hg;qk=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=`
622
+ `,p="/",g="*",m="",y="comment",b="declaration";function k(S,E){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];E=E||{};var C=1,N=1;function _(D){var F=D.match(t);F&&(C+=F.length);var I=D.lastIndexOf(f);N=~I?D.length-I:N+D.length}function T(){var D={line:C,column:N};return function(F){return F.position=new M(D),B(),F}}function M(D){this.start=D,this.end={line:C,column:N},this.source=E.source}M.prototype.content=S;function O(D){var F=new Error(E.source+":"+C+":"+N+": "+D);if(F.reason=D,F.filename=E.source,F.line=C,F.column=N,F.source=S,!E.silent)throw F}function R(D){var F=D.exec(S);if(F){var I=F[0];return _(I),S=S.slice(I.length),F}}function B(){R(n)}function U(D){var F;for(D=D||[];F=K();)F!==!1&&D.push(F);return D}function K(){var D=T();if(!(p!=S.charAt(0)||g!=S.charAt(1))){for(var F=2;m!=S.charAt(F)&&(g!=S.charAt(F)||p!=S.charAt(F+1));)++F;if(F+=2,m===S.charAt(F-1))return O("End of comment missing");var I=S.slice(2,F-2);return N+=2,_(I),S=S.slice(F),N+=2,D({type:y,comment:I})}}function q(){var D=T(),F=R(i);if(F){if(K(),!R(a))return O("property missing ':'");var I=R(l),H=D({type:b,property:v(F[0].replace(e,m)),value:I?v(I[0].replace(e,m)):m});return R(o),H}}function Y(){var D=[];U(D);for(var F;F=q();)F!==!1&&(D.push(F),U(D));return D}return B(),Y()}function v(S){return S?S.replace(d,m):m}return Hg=k,Hg}var Hk;function Y5(){if(Hk)return oo;Hk=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(V5());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:p,value:g}=f;d?a(p,g,f):g&&(l=l||{},l[p]=g)}),l}return oo}var nu={},Kk;function W5(){if(Kk)return nu;Kk=1,Object.defineProperty(nu,"__esModule",{value:!0}),nu.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,l=function(p){return!p||n.test(p)||e.test(p)},o=function(p,g){return g.toUpperCase()},d=function(p,g){return"".concat(g,"-")},f=function(p,g){return g===void 0&&(g={}),l(p)?p:(p=p.toLowerCase(),g.reactCompat?p=p.replace(a,d):p=p.replace(i,d),p.replace(t,o))};return nu.camelCase=f,nu}var iu,Gk;function Q5(){if(Gk)return iu;Gk=1;var e=iu&&iu.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(Y5()),n=W5();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,iu=i,iu}var X5=Q5();const Z5=Hu(X5),F2=q2("end"),wx=q2("start");function q2(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 J5(e){const t=wx(e),n=F2(e);if(t&&n)return{start:t,end:n}}function hu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Vk(e.position):"start"in e||"end"in e?Vk(e):"line"in e||"column"in e?ib(e):""}function ib(e){return Yk(e&&e.line)+":"+Yk(e&&e.column)}function Vk(e){return ib(e&&e.start)+"-"+ib(e&&e.end)}function Yk(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 kx={}.hasOwnProperty,eP=new Map,tP=/[A-Z]/g,nP=new Set(["table","tbody","thead","tfoot","tr"]),iP=new Set(["td","th"]),H2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function rP(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=fP(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=dP(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"?vx:K5,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=K2(a,e,void 0);return l&&typeof l!="string"?l:a.create(e,a.Fragment,{children:l||void 0},void 0)}function K2(e,t,n){if(t.type==="element")return aP(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return sP(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return oP(e,t,n);if(t.type==="mdxjsEsm")return lP(e,t);if(t.type==="root")return cP(e,t,n);if(t.type==="text")return uP(e,t)}function aP(e,t,n){const i=e.schema;let a=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(a=vx,e.schema=a),e.ancestors.push(t);const l=V2(e,t.tagName,!1),o=pP(e,t);let d=Sx(e,t);return nP.has(t.tagName)&&(d=d.filter(function(f){return typeof f=="string"?!L5(f):!0})),G2(e,o,l,t),Ex(o,d),e.ancestors.pop(),e.schema=i,e.create(t,l,o,n)}function sP(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)}Cu(e,t.position)}function lP(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Cu(e,t.position)}function oP(e,t,n){const i=e.schema;let a=i;t.name==="svg"&&i.space==="html"&&(a=vx,e.schema=a),e.ancestors.push(t);const l=t.name===null?e.Fragment:V2(e,t.name,!0),o=hP(e,t),d=Sx(e,t);return G2(e,o,l,t),Ex(o,d),e.ancestors.pop(),e.schema=i,e.create(t,l,o,n)}function cP(e,t,n){const i={};return Ex(i,Sx(e,t)),e.create(t,e.Fragment,i,n)}function uP(e,t){return t.value}function G2(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function Ex(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function dP(e,t,n){return i;function i(a,l,o,d){const p=Array.isArray(o.children)?n:t;return d?p(l,o,d):p(l,o)}}function fP(e,t){return n;function n(i,a,l,o){const d=Array.isArray(l.children),f=wx(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 pP(e,t){const n={};let i,a;for(a in t.properties)if(a!=="children"&&kx.call(t.properties,a)){const l=mP(e,a,t.properties[a]);if(l){const[o,d]=l;e.tableCellAlignToStyle&&o==="align"&&typeof d=="string"&&iP.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 hP(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 Cu(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 Cu(e,t.position);else l=i.value===null?!0:i.value;n[a]=l}return n}function Sx(e,t){const n=[];let i=-1;const a=e.passKeys?new Map:eP;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 p=a.get(f)||0;o=f+"-"+p,a.set(f,p+1)}}const d=K2(e,l,o);d!==void 0&&n.push(d)}return n}function mP(e,t,n){const i=F5(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?T5(n):G5(n)),i.property==="style"){let a=typeof n=="object"?n:gP(e,String(n));return e.stylePropertyNameCase==="css"&&(a=yP(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&i.space?B5[i.property]||i.property:i.attribute,n]}}function gP(e,t){try{return Z5(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=H2+"#cannot-parse-style-attribute",a}}function V2(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=Bk(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=Bk(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const a=i.value;return kx.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(i);Cu(e)}function Cu(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=H2+"#cannot-handle-mdx-estrees-without-createevaluater",n}function yP(e){const t={};let n;for(n in e)kx.call(e,n)&&(t[bP(n)]=e[n]);return t}function bP(e){let t=e.replace(tP,xP);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function xP(e){return"-"+e.toLowerCase()}const Kg={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"]},vP={};function Nx(e,t){const n=vP,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Y2(e,i,a)}function Y2(e,t,n){if(wP(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 Wk(e.children,t,n)}return Array.isArray(e)?Wk(e,t,n):""}function Wk(e,t,n){const i=[];let a=-1;for(;++a<e.length;)i[a]=Y2(e[a],t,n);return i.join("")}function wP(e){return!!(e&&typeof e=="object")}const Qk=document.createElement("i");function _x(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 Xk={}.hasOwnProperty;function W2(e){const t={};let n=-1;for(;++n<e.length;)kP(t,e[n]);return t}function kP(e,t){let n;for(n in t){const a=(Xk.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let o;if(l)for(o in l){Xk.call(a,o)||(a[o]=[]);const d=l[o];EP(a[o],Array.isArray(d)?d:d?[d]:[])}}}function EP(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 Q2(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 fr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ni=Ns(/[A-Za-z]/),Gn=Ns(/[\dA-Za-z]/),SP=Ns(/[#-'*+\--9=?A-Z^-~]/);function kp(e){return e!==null&&(e<32||e===127)}const rb=Ns(/\d/),NP=Ns(/[\dA-Fa-f]/),_P=Ns(/[!-/:-@[-`{-~]/);function Je(e){return e!==null&&e<-2}function Kt(e){return e!==null&&(e<0||e===32)}function gt(e){return e===-2||e===-1||e===32}const sh=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 oc(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 St(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 jP={tokenize:CP};function CP(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"),St(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 AP={tokenize:TP},Zk={tokenize:MP};function TP(e){const t=this,n=[];let i=0,a,l,o;return d;function d(N){if(i<n.length){const _=n[i];return t.containerState=_[1],e.attempt(_[0].continuation,f,p)(N)}return p(N)}function f(N){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&C();const _=t.events.length;let T=_,M;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){M=t.events[T][1].end;break}E(i);let O=_;for(;O<t.events.length;)t.events[O][1].end={...M},O++;return ji(t.events,T+1,0,t.events.slice(_)),t.events.length=O,p(N)}return d(N)}function p(N){if(i===n.length){if(!a)return y(N);if(a.currentConstruct&&a.currentConstruct.concrete)return k(N);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Zk,g,m)(N)}function g(N){return a&&C(),E(i),y(N)}function m(N){return t.parser.lazy[t.now().line]=i!==n.length,o=t.now().offset,k(N)}function y(N){return t.containerState={},e.attempt(Zk,b,k)(N)}function b(N){return i++,n.push([t.currentConstruct,t.containerState]),y(N)}function k(N){if(N===null){a&&C(),E(0),e.consume(N);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:l}),v(N)}function v(N){if(N===null){S(e.exit("chunkFlow"),!0),E(0),e.consume(N);return}return Je(N)?(e.consume(N),S(e.exit("chunkFlow")),i=0,t.interrupt=void 0,d):(e.consume(N),v)}function S(N,_){const T=t.sliceStream(N);if(_&&T.push(null),N.previous=l,l&&(l.next=N),l=N,a.defineSkip(N.start),a.write(T),t.parser.lazy[N.start.line]){let M=a.events.length;for(;M--;)if(a.events[M][1].start.offset<o&&(!a.events[M][1].end||a.events[M][1].end.offset>o))return;const O=t.events.length;let R=O,B,U;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(B){U=t.events[R][1].end;break}B=!0}for(E(i),M=O;M<t.events.length;)t.events[M][1].end={...U},M++;ji(t.events,R+1,0,t.events.slice(O)),t.events.length=M}}function E(N){let _=n.length;for(;_-- >N;){const T=n[_];t.containerState=T[1],T[0].exit.call(t,e)}n.length=N}function C(){a.write([null]),l=void 0,a=void 0,t.containerState._closeFlow=void 0}}function MP(e,t,n){return St(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Fo(e){if(e===null||Kt(e)||ml(e))return 1;if(sh(e))return 2}function lh(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 ab={name:"attention",resolveAll:DP,tokenize:OP};function DP(e,t){let n=-1,i,a,l,o,d,f,p,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};Jk(m,-f),Jk(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},p=[],e[i][1].end.offset-e[i][1].start.offset&&(p=Hi(p,[["enter",e[i][1],t],["exit",e[i][1],t]])),p=Hi(p,[["enter",a,t],["enter",o,t],["exit",o,t],["enter",l,t]]),p=Hi(p,lh(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),p=Hi(p,[["exit",l,t],["enter",d,t],["exit",d,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,p=Hi(p,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,ji(e,i-1,n-i+3,p),n=i+p.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function OP(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,a=Fo(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 p=e.exit("attentionSequence"),g=Fo(f),m=!g||g===2&&a||n.includes(f),y=!a||a===2&&g||n.includes(i);return p._open=!!(l===42?m:m&&(a||!y)),p._close=!!(l===42?y:y&&(g||!m)),t(f)}}function Jk(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const RP={name:"autolink",tokenize:LP};function LP(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):p(b)}function o(b){return b===43||b===45||b===46||Gn(b)?(i=1,d(b)):p(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,p(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||kp(b)?n(b):(e.consume(b),f)}function p(b){return b===64?(e.consume(b),g):SP(b)?(e.consume(b),p):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 td={partial:!0,tokenize:IP};function IP(e,t,n){return i;function i(l){return gt(l)?St(e,a,"linePrefix")(l):a(l)}function a(l){return l===null||Je(l)?t(l):n(l)}}const X2={continuation:{tokenize:PP},exit:BP,name:"blockQuote",tokenize:zP};function zP(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 PP(e,t,n){const i=this;return a;function a(o){return gt(o)?St(e,l,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):l(o)}function l(o){return e.attempt(X2,t,n)(o)}}function BP(e){e.exit("blockQuote")}const Z2={name:"characterEscape",tokenize:$P};function $P(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 _P(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const J2={name:"characterReference",tokenize:UP};function UP(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"),p):(e.enter("characterReferenceValue"),l=31,o=Gn,g(m))}function p(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,o=NP,g):(e.enter("characterReferenceValue"),l=7,o=rb,g(m))}function g(m){if(m===59&&a){const y=e.exit("characterReferenceValue");return o===Gn&&!_x(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 eE={partial:!0,tokenize:qP},tE={concrete:!0,name:"codeFenced",tokenize:FP};function FP(e,t,n){const i=this,a={partial:!0,tokenize:T};let l=0,o=0,d;return f;function f(M){return p(M)}function p(M){const O=i.events[i.events.length-1];return l=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,d=M,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(M)}function g(M){return M===d?(o++,e.consume(M),g):o<3?n(M):(e.exit("codeFencedFenceSequence"),gt(M)?St(e,m,"whitespace")(M):m(M))}function m(M){return M===null||Je(M)?(e.exit("codeFencedFence"),i.interrupt?t(M):e.check(eE,v,_)(M)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(M))}function y(M){return M===null||Je(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(M)):gt(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),St(e,b,"whitespace")(M)):M===96&&M===d?n(M):(e.consume(M),y)}function b(M){return M===null||Je(M)?m(M):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(M))}function k(M){return M===null||Je(M)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(M)):M===96&&M===d?n(M):(e.consume(M),k)}function v(M){return e.attempt(a,_,S)(M)}function S(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),E}function E(M){return l>0&&gt(M)?St(e,C,"linePrefix",l+1)(M):C(M)}function C(M){return M===null||Je(M)?e.check(eE,v,_)(M):(e.enter("codeFlowValue"),N(M))}function N(M){return M===null||Je(M)?(e.exit("codeFlowValue"),C(M)):(e.consume(M),N)}function _(M){return e.exit("codeFenced"),t(M)}function T(M,O,R){let B=0;return U;function U(F){return M.enter("lineEnding"),M.consume(F),M.exit("lineEnding"),K}function K(F){return M.enter("codeFencedFence"),gt(F)?St(M,q,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):q(F)}function q(F){return F===d?(M.enter("codeFencedFenceSequence"),Y(F)):R(F)}function Y(F){return F===d?(B++,M.consume(F),Y):B>=o?(M.exit("codeFencedFenceSequence"),gt(F)?St(M,D,"whitespace")(F):D(F)):R(F)}function D(F){return F===null||Je(F)?(M.exit("codeFencedFence"),O(F)):R(F)}}}function qP(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 Gg={name:"codeIndented",tokenize:KP},HP={partial:!0,tokenize:GP};function KP(e,t,n){const i=this;return a;function a(p){return e.enter("codeIndented"),St(e,l,"linePrefix",5)(p)}function l(p){const g=i.events[i.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?o(p):n(p)}function o(p){return p===null?f(p):Je(p)?e.attempt(HP,o,f)(p):(e.enter("codeFlowValue"),d(p))}function d(p){return p===null||Je(p)?(e.exit("codeFlowValue"),o(p)):(e.consume(p),d)}function f(p){return e.exit("codeIndented"),t(p)}}function GP(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):St(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 VP={name:"codeText",previous:WP,resolve:YP,tokenize:QP};function YP(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 WP(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function QP(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"),p(m))}function p(m){return m===null||m===32||m===96||Je(m)?(e.exit("codeTextData"),f(m)):(e.consume(m),p)}function g(m){return m===96?(e.consume(m),a++,g):a===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(l.type="codeTextData",p(m))}}class XP{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&&ru(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),ru(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ru(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);ru(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ru(this.left,n.reverse())}}}function ru(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 ej(e){const t={};let n=-1,i,a,l,o,d,f,p;const g=new XP(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,ZP(g,n)),n=t[n],p=!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)),!p}function ZP(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=[],p={};let g,m,y=-1,b=n,k=0,v=0;const S=[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,S.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):S.pop(),y=S.length;y--;){const E=d.slice(S[y],S[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;)p[k+f[y][0]]=k+f[y][1],k+=f[y][1]-f[y][0]-1;return p}const JP={resolve:tB,tokenize:nB},eB={partial:!0,tokenize:iB};function tB(e){return ej(e),e}function nB(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(eB,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 iB(e,t,n){const i=this;return a;function a(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),St(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 tj(e,t,n,i,a,l,o,d,f){const p=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||kp(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||Kt(E))?(e.exit("chunkString"),e.exit(d),e.exit(o),e.exit(i),t(E)):g<p&&E===40?(e.consume(E),g++,v):E===41?(e.consume(E),g--,v):E===null||E===32||E===40||kp(E)?n(E):(e.consume(E),E===92?S:v)}function S(E){return E===40||E===41||E===92?(e.consume(E),v):v(E)}}function nj(e,t,n,i,a,l){const o=this;let d=0,f;return p;function p(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 ij(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),p(y))}function p(y){return y===o?(e.exit(l),f(o)):y===null?n(y):Je(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),St(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(y))}function g(y){return y===o||y===null||Je(y)?(e.exit("chunkString"),p(y)):(e.consume(y),y===92?m:g)}function m(y){return y===o||y===92?(e.consume(y),g):g(y)}}function mu(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)?St(e,i,n?"linePrefix":"lineSuffix")(a):t(a)}}const rB={name:"definition",tokenize:sB},aB={partial:!0,tokenize:lB};function sB(e,t,n){const i=this;let a;return l;function l(b){return e.enter("definition"),o(b)}function o(b){return nj.call(i,e,d,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function d(b){return a=fr(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 Kt(b)?mu(e,p)(b):p(b)}function p(b){return tj(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function g(b){return e.attempt(aB,m,m)(b)}function m(b){return gt(b)?St(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 lB(e,t,n){return i;function i(d){return Kt(d)?mu(e,a)(d):n(d)}function a(d){return ij(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function l(d){return gt(d)?St(e,o,"whitespace")(d):o(d)}function o(d){return d===null||Je(d)?t(d):n(d)}}const oB={name:"hardBreakEscape",tokenize:cB};function cB(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 uB={name:"headingAtx",resolve:dB,tokenize:fB};function dB(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 fB(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||Kt(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)?St(e,d,"whitespace")(g):(e.enter("atxHeadingText"),p(g))}function f(g){return g===35?(e.consume(g),f):(e.exit("atxHeadingSequence"),d(g))}function p(g){return g===null||g===35||Kt(g)?(e.exit("atxHeadingText"),d(g)):(e.consume(g),p)}}const pB=["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"],nE=["pre","script","style","textarea"],hB={concrete:!0,name:"htmlFlow",resolveTo:yB,tokenize:bB},mB={partial:!0,tokenize:vB},gB={partial:!0,tokenize:xB};function yB(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 bB(e,t,n){const i=this;let a,l,o,d,f;return p;function p(P){return g(P)}function g(P){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(P),m}function m(P){return P===33?(e.consume(P),y):P===47?(e.consume(P),l=!0,v):P===63?(e.consume(P),a=3,i.interrupt?t:L):ni(P)?(e.consume(P),o=String.fromCharCode(P),S):n(P)}function y(P){return P===45?(e.consume(P),a=2,b):P===91?(e.consume(P),a=5,d=0,k):ni(P)?(e.consume(P),a=4,i.interrupt?t:L):n(P)}function b(P){return P===45?(e.consume(P),i.interrupt?t:L):n(P)}function k(P){const le="CDATA[";return P===le.charCodeAt(d++)?(e.consume(P),d===le.length?i.interrupt?t:q:k):n(P)}function v(P){return ni(P)?(e.consume(P),o=String.fromCharCode(P),S):n(P)}function S(P){if(P===null||P===47||P===62||Kt(P)){const le=P===47,xe=o.toLowerCase();return!le&&!l&&nE.includes(xe)?(a=1,i.interrupt?t(P):q(P)):pB.includes(o.toLowerCase())?(a=6,le?(e.consume(P),E):i.interrupt?t(P):q(P)):(a=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(P):l?C(P):N(P))}return P===45||Gn(P)?(e.consume(P),o+=String.fromCharCode(P),S):n(P)}function E(P){return P===62?(e.consume(P),i.interrupt?t:q):n(P)}function C(P){return gt(P)?(e.consume(P),C):U(P)}function N(P){return P===47?(e.consume(P),U):P===58||P===95||ni(P)?(e.consume(P),_):gt(P)?(e.consume(P),N):U(P)}function _(P){return P===45||P===46||P===58||P===95||Gn(P)?(e.consume(P),_):T(P)}function T(P){return P===61?(e.consume(P),M):gt(P)?(e.consume(P),T):N(P)}function M(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),f=P,O):gt(P)?(e.consume(P),M):R(P)}function O(P){return P===f?(e.consume(P),f=null,B):P===null||Je(P)?n(P):(e.consume(P),O)}function R(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||Kt(P)?T(P):(e.consume(P),R)}function B(P){return P===47||P===62||gt(P)?N(P):n(P)}function U(P){return P===62?(e.consume(P),K):n(P)}function K(P){return P===null||Je(P)?q(P):gt(P)?(e.consume(P),K):n(P)}function q(P){return P===45&&a===2?(e.consume(P),I):P===60&&a===1?(e.consume(P),H):P===62&&a===4?(e.consume(P),z):P===63&&a===3?(e.consume(P),L):P===93&&a===5?(e.consume(P),G):Je(P)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(mB,V,Y)(P)):P===null||Je(P)?(e.exit("htmlFlowData"),Y(P)):(e.consume(P),q)}function Y(P){return e.check(gB,D,V)(P)}function D(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),F}function F(P){return P===null||Je(P)?Y(P):(e.enter("htmlFlowData"),q(P))}function I(P){return P===45?(e.consume(P),L):q(P)}function H(P){return P===47?(e.consume(P),o="",W):q(P)}function W(P){if(P===62){const le=o.toLowerCase();return nE.includes(le)?(e.consume(P),z):q(P)}return ni(P)&&o.length<8?(e.consume(P),o+=String.fromCharCode(P),W):q(P)}function G(P){return P===93?(e.consume(P),L):q(P)}function L(P){return P===62?(e.consume(P),z):P===45&&a===2?(e.consume(P),L):q(P)}function z(P){return P===null||Je(P)?(e.exit("htmlFlowData"),V(P)):(e.consume(P),z)}function V(P){return e.exit("htmlFlow"),t(P)}}function xB(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 vB(e,t,n){return i;function i(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(td,t,n)}}const wB={name:"htmlText",tokenize:kB};function kB(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),p):L===47?(e.consume(L),T):L===63?(e.consume(L),N):ni(L)?(e.consume(L),R):n(L)}function p(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?I(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),S):Je(L)?(o=v,H(L)):(e.consume(L),v)}function S(L){return L===93?(e.consume(L),E):v(L)}function E(L){return L===62?I(L):L===93?(e.consume(L),E):v(L)}function C(L){return L===null||L===62?I(L):Je(L)?(o=C,H(L)):(e.consume(L),C)}function N(L){return L===null?n(L):L===63?(e.consume(L),_):Je(L)?(o=N,H(L)):(e.consume(L),N)}function _(L){return L===62?I(L):N(L)}function T(L){return ni(L)?(e.consume(L),M):n(L)}function M(L){return L===45||Gn(L)?(e.consume(L),M):O(L)}function O(L){return Je(L)?(o=O,H(L)):gt(L)?(e.consume(L),O):I(L)}function R(L){return L===45||Gn(L)?(e.consume(L),R):L===47||L===62||Kt(L)?B(L):n(L)}function B(L){return L===47?(e.consume(L),I):L===58||L===95||ni(L)?(e.consume(L),U):Je(L)?(o=B,H(L)):gt(L)?(e.consume(L),B):I(L)}function U(L){return L===45||L===46||L===58||L===95||Gn(L)?(e.consume(L),U):K(L)}function K(L){return L===61?(e.consume(L),q):Je(L)?(o=K,H(L)):gt(L)?(e.consume(L),K):B(L)}function q(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=q,H(L)):gt(L)?(e.consume(L),q):(e.consume(L),D)}function Y(L){return L===a?(e.consume(L),a=void 0,F):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||Kt(L)?B(L):(e.consume(L),D)}function F(L){return L===47||L===62||Kt(L)?B(L):n(L)}function I(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"),W}function W(L){return gt(L)?St(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 jx={name:"labelEnd",resolveAll:_B,resolveTo:jB,tokenize:CB},EB={tokenize:AB},SB={tokenize:TB},NB={tokenize:MB};function _B(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 jB(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}},p={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",p,t]],d=Hi(d,e.slice(l+1,l+i+3)),d=Hi(d,[["enter",g,t]]),d=Hi(d,lh(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",p,t]]),d=Hi(d,e.slice(o+1)),d=Hi(d,[["exit",f,t]]),ji(e,l,e.length,d),e}function CB(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(fr(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(EB,g,o?g:m)(y):y===91?e.attempt(SB,g,o?p:m)(y):o?g(y):m(y)}function p(y){return e.attempt(NB,g,m)(y)}function g(y){return t(y)}function m(y){return l._balanced=!0,n(y)}}function AB(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 Kt(m)?mu(e,l)(m):l(m)}function l(m){return m===41?g(m):tj(e,o,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function o(m){return Kt(m)?mu(e,f)(m):g(m)}function d(m){return n(m)}function f(m){return m===34||m===39||m===40?ij(e,p,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):g(m)}function p(m){return Kt(m)?mu(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 TB(e,t,n){const i=this;return a;function a(d){return nj.call(i,e,l,o,"reference","referenceMarker","referenceString")(d)}function l(d){return i.parser.defined.includes(fr(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(d):n(d)}function o(d){return n(d)}}function MB(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 DB={name:"labelStartImage",resolveAll:jx.resolveAll,tokenize:OB};function OB(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 RB={name:"labelStartLink",resolveAll:jx.resolveAll,tokenize:LB};function LB(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 Vg={name:"lineEnding",tokenize:IB};function IB(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),St(e,t,"linePrefix")}}const ap={name:"thematicBreak",tokenize:zB};function zB(e,t,n){let i=0,a;return l;function l(p){return e.enter("thematicBreak"),o(p)}function o(p){return a=p,d(p)}function d(p){return p===a?(e.enter("thematicBreakSequence"),f(p)):i>=3&&(p===null||Je(p))?(e.exit("thematicBreak"),t(p)):n(p)}function f(p){return p===a?(e.consume(p),i++,f):(e.exit("thematicBreakSequence"),gt(p)?St(e,d,"whitespace")(p):d(p))}}const ci={continuation:{tokenize:UB},exit:qB,name:"list",tokenize:$B},PB={partial:!0,tokenize:HB},BB={partial:!0,tokenize:FB};function $B(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:rb(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(ap,n,p)(b):p(b);if(!i.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(b)}return n(b)}function f(b){return rb(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"),p(b)):n(b)}function p(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||b,e.check(td,i.interrupt?n:g,e.attempt(PB,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 UB(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(td,a,l);function a(d){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,St(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(BB,t,o)(d))}function o(d){return i.containerState._closeFlow=!0,i.interrupt=void 0,St(e,e.attempt(ci,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function FB(e,t,n){const i=this;return St(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 qB(e){e.exit(this.containerState.type)}function HB(e,t,n){const i=this;return St(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 iE={name:"setextUnderline",resolveTo:KB,tokenize:GB};function KB(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 GB(e,t,n){const i=this;let a;return l;function l(p){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=p,o(p)):n(p)}function o(p){return e.enter("setextHeadingLineSequence"),d(p)}function d(p){return p===a?(e.consume(p),d):(e.exit("setextHeadingLineSequence"),gt(p)?St(e,f,"lineSuffix")(p):f(p))}function f(p){return p===null||Je(p)?(e.exit("setextHeadingLine"),t(p)):n(p)}}const VB={tokenize:YB};function YB(e){const t=this,n=e.attempt(td,i,e.attempt(this.parser.constructs.flowInitial,a,St(e,e.attempt(this.parser.constructs.flow,a,e.attempt(JP,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 WB={resolveAll:aj()},QB=rj("string"),XB=rj("text");function rj(e){return{resolveAll:aj(e==="text"?ZB: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 p(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 p(g)?(n.exit("data"),l(g)):(n.consume(g),f)}function p(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 aj(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 ZB(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 p=a[l];if(typeof p=="string"){for(o=p.length;p.charCodeAt(o-1)===32;)d++,o--;if(o)break;o=-1}else if(p===-2)f=!0,d++;else if(p!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(d=0),d){const p={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={...p.start},i.start.offset===i.end.offset?Object.assign(i,p):(e.splice(n,0,["enter",p,t],["exit",p,t]),n+=2)}n++}return e}const JB={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:X2},e6={91:rB},t6={[-2]:Gg,[-1]:Gg,32:Gg},n6={35:uB,42:ap,45:[iE,ap],60:hB,61:iE,95:ap,96:tE,126:tE},i6={38:J2,92:Z2},r6={[-5]:Vg,[-4]:Vg,[-3]:Vg,33:DB,38:J2,42:ab,60:[RP,wB],91:RB,92:[oB,Z2],93:jx,95:ab,96:VP},a6={null:[ab,WB]},s6={null:[42,95]},l6={null:[]},o6=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:s6,contentInitial:e6,disable:l6,document:JB,flow:n6,flowInitial:t6,insideSpan:a6,string:i6,text:r6},Symbol.toStringTag,{value:"Module"}));function c6(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:O(T),check:O(M),consume:C,enter:N,exit:_,interrupt:O(M,{interrupt:!0})},p={code:null,containerState:{},defineSkip:v,events:[],now:k,parser:e,previous:null,sliceSerialize:y,sliceStream:b,write:m};let g=t.tokenize.call(p,f);return t.resolveAll&&l.push(t),p;function m(K){return o=Hi(o,K),S(),o[o.length-1]!==null?[]:(R(t,0),p.events=lh(l,p.events,p),p.events)}function y(K,q){return d6(b(K),q)}function b(K){return u6(o,K)}function k(){const{_bufferIndex:K,_index:q,line:Y,column:D,offset:F}=i;return{_bufferIndex:K,_index:q,line:Y,column:D,offset:F}}function v(K){a[K.line]=K.column,U()}function S(){let K;for(;i._index<o.length;){const q=o[i._index];if(typeof q=="string")for(K=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===K&&i._bufferIndex<q.length;)E(q.charCodeAt(i._bufferIndex));else E(q)}}function E(K){g=g(K)}function C(K){Je(K)?(i.line++,i.column=1,i.offset+=K===-3?2:1,U()):K!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===o[i._index].length&&(i._bufferIndex=-1,i._index++)),p.previous=K}function N(K,q){const Y=q||{};return Y.type=K,Y.start=k(),p.events.push(["enter",Y,p]),d.push(Y),Y}function _(K){const q=d.pop();return q.end=k(),p.events.push(["exit",q,p]),q}function T(K,q){R(K,q.from)}function M(K,q){q.restore()}function O(K,q){return Y;function Y(D,F,I){let H,W,G,L;return Array.isArray(D)?V(D):"tokenize"in D?V([D]):z(D);function z(ke){return Ne;function Ne(se){const ve=se!==null&&ke[se],ue=se!==null&&ke.null,J=[...Array.isArray(ve)?ve:ve?[ve]:[],...Array.isArray(ue)?ue:ue?[ue]:[]];return V(J)(se)}}function V(ke){return H=ke,W=0,ke.length===0?I:P(ke[W])}function P(ke){return Ne;function Ne(se){return L=B(),G=ke,ke.partial||(p.currentConstruct=ke),ke.name&&p.parser.constructs.disable.null.includes(ke.name)?xe():ke.tokenize.call(q?Object.assign(Object.create(p),q):p,f,le,xe)(se)}}function le(ke){return K(G,L),F}function xe(ke){return L.restore(),++W<H.length?P(H[W]):I}}}function R(K,q){K.resolveAll&&!l.includes(K)&&l.push(K),K.resolve&&ji(p.events,q,p.events.length-q,K.resolve(p.events.slice(q),p)),K.resolveTo&&(p.events=K.resolveTo(p.events,p))}function B(){const K=k(),q=p.previous,Y=p.currentConstruct,D=p.events.length,F=Array.from(d);return{from:D,restore:I};function I(){i=K,p.previous=q,p.currentConstruct=Y,p.events.length=D,d=F,U()}}function U(){i.line in a&&i.column<2&&(i.column=a[i.line],i.offset+=a[i.line]-1)}}function u6(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 d6(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=`
623
+ `;break}case-3:{o=`\r
624
+ `;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 f6(e){const i={constructs:W2([o6,...(e||{}).extensions||[]]),content:a(jP),defined:[],document:a(AP),flow:a(VB),lazy:{},string:a(QB),text:a(XB)};return i;function a(l){return o;function o(d){return c6(i,l,d)}}}function p6(e){for(;!ej(e););return e}const rE=/[\0\t\n\r]/g;function h6(){let e=1,t="",n=!0,i;return a;function a(l,o,d){const f=[];let p,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(rE.lastIndex=m,p=rE.exec(l),y=p&&p.index!==void 0?p.index:l.length,b=l.charCodeAt(y),!p){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 m6=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function g6(e){return e.replace(m6,y6)}function y6(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),l=a===120||a===88;return Q2(n.slice(l?2:1),l?16:10)}return _x(n)||e}const sj={}.hasOwnProperty;function b6(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),x6(n)(p6(f6(n).document().write(h6()(e,t,!0))))}function x6(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(ce),autolinkProtocol:B,autolinkEmail:B,atxHeading:l(Me),blockQuote:l(ue),characterEscape:B,characterReference:B,codeFenced:l(J),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:l(J,o),codeText:l(we,o),codeTextData:B,data:B,codeFlowValue:B,definition:l(re),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:l(Ce),hardBreakEscape:l(_e),hardBreakTrailing:l(_e),htmlFlow:l(Qe,o),htmlFlowData:B,htmlText:l(Qe,o),htmlTextData:B,image:l(Ue),label:o,link:l(ce),listItem:l(ge),listItemValue:y,listOrdered:l(be,m),listUnordered:l(be),paragraph:l(pe),reference:P,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:l(Me),strong:l(Se),thematicBreak:l(He)},exit:{atxHeading:f(),atxHeadingSequence:T,autolink:f(),autolinkEmail:ve,autolinkProtocol:se,blockQuote:f(),characterEscapeValue:U,characterReferenceMarkerHexadecimal:xe,characterReferenceMarkerNumeric:xe,characterReferenceValue:ke,characterReference:Ne,codeFenced:f(S),codeFencedFence:v,codeFencedFenceInfo:b,codeFencedFenceMeta:k,codeFlowValue:U,codeIndented:f(E),codeText:f(F),codeTextData:U,data:U,definition:f(),definitionDestinationString:_,definitionLabelString:C,definitionTitleString:N,emphasis:f(),hardBreakEscape:f(q),hardBreakTrailing:f(q),htmlFlow:f(Y),htmlFlowData:U,htmlText:f(D),htmlTextData:U,image:f(H),label:G,labelText:W,lineEnding:K,link:f(I),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:le,resourceDestinationString:L,resourceTitleString:z,resource:V,setextHeading:f(R),setextHeadingLineSequence:O,setextHeadingText:M,strong:f(),thematicBreak:f()}};lj(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(te){let de={type:"root",children:[]};const Le={stack:[de],tokenStack:[],config:t,enter:d,exit:p,buffer:o,resume:g,data:n},Ze=[];let rt=-1;for(;++rt<te.length;)if(te[rt][1].type==="listOrdered"||te[rt][1].type==="listUnordered")if(te[rt][0]==="enter")Ze.push(rt);else{const At=Ze.pop();rt=a(te,At,rt)}for(rt=-1;++rt<te.length;){const At=t[te[rt][0]];sj.call(At,te[rt][1].type)&&At[te[rt][1].type].call(Object.assign({sliceSerialize:te[rt][2].sliceSerialize},Le),te[rt][1])}if(Le.tokenStack.length>0){const At=Le.tokenStack[Le.tokenStack.length-1];(At[1]||aE).call(Le,void 0,At[0])}for(de.position={start:ns(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:ns(te.length>0?te[te.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(te,de,Le){let Ze=de-1,rt=-1,At=!1,$n,dn,Mt,Wt;for(;++Ze<=Le;){const yt=te[Ze];switch(yt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{yt[0]==="enter"?rt++:rt--,Wt=void 0;break}case"lineEndingBlank":{yt[0]==="enter"&&($n&&!Wt&&!rt&&!Mt&&(Mt=Ze),Wt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Wt=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=te[Ti];if(Rn[1].type==="lineEnding"||Rn[1].type==="lineEndingBlank"){if(Rn[0]==="exit")continue;dn&&(te[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?te[dn][1].start:yt[1].end),te.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,te.splice(Ze,0,["enter",Ti,yt[2]]),Ze++,Le++,Mt=void 0,Wt=!0}}}return te[de][1]._spread=At,Le}function l(te,de){return Le;function Le(Ze){d.call(this,te(Ze),Ze),de&&de.call(this,Ze)}}function o(){this.stack.push({type:"fragment",children:[]})}function d(te,de,Le){this.stack[this.stack.length-1].children.push(te),this.stack.push(te),this.tokenStack.push([de,Le||void 0]),te.position={start:ns(de.start),end:void 0}}function f(te){return de;function de(Le){te&&te.call(this,Le),p.call(this,Le)}}function p(te,de){const Le=this.stack.pop(),Ze=this.tokenStack.pop();if(Ze)Ze[0].type!==te.type&&(de?de.call(this,te,Ze[0]):(Ze[1]||aE).call(this,te,Ze[0]));else throw new Error("Cannot close `"+te.type+"` ("+hu({start:te.start,end:te.end})+"): it’s not open");Le.position.end=ns(te.end)}function g(){return Nx(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function y(te){if(this.data.expectingFirstListItemValue){const de=this.stack[this.stack.length-2];de.start=Number.parseInt(this.sliceSerialize(te),10),this.data.expectingFirstListItemValue=void 0}}function b(){const te=this.resume(),de=this.stack[this.stack.length-1];de.lang=te}function k(){const te=this.resume(),de=this.stack[this.stack.length-1];de.meta=te}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te.replace(/(\r?\n|\r)$/g,"")}function C(te){const de=this.resume(),Le=this.stack[this.stack.length-1];Le.label=de,Le.identifier=fr(this.sliceSerialize(te)).toLowerCase()}function N(){const te=this.resume(),de=this.stack[this.stack.length-1];de.title=te}function _(){const te=this.resume(),de=this.stack[this.stack.length-1];de.url=te}function T(te){const de=this.stack[this.stack.length-1];if(!de.depth){const Le=this.sliceSerialize(te).length;de.depth=Le}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function O(te){const de=this.stack[this.stack.length-1];de.depth=this.sliceSerialize(te).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function B(te){const Le=this.stack[this.stack.length-1].children;let Ze=Le[Le.length-1];(!Ze||Ze.type!=="text")&&(Ze=je(),Ze.position={start:ns(te.start),end:void 0},Le.push(Ze)),this.stack.push(Ze)}function U(te){const de=this.stack.pop();de.value+=this.sliceSerialize(te),de.position.end=ns(te.end)}function K(te){const de=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Le=de.children[de.children.length-1];Le.position.end=ns(te.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(de.type)&&(B.call(this,te),U.call(this,te))}function q(){this.data.atHardBreak=!0}function Y(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te}function D(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te}function F(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te}function I(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=de,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function H(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=de,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function W(te){const de=this.sliceSerialize(te),Le=this.stack[this.stack.length-2];Le.label=g6(de),Le.identifier=fr(de).toLowerCase()}function G(){const te=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=te.children;Le.children=Ze}else Le.alt=de}function L(){const te=this.resume(),de=this.stack[this.stack.length-1];de.url=te}function z(){const te=this.resume(),de=this.stack[this.stack.length-1];de.title=te}function V(){this.data.inReference=void 0}function P(){this.data.referenceType="collapsed"}function le(te){const de=this.resume(),Le=this.stack[this.stack.length-1];Le.label=de,Le.identifier=fr(this.sliceSerialize(te)).toLowerCase(),this.data.referenceType="full"}function xe(te){this.data.characterReferenceType=te.type}function ke(te){const de=this.sliceSerialize(te),Le=this.data.characterReferenceType;let Ze;Le?(Ze=Q2(de,Le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ze=_x(de);const rt=this.stack[this.stack.length-1];rt.value+=Ze}function Ne(te){const de=this.stack.pop();de.position.end=ns(te.end)}function se(te){U.call(this,te);const de=this.stack[this.stack.length-1];de.url=this.sliceSerialize(te)}function ve(te){U.call(this,te);const de=this.stack[this.stack.length-1];de.url="mailto:"+this.sliceSerialize(te)}function ue(){return{type:"blockquote",children:[]}}function J(){return{type:"code",lang:null,meta:null,value:""}}function we(){return{type:"inlineCode",value:""}}function re(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ce(){return{type:"emphasis",children:[]}}function Me(){return{type:"heading",depth:0,children:[]}}function _e(){return{type:"break"}}function Qe(){return{type:"html",value:""}}function Ue(){return{type:"image",title:null,url:"",alt:null}}function ce(){return{type:"link",title:null,url:"",children:[]}}function be(te){return{type:"list",ordered:te.type==="listOrdered",start:null,spread:te._spread,children:[]}}function ge(te){return{type:"listItem",spread:te._spread,checked:null,children:[]}}function pe(){return{type:"paragraph",children:[]}}function Se(){return{type:"strong",children:[]}}function je(){return{type:"text",value:""}}function He(){return{type:"thematicBreak"}}}function ns(e){return{line:e.line,column:e.column,offset:e.offset}}function lj(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?lj(e,i):v6(e,i)}}function v6(e,t){let n;for(n in t)if(sj.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 aE(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 w6(e){const t=this;t.parser=n;function n(i){return b6(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function k6(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 E6(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
625
+ `}]}function S6(e,t){const n=t.value?t.value+`
626
+ `:"",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 N6(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _6(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function j6(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),a=oc(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 p={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,p),e.applyData(t,p)}function C6(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 A6(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function oj(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 T6(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return oj(e,t);const a={src:oc(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 M6(e,t){const n={src:oc(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 D6(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 O6(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return oj(e,t);const a={href:oc(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 R6(e,t){const n={href:oc(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 L6(e,t,n){const i=e.all(t),a=n?I6(n):cj(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:`
627
+ `}),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:`
628
+ `});const p={type:"element",tagName:"li",properties:l,children:o};return e.patch(t,p),e.applyData(t,p)}function I6(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=cj(n[i])}return t}function cj(e){const t=e.spread;return t??e.children.length>1}function z6(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 P6(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function B6(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function $6(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function U6(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=wx(t.children[1]),f=F2(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 F6(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 p=[];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)),p.push(k)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(p,!0)};return e.patch(t,g),e.applyData(t,g)}function q6(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const sE=9,lE=32;function H6(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),a=0;const l=[];for(;i;)l.push(oE(t.slice(a,i.index),a>0,!0),i[0]),a=i.index+i[0].length,i=n.exec(t);return l.push(oE(t.slice(a),a>0,!1)),l.join("")}function oE(e,t,n){let i=0,a=e.length;if(t){let l=e.codePointAt(i);for(;l===sE||l===lE;)i++,l=e.codePointAt(i)}if(n){let l=e.codePointAt(a-1);for(;l===sE||l===lE;)a--,l=e.codePointAt(a-1)}return a>i?e.slice(i,a):""}function K6(e,t){const n={type:"text",value:H6(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function G6(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const V6={blockquote:k6,break:E6,code:S6,delete:N6,emphasis:_6,footnoteReference:j6,heading:C6,html:A6,imageReference:T6,image:M6,inlineCode:D6,linkReference:O6,link:R6,listItem:L6,list:z6,paragraph:P6,root:B6,strong:$6,table:U6,tableCell:q6,tableRow:F6,text:K6,thematicBreak:G6,toml:Df,yaml:Df,definition:Df,footnoteDefinition:Df};function Df(){}const uj=-1,oh=0,gu=1,Ep=2,Cx=3,Ax=4,Tx=5,Mx=6,dj=7,fj=8,cE=typeof self=="object"?self:globalThis,Y6=(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 oh:case uj:return n(o,a);case gu:{const d=n([],a);for(const f of o)d.push(i(f));return d}case Ep:{const d=n({},a);for(const[f,p]of o)d[i(f)]=i(p);return d}case Cx:return n(new Date(o),a);case Ax:{const{source:d,flags:f}=o;return n(new RegExp(d,f),a)}case Tx:{const d=n(new Map,a);for(const[f,p]of o)d.set(i(f),i(p));return d}case Mx:{const d=n(new Set,a);for(const f of o)d.add(i(f));return d}case dj:{const{name:d,message:f}=o;return n(new cE[d](f),a)}case fj: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 cE[l](o),a)};return i},uE=e=>Y6(new Map,e)(0),co="",{toString:W6}={},{keys:Q6}=Object,au=e=>{const t=typeof e;if(t!=="object"||!e)return[oh,t];const n=W6.call(e).slice(8,-1);switch(n){case"Array":return[gu,co];case"Object":return[Ep,co];case"Date":return[Cx,co];case"RegExp":return[Ax,co];case"Map":return[Tx,co];case"Set":return[Mx,co];case"DataView":return[gu,n]}return n.includes("Array")?[gu,n]:n.includes("Error")?[dj,n]:[Ep,n]},Of=([e,t])=>e===oh&&(t==="function"||t==="symbol"),X6=(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]=au(o);switch(d){case oh:{let g=o;switch(f){case"bigint":d=fj,g=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);g=null;break;case"undefined":return a([uj],o)}return a([d,g],o)}case gu:{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 Ep:{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 Q6(o))(e||!Of(au(o[y])))&&g.push([l(y),l(o[y])]);return m}case Cx:return a([d,o.toISOString()],o);case Ax:{const{source:g,flags:m}=o;return a([d,{source:g,flags:m}],o)}case Tx:{const g=[],m=a([d,g],o);for(const[y,b]of o)(e||!(Of(au(y))||Of(au(b))))&&g.push([l(y),l(b)]);return m}case Mx:{const g=[],m=a([d,g],o);for(const y of o)(e||!Of(au(y)))&&g.push(l(y));return m}}const{message:p}=o;return a([d,{name:f,message:p}],o)};return l},dE=(e,{json:t,lossy:n}={})=>{const i=[];return X6(!(t||n),!!t,new Map,i)(e),i},Sp=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?uE(dE(e,t)):structuredClone(e):(e,t)=>uE(dE(e,t));function Z6(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 J6(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function e$(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Z6,i=e.options.footnoteBackLabel||J6,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 p=e.footnoteById.get(e.footnoteOrder[f]);if(!p)continue;const g=e.all(p),m=String(p.identifier).toUpperCase(),y=oc(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 S=g[g.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const C=S.children[S.children.length-1];C&&C.type==="text"?C.value+=" ":S.children.push({type:"text",value:" "}),S.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(p,E),d.push(E)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Sp(o),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
629
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
630
+ `}]}}const nd=(function(e){if(e==null)return r$;if(typeof e=="function")return ch(e);if(typeof e=="object")return Array.isArray(e)?t$(e):n$(e);if(typeof e=="string")return i$(e);throw new Error("Expected function, string, or object as test")});function t$(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=nd(e[n]);return ch(i);function i(...a){let l=-1;for(;++l<t.length;)if(t[l].apply(this,a))return!0;return!1}}function n$(e){const t=e;return ch(n);function n(i){const a=i;let l;for(l in e)if(a[l]!==t[l])return!1;return!0}}function i$(e){return ch(t);function t(n){return n&&n.type===e}}function ch(e){return t;function t(n,i,a){return!!(a$(n)&&e.call(this,n,typeof i=="number"?i:void 0,a||void 0))}}function r$(){return!0}function a$(e){return e!==null&&typeof e=="object"&&"type"in e}const pj=[],s$=!0,sb=!1,l$="skip";function hj(e,t,n,i){let a;typeof t=="function"&&typeof n!="function"?(i=n,n=t):a=t;const l=nd(a),o=i?-1:1;d(e,void 0,[])();function d(f,p,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=pj,k,v,S;if((!t||l(f,p,g[g.length-1]||void 0))&&(b=o$(n(f,g)),b[0]===sb))return b;if("children"in f&&f.children){const E=f;if(E.children&&b[0]!==l$)for(v=(i?E.children.length:-1)+o,S=g.concat(E);v>-1&&v<E.children.length;){const C=E.children[v];if(k=d(C,v,S)(),k[0]===sb)return k;v=typeof k[1]=="number"?k[1]:v+o}}return b}}}function o$(e){return Array.isArray(e)?e:typeof e=="number"?[s$,e]:e==null?pj:[e]}function uh(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),hj(e,l,d,a);function d(f,p){const g=p[p.length-1],m=g?g.children.indexOf(f):void 0;return o(f,m,g)}}const lb={}.hasOwnProperty,c$={};function u$(e,t){const n=t||c$,i=new Map,a=new Map,l=new Map,o={...V6,...n.handlers},d={all:p,applyData:f$,definitionById:i,footnoteById:a,footnoteCounts:l,footnoteOrder:[],handlers:o,one:f,options:n,patch:d$,wrap:h$};return uh(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(lb.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,...S}=g,E=Sp(S);return E.children=d.all(g),E}return Sp(g)}return(d.options.unknownHandler||p$)(d,g,m)}function p(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=fE(k.value)),!Array.isArray(k)&&k.type==="element")){const v=k.children[0];v&&v.type==="text"&&(v.value=fE(v.value))}Array.isArray(k)?m.push(...k):m.push(k)}}}return m}}function d$(e,t){e.position&&(t.position=J5(e))}function f$(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,Sp(l)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function p$(e,t){const n=t.data||{},i="value"in t&&!(lb.call(n,"hProperties")||lb.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 h$(e,t){const n=[];let i=-1;for(t&&n.push({type:"text",value:`
631
+ `});++i<e.length;)i&&n.push({type:"text",value:`
632
+ `}),n.push(e[i]);return t&&e.length>0&&n.push({type:"text",value:`
633
+ `}),n}function fE(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function pE(e,t){const n=u$(e,t),i=n.one(e,void 0),a=e$(n),l=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return a&&l.children.push({type:"text",value:`
634
+ `},a),l}function m$(e,t){return e&&"run"in e?async function(n,i){const a=pE(n,{file:i,...t});await e.run(a,i)}:function(n,i){return pE(n,{file:i,...e||t})}}function hE(e){if(e)throw e}var Yg,mE;function g$(){if(mE)return Yg;mE=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=function(p){return typeof Array.isArray=="function"?Array.isArray(p):t.call(p)==="[object Array]"},l=function(p){if(!p||t.call(p)!=="[object Object]")return!1;var g=e.call(p,"constructor"),m=p.constructor&&p.constructor.prototype&&e.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!g&&!m)return!1;var y;for(y in p);return typeof y>"u"||e.call(p,y)},o=function(p,g){n&&g.name==="__proto__"?n(p,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):p[g.name]=g.newValue},d=function(p,g){if(g==="__proto__")if(e.call(p,g)){if(i)return i(p,g).value}else return;return p[g]};return Yg=function f(){var p,g,m,y,b,k,v=arguments[0],S=1,E=arguments.length,C=!1;for(typeof v=="boolean"&&(C=v,v=arguments[1]||{},S=2),(v==null||typeof v!="object"&&typeof v!="function")&&(v={});S<E;++S)if(p=arguments[S],p!=null)for(g in p)m=d(v,g),y=d(p,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},Yg}var y$=g$();const Wg=Hu(y$);function ob(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 b$(){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,...p){const g=e[++l];let m=-1;if(f){o(f);return}for(;++m<a.length;)(p[m]===null||p[m]===void 0)&&(p[m]=a[m]);a=p,g?x$(g,d)(...p):o(null,...p)}}function i(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function x$(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(p){const g=p;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 jr={basename:v$,dirname:w$,extname:k$,join:E$,sep:"/"};function v$(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');id(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 w$(e){if(id(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 k$(e){id(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 E$(...e){let t=-1,n;for(;++t<e.length;)id(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":S$(n)}function S$(e){id(e);const t=e.codePointAt(0)===47;let n=N$(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function N$(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 id(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const _$={cwd:j$};function j$(){return"/"}function cb(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function C$(e){if(typeof e=="string")e=new URL(e);else if(!cb(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 A$(e)}function A$(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 Qg=["history","path","basename","stem","extname","dirname"];class mj{constructor(t){let n;t?cb(t)?n={path:t}:typeof t=="string"||T$(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":_$.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<Qg.length;){const l=Qg[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)Qg.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?jr.basename(this.path):void 0}set basename(t){Zg(t,"basename"),Xg(t,"basename"),this.path=jr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?jr.dirname(this.path):void 0}set dirname(t){gE(this.basename,"dirname"),this.path=jr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?jr.extname(this.path):void 0}set extname(t){if(Xg(t,"extname"),gE(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=jr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){cb(t)&&(t=C$(t)),Zg(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?jr.basename(this.path,this.extname):void 0}set stem(t){Zg(t,"stem"),Xg(t,"stem"),this.path=jr.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 Xg(e,t){if(e&&e.includes(jr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+jr.sep+"`")}function Zg(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function gE(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function T$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const M$=(function(e){const i=this.constructor.prototype,a=i[e],l=function(){return a.apply(l,arguments)};return Object.setPrototypeOf(l,i),l}),D$={}.hasOwnProperty;class Dx extends M${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=b$()}copy(){const t=new Dx;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(Wg(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(ty("data",this.frozen),this.namespace[t]=n,this):D$.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ty("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=Rf(t),i=this.parser||this.Parser;return Jg("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),Jg("process",this.parser||this.Parser),ey("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(l,o){const d=Rf(t),f=i.parse(d);i.run(f,d,function(g,m,y){if(g||!m||!y)return p(g);const b=m,k=i.stringify(b,y);L$(k)?y.value=k:y.result=k,p(g,y)});function p(g,m){g||!m?o(g):l?l(m):n(void 0,m)}}}processSync(t){let n=!1,i;return this.freeze(),Jg("processSync",this.parser||this.Parser),ey("processSync",this.compiler||this.Compiler),this.process(t,a),bE("processSync","process",n),i;function a(l,o){n=!0,hE(l),i=o}}run(t,n,i){yE(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=Rf(n);a.run(t,f,p);function p(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),bE("runSync","run",i),a;function l(o,d){hE(o),a=d,i=!0}}stringify(t,n){this.freeze();const i=Rf(n),a=this.compiler||this.Compiler;return ey("stringify",a),yE(t),a(t,i)}use(t,...n){const i=this.attachers,a=this.namespace;if(ty("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(p){if(typeof p=="function")f(p,[]);else if(typeof p=="object")if(Array.isArray(p)){const[g,...m]=p;f(g,m)}else o(p);else throw new TypeError("Expected usable value, not `"+p+"`")}function o(p){if(!("plugins"in p)&&!("settings"in p))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");d(p.plugins),p.settings&&(a.settings=Wg(!0,a.settings,p.settings))}function d(p){let g=-1;if(p!=null)if(Array.isArray(p))for(;++g<p.length;){const m=p[g];l(m)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function f(p,g){let m=-1,y=-1;for(;++m<i.length;)if(i[m][0]===p){y=m;break}if(y===-1)i.push([p,...g]);else if(g.length>0){let[b,...k]=g;const v=i[y][1];ob(v)&&ob(b)&&(b=Wg(!0,v,b)),i[y]=[p,b,...k]}}}}const O$=new Dx().freeze();function Jg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ey(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ty(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 yE(e){if(!ob(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function bE(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Rf(e){return R$(e)?e:new mj(e)}function R$(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function L$(e){return typeof e=="string"||I$(e)}function I$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const z$="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",xE=[],vE={allowDangerousHtml:!0},P$=/^(https?|ircs?|mailto|xmpp)$/i,B$=[{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 Ox(e){const t=$$(e),n=U$(e);return F$(t.runSync(t.parse(n),n),e)}function $$(e){const t=e.rehypePlugins||xE,n=e.remarkPlugins||xE,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...vE}:vE;return O$().use(w6).use(n).use(m$,i).use(t)}function U$(e){const t=e.children||"",n=new mj;return typeof t=="string"&&(n.value=t),n}function F$(e,t){const n=t.allowedElements,i=t.allowElement,a=t.components,l=t.disallowedElements,o=t.skipHtml,d=t.unwrapDisallowed,f=t.urlTransform||q$;for(const g of B$)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+z$+g.id,void 0);return uh(e,p),rP(e,{Fragment:c.Fragment,components:a,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function p(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 Kg)if(Object.hasOwn(Kg,b)&&Object.hasOwn(g.properties,b)){const k=g.properties[b],v=Kg[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 q$(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||P$.test(e.slice(0,t))?e:""}function wE(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 H$(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function K$(e,t,n){const a=nd((n||{}).ignore||[]),l=G$(t);let o=-1;for(;++o<l.length;)hj(e,"text",d);function d(p,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(p,g)}function f(p,g){const m=g[g.length-1],y=l[o][0],b=l[o][1];let k=0;const S=m.children.indexOf(p);let E=!1,C=[];y.lastIndex=0;let N=y.exec(p.value);for(;N;){const _=N.index,T={index:N.index,input:N.input,stack:[...g,p]};let M=b(...N,T);if(typeof M=="string"&&(M=M.length>0?{type:"text",value:M}:void 0),M===!1?y.lastIndex=_+1:(k!==_&&C.push({type:"text",value:p.value.slice(k,_)}),Array.isArray(M)?C.push(...M):M&&C.push(M),k=_+N[0].length,E=!0),!y.global)break;N=y.exec(p.value)}return E?(k<p.value.length&&C.push({type:"text",value:p.value.slice(k)}),m.children.splice(S,1,...C)):C=[p],S+C.length}}function G$(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([V$(a[0]),Y$(a[1])])}return t}function V$(e){return typeof e=="string"?new RegExp(H$(e),"g"):e}function Y$(e){return typeof e=="function"?e:function(){return e}}const ny="phrasing",iy=["autolink","link","image","label"];function W$(){return{transforms:[nU],enter:{literalAutolink:X$,literalAutolinkEmail:ry,literalAutolinkHttp:ry,literalAutolinkWww:ry},exit:{literalAutolink:tU,literalAutolinkEmail:eU,literalAutolinkHttp:Z$,literalAutolinkWww:J$}}}function Q$(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ny,notInConstruct:iy},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ny,notInConstruct:iy},{character:":",before:"[ps]",after:"\\/",inConstruct:ny,notInConstruct:iy}]}}function X$(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ry(e){this.config.enter.autolinkProtocol.call(this,e)}function Z$(e){this.config.exit.autolinkProtocol.call(this,e)}function J$(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 eU(e){this.config.exit.autolinkEmail.call(this,e)}function tU(e){this.exit(e)}function nU(e){K$(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,iU],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),rU]],{ignore:["link","linkReference"]})}function iU(e,t,n,i,a){let l="";if(!gj(a)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!aU(n)))return!1;const o=sU(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 rU(e,t,n,i){return!gj(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function aU(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 sU(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=wE(e,"(");let l=wE(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 gj(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||ml(n)||sh(n))&&(!t||n!==47)}yj.peek=mU;function lU(){this.buffer()}function oU(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function cU(){this.buffer()}function uU(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function dU(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=fr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function fU(e){this.exit(e)}function pU(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=fr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function hU(e){this.exit(e)}function mU(){return"["}function yj(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 gU(){return{enter:{gfmFootnoteCallString:lU,gfmFootnoteCall:oU,gfmFootnoteDefinitionLabelString:cU,gfmFootnoteDefinition:uU},exit:{gfmFootnoteCallString:dU,gfmFootnoteCall:fU,gfmFootnoteDefinitionLabelString:pU,gfmFootnoteDefinition:hU}}}function yU(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:yj},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,a,l,o){const d=l.createTracker(o);let f=d.move("[^");const p=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?`
635
+ `:" ")+l.indentLines(l.containerFlow(i,d.current()),t?bj:bU))),p(),f}}function bU(e,t,n){return t===0?e:bj(e,t,n)}function bj(e,t,n){return(n?"":" ")+e}const xU=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];xj.peek=SU;function vU(){return{canContainEols:["delete"],enter:{strikethrough:kU},exit:{strikethrough:EU}}}function wU(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:xU}],handlers:{delete:xj}}}function kU(e){this.enter({type:"delete",children:[]},e)}function EU(e){this.exit(e)}function xj(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 NU(e){return e.length}function _U(e,t){const n=t||{},i=(n.align||[]).concat(),a=n.stringLength||NU,l=[],o=[],d=[],f=[];let p=0,g=-1;for(;++g<e.length;){const v=[],S=[];let E=-1;for(e[g].length>p&&(p=e[g].length);++E<e[g].length;){const C=jU(e[g][E]);if(n.alignDelimiters!==!1){const N=a(C);S[E]=N,(f[E]===void 0||N>f[E])&&(f[E]=N)}v.push(C)}o[g]=v,d[g]=S}let m=-1;if(typeof i=="object"&&"length"in i)for(;++m<p;)l[m]=kE(i[m]);else{const v=kE(i);for(;++m<p;)l[m]=v}m=-1;const y=[],b=[];for(;++m<p;){const v=l[m];let S="",E="";v===99?(S=":",E=":"):v===108?S=":":v===114&&(E=":");let C=n.alignDelimiters===!1?1:Math.max(1,f[m]-S.length-E.length);const N=S+"-".repeat(C)+E;n.alignDelimiters!==!1&&(C=S.length+C+E.length,C>f[m]&&(f[m]=C),b[m]=C),y[m]=N}o.splice(1,0,y),d.splice(1,0,b),g=-1;const k=[];for(;++g<o.length;){const v=o[g],S=d[g];m=-1;const E=[];for(;++m<p;){const C=v[m]||"";let N="",_="";if(n.alignDelimiters!==!1){const T=f[m]-(S[m]||0),M=l[m];M===114?N=" ".repeat(T):M===99?T%2?(N=" ".repeat(T/2+.5),_=" ".repeat(T/2-.5)):(N=" ".repeat(T/2),_=N):_=" ".repeat(T)}n.delimiterStart!==!1&&!m&&E.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&C==="")&&(n.delimiterStart!==!1||m)&&E.push(" "),n.alignDelimiters!==!1&&E.push(N),E.push(C),n.alignDelimiters!==!1&&E.push(_),n.padding!==!1&&E.push(" "),(n.delimiterEnd!==!1||m!==p-1)&&E.push("|")}k.push(n.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return k.join(`
636
+ `)}function jU(e){return e==null?"":String(e)}function kE(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 CU(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()),AU);return a(),o}function AU(e,t,n){return">"+(n?"":" ")+e}function TU(e,t){return EE(e,t.inConstruct,!0)&&!EE(e,t.notInConstruct,!1)}function EE(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 SE(e,t,n,i){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
637
+ `&&TU(n.stack,n.unsafe[a]))return/[ \t]/.test(i.before)?"":" ";return`\\
638
+ `}function MU(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 DU(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 OU(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 RU(e,t,n,i){const a=OU(n),l=e.value||"",o=a==="`"?"GraveAccent":"Tilde";if(DU(e,n)){const m=n.enter("codeIndented"),y=n.indentLines(l,LU);return m(),y}const d=n.createTracker(i),f=a.repeat(Math.max(MU(l,a)+1,3)),p=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:`
639
+ `,encode:["`"],...d.current()})),m()}return g+=d.move(`
640
+ `),l&&(g+=d.move(l+`
641
+ `)),g+=d.move(f),p(),g}function LU(e,t,n){return(n?"":" ")+e}function Rx(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 IU(e,t,n,i){const a=Rx(n),l=a==='"'?"Quote":"Apostrophe",o=n.enter("definition");let d=n.enter("label");const f=n.createTracker(i);let p=f.move("[");return p+=f.move(n.safe(n.associationId(e),{before:p,after:"]",...f.current()})),p+=f.move("]: "),d(),!e.url||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),p+=f.move("<"),p+=f.move(n.safe(e.url,{before:p,after:">",...f.current()})),p+=f.move(">")):(d=n.enter("destinationRaw"),p+=f.move(n.safe(e.url,{before:p,after:e.title?" ":`
642
+ `,...f.current()}))),d(),e.title&&(d=n.enter(`title${l}`),p+=f.move(" "+a),p+=f.move(n.safe(e.title,{before:p,after:a,...f.current()})),p+=f.move(a),d()),o(),p}function zU(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 Au(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Np(e,t,n){const i=Fo(e),a=Fo(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}}vj.peek=PU;function vj(e,t,n,i){const a=zU(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 p=f.charCodeAt(0),g=Np(i.before.charCodeAt(i.before.length-1),p,a);g.inside&&(f=Au(p)+f.slice(1));const m=f.charCodeAt(f.length-1),y=Np(i.after.charCodeAt(0),m,a);y.inside&&(f=f.slice(0,-1)+Au(m));const b=o.move(a);return l(),n.attentionEncodeSurroundingInfo={after:y.outside,before:g.outside},d+f+b}function PU(e,t,n){return n.options.emphasis||"*"}function BU(e,t){let n=!1;return uh(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,sb}),!!((!e.depth||e.depth<3)&&Nx(e)&&(t.options.setext||n))}function $U(e,t,n,i){const a=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(i);if(BU(e,n)){const g=n.enter("headingSetext"),m=n.enter("phrasing"),y=n.containerPhrasing(e,{...l.current(),before:`
643
+ `,after:`
644
+ `});return m(),g(),y+`
645
+ `+(a===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
646
+ `))+1))}const o="#".repeat(a),d=n.enter("headingAtx"),f=n.enter("phrasing");l.move(o+" ");let p=n.containerPhrasing(e,{before:"# ",after:`
647
+ `,...l.current()});return/^[\t ]/.test(p)&&(p=Au(p.charCodeAt(0))+p.slice(1)),p=p?o+" "+p:o,n.options.closeAtx&&(p+=" "+o),f(),d(),p}wj.peek=UU;function wj(e){return e.value||""}function UU(){return"<"}kj.peek=FU;function kj(e,t,n,i){const a=Rx(n),l=a==='"'?"Quote":"Apostrophe",o=n.enter("image");let d=n.enter("label");const f=n.createTracker(i);let p=f.move("![");return p+=f.move(n.safe(e.alt,{before:p,after:"]",...f.current()})),p+=f.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),p+=f.move("<"),p+=f.move(n.safe(e.url,{before:p,after:">",...f.current()})),p+=f.move(">")):(d=n.enter("destinationRaw"),p+=f.move(n.safe(e.url,{before:p,after:e.title?" ":")",...f.current()}))),d(),e.title&&(d=n.enter(`title${l}`),p+=f.move(" "+a),p+=f.move(n.safe(e.title,{before:p,after:a,...f.current()})),p+=f.move(a),d()),p+=f.move(")"),o(),p}function FU(){return"!"}Ej.peek=qU;function Ej(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 p=n.safe(e.alt,{before:f,after:"]",...d.current()});f+=d.move(p+"]["),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"||!p||p!==m?f+=d.move(m+"]"):a==="shortcut"?f=f.slice(0,-1):f+=d.move("]"),f}function qU(){return"!"}Sj.peek=HU;function Sj(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 p=f.index;i.charCodeAt(p)===10&&i.charCodeAt(p-1)===13&&p--,i=i.slice(0,p)+" "+i.slice(f.index+1)}}return a+i+a}function HU(){return"`"}function Nj(e,t){const n=Nx(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))}_j.peek=KU;function _j(e,t,n,i){const a=Rx(n),l=a==='"'?"Quote":"Apostrophe",o=n.createTracker(i);let d,f;if(Nj(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 p=o.move("[");return p+=o.move(n.containerPhrasing(e,{before:p,after:"](",...o.current()})),p+=o.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),p+=o.move("<"),p+=o.move(n.safe(e.url,{before:p,after:">",...o.current()})),p+=o.move(">")):(f=n.enter("destinationRaw"),p+=o.move(n.safe(e.url,{before:p,after:e.title?" ":")",...o.current()}))),f(),e.title&&(f=n.enter(`title${l}`),p+=o.move(" "+a),p+=o.move(n.safe(e.title,{before:p,after:a,...o.current()})),p+=o.move(a),f()),p+=o.move(")"),d(),p}function KU(e,t,n){return Nj(e,n)?"<":"["}jj.peek=GU;function jj(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 p=n.containerPhrasing(e,{before:f,after:"]",...d.current()});f+=d.move(p+"]["),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"||!p||p!==m?f+=d.move(m+"]"):a==="shortcut"?f=f.slice(0,-1):f+=d.move("]"),f}function GU(){return"["}function Lx(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 VU(e){const t=Lx(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 YU(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 Cj(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 WU(e,t,n,i){const a=n.enter("list"),l=n.bulletCurrent;let o=e.ordered?YU(n):Lx(n);const d=e.ordered?o==="."?")":".":VU(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),Cj(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 p=n.containerFlow(e,i);return n.bulletLastUsed=o,n.bulletCurrent=l,a(),p}function QU(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 XU(e,t,n,i){const a=QU(n);let l=n.bulletCurrent||Lx(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"),p=n.indentLines(n.containerFlow(e,d.current()),g);return f(),p;function g(m,y,b){return y?(b?"":" ".repeat(o))+m:(b?l:l+" ".repeat(o-l.length))+m}}function ZU(e,t,n,i){const a=n.enter("paragraph"),l=n.enter("phrasing"),o=n.containerPhrasing(e,i);return l(),a(),o}const JU=nd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function e9(e,t,n,i){return(e.children.some(function(o){return JU(o)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function t9(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Aj.peek=n9;function Aj(e,t,n,i){const a=t9(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 p=f.charCodeAt(0),g=Np(i.before.charCodeAt(i.before.length-1),p,a);g.inside&&(f=Au(p)+f.slice(1));const m=f.charCodeAt(f.length-1),y=Np(i.after.charCodeAt(0),m,a);y.inside&&(f=f.slice(0,-1)+Au(m));const b=o.move(a+a);return l(),n.attentionEncodeSurroundingInfo={after:y.outside,before:g.outside},d+f+b}function n9(e,t,n){return n.options.strong||"*"}function i9(e,t,n,i){return n.safe(e.value,i)}function r9(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 a9(e,t,n){const i=(Cj(n)+(n.options.ruleSpaces?" ":"")).repeat(r9(n));return n.options.ruleSpaces?i.slice(0,-1):i}const Tj={blockquote:CU,break:SE,code:RU,definition:IU,emphasis:vj,hardBreak:SE,heading:$U,html:wj,image:kj,imageReference:Ej,inlineCode:Sj,link:_j,linkReference:jj,list:WU,listItem:XU,paragraph:ZU,root:e9,strong:Aj,text:i9,thematicBreak:a9};function s9(){return{enter:{table:l9,tableData:NE,tableHeader:NE,tableRow:c9},exit:{codeText:u9,table:o9,tableData:ay,tableHeader:ay,tableRow:ay}}}function l9(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 o9(e){this.exit(e),this.data.inTable=void 0}function c9(e){this.enter({type:"tableRow",children:[]},e)}function ay(e){this.exit(e)}function NE(e){this.enter({type:"tableCell",children:[]},e)}function u9(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,d9));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function d9(e,t){return t==="|"?t:e}function f9(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,a=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
648
+ `,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,S){return p(g(b,v,S),b.align)}function d(b,k,v,S){const E=m(b,v,S),C=p([E]);return C.slice(0,C.indexOf(`
649
+ `))}function f(b,k,v,S){const E=v.enter("tableCell"),C=v.enter("phrasing"),N=v.containerPhrasing(b,{...S,before:l,after:l});return C(),E(),N}function p(b,k){return _U(b,{align:k,alignDelimiters:i,padding:n,stringLength:a})}function g(b,k,v){const S=b.children;let E=-1;const C=[],N=k.enter("table");for(;++E<S.length;)C[E]=m(S[E],k,v);return N(),C}function m(b,k,v){const S=b.children;let E=-1;const C=[],N=k.enter("tableRow");for(;++E<S.length;)C[E]=f(S[E],b,k,v);return N(),C}function y(b,k,v){let S=Tj.inlineCode(b,k,v);return v.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function p9(){return{exit:{taskListCheckValueChecked:_E,taskListCheckValueUnchecked:_E,paragraph:m9}}}function h9(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:g9}}}function _E(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function m9(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 g9(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=Tj.listItem(e,t,n,{...i,...d.current()});return l&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,p)),f;function p(g){return g+o}}function y9(){return[W$(),gU(),vU(),s9(),p9()]}function b9(e){return{extensions:[Q$(),yU(e),wU(),f9(e),h9()]}}const x9={tokenize:N9,partial:!0},Mj={tokenize:_9,partial:!0},Dj={tokenize:j9,partial:!0},Oj={tokenize:C9,partial:!0},v9={tokenize:A9,partial:!0},Rj={name:"wwwAutolink",tokenize:E9,previous:Ij},Lj={name:"protocolAutolink",tokenize:S9,previous:zj},xa={name:"emailAutolink",tokenize:k9,previous:Pj},Ir={};function w9(){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,Lj];Ir[104]=[xa,Lj];Ir[87]=[xa,Rj];Ir[119]=[xa,Rj];function k9(e,t,n){const i=this;let a,l;return o;function o(m){return!ub(m)||!Pj.call(i,i.previous)||Ix(i.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(m))}function d(m){return ub(m)?(e.consume(m),d):m===64?(e.consume(m),f):n(m)}function f(m){return m===46?e.check(v9,g,p)(m):m===45||m===95||Gn(m)?(l=!0,e.consume(m),f):g(m)}function p(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 E9(e,t,n){const i=this;return a;function a(o){return o!==87&&o!==119||!Ij.call(i,i.previous)||Ix(i.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(x9,e.attempt(Mj,e.attempt(Dj,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)&&zj.call(i,i.previous)&&!Ix(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?p:(l=!0,f)):n(m)}function p(m){return m===null||kp(m)||Kt(m)||ml(m)||sh(m)?n(m):e.attempt(Mj,e.attempt(Dj,g),n)(m)}function g(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function N9(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 _9(e,t,n){let i,a,l;return o;function o(p){return p===46||p===95?e.check(Oj,f,d)(p):p===null||Kt(p)||ml(p)||p!==45&&sh(p)?f(p):(l=!0,e.consume(p),o)}function d(p){return p===95?i=!0:(a=i,i=void 0),e.consume(p),o}function f(p){return a||i||!l?n(p):t(p)}}function j9(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(Oj,t,l)(o):o===null||Kt(o)||ml(o)?t(o):(e.consume(o),a)}function l(o){return o===41&&i++,e.consume(o),a}}function C9(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||Kt(d)||ml(d)?t(d):n(d)}function a(d){return d===null||d===40||d===91||Kt(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 A9(e,t,n){return i;function i(l){return e.consume(l),a}function a(l){return Gn(l)?n(l):t(l)}}function Ij(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Kt(e)}function zj(e){return!ni(e)}function Pj(e){return!(e===47||ub(e))}function ub(e){return e===43||e===45||e===46||e===95||Gn(e)}function Ix(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 T9={tokenize:P9,partial:!0};function M9(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:L9,continuation:{tokenize:I9},exit:z9}},text:{91:{name:"gfmFootnoteCall",tokenize:R9},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:D9,resolveTo:O9}}}}function D9(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 p=fr(i.sliceSerialize({start:o.end,end:i.now()}));return p.codePointAt(0)!==94||!l.includes(p.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function O9(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 R9(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",p)}function p(m){if(l>999||m===93&&!o||m===null||m===91||Kt(m))return n(m);if(m===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return a.includes(fr(i.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return Kt(m)||(o=!0),l++,e.consume(m),m===92?g:p}function g(m){return m===91||m===92||m===93?(e.consume(m),l++,p):p(m)}}function L9(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"),p}function p(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||Kt(k))return n(k);if(k===93){e.exit("chunkString");const v=e.exit("gfmFootnoteDefinitionLabelString");return l=fr(i.sliceSerialize(v)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return Kt(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),St(e,b,"gfmFootnoteDefinitionWhitespace")):n(k)}function b(k){return t(k)}}function I9(e,t,n){return e.check(td,t,e.attempt(T9,t,n))}function z9(e){e.exit("gfmFootnoteDefinition")}function P9(e,t,n){const i=this;return St(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 B9(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 p=f;for(;p--;)if(o[p][0]==="exit"&&o[p][1].type==="strikethroughSequenceTemporary"&&o[p][1]._open&&o[f][1].end.offset-o[f][1].start.offset===o[p][1].end.offset-o[p][1].start.offset){o[f][1].type="strikethroughSequence",o[p][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},o[p][1].start),end:Object.assign({},o[f][1].end)},m={type:"strikethroughText",start:Object.assign({},o[p][1].end),end:Object.assign({},o[f][1].start)},y=[["enter",g,d],["enter",o[p][1],d],["exit",o[p][1],d],["enter",m,d]],b=d.parser.constructs.insideSpan.null;b&&ji(y,y.length,0,lh(b,o.slice(p+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,p-1,f-p+3,y),f=p+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 p=this.previous,g=this.events;let m=0;return y;function y(k){return p===126&&g[g.length-1][1].type!=="characterEscape"?f(k):(o.enter("strikethroughSequenceTemporary"),b(k))}function b(k){const v=Fo(p);if(k===126)return m>1?f(k):(o.consume(k),m++,b);if(m<2&&!n)return f(k);const S=o.exit("strikethroughSequenceTemporary"),E=Fo(k);return S._open=!E||E===2&&!!v,S._close=!v||v===2&&!!E,d(k)}}}class $9{constructor(){this.map=[]}add(t,n,i){U9(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 U9(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 F9(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 q9(){return{flow:{null:{name:"table",tokenize:H9,resolveAll:K9}}}}function H9(e,t,n){const i=this;let a=0,l=0,o;return d;function d(U){let K=i.events.length-1;for(;K>-1;){const D=i.events[K][1].type;if(D==="lineEnding"||D==="linePrefix")K--;else break}const q=K>-1?i.events[K][1].type:null,Y=q==="tableHead"||q==="tableRow"?M:f;return Y===M&&i.parser.lazy[i.now().line]?n(U):Y(U)}function f(U){return e.enter("tableHead"),e.enter("tableRow"),p(U)}function p(U){return U===124||(o=!0,l+=1),g(U)}function g(U){return U===null?n(U):Je(U)?l>1?(l=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),b):n(U):gt(U)?St(e,g,"whitespace")(U):(l+=1,o&&(o=!1,a+=1),U===124?(e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),o=!0,g):(e.enter("data"),m(U)))}function m(U){return U===null||U===124||Kt(U)?(e.exit("data"),g(U)):(e.consume(U),U===92?y:m)}function y(U){return U===92||U===124?(e.consume(U),m):m(U)}function b(U){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(U):(e.enter("tableDelimiterRow"),o=!1,gt(U)?St(e,k,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):k(U))}function k(U){return U===45||U===58?S(U):U===124?(o=!0,e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),v):T(U)}function v(U){return gt(U)?St(e,S,"whitespace")(U):S(U)}function S(U){return U===58?(l+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(U),e.exit("tableDelimiterMarker"),E):U===45?(l+=1,E(U)):U===null||Je(U)?_(U):T(U)}function E(U){return U===45?(e.enter("tableDelimiterFiller"),C(U)):T(U)}function C(U){return U===45?(e.consume(U),C):U===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(U),e.exit("tableDelimiterMarker"),N):(e.exit("tableDelimiterFiller"),N(U))}function N(U){return gt(U)?St(e,_,"whitespace")(U):_(U)}function _(U){return U===124?k(U):U===null||Je(U)?!o||a!==l?T(U):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(U)):T(U)}function T(U){return n(U)}function M(U){return e.enter("tableRow"),O(U)}function O(U){return U===124?(e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),O):U===null||Je(U)?(e.exit("tableRow"),t(U)):gt(U)?St(e,O,"whitespace")(U):(e.enter("data"),R(U))}function R(U){return U===null||U===124||Kt(U)?(e.exit("data"),O(U)):(e.consume(U),U===92?B:R)}function B(U){return U===92||U===124?(e.consume(U),R):R(U)}}function K9(e,t){let n=-1,i=!0,a=0,l=[0,0,0,0],o=[0,0,0,0],d=!1,f=0,p,g,m;const y=new $9;for(;++n<e.length;){const b=e[n],k=b[1];b[0]==="enter"?k.type==="tableHead"?(d=!1,f!==0&&(jE(y,t,f,p,g),g=void 0,f=0),p={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},y.add(n,0,[["enter",p,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=Lf(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=Lf(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=Lf(y,t,l,a,n,m)):o[1]!==0&&(m=Lf(y,t,o,a,n,m)),a=0):a&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(o[3]=n)}for(f!==0&&jE(y,t,f,p,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=F9(t.events,n))}return e}function Lf(e,t,n,i,a,l){const o=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",d="tableContent";n[0]!==0&&(l.end=Object.assign({},po(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const f=po(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 p=po(t.events,n[2]),g=po(t.events,n[3]),m={type:d,start:Object.assign({},p),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({},po(t.events,a)),e.add(a,0,[["exit",l,t]]),l=void 0),l}function jE(e,t,n,i,a){const l=[],o=po(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 po(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const G9={name:"tasklistCheck",tokenize:Y9};function V9(){return{text:{91:G9}}}function Y9(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 Kt(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:W9},t,n)(f):n(f)}}function W9(e,t,n){return St(e,i,"whitespace");function i(a){return a===null?n(a):t(a)}}function Q9(e){return W2([w9(),M9(),B9(e),q9(),V9()])}const X9={};function zx(e){const t=this,n=e||X9,i=t.data(),a=i.micromarkExtensions||(i.micromarkExtensions=[]),l=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),o=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);a.push(Q9(n)),l.push(y9()),o.push(b9(n))}const CE=(function(e,t,n){const i=nd(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 eF;if(typeof e=="string")return J9(e);if(typeof e=="object")return Z9(e);if(typeof e=="function")return Px(e);throw new Error("Expected function, string, or array as `test`")});function Z9(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Sl(e[n]);return Px(i);function i(...a){let l=-1;for(;++l<t.length;)if(t[l].apply(this,a))return!0;return!1}}function J9(e){return Px(t);function t(n){return n.tagName===e}}function Px(e){return t;function t(n,i,a){return!!(tF(n)&&e.call(this,n,typeof i=="number"?i:void 0,a||void 0))}}function eF(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function tF(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const AE=/\n/g,TE=/[\t ]+/g,db=Sl("br"),ME=Sl(cF),nF=Sl("p"),DE=Sl("tr"),iF=Sl(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",oF,uF]),Bj=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 rF(e,t){const n=t||{},i="children"in e?e.children:[],a=Bj(e),l=Fj(e,{whitespace:n.whitespace||"normal"}),o=[];(e.type==="text"||e.type==="comment")&&o.push(...Uj(e,{breakBefore:!0,breakAfter:!0}));let d=-1;for(;++d<i.length;)o.push(...$j(i[d],e,{whitespace:l,breakBefore:d?void 0:a,breakAfter:d<i.length-1?db(i[d+1]):a}));const f=[];let p;for(d=-1;++d<o.length;){const g=o[d];typeof g=="number"?p!==void 0&&g>p&&(p=g):g&&(p!==void 0&&p>-1&&f.push(`
650
+ `.repeat(p)||" "),p=-1,f.push(g))}return f.join("")}function $j(e,t,n){return e.type==="element"?aF(e,t,n):e.type==="text"?n.whitespace==="normal"?Uj(e,n):sF(e):[]}function aF(e,t,n){const i=Fj(e,n),a=e.children||[];let l=-1,o=[];if(iF(e))return o;let d,f;for(db(e)||DE(e)&&CE(t,e,DE)?f=`
651
+ `:nF(e)?(d=2,f=2):Bj(e)&&(d=1,f=1);++l<a.length;)o=o.concat($j(a[l],e,{whitespace:i,breakBefore:l?void 0:d,breakAfter:l<a.length-1?db(a[l+1]):f}));return ME(e)&&CE(t,e,ME)&&o.push(" "),d&&o.unshift(d),f&&o.push(f),o}function Uj(e,t){const n=String(e.value),i=[],a=[];let l=0;for(;l<=n.length;){AE.lastIndex=l;const f=AE.exec(n),p=f&&"index"in f?f.index:n.length;i.push(lF(n.slice(l,p).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),l===0?t.breakBefore:!0,p===n.length?t.breakAfter:!0)),l=p+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 sF(e){return[String(e.value)]}function lF(e,t,n){const i=[];let a=0,l;for(;a<e.length;){TE.lastIndex=a;const o=TE.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 Fj(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 oF(e){return!!(e.properties||{}).hidden}function cF(e){return e.tagName==="td"||e.tagName==="th"}function uF(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function dF(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"},p={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(p,{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"],S=["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:S},T={className:"function.dispatch",relevance:0,keywords:{_hint:E},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},M=[T,m,d,n,e.C_BLOCK_COMMENT_MODE,g,p],O={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:M.concat([{begin:/\(/,end:/\)/,keywords:_,contains:M.concat(["self"]),relevance:0}]),relevance:0},R={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:[p,g]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,p,g,d,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,p,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(O,R,T,M,[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 fF(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=dF(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 pF(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:/\\"/},p={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"],S=["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"],N=["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"],T=["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:S,built_in:[...C,...N,"set","shopt",..._,...T]},contains:[b,e.SHEBANG(),k,m,l,o,E,d,f,p,g,n]}}function hF(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/}]},p={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(p,{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*\\(",S={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},E=[m,d,n,e.C_BLOCK_COMMENT_MODE,g,p],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:S,contains:E.concat([{begin:/\(/,end:/\)/,keywords:S,contains:E.concat(["self"]),relevance:0}]),relevance:0},N={begin:"("+o+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:S,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:S,relevance:0},{begin:b,returnBegin:!0,contains:[e.inherit(y,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,p,g,d,{begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,p,g,d]}]},d,n,e.C_BLOCK_COMMENT_MODE,m]};return{name:"C",aliases:["h"],keywords:S,disableAutodetect:!0,illegal:"</",contains:[].concat(C,N,E,[m,{begin:e.IDENT_RE+"::",keywords:S},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:m,strings:p,keywords:S}}}function mF(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"},p={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(p,{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"],S=["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:S},T={className:"function.dispatch",relevance:0,keywords:{_hint:E},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},M=[T,m,d,n,e.C_BLOCK_COMMENT_MODE,g,p],O={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:M.concat([{begin:/\(/,end:/\)/,keywords:_,contains:M.concat(["self"]),relevance:0}]),relevance:0},R={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:[p,g]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,p,g,d,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,p,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(O,R,T,M,[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 gF(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},p={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]},S=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=[S,k,m,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const E={variants:[p,v,k,g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},C={begin:"<",end:">",contains:[{beginKeywords:"in out"},d]},N=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:"("+N+"\\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 yF=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_-]*/}}),bF=["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"],xF=["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"],vF=[...bF,...xF],wF=["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(),kF=["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(),EF=["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 NF(e){const t=e.regex,n=yF(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:":("+kF.join("|")+")"},{begin:":(:)?("+EF.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:wF.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...d,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+vF.join("|")+")\\b"}]}}function _F(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 jF(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 CF(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 AF(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_-]+/,p=/"(\\"|[^"])*"/,g=/'[^']*'/,m=t.either(f,p,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 ho="[0-9](_*[0-9])*",If=`\\.(${ho})`,zf="[0-9a-fA-F](_*[0-9a-fA-F])*",OE={className:"number",variants:[{begin:`(\\b(${ho})((${If})|\\.)?|(${If}))[eE][+-]?(${ho})[fFdD]?\\b`},{begin:`\\b(${ho})((${If})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${If})[fFdD]?\\b`},{begin:`\\b(${ho})[fFdD]\\b`},{begin:`\\b0[xX]((${zf})\\.?|(${zf})?\\.(${zf}))[pP][+-]?(${ho})[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 qj(e,t,n){return n===-1?"":e.replace(t,i=>qj(e,t,n-1))}function TF(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+qj("(?:<"+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"]},p={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:[p,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,OE,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},OE,p]}}const RE="[A-Za-z$_][0-9A-Za-z$_]*",MF=["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"],DF=["true","false","null","undefined","NaN","Infinity"],Hj=["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"],Kj=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Gj=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],OF=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],RF=[].concat(Gj,Hj,Kj);function LF(e){const t=e.regex,n=(W,{after:G})=>{const L="</"+W[0].slice(1);return W.input.indexOf(L,G)!==-1},i=RE,a={begin:"<>",end:"</>"},l=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(W,G)=>{const L=W[0].length+W.index,z=W.input[L];if(z==="<"||z===","){G.ignoreMatch();return}z===">"&&(n(W,{after:L})||G.ignoreMatch());let V;const P=W.input.substring(L);if(V=P.match(/^\s*=/)){G.ignoreMatch();return}if((V=P.match(/^\s+extends\s+/))&&V.index===0){G.ignoreMatch();return}}},d={$pattern:RE,keyword:MF,literal:DF,built_in:RF,"variable.language":OF},f="[0-9](_?[0-9])*",p=`\\.(${f})`,g="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",m={className:"number",variants:[{begin:`(\\b(${g})((${p})|\\.)?|(${p}))[eE][+-]?(${f})\\b`},{begin:`\\b(${g})\\b((${p})\\b|\\.)?|(${p})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},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"}},S={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]},N=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,k,v,S,{match:/\$\d+/},m];y.contains=N.concat({begin:/\{/,end:/\}/,keywords:d,contains:["self"].concat(N)});const _=[].concat(C,y.contains),T=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:d,contains:["self"].concat(_)}]),M={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:T},O={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"}}]},R={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:{_:[...Hj,...Kj]}},B={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},U={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[M],illegal:/%/},K={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function q(W){return t.concat("(?!",W.join("|"),")")}const Y={match:t.concat(/\b/,q([...Gj,"super","import"].map(W=>`${W}\\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},F={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},M]},I="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",H={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(I)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[M]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:d,exports:{PARAMS_CONTAINS:T,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),B,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,k,v,S,C,{match:/\$\d+/},m,R,{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:I,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:T}]}]},{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"]}]}]},U,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[M,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:[M]},Y,K,O,F,{match:/\$[(.]/}]}}function IF(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])*",Pf=`\\.(${mo})`,Bf="[0-9a-fA-F](_*[0-9a-fA-F])*",zF={className:"number",variants:[{begin:`(\\b(${mo})((${Pf})|\\.)?|(${Pf}))[eE][+-]?(${mo})[fFdD]?\\b`},{begin:`\\b(${mo})((${Pf})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Pf})[fFdD]?\\b`},{begin:`\\b(${mo})[fFdD]\\b`},{begin:`\\b0[xX]((${Bf})\\.?|(${Bf})?\\.(${Bf}))[pP][+-]?(${mo})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Bf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function PF(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"]}]},p=zF,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:`
652
+ `},p]}}const BF=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_-]*/}}),$F=["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"],UF=["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"],FF=[...$F,...UF],qF=["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(),Vj=["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(),Yj=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),HF=["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(),KF=Vj.concat(Yj).sort().reverse();function GF(e){const t=BF(e),n=KF,i="and or not only",a="[\\w-]+",l="("+a+"|@\\{"+a+"\\})",o=[],d=[],f=function(N){return{className:"string",begin:"~?"+N+".*?"+N}},p=function(N,_,T){return{className:N,begin:_,relevance:T}},g={$pattern:/[a-z-]+/,keyword:i,attribute:qF.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,p("variable","@@?"+a,10),p("variable","@\\{"+a+"\\}"),p("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("+HF.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}},S={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,p("keyword","all\\b"),p("variable","@\\{"+a+"\\}"),{begin:"\\b("+FF.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,p("selector-tag",l,0),p("selector-id","#"+l),p("selector-class","\\."+l,0),p("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+Vj.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Yj.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,S,C,k,E,b,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}function VF(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 YF(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 WF(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}]},p={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(p,{contains:[]}),y=e.inherit(g,{contains:[]});p.contains.push(y),g.contains.push(m);let b=[n,f];return[p,g,m,y].forEach(E=>{E.contains=E.contains.concat(b)}),b=b.concat(p,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,p,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 QF(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 XF(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]},p={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},g=[e.BACKSLASH_ESCAPE,l,f],m=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],y=(v,S,E="\\1")=>{const C=E==="\\1"?E:t.concat(E,S);return t.concat(t.concat("(?:",v,")"),S,/(?:\\.|[^\\\/])*?/,C,/(?:\\.|[^\\\/])*?/,E,i)},b=(v,S,E)=>t.concat(t.concat("(?:",v,")"),S,/(?:\\.|[^\\\/])*?/,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}]},p,{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,p]},{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 ZF(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:/\}/}]},p=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,F)=>{F.data._beginMatch=D[1]||D[2]},"on:end":(D,F)=>{F.data._beginMatch!==D[1]&&F.ignoreMatch()}},y=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),b=`[
653
+ ]`,k={scope:"string",variants:[g,p,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},S=["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 F=[];return D.forEach(I=>{F.push(I),I.toLowerCase()===I?F.push(I.toUpperCase()):F.push(I.toLowerCase())}),F})(S),built_in:C},T=D=>D.map(F=>F.replace(/\|\d+$/,"")),M={variants:[{match:[/new/,t.concat(b,"+"),t.concat("(?!",T(C).join("\\b|"),"\\b)"),a],scope:{1:"keyword",4:"title.class"}}]},O=t.concat(i,"\\b(?!\\()"),R={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),O],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[a,t.concat(/::/,t.lookahead(/(?!class\b)/)),O],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"}}]},B={scope:"attr",match:t.concat(i,t.lookahead(":"),t.lookahead(/(?!::)/))},U={relevance:0,begin:/\(/,end:/\)/,keywords:_,contains:[B,o,R,e.C_BLOCK_COMMENT_MODE,k,v,M]},K={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",T(E).join("\\b|"),"|",T(C).join("\\b|"),"\\b)"),i,t.concat(b,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[U]};U.contains.push(K);const q=[B,R,e.C_BLOCK_COMMENT_MODE,k,v,M],Y={begin:t.concat(/#\[\s*\\?/,t.either(a,l)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:S,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:S,keyword:["new","array"]},contains:["self",...q]},...q,{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,K,R,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},M,{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,R,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 JF(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 e8(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function t8(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:/^(>>>|\.\.\.) /},p={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,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,f,g,p]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,g,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,g,p]},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})`}]},S={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 p.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,S,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 n8(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function i8(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 r8(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:">"},p=[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}]},M=[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,p),relevance:0}].concat(f,p);g.contains=M,v.contains=M;const U=[{begin:/^\s*=>/,starts:{end:"$",contains:M}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:M}}];return p.unshift(f),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(U).concat(p).concat(M)}}function a8(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"],p=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],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:p},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:p,type:g}},{className:"punctuation",begin:"->"},l]}}const s8=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_-]*/}}),l8=["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"],o8=["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"],c8=[...l8,...o8],u8=["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(),d8=["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(),f8=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),p8=["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 h8(e){const t=s8(e),n=f8,i=d8,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("+c8.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("+p8.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:u8.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 m8(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function g8(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"],p=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],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=[...p,...f].filter(T=>!g.includes(T)),v={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},S={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},E={match:t.concat(/\b/,t.either(...b),/\s*\(/),relevance:0,keywords:{built_in:b}};function C(T){return t.concat(/\b/,t.either(...T.map(M=>M.replace(/\s+/,"\\s+"))),/\b/)}const N={scope:"keyword",match:C(y),relevance:0};function _(T,{exceptions:M,when:O}={}){const R=O;return M=M||[],T.map(B=>B.match(/\|\d+$/)||M.includes(B)?B:R(B)?`${B}|0`:B)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:_(k,{when:T=>T.length<3}),literal:l,type:d,built_in:m},contains:[{scope:"type",match:C(o)},N,E,v,i,a,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,S]}}function Wj(e){return e?typeof e=="string"?e:e.source:null}function su(e){return Ut("(?=",e,")")}function Ut(...e){return e.map(n=>Wj(n)).join("")}function y8(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"("+(y8(e).capture?"":"?:")+e.map(i=>Wj(i)).join("|")+")"}const Bx=e=>Ut(/\b/,e,/\w$/.test(e)?/\b/:/\B/),b8=["Protocol","Type"].map(Bx),LE=["init","self"].map(Bx),x8=["Any","Self"],sy=["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"],IE=["false","nil","true"],v8=["assignment","associativity","higherThan","left","lowerThan","none","right"],w8=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],zE=["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"],Qj=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]/),Xj=Jn(Qj,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),ly=Ut(Qj,Xj,"*"),Zj=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]/),_p=Jn(Zj,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),_r=Ut(Zj,_p,"*"),$f=Ut(/[A-Z]/,_p,"*"),k8=["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\(/,_r,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],E8=["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(...b8,...LE)],className:{2:"keyword"}},l={match:Ut(/\./,Jn(...sy)),relevance:0},o=sy.filter(_e=>typeof _e=="string").concat(["_|0"]),d=sy.filter(_e=>typeof _e!="string").concat(x8).map(Bx),f={variants:[{className:"keyword",match:Jn(...d,...LE)}]},p={$pattern:Jn(/\b\w+/,/#\w+/),keyword:o.concat(w8),literal:IE},g=[a,l,f],m={match:Ut(/\./,Jn(...zE)),relevance:0},y={className:"built_in",match:Ut(/\b/,Jn(...zE),/(?=\()/)},b=[m,y],k={match:/->/,relevance:0},v={className:"operator",relevance:0,variants:[{match:ly},{match:`\\.(\\.|${Xj})+`}]},S=[k,v],E="([0-9]_*)+",C="([0-9a-fA-F]_*)+",N={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/}]},_=(_e="")=>({className:"subst",variants:[{match:Ut(/\\/,_e,/[0\\tnr"']/)},{match:Ut(/\\/,_e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),T=(_e="")=>({className:"subst",match:Ut(/\\/,_e,/[\t ]*(?:[\r\n]|\r\n)/)}),M=(_e="")=>({className:"subst",label:"interpol",begin:Ut(/\\/,_e,/\(/),end:/\)/}),O=(_e="")=>({begin:Ut(_e,/"""/),end:Ut(/"""/,_e),contains:[_(_e),T(_e),M(_e)]}),R=(_e="")=>({begin:Ut(_e,/"/),end:Ut(/"/,_e),contains:[_(_e),M(_e)]}),B={className:"string",variants:[O(),O("#"),O("##"),O("###"),R(),R("#"),R("##"),R("###")]},U=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],K={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:U},q=_e=>{const Qe=Ut(_e,/\//),Ue=Ut(/\//,_e);return{begin:Qe,end:Ue,contains:[...U,{scope:"comment",begin:`#(?!.*${Ue})`,end:/$/}]}},Y={scope:"regexp",variants:[q("###"),q("##"),q("#"),K]},D={match:Ut(/`/,_r,/`/)},F={className:"variable",match:/\$\d+/},I={className:"variable",match:`\\$${_p}+`},H=[D,F,I],W={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:E8,contains:[...S,N,B]}]}},G={scope:"keyword",match:Ut(/@/,Jn(...k8),su(Jn(/\(/,/\s+/)))},L={scope:"meta",match:Ut(/@/,_r)},z=[W,G,L],V={match:su(/\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)/,_p,"+")},{className:"type",match:$f,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Ut(/\s+&\s+/,su($f)),relevance:0}]},P={begin:/</,end:/>/,keywords:p,contains:[...i,...g,...z,k,V]};V.contains.push(P);const le={match:Ut(_r,/\s*:/),keywords:"_|0",relevance:0},xe={begin:/\(/,end:/\)/,relevance:0,keywords:p,contains:["self",le,...i,Y,...g,...b,...S,N,B,...H,...z,V]},ke={begin:/</,end:/>/,keywords:"repeat each",contains:[...i,V]},Ne={begin:Jn(su(Ut(_r,/\s*:/)),su(Ut(_r,/\s+/,_r,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:_r}]},se={begin:/\(/,end:/\)/,keywords:p,contains:[Ne,...i,...g,...S,N,B,...z,V,xe],endsParent:!0,illegal:/["']/},ve={match:[/(func|macro)/,/\s+/,Jn(D.match,_r,ly)],className:{1:"keyword",3:"title.function"},contains:[ke,se,t],illegal:[/\[/,/%/]},ue={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ke,se,t],illegal:/\[|%/},J={match:[/operator/,/\s+/,ly],className:{1:"keyword",3:"title"}},we={begin:[/precedencegroup/,/\s+/,$f],className:{1:"keyword",3:"title"},contains:[V],keywords:[...v8,...IE],end:/}/},re={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"}},Me={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,_r,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:p,contains:[ke,...g,{begin:/:/,end:/\{/,keywords:p,contains:[{scope:"title.class.inherited",match:$f},...g],relevance:0}]};for(const _e of B.variants){const Qe=_e.contains.find(ce=>ce.label==="interpol");Qe.keywords=p;const Ue=[...g,...b,...S,N,B,...H];Qe.contains=[...Ue,{begin:/\(/,end:/\)/,contains:["self",...Ue]}]}return{name:"Swift",keywords:p,contains:[...i,ve,ue,re,Ce,Me,J,we,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},Y,...g,...b,...S,N,B,...H,...z,V,xe]}}const jp="[A-Za-z$_][0-9A-Za-z$_]*",Jj=["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"],eC=["true","false","null","undefined","NaN","Infinity"],tC=["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"],nC=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],iC=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],rC=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],aC=[].concat(iC,tC,nC);function N8(e){const t=e.regex,n=(W,{after:G})=>{const L="</"+W[0].slice(1);return W.input.indexOf(L,G)!==-1},i=jp,a={begin:"<>",end:"</>"},l=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(W,G)=>{const L=W[0].length+W.index,z=W.input[L];if(z==="<"||z===","){G.ignoreMatch();return}z===">"&&(n(W,{after:L})||G.ignoreMatch());let V;const P=W.input.substring(L);if(V=P.match(/^\s*=/)){G.ignoreMatch();return}if((V=P.match(/^\s+extends\s+/))&&V.index===0){G.ignoreMatch();return}}},d={$pattern:jp,keyword:Jj,literal:eC,built_in:aC,"variable.language":rC},f="[0-9](_?[0-9])*",p=`\\.(${f})`,g="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",m={className:"number",variants:[{begin:`(\\b(${g})((${p})|\\.)?|(${p}))[eE][+-]?(${f})\\b`},{begin:`\\b(${g})\\b((${p})\\b|\\.)?|(${p})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},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"}},S={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]},N=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,k,v,S,{match:/\$\d+/},m];y.contains=N.concat({begin:/\{/,end:/\}/,keywords:d,contains:["self"].concat(N)});const _=[].concat(C,y.contains),T=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:d,contains:["self"].concat(_)}]),M={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:T},O={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"}}]},R={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:{_:[...tC,...nC]}},B={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},U={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[M],illegal:/%/},K={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function q(W){return t.concat("(?!",W.join("|"),")")}const Y={match:t.concat(/\b/,q([...iC,"super","import"].map(W=>`${W}\\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},F={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},M]},I="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",H={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(I)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[M]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:d,exports:{PARAMS_CONTAINS:T,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),B,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,k,v,S,C,{match:/\$\d+/},m,R,{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:I,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:T}]}]},{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"]}]}]},U,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[M,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:[M]},Y,K,O,F,{match:/\$[(.]/}]}}function _8(e){const t=e.regex,n=N8(e),i=jp,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"],p={$pattern:jp,keyword:Jj.concat(f),literal:eC,built_in:aC.concat(a),"variable.language":rC},g={className:"meta",begin:"@"+i},m=(v,S,E)=>{const C=v.contains.findIndex(N=>N.label===S);if(C===-1)throw new Error("can not find mode to replace");v.contains.splice(C,1,E)};Object.assign(n.keywords,p),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 j8(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),/ *#/)}]},p={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},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,p,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 C8(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"},p={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:i},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},l,o,a,e.QUOTE_STRING_MODE,f,p,d]}}function A8(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"}),p={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:i,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[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:[p],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[p],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:p}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function T8(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},S=[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=[...S];return E.pop(),E.push(d),b.contains=E,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:S}}const M8={arduino:fF,bash:pF,c:hF,cpp:mF,csharp:gF,css:NF,diff:_F,go:jF,graphql:CF,ini:AF,java:TF,javascript:LF,json:IF,kotlin:PF,less:GF,lua:VF,makefile:YF,markdown:WF,objectivec:QF,perl:XF,php:ZF,"php-template":JF,plaintext:e8,python:t8,"python-repl":n8,r:i8,ruby:r8,rust:a8,scss:h8,shell:m8,sql:g8,swift:S8,typescript:_8,vbnet:j8,wasm:C8,xml:A8,yaml:T8};var oy,PE;function D8(){if(PE)return oy;PE=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(me=>{const Oe=Z[me],it=typeof Oe;(it==="object"||it==="function")&&!Object.isFrozen(Oe)&&e(Oe)}),Z}class t{constructor(me){me.data===void 0&&(me.data={}),this.data=me.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,...me){const Oe=Object.create(null);for(const it in Z)Oe[it]=Z[it];return me.forEach(function(it){for(const qt in it)Oe[qt]=it[qt]}),Oe}const a="</span>",l=Z=>!!Z.scope,o=(Z,{prefix:me})=>{if(Z.startsWith("language:"))return Z.replace("language:","language-");if(Z.includes(".")){const Oe=Z.split(".");return[`${me}${Oe.shift()}`,...Oe.map((it,qt)=>`${it}${"_".repeat(qt+1)}`)].join(" ")}return`${me}${Z}`};class d{constructor(me,Oe){this.buffer="",this.classPrefix=Oe.classPrefix,me.walk(this)}addText(me){this.buffer+=n(me)}openNode(me){if(!l(me))return;const Oe=o(me.scope,{prefix:this.classPrefix});this.span(Oe)}closeNode(me){l(me)&&(this.buffer+=a)}value(){return this.buffer}span(me){this.buffer+=`<span class="${me}">`}}const f=(Z={})=>{const me={children:[]};return Object.assign(me,Z),me};class p{constructor(){this.rootNode=f(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(me){this.top.children.push(me)}openNode(me){const Oe=f({scope:me});this.add(Oe),this.stack.push(Oe)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(me){return this.constructor._walk(me,this.rootNode)}static _walk(me,Oe){return typeof Oe=="string"?me.addText(Oe):Oe.children&&(me.openNode(Oe),Oe.children.forEach(it=>this._walk(me,it)),me.closeNode(Oe)),me}static _collapse(me){typeof me!="string"&&me.children&&(me.children.every(Oe=>typeof Oe=="string")?me.children=[me.children.join("")]:me.children.forEach(Oe=>{p._collapse(Oe)}))}}class g extends p{constructor(me){super(),this.options=me}addText(me){me!==""&&this.add(me)}startScope(me){this.openNode(me)}endScope(){this.closeNode()}__addSublanguage(me,Oe){const it=me.root;Oe&&(it.scope=`language:${Oe}`),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(Oe=>m(Oe)).join("")}function S(Z){const me=Z[Z.length-1];return typeof me=="object"&&me.constructor===Object?(Z.splice(Z.length-1,1),me):{}}function E(...Z){return"("+(S(Z).capture?"":"?:")+Z.map(it=>m(it)).join("|")+")"}function C(Z){return new RegExp(Z.toString()+"|").exec("").length-1}function N(Z,me){const Oe=Z&&Z.exec(me);return Oe&&Oe.index===0}const _=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function T(Z,{joinWith:me}){let Oe=0;return Z.map(it=>{Oe+=1;const qt=Oe;let Ot=m(it),$e="";for(;Ot.length>0;){const ze=_.exec(Ot);if(!ze){$e+=Ot;break}$e+=Ot.substring(0,ze.index),Ot=Ot.substring(ze.index+ze[0].length),ze[0][0]==="\\"&&ze[1]?$e+="\\"+String(Number(ze[1])+qt):($e+=ze[0],ze[0]==="("&&Oe++)}return $e}).map(it=>`(${it})`).join(me)}const M=/\b\B/,O="[a-zA-Z]\\w*",R="[a-zA-Z_]\\w*",B="\\b\\d+(\\.\\d+)?",U="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",K="\\b(0b[01]+)",q="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Y=(Z={})=>{const me=/^#![ ]*\//;return Z.binary&&(Z.begin=v(me,/.*\b/,Z.binary,/\b.*/)),i({scope:"meta",begin:me,end:/$/,relevance:0,"on:begin":(Oe,it)=>{Oe.index!==0&&it.ignoreMatch()}},Z)},D={begin:"\\\\[\\s\\S]",relevance:0},F={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[D]},I={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/},W=function(Z,me,Oe={}){const it=i({scope:"comment",begin:Z,end:me,contains:[]},Oe);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 qt=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(/[ ]+/,"(",qt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),it},G=W("//","$"),L=W("/\\*","\\*/"),z=W("#","$"),V={scope:"number",begin:B,relevance:0},P={scope:"number",begin:U,relevance:0},le={scope:"number",begin:K,relevance:0},xe={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[D,{begin:/\[/,end:/\]/,relevance:0,contains:[D]}]},ke={scope:"title",begin:O,relevance:0},Ne={scope:"title",begin:R,relevance:0},se={begin:"\\.\\s*"+R,relevance:0};var ue=Object.freeze({__proto__:null,APOS_STRING_MODE:F,BACKSLASH_ESCAPE:D,BINARY_NUMBER_MODE:le,BINARY_NUMBER_RE:K,COMMENT:W,C_BLOCK_COMMENT_MODE:L,C_LINE_COMMENT_MODE:G,C_NUMBER_MODE:P,C_NUMBER_RE:U,END_SAME_AS_BEGIN:function(Z){return Object.assign(Z,{"on:begin":(me,Oe)=>{Oe.data._beginMatch=me[1]},"on:end":(me,Oe)=>{Oe.data._beginMatch!==me[1]&&Oe.ignoreMatch()}})},HASH_COMMENT_MODE:z,IDENT_RE:O,MATCH_NOTHING_RE:M,METHOD_GUARD:se,NUMBER_MODE:V,NUMBER_RE:B,PHRASAL_WORDS_MODE:H,QUOTE_STRING_MODE:I,REGEXP_MODE:xe,RE_STARTERS_RE:q,SHEBANG:Y,TITLE_MODE:ke,UNDERSCORE_IDENT_RE:R,UNDERSCORE_TITLE_MODE:Ne});function J(Z,me){Z.input[Z.index-1]==="."&&me.ignoreMatch()}function we(Z,me){Z.className!==void 0&&(Z.scope=Z.className,delete Z.className)}function re(Z,me){me&&Z.beginKeywords&&(Z.begin="\\b("+Z.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",Z.__beforeBegin=J,Z.keywords=Z.keywords||Z.beginKeywords,delete Z.beginKeywords,Z.relevance===void 0&&(Z.relevance=0))}function Ce(Z,me){Array.isArray(Z.illegal)&&(Z.illegal=E(...Z.illegal))}function Me(Z,me){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 _e(Z,me){Z.relevance===void 0&&(Z.relevance=1)}const Qe=(Z,me)=>{if(!Z.beforeMatch)return;if(Z.starts)throw new Error("beforeMatch cannot be used with starts");const Oe=Object.assign({},Z);Object.keys(Z).forEach(it=>{delete Z[it]}),Z.keywords=Oe.keywords,Z.begin=v(Oe.beforeMatch,y(Oe.begin)),Z.starts={relevance:0,contains:[Object.assign(Oe,{endsParent:!0})]},Z.relevance=0,delete Oe.beforeMatch},Ue=["of","and","for","in","not","or","if","then","parent","list","value"],ce="keyword";function be(Z,me,Oe=ce){const it=Object.create(null);return typeof Z=="string"?qt(Oe,Z.split(" ")):Array.isArray(Z)?qt(Oe,Z):Object.keys(Z).forEach(function(Ot){Object.assign(it,be(Z[Ot],me,Ot))}),it;function qt(Ot,$e){me&&($e=$e.map(ze=>ze.toLowerCase())),$e.forEach(function(ze){const et=ze.split("|");it[et[0]]=[Ot,ge(et[0],et[1])]})}}function ge(Z,me){return me?Number(me):pe(Z)?0:1}function pe(Z){return Ue.includes(Z.toLowerCase())}const Se={},je=Z=>{console.error(Z)},He=(Z,...me)=>{console.log(`WARN: ${Z}`,...me)},te=(Z,me)=>{Se[`${Z}/${me}`]||(console.log(`Deprecated as of ${Z}. ${me}`),Se[`${Z}/${me}`]=!0)},de=new Error;function Le(Z,me,{key:Oe}){let it=0;const qt=Z[Oe],Ot={},$e={};for(let ze=1;ze<=me.length;ze++)$e[ze+it]=qt[ze],Ot[ze+it]=!0,it+=C(me[ze-1]);Z[Oe]=$e,Z[Oe]._emit=Ot,Z[Oe]._multi=!0}function Ze(Z){if(Array.isArray(Z.begin)){if(Z.skip||Z.excludeBegin||Z.returnBegin)throw je("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),de;if(typeof Z.beginScope!="object"||Z.beginScope===null)throw je("beginScope must be object"),de;Le(Z,Z.begin,{key:"beginScope"}),Z.begin=T(Z.begin,{joinWith:""})}}function rt(Z){if(Array.isArray(Z.end)){if(Z.skip||Z.excludeEnd||Z.returnEnd)throw je("skip, excludeEnd, returnEnd not compatible with endScope: {}"),de;if(typeof Z.endScope!="object"||Z.endScope===null)throw je("endScope must be object"),de;Le(Z,Z.end,{key:"endScope"}),Z.end=T(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 me($e,ze){return new RegExp(m($e),"m"+(Z.case_insensitive?"i":"")+(Z.unicodeRegex?"u":"")+(ze?"g":""))}class Oe{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(ze,et){et.position=this.position++,this.matchIndexes[this.matchAt]=et,this.regexes.push([et,ze]),this.matchAt+=C(ze)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const ze=this.regexes.map(et=>et[1]);this.matcherRe=me(T(ze,{joinWith:"|"}),!0),this.lastIndex=0}exec(ze){this.matcherRe.lastIndex=this.lastIndex;const et=this.matcherRe.exec(ze);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(ze){if(this.multiRegexes[ze])return this.multiRegexes[ze];const et=new Oe;return this.rules.slice(ze).forEach(([rn,Vt])=>et.addRule(rn,Vt)),et.compile(),this.multiRegexes[ze]=et,et}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(ze,et){this.rules.push([ze,et]),et.type==="begin"&&this.count++}exec(ze){const et=this.getMatcher(this.regexIndex);et.lastIndex=this.lastIndex;let rn=et.exec(ze);if(this.resumingScanAtSamePosition()&&!(rn&&rn.index===this.lastIndex)){const Vt=this.getMatcher(0);Vt.lastIndex=this.lastIndex+1,rn=Vt.exec(ze)}return rn&&(this.regexIndex+=rn.position+1,this.regexIndex===this.count&&this.considerAll()),rn}}function qt($e){const ze=new it;return $e.contains.forEach(et=>ze.addRule(et.begin,{rule:et,type:"begin"})),$e.terminatorEnd&&ze.addRule($e.terminatorEnd,{type:"end"}),$e.illegal&&ze.addRule($e.illegal,{type:"illegal"}),ze}function Ot($e,ze){const et=$e;if($e.isCompiled)return et;[we,Me,$n,Qe].forEach(Vt=>Vt($e,ze)),Z.compilerExtensions.forEach(Vt=>Vt($e,ze)),$e.__beforeBegin=null,[re,Ce,_e].forEach(Vt=>Vt($e,ze)),$e.isCompiled=!0;let rn=null;return typeof $e.keywords=="object"&&$e.keywords.$pattern&&($e.keywords=Object.assign({},$e.keywords),rn=$e.keywords.$pattern,delete $e.keywords.$pattern),rn=rn||/\w+/,$e.keywords&&($e.keywords=be($e.keywords,Z.case_insensitive)),et.keywordPatternRe=me(rn,!0),ze&&($e.begin||($e.begin=/\B|\b/),et.beginRe=me(et.begin),!$e.end&&!$e.endsWithParent&&($e.end=/\B|\b/),$e.end&&(et.endRe=me(et.end)),et.terminatorEnd=m(et.end)||"",$e.endsWithParent&&ze.terminatorEnd&&(et.terminatorEnd+=($e.end?"|":"")+ze.terminatorEnd)),$e.illegal&&(et.illegalRe=me($e.illegal)),$e.contains||($e.contains=[]),$e.contains=[].concat(...$e.contains.map(function(Vt){return Wt(Vt==="self"?$e:Vt)})),$e.contains.forEach(function(Vt){Ot(Vt,et)}),$e.starts&&Ot($e.starts,ze),et.matcher=qt(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 Wt(Z){return Z.variants&&!Z.cachedVariants&&(Z.cachedVariants=Z.variants.map(function(me){return i(Z,{variants:null},me)})),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(me,Oe){super(me),this.name="HTMLInjectionError",this.html=Oe}}const Rn=n,Nl=i,Pr=Symbol("nomatch"),wa=7,Br=function(Z){const me=Object.create(null),Oe=Object.create(null),it=[];let qt=!0;const Ot="Could not find the language '{}', did you forget to load/include a language module?",$e={disableAutodetect:!0,name:"Plain text",contains:[]};let ze={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(Ae){return ze.noHighlightRe.test(Ae)}function rn(Ae){let Ge=Ae.className+" ";Ge+=Ae.parentNode?Ae.parentNode.className:"";const pt=ze.languageDetectRe.exec(Ge);if(pt){const _t=Ln(pt[1]);return _t||(He(Ot.replace("{}",pt[1])),He("Falling back to no-highlight mode for this block.",Ae)),_t?pt[1]:"no-highlight"}return Ge.split(/\s+/).find(_t=>et(_t)||Ln(_t))}function Vt(Ae,Ge,pt){let _t="",sn="";typeof Ge=="object"?(_t=Ae,pt=Ge.ignoreIllegals,sn=Ge.language):(te("10.7.0","highlight(lang, code, ...args) has been deprecated."),te("10.7.0",`Please use highlight(code, options) instead.
654
+ https://github.com/highlightjs/highlight.js/issues/2277`),sn=Ae,_t=Ge),pt===void 0&&(pt=!0);const Mn={code:_t,language:sn};Ur("before:highlight",Mn);const Wn=Mn.result?Mn.result:Qi(Mn.language,Mn.code,pt);return Wn.code=Mn.code,Ur("after:highlight",Wn),Wn}function Qi(Ae,Ge,pt,_t){const sn=Object.create(null);function Mn(De,Fe){return De.keywords[Fe]}function Wn(){if(!nt.keywords){xn.addText(Rt);return}let De=0;nt.keywordPatternRe.lastIndex=0;let Fe=nt.keywordPatternRe.exec(Rt),lt="";for(;Fe;){lt+=Rt.substring(De,Fe.index);const bt=jn.case_insensitive?Fe[0].toLowerCase():Fe[0],ln=Mn(nt,bt);if(ln){const[Di,uc]=ln;if(xn.addText(lt),lt="",sn[bt]=(sn[bt]||0)+1,sn[bt]<=wa&&(Aa+=uc),Di.startsWith("_"))lt+=Fe[0];else{const dd=jn.classNameAliases[Di]||Di;Qn(Fe[0],dd)}}else lt+=Fe[0];De=nt.keywordPatternRe.lastIndex,Fe=nt.keywordPatternRe.exec(Rt)}lt+=Rt.substring(De),xn.addText(lt)}function Fn(){if(Rt==="")return;let De=null;if(typeof nt.subLanguage=="string"){if(!me[nt.subLanguage]){xn.addText(Rt);return}De=Qi(nt.subLanguage,Rt,!0,ud[nt.subLanguage]),ud[nt.subLanguage]=De._top}else De=Ea(Rt,nt.subLanguage.length?nt.subLanguage:null);nt.relevance>0&&(Aa+=De.relevance),xn.__addSublanguage(De._emitter,De.language)}function zt(){nt.subLanguage!=null?Fn():Wn(),Rt=""}function Qn(De,Fe){De!==""&&(xn.startScope(Fe),xn.addText(De),xn.endScope())}function Cl(De,Fe){let lt=1;const bt=Fe.length-1;for(;lt<=bt;){if(!De._emit[lt]){lt++;continue}const ln=jn.classNameAliases[De[lt]]||De[lt],Di=Fe[lt];ln?Qn(Di,ln):(Rt=Di,Wn(),Rt=""),lt++}}function _a(De,Fe){return De.scope&&typeof De.scope=="string"&&xn.openNode(jn.classNameAliases[De.scope]||De.scope),De.beginScope&&(De.beginScope._wrap?(Qn(Rt,jn.classNameAliases[De.beginScope._wrap]||De.beginScope._wrap),Rt=""):De.beginScope._multi&&(Cl(De.beginScope,Fe),Rt="")),nt=Object.create(De,{parent:{value:nt}}),nt}function vr(De,Fe,lt){let bt=N(De.endRe,lt);if(bt){if(De["on:end"]){const ln=new t(De);De["on:end"](Fe,ln),ln.isMatchIgnored&&(bt=!1)}if(bt){for(;De.endsParent&&De.parent;)De=De.parent;return De}}if(De.endsWithParent)return vr(De.parent,Fe,lt)}function ja(De){return nt.matcher.regexIndex===0?(Rt+=De[0],1):(Ta=!0,0)}function Al(De){const Fe=De[0],lt=De.rule,bt=new t(lt),ln=[lt.__beforeBegin,lt["on:begin"]];for(const Di of ln)if(Di&&(Di(De,bt),bt.isMatchIgnored))return ja(Fe);return lt.skip?Rt+=Fe:(lt.excludeBegin&&(Rt+=Fe),zt(),!lt.returnBegin&&!lt.excludeBegin&&(Rt=Fe)),_a(lt,De),lt.returnBegin?0:Fe.length}function qn(De){const Fe=De[0],lt=Ge.substring(De.index),bt=vr(nt,De,lt);if(!bt)return Pr;const ln=nt;nt.endScope&&nt.endScope._wrap?(zt(),Qn(Fe,nt.endScope._wrap)):nt.endScope&&nt.endScope._multi?(zt(),Cl(nt.endScope,De)):ln.skip?Rt+=Fe:(ln.returnEnd||ln.excludeEnd||(Rt+=Fe),zt(),ln.excludeEnd&&(Rt=Fe));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,De),ln.returnEnd?0:Fe.length}function Cs(){const De=[];for(let Fe=nt;Fe!==jn;Fe=Fe.parent)Fe.scope&&De.unshift(Fe.scope);De.forEach(Fe=>xn.openNode(Fe))}let tr={};function Ca(De,Fe){const lt=Fe&&Fe[0];if(Rt+=De,lt==null)return zt(),0;if(tr.type==="begin"&&Fe.type==="end"&&tr.index===Fe.index&&lt===""){if(Rt+=Ge.slice(Fe.index,Fe.index+1),!qt){const bt=new Error(`0 width match regex (${Ae})`);throw bt.languageName=Ae,bt.badRule=tr.rule,bt}return 1}if(tr=Fe,Fe.type==="begin")return Al(Fe);if(Fe.type==="illegal"&&!pt){const bt=new Error('Illegal lexeme "'+lt+'" for mode "'+(nt.scope||"<unnamed>")+'"');throw bt.mode=nt,bt}else if(Fe.type==="end"){const bt=qn(Fe);if(bt!==Pr)return bt}if(Fe.type==="illegal"&&lt==="")return Rt+=`
655
+ `,1;if(cc>1e5&&cc>Fe.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Rt+=lt,lt.length}const jn=Ln(Ae);if(!jn)throw je(Ot.replace("{}",Ae)),new Error('Unknown language: "'+Ae+'"');const As=dn(jn);let Tl="",nt=_t||As;const ud={},xn=new ze.__emitter(ze);Cs();let Rt="",Aa=0,Fr=0,cc=0,Ta=!1;try{if(jn.__emitTokens)jn.__emitTokens(Ge,xn);else{for(nt.matcher.considerAll();;){cc++,Ta?Ta=!1:nt.matcher.considerAll(),nt.matcher.lastIndex=Fr;const De=nt.matcher.exec(Ge);if(!De)break;const Fe=Ge.substring(Fr,De.index),lt=Ca(Fe,De);Fr=De.index+lt}Ca(Ge.substring(Fr))}return xn.finalize(),Tl=xn.toHTML(),{language:Ae,value:Tl,relevance:Aa,illegal:!1,_emitter:xn,_top:nt}}catch(De){if(De.message&&De.message.includes("Illegal"))return{language:Ae,value:Rn(Ge),illegal:!0,relevance:0,_illegalBy:{message:De.message,index:Fr,context:Ge.slice(Fr-100,Fr+100),mode:De.mode,resultSoFar:Tl},_emitter:xn};if(qt)return{language:Ae,value:Rn(Ge),illegal:!1,relevance:0,errorRaised:De,_emitter:xn,_top:nt};throw De}}function ka(Ae){const Ge={value:Rn(Ae),illegal:!1,relevance:0,_top:$e,_emitter:new ze.__emitter(ze)};return Ge._emitter.addText(Ae),Ge}function Ea(Ae,Ge){Ge=Ge||ze.languages||Object.keys(me);const pt=ka(Ae),_t=Ge.filter(Ln).filter(Ji).map(zt=>Qi(zt,Ae,!1));_t.unshift(pt);const sn=_t.sort((zt,Qn)=>{if(zt.relevance!==Qn.relevance)return Qn.relevance-zt.relevance;if(zt.language&&Qn.language){if(Ln(zt.language).supersetOf===Qn.language)return 1;if(Ln(Qn.language).supersetOf===zt.language)return-1}return 0}),[Mn,Wn]=sn,Fn=Mn;return Fn.secondBest=Wn,Fn}function Mi(Ae,Ge,pt){const _t=Ge&&Oe[Ge]||pt;Ae.classList.add("hljs"),Ae.classList.add(`language-${_t}`)}function an(Ae){let Ge=null;const pt=rn(Ae);if(et(pt))return;if(Ur("before:highlightElement",{el:Ae,language:pt}),Ae.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Ae);return}if(Ae.children.length>0&&(ze.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(Ae)),ze.throwUnescapedHTML))throw new Ti("One of your code blocks includes unescaped HTML.",Ae.innerHTML);Ge=Ae;const _t=Ge.textContent,sn=pt?Vt(_t,{language:pt,ignoreIllegals:!0}):Ea(_t);Ae.innerHTML=sn.value,Ae.dataset.highlighted="yes",Mi(Ae,pt,sn.language),Ae.result={language:sn.language,re:sn.relevance,relevance:sn.relevance},sn.secondBest&&(Ae.secondBest={language:sn.secondBest.language,relevance:sn.secondBest.relevance}),Ur("after:highlightElement",{el:Ae,result:sn,text:_t})}function Tn(Ae){ze=Nl(ze,Ae)}const Xi=()=>{Na(),te("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Sa(){Na(),te("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let _s=!1;function Na(){function Ae(){Na()}if(document.readyState==="loading"){_s||window.addEventListener("DOMContentLoaded",Ae,!1),_s=!0;return}document.querySelectorAll(ze.cssSelector).forEach(an)}function _l(Ae,Ge){let pt=null;try{pt=Ge(Z)}catch(_t){if(je("Language definition for '{}' could not be registered.".replace("{}",Ae)),qt)je(_t);else throw _t;pt=$e}pt.name||(pt.name=Ae),me[Ae]=pt,pt.rawDefinition=Ge.bind(null,Z),pt.aliases&&Zi(pt.aliases,{languageName:Ae})}function $r(Ae){delete me[Ae];for(const Ge of Object.keys(Oe))Oe[Ge]===Ae&&delete Oe[Ge]}function js(){return Object.keys(me)}function Ln(Ae){return Ae=(Ae||"").toLowerCase(),me[Ae]||me[Oe[Ae]]}function Zi(Ae,{languageName:Ge}){typeof Ae=="string"&&(Ae=[Ae]),Ae.forEach(pt=>{Oe[pt.toLowerCase()]=Ge})}function Ji(Ae){const Ge=Ln(Ae);return Ge&&!Ge.disableAutodetect}function xr(Ae){Ae["before:highlightBlock"]&&!Ae["before:highlightElement"]&&(Ae["before:highlightElement"]=Ge=>{Ae["before:highlightBlock"](Object.assign({block:Ge.el},Ge))}),Ae["after:highlightBlock"]&&!Ae["after:highlightElement"]&&(Ae["after:highlightElement"]=Ge=>{Ae["after:highlightBlock"](Object.assign({block:Ge.el},Ge))})}function fn(Ae){xr(Ae),it.push(Ae)}function jl(Ae){const Ge=it.indexOf(Ae);Ge!==-1&&it.splice(Ge,1)}function Ur(Ae,Ge){const pt=Ae;it.forEach(function(_t){_t[pt]&&_t[pt](Ge)})}function er(Ae){return te("10.7.0","highlightBlock will be removed entirely in v12.0"),te("10.7.0","Please use highlightElement now."),an(Ae)}Object.assign(Z,{highlight:Vt,highlightAuto:Ea,highlightAll:Na,highlightElement:an,highlightBlock:er,configure:Tn,initHighlighting:Xi,initHighlightingOnLoad:Sa,registerLanguage:_l,unregisterLanguage:$r,listLanguages:js,getLanguage:Ln,registerAliases:Zi,autoDetection:Ji,inherit:Nl,addPlugin:fn,removePlugin:jl}),Z.debugMode=function(){qt=!1},Z.safeMode=function(){qt=!0},Z.versionString=yt,Z.regex={concat:v,lookahead:y,either:E,optional:k,anyNumberOfTimes:b};for(const Ae in ue)typeof ue[Ae]=="object"&&e(ue[Ae]);return Object.assign(Z,ue),Z},Un=Br({});return Un.newInstance=()=>Br({}),oy=Un,Un.HighlightJS=Un,Un.default=Un,oy}var O8=D8();const R8=Hu(O8),BE={},L8="hljs-";function I8(e){const t=R8.newInstance();return e&&l(e),{highlight:n,highlightAuto:i,listLanguages:a,register:l,registerAlias:o,registered:d};function n(f,p,g){const m=g||BE,y=typeof m.prefix=="string"?m.prefix:L8;if(!t.getLanguage(f))throw new Error("Unknown language: `"+f+"` is not registered");t.configure({__emitter:z8,classPrefix:y});const b=t.highlight(p,{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,p){const m=(p||BE).subset||a();let y=-1,b=0,k;for(;++y<m.length;){const v=m[y];if(!t.getLanguage(v))continue;const S=n(v,f,p);S.data&&S.data.relevance!==void 0&&S.data.relevance>b&&(b=S.data.relevance,k=S)}return k||{type:"root",children:[],data:{language:void 0,relevance:b}}}function a(){return t.listLanguages()}function l(f,p){if(typeof f=="string")t.registerLanguage(f,p);else{let g;for(g in f)Object.hasOwn(f,g)&&t.registerLanguage(g,f[g])}}function o(f,p){if(typeof f=="string")t.registerAliases(typeof p=="string"?p:[...p],{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 z8{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 P8={};function $x(e){const t=e||P8,n=t.aliases,i=t.detect||!1,a=t.languages||M8,l=t.plainText,o=t.prefix,d=t.subset;let f="hljs";const p=I8(a);if(n&&p.registerAlias(n),o){const g=o.indexOf("-");f=g===-1?o:o.slice(0,g)}return function(g,m){uh(g,"element",function(y,b,k){if(y.tagName!=="code"||!k||k.type!=="element"||k.tagName!=="pre")return;const v=B8(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 S=rF(y,{whitespace:"pre"});let E;try{E=v?p.highlight(v,S,{prefix:o}):p.highlightAuto(S,{prefix:o,subset:d})}catch(C){const N=C;if(v&&/Unknown language/.test(N.message)){m.message("Cannot highlight as `"+v+"`, it’s not registered",{ancestors:[k,y],cause:N,place:y.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw N}!v&&E.data&&E.data.language&&y.properties.className.push("language-"+E.data.language),E.children.length>0&&(y.children=E.children)})}}function B8(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}const cy=e=>e instanceof Error?e.message:String(e),$E=e=>e.replace(/^---\n[\s\S]*?\n---\n?/,"");function $8({name:e,onClose:t}){const n=Pe(),i=Ft(),{data:a,isLoading:l,isError:o,error:d}=Ve({queryKey:["skill",e],queryFn:()=>Jz(e)}),[f,p]=j.useState(!1),[g,m]=j.useState(""),[y,b]=j.useState(!1),[k,v]=j.useState(null),S=T=>{m(T),p(!0),b(!1),v(null)},E=Et({mutationFn:()=>t4(e,g),onSuccess:()=>{i.invalidateQueries({queryKey:["skill",e]}),i.invalidateQueries({queryKey:["skills"]}),p(!1)},onError:T=>v(n("skillDetail.saveFailed",{detail:cy(T)}))}),C=Et({mutationFn:()=>i4(e),onSuccess:T=>S(T.content),onError:T=>v(n("skillDetail.translateFailed",{detail:cy(T)}))}),N=Et({mutationFn:()=>n4(e),onSuccess:()=>{i.invalidateQueries({queryKey:["skills"]}),t()},onError:T=>v(n("skillDetail.deleteFailed",{detail:cy(T)}))}),_=E.isPending||C.isPending||N.isPending;return j.useEffect(()=>{const T=M=>{M.key==="Escape"&&(f?p(!1):t())};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[t,f]),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}),a&&c.jsxs("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:[a.category," · ",a.origin||"local"]})]}),c.jsxs("div",{className:"flex items-center gap-2 flex-wrap justify-end",children:[a&&!f&&c.jsxs(c.Fragment,{children:[c.jsxs("button",{onClick:()=>S(a.body),className:"nb-btn nb-btn-blue px-3 py-2 text-sm flex items-center gap-1.5",type:"button",disabled:_,children:[c.jsx(o_,{size:14,strokeWidth:2.5})," ",n("skillDetail.edit")]}),c.jsxs("button",{onClick:()=>C.mutate(),className:"nb-btn nb-btn-lilac px-3 py-2 text-sm flex items-center gap-1.5",type:"button",disabled:_,children:[c.jsx(FL,{size:14,strokeWidth:2.5})," ",C.isPending?n("skillDetail.translating"):n("skillDetail.translate")]}),c.jsxs("button",{onClick:()=>y?N.mutate():b(!0),className:`nb-btn px-3 py-2 text-sm flex items-center gap-1.5 ${y?"nb-btn-danger":""}`,type:"button",disabled:_,children:[c.jsx(Vi,{size:14,strokeWidth:2.5})," ",y?n("skillDetail.deleteConfirm",{name:e}):n("skillDetail.delete")]})]}),f&&c.jsxs(c.Fragment,{children:[c.jsxs("button",{onClick:()=>E.mutate(),className:"nb-btn nb-btn-mint px-3 py-2 text-sm flex items-center gap-1.5",type:"button",disabled:_,children:[c.jsx(mr,{size:14,strokeWidth:2.5})," ",E.isPending?n("skillDetail.saving"):n("skillDetail.save")]}),c.jsx("button",{onClick:()=>p(!1),className:"nb-btn px-3 py-2 text-sm",type:"button",disabled:_,children:n("skillDetail.cancel")})]}),c.jsx("button",{onClick:t,className:"nb-btn nb-btn-mint p-2","aria-label":n("skillDetail.close.aria"),type:"button",children:c.jsx(gn,{size:16,strokeWidth:3})})]})]}),k&&c.jsx("p",{className:"text-sm text-[var(--color-crashed)] mb-3",children:k}),l&&c.jsx("p",{children:n("skillDetail.loading")}),o&&c.jsx("p",{className:"text-[var(--color-crashed)]",children:n("skillDetail.error.load",{detail:d instanceof Error?d.message:String(d)})}),a&&c.jsxs("div",{className:"flex flex-col gap-4",children:[!f&&(a.description||a.tags.length>0)&&c.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border-2 border-[var(--color-text)] bg-[var(--color-bg-cream)] p-3",children:[a.description&&c.jsx("p",{className:"text-sm leading-6",children:a.description}),a.tags.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.tags.map(T=>c.jsx("span",{className:"text-xs font-[family-name:var(--font-mono)] px-2 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-text)]",children:T},T))})]}),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")}),f?c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:n("skillDetail.editHint")}),c.jsx("textarea",{value:g,onChange:T=>m(T.target.value),spellCheck:!1,className:"w-full h-96 rounded-lg border-2 border-[var(--color-text)] bg-surface-input p-4 text-sm font-[family-name:var(--font-mono)] resize-y"})]}):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:$E(a.body).trim()?c.jsx(Ox,{remarkPlugins:[zx],rehypePlugins:[$x],children:$E(a.body)}):c.jsx("p",{className:"text-[var(--color-text-muted)] italic",children:"(empty)"})})})]}),a.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:a.references.map(T=>c.jsx(U8,{skillName:e,file:T.name,lines:T.lines},T.name))})]})]})]})})}function U8({skillName:e,file:t,lines:n}){const i=Pe(),[a,l]=j.useState(!1),{data:o,isLoading:d,isError:f,error:p}=Ve({queryKey:["skill-ref",e,t],queryFn:()=>e4(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(Jo,{size:12,strokeWidth:3,className:["transition-transform",a?"rotate-90":""].join(" ")}),c.jsx(Wu,{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:p instanceof Error?p.message:String(p)})}),o&&c.jsx("div",{className:"prose-chat text-sm",children:c.jsx(Ox,{remarkPlugins:[zx],rehypePlugins:[$x],children:o.content})})]})]})}function F8({onClose:e}){const t=Pe(),n=Ft(),{alert:i}=un(),[a,l]=j.useState(""),[o,d]=j.useState(""),f=/^[a-z0-9][a-z0-9-]*$/.test(a),p=Et({mutationFn:()=>c4(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(gn,{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:`---
656
+ name: code-review
657
+ description: ...
658
+ ---
659
+
660
+ # ...`,"aria-label":t("skills.import.body")})]}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint self-start",disabled:p.isPending||!f||!o.trim(),onClick:()=>p.mutate(),children:[p.isPending?c.jsx(Xe,{size:14,className:"animate-spin"}):c.jsx(h_,{size:14,strokeWidth:3}),t("skills.import.submit")]})]})})}function q8({onClose:e,onSubmit:t}){const n=Pe(),[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(pl,{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(gn,{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(pl,{size:14,strokeWidth:2.5}),n("skills.ai.submit")]})]})})})}async function H8(e){const{files:t}=await u4(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 K8=[{value:"all",labelKey:"skills.category.all"},{value:"language",labelKey:"skills.category.language"},{value:"domain",labelKey:"skills.category.domain"},{value:"persona",labelKey:"skills.category.persona"},{value:"workflow",labelKey:"skills.category.workflow"},{value:"engine",labelKey:"skills.category.engine"},{value:"genre",labelKey:"skills.category.genre"},{value:"platform",labelKey:"skills.category.platform"},{value:"review",labelKey:"skills.category.review"},{value:"meta",labelKey:"skills.category.meta"},{value:"other",labelKey:"skills.category.other"}],G8={language:"var(--color-accent-purple)",domain:"var(--color-secondary)",persona:"var(--color-primary)",workflow:"var(--color-accent-mint)",engine:"var(--color-accent-yellow)",genre:"var(--color-accent-pink)",platform:"var(--color-secondary-dark)",review:"var(--color-primary-dark)",meta:"var(--color-bg-cream)",other:"var(--color-bg-cream)"};function V8(){var q,Y;const e=Pe(),[t,n]=j.useState("all"),[i,a]=j.useState([]),[l,o]=j.useState(""),[d,f]=j.useState(null),[p,g]=j.useState(!1),[m,y]=j.useState(!1),b=Ft(),v=(((q=Ve({queryKey:["gen-jobs"],queryFn:R2,refetchInterval:3e3}).data)==null?void 0:q.data)??[]).filter(D=>D.kind==="skill"),S=v.filter(D=>D.status!=="done"),E=j.useRef(new Set);j.useEffect(()=>{for(const D of v)(D.status==="done"||D.status==="error")&&!E.current.has(D.id)&&(E.current.add(D.id),b.invalidateQueries({queryKey:["skills"]}),b.invalidateQueries({queryKey:["skill-updates"]}))},[v,b]);const C=(D,F)=>{d4(D,F).then(()=>b.invalidateQueries({queryKey:["gen-jobs"]})).catch(()=>{})},_=(((Y=Ve({queryKey:["skill-updates"],queryFn:o4}).data)==null?void 0:Y.data)??[]).filter(D=>D.status!=="same").length,{data:T,isLoading:M}=Ve({queryKey:["skills"],queryFn:()=>fx()}),O=Ve({queryKey:["projects"],queryFn:Es}),R=j.useMemo(()=>((T==null?void 0:T.data)??[]).filter(F=>!(t!=="all"&&F.category!==t||i.length>0&&!F.tags.some(I=>i.includes(I))||l&&!F.name.toLowerCase().includes(l.toLowerCase()))),[T,t,i,l]),B=j.useMemo(()=>{const D=(T==null?void 0:T.data)??[],F={all:D.length};for(const I of D)F[I.category]=(F[I.category]??0)+1;return F},[T]),U=j.useMemo(()=>{const D=new Map;for(const F of(T==null?void 0:T.data)??[])for(const I of F.tags)D.set(I,(D.get(I)??0)+1);return[...D.entries()].sort((F,I)=>I[1]-F[1]||F[0].localeCompare(I[0]))},[T]),K=D=>a(F=>F.includes(D)?F.filter(I=>I!==D):[...F,D]);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:M?e("common.loading"):e("skills.subtitleCount",{count:(T==null?void 0:T.data.length)??0})})]}),c.jsxs("div",{className:"flex gap-3 items-center",children:[_>0&&c.jsx("span",{className:"nb-badge text-[10px]",title:e("skills.updates.badge",{count:String(_)}),children:e("skills.updates.badge",{count:String(_)})}),c.jsxs("button",{className:"nb-btn",onClick:()=>y(!0),type:"button",children:[c.jsx(pl,{size:14,strokeWidth:2.5}),e("skills.ai")]}),c.jsxs("button",{className:"nb-btn",onClick:()=>g(!0),type:"button",children:[c.jsx(h_,{size:14,strokeWidth:2.5}),e("skills.import")]}),c.jsxs("button",{className:"nb-btn nb-btn-mint",onClick:async()=>{await a4(),b.invalidateQueries({queryKey:["skills"]}),b.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:l,onChange:D=>o(D.target.value),"aria-label":e("skills.search.aria")})]}),c.jsx("div",{className:"flex flex-wrap gap-1 p-1 bg-[var(--color-bg)] border-[2px] border-[var(--color-text)] rounded-2xl shadow-[2px_2px_0_var(--color-text)]",children:K8.filter(D=>D.value==="all"||(B[D.value]??0)>0).map(D=>c.jsxs("button",{type:"button",onClick:()=>n(D.value),className:["px-3 py-1 rounded-full text-xs font-bold font-[family-name:var(--font-body)]",t===D.value?"bg-[var(--color-text)] text-[var(--color-bg)]":"text-[var(--color-text-muted)] hover:text-[var(--color-text)]"].join(" "),children:[e(D.labelKey)," ",B[D.value]??0]},D.value))})]}),U.length>0&&c.jsxs("div",{className:"flex items-start gap-2 flex-wrap",children:[c.jsx("span",{className:"text-xs font-bold text-[var(--color-text-muted)] pt-1.5 uppercase tracking-wider",children:e("skills.tags.title")}),c.jsxs("div",{className:"flex flex-wrap gap-1.5 flex-1",children:[U.map(([D,F])=>{const I=i.includes(D);return c.jsxs("button",{type:"button",onClick:()=>K(D),className:["px-2.5 py-1 rounded-full text-xs font-[family-name:var(--font-mono)] border-2 border-[var(--color-text)] transition-colors",I?"bg-[var(--color-text)] text-[var(--color-bg)] font-bold":"bg-[var(--color-bg)] text-[var(--color-text-muted)] hover:bg-[var(--color-accent-yellow)]"].join(" "),children:[D," ",c.jsx("span",{className:"opacity-60",children:F})]},D)}),i.length>0&&c.jsx("button",{type:"button",onClick:()=>a([]),className:"px-2.5 py-1 rounded-full text-xs font-bold text-[var(--color-crashed)] hover:underline",children:e("skills.tags.clear")})]})]}),c.jsxs("div",{className:"grid gap-4 grid-cols-[repeat(auto-fill,minmax(280px,1fr))]",children:[S.map(D=>c.jsxs("div",{className:`nb-card flex items-center gap-2 ${D.status==="error"?"bg-[var(--color-crashed-bg)]":"opacity-70"}`,children:[D.status==="running"?c.jsx(Xe,{size:14,className:"animate-spin"}):c.jsx(gn,{size:14,strokeWidth:3}),c.jsx("span",{className:"text-sm text-[var(--color-text-muted)] truncate",children:D.status==="running"?`${D.label} · ${e("skills.ai.wait")}`:`${D.label}: ${D.error??e("skills.ai.error")}`})]},D.id)),R.map(D=>{var F;return c.jsx(Y8,{skill:D,projectCount:((F=O.data)==null?void 0:F.data.length)??0,onOpen:()=>f(D.name),onExport:()=>void H8(D.name)},D.name)})]}),d&&c.jsx($8,{name:d,onClose:()=>f(null)}),p&&c.jsx(F8,{onClose:()=>g(!1)}),m&&c.jsx(q8,{onClose:()=>y(!1),onSubmit:(D,F)=>{C(D,F),y(!1)}})]})}function Y8({skill:e,projectCount:t,onOpen:n,onExport:i}){const a=Pe(),l=G8[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(Hp,{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)"}),e.tags.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.map(o=>c.jsx("span",{className:"text-[10px] font-[family-name:var(--font-mono)] px-1.5 py-0.5 rounded-full bg-[var(--color-bg-cream)] border border-[var(--color-text)]",children:o},o))}),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)] mt-auto",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 sC(e){const t=e?`?q=${encodeURIComponent(e)}`:"";return ct(`/api/prompts${t}`)}function Ux(e){return ct(`/api/prompts/${encodeURIComponent(e)}`)}function W8(e){return gr("/api/prompts",e)}function Q8(e,t){return Vb(`/api/prompts/${encodeURIComponent(e)}`,t)}function X8(e){return k_(`/api/prompts/${encodeURIComponent(e)}`)}function Z8(e){return gr("/api/prompts/generate",{intent:e})}function lC(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 J8(){var M,O;const e=Pe(),[t,n]=Wb("prompts.last",""),[i,a]=j.useState(null),[l,o]=j.useState(!1),[d,f]=j.useState(""),[p,g]=j.useState(new Set),m=Ft(),y=Ve({queryKey:["prompts"],queryFn:()=>sC()}),b=((M=y.data)==null?void 0:M.data)??[],k=j.useMemo(()=>[...new Set(b.flatMap(R=>R.tags))].sort(),[b]),S=(((O=Ve({queryKey:["gen-jobs"],queryFn:R2,refetchInterval:3e3}).data)==null?void 0:O.data)??[]).filter(R=>R.kind==="prompt"),E=S.filter(R=>R.status!=="done"),C=j.useRef(new Set);j.useEffect(()=>{for(const R of S)(R.status==="done"||R.status==="error")&&!C.current.has(R.id)&&(C.current.add(R.id),m.invalidateQueries({queryKey:["prompts"]}),R.status==="done"&&R.result&&n(R.result))},[S,m,n]);const N=R=>{Z8(R).then(()=>m.invalidateQueries({queryKey:["gen-jobs"]})).catch(()=>{})},_=j.useMemo(()=>{const R=d.trim().toLowerCase();return b.filter(B=>!(p.size&&![...p].every(U=>B.tags.includes(U))||R&&!(B.name.toLowerCase().includes(R)||B.description.toLowerCase().includes(R)||B.tags.some(K=>K.toLowerCase().includes(R)))))},[b,p,d]);j.useEffect(()=>{t&&b.length&&!b.some(R=>R.name===t)&&n("")},[t,b,n]);const T=R=>g(B=>{const U=new Set(B);return U.has(R)?U.delete(R):U.add(R),U});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(pl,{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(hi,{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:R=>f(R.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(R=>c.jsx("button",{type:"button",onClick:()=>T(R),className:`text-xs border-2 border-[var(--color-text)] rounded-full px-2 py-0.5 ${p.has(R)?"bg-[var(--color-accent-mint)] font-bold":""}`,children:R},R))})]}),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(R=>c.jsxs("div",{className:`nb-card flex items-center gap-2 ${R.status==="error"?"bg-[var(--color-crashed-bg)]":"opacity-70"}`,style:{padding:"8px 10px"},children:[R.status==="running"?c.jsx(Xe,{size:12,className:"animate-spin"}):c.jsx(gn,{size:12,strokeWidth:3}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)] truncate",children:R.status==="running"?e("prompts.ai.wait"):`${e("prompts.ai.error")}: ${R.error??""}`})]},R.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(R=>c.jsxs("button",{type:"button",onClick:()=>n(R.name),className:`nb-card w-full text-left ${t===R.name?"bg-[var(--color-accent-mint)]":""}`,style:{padding:"8px 10px"},children:[c.jsxs("span",{className:"flex items-center gap-1.5",children:[R.favorite&&c.jsx(f_,{size:12,fill:"currentColor"}),c.jsx("code",{className:"font-[family-name:var(--font-mono)] text-sm font-bold truncate",children:R.name})]}),R.description&&c.jsx("span",{className:"block text-xs text-[var(--color-text-muted)] truncate",children:R.description})]},R.name))]}),c.jsx("div",{className:"flex-1 min-w-0 min-h-0",children:t?c.jsx(tq,{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(iq,{name:i.mode==="edit"?i.name:null,onClose:()=>a(null),onSaved:R=>{a(null),n(R)}}),l&&c.jsx(eq,{onClose:()=>o(!1),onSubmit:R=>{N(R),o(!1)}})]})}function eq({onClose:e,onSubmit:t}){const n=Pe(),[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(pl,{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(gn,{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(pl,{size:14,strokeWidth:2.5}),n("prompts.ai.submit")]})]})})})}function tq({name:e,onEdit:t,onDeleted:n}){const i=Pe(),a=Ft(),{confirm:l}=un(),o=Ve({queryKey:["prompt",e],queryFn:()=>Ux(e)}),d=Et({mutationFn:()=>X8(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 p=lC(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(f_,{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(Kp,{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(Vi,{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:p.length?i("prompts.vars",{names:p.join(", ")}):i("prompts.noVars")})]})}function nq({tags:e,onChange:t}){const n=Pe(),[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(gn,{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 iq({name:e,onClose:t,onSaved:n}){const i=Pe(),a=Ft(),{alert:l}=un(),o=e===null,d=Ve({queryKey:["prompt",e],queryFn:()=>Ux(e),enabled:!o}),[f,p]=j.useState(o?{name:"",description:"",tags:[],body:"",favorite:!1}:null);j.useEffect(()=>{if(!o&&d.data&&f===null){const b=d.data;p({name:b.name,description:b.description,tags:b.tags,body:b.body,favorite:b.favorite})}},[o,d.data,f]);const g=Et({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?W8({name:f.name,...b}):Q8(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?lC(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(gn,{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=>p({...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=>p({...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(nq,{tags:f.tags,onChange:b=>p({...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=>p({...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(mr,{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=>p({...f,favorite:b.target.checked})}),i("prompts.favorite")]})]})]}):null]})})})}function rq(){var l;const e=Pe(),t=Ve({queryKey:["system-info"],queryFn:S_}),n=Ve({queryKey:["system-env"],queryFn:eI}),[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(aq,{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:cq(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 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(Kp,{size:12,strokeWidth:2.5})," ",e("system.env.edit.button")]})]}),i?c.jsx(sq,{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(lq,{})]})}function aq({current:e}){var v;const t=Pe(),{confirm:n,alert:i}=un(),[a,l]=j.useState(!1),[o,d]=j.useState(null),f=Ve({queryKey:["latest-version"],queryFn:sI,enabled:!1}),[p,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 lI();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 N=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:N})}}catch(C){d(C.message),i({title:t("system.upgrade.error.title"),body:C.message})}finally{l(!1)}}},k=async()=>{const S=f.data&&!f.data.upToDate?`npm i -g @coralai/sps-cli@${f.data.latest}`:m;try{await navigator.clipboard.writeText(S),i({title:t("system.upgrade.copy.success.title"),body:t("system.upgrade.copy.success.body",{cmd:S})})}catch{i({title:t("system.upgrade.copy.fail.title"),body:t("system.upgrade.copy.fail.body",{cmd:S})})}};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(Hp,{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(n_,{size:11,strokeWidth:2.5})," ",t("system.upgrade.button.copy")]})]})]})]}),p&&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:[p,p===((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")}):p===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 sq({onClose:e}){const t=Pe(),n=Ft(),{alert:i}=un(),a=Ve({queryKey:["system-env-raw"],queryFn:tI}),[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 p=l!==null&&a.data&&l!==a.data.content,g=Et({mutationFn:()=>{if(l===null)throw new Error("no draft");return nI(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}`:"",p?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(gn,{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:!p||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(mr,{size:12,strokeWidth:3}),t("system.env.save")]})]})]})]})}function lq(){var y;const e=Pe(),{alert:t}=un(),n=Ve({queryKey:["projects"],queryFn:Es}),[i,a]=j.useState({}),[l,o]=j.useState({}),[d,f]=j.useState({}),p=(((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 oI(b,k);a(S=>({...S,[b]:v})),f(S=>({...S,[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 p)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:p.length===0||Object.values(l).some(Boolean),type:"button",children:[c.jsx(ya,{size:12,strokeWidth:2.5}),e("system.diagnostics.checkAll")]})]}),p.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:p.map(b=>{const k=i[b.project],v=l[b.project],S=k?k.checks.filter(_=>_.status==="fail").length:0,E=k?k.checks.filter(_=>_.status==="warn").length:0,C=d[b.project]??!1,N=k!=null;return c.jsxs("li",{className:"bg-surface-input 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:!N,className:"flex items-center gap-2 flex-1 text-left min-w-0","aria-label":e(C?"system.diagnostics.collapseAria":"system.diagnostics.expandAria"),children:[N&&k.ok?c.jsx(mp,{size:16,className:"text-[var(--color-running)] shrink-0",strokeWidth:2.5}):N?c.jsx(Eu,{size:16,className:"text-[var(--color-stuck)] shrink-0",strokeWidth:2.5}):c.jsx(mp,{size:16,className:"text-[var(--color-text-subtle)] shrink-0",strokeWidth:2.5}),N&&(C?c.jsx(Yu,{size:12}):c.jsx(Jo,{size:12})),c.jsx("span",{className:"font-bold font-[family-name:var(--font-mono)]",children:b.project}),N?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:[S," 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||N&&k.ok,type:"button","aria-label":e("system.diagnostics.fixAria"),title:N&&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(g_,{size:11,strokeWidth:2.5}),e("system.diagnostics.fix")]})]}),C&&N&&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((_,T)=>c.jsx(oq,{check:_},`${_.name}-${T}`))}),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((_,T)=>c.jsx("li",{children:_},T))})]})]})]},b.project)})})]})}function oq({check:e}){const t=e.status==="pass"?c.jsx(mp,{size:12,className:"text-[var(--color-running)]",strokeWidth:2.5}):e.status==="fail"?c.jsx(Eu,{size:12,className:"text-[var(--color-crashed)]",strokeWidth:2.5}):e.status==="warn"?c.jsx(Eu,{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 cq(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 uq(){return ct("/api/chat/sessions")}function dq(e){return ct(`/api/chat/sessions/${e}`)}async function uy(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 fq(e){const t=await fetch(`/api/chat/sessions/${e}`,{method:"DELETE"});if(!t.ok)throw new Error(`${t.status}`)}async function pq(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 hq(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 mq(e,t){const n=t?`?since=${encodeURIComponent(t)}`:"";return ct(`/api/chat/sessions/${e}/messages${n}`)}function gq({onInsert:e,disabled:t,className:n="nb-btn"}){var m;const i=Pe(),[a,l]=j.useState(!1),[o,d]=j.useState(""),p=((m=Ve({queryKey:["prompts",o],queryFn:()=>sC(o||void 0),enabled:a}).data)==null?void 0:m.data)??[],g=async y=>{try{const b=await Ux(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(l_,{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:p.length===0?c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] px-1 py-2",children:i("prompts.empty")}):p.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 UE(){var ue,J,we,re,Ce,Me,_e,Qe,Ue;const e=Pe(),{sessionId:t}=Lb(),n=ks(),i=Ft(),{confirm:a,alert:l}=un(),o=Ve({queryKey:["chat-sessions"],queryFn:uq,refetchInterval:5e3}),d=Ve({queryKey:["chat-session",t],queryFn:()=>dq(t??""),enabled:!!t,refetchInterval:4e3}),[f,p]=j.useState(null),g=ce=>`chat-draft:${ce??""}`,[m,y]=j.useState(()=>localStorage.getItem(g(t))??""),b=j.useCallback(ce=>{y(be=>{const ge=typeof ce=="function"?ce(be):ce;try{t&&localStorage.setItem(g(t),ge)}catch{}return ge})},[t]);j.useEffect(()=>{y(localStorage.getItem(g(t))??"")},[t]);const[k,v]=j.useState(!1),S=j.useRef(null),E=j.useRef(!0),[C,N]=j.useState(!1),_=()=>{const ce=S.current;return!ce||ce.scrollHeight-ce.scrollTop-ce.clientHeight<40},T=j.useCallback(()=>{const ce=S.current;ce&&(ce.scrollTop=ce.scrollHeight),E.current=!0,N(!1)},[]),M=j.useCallback(()=>{const ce=_();E.current=ce,N(!ce)},[]),O=j.useRef(null);j.useEffect(()=>{const ce=O.current;ce&&(ce.style.height="auto",ce.style.height=`${Math.min(ce.scrollHeight,200)}px`,ce.scrollTop=ce.scrollHeight)},[m]);const R="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",[B,U]=j.useState(!1),[K,q]=j.useState([]),[Y,D]=j.useState(!1),[F,I]=j.useState(!1),[H,W]=j.useState(!1),[G,L]=j.useState(null),[z,V]=j.useState(!1);j.useEffect(()=>{if(!t)return;const ce=new EventSource(`/stream/chat/${encodeURIComponent(t)}`);let be=!0;return ce.addEventListener("open",()=>{if(be){be=!1;return}const ge=i.getQueryData(["chat-session",t]),pe=ge!=null&&ge.messages.length?ge.messages[ge.messages.length-1].ts:void 0;mq(t,pe).then(Se=>{Se.data.length!==0&&i.setQueryData(["chat-session",t],je=>{if(!je)return je;const He=new Set(je.messages.map(de=>de.id)),te=Se.data.filter(de=>!He.has(de.id));return te.length===0?je:{...je,messages:[...je.messages,...te],lastMessageAt:te[te.length-1].ts,messageCount:je.messageCount+te.length}})}).catch(()=>{})}),ce.addEventListener("chat.message",ge=>{try{const pe=JSON.parse(ge.data);i.setQueryData(["chat-session",t],Se=>{if(!Se||Se.messages.some(te=>te.id===pe.message.id))return Se;const He=Se.messages.findIndex(te=>te.role==="user"&&te.id.startsWith("optim-")&&te.content===pe.message.content);if(He>=0){const te=[...Se.messages];return te[He]=pe.message,{...Se,messages:te}}return{...Se,messages:[...Se.messages,pe.message]}})}catch{}}),ce.addEventListener("chat.message.pending",ge=>{try{const pe=JSON.parse(ge.data);p({sessionId:t,id:pe.assistantId,blocks:[],done:!1,finalMessage:null})}catch{}}),ce.addEventListener("chat.message.snapshot",ge=>{try{const pe=JSON.parse(ge.data);p({sessionId:t,id:pe.assistantId,blocks:pe.blocks.map(Se=>Se.type==="text"?{type:"text",target:Se.text,displayed:Se.text}:{type:"tool_use",id:Se.id,title:Se.title,kind:Se.kind,status:Se.status,input:Se.input,locations:Se.locations}),done:!1,finalMessage:null})}catch{}}),ce.addEventListener("chat.message.chunk.text",ge=>{try{const pe=JSON.parse(ge.data);p(Se=>{if(!Se||Se.id!==pe.assistantId)return Se;const je=[...Se.blocks],He=je[je.length-1];return He&&He.type==="text"?je[je.length-1]={...He,target:He.target+pe.text}:je.push({type:"text",target:pe.text,displayed:""}),{...Se,blocks:je}})}catch{}}),ce.addEventListener("chat.message.chunk.tool_use",ge=>{try{const pe=JSON.parse(ge.data);p(Se=>!Se||Se.id!==pe.assistantId?Se:{...Se,blocks:[...Se.blocks,{type:"tool_use",id:pe.id,title:pe.title,kind:pe.kind,status:pe.status,input:pe.input,locations:pe.locations}]})}catch{}}),ce.addEventListener("chat.message.chunk.tool_update",ge=>{try{const pe=JSON.parse(ge.data);p(Se=>!Se||Se.id!==pe.assistantId?Se:{...Se,blocks:Se.blocks.map(je=>je.type==="tool_use"&&je.id===pe.id?{...je,status:pe.status,input:je.input??pe.input,locations:je.locations??pe.locations}:je)})}catch{}}),ce.addEventListener("chat.message.complete",ge=>{try{const pe=JSON.parse(ge.data);p(Se=>Se&&Se.id===pe.assistantId?{...Se,done:!0,finalMessage:pe.message}:Se)}catch{}}),ce.addEventListener("chat.message.error",ge=>{try{const pe=JSON.parse(ge.data);p(je=>je&&je.sessionId===t&&(!pe.assistantId||je.id===pe.assistantId||je.id===pe.turnId)?null:je),v(!1);const Se=pe.message;Se&&i.setQueryData(["chat-session",t],je=>!je||je.messages.some(He=>He.id===Se.id)?je:{...je,messages:[...je.messages,Se],lastMessageAt:Se.ts,messageCount:je.messageCount+1})}catch{}}),()=>ce.close()},[t,i]),j.useEffect(()=>{if(!f||f.sessionId!==t)return;const ce=f.blocks.reduce((ge,pe)=>pe.type==="text"?ge+(pe.target.length-pe.displayed.length):ge,0);if(ce<=0){if(f.done&&f.finalMessage){const ge=f.finalMessage;i.setQueryData(["chat-session",t],pe=>!pe||pe.messages.some(Se=>Se.id===ge.id)?pe:{...pe,messages:[...pe.messages,ge],lastMessageAt:ge.ts,messageCount:pe.messageCount+1}),i.invalidateQueries({queryKey:["chat-sessions"]}),i.invalidateQueries({queryKey:["chat-session",t]}),p(null),v(!1)}return}const be=setTimeout(()=>{p(ge=>{if(!ge)return ge;let pe=Math.max(1,Math.ceil(ce/40));const Se=ge.blocks.map(je=>{if(je.type!=="text"||pe<=0)return je;const He=je.target.length-je.displayed.length;if(He<=0)return je;const te=Math.min(He,pe);return pe-=te,{...je,displayed:je.target.slice(0,je.displayed.length+te)}});return{...ge,blocks:Se}})},25);return()=>clearTimeout(be)},[f,i,t]),j.useEffect(()=>{if(E.current){const ce=S.current;ce&&(ce.scrollTop=ce.scrollHeight)}},[d.data,f]),j.useEffect(()=>{E.current=!0,N(!1),v(!1)},[t]);const P=j.useCallback(async(ce={})=>{var be,ge;try{const pe=await uy({cwd:((be=ce.cwd)==null?void 0:be.trim())||void 0,title:((ge=ce.title)==null?void 0:ge.trim())||void 0,agentKind:ce.agentKind,model:ce.model,providerId:ce.providerId});i.invalidateQueries({queryKey:["chat-sessions"]}),n(`/chat/${pe.id}`),U(!1)}catch(pe){l({title:e("chat.error.create.title"),body:pe instanceof Error?pe.message:String(pe)})}},[i,n,l,e]),le=j.useCallback(async()=>{const ce=m.trim();if(!ce&&K.length===0||k)return;let be=t;if(!be){const Se=await uy();i.invalidateQueries({queryKey:["chat-sessions"]}),be=Se.id,n(`/chat/${be}`,{replace:!0})}E.current=!0,N(!1);const ge=K.map(Se=>Se.path),pe={id:`optim-${Date.now()}`,role:"user",content:ce||e("chat.placeholder.attachment"),ts:new Date().toISOString(),status:"complete",attachments:ge.length>0?ge:void 0};i.setQueryData(["chat-session",be],Se=>Se?{...Se,messages:[...Se.messages,pe],lastMessageAt:pe.ts,messageCount:Se.messageCount+1}:{id:be,createdAt:pe.ts,lastMessageAt:pe.ts,title:ce.slice(0,60)||e("chat.placeholder.attachmentTitle"),project:null,messageCount:1,messages:[pe]}),b(""),q([]),v(!0);try{await pq(be,ce||e("chat.placeholder.viewAttachment"),ge.length>0?ge:void 0)}catch(Se){v(!1),console.error("sendMessage failed",Se),l({title:e("chat.error.send.title"),body:Se instanceof Error?Se.message:String(Se)})}},[m,K,k,t,i,n,l,e]),xe=j.useCallback(async ce=>{if(ce.size>j2){l({title:e("chat.error.fileTooBig.title"),body:e("chat.error.fileTooBig.body",{size:(ce.size/1024/1024).toFixed(2),name:ce.name})});return}let be=t;if(!be){const ge=await uy();i.invalidateQueries({queryKey:["chat-sessions"]}),be=ge.id,n(`/chat/${be}`,{replace:!0})}D(!0);try{const ge=await D4(be,ce);q(pe=>[...pe,{path:ge.path,name:ge.name}])}catch(ge){l({title:e("chat.error.uploadAttachment.title"),body:ge instanceof Error?ge.message:String(ge)})}finally{D(!1)}},[t,i,n,l,e]),ke=j.useCallback(ce=>{q(be=>be.filter(ge=>ge.path!==ce))},[]),Ne=j.useCallback(async(ce,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 fq(ce),i.invalidateQueries({queryKey:["chat-sessions"]}),t===ce&&n("/chat"))},[i,t,n,a,e]),se=j.useCallback(async()=>{if(t)try{await hq(t)}catch(ce){l({title:e("chat.error.interrupt.title"),body:ce instanceof Error?ce.message:String(ce)})}},[t,l,e]),ve=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:()=>U(!0),type:"button",children:[c.jsx(hi,{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:((ue=o.data)==null?void 0:ue.data.length)??0})}),c.jsx("div",{className:"flex flex-col gap-0.5 mt-1 overflow-auto min-h-0",children:(()=>{var te;const ce=((te=o.data)==null?void 0:te.data)??[],be=Date.now(),ge=10080*60*1e3,pe=de=>new Date(de.lastMessageAt??de.createdAt).getTime(),Se=ce.filter(de=>be-pe(de)<=ge),je=ce.filter(de=>be-pe(de)>ge),He=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(gk,{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:uC(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(yp,{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(),Ne(de.id,de.source)},children:c.jsx(Vi,{size:12})})]},de.id);return c.jsxs(c.Fragment,{children:[Se.map(He),je.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(Yu,{size:12,strokeWidth:2.5}):c.jsx(Jo,{size:12,strokeWidth:2.5}),e("chat.list.olderToggle",{count:je.length})]}),z&&je.map(He)]}),ce.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:((J=d.data)==null?void 0:J.title)??e("common.loading")}),((we=d.data)==null?void 0:we.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(gp,{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}),((re=d.data)==null?void 0:re.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(yp,{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:S,onScroll:M,className:"flex-1 overflow-auto p-4 flex flex-col gap-4",children:[(((Me=d.data)==null?void 0:Me.messages)??[]).filter(ce=>!(ve&&ce.status==="streaming")).map(ce=>c.jsx(xq,{msg:ce,sessionId:t??null,onPreviewAttachment:be=>L(be)},ce.id)),ve&&c.jsx(wq,{pending:ve}),!d.isLoading&&(((_e=d.data)==null?void 0:_e.messages)??[]).length===0&&!ve&&!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:T,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(FR,{size:18,strokeWidth:3})})]}),((Qe=d.data)==null?void 0:Qe.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:ce=>{ce.dataTransfer.types.includes("Files")&&(ce.preventDefault(),ce.dataTransfer.dropEffect="copy",H||W(!0))},onDragLeave:()=>W(!1),onDrop:ce=>{if(!ce.dataTransfer.types.includes("Files"))return;ce.preventDefault(),W(!1);const be=Array.from(ce.dataTransfer.files??[]);for(const ge of be)xe(ge)},children:[(K.length>0||Y)&&c.jsxs("div",{className:"flex flex-wrap gap-2 mb-2",children:[K.map(ce=>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(ce.path),title:e("chat.attachment.previewTooltip",{name:ce.name,path:ce.path}),children:[Cp(ce.path)?c.jsx(IL,{size:11,strokeWidth:2.5,className:"flex-shrink-0"}):c.jsx(Wu,{size:11,strokeWidth:2.5,className:"flex-shrink-0"}),c.jsx("span",{className:"truncate max-w-[180px]",children:ce.name}),c.jsx("span",{role:"button","aria-label":e("chat.input.removeAttachment",{name:ce.name}),className:"ml-1 hover:text-[var(--color-crashed)] cursor-pointer",onClick:be=>{be.stopPropagation(),ke(ce.path)},children:c.jsx(gn,{size:11,strokeWidth:3})})]},ce.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:O,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:ce=>b(ce.target.value),onKeyDown:ce=>{ce.key==="Enter"&&!ce.shiftKey&&!ce.nativeEvent.isComposing&&(ce.preventDefault(),le())},onPaste:ce=>{const ge=Array.from(ce.clipboardData.items??[]).filter(pe=>pe.kind==="file"&&pe.type.startsWith("image/"));if(ge.length!==0){ce.preventDefault();for(const pe of ge){const Se=pe.getAsFile();Se&&xe(Se)}}},"aria-label":e("chat.input.aria")}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("button",{type:"button",className:R,onClick:()=>I(!0),disabled:k,"aria-label":e("chat.input.attach.aria"),title:e("chat.input.attach.title"),children:c.jsx(e3,{size:15,strokeWidth:2.5})}),c.jsx(gq,{className:R,disabled:k,onInsert:ce=>b(be=>be.trim()?`${be}
661
+ ${ce}`:ce)}),c.jsx("div",{className:"flex-1"}),ve?c.jsx("button",{className:"nb-btn nb-btn-danger w-9 h-9 p-0 justify-center",onClick:se,type:"button","aria-label":e("chat.input.interrupt.aria"),title:e("chat.input.interrupt"),children:c.jsx(Hb,{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()&&K.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(JN,{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(gk,{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")})]})})}),B&&c.jsx(bq,{onCancel:()=>U(!1),onCreate:ce=>P(ce)}),F&&c.jsx(hx,{mode:"file",title:e("chat.filePicker.title"),initialPath:((Ue=d.data)==null?void 0:Ue.cwd)??void 0,onCancel:()=>I(!1),onSelect:ce=>{q(be=>{if(be.some(pe=>pe.path===ce))return be;const ge=ce.split(/[\\/]/).pop()||ce;return[...be,{path:ce,name:ge}]}),I(!1)}}),G&&t&&c.jsx(yq,{sessionId:t,path:G,onClose:()=>L(null)})]})}function Cp(e){return/\.(png|jpe?g|gif|webp|svg|avif)$/i.test(e)}function FE(e){return/\.pdf$/i.test(e)}function dy(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 yq({sessionId:e,path:t,onClose:n}){const i=Pe(),[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(!dy(t))return;let g=!1;return fetch(Zy(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)+`
662
+
663
+ …(truncated)`:m)}).catch(m=>{g||d(m instanceof Error?m.message:String(m))}),()=>{g=!0}},[e,t]);const f=Zy(e,t),p=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:p}),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(fL,{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:p})]}),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(gn,{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:[Cp(t)&&c.jsx("div",{className:"flex items-center justify-center p-4",children:c.jsx("img",{src:f,alt:`Preview: ${p}`,className:"max-w-full max-h-[60vh] object-contain"})}),FE(t)&&c.jsx("iframe",{src:f,title:`PDF: ${p}`,className:"w-full",style:{height:"60vh",border:0}}),dy(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}),!Cp(t)&&!FE(t)&&!dy(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:p,className:"nb-btn nb-btn-primary inline-flex",children:i("chat.attachment.download")})]})]})]})})}function bq({onCancel:e,onCreate:t}){var N;const n=Pe(),[i,a]=j.useState(""),[l,o]=j.useState(""),[d,f]=j.useState(""),[p,g]=j.useState(!1),[m,y]=j.useState(!1),[b,k]=j.useState(!1),v=Ve({queryKey:["providers"],queryFn:px}),S=Ve({queryKey:["system-agents"],queryFn:Yb}),E=N2(((N=v.data)==null?void 0:N.anthropic)??[]);j.useEffect(()=>{var M;if(p)return;const _=(M=S.data)==null?void 0:M.agents.worker;if(!_)return;const T=`${_.providerId||"official"}::${_.model}`;E.some(O=>`${O.providerId}::${O.model}`===T)&&f(T)},[S.data,E,p]),j.useEffect(()=>{if(b)return;const _=T=>{T.key==="Escape"&&(T.preventDefault(),e())};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[e,b]);const C=async()=>{if(!m){y(!0);try{const[_,T]=d?d.split("::"):[void 0,void 0];t({title:i.trim()||void 0,cwd:l.trim()||void 0,agentKind:"claude",model:T,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(gn,{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(i_,{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(yp,{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(hi,{size:14,strokeWidth:3}),n("chat.newSession.create")]})]})]})]}),b&&c.jsx(hx,{initialPath:l.trim()||void 0,onCancel:()=>k(!1),onSelect:_=>{o(_),k(!1)}})]})}function xq({msg:e,sessionId:t,onPreviewAttachment:n}){const i=Pe(),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:uC(e.ts,i)})]}),c.jsx("div",{className:"flex flex-col gap-2",children:o.map((f,p)=>c.jsx(kq,{block:f},p))}),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(vq,{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 vq({sessionId:e,path:t,onPreview:n}){const i=Pe(),a=t.split(/[\\/]/).pop()??t;return Cp(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:Zy(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(Wu,{size:11,strokeWidth:2.5,className:"flex-shrink-0"}),c.jsx("span",{className:"truncate max-w-[200px]",children:a})]})}function wq({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(oC,{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(cC,{tool:n},i)})]})]})})}function kq({block:e}){return e.type==="text"?c.jsx(oC,{text:e.text}):c.jsx(cC,{tool:e})}function oC({text:e}){return e?c.jsx("div",{className:"text-sm font-[family-name:var(--font-body)] break-words prose-chat",children:c.jsx(Ox,{remarkPlugins:[zx],rehypePlugins:[$x],children:e})}):null}function Eq(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 cC({tool:e}){const[t,n]=j.useState(!1),i=e.status==="completed"||e.status==="complete",a=e.status==="failed",l=!i&&!a,o=Eq(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(Jo,{size:12,strokeWidth:3,className:["transition-transform flex-shrink-0",t?"rotate-90":""].join(" ")}),c.jsx(g_,{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(Su,{size:12,strokeWidth:2.5,className:"text-[var(--color-running)] flex-shrink-0"}),a&&c.jsx(e_,{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 uC(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 Nq(){return ct("/api/processes").then(e=>e.data)}function _q(e){return gr(`/api/processes/${e}/kill`)}function jq(){return ct("/api/processes/reclaim")}async function Cq(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 qE="nb-card";function Aq(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 fy(e){return e.project?e.project:e.cwd?e.cwd.split("/").filter(Boolean).pop()??e.slot:e.slot}function HE(e){const t=/^session-chat-(.+)$/.exec(e.slot);return(t==null?void 0:t[1])??null}function Tq({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 Mq(){var k;const e=Pe(),t=Ft(),[n,i]=j.useState(null),[a,l]=j.useState("all"),o=Ve({queryKey:["processes"],queryFn:Nq,refetchInterval:5e3}),d=Et({mutationFn:_q,onSuccess:v=>{i(v.message),t.invalidateQueries({queryKey:["processes"]})},onError:v=>i(v instanceof Error?v.message:String(v))}),f=Ve({queryKey:["reclaim"],queryFn:jq}),[p,g]=j.useState("");j.useEffect(()=>{f.data&&p===""&&g(String(f.data.idleMinutes))},[f.data,p]);const m=Et({mutationFn:v=>Cq(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(gp,{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:`${qE} px-4 py-3 mb-4 flex flex-wrap items-center gap-2`,children:[c.jsx(T3,{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:p,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||p===""||Number(p)===((k=f.data)==null?void 0:k.idleMinutes),onClick:()=>m.mutate(Math.round(Number(p))),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(mr,{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:`${qE} 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"&&HE(v)?c.jsxs(vs,{to:`/chat/${HE(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(a_,{size:12,strokeWidth:2.5})," ",fy(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(gp,{size:12,strokeWidth:2.5})," ",fy(v)]}):c.jsx("span",{children:fy(v)})}),c.jsx("td",{className:"px-3 py-2",children:v.pid??"—"}),c.jsx("td",{className:"px-3 py-2",children:c.jsx(Tq,{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:Aq(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(e_,{size:13})," ",e("processes.kill")]}):c.jsx("span",{className:"text-[var(--color-text)]/40 text-xs",children:"—"})})]},v.slot))]})]})})]})}function Dq(e={}){const t=new URLSearchParams;e.project&&t.set("project",e.project),e.action&&t.set("action",e.action);const n=t.toString();return ct(`/api/audit${n?`?${n}`:""}`).then(i=>i.data)}const Oq="nb-card",Rq={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 Lq(){const e=Pe(),t=Ft(),[n,i]=j.useState(""),a=Ve({queryKey:["audit",n],queryFn:()=>Dq(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(qb,{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:`${Oq} 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 ${Rq[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 Iq=["convention","decision","gotcha","pattern","reference","note"],zq=["local","local+external","external","none"];function Fx(e){return e!=null&&typeof e=="object"?e:{}}function No(e){return Array.isArray(e)?e:[]}function Pq(e){switch(e){case"none":return"none";case"agentmemory":case"custom":return"external";case"builtin":default:return"local"}}function KE(e){const t=Fx(e);return{mode:typeof t.mode=="string"&&t.mode?t.mode:Pq(t.provider),externalUrl:typeof t.externalUrl=="string"?t.externalUrl:typeof t.url=="string"?t.url:"",modeOptions:No(t.modeOptions).length>0?No(t.modeOptions):zq}}function Bq(e){const t=Fx(e),n=t.scope==="global"||t.scope==="project"||t.scope==="agent"?t.scope:null;return n?{scope:n,project:typeof t.project=="string"?t.project:void 0,agentId:typeof t.agentId=="string"?t.agentId:void 0,count:typeof t.count=="number"?t.count:0,updated:typeof t.updated=="string"?t.updated:""}:null}function $q(e){const t=Fx(e);if(typeof t.id!="string")return null;const n=t.scope==="global"||t.scope==="project"||t.scope==="agent"?t.scope:"global";return{id:t.id,title:typeof t.title=="string"?t.title:t.id,scope:n,category:typeof t.category=="string"?t.category:"note",tags:No(t.tags),salience:typeof t.salience=="number"?t.salience:3,source:typeof t.source=="string"?t.source:"human",project:typeof t.project=="string"?t.project:void 0,agentId:typeof t.agentId=="string"?t.agentId:void 0,created:typeof t.created=="string"?t.created:"",updated:typeof t.updated=="string"?t.updated:"",body:typeof t.body=="string"?t.body:""}}function is(e){return`${e.scope}:${e.project??e.agentId??""}`}function Uf(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 Nr(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 Uq=()=>({title:"",body:"",category:"note",tags:"",salience:3});function Fq(){var se,ve,ue;const e=Pe(),[t,n]=j.useState([]),[i,a]=j.useState(null),[l,o]=j.useState(!1),[d,f]=j.useState([]),[p,g]=j.useState(null),[m,y]=j.useState(!1),[b,k]=j.useState(""),[v,S]=j.useState(!0),[E,C]=j.useState([]),[N,_]=j.useState(null),[T,M]=j.useState(null),[O,R]=j.useState(null),[B,U]=j.useState(null),[K,q]=j.useState(""),[Y,D]=j.useState(""),F=j.useCallback(async()=>{try{const{scopes:J}=await Nr("/api/memory/scopes"),we=No(J).map(Bq).filter(re=>re!=null);n(we),a(re=>re??we[0]??null)}catch(J){g(J instanceof Error?J.message:String(J))}},[]),I=j.useCallback(async J=>{try{const we=new URLSearchParams(Vs(J)).toString(),{data:re}=await Nr(`/api/memory/entries?${we}`);f(No(re).map($q).filter(Ce=>Ce!=null))}catch(we){g(we instanceof Error?we.message:String(we))}},[]);j.useEffect(()=>{F(),Nr("/api/system/memory").then(J=>{const we=KE(J);U(we),q(we.mode),D(we.externalUrl)}).catch(()=>{})},[F]),j.useEffect(()=>{i&&I(i),(i==null?void 0:i.scope)==="project"&&i.project?Nr(`/api/memory/external?project=${encodeURIComponent(i.project)}`).then(J=>R(J)).catch(()=>R(null)):R(null)},[i,I]);const H=j.useCallback(async()=>{if(!b.trim()){C([]);return}y(!0),g(null);try{const J=new URLSearchParams({q:b,limit:"20"});if(v)J.set("all","1");else if(i)for(const[re,Ce]of Object.entries(Vs(i)))J.set(re,Ce);const{results:we}=await Nr(`/api/memory/recall?${J.toString()}`);C(No(we))}catch(J){g(J instanceof Error?J.message:String(J))}finally{y(!1)}},[b,v,i]),W=j.useCallback(async()=>{if(!(!i||!N)){y(!0),g(null);try{await Nr("/api/memory/entries",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({...Vs(i),id:N.id,title:N.title,body:N.body,category:N.category,tags:N.tags.split(",").map(J=>J.trim()).filter(Boolean),salience:N.salience})}),_(null),await Promise.all([I(i),F()])}catch(J){g(J instanceof Error?J.message:String(J))}finally{y(!1)}}},[i,N,I,F]),G=j.useCallback(async J=>{if(i){y(!0),g(null);try{const we=new URLSearchParams(Vs(i)).toString();await Nr(`/api/memory/entries/${encodeURIComponent(J)}?${we}`,{method:"DELETE"}),await Promise.all([I(i),F()])}catch(we){g(we instanceof Error?we.message:String(we))}finally{y(!1)}}},[i,I,F]),L=j.useCallback(async(J,we,re)=>{if(i){y(!0),g(null);try{await Nr("/api/memory/promote",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({from:Vs(i),id:J.id,to:Vs(we),move:re})}),M(null),await Promise.all([I(i),F()])}catch(Ce){g(Ce instanceof Error?Ce.message:String(Ce))}finally{y(!1)}}},[i,I,F]),z=j.useCallback(async()=>{if(i){y(!0),g(null);try{const we=(await Nr("/api/memory/gc",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(Vs(i))})).results[0];we&&g(`收敛完成:清 tombstone ${we.purged}、去重 ${we.deduped}、剩余 ${we.kept}`),await Promise.all([I(i),F()])}catch(J){g(J instanceof Error?J.message:String(J))}finally{y(!1)}}},[i,I,F]),V=j.useCallback(async()=>{y(!0),g(null);try{const J=KE(await Nr("/api/system/memory",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({mode:K,externalUrl:Y})}));U(J),q(J.mode),D(J.externalUrl),g("模式已保存(重启 worker 生效)")}catch(J){g(J instanceof Error?J.message:String(J))}finally{y(!1)}},[K,Y]),P=B!=null&&(K!==B.mode||Y!==B.externalUrl),le=K==="external"||K==="local+external",xe=j.useMemo(()=>T?t.filter(J=>is(J)!==is(i??{scope:""})):[],[T,t,i]),ke=Array.isArray((se=O==null?void 0:O.profile)==null?void 0:se.topConcepts)?O.profile.topConcepts:[],Ne=Array.isArray((ve=O==null?void 0:O.graph)==null?void 0:ve.edges)?O.graph.edges.length:0;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 真源"})]}),B&&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:K,onChange:J=>q(J.target.value),"aria-label":"记忆模式",children:B.modeOptions.map(J=>c.jsx("option",{value:J,children:J},J))})]}),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:J=>D(J.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||!P,"aria-label":"保存模式",children:"保存模式"})]}),c.jsxs("div",{className:"flex gap-2 flex-wrap items-center",children:[c.jsx("input",{value:b,onChange:J=>k(J.target.value),onKeyDown:J=>J.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:J=>S(J.target.checked),"aria-label":"全局检索"}),"全局"]}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-mint",onClick:H,disabled:m,"aria-label":"检索",children:m?"…":"检索"})]}),p&&c.jsxs("div",{className:"text-sm text-[var(--color-text)] font-semibold nb-card py-2",children:["ℹ ",p]}),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(J=>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:J.source==="external"?"🌐 外部":"📁 本地"}),c.jsx("span",{children:J.source==="external"?J.type??"":J.scope==="project"?`项目:${J.project}`:J.scope}),J.category&&c.jsxs(c.Fragment,{children:[c.jsx("span",{children:"·"}),c.jsx("span",{children:J.category})]})]}),c.jsx("div",{className:"font-bold text-sm mt-1",children:J.title}),c.jsx("div",{className:"text-sm mt-1 whitespace-pre-wrap opacity-80",children:J.snippet.slice(0,300)})]},J.id))]}),(()=>{const J=new Date(Date.now()-6048e5).toISOString(),we=i?is(i):"",re=l?t:t.filter(Me=>Me.scope!=="project"||Me.updated>=J||is(Me)===we),Ce=t.length-re.length;return c.jsxs("div",{className:"flex gap-2 flex-wrap items-center",children:[c.jsx("select",{className:"nb-input",value:we,onChange:Me=>a(t.find(_e=>is(_e)===Me.target.value)??null),"aria-label":"选择作用域",children:re.map(Me=>c.jsx("option",{value:is(Me),children:Uf(Me)},is(Me)))}),(Ce>0||l)&&c.jsx("button",{type:"button",className:"nb-btn text-xs",onClick:()=>o(Me=>!Me),"aria-label":l?"收起更早项目":"显示更早项目",children:l?"收起更早":`含更早 (${Ce})`}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-blue",onClick:()=>_(Uq()),disabled:!i,"aria-label":"新建记忆",children:"+ 新建"}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-yellow",onClick:z,disabled:m||!i,"aria-label":"收敛去重",children:"收敛"})]})})(),O&&(ke.length||Ne)?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)"}),ke.length?c.jsxs("div",{className:"text-xs",children:[c.jsx("span",{className:"font-bold",children:"概念:"}),ke.slice(0,8).map(J=>c.jsx("span",{className:"nb-badge ml-1",children:J.concept},J.concept))]}):null,c.jsxs("div",{className:"text-xs opacity-70 font-[family-name:var(--font-mono)]",children:["知识图谱 ",Ne," 条边 · 观测 ",((ue=O.profile)==null?void 0:ue.totalObservations)??0]})]}):null,N&&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:N.id?"编辑记忆":"新建记忆"}),c.jsx("input",{className:"nb-input text-sm",value:N.title,onChange:J=>_({...N,title:J.target.value}),placeholder:"标题","aria-label":"标题"}),c.jsxs("div",{className:"flex gap-2 flex-wrap",children:[c.jsx("select",{className:"nb-input",value:N.category,onChange:J=>_({...N,category:J.target.value}),"aria-label":"类别",children:Iq.map(J=>c.jsx("option",{value:J,children:J},J))}),c.jsx("input",{className:"nb-input flex-1 min-w-[160px] text-sm",value:N.tags,onChange:J=>_({...N,tags:J.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:N.salience,onChange:J=>_({...N,salience:Number(J.target.value)}),"aria-label":"显著度"})]})]}),c.jsx("textarea",{className:"nb-input font-[family-name:var(--font-mono)] text-sm min-h-[120px]",value:N.body,onChange:J=>_({...N,body:J.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:W,disabled:m||!N.title.trim()||!N.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?Uf(i):"条目"}),d.length===0&&c.jsx("div",{className:"nb-card text-sm opacity-60",children:"(无记忆)"}),d.map(J=>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:J.category}),c.jsxs("span",{children:["s",J.salience]}),c.jsx("span",{children:"·"}),c.jsx("span",{children:J.source}),J.tags.map(we=>c.jsxs("span",{children:["#",we]},we))]}),c.jsx("div",{className:"font-bold text-sm mt-1",children:J.title}),c.jsx("div",{className:"text-sm mt-1 whitespace-pre-wrap opacity-80",children:J.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:J.id,title:J.title,body:J.body,category:J.category,tags:J.tags.join(", "),salience:J.salience}),"aria-label":"编辑",children:"编辑"}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-purple text-xs",onClick:()=>M(J),"aria-label":"提升",children:"提升"}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-danger text-xs",onClick:()=>G(J.id),"aria-label":"删除",children:"删除"})]}),(T==null?void 0:T.id)===J.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:"提升到:"}),xe.map(we=>c.jsx("button",{type:"button",className:"nb-btn nb-btn-mint text-xs",onClick:()=>L(J,we,!1),"aria-label":`复制到${Uf(we)}`,children:Uf(we)},is(we))),xe.length===0&&c.jsx("span",{className:"text-xs opacity-60",children:"(无其它作用域)"}),c.jsx("button",{type:"button",className:"nb-btn text-xs",onClick:()=>M(null),"aria-label":"取消提升",children:"取消"})]})]},J.id))]})]})}async function qq(){return(await ct("/api/channels")).data??{console:{},adapters:[]}}async function Hq(e){return(await Vb("/api/channels",e)).data}async function Kq(){return(await ct("/api/codex-proxy")).data}async function Gq(){return(await gr("/api/codex-proxy/install")).data}async function Vq(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 Yq(){return(await gr("/api/codex-proxy/auth/start")).data}async function Wq(){await gr("/api/codex-proxy/auth/cancel")}const GE=[{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 Qq(){const e=Pe(),[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:GE.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(Zq,{}):t==="channel"?c.jsx(rH,{}):t==="model"?c.jsx(Jq,{}):c.jsx(Xq,{label:e(GE.find(i=>i.key===t).labelKey)})})]})}function Xq({label:e}){const t=Pe();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 Zq(){var k,v,S;const e=Pe(),t=Ft(),{alert:n}=un(),i=Ve({queryKey:["system-memory"],queryFn:iI}),[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",p=o??((v=i.data)==null?void 0:v.url)??"",g=i.data!=null&&(f!==i.data.provider||f==="custom"&&p!==i.data.url),m=E=>{const C=`system.memory.opt.${E}`;return e(C)},y=Et({mutationFn:()=>rI(f,f==="custom"?p:""),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=((S=i.data)==null?void 0:S.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:p,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(mr,{size:12,strokeWidth:3}),y.isSuccess&&!g?e("system.memory.saved"):e("system.memory.save")]})})]})]})}function Jq(){var S,E,C;const e=Ft(),{alert:t,confirm:n}=un(),i=Ve({queryKey:["providers"],queryFn:px}),l=(S=Ve({queryKey:["system-agents"],queryFn:Yb}).data)==null?void 0:S.agents,[o,d]=j.useState(null),f=Et({mutationFn:()=>A4(o.kind,o.entry),onSuccess:()=>{d(null),e.invalidateQueries({queryKey:["providers"]})},onError:N=>void t({title:"保存失败",body:N instanceof Error?N.message:String(N)})}),p=Et({mutationFn:N=>T4(N.kind,N.id),onSuccess:()=>void e.invalidateQueries({queryKey:["providers"]}),onError:N=>void t({title:"删除失败",body:N instanceof Error?N.message:String(N)})}),g=Et({mutationFn:N=>aI(N),onSuccess:()=>void e.invalidateQueries({queryKey:["system-agents"]}),onError:N=>void t({title:"设默认失败",body:N instanceof Error?N.message:String(N)})}),m=(N,_,T)=>{if(!l)return!1;const M=N==="anthropic"?l.worker:l.reviewer;return(M.providerId||"official")===_&&M.model===T},y=(N,_,T)=>{if(!l)return;let M;if(N==="anthropic"){const O={...l.worker,model:T};_==="official"?delete O.providerId:O.providerId=_,M={...l,worker:O}}else M={...l,reviewer:{...l.reviewer,providerId:_,model:T}};g.mutate(M)},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=N=>d({kind:N,isNew:!0,entry:{id:"",name:"",baseUrl:"",apiKey:"",models:[]}}),v=(N,_)=>d({kind:N,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(N=>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:N.title}),c.jsxs("button",{className:"nb-btn",style:{padding:"4px 10px",fontSize:12},type:"button",onClick:()=>k(N.kind),"aria-label":`添加 ${N.title} 端点`,children:[c.jsx(hi,{size:12,strokeWidth:3})," 添加"]})]}),N.items.length===0&&c.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:"(无端点)"}),N.items.map(_=>_.id==="codex-proxy"?c.jsx(tH,{isDefault:T=>m(N.kind,_.id,T),pickDefault:T=>y(N.kind,_.id,T),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(N.kind,_),"aria-label":`编辑 ${_.id}`,children:c.jsx(o_,{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})&&p.mutate({kind:N.kind,id:_.id})},"aria-label":`删除 ${_.id}`,children:c.jsx(Vi,{size:12,strokeWidth:3})})]})]}),_.models.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:_.models.map(T=>{const M=m(N.kind,_.id,T);return c.jsxs("button",{type:"button",onClick:()=>y(N.kind,_.id,T),disabled:g.isPending,"aria-pressed":M,className:["px-2 py-0.5 rounded-md text-xs font-[family-name:var(--font-mono)] border-2 border-[var(--color-text)]",M?"bg-[var(--color-accent-mint)] font-bold":" hover:bg-[var(--color-bg-cream)]"].join(" "),title:M?"当前默认":"设为默认",children:[T,M?" ✓":""]},T)})})]},_.id))]},N.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:N=>N.stopPropagation(),children:c.jsx(eH,{state:o,onChange:N=>d({...o,entry:N}),onCancel:()=>d(null),onSave:()=>f.mutate(),saving:f.isPending})})})]})}function eH({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(p=>p.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(mr,{size:14,strokeWidth:3})," 保存"]})]})]})}function tH({isDefault:e,pickDefault:t,setDefaultPending:n}){const i=Ft(),{alert:a,confirm:l}=un(),[o,d]=j.useState(!1),[f,p]=j.useState(null),[g,m]=j.useState(!1),[y,b]=j.useState(!1),[k,v]=j.useState(!1),E=Ve({queryKey:["codex-proxy"],queryFn:Kq,refetchInterval:o?3e3:!1}).data;j.useEffect(()=>{o&&(E!=null&&E.authed)&&(d(!1),p(null),i.invalidateQueries({queryKey:["codex-proxy"]}))},[o,E==null?void 0:E.authed,i]);const C=Et({mutationFn:Gq,onSuccess:B=>{i.invalidateQueries({queryKey:["codex-proxy"]}),i.invalidateQueries({queryKey:["providers"]}),B.ok||a({title:"安装失败",body:(B.output||"未知错误").slice(-600)})},onError:B=>void a({title:"安装失败",body:B instanceof Error?B.message:String(B)})}),N=Et({mutationFn:B=>Vq(B),onSuccess:B=>{m(!1),b(!1),i.invalidateQueries({queryKey:["codex-proxy"]}),i.invalidateQueries({queryKey:["providers"]}),i.invalidateQueries({queryKey:["system-agents"]}),B.ok||a({title:"卸载未完成",body:B.note??"删除失败(可能需 sudo)"})},onError:B=>void a({title:"卸载失败",body:B instanceof Error?B.message:String(B)})}),_=async()=>{await l({title:"安装 claude-code-proxy",body:"将运行官方安装脚本(curl … install.sh | bash),下载预编译二进制到 ~/.local/bin。继续?"})&&C.mutate()},T=async()=>{d(!0),p(null);try{const B=await Yq();p(B)}catch(B){d(!1),a({title:"订阅失败",body:B instanceof Error?B.message:String(B)})}},M=()=>{Wq(),d(!1),p(null)},O=C.isPending||(E==null?void 0:E.installing),R=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(Vi,{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:[R.map(B=>{const U=e(B);return c.jsxs("button",{type:"button",onClick:()=>t(B),disabled:n,"aria-pressed":U,className:["px-2 py-0.5 rounded-md text-xs font-[family-name:var(--font-mono)] border-2 border-[var(--color-text)]",U?"bg-[var(--color-accent-mint)] font-bold":" hover:bg-[var(--color-bg-cream)]"].join(" "),title:U?"当前默认":"设为 worker 默认",children:[B,U?" ✓":""]},B)}),E.models.all.length>E.models.curated.length&&c.jsx("button",{type:"button",className:"text-xs text-[var(--color-text-muted)] underline",onClick:()=>v(B=>!B),children:k?"收起":`显示全部(${E.models.all.length})`})]}):c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"4px 12px",fontSize:12},type:"button",onClick:T,children:[c.jsx($L,{size:12,strokeWidth:3})," 订阅(授权 ChatGPT)"]}):c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"4px 12px",fontSize:12},type:"button",disabled:!!O,onClick:_,children:[O?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(Hp,{size:12,strokeWidth:3}),O?" 安装中…":" 安装插件"]}):c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin text-[var(--color-text-muted)]"})}),o&&c.jsxs(VE,{onClose:M,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(uL,{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:M,children:"取消"})})]}),g&&c.jsxs(VE,{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=>b(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:N.isPending,onClick:()=>N.mutate(y),children:[N.isPending?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(Vi,{size:14,strokeWidth:3})," 卸载"]})]})]})]})}function VE({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 nH=["telegram","dingtalk","matrix","slack","discord","feishu"],yu={telegram:"Telegram",dingtalk:"钉钉 (Stream)",matrix:"Matrix",slack:"Slack",discord:"Discord",feishu:"飞书 / Lark"},iH={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 rH(){var k,v,S;const e=Ft(),{alert:t}=un(),n=Ve({queryKey:["channels"],queryFn:qq}),[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=Et({mutationFn:()=>Hq(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??[],p=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((N,_)=>_!==E);a({...i,adapters:C}),o({type:"console"})},y=(E,C)=>{const N=f.map((_,T)=>T===E?{..._,...C}:_);a({...i,adapters:N})},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:!p||d.isPending,onClick:()=>d.mutate(),"aria-label":"保存频道配置",children:[d.isPending?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(mr,{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(YE,{label:"console 桥接",sub:((S=i.console)==null?void 0:S.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(YE,{label:yu[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:nH.map(E=>c.jsxs("button",{className:"nb-btn",style:{padding:"4px 8px",fontSize:12},type:"button",onClick:()=>g(E),"aria-label":`添加 ${yu[E]} 频道`,children:[c.jsx(hi,{size:11,strokeWidth:3})," ",yu[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(WE,{console:i.console??{},onChange:b});const E=f[l.index];if(!E)return c.jsx(WE,{console:i.console??{},onChange:b});const C=l.index;return c.jsx(aH,{adapter:E,onChange:N=>y(C,N),onRemove:()=>m(C)})})()})]})]})}function YE({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)]":"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 WE({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 aH({adapter:e,onChange:t,onRemove:n}){const{confirm:i}=un(),a=iH[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:yu[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:`删除 ${yu[e.kind]??e.kind} 频道?`,danger:!0})&&n()},"aria-label":"删除频道",children:[c.jsx(Vi,{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(sH,{spec:o,value:e[o.key],onChange:d=>t({[o.key]:d})},o.key))]})}function sH({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 _n(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=_n(e[n]))!==""&&(t+=(t&&" ")+i);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var lH={value:()=>{}};function dh(){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 sp(n)}function sp(e){this._=e}function oH(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}})}sp.prototype=dh.prototype={constructor:sp,on:function(e,t){var n=this._,i=oH(e+"",n),a,l=-1,o=i.length;if(arguments.length<2){for(;++l<o;)if((a=(e=i[l]).type)&&(a=cH(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]=QE(n[a],e.name,t);else if(t==null)for(a in n)n[a]=QE(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 sp(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 cH(e,t){for(var n=0,i=e.length,a;n<i;++n)if((a=e[n]).name===t)return a.value}function QE(e,t,n){for(var i=0,a=e.length;i<a;++i)if(e[i].name===t){e[i]=lH,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}var fb="http://www.w3.org/1999/xhtml";const XE={svg:"http://www.w3.org/2000/svg",xhtml:fb,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function fh(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),XE.hasOwnProperty(t)?{space:XE[t],local:e}:e}function uH(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===fb&&t.documentElement.namespaceURI===fb?t.createElement(e):t.createElementNS(n,e)}}function dH(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function dC(e){var t=fh(e);return(t.local?dH:uH)(t)}function fH(){}function qx(e){return e==null?fH:function(){return this.querySelector(e)}}function pH(e){typeof e!="function"&&(e=qx(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,p,g=0;g<o;++g)(f=l[g])&&(p=e.call(f,f.__data__,g,l))&&("__data__"in f&&(p.__data__=f.__data__),d[g]=p);return new Ci(i,this._parents)}function hH(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function mH(){return[]}function fC(e){return e==null?mH:function(){return this.querySelectorAll(e)}}function gH(e){return function(){return hH(e.apply(this,arguments))}}function yH(e){typeof e=="function"?e=gH(e):e=fC(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,p=0;p<d;++p)(f=o[p])&&(i.push(e.call(f,f.__data__,p,o)),a.push(f));return new Ci(i,a)}function pC(e){return function(){return this.matches(e)}}function hC(e){return function(t){return t.matches(e)}}var bH=Array.prototype.find;function xH(e){return function(){return bH.call(this.children,e)}}function vH(){return this.firstElementChild}function wH(e){return this.select(e==null?vH:xH(typeof e=="function"?e:hC(e)))}var kH=Array.prototype.filter;function EH(){return Array.from(this.children)}function SH(e){return function(){return kH.call(this.children,e)}}function NH(e){return this.selectAll(e==null?EH:SH(typeof e=="function"?e:hC(e)))}function _H(e){typeof e!="function"&&(e=pC(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,p=0;p<o;++p)(f=l[p])&&e.call(f,f.__data__,p,l)&&d.push(f);return new Ci(i,this._parents)}function mC(e){return new Array(e.length)}function jH(){return new Ci(this._enter||this._groups.map(mC),this._parents)}function Ap(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ap.prototype={constructor:Ap,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 CH(e){return function(){return e}}function AH(e,t,n,i,a,l){for(var o=0,d,f=t.length,p=l.length;o<p;++o)(d=t[o])?(d.__data__=l[o],i[o]=d):n[o]=new Ap(e,l[o]);for(;o<f;++o)(d=t[o])&&(a[o]=d)}function TH(e,t,n,i,a,l,o){var d,f,p=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)+"",p.has(b)?a[d]=f:p.set(b,f));for(d=0;d<m;++d)b=o.call(e,l[d],d,l)+"",(f=p.get(b))?(i[d]=f,f.__data__=l[d],p.delete(b)):n[d]=new Ap(e,l[d]);for(d=0;d<g;++d)(f=t[d])&&p.get(y[d])===f&&(a[d]=f)}function MH(e){return e.__data__}function DH(e,t){if(!arguments.length)return Array.from(this,MH);var n=t?TH:AH,i=this._parents,a=this._groups;typeof e!="function"&&(e=CH(e));for(var l=a.length,o=new Array(l),d=new Array(l),f=new Array(l),p=0;p<l;++p){var g=i[p],m=a[p],y=m.length,b=OH(e.call(g,g&&g.__data__,p,i)),k=b.length,v=d[p]=new Array(k),S=o[p]=new Array(k),E=f[p]=new Array(y);n(g,m,v,S,E,b,t);for(var C=0,N=0,_,T;C<k;++C)if(_=v[C]){for(C>=N&&(N=C+1);!(T=S[N])&&++N<k;);_._next=T||null}}return o=new Ci(o,i),o._enter=d,o._exit=f,o}function OH(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function RH(){return new Ci(this._exit||this._groups.map(mC),this._parents)}function LH(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 IH(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 p=n[f],g=i[f],m=p.length,y=d[f]=new Array(m),b,k=0;k<m;++k)(b=p[k]||g[k])&&(y[k]=b);for(;f<a;++f)d[f]=n[f];return new Ci(d,this._parents)}function zH(){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 PH(e){e||(e=BH);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),p,g=0;g<d;++g)(p=o[g])&&(f[g]=p);f.sort(t)}return new Ci(a,this._parents).order()}function BH(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function $H(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function UH(){return Array.from(this)}function FH(){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 qH(){let e=0;for(const t of this)++e;return e}function HH(){return!this.node()}function KH(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 GH(e){return function(){this.removeAttribute(e)}}function VH(e){return function(){this.removeAttributeNS(e.space,e.local)}}function YH(e,t){return function(){this.setAttribute(e,t)}}function WH(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function QH(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function XH(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 ZH(e,t){var n=fh(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?VH:GH:typeof t=="function"?n.local?XH:QH:n.local?WH:YH)(n,t))}function gC(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function JH(e){return function(){this.style.removeProperty(e)}}function e7(e,t,n){return function(){this.style.setProperty(e,t,n)}}function t7(e,t,n){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,n)}}function n7(e,t,n){return arguments.length>1?this.each((t==null?JH:typeof t=="function"?t7:e7)(e,t,n??"")):qo(this.node(),e)}function qo(e,t){return e.style.getPropertyValue(t)||gC(e).getComputedStyle(e,null).getPropertyValue(t)}function i7(e){return function(){delete this[e]}}function r7(e,t){return function(){this[e]=t}}function a7(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function s7(e,t){return arguments.length>1?this.each((t==null?i7:typeof t=="function"?a7:r7)(e,t)):this.node()[e]}function yC(e){return e.trim().split(/^|\s+/)}function Hx(e){return e.classList||new bC(e)}function bC(e){this._node=e,this._names=yC(e.getAttribute("class")||"")}bC.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 xC(e,t){for(var n=Hx(e),i=-1,a=t.length;++i<a;)n.add(t[i])}function vC(e,t){for(var n=Hx(e),i=-1,a=t.length;++i<a;)n.remove(t[i])}function l7(e){return function(){xC(this,e)}}function o7(e){return function(){vC(this,e)}}function c7(e,t){return function(){(t.apply(this,arguments)?xC:vC)(this,e)}}function u7(e,t){var n=yC(e+"");if(arguments.length<2){for(var i=Hx(this.node()),a=-1,l=n.length;++a<l;)if(!i.contains(n[a]))return!1;return!0}return this.each((typeof t=="function"?c7:t?l7:o7)(n,t))}function d7(){this.textContent=""}function f7(e){return function(){this.textContent=e}}function p7(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function h7(e){return arguments.length?this.each(e==null?d7:(typeof e=="function"?p7:f7)(e)):this.node().textContent}function m7(){this.innerHTML=""}function g7(e){return function(){this.innerHTML=e}}function y7(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function b7(e){return arguments.length?this.each(e==null?m7:(typeof e=="function"?y7:g7)(e)):this.node().innerHTML}function x7(){this.nextSibling&&this.parentNode.appendChild(this)}function v7(){return this.each(x7)}function w7(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function k7(){return this.each(w7)}function E7(e){var t=typeof e=="function"?e:dC(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function S7(){return null}function N7(e,t){var n=typeof e=="function"?e:dC(e),i=t==null?S7:typeof t=="function"?t:qx(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function _7(){var e=this.parentNode;e&&e.removeChild(this)}function j7(){return this.each(_7)}function C7(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function A7(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function T7(e){return this.select(e?A7:C7)}function M7(e){return arguments.length?this.property("__data__",e):this.node().__data__}function D7(e){return function(t){e.call(this,t,this.__data__)}}function O7(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 R7(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 L7(e,t,n){return function(){var i=this.__on,a,l=D7(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 I7(e,t,n){var i=O7(e+""),a,l=i.length,o;if(arguments.length<2){var d=this.node().__on;if(d){for(var f=0,p=d.length,g;f<p;++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?L7:R7,a=0;a<l;++a)this.each(d(i[a],t,n));return this}function wC(e,t,n){var i=gC(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 z7(e,t){return function(){return wC(this,e,t)}}function P7(e,t){return function(){return wC(this,e,t.apply(this,arguments))}}function B7(e,t){return this.each((typeof t=="function"?P7:z7)(e,t))}function*$7(){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 kC=[null];function Ci(e,t){this._groups=e,this._parents=t}function rd(){return new Ci([[document.documentElement]],kC)}function U7(){return this}Ci.prototype=rd.prototype={constructor:Ci,select:pH,selectAll:yH,selectChild:wH,selectChildren:NH,filter:_H,data:DH,enter:jH,exit:RH,join:LH,merge:IH,selection:U7,order:zH,sort:PH,call:$H,nodes:UH,node:FH,size:qH,empty:HH,each:KH,attr:ZH,style:n7,property:s7,classed:u7,text:h7,html:b7,raise:v7,lower:k7,append:E7,insert:N7,remove:j7,clone:T7,datum:M7,on:I7,dispatch:B7,[Symbol.iterator]:$7};function _i(e){return typeof e=="string"?new Ci([[document.querySelector(e)]],[document.documentElement]):new Ci([[e]],kC)}function F7(e){let t;for(;t=e.sourceEvent;)e=t;return e}function lr(e,t){if(e=F7(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 q7={passive:!1},Tu={capture:!0,passive:!1};function py(e){e.stopImmediatePropagation()}function _o(e){e.preventDefault(),e.stopImmediatePropagation()}function EC(e){var t=e.document.documentElement,n=_i(e).on("dragstart.drag",_o,Tu);"onselectstart"in t?n.on("selectstart.drag",_o,Tu):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function SC(e,t){var n=e.document.documentElement,i=_i(e).on("dragstart.drag",null);t&&(i.on("click.drag",_o,Tu),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 Ff=e=>()=>e;function pb(e,{sourceEvent:t,subject:n,target:i,identifier:a,active:l,x:o,y:d,dx:f,dy:p,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:p,enumerable:!0,configurable:!0},_:{value:g}})}pb.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function H7(e){return!e.ctrlKey&&!e.button}function K7(){return this.parentNode}function G7(e,t){return t??{x:e.x,y:e.y}}function V7(){return navigator.maxTouchPoints||"ontouchstart"in this}function NC(){var e=H7,t=K7,n=G7,i=V7,a={},l=dh("start","drag","end"),o=0,d,f,p,g,m=0;function y(_){_.on("mousedown.drag",b).filter(i).on("touchstart.drag",S).on("touchmove.drag",E,q7).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(_,T){if(!(g||!e.call(this,_,T))){var M=N(this,t.call(this,_,T),_,T,"mouse");M&&(_i(_.view).on("mousemove.drag",k,Tu).on("mouseup.drag",v,Tu),EC(_.view),py(_),p=!1,d=_.clientX,f=_.clientY,M("start",_))}}function k(_){if(_o(_),!p){var T=_.clientX-d,M=_.clientY-f;p=T*T+M*M>m}a.mouse("drag",_)}function v(_){_i(_.view).on("mousemove.drag mouseup.drag",null),SC(_.view,p),_o(_),a.mouse("end",_)}function S(_,T){if(e.call(this,_,T)){var M=_.changedTouches,O=t.call(this,_,T),R=M.length,B,U;for(B=0;B<R;++B)(U=N(this,O,_,T,M[B].identifier,M[B]))&&(py(_),U("start",_,M[B]))}}function E(_){var T=_.changedTouches,M=T.length,O,R;for(O=0;O<M;++O)(R=a[T[O].identifier])&&(_o(_),R("drag",_,T[O]))}function C(_){var T=_.changedTouches,M=T.length,O,R;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),O=0;O<M;++O)(R=a[T[O].identifier])&&(py(_),R("end",_,T[O]))}function N(_,T,M,O,R,B){var U=l.copy(),K=lr(B||M,T),q,Y,D;if((D=n.call(_,new pb("beforestart",{sourceEvent:M,target:y,identifier:R,active:o,x:K[0],y:K[1],dx:0,dy:0,dispatch:U}),O))!=null)return q=D.x-K[0]||0,Y=D.y-K[1]||0,function F(I,H,W){var G=K,L;switch(I){case"start":a[R]=F,L=o++;break;case"end":delete a[R],--o;case"drag":K=lr(W||H,T),L=o;break}U.call(I,_,new pb(I,{sourceEvent:H,subject:D,target:y,identifier:R,active:L,x:K[0]+q,y:K[1]+Y,dx:K[0]-G[0],dy:K[1]-G[1],dispatch:U}),O)}}return y.filter=function(_){return arguments.length?(e=typeof _=="function"?_:Ff(!!_),y):e},y.container=function(_){return arguments.length?(t=typeof _=="function"?_:Ff(_),y):t},y.subject=function(_){return arguments.length?(n=typeof _=="function"?_:Ff(_),y):n},y.touchable=function(_){return arguments.length?(i=typeof _=="function"?_:Ff(!!_),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 Kx(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function _C(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function ad(){}var Mu=.7,Tp=1/Mu,jo="\\s*([+-]?\\d+)\\s*",Du="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Rr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Y7=/^#([0-9a-f]{3,8})$/,W7=new RegExp(`^rgb\\(${jo},${jo},${jo}\\)$`),Q7=new RegExp(`^rgb\\(${Rr},${Rr},${Rr}\\)$`),X7=new RegExp(`^rgba\\(${jo},${jo},${jo},${Du}\\)$`),Z7=new RegExp(`^rgba\\(${Rr},${Rr},${Rr},${Du}\\)$`),J7=new RegExp(`^hsl\\(${Du},${Rr},${Rr}\\)$`),eK=new RegExp(`^hsla\\(${Du},${Rr},${Rr},${Du}\\)$`),ZE={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};Kx(ad,gl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:JE,formatHex:JE,formatHex8:tK,formatHsl:nK,formatRgb:eS,toString:eS});function JE(){return this.rgb().formatHex()}function tK(){return this.rgb().formatHex8()}function nK(){return jC(this).formatHsl()}function eS(){return this.rgb().formatRgb()}function gl(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Y7.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?tS(t):n===3?new pi(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?qf(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?qf(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=W7.exec(e))?new pi(t[1],t[2],t[3],1):(t=Q7.exec(e))?new pi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=X7.exec(e))?qf(t[1],t[2],t[3],t[4]):(t=Z7.exec(e))?qf(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=J7.exec(e))?rS(t[1],t[2]/100,t[3]/100,1):(t=eK.exec(e))?rS(t[1],t[2]/100,t[3]/100,t[4]):ZE.hasOwnProperty(e)?tS(ZE[e]):e==="transparent"?new pi(NaN,NaN,NaN,0):null}function tS(e){return new pi(e>>16&255,e>>8&255,e&255,1)}function qf(e,t,n,i){return i<=0&&(e=t=n=NaN),new pi(e,t,n,i)}function iK(e){return e instanceof ad||(e=gl(e)),e?(e=e.rgb(),new pi(e.r,e.g,e.b,e.opacity)):new pi}function hb(e,t,n,i){return arguments.length===1?iK(e):new pi(e,t,n,i??1)}function pi(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}Kx(pi,hb,_C(ad,{brighter(e){return e=e==null?Tp:Math.pow(Tp,e),new pi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Mu:Math.pow(Mu,e),new pi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new pi(cl(this.r),cl(this.g),cl(this.b),Mp(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:nS,formatHex:nS,formatHex8:rK,formatRgb:iS,toString:iS}));function nS(){return`#${Js(this.r)}${Js(this.g)}${Js(this.b)}`}function rK(){return`#${Js(this.r)}${Js(this.g)}${Js(this.b)}${Js((isNaN(this.opacity)?1:this.opacity)*255)}`}function iS(){const e=Mp(this.opacity);return`${e===1?"rgb(":"rgba("}${cl(this.r)}, ${cl(this.g)}, ${cl(this.b)}${e===1?")":`, ${e})`}`}function Mp(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 rS(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new or(e,t,n,i)}function jC(e){if(e instanceof or)return new or(e.h,e.s,e.l,e.opacity);if(e instanceof ad||(e=gl(e)),!e)return new or;if(e instanceof or)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 or(o,d,f,e.opacity)}function aK(e,t,n,i){return arguments.length===1?jC(e):new or(e,t,n,i??1)}function or(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}Kx(or,aK,_C(ad,{brighter(e){return e=e==null?Tp:Math.pow(Tp,e),new or(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Mu:Math.pow(Mu,e),new or(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 pi(hy(e>=240?e-240:e+120,a,i),hy(e,a,i),hy(e<120?e+240:e-120,a,i),this.opacity)},clamp(){return new or(aS(this.h),Hf(this.s),Hf(this.l),Mp(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=Mp(this.opacity);return`${e===1?"hsl(":"hsla("}${aS(this.h)}, ${Hf(this.s)*100}%, ${Hf(this.l)*100}%${e===1?")":`, ${e})`}`}}));function aS(e){return e=(e||0)%360,e<0?e+360:e}function Hf(e){return Math.max(0,Math.min(1,e||0))}function hy(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 Gx=e=>()=>e;function sK(e,t){return function(n){return e+n*t}}function lK(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 oK(e){return(e=+e)==1?CC:function(t,n){return n-t?lK(t,n,e):Gx(isNaN(t)?n:t)}}function CC(e,t){var n=t-e;return n?sK(e,n):Gx(isNaN(e)?t:e)}const Dp=(function e(t){var n=oK(t);function i(a,l){var o=n((a=hb(a)).r,(l=hb(l)).r),d=n(a.g,l.g),f=n(a.b,l.b),p=CC(a.opacity,l.opacity);return function(g){return a.r=o(g),a.g=d(g),a.b=f(g),a.opacity=p(g),a+""}}return i.gamma=e,i})(1);function cK(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 uK(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function dK(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]=bu(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 fK(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function Mr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function pK(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]=bu(e[a],t[a]):i[a]=t[a];return function(l){for(a in n)i[a]=n[a](l);return i}}var mb=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,my=new RegExp(mb.source,"g");function hK(e){return function(){return e}}function mK(e){return function(t){return e(t)+""}}function AC(e,t){var n=mb.lastIndex=my.lastIndex=0,i,a,l,o=-1,d=[],f=[];for(e=e+"",t=t+"";(i=mb.exec(e))&&(a=my.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:Mr(i,a)})),n=my.lastIndex;return n<t.length&&(l=t.slice(n),d[o]?d[o]+=l:d[++o]=l),d.length<2?f[0]?mK(f[0].x):hK(t):(t=f.length,function(p){for(var g=0,m;g<t;++g)d[(m=f[g]).i]=m.x(p);return d.join("")})}function bu(e,t){var n=typeof t,i;return t==null||n==="boolean"?Gx(t):(n==="number"?Mr:n==="string"?(i=gl(t))?(t=i,Dp):AC:t instanceof gl?Dp:t instanceof Date?fK:uK(t)?cK:Array.isArray(t)?dK:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?pK:Mr)(e,t)}var sS=180/Math.PI,gb={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function TC(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)*sS,skewX:Math.atan(f)*sS,scaleX:o,scaleY:d}}var Kf;function gK(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?gb:TC(t.a,t.b,t.c,t.d,t.e,t.f)}function yK(e){return e==null||(Kf||(Kf=document.createElementNS("http://www.w3.org/2000/svg","g")),Kf.setAttribute("transform",e),!(e=Kf.transform.baseVal.consolidate()))?gb:(e=e.matrix,TC(e.a,e.b,e.c,e.d,e.e,e.f))}function MC(e,t,n,i){function a(p){return p.length?p.pop()+" ":""}function l(p,g,m,y,b,k){if(p!==m||g!==y){var v=b.push("translate(",null,t,null,n);k.push({i:v-4,x:Mr(p,m)},{i:v-2,x:Mr(g,y)})}else(m||y)&&b.push("translate("+m+t+y+n)}function o(p,g,m,y){p!==g?(p-g>180?g+=360:g-p>180&&(p+=360),y.push({i:m.push(a(m)+"rotate(",null,i)-2,x:Mr(p,g)})):g&&m.push(a(m)+"rotate("+g+i)}function d(p,g,m,y){p!==g?y.push({i:m.push(a(m)+"skewX(",null,i)-2,x:Mr(p,g)}):g&&m.push(a(m)+"skewX("+g+i)}function f(p,g,m,y,b,k){if(p!==m||g!==y){var v=b.push(a(b)+"scale(",null,",",null,")");k.push({i:v-4,x:Mr(p,m)},{i:v-2,x:Mr(g,y)})}else(m!==1||y!==1)&&b.push(a(b)+"scale("+m+","+y+")")}return function(p,g){var m=[],y=[];return p=e(p),g=e(g),l(p.translateX,p.translateY,g.translateX,g.translateY,m,y),o(p.rotate,g.rotate,m,y),d(p.skewX,g.skewX,m,y),f(p.scaleX,p.scaleY,g.scaleX,g.scaleY,m,y),p=g=null,function(b){for(var k=-1,v=y.length,S;++k<v;)m[(S=y[k]).i]=S.x(b);return m.join("")}}}var bK=MC(gK,"px, ","px)","deg)"),xK=MC(yK,", ",")",")"),vK=1e-12;function lS(e){return((e=Math.exp(e))+1/e)/2}function wK(e){return((e=Math.exp(e))-1/e)/2}function kK(e){return((e=Math.exp(2*e))-1)/(e+1)}const lp=(function e(t,n,i){function a(l,o){var d=l[0],f=l[1],p=l[2],g=o[0],m=o[1],y=o[2],b=g-d,k=m-f,v=b*b+k*k,S,E;if(v<vK)E=Math.log(y/p)/t,S=function(O){return[d+O*b,f+O*k,p*Math.exp(t*O*E)]};else{var C=Math.sqrt(v),N=(y*y-p*p+i*v)/(2*p*n*C),_=(y*y-p*p-i*v)/(2*y*n*C),T=Math.log(Math.sqrt(N*N+1)-N),M=Math.log(Math.sqrt(_*_+1)-_);E=(M-T)/t,S=function(O){var R=O*E,B=lS(T),U=p/(n*C)*(B*kK(t*R+T)-wK(T));return[d+U*b,f+U*k,p*B/lS(t*R+T)]}}return S.duration=E*1e3*t/Math.SQRT2,S}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 Ho=0,du=0,lu=0,DC=1e3,Op,fu,Rp=0,yl=0,ph=0,Ou=typeof performance=="object"&&performance.now?performance:Date,OC=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Vx(){return yl||(OC(EK),yl=Ou.now()+ph)}function EK(){yl=0}function Lp(){this._call=this._time=this._next=null}Lp.prototype=RC.prototype={constructor:Lp,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Vx():+n)+(t==null?0:+t),!this._next&&fu!==this&&(fu?fu._next=this:Op=this,fu=this),this._call=e,this._time=n,yb()},stop:function(){this._call&&(this._call=null,this._time=1/0,yb())}};function RC(e,t,n){var i=new Lp;return i.restart(e,t,n),i}function SK(){Vx(),++Ho;for(var e=Op,t;e;)(t=yl-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ho}function oS(){yl=(Rp=Ou.now())+ph,Ho=du=0;try{SK()}finally{Ho=0,_K(),yl=0}}function NK(){var e=Ou.now(),t=e-Rp;t>DC&&(ph-=t,Rp=e)}function _K(){for(var e,t=Op,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:Op=n);fu=e,yb(i)}function yb(e){if(!Ho){du&&(du=clearTimeout(du));var t=e-yl;t>24?(e<1/0&&(du=setTimeout(oS,e-Ou.now()-ph)),lu&&(lu=clearInterval(lu))):(lu||(Rp=Ou.now(),lu=setInterval(NK,DC)),Ho=1,OC(oS))}}function cS(e,t,n){var i=new Lp;return t=t==null?0:+t,i.restart(a=>{i.stop(),e(a+t)},t,n),i}var jK=dh("start","end","cancel","interrupt"),CK=[],LC=0,uS=1,bb=2,op=3,dS=4,xb=5,cp=6;function hh(e,t,n,i,a,l){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;AK(e,n,{name:t,index:i,group:a,on:jK,tween:CK,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:LC})}function Yx(e,t){var n=br(e,t);if(n.state>LC)throw new Error("too late; already scheduled");return n}function zr(e,t){var n=br(e,t);if(n.state>op)throw new Error("too late; already running");return n}function br(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function AK(e,t,n){var i=e.__transition,a;i[t]=n,n.timer=RC(l,0,n.time);function l(p){n.state=uS,n.timer.restart(o,n.delay,n.time),n.delay<=p&&o(p-n.delay)}function o(p){var g,m,y,b;if(n.state!==uS)return f();for(g in i)if(b=i[g],b.name===n.name){if(b.state===op)return cS(o);b.state===dS?(b.state=cp,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete i[g]):+g<t&&(b.state=cp,b.timer.stop(),b.on.call("cancel",e,e.__data__,b.index,b.group),delete i[g])}if(cS(function(){n.state===op&&(n.state=dS,n.timer.restart(d,n.delay,n.time),d(p))}),n.state=bb,n.on.call("start",e,e.__data__,n.index,n.group),n.state===bb){for(n.state=op,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(p){for(var g=p<n.duration?n.ease.call(null,p/n.duration):(n.timer.restart(f),n.state=xb,1),m=-1,y=a.length;++m<y;)a[m].call(e,g);n.state===xb&&(n.on.call("end",e,e.__data__,n.index,n.group),f())}function f(){n.state=cp,n.timer.stop(),delete i[t];for(var p in i)return;delete e.__transition}}function up(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>bb&&i.state<xb,i.state=cp,i.timer.stop(),i.on.call(a?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete n[o]}l&&delete e.__transition}}function TK(e){return this.each(function(){up(this,e)})}function MK(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 DK(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,p=a.length;f<p;++f)if(a[f].name===t){a[f]=d;break}f===p&&a.push(d)}l.tween=a}}function OK(e,t){var n=this._id;if(e+="",arguments.length<2){for(var i=br(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?MK:DK)(n,e,t))}function Wx(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 br(a,i).value[t]}}function IC(e,t){var n;return(typeof t=="number"?Mr:t instanceof gl?Dp:(n=gl(t))?(t=n,Dp):AC)(e,t)}function RK(e){return function(){this.removeAttribute(e)}}function LK(e){return function(){this.removeAttributeNS(e.space,e.local)}}function IK(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 zK(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 PK(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 BK(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 $K(e,t){var n=fh(e),i=n==="transform"?xK:IC;return this.attrTween(e,typeof t=="function"?(n.local?BK:PK)(n,i,Wx(this,"attr."+e,t)):t==null?(n.local?LK:RK)(n):(n.local?zK:IK)(n,i,t))}function UK(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function FK(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function qK(e,t){var n,i;function a(){var l=t.apply(this,arguments);return l!==i&&(n=(i=l)&&FK(e,l)),n}return a._value=t,a}function HK(e,t){var n,i;function a(){var l=t.apply(this,arguments);return l!==i&&(n=(i=l)&&UK(e,l)),n}return a._value=t,a}function KK(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=fh(e);return this.tween(n,(i.local?qK:HK)(i,t))}function GK(e,t){return function(){Yx(this,e).delay=+t.apply(this,arguments)}}function VK(e,t){return t=+t,function(){Yx(this,e).delay=t}}function YK(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?GK:VK)(t,e)):br(this.node(),t).delay}function WK(e,t){return function(){zr(this,e).duration=+t.apply(this,arguments)}}function QK(e,t){return t=+t,function(){zr(this,e).duration=t}}function XK(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?WK:QK)(t,e)):br(this.node(),t).duration}function ZK(e,t){if(typeof t!="function")throw new Error;return function(){zr(this,e).ease=t}}function JK(e){var t=this._id;return arguments.length?this.each(ZK(t,e)):br(this.node(),t).ease}function eG(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;zr(this,e).ease=n}}function tG(e){if(typeof e!="function")throw new Error;return this.each(eG(this._id,e))}function nG(e){typeof e!="function"&&(e=pC(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,p=0;p<o;++p)(f=l[p])&&e.call(f,f.__data__,p,l)&&d.push(f);return new ba(i,this._parents,this._name,this._id)}function iG(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],p=n[d],g=f.length,m=o[d]=new Array(g),y,b=0;b<g;++b)(y=f[b]||p[b])&&(m[b]=y);for(;d<i;++d)o[d]=t[d];return new ba(o,this._parents,this._name,this._id)}function rG(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 aG(e,t,n){var i,a,l=rG(t)?Yx:zr;return function(){var o=l(this,e),d=o.on;d!==i&&(a=(i=d).copy()).on(t,n),o.on=a}}function sG(e,t){var n=this._id;return arguments.length<2?br(this.node(),n).on.on(e):this.each(aG(n,e,t))}function lG(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function oG(){return this.on("end.remove",lG(this._id))}function cG(e){var t=this._name,n=this._id;typeof e!="function"&&(e=qx(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,p=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__),p[y]=m,hh(p[y],t,n,y,p,br(g,n)));return new ba(l,this._parents,t,n)}function uG(e){var t=this._name,n=this._id;typeof e!="function"&&(e=fC(e));for(var i=this._groups,a=i.length,l=[],o=[],d=0;d<a;++d)for(var f=i[d],p=f.length,g,m=0;m<p;++m)if(g=f[m]){for(var y=e.call(g,g.__data__,m,f),b,k=br(g,n),v=0,S=y.length;v<S;++v)(b=y[v])&&hh(b,t,n,v,y,k);l.push(y),o.push(g)}return new ba(l,o,t,n)}var dG=rd.prototype.constructor;function fG(){return new dG(this._groups,this._parents)}function pG(e,t){var n,i,a;return function(){var l=qo(this,e),o=(this.style.removeProperty(e),qo(this,e));return l===o?null:l===n&&o===i?a:a=t(n=l,i=o)}}function zC(e){return function(){this.style.removeProperty(e)}}function hG(e,t,n){var i,a=n+"",l;return function(){var o=qo(this,e);return o===a?null:o===i?l:l=t(i=o,n)}}function mG(e,t,n){var i,a,l;return function(){var o=qo(this,e),d=n(this),f=d+"";return d==null&&(f=d=(this.style.removeProperty(e),qo(this,e))),o===f?null:o===i&&f===a?l:(a=f,l=t(i=o,d))}}function gG(e,t){var n,i,a,l="style."+t,o="end."+l,d;return function(){var f=zr(this,e),p=f.on,g=f.value[l]==null?d||(d=zC(t)):void 0;(p!==n||a!==g)&&(i=(n=p).copy()).on(o,a=g),f.on=i}}function yG(e,t,n){var i=(e+="")=="transform"?bK:IC;return t==null?this.styleTween(e,pG(e,i)).on("end.style."+e,zC(e)):typeof t=="function"?this.styleTween(e,mG(e,i,Wx(this,"style."+e,t))).each(gG(this._id,e)):this.styleTween(e,hG(e,i,t),n).on("end.style."+e,null)}function bG(e,t,n){return function(i){this.style.setProperty(e,t.call(this,i),n)}}function xG(e,t,n){var i,a;function l(){var o=t.apply(this,arguments);return o!==a&&(i=(a=o)&&bG(e,o,n)),i}return l._value=t,l}function vG(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,xG(e,t,n??""))}function wG(e){return function(){this.textContent=e}}function kG(e){return function(){var t=e(this);this.textContent=t??""}}function EG(e){return this.tween("text",typeof e=="function"?kG(Wx(this,"text",e)):wG(e==null?"":e+""))}function SG(e){return function(t){this.textContent=e.call(this,t)}}function NG(e){var t,n;function i(){var a=e.apply(this,arguments);return a!==n&&(t=(n=a)&&SG(a)),t}return i._value=e,i}function _G(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,NG(e))}function jG(){for(var e=this._name,t=this._id,n=PC(),i=this._groups,a=i.length,l=0;l<a;++l)for(var o=i[l],d=o.length,f,p=0;p<d;++p)if(f=o[p]){var g=br(f,t);hh(f,e,n,p,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 CG(){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 p=zr(this,i),g=p.on;g!==e&&(t=(e=g).copy(),t._.cancel.push(d),t._.interrupt.push(d),t._.end.push(f)),p.on=t}),a===0&&l()})}var AG=0;function ba(e,t,n,i){this._groups=e,this._parents=t,this._name=n,this._id=i}function PC(){return++AG}var aa=rd.prototype;ba.prototype={constructor:ba,select:cG,selectAll:uG,selectChild:aa.selectChild,selectChildren:aa.selectChildren,filter:nG,merge:iG,selection:fG,transition:jG,call:aa.call,nodes:aa.nodes,node:aa.node,size:aa.size,empty:aa.empty,each:aa.each,on:sG,attr:$K,attrTween:KK,style:yG,styleTween:vG,text:EG,textTween:_G,remove:oG,tween:OK,delay:YK,duration:XK,ease:JK,easeVarying:tG,end:CG,[Symbol.iterator]:aa[Symbol.iterator]};function TG(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var MG={time:null,delay:0,duration:250,ease:TG};function DG(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 OG(e){var t,n;e instanceof ba?(t=e._id,e=e._name):(t=PC(),(n=MG).time=Vx(),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,p=0;p<d;++p)(f=o[p])&&hh(f,e,t,p,o,n||DG(f,t));return new ba(i,this._parents,e,t)}rd.prototype.interrupt=TK;rd.prototype.transition=OG;const Gf=e=>()=>e;function RG(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 mh=new fa(1,0,0);BC.prototype=fa.prototype;function BC(e){for(;!e.__zoom;)if(!(e=e.parentNode))return mh;return e.__zoom}function gy(e){e.stopImmediatePropagation()}function ou(e){e.preventDefault(),e.stopImmediatePropagation()}function LG(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function IG(){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 fS(){return this.__zoom||mh}function zG(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function PG(){return navigator.maxTouchPoints||"ontouchstart"in this}function BG(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 $C(){var e=LG,t=IG,n=BG,i=zG,a=PG,l=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],d=250,f=lp,p=dh("start","zoom","end"),g,m,y,b=500,k=150,v=0,S=10;function E(D){D.property("__zoom",fS).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",B).on("dblclick.zoom",U).filter(a).on("touchstart.zoom",K).on("touchmove.zoom",q).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}E.transform=function(D,F,I,H){var W=D.selection?D.selection():D;W.property("__zoom",fS),D!==W?T(D,F,I,H):W.interrupt().each(function(){M(this,arguments).event(H).start().zoom(null,typeof F=="function"?F.apply(this,arguments):F).end()})},E.scaleBy=function(D,F,I,H){E.scaleTo(D,function(){var W=this.__zoom.k,G=typeof F=="function"?F.apply(this,arguments):F;return W*G},I,H)},E.scaleTo=function(D,F,I,H){E.transform(D,function(){var W=t.apply(this,arguments),G=this.__zoom,L=I==null?_(W):typeof I=="function"?I.apply(this,arguments):I,z=G.invert(L),V=typeof F=="function"?F.apply(this,arguments):F;return n(N(C(G,V),L,z),W,o)},I,H)},E.translateBy=function(D,F,I,H){E.transform(D,function(){return n(this.__zoom.translate(typeof F=="function"?F.apply(this,arguments):F,typeof I=="function"?I.apply(this,arguments):I),t.apply(this,arguments),o)},null,H)},E.translateTo=function(D,F,I,H,W){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(mh.translate(z[0],z[1]).scale(L.k).translate(typeof F=="function"?-F.apply(this,arguments):-F,typeof I=="function"?-I.apply(this,arguments):-I),G,o)},H,W)};function C(D,F){return F=Math.max(l[0],Math.min(l[1],F)),F===D.k?D:new fa(F,D.x,D.y)}function N(D,F,I){var H=F[0]-I[0]*D.k,W=F[1]-I[1]*D.k;return H===D.x&&W===D.y?D:new fa(D.k,H,W)}function _(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function T(D,F,I,H){D.on("start.zoom",function(){M(this,arguments).event(H).start()}).on("interrupt.zoom end.zoom",function(){M(this,arguments).event(H).end()}).tween("zoom",function(){var W=this,G=arguments,L=M(W,G).event(H),z=t.apply(W,G),V=I==null?_(z):typeof I=="function"?I.apply(W,G):I,P=Math.max(z[1][0]-z[0][0],z[1][1]-z[0][1]),le=W.__zoom,xe=typeof F=="function"?F.apply(W,G):F,ke=f(le.invert(V).concat(P/le.k),xe.invert(V).concat(P/xe.k));return function(Ne){if(Ne===1)Ne=xe;else{var se=ke(Ne),ve=P/se[2];Ne=new fa(ve,V[0]-se[0]*ve,V[1]-se[1]*ve)}L.zoom(null,Ne)}})}function M(D,F,I){return!I&&D.__zooming||new O(D,F)}function O(D,F){this.that=D,this.args=F,this.active=0,this.sourceEvent=null,this.extent=t.apply(D,F),this.taps=0}O.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,F){return this.mouse&&D!=="mouse"&&(this.mouse[1]=F.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=F.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=F.invert(this.touch1[0])),this.that.__zoom=F,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var F=_i(this.that).datum();p.call(D,this.that,new RG(D,{sourceEvent:this.sourceEvent,target:E,transform:this.that.__zoom,dispatch:p}),F)}};function R(D,...F){if(!e.apply(this,arguments))return;var I=M(this,F).event(D),H=this.__zoom,W=Math.max(l[0],Math.min(l[1],H.k*Math.pow(2,i.apply(this,arguments)))),G=lr(D);if(I.wheel)(I.mouse[0][0]!==G[0]||I.mouse[0][1]!==G[1])&&(I.mouse[1]=H.invert(I.mouse[0]=G)),clearTimeout(I.wheel);else{if(H.k===W)return;I.mouse=[G,H.invert(G)],up(this),I.start()}ou(D),I.wheel=setTimeout(L,k),I.zoom("mouse",n(N(C(H,W),I.mouse[0],I.mouse[1]),I.extent,o));function L(){I.wheel=null,I.end()}}function B(D,...F){if(y||!e.apply(this,arguments))return;var I=D.currentTarget,H=M(this,F,!0).event(D),W=_i(D.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",P,!0),G=lr(D,I),L=D.clientX,z=D.clientY;EC(D.view),gy(D),H.mouse=[G,this.__zoom.invert(G)],up(this),H.start();function V(le){if(ou(le),!H.moved){var xe=le.clientX-L,ke=le.clientY-z;H.moved=xe*xe+ke*ke>v}H.event(le).zoom("mouse",n(N(H.that.__zoom,H.mouse[0]=lr(le,I),H.mouse[1]),H.extent,o))}function P(le){W.on("mousemove.zoom mouseup.zoom",null),SC(le.view,H.moved),ou(le),H.event(le).end()}}function U(D,...F){if(e.apply(this,arguments)){var I=this.__zoom,H=lr(D.changedTouches?D.changedTouches[0]:D,this),W=I.invert(H),G=I.k*(D.shiftKey?.5:2),L=n(N(C(I,G),H,W),t.apply(this,F),o);ou(D),d>0?_i(this).transition().duration(d).call(T,L,H,D):_i(this).call(E.transform,L,H,D)}}function K(D,...F){if(e.apply(this,arguments)){var I=D.touches,H=I.length,W=M(this,F,D.changedTouches.length===H).event(D),G,L,z,V;for(gy(D),L=0;L<H;++L)z=I[L],V=lr(z,this),V=[V,this.__zoom.invert(V),z.identifier],W.touch0?!W.touch1&&W.touch0[2]!==V[2]&&(W.touch1=V,W.taps=0):(W.touch0=V,G=!0,W.taps=1+!!g);g&&(g=clearTimeout(g)),G&&(W.taps<2&&(m=V[0],g=setTimeout(function(){g=null},b)),up(this),W.start())}}function q(D,...F){if(this.__zooming){var I=M(this,F).event(D),H=D.changedTouches,W=H.length,G,L,z,V;for(ou(D),G=0;G<W;++G)L=H[G],z=lr(L,this),I.touch0&&I.touch0[2]===L.identifier?I.touch0[0]=z:I.touch1&&I.touch1[2]===L.identifier&&(I.touch1[0]=z);if(L=I.that.__zoom,I.touch1){var P=I.touch0[0],le=I.touch0[1],xe=I.touch1[0],ke=I.touch1[1],Ne=(Ne=xe[0]-P[0])*Ne+(Ne=xe[1]-P[1])*Ne,se=(se=ke[0]-le[0])*se+(se=ke[1]-le[1])*se;L=C(L,Math.sqrt(Ne/se)),z=[(P[0]+xe[0])/2,(P[1]+xe[1])/2],V=[(le[0]+ke[0])/2,(le[1]+ke[1])/2]}else if(I.touch0)z=I.touch0[0],V=I.touch0[1];else return;I.zoom("touch",n(N(L,z,V),I.extent,o))}}function Y(D,...F){if(this.__zooming){var I=M(this,F).event(D),H=D.changedTouches,W=H.length,G,L;for(gy(D),y&&clearTimeout(y),y=setTimeout(function(){y=null},b),G=0;G<W;++G)L=H[G],I.touch0&&I.touch0[2]===L.identifier?delete I.touch0:I.touch1&&I.touch1[2]===L.identifier&&delete I.touch1;if(I.touch1&&!I.touch0&&(I.touch0=I.touch1,delete I.touch1),I.touch0)I.touch0[1]=this.__zoom.invert(I.touch0[0]);else if(I.end(),I.taps===2&&(L=lr(L,this),Math.hypot(m[0]-L[0],m[1]-L[1])<S)){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:Gf(+D),E):i},E.filter=function(D){return arguments.length?(e=typeof D=="function"?D:Gf(!!D),E):e},E.touchable=function(D){return arguments.length?(a=typeof D=="function"?D:Gf(!!D),E):a},E.extent=function(D){return arguments.length?(t=typeof D=="function"?D:Gf([[+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=p.on.apply(p,arguments);return D===p?E:D},E.clickDistance=function(D){return arguments.length?(v=(D=+D)*D,E):Math.sqrt(v)},E.tapDistance=function(D){return arguments.length?(S=+D,E):S},E}const pr={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.`},Ru=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],UC=["Enter"," ","Escape"],FC={"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 Ko;(function(e){e.Strict="strict",e.Loose="loose"})(Ko||(Ko={}));var ul;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ul||(ul={}));var Lu;(function(e){e.Partial="partial",e.Full="full"})(Lu||(Lu={}));const qC={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 Ip;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ip||(Ip={}));var Ke;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ke||(Ke={}));const pS={[Ke.Left]:Ke.Right,[Ke.Right]:Ke.Left,[Ke.Top]:Ke.Bottom,[Ke.Bottom]:Ke.Top};function HC(e){return e===null?null:e?"valid":"invalid"}const KC=e=>"id"in e&&"source"in e&&"target"in e,$G=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Qx=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),sd=(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}},UG=(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):Qx(a)?a:t.nodeLookup.get(a.id));const d=o?zp(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return gh(i,d)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return yh(n)},ld=(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=gh(n,zp(a)),i=!0)}),i?yh(n):{x:0,y:0,width:0,height:0}},Xx=(e,t,[n,i,a]=[0,0,1],l=!1,o=!1)=>{const d=(t.x-n)/a,f=(t.y-i)/a,p=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 S=b.width??y.width??y.initialWidth??0,E=b.height??y.height??y.initialHeight??0,{x:C,y:N}=y.internals.positionAbsolute,_=WC(d,f,p,g,C,N,S,E),T=S*E,M=l&&_>0;(!y.internals.handleBounds||M||_>=T||y.dragging)&&m.push(y)}return m},FG=(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 qG(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 HG({nodes:e,width:t,height:n,panZoom:i,minZoom:a,maxZoom:l},o){if(e.size===0)return!0;const d=qG(e,o),f=ld(d),p=Jx(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(p,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),!0}function GC({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:p}=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",pr.error005());else{const b=d.measured.width,k=d.measured.height;b&&k&&(m=[[f,p],[f+b,p+k]])}else d&&xl(o.extent)&&(m=[[o.extent[0][0]+f,o.extent[0][1]+p],[o.extent[1][0]+f,o.extent[1][1]+p]]);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",pr.error015())),{position:{x:y.x-f+(o.measured.width??0)*g[0],y:y.y-p+(o.measured.height??0)*g[1]},positionAbsolute:y}}async function KG({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=FG(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 Go=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),bl=(e={x:0,y:0},t,n)=>({x:Go(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Go(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function VC(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 hS=(e,t,n)=>e<t?Go(Math.abs(e-t),1,t)/t:e>n?-Go(Math.abs(e-n),1,t)/t:0,Zx=(e,t,n=15,i=40)=>{const a=hS(e.x,i,t.width-i)*n,l=hS(e.y,i,t.height-i)*n;return[a,l]},gh=(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)}),vb=({x:e,y:t,width:n,height:i})=>({x:e,y:t,x2:e+n,y2:t+i}),yh=({x:e,y:t,x2:n,y2:i})=>({x:e,y:t,width:n-e,height:i-t}),Iu=(e,t=[0,0])=>{var a,l;const{x:n,y:i}=Qx(e)?e.internals.positionAbsolute:sd(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}},zp=(e,t=[0,0])=>{var a,l;const{x:n,y:i}=Qx(e)?e.internals.positionAbsolute:sd(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)}},YC=(e,t)=>yh(gh(vb(e),vb(t))),WC=(e,t,n,i,a,l,o,d)=>{const f=Math.max(0,Math.min(e+n,a+o)-Math.max(e,a)),p=Math.max(0,Math.min(t+i,l+d)-Math.max(t,l));return Math.ceil(f*p)},Pp=(e,t)=>WC(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),mS=e=>cr(e.width)&&cr(e.height)&&cr(e.x)&&cr(e.y),cr=e=>!isNaN(e)&&isFinite(e),QC=(e,t)=>(n,i)=>{},od=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),cd=({x:e,y:t},[n,i,a],l=!1,o=[1,1])=>{const d={x:(e-n)/a,y:(t-i)/a};return l?od(d,o):d},Vo=({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 GG(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 VG(e,t,n,i,a,l){const{x:o,y:d}=Vo(e,[t,n,i]),{x:f,y:p}=Vo({x:e.x+e.width,y:e.y+e.height},[t,n,i]),g=a-f,m=l-p;return{left:Math.floor(o),top:Math.floor(d),right:Math.floor(g),bottom:Math.floor(m)}}const Jx=(e,t,n,i,a,l)=>{const o=GG(l,t,n),d=(t-o.x)/e.width,f=(n-o.y)/e.height,p=Math.min(d,f),g=Go(p,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=VG(e,b,k,g,t,n),S={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-S.left+S.right,y:k-S.top+S.bottom,zoom:g}},zu=()=>{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 XC(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 ZC(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 gS(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function YG(){let e,t;return{promise:new Promise((i,a)=>{e=i,t=a}),resolve:e,reject:t}}function WG(e){return{...FC,...e||{}}}function xu(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:i,containerBounds:a}){const{x:l,y:o}=ur(e),d=cd({x:l-((a==null?void 0:a.left)??0),y:o-((a==null?void 0:a.top)??0)},i),{x:f,y:p}=n?od(d,t):d;return{xSnapped:f,ySnapped:p,...d}}const ev=e=>({width:e.offsetWidth,height:e.offsetHeight}),JC=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},QG=["INPUT","SELECT","TEXTAREA"];function eA(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:QG.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const tA=e=>"clientX"in e,ur=(e,t)=>{var l,o;const n=tA(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)}},yS=(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,...ev(o)}})};function nA({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,p=t*.125+l*.375+d*.375+i*.125,g=Math.abs(f-e),m=Math.abs(p-t);return[f,p,g,m]}function Vf(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function bS({pos:e,x1:t,y1:n,x2:i,y2:a,c:l}){switch(e){case Ke.Left:return[t-Vf(t-i,l),n];case Ke.Right:return[t+Vf(i-t,l),n];case Ke.Top:return[t,n-Vf(n-a,l)];case Ke.Bottom:return[t,n+Vf(a-n,l)]}}function iA({sourceX:e,sourceY:t,sourcePosition:n=Ke.Bottom,targetX:i,targetY:a,targetPosition:l=Ke.Top,curvature:o=.25}){const[d,f]=bS({pos:n,x1:e,y1:t,x2:i,y2:a,c:o}),[p,g]=bS({pos:l,x1:i,y1:a,x2:e,y2:t,c:o}),[m,y,b,k]=nA({sourceX:e,sourceY:t,targetX:i,targetY:a,sourceControlX:d,sourceControlY:f,targetControlX:p,targetControlY:g});return[`M${e},${t} C${d},${f} ${p},${g} ${i},${a}`,m,y,b,k]}function rA({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 XG({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 ZG({sourceNode:e,targetNode:t,width:n,height:i,transform:a}){const l=gh(zp(e),zp(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 Pp(o,yh(l))>0}const JG=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,eV=(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)),tV=(e,t,n={})=>{var l;if(!e.source||!e.target)return(l=n.onError)==null||l.call(n,"006",pr.error006()),t;const i=n.getEdgeId||JG;let a;return KC(e)?a={...e}:a={...e,id:i(e)},eV(a,t)?t:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,t.concat(a))};function aA({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[a,l,o,d]=rA({sourceX:e,sourceY:t,targetX:n,targetY:i});return[`M ${e},${t}L ${n},${i}`,a,l,o,d]}const xS={[Ke.Left]:{x:-1,y:0},[Ke.Right]:{x:1,y:0},[Ke.Top]:{x:0,y:-1},[Ke.Bottom]:{x:0,y:1}},nV=({source:e,sourcePosition:t=Ke.Bottom,target:n})=>t===Ke.Left||t===Ke.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},vS=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function iV({source:e,sourcePosition:t=Ke.Bottom,target:n,targetPosition:i=Ke.Top,center:a,offset:l,stepPosition:o}){const d=xS[t],f=xS[i],p={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=nV({source:p,sourcePosition:t,target:g}),y=m.x!==0?"x":"y",b=m[y];let k=[],v,S;const E={x:0,y:0},C={x:0,y:0},[,,N,_]=rA({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(d[y]*f[y]===-1){y==="x"?(v=a.x??p.x+(g.x-p.x)*o,S=a.y??(p.y+g.y)/2):(v=a.x??(p.x+g.x)/2,S=a.y??p.y+(g.y-p.y)*o);const R=[{x:v,y:p.y},{x:v,y:g.y}],B=[{x:p.x,y:S},{x:g.x,y:S}];d[y]===b?k=y==="x"?R:B:k=y==="x"?B:R}else{const R=[{x:p.x,y:g.y}],B=[{x:g.x,y:p.y}];if(y==="x"?k=d.x===b?B:R:k=d.y===b?R:B,t===i){const D=Math.abs(e[y]-n[y]);if(D<=l){const F=Math.min(l-1,l-D);d[y]===b?E[y]=(p[y]>e[y]?-1:1)*F:C[y]=(g[y]>n[y]?-1:1)*F}}if(t!==i){const D=y==="x"?"y":"x",F=d[y]===f[D],I=p[D]>g[D],H=p[D]<g[D];(d[y]===1&&(!F&&I||F&&H)||d[y]!==1&&(!F&&H||F&&I))&&(k=y==="x"?R:B)}const U={x:p.x+E.x,y:p.y+E.y},K={x:g.x+C.x,y:g.y+C.y},q=Math.max(Math.abs(U.x-k[0].x),Math.abs(K.x-k[0].x)),Y=Math.max(Math.abs(U.y-k[0].y),Math.abs(K.y-k[0].y));q>=Y?(v=(U.x+K.x)/2,S=k[0].y):(v=k[0].x,S=(U.y+K.y)/2)}const T={x:p.x+E.x,y:p.y+E.y},M={x:g.x+C.x,y:g.y+C.y};return[[e,...T.x!==k[0].x||T.y!==k[0].y?[T]:[],...k,...M.x!==k[k.length-1].x||M.y!==k[k.length-1].y?[M]:[],n],v,S,N,_]}function rV(e,t,n,i){const a=Math.min(vS(e,t)/2,vS(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 p=e.x<n.x?-1:1,g=e.y<n.y?1:-1;return`L ${l+a*p},${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 wb({sourceX:e,sourceY:t,sourcePosition:n=Ke.Bottom,targetX:i,targetY:a,targetPosition:l=Ke.Top,borderRadius:o=5,centerX:d,centerY:f,offset:p=20,stepPosition:g=.5}){const[m,y,b,k,v]=iV({source:{x:e,y:t},sourcePosition:n,target:{x:i,y:a},targetPosition:l,center:{x:d,y:f},offset:p,stepPosition:g});let S=`M${m[0].x} ${m[0].y}`;for(let E=1;E<m.length-1;E++)S+=rV(m[E-1],m[E],m[E+1],o);return S+=`L${m[m.length-1].x} ${m[m.length-1].y}`,[S,y,b,k,v]}function wS(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function aV(e){var m;const{sourceNode:t,targetNode:n}=e;if(!wS(t)||!wS(n))return null;const i=t.internals.handleBounds||kS(t.handles),a=n.internals.handleBounds||kS(n.handles),l=ES((i==null?void 0:i.source)??[],e.sourceHandle),o=ES(e.connectionMode===Ko.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",pr.error008(l?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const d=(l==null?void 0:l.position)||Ke.Bottom,f=(o==null?void 0:o.position)||Ke.Top,p=vl(t,l,d),g=vl(n,o,f);return{sourceX:p.x,sourceY:p.y,targetX:g.x,targetY:g.y,sourcePosition:d,targetPosition:f}}function kS(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=Ke.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 Ke.Top:return{x:a+o/2,y:l};case Ke.Right:return{x:a+o,y:l+d/2};case Ke.Bottom:return{x:a+o/2,y:l+d};case Ke.Left:return{x:a,y:l+d/2}}}function ES(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function kb(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function sV(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 p=kb(f,t);l.has(p)||(o.push({id:p,color:f.color||n,...f}),l.add(p))}}),o),[]).sort((o,d)=>o.id.localeCompare(d.id))}const sA=1e3,lV=10,tv={nodeOrigin:[0,0],nodeExtent:Ru,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},oV={...tv,checkEquality:!0};function nv(e,t){const n={...e};for(const i in t)t[i]!==void 0&&(n[i]=t[i]);return n}function cV(e,t,n){const i=nv(tv,n);for(const a of e.values())if(a.parentId)rv(a,e,t,i);else{const l=sd(a,i.nodeOrigin),o=xl(a.extent)?a.extent:i.nodeExtent,d=bl(l,o,va(a));a.internals.positionAbsolute=d}}function uV(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 iv(e){return e==="manual"}function Eb(e,t,n,i={}){var g,m;const a=nv(oV,i),l={i:0},o=new Map(t),d=a!=null&&a.elevateNodesOnSelect&&!iv(a.zIndexMode)?sA:0;let f=e.length>0,p=!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=sd(y,a.nodeOrigin),v=xl(y.extent)?y.extent:a.nodeExtent,S=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:S,handleBounds:uV(y,b),z:lA(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&&rv(b,t,n,i,l),p||(p=y.selected??!1)}return{nodesInitialized:f,hasSelectedNodes:p}}function dV(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 rv(e,t,n,i,a){const{elevateNodesOnSelect:l,nodeOrigin:o,nodeExtent:d,zIndexMode:f}=nv(tv,i),p=e.parentId,g=t.get(p);if(!g){console.warn(`Parent node ${p} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}dV(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*lV),a&&g.internals.rootParentIndex!==void 0&&(a.i=g.internals.rootParentIndex);const m=l&&!iv(f)?sA:0,{x:y,y:b,z:k}=fV(e,g,o,d,m,f),{positionAbsolute:v}=e.internals,S=y!==v.x||b!==v.y;(S||k!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:S?{x:y,y:b}:v,z:k}})}function lA(e,t,n){const i=cr(e.zIndex)?e.zIndex:0;return iv(n)?i:i+(e.selected?t:0)}function fV(e,t,n,i,a,l){const{x:o,y:d}=t.internals.positionAbsolute,f=va(e),p=sd(e,n),g=xl(e.extent)?bl(p,e.extent,f):p;let m=bl({x:o+g.x,y:d+g.y},i,f);e.extent==="parent"&&(m=VC(m,f,t));const y=lA(e,a,l),b=t.internals.z??0;return{x:m.x,y:m.y,z:b>=y?b+1:y}}function av(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 p=((o=l.get(d.parentId))==null?void 0:o.expandedRect)??Iu(f),g=YC(p,d.rect);l.set(d.parentId,{expandedRect:g,parent:f})}return l.size>0&&l.forEach(({expandedRect:d,parent:f},p)=>{var N;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)),S=Math.max(m.height,Math.round(d.height)),E=(v-m.width)*y[0],C=(S-m.height)*y[1];(b>0||k>0||E||C)&&(a.push({id:p,type:"position",position:{x:f.position.x-b+E,y:f.position.y-k+C}}),(N=n.get(p))==null||N.forEach(_=>{e.some(T=>T.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:p,type:"dimensions",setAttributes:!0,dimensions:{width:v+(b?y[0]*b-E:0),height:S+(k?y[1]*k-C:0)}})}),a}function pV(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 p=[],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=ev(b.nodeElement),S=k.measured.width!==v.width||k.measured.height!==v.height;if(!!(v.width&&v.height&&(S||!k.internals.handleBounds||b.force))){const C=b.nodeElement.getBoundingClientRect(),N=xl(k.extent)?k.extent:l;let{positionAbsolute:_}=k.internals;k.parentId&&k.extent==="parent"?_=VC(_,v,t.get(k.parentId)):N&&(_=bl(_,N,v));const T={...k,measured:v,internals:{...k.internals,positionAbsolute:_,handleBounds:{source:yS("source",b.nodeElement,C,m,k.id),target:yS("target",b.nodeElement,C,m,k.id)}}};t.set(k.id,T),k.parentId&&rv(T,t,n,{nodeOrigin:a,zIndexMode:o}),f=!0,S&&(p.push({id:k.id,type:"dimensions",dimensions:v}),k.expandParent&&k.parentId&&y.push({id:k.id,parentId:k.parentId,rect:Iu(T,a)}))}}if(y.length>0){const b=av(y,t,n,a);p.push(...b)}return{changes:p,updatedInternals:f}}async function hV({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 SS(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 p=i.get(o)||new Map;i.set(o,p.set(n,t))}}function oA(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},p=`${a}-${o}--${l}-${d}`,g=`${l}-${d}--${a}-${o}`;SS("source",f,g,e,a,o),SS("target",f,p,e,l,d),t.set(i.id,i)}}function cA(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:cA(n,t):!1}function NS(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 mV(e,t,n,i){const a=new Map;for(const[l,o]of e)if((o.selected||o.id===i)&&(!o.parentId||!cA(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 yy({nodeId:e,dragItems:t,nodeLookup:n,dragging:i=!0}){var o,d,f;const a=[];for(const[p,g]of t){const m=(o=n.get(p))==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 gV({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=od(l,t);return{x:o.x-l.x,y:o.y-l.y}}function yV({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:i,onDragStop:a}){let l={x:null,y:null},o=0,d=new Map,f=!1,p={x:0,y:0},g=null,m=!1,y=null,b=!1,k=!1,v=null;function S({noDragClassName:C,handleSelector:N,domNode:_,isSelectable:T,nodeId:M,nodeClickDistance:O=0}){y=_i(_);function R({x:q,y:Y}){const{nodeLookup:D,nodeExtent:F,snapGrid:I,snapToGrid:H,nodeOrigin:W,onNodeDrag:G,onSelectionDrag:L,onError:z,updateNodePositions:V}=t();l={x:q,y:Y};let P=!1;const le=d.size>1,xe=le&&F?vb(ld(d)):null,ke=le&&H?gV({dragItems:d,snapGrid:I,x:q,y:Y}):null;for(const[Ne,se]of d){if(!D.has(Ne))continue;let ve={x:q-se.distance.x,y:Y-se.distance.y};H&&(ve=ke?{x:Math.round(ve.x+ke.x),y:Math.round(ve.y+ke.y)}:od(ve,I));let ue=null;if(le&&F&&!se.extent&&xe){const{positionAbsolute:re}=se.internals,Ce=re.x-xe.x+F[0][0],Me=re.x+se.measured.width-xe.x2+F[1][0],_e=re.y-xe.y+F[0][1],Qe=re.y+se.measured.height-xe.y2+F[1][1];ue=[[Ce,_e],[Me,Qe]]}const{position:J,positionAbsolute:we}=GC({nodeId:Ne,nextPosition:ve,nodeLookup:D,nodeExtent:ue||F,nodeOrigin:W,onError:z});P=P||se.position.x!==J.x||se.position.y!==J.y,se.position=J,se.internals.positionAbsolute=we}if(k=k||P,!!P&&(V(d,!0),v&&(i||G||!M&&L))){const[Ne,se]=yy({nodeId:M,dragItems:d,nodeLookup:D});i==null||i(v,d,Ne,se),G==null||G(v,Ne,se),M||L==null||L(v,se)}}async function B(){if(!g)return;const{transform:q,panBy:Y,autoPanSpeed:D,autoPanOnNodeDrag:F}=t();if(!F){f=!1,cancelAnimationFrame(o);return}const[I,H]=Zx(p,g,D);(I!==0||H!==0)&&(l.x=(l.x??0)-I/q[2],l.y=(l.y??0)-H/q[2],await Y({x:I,y:H})&&R(l)),o=requestAnimationFrame(B)}function U(q){var le;const{nodeLookup:Y,multiSelectionActive:D,nodesDraggable:F,transform:I,snapGrid:H,snapToGrid:W,selectNodesOnDrag:G,onNodeDragStart:L,onSelectionDragStart:z,unselectNodesAndEdges:V}=t();m=!0,(!G||!T)&&!D&&M&&((le=Y.get(M))!=null&&le.selected||V()),T&&G&&M&&(e==null||e(M));const P=xu(q.sourceEvent,{transform:I,snapGrid:H,snapToGrid:W,containerBounds:g});if(l=P,d=mV(Y,F,P,M),d.size>0&&(n||L||!M&&z)){const[xe,ke]=yy({nodeId:M,dragItems:d,nodeLookup:Y});n==null||n(q.sourceEvent,d,xe,ke),L==null||L(q.sourceEvent,xe,ke),M||z==null||z(q.sourceEvent,ke)}}const K=NC().clickDistance(O).on("start",q=>{const{domNode:Y,nodeDragThreshold:D,transform:F,snapGrid:I,snapToGrid:H}=t();g=(Y==null?void 0:Y.getBoundingClientRect())||null,b=!1,k=!1,v=q.sourceEvent,D===0&&U(q),l=xu(q.sourceEvent,{transform:F,snapGrid:I,snapToGrid:H,containerBounds:g}),p=ur(q.sourceEvent,g)}).on("drag",q=>{const{autoPanOnNodeDrag:Y,transform:D,snapGrid:F,snapToGrid:I,nodeDragThreshold:H,nodeLookup:W}=t(),G=xu(q.sourceEvent,{transform:D,snapGrid:F,snapToGrid:I,containerBounds:g});if(v=q.sourceEvent,(q.sourceEvent.type==="touchmove"&&q.sourceEvent.touches.length>1||M&&!W.has(M))&&(b=!0),!b){if(!f&&Y&&m&&(f=!0,B()),!m){const L=ur(q.sourceEvent,g),z=L.x-p.x,V=L.y-p.y;Math.sqrt(z*z+V*V)>H&&U(q)}(l.x!==G.xSnapped||l.y!==G.ySnapped)&&d&&m&&(p=ur(q.sourceEvent,g),R(G))}}).on("end",q=>{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:F,onSelectionDragStop:I}=t();if(k&&(D(d,!1),k=!1),a||F||!M&&I){const[H,W]=yy({nodeId:M,dragItems:d,nodeLookup:Y,dragging:!1});a==null||a(q.sourceEvent,d,H,W),F==null||F(q.sourceEvent,H,W),M||I==null||I(q.sourceEvent,W)}}}).filter(q=>{const Y=q.target;return!q.button&&(!C||!NS(Y,`.${C}`,_))&&(!N||NS(Y,N,_))});y.call(K)}function E(){y==null||y.on(".drag",null)}return{update:S,destroy:E}}function bV(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())Pp(a,Iu(l))>0&&i.push(l);return i}const xV=250;function vV(e,t,n,i){var d,f;let a=[],l=1/0;const o=bV(e,n,t+xV);for(const p of o){const g=[...((d=p.internals.handleBounds)==null?void 0:d.source)??[],...((f=p.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(p,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 p=i.type==="source"?"target":"source";return a.find(g=>g.type===p)??a[0]}return a[0]}function uA(e,t,n,i,a,l=!1){var p,g,m;const o=i.get(e);if(!o)return null;const d=a==="strict"?(p=o.internals.handleBounds)==null?void 0:p[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 dA(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function wV(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const fA=()=>!0;function kV(e,{connectionMode:t,connectionRadius:n,handleId:i,nodeId:a,edgeUpdaterType:l,isTarget:o,domNode:d,nodeLookup:f,lib:p,autoPanOnConnect:g,flowId:m,panBy:y,cancelConnection:b,onConnectStart:k,onConnect:v,onConnectEnd:S,isValidConnection:E=fA,onReconnectEnd:C,updateConnection:N,getTransform:_,getFromHandle:T,autoPanSpeed:M,dragThreshold:O=1,handleDomNode:R}){const B=JC(e.target);let U=0,K;const{x:q,y:Y}=ur(e),D=dA(l,R),F=d==null?void 0:d.getBoundingClientRect();let I=!1;if(!F||!D)return;const H=uA(a,D,i,f,t);if(!H)return;let W=ur(e,F),G=!1,L=null,z=!1,V=null;function P(){if(!g||!F)return;const[J,we]=Zx(W,F,M);y({x:J,y:we}),U=requestAnimationFrame(P)}const le={...H,nodeId:a,type:D,position:H.position},xe=f.get(a);let Ne={inProgress:!0,isValid:null,from:vl(xe,le,Ke.Left,!0),fromHandle:le,fromPosition:le.position,fromNode:xe,to:W,toHandle:null,toPosition:pS[le.position],toNode:null,pointer:W};function se(){I=!0,N(Ne),k==null||k(e,{nodeId:a,handleId:i,handleType:D})}O===0&&se();function ve(J){if(!I){const{x:Qe,y:Ue}=ur(J),ce=Qe-q,be=Ue-Y;if(!(ce*ce+be*be>O*O))return;se()}if(!T()||!le){ue(J);return}const we=_();W=ur(J,F),K=vV(cd(W,we,!1,[1,1]),n,f,le),G||(P(),G=!0);const re=pA(J,{handle:K,connectionMode:t,fromNodeId:a,fromHandleId:i,fromType:o?"target":"source",isValidConnection:E,doc:B,lib:p,flowId:m,nodeLookup:f});V=re.handleDomNode,L=re.connection,z=wV(!!K,re.isValid);const Ce=f.get(a),Me=Ce?vl(Ce,le,Ke.Left,!0):Ne.from,_e={...Ne,from:Me,isValid:z,to:re.toHandle&&z?Vo({x:re.toHandle.x,y:re.toHandle.y},we):W,toHandle:re.toHandle,toPosition:z&&re.toHandle?re.toHandle.position:pS[le.position],toNode:re.toHandle?f.get(re.toHandle.nodeId):null,pointer:W};N(_e),Ne=_e}function ue(J){if(!("touches"in J&&J.touches.length>0)){if(I){(K||V)&&L&&z&&(v==null||v(L));const{inProgress:we,...re}=Ne,Ce={...re,toPosition:Ne.toHandle?Ne.toPosition:null};S==null||S(J,Ce),l&&(C==null||C(J,Ce))}b(),cancelAnimationFrame(U),G=!1,z=!1,L=null,V=null,B.removeEventListener("mousemove",ve),B.removeEventListener("mouseup",ue),B.removeEventListener("touchmove",ve),B.removeEventListener("touchend",ue)}}B.addEventListener("mousemove",ve),B.addEventListener("mouseup",ue),B.addEventListener("touchmove",ve),B.addEventListener("touchend",ue)}function pA(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:a,fromType:l,doc:o,lib:d,flowId:f,isValidConnection:p=fA,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}=ur(e),v=o.elementFromPoint(b,k),S=v!=null&&v.classList.contains(`${d}-flow__handle`)?v:y,E={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const C=dA(void 0,S),N=S.getAttribute("data-nodeid"),_=S.getAttribute("data-handleid"),T=S.classList.contains("connectable"),M=S.classList.contains("connectableend");if(!N||!C)return E;const O={source:m?N:i,sourceHandle:m?_:a,target:m?i:N,targetHandle:m?a:_};E.connection=O;const B=T&&M&&(n===Ko.Strict?m&&C==="source"||!m&&C==="target":N!==i||_!==a);E.isValid=B&&p(O),E.toHandle=uA(N,C,_,g,n,!0)}return E}const Sb={onPointerDown:kV,isValid:pA};function EV({domNode:e,panZoom:t,getTransform:n,getViewScale:i}){const a=_i(e);function l({translateExtent:d,width:f,height:p,zoomStep:g=1,pannable:m=!0,zoomable:y=!0,inversePan:b=!1}){const k=N=>{if(N.sourceEvent.type!=="wheel"||!t)return;const _=n(),T=N.sourceEvent.ctrlKey&&zu()?10:1,M=-N.sourceEvent.deltaY*(N.sourceEvent.deltaMode===1?.05:N.sourceEvent.deltaMode?1:.002)*g,O=_[2]*Math.pow(2,M*T);t.scaleTo(O)};let v=[0,0];const S=N=>{(N.sourceEvent.type==="mousedown"||N.sourceEvent.type==="touchstart")&&(v=[N.sourceEvent.clientX??N.sourceEvent.touches[0].clientX,N.sourceEvent.clientY??N.sourceEvent.touches[0].clientY])},E=N=>{const _=n();if(N.sourceEvent.type!=="mousemove"&&N.sourceEvent.type!=="touchmove"||!t)return;const T=[N.sourceEvent.clientX??N.sourceEvent.touches[0].clientX,N.sourceEvent.clientY??N.sourceEvent.touches[0].clientY],M=[T[0]-v[0],T[1]-v[1]];v=T;const O=i()*Math.max(_[2],Math.log(_[2]))*(b?-1:1),R={x:_[0]-M[0]*O,y:_[1]-M[1]*O},B=[[0,0],[f,p]];t.setViewportConstrained({x:R.x,y:R.y,zoom:_[2]},B,d)},C=$C().on("start",S).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:lr}}const bh=e=>({x:e.x,y:e.y,zoom:e.k}),by=({x:e,y:t,zoom:n})=>mh.translate(e,t).scale(n),vo=(e,t)=>e.target.closest(`.${t}`),hA=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),SV=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,xy=(e,t=0,n=SV,i=()=>{})=>{const a=typeof t=="number"&&t>0;return a||i(),a?e.transition().duration(t).ease(n).on("end",i):e},mA=e=>{const t=e.ctrlKey&&zu()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function NV({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:i,panOnScrollMode:a,panOnScrollSpeed:l,zoomOnPinch:o,onPanZoomStart:d,onPanZoom:f,onPanZoomEnd:p}){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 S=lr(g),E=mA(g),C=m*Math.pow(2,E);i.scaleTo(n,C,S,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;!zu()&&g.shiftKey&&a!==ul.Vertical&&(b=g.deltaY*y,k=0),i.translateBy(n,-(b/m)*l,-(k/m)*l,{internal:!0});const v=bh(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(f==null||f(g,v),e.panScrollTimeout=setTimeout(()=>{p==null||p(g,v),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,d==null||d(g,v))}}function _V({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 jV({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return i=>{var l,o,d;if((l=i.sourceEvent)!=null&&l.internal)return;const a=bh(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 CV({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:a}){return l=>{var o,d;e.usedRightMouseButton=!!(n&&hA(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,bh(l.transform)))}}function AV({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&&hA(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&l(o.sourceEvent),e.usedRightMouseButton=!1,i(!1),a)){const f=bh(o.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a==null||a(o.sourceEvent,f)},n?150:0)}}}function TV({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:i,panOnScroll:a,zoomOnDoubleClick:l,userSelectionActive:o,noWheelClassName:d,noPanClassName:f,lib:p,connectionInProgress:g}){return m=>{var S;const y=e||t,b=n&&m.ctrlKey,k=m.type==="wheel";if(m.button===1&&m.type==="mousedown"&&(vo(m,`${p}-flow__node`)||vo(m,`${p}-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"&&((S=m.touches)==null?void 0:S.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 MV({domNode:e,minZoom:t,maxZoom:n,translateExtent:i,viewport:a,onPanZoom:l,onPanZoomStart:o,onPanZoomEnd:d,onDraggingChange:f}){const p={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},g=e.getBoundingClientRect(),m=$C().scaleExtent([t,n]).translateExtent(i),y=_i(e).call(m);C({x:a.x,y:a.y,zoom:Go(a.zoom,t,n)},[[0,0],[g.width,g.height]],i);const b=y.on("wheel.zoom"),k=y.on("dblclick.zoom");m.wheelDelta(mA);async function v(K,q){return y?new Promise(Y=>{m==null||m.interpolate((q==null?void 0:q.interpolate)==="linear"?bu:lp).transform(xy(y,q==null?void 0:q.duration,q==null?void 0:q.ease,()=>Y(!0)),K)}):!1}function S({noWheelClassName:K,noPanClassName:q,onPaneContextMenu:Y,userSelectionActive:D,panOnScroll:F,panOnDrag:I,panOnScrollMode:H,panOnScrollSpeed:W,preventScrolling:G,zoomOnPinch:L,zoomOnScroll:z,zoomOnDoubleClick:V,zoomActivationKeyPressed:P,lib:le,onTransformChange:xe,connectionInProgress:ke,paneClickDistance:Ne,selectionOnDrag:se}){D&&!p.isZoomingOrPanning&&E();const ve=F&&!P&&!D;m.clickDistance(se?1/0:!cr(Ne)||Ne<0?0:Ne);const ue=ve?NV({zoomPanValues:p,noWheelClassName:K,d3Selection:y,d3Zoom:m,panOnScrollMode:H,panOnScrollSpeed:W,zoomOnPinch:L,onPanZoomStart:o,onPanZoom:l,onPanZoomEnd:d}):_V({noWheelClassName:K,preventScrolling:G,d3ZoomHandler:b});y.on("wheel.zoom",ue,{passive:!1});const J=jV({zoomPanValues:p,onDraggingChange:f,onPanZoomStart:o});m.on("start",J);const we=CV({zoomPanValues:p,panOnDrag:I,onPaneContextMenu:!!Y,onPanZoom:l,onTransformChange:xe});m.on("zoom",we);const re=AV({zoomPanValues:p,panOnDrag:I,panOnScroll:F,onPaneContextMenu:Y,onPanZoomEnd:d,onDraggingChange:f});m.on("end",re);const Ce=TV({zoomActivationKeyPressed:P,panOnDrag:I,zoomOnScroll:z,panOnScroll:F,zoomOnDoubleClick:V,zoomOnPinch:L,userSelectionActive:D,noPanClassName:q,noWheelClassName:K,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(K,q,Y){const D=by(K),F=m==null?void 0:m.constrain()(D,q,Y);return F&&await v(F),F}async function N(K,q){const Y=by(K);return await v(Y,q),Y}function _(K){if(y){const q=by(K),Y=y.property("__zoom");(Y.k!==K.zoom||Y.x!==K.x||Y.y!==K.y)&&(m==null||m.transform(y,q,null,{sync:!0}))}}function T(){const K=y?BC(y.node()):{x:0,y:0,k:1};return{x:K.x,y:K.y,zoom:K.k}}async function M(K,q){return y?new Promise(Y=>{m==null||m.interpolate((q==null?void 0:q.interpolate)==="linear"?bu:lp).scaleTo(xy(y,q==null?void 0:q.duration,q==null?void 0:q.ease,()=>Y(!0)),K)}):!1}async function O(K,q){return y?new Promise(Y=>{m==null||m.interpolate((q==null?void 0:q.interpolate)==="linear"?bu:lp).scaleBy(xy(y,q==null?void 0:q.duration,q==null?void 0:q.ease,()=>Y(!0)),K)}):!1}function R(K){m==null||m.scaleExtent(K)}function B(K){m==null||m.translateExtent(K)}function U(K){const q=!cr(K)||K<0?0:K;m==null||m.clickDistance(q)}return{update:S,destroy:E,setViewport:N,setViewportConstrained:C,getViewport:T,scaleTo:M,scaleBy:O,setScaleExtent:R,setTranslateExtent:B,syncViewport:_,setClickDistance:U}}var Yo;(function(e){e.Line="line",e.Handle="handle"})(Yo||(Yo={}));function DV({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 _S(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 Yf(e,t,n){return Math.max(0,t-e,e-n)}function jS(e,t){return e?!t:t}function OV(e,t,n,i,a,l,o,d){let{affectsX:f,affectsY:p}=t;const{isHorizontal:g,isVertical:m}=t,y=g&&m,{xSnapped:b,ySnapped:k}=n,{minWidth:v,maxWidth:S,minHeight:E,maxHeight:C}=i,{x:N,y:_,width:T,height:M,aspectRatio:O}=e;let R=Math.floor(g?b-e.pointerX:0),B=Math.floor(m?k-e.pointerY:0);const U=T+(f?-R:R),K=M+(p?-B:B),q=-l[0]*T,Y=-l[1]*M;let D=Yf(U,v,S),F=Yf(K,E,C);if(o){let W=0,G=0;f&&R<0?W=rs(N+R+q,o[0][0]):!f&&R>0&&(W=as(N+U+q,o[1][0])),p&&B<0?G=rs(_+B+Y,o[0][1]):!p&&B>0&&(G=as(_+K+Y,o[1][1])),D=Math.max(D,W),F=Math.max(F,G)}if(d){let W=0,G=0;f&&R>0?W=as(N+R,d[0][0]):!f&&R<0&&(W=rs(N+U,d[1][0])),p&&B>0?G=as(_+B,d[0][1]):!p&&B<0&&(G=rs(_+K,d[1][1])),D=Math.max(D,W),F=Math.max(F,G)}if(a){if(g){const W=Yf(U/O,E,C)*O;if(D=Math.max(D,W),o){let G=0;!f&&!p||f&&!p&&y?G=as(_+Y+U/O,o[1][1])*O:G=rs(_+Y+(f?R:-R)/O,o[0][1])*O,D=Math.max(D,G)}if(d){let G=0;!f&&!p||f&&!p&&y?G=rs(_+U/O,d[1][1])*O:G=as(_+(f?R:-R)/O,d[0][1])*O,D=Math.max(D,G)}}if(m){const W=Yf(K*O,v,S)/O;if(F=Math.max(F,W),o){let G=0;!f&&!p||p&&!f&&y?G=as(N+K*O+q,o[1][0])/O:G=rs(N+(p?B:-B)*O+q,o[0][0])/O,F=Math.max(F,G)}if(d){let G=0;!f&&!p||p&&!f&&y?G=rs(N+K*O,d[1][0])/O:G=as(N+(p?B:-B)*O,d[0][0])/O,F=Math.max(F,G)}}}B=B+(B<0?F:-F),R=R+(R<0?D:-D),a&&(y?U>K*O?B=(jS(f,p)?-R:R)/O:R=(jS(f,p)?-B:B)*O:g?(B=R/O,p=f):(R=B*O,f=p));const I=f?N+R:N,H=p?_+B:_;return{width:T+(f?-R:R),height:M+(p?-B:B),x:l[0]*R*(f?-1:1)+I,y:l[1]*B*(p?-1:1)+H}}const gA={width:0,height:0,x:0,y:0},RV={...gA,pointerX:0,pointerY:0,aspectRatio:1};function LV(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 IV({domNode:e,nodeId:t,getStoreItems:n,onChange:i,onEnd:a}){const l=_i(e);let o={controlDirection:_S("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function d({controlPosition:p,boundaries:g,keepAspectRatio:m,resizeDirection:y,onResizeStart:b,onResize:k,onResizeEnd:v,shouldResize:S}){let E={...gA},C={...RV};o={boundaries:g,resizeDirection:y,keepAspectRatio:m,controlDirection:_S(p)};let N,_=null,T=[],M,O,R,B=!1;const U=NC().on("start",K=>{const{nodeLookup:q,transform:Y,snapGrid:D,snapToGrid:F,nodeOrigin:I,paneDomNode:H}=n();if(N=q.get(t),!N)return;_=(H==null?void 0:H.getBoundingClientRect())??null;const{xSnapped:W,ySnapped:G}=xu(K.sourceEvent,{transform:Y,snapGrid:D,snapToGrid:F,containerBounds:_});E={width:N.measured.width??0,height:N.measured.height??0,x:N.position.x??0,y:N.position.y??0},C={...E,pointerX:W,pointerY:G,aspectRatio:E.width/E.height},M=void 0,O=xl(N.extent)?N.extent:void 0,N.parentId&&(N.extent==="parent"||N.expandParent)&&(M=q.get(N.parentId)),M&&N.extent==="parent"&&(O=[[0,0],[M.measured.width,M.measured.height]]),T=[],R=void 0;for(const[L,z]of q)if(z.parentId===t&&(T.push({id:L,position:{...z.position},extent:z.extent}),z.extent==="parent"||z.expandParent)){const V=LV(z,N,z.origin??I);R?R=[[Math.min(V[0][0],R[0][0]),Math.min(V[0][1],R[0][1])],[Math.max(V[1][0],R[1][0]),Math.max(V[1][1],R[1][1])]]:R=V}b==null||b(K,{...E})}).on("drag",K=>{const{transform:q,snapGrid:Y,snapToGrid:D,nodeOrigin:F}=n(),I=xu(K.sourceEvent,{transform:q,snapGrid:Y,snapToGrid:D,containerBounds:_}),H=[];if(!N)return;const{x:W,y:G,width:L,height:z}=E,V={},P=N.origin??F,{width:le,height:xe,x:ke,y:Ne}=OV(C,o.controlDirection,I,o.boundaries,o.keepAspectRatio,P,O,R),se=le!==L,ve=xe!==z,ue=ke!==W&&se,J=Ne!==G&&ve;if(!ue&&!J&&!se&&!ve)return;if((ue||J||P[0]===1||P[1]===1)&&(V.x=ue?ke:E.x,V.y=J?Ne:E.y,E.x=V.x,E.y=V.y,T.length>0)){const Me=ke-W,_e=Ne-G;for(const Qe of T)Qe.position={x:Qe.position.x-Me+P[0]*(le-L),y:Qe.position.y-_e+P[1]*(xe-z)},H.push(Qe)}if((se||ve)&&(V.width=se&&(!o.resizeDirection||o.resizeDirection==="horizontal")?le:E.width,V.height=ve&&(!o.resizeDirection||o.resizeDirection==="vertical")?xe:E.height,E.width=V.width,E.height=V.height),M&&N.expandParent){const Me=P[0]*(V.width??0);V.x&&V.x<Me&&(E.x=Me,C.x=C.x-(V.x-Me));const _e=P[1]*(V.height??0);V.y&&V.y<_e&&(E.y=_e,C.y=C.y-(V.y-_e))}const we=DV({width:E.width,prevWidth:L,height:E.height,prevHeight:z,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),re={...E,direction:we};(S==null?void 0:S(K,re))!==!1&&(B=!0,k==null||k(K,re),i(V,H))}).on("end",K=>{B&&(v==null||v(K,{...E}),a==null||a({...E}),B=!1)});l.call(U)}function f(){l.on(".drag",null)}return{update:d,destroy:f}}var vy={exports:{}},wy={},ky={exports:{}},Ey={};/**
664
+ * @license React
665
+ * use-sync-external-store-shim.production.js
666
+ *
667
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
668
+ *
669
+ * This source code is licensed under the MIT license found in the
670
+ * LICENSE file in the root directory of this source tree.
671
+ */var CS;function zV(){if(CS)return Ey;CS=1;var e=Ku();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,S=k[1];return l(function(){v.value=b,v.getSnapshot=y,f(v)&&S({inst:v})},[m,b,y]),a(function(){return f(v)&&S({inst:v}),m(function(){f(v)&&S({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 p(m,y){return y()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:d;return Ey.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,Ey}var AS;function PV(){return AS||(AS=1,ky.exports=zV()),ky.exports}/**
672
+ * @license React
673
+ * use-sync-external-store-shim/with-selector.production.js
674
+ *
675
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
676
+ *
677
+ * This source code is licensed under the MIT license found in the
678
+ * LICENSE file in the root directory of this source tree.
679
+ */var TS;function BV(){if(TS)return wy;TS=1;var e=Ku(),t=PV();function n(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&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 wy.useSyncExternalStoreWithSelector=function(p,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(M){if(!C){if(C=!0,N=M,M=y(M),b!==void 0&&v.hasValue){var O=v.value;if(b(O,M))return _=O}return _=M}if(O=_,i(N,M))return O;var R=y(M);return b!==void 0&&b(O,R)?(N=M,O):(N=M,_=R)}var C=!1,N,_,T=m===void 0?null:m;return[function(){return E(g())},T===null?void 0:function(){return E(T())}]},[g,m,y,b]);var S=a(p,k[0],k[1]);return o(function(){v.hasValue=!0,v.value=S},[S]),f(S),S},wy}var MS;function $V(){return MS||(MS=1,vy.exports=BV()),vy.exports}var UV=$V();const FV=Hu(UV),qV={},DS=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:()=>p,subscribe:g=>(n.add(g),()=>n.delete(g)),destroy:()=>{(qV?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},p=t=e(i,a,f);return f},HV=e=>e?DS(e):DS,{useDebugValue:KV}=dD,{useSyncExternalStoreWithSelector:GV}=FV,VV=e=>e;function yA(e,t=VV,n){const i=GV(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return KV(i),i}const OS=(e,t)=>{const n=HV(e),i=(a,l=t)=>yA(n,a,l);return Object.assign(i,n),i},YV=(e,t)=>e?OS(e,t):OS;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 xh=j.createContext(null),WV=xh.Provider,bA=pr.error001("react");function Nt(e,t){const n=j.useContext(xh);if(n===null)throw new Error(bA);return yA(n,e,t)}function nn(){const e=j.useContext(xh);if(e===null)throw new Error(bA);return j.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const RS={display:"none"},QV={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},xA="react-flow__node-desc",vA="react-flow__edge-desc",XV="react-flow__aria-live",ZV=e=>e.ariaLiveMessage,JV=e=>e.ariaLabelConfig;function eY({rfId:e}){const t=Nt(ZV);return c.jsx("div",{id:`${XV}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:QV,children:t})}function tY({rfId:e,disableKeyboardA11y:t}){const n=Nt(JV);return c.jsxs(c.Fragment,{children:[c.jsx("div",{id:`${xA}-${e}`,style:RS,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),c.jsx("div",{id:`${vA}-${e}`,style:RS,children:n["edge.a11yDescription.default"]}),!t&&c.jsx(eY,{rfId:e})]})}const vh=j.forwardRef(({position:e="top-left",children:t,className:n,style:i,...a},l)=>{const o=`${e}`.split("-");return c.jsx("div",{className:_n(["react-flow__panel",n,...o]),style:i,ref:l,...a,children:t})});vh.displayName="Panel";const LS="https://reactflow.dev?utm_source=attribution";function nY({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:c.jsx(vh,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${LS}`,children:c.jsx("a",{href:LS,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const iY=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}},Wf=e=>e.id;function rY(e,t){return tn(e.selectedNodes.map(Wf),t.selectedNodes.map(Wf))&&tn(e.selectedEdges.map(Wf),t.selectedEdges.map(Wf))}function aY({onSelectionChange:e}){const t=nn(),{selectedNodes:n,selectedEdges:i}=Nt(iY,rY);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 sY=e=>!!e.onSelectionChangeHandlers;function lY({onSelectionChange:e}){const t=Nt(sY);return e||t?c.jsx(aY,{onSelectionChange:e}):null}const wA=[0,0],oY={x:0,y:0,zoom:1},cY=["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"],IS=[...cY,"rfId"],uY=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}),zS={translateExtent:Ru,nodeOrigin:wA,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function dY(e){const{setNodes:t,setEdges:n,setMinZoom:i,setMaxZoom:a,setTranslateExtent:l,setNodeExtent:o,reset:d,setDefaultNodesAndEdges:f}=Nt(uY,tn),p=nn();j.useEffect(()=>(f(e.defaultNodes,e.defaultEdges),()=>{g.current=zS,d()}),[]);const g=j.useRef(zS);return j.useEffect(()=>{for(const m of IS){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"?p.setState({ariaLabelConfig:WG(y)}):m==="fitView"?p.setState({fitViewQueued:y}):m==="fitViewOptions"?p.setState({fitViewOptions:y}):p.setState({[m]:y})))}g.current=e},IS.map(m=>e[m])),null}function PS(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function fY(e){var i;const[t,n]=j.useState(e==="system"?null:e);return j.useEffect(()=>{if(e!=="system"){n(e);return}const a=PS(),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=PS())!=null&&i.matches?"dark":"light"}const BS=typeof document<"u"?document:null;function Pu(e=null,t={target:BS,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 p=(Array.isArray(e)?e:[e]).filter(m=>typeof m=="string").map(m=>m.replace("+",`
680
+ `).replace(`
681
+
682
+ `,`
683
+ +`).split(`
684
+ `)),g=p.reduce((m,y)=>m.concat(...y),[]);return[p,g]}return[[],[]]},[e]);return j.useEffect(()=>{const f=(t==null?void 0:t.target)??BS,p=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const g=b=>{var S,E;if(a.current=b.ctrlKey||b.metaKey||b.shiftKey||b.altKey,(!a.current||a.current&&!p)&&eA(b))return!1;const v=US(b.code,d);if(l.current.add(b[v]),$S(o,l.current,!1)){const C=((E=(S=b.composedPath)==null?void 0:S.call(b))==null?void 0:E[0])||b.target,N=(C==null?void 0:C.nodeName)==="BUTTON"||(C==null?void 0:C.nodeName)==="A";t.preventDefault!==!1&&(a.current||!N)&&b.preventDefault(),i(!0)}},m=b=>{const k=US(b.code,d);$S(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 $S(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(a=>t.has(a)))}function US(e,t){return t.includes(e)?"code":"key"}const pY=()=>{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=Jx(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(),p={x:t.x-d,y:t.y-f},g=n.snapGrid??a,m=n.snapToGrid??l;return cd(p,i,m,g)},flowToScreenPosition:t=>{const{transform:n,domNode:i}=e.getState();if(!i)return t;const{x:a,y:l}=i.getBoundingClientRect(),o=Vo(t,n);return{x:o.x+a,y:o.y+l}}}),[])};function kA(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)hY(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 hY(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 EA(e,t){return kA(e,t)}function SA(e,t){return kA(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 FS({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 qS(e){return{id:e.id,type:"remove"}}const mY=QC();function gY(e,t,n={}){return tV(e,t,{...n,onError:n.onError??mY})}const HS=e=>$G(e),yY=e=>KC(e);function NA(e){return j.forwardRef(e)}const bY=typeof window<"u"?j.useLayoutEffect:j.useEffect;function KS(e){const[t,n]=j.useState(BigInt(0)),[i]=j.useState(()=>xY(()=>n(a=>a+BigInt(1))));return bY(()=>{const a=i.get();a.length&&(e(a),i.reset())},[t]),i}function xY(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const _A=j.createContext(null);function vY({children:e}){const t=nn(),n=j.useCallback(d=>{const{nodes:f=[],setNodes:p,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 S=FS({items:v,lookup:y});for(const E of k.values())S=E(S);g&&p(v),S.length>0?m==null||m(S):b&&window.requestAnimationFrame(()=>{const{fitViewQueued:E,nodes:C,setNodes:N}=t.getState();E&&N(C)})},[]),i=KS(n),a=j.useCallback(d=>{const{edges:f=[],setEdges:p,hasDefaultEdges:g,onEdgesChange:m,edgeLookup:y}=t.getState();let b=f;for(const k of d)b=typeof k=="function"?k(b):k;g?p(b):m&&m(FS({items:b,lookup:y}))},[]),l=KS(a),o=j.useMemo(()=>({nodeQueue:i,edgeQueue:l}),[]);return c.jsx(_A.Provider,{value:o,children:e})}function wY(){const e=j.useContext(_A);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const kY=e=>!!e.panZoom;function wh(){const e=pY(),t=nn(),n=wY(),i=Nt(kY),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=HS(m)?m:y.get(m.id),v=k.parentId?ZC(k.position,k.measured,k.parentId,y,b):k.position,S={...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 Iu(S)},p=(m,y,b={replace:!1})=>{o(k=>k.map(v=>{if(v.id===m){const S=typeof y=="function"?y(v):y;return b.replace&&HS(S)?S:{...v,...S}}return v}))},g=(m,y,b={replace:!1})=>{d(k=>k.map(v=>{if(v.id===m){const S=typeof y=="function"?y(v):y;return b.replace&&yY(S)?S:{...v,...S}}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,S]=b;return{nodes:m.map(E=>({...E})),edges:y.map(E=>({...E})),viewport:{x:k,y:v,zoom:S}}},deleteElements:async({nodes:m=[],edges:y=[]})=>{const{nodes:b,edges:k,onNodesDelete:v,onEdgesDelete:S,triggerNodeChanges:E,triggerEdgeChanges:C,onDelete:N,onBeforeDelete:_}=t.getState(),{nodes:T,edges:M}=await KG({nodesToRemove:m,edgesToRemove:y,nodes:b,edges:k,onBeforeDelete:_}),O=M.length>0,R=T.length>0;if(O){const B=M.map(qS);S==null||S(M),C(B)}if(R){const B=T.map(qS);v==null||v(T),E(B)}return(R||O)&&(N==null||N({nodes:T,edges:M})),{deletedNodes:T,deletedEdges:M}},getIntersectingNodes:(m,y=!0,b)=>{const k=mS(m),v=k?m:f(m),S=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 N=Iu(S?E:C),_=Pp(N,v);return y&&_>0||_>=N.width*N.height||_>=v.width*v.height}):[]},isNodeIntersecting:(m,y,b=!0)=>{const v=mS(m)?m:f(m);if(!v)return!1;const S=Pp(v,y);return b&&S>0||S>=y.width*y.height||S>=v.width*v.height},updateNode:p,updateNodeData:(m,y,b={replace:!1})=>{p(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 UG(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??YG();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 GS=e=>e.selected,EY=typeof window<"u"?window:void 0;function SY({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=nn(),{deleteElements:i}=wh(),a=Pu(e,{actInsideInputWithModifier:!1}),l=Pu(t,{target:EY});j.useEffect(()=>{if(a){const{edges:o,nodes:d}=n.getState();i({nodes:d.filter(GS),edges:o.filter(GS)}),n.setState({nodesSelectionActive:!1})}},[a]),j.useEffect(()=>{n.setState({multiSelectionActive:l})},[l])}function NY(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=ev(e.current);(i.height===0||i.width===0)&&((d=(o=t.getState()).onError)==null||d.call(o,"004",pr.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 kh={position:"absolute",width:"100%",height:"100%",top:0,left:0},_Y=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function jY({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:p,minZoom:g,maxZoom:m,zoomActivationKeyCode:y,preventScrolling:b=!0,children:k,noWheelClassName:v,noPanClassName:S,onViewportChange:E,isControlledViewport:C,paneClickDistance:N,selectionOnDrag:_}){const T=nn(),M=j.useRef(null),{userSelectionActive:O,lib:R,connectionInProgress:B}=Nt(_Y,tn),U=Pu(y),K=j.useRef();NY(M);const q=j.useCallback(Y=>{E==null||E({x:Y[0],y:Y[1],zoom:Y[2]}),C||T.setState({transform:Y})},[E,C]);return j.useEffect(()=>{if(M.current){K.current=MV({domNode:M.current,minZoom:g,maxZoom:m,translateExtent:p,viewport:f,onDraggingChange:I=>T.setState(H=>H.paneDragging===I?H:{paneDragging:I}),onPanZoomStart:(I,H)=>{const{onViewportChangeStart:W,onMoveStart:G}=T.getState();G==null||G(I,H),W==null||W(H)},onPanZoom:(I,H)=>{const{onViewportChange:W,onMove:G}=T.getState();G==null||G(I,H),W==null||W(H)},onPanZoomEnd:(I,H)=>{const{onViewportChangeEnd:W,onMoveEnd:G}=T.getState();G==null||G(I,H),W==null||W(H)}});const{x:Y,y:D,zoom:F}=K.current.getViewport();return T.setState({panZoom:K.current,transform:[Y,D,F],domNode:M.current.closest(".react-flow")}),()=>{var I;(I=K.current)==null||I.destroy()}}},[]),j.useEffect(()=>{var Y;(Y=K.current)==null||Y.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:a,panOnScrollMode:l,zoomOnDoubleClick:o,panOnDrag:d,zoomActivationKeyPressed:U,preventScrolling:b,noPanClassName:S,userSelectionActive:O,noWheelClassName:v,lib:R,onTransformChange:q,connectionInProgress:B,selectionOnDrag:_,paneClickDistance:N})},[e,t,n,i,a,l,o,d,U,b,S,O,v,R,q,B,_,N]),c.jsx("div",{className:"react-flow__renderer",ref:M,style:kh,children:k})}const CY=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function AY(){const{userSelectionActive:e,userSelectionRect:t}=Nt(CY,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 Sy=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},TY=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function MY({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Lu.Full,panOnDrag:i,autoPanOnSelection:a,paneClickDistance:l,selectionOnDrag:o,onSelectionStart:d,onSelectionEnd:f,onPaneClick:p,onPaneContextMenu:g,onPaneScroll:m,onPaneMouseEnter:y,onPaneMouseMove:b,onPaneMouseLeave:k,children:v}){const S=j.useRef(0),E=nn(),{userSelectionActive:C,elementsSelectable:N,dragging:_,panBy:T,autoPanSpeed:M}=Nt(TY,tn),O=N&&(e||C),R=j.useRef(null),B=j.useRef(),U=j.useRef(new Set),K=j.useRef(new Set),q=j.useRef(!1),Y=j.useRef(!1),D=j.useRef({x:0,y:0}),F=j.useRef(!1),I=se=>{if(Y.current||q.current||E.getState().connection.inProgress){Y.current=!1,q.current=!1;return}p==null||p(se),E.getState().resetSelectedElements(),E.setState({nodesSelectionActive:!1})},H=se=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){se.preventDefault();return}g==null||g(se)},W=m?se=>m(se):void 0,G=se=>{Y.current&&(se.stopPropagation(),Y.current=!1)},L=se=>{var Qe,Ue;const{domNode:ve,transform:ue}=E.getState();if(B.current=ve==null?void 0:ve.getBoundingClientRect(),!B.current)return;const J=se.target===R.current;if(!J&&!!se.target.closest(".nokey")||!e||!(o&&J||t)||se.button!==0||!se.isPrimary)return;(Ue=(Qe=se.target)==null?void 0:Qe.setPointerCapture)==null||Ue.call(Qe,se.pointerId),Y.current=!1;const{x:Ce,y:Me}=ur(se.nativeEvent,B.current),_e=cd({x:Ce,y:Me},ue);E.setState({userSelectionRect:{width:0,height:0,startX:_e.x,startY:_e.y,x:Ce,y:Me}}),J||(se.stopPropagation(),se.preventDefault())};function z(se,ve){const{userSelectionRect:ue}=E.getState();if(!ue)return;const{transform:J,nodeLookup:we,edgeLookup:re,connectionLookup:Ce,triggerNodeChanges:Me,triggerEdgeChanges:_e,defaultEdgeOptions:Qe}=E.getState(),Ue={x:ue.startX,y:ue.startY},{x:ce,y:be}=Vo(Ue,J),ge={startX:Ue.x,startY:Ue.y,x:se<ce?se:ce,y:ve<be?ve:be,width:Math.abs(se-ce),height:Math.abs(ve-be)},pe=U.current,Se=K.current;U.current=new Set(Xx(we,ge,J,n===Lu.Partial,!0).map(He=>He.id)),K.current=new Set;const je=(Qe==null?void 0:Qe.selectable)??!0;for(const He of U.current){const te=Ce.get(He);if(te)for(const{edgeId:de}of te.values()){const Le=re.get(de);Le&&(Le.selectable??je)&&K.current.add(de)}}if(!gS(pe,U.current)){const He=wo(we,U.current,!0);Me(He)}if(!gS(Se,K.current)){const He=wo(re,K.current);_e(He)}E.setState({userSelectionRect:ge,userSelectionActive:!0,nodesSelectionActive:!1})}function V(){if(!a||!B.current)return;const[se,ve]=Zx(D.current,B.current,M);T({x:se,y:ve}).then(ue=>{if(!Y.current||!ue){S.current=requestAnimationFrame(V);return}const{x:J,y:we}=D.current;z(J,we),S.current=requestAnimationFrame(V)})}const P=()=>{cancelAnimationFrame(S.current),S.current=0,F.current=!1};j.useEffect(()=>()=>P(),[]);const le=se=>{const{userSelectionRect:ve,transform:ue,resetSelectedElements:J}=E.getState();if(!B.current||!ve)return;const{x:we,y:re}=ur(se.nativeEvent,B.current);D.current={x:we,y:re};const Ce=Vo({x:ve.startX,y:ve.startY},ue);if(!Y.current){const Me=t?0:l;if(Math.hypot(we-Ce.x,re-Ce.y)<=Me)return;J(),d==null||d(se)}Y.current=!0,F.current||(V(),F.current=!0),z(we,re)},xe=se=>{var ve,ue;if(!O){se.target===R.current&&E.getState().connection.inProgress&&(q.current=!0);return}se.button===0&&((ue=(ve=se.target)==null?void 0:ve.releasePointerCapture)==null||ue.call(ve,se.pointerId),!C&&se.target===R.current&&E.getState().userSelectionRect&&(I==null||I(se)),E.setState({userSelectionActive:!1,userSelectionRect:null}),Y.current&&(f==null||f(se),E.setState({nodesSelectionActive:U.current.size>0})),P())},ke=se=>{var ve,ue;(ue=(ve=se.target)==null?void 0:ve.releasePointerCapture)==null||ue.call(ve,se.pointerId),P()},Ne=i===!0||Array.isArray(i)&&i.includes(0);return c.jsxs("div",{className:_n(["react-flow__pane",{draggable:Ne,dragging:_,selection:e}]),onClick:O?void 0:Sy(I,R),onContextMenu:Sy(H,R),onWheel:Sy(W,R),onPointerEnter:O?void 0:y,onPointerMove:O?le:b,onPointerUp:xe,onPointerCancel:O?ke:void 0,onPointerDownCapture:O?L:void 0,onClickCapture:O?G:void 0,onPointerLeave:k,ref:R,style:kh,children:[v,c.jsx(AY,{})]})}function Nb({id:e,store:t,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:a,unselectNodesAndEdges:l,multiSelectionActive:o,nodeLookup:d,onError:f}=t.getState(),p=d.get(e);if(!p){f==null||f("012",pr.error012(e));return}t.setState({nodesSelectionActive:!1}),p.selected?(n||p.selected&&o)&&(l({nodes:[p],edges:[]}),requestAnimationFrame(()=>{var g;return(g=i==null?void 0:i.current)==null?void 0:g.blur()})):a([e])}function jA({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:a,isSelectable:l,nodeClickDistance:o}){const d=nn(),[f,p]=j.useState(!1),g=j.useRef();return j.useEffect(()=>{g.current=yV({getStoreItems:()=>d.getState(),onNodeMouseDown:m=>{Nb({id:m,store:d,nodeRef:e})},onDragStart:()=>{p(!0)},onDragStop:()=>{p(!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 DY=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function CA(){const e=nn();return j.useCallback(n=>{const{nodeExtent:i,snapToGrid:a,snapGrid:l,nodesDraggable:o,onError:d,updateNodePositions:f,nodeLookup:p,nodeOrigin:g}=e.getState(),m=new Map,y=DY(o),b=a?l[0]:5,k=a?l[1]:5,v=n.direction.x*b*n.factor,S=n.direction.y*k*n.factor;for(const[,E]of p){if(!y(E))continue;let C={x:E.internals.positionAbsolute.x+v,y:E.internals.positionAbsolute.y+S};a&&(C=od(C,l));const{position:N,positionAbsolute:_}=GC({nodeId:E.id,nextPosition:C,nodeLookup:p,nodeExtent:i,nodeOrigin:g,onError:d});E.position=N,E.internals.positionAbsolute=_,m.set(E.id,E)}f(m)},[])}const sv=j.createContext(null),OY=sv.Provider;sv.Consumer;const AA=()=>j.useContext(sv),RY=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),TA=j.createContext(null);function LY({children:e}){const t=Nt(RY,tn);return c.jsx(TA.Provider,{value:t,children:e})}function IY(){const e=j.useContext(TA);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const zY={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},PY=(e,t,n)=>i=>{const{connectionClickStartHandle:a,connectionMode:l,connection:o}=i,{fromHandle:d,toHandle:f,isValid:p}=o;if(!d&&!a)return zY;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===Ko.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&&p}};function BY({type:e="source",position:t=Ke.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:a=!0,isConnectableEnd:l=!0,id:o,onConnect:d,children:f,className:p,onMouseDown:g,onTouchStart:m,...y},b){var F,I;const k=o||null,v=e==="target",S=nn(),E=AA(),{connectOnClick:C,noPanClassName:N,rfId:_}=IY(),{connectingFrom:T,connectingTo:M,clickConnecting:O,isPossibleEndHandle:R,connectionInProcess:B,clickConnectionInProcess:U,valid:K}=Nt(PY(E,k,e),tn);E||(I=(F=S.getState()).onError)==null||I.call(F,"010",pr.error010());const q=H=>{const{defaultEdgeOptions:W,onConnect:G,hasDefaultEdges:L}=S.getState(),z={...W,...H};if(L){const{edges:V,setEdges:P,onError:le}=S.getState();P(gY(z,V,{onError:le}))}G==null||G(z),d==null||d(z)},Y=H=>{if(!E)return;const W=tA(H.nativeEvent);if(a&&(W&&H.button===0||!W)){const G=S.getState();Sb.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=S.getState()).onConnectEnd)==null?void 0:V.call(z,...L)},updateConnection:G.updateConnection,onConnect:q,isValidConnection:n||((...L)=>{var z,V;return((V=(z=S.getState()).isValidConnection)==null?void 0:V.call(z,...L))??!0}),getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:G.autoPanSpeed,dragThreshold:G.connectionDragThreshold})}W?g==null||g(H):m==null||m(H)},D=H=>{const{onClickConnectStart:W,onClickConnectEnd:G,connectionClickStartHandle:L,connectionMode:z,isValidConnection:V,lib:P,rfId:le,nodeLookup:xe,connection:ke}=S.getState();if(!E||!L&&!a)return;if(!L){W==null||W(H.nativeEvent,{nodeId:E,handleId:k,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:E,type:e,id:k}});return}const Ne=JC(H.target),se=n||V,{connection:ve,isValid:ue}=Sb.isValid(H.nativeEvent,{handle:{nodeId:E,id:k,type:e},connectionMode:z,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:se,flowId:le,doc:Ne,lib:P,nodeLookup:xe});ue&&ve&&q(ve);const J=structuredClone(ke);delete J.inProgress,J.toPosition=J.toHandle?J.toHandle.position:null,G==null||G(H,J),S.setState({connectionClickStartHandle:null})};return c.jsx("div",{"data-handleid":k,"data-nodeid":E,"data-handlepos":t,"data-id":`${_}-${E}-${k}-${e}`,className:_n(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",N,p,{source:!v,target:v,connectable:i,connectablestart:a,connectableend:l,clickconnecting:O,connectingfrom:T,connectingto:M,valid:K,connectionindicator:i&&(!B||R)&&(B||U?l:a)}]),onMouseDown:Y,onTouchStart:Y,onClick:C?D:void 0,ref:b,...y,children:f})}const Dr=j.memo(NA(BY));function $Y({data:e,isConnectable:t,sourcePosition:n=Ke.Bottom}){return c.jsxs(c.Fragment,{children:[e==null?void 0:e.label,c.jsx(Dr,{type:"source",position:n,isConnectable:t})]})}function UY({data:e,isConnectable:t,targetPosition:n=Ke.Top,sourcePosition:i=Ke.Bottom}){return c.jsxs(c.Fragment,{children:[c.jsx(Dr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,c.jsx(Dr,{type:"source",position:i,isConnectable:t})]})}function FY(){return null}function qY({data:e,isConnectable:t,targetPosition:n=Ke.Top}){return c.jsxs(c.Fragment,{children:[c.jsx(Dr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Bp={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},VS={input:$Y,default:UY,output:qY,group:FY};function HY(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 KY=e=>{const{width:t,height:n,x:i,y:a}=ld(e.nodeLookup,{filter:l=>!!l.selected});return{width:cr(t)?t:null,height:cr(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 GY({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=nn(),{width:a,height:l,transformString:o,userSelectionActive:d}=Nt(KY,tn),f=CA(),p=j.useRef(null);j.useEffect(()=>{var b;n||(b=p.current)==null||b.focus({preventScroll:!0})},[n]);const g=!d&&a!==null&&l!==null;if(jA({nodeRef:p,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(Bp,b.key)&&(b.preventDefault(),f({direction:Bp[b.key],factor:b.shiftKey?4:1}))};return c.jsx("div",{className:_n(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:c.jsx("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:m,tabIndex:n?void 0:-1,onKeyDown:n?void 0:y,style:{width:a,height:l}})})}const YS=typeof window<"u"?window:void 0,VY=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function MA({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:a,onPaneContextMenu:l,onPaneScroll:o,paneClickDistance:d,deleteKeyCode:f,selectionKeyCode:p,selectionOnDrag:g,selectionMode:m,onSelectionStart:y,onSelectionEnd:b,multiSelectionKeyCode:k,panActivationKeyCode:v,zoomActivationKeyCode:S,elementsSelectable:E,zoomOnScroll:C,zoomOnPinch:N,panOnScroll:_,panOnScrollSpeed:T,panOnScrollMode:M,zoomOnDoubleClick:O,panOnDrag:R,autoPanOnSelection:B,defaultViewport:U,translateExtent:K,minZoom:q,maxZoom:Y,preventScrolling:D,onSelectionContextMenu:F,noWheelClassName:I,noPanClassName:H,disableKeyboardA11y:W,onViewportChange:G,isControlledViewport:L}){const{nodesSelectionActive:z,userSelectionActive:V}=Nt(VY,tn),P=Pu(p,{target:YS}),le=Pu(v,{target:YS}),xe=le||R,ke=le||_,Ne=g&&xe!==!0,se=P||V||Ne;return SY({deleteKeyCode:f,multiSelectionKeyCode:k}),c.jsx(jY,{onPaneContextMenu:l,elementsSelectable:E,zoomOnScroll:C,zoomOnPinch:N,panOnScroll:ke,panOnScrollSpeed:T,panOnScrollMode:M,zoomOnDoubleClick:O,panOnDrag:!P&&xe,defaultViewport:U,translateExtent:K,minZoom:q,maxZoom:Y,zoomActivationKeyCode:S,preventScrolling:D,noWheelClassName:I,noPanClassName:H,onViewportChange:G,isControlledViewport:L,paneClickDistance:d,selectionOnDrag:Ne,children:c.jsxs(MY,{onSelectionStart:y,onSelectionEnd:b,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:a,onPaneContextMenu:l,onPaneScroll:o,panOnDrag:xe,autoPanOnSelection:B,isSelecting:!!se,selectionMode:m,selectionKeyPressed:P,paneClickDistance:d,selectionOnDrag:Ne,children:[e,z&&c.jsx(GY,{onSelectionContextMenu:F,noPanClassName:H,disableKeyboardA11y:W})]})})}MA.displayName="FlowRenderer";const YY=j.memo(MA),WY=e=>t=>e?Xx(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 QY(e){return Nt(j.useCallback(WY(e),[e]),tn)}const XY=e=>e.updateNodeInternals;function ZY(){const e=Nt(XY),[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 JY({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),p=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=p.current!==t,y=d.current!==e.sourcePosition,b=f.current!==e.targetPosition;(m||y||b)&&(p.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 eW({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:a,onContextMenu:l,onDoubleClick:o,nodesDraggable:d,elementsSelectable:f,nodesConnectable:p,nodesFocusable:g,resizeObserver:m,noDragClassName:y,noPanClassName:b,disableKeyboardA11y:k,rfId:v,nodeTypes:S,nodeClickDistance:E,onError:C}){const{node:N,internals:_,isParent:T}=Nt(se=>{const ve=se.nodeLookup.get(e),ue=se.parentLookup.has(e);return{node:ve,internals:ve.internals,isParent:ue}},tn);let M=N.type||"default",O=(S==null?void 0:S[M])||VS[M];O===void 0&&(C==null||C("003",pr.error003(M)),M="default",O=(S==null?void 0:S.default)||VS.default);const R=!!(N.draggable||d&&typeof N.draggable>"u"),B=!!(N.selectable||f&&typeof N.selectable>"u"),U=!!(N.connectable||p&&typeof N.connectable>"u"),K=!!(N.focusable||g&&typeof N.focusable>"u"),q=nn(),Y=XC(N),D=JY({node:N,nodeType:M,hasDimensions:Y,resizeObserver:m}),F=jA({nodeRef:D,disabled:N.hidden||!R,noDragClassName:y,handleSelector:N.dragHandle,nodeId:e,isSelectable:B,nodeClickDistance:E}),I=CA();if(N.hidden)return null;const H=va(N),W=HY(N),G=B||R||t||n||i||a,L=n?se=>n(se,{..._.userNode}):void 0,z=i?se=>i(se,{..._.userNode}):void 0,V=a?se=>a(se,{..._.userNode}):void 0,P=l?se=>l(se,{..._.userNode}):void 0,le=o?se=>o(se,{..._.userNode}):void 0,xe=se=>{const{selectNodesOnDrag:ve,nodeDragThreshold:ue}=q.getState();B&&(!ve||!R||ue>0)&&Nb({id:e,store:q,nodeRef:D}),t&&t(se,{..._.userNode})},ke=se=>{if(!(eA(se.nativeEvent)||k)){if(UC.includes(se.key)&&B){const ve=se.key==="Escape";Nb({id:e,store:q,unselect:ve,nodeRef:D})}else if(R&&N.selected&&Object.prototype.hasOwnProperty.call(Bp,se.key)){se.preventDefault();const{ariaLabelConfig:ve}=q.getState();q.setState({ariaLiveMessage:ve["node.a11yDescription.ariaLiveMessage"]({direction:se.key.replace("Arrow","").toLowerCase(),x:~~_.positionAbsolute.x,y:~~_.positionAbsolute.y})}),I({direction:Bp[se.key],factor:se.shiftKey?4:1})}}},Ne=()=>{var Ce;if(k||!((Ce=D.current)!=null&&Ce.matches(":focus-visible")))return;const{transform:se,width:ve,height:ue,autoPanOnNodeFocus:J,setCenter:we}=q.getState();if(!J)return;Xx(new Map([[e,N]]),{x:0,y:0,width:ve,height:ue},se,!0).length>0||we(N.position.x+H.width/2,N.position.y+H.height/2,{zoom:se[2]})};return c.jsx("div",{className:_n(["react-flow__node",`react-flow__node-${M}`,{[b]:R},N.className,{selected:N.selected,selectable:B,parent:T,draggable:R,dragging:F}]),ref:D,style:{zIndex:_.z,transform:`translate(${_.positionAbsolute.x}px,${_.positionAbsolute.y}px)`,pointerEvents:G?"all":"none",visibility:Y?"visible":"hidden",...N.style,...W},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:z,onMouseLeave:V,onContextMenu:P,onClick:xe,onDoubleClick:le,onKeyDown:K?ke:void 0,tabIndex:K?0:void 0,onFocus:K?Ne:void 0,role:N.ariaRole??(K?"group":void 0),"aria-roledescription":"node","aria-describedby":k?void 0:`${xA}-${v}`,"aria-label":N.ariaLabel,...N.domAttributes,children:c.jsx(OY,{value:e,children:c.jsx(O,{id:e,data:N.data,type:M,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:N.selected??!1,selectable:B,draggable:R,deletable:N.deletable??!0,isConnectable:U,sourcePosition:N.sourcePosition,targetPosition:N.targetPosition,dragging:F,dragHandle:N.dragHandle,zIndex:_.z,parentId:N.parentId,...H})})})}var tW=j.memo(eW);const nW=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function DA(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:a,onError:l}=Nt(nW,tn),o=QY(e.onlyRenderVisibleElements),d=ZY();return c.jsx("div",{className:"react-flow__nodes",style:kh,children:o.map(f=>c.jsx(tW,{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))})}DA.displayName="NodeRenderer";const iW=j.memo(DA);function rW(e){return Nt(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&&ZG({sourceNode:l,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&i.push(a.id)}return i},[e]),tn)}const aW=({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"})},sW=({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"})},WS={[Ip.Arrow]:aW,[Ip.ArrowClosed]:sW};function lW(e){const t=nn();return j.useMemo(()=>{var a,l;return Object.prototype.hasOwnProperty.call(WS,e)?WS[e]:((l=(a=t.getState()).onError)==null||l.call(a,"009",pr.error009(e)),null)},[e])}const oW=({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=lW(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},OA=({defaultColor:e,rfId:t})=>{const n=Nt(l=>l.edges),i=Nt(l=>l.defaultEdgeOptions),a=j.useMemo(()=>sV(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(oW,{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};OA.displayName="MarkerDefinitions";var cW=j.memo(OA);function RA({x:e,y:t,label:n,labelStyle:i,labelShowBg:a=!0,labelBgStyle:l,labelBgPadding:o=[2,4],labelBgBorderRadius:d=2,children:f,className:p,...g}){const[m,y]=j.useState({x:1,y:0,width:0,height:0}),b=_n(["react-flow__edge-textwrapper",p]),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}RA.displayName="EdgeText";const uW=j.memo(RA);function Eh({path:e,labelX:t,labelY:n,label:i,labelStyle:a,labelShowBg:l,labelBgStyle:o,labelBgPadding:d,labelBgBorderRadius:f,interactionWidth:p=20,...g}){return c.jsxs(c.Fragment,{children:[c.jsx("path",{...g,d:e,fill:"none",className:_n(["react-flow__edge-path",g.className])}),p?c.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:p,className:"react-flow__edge-interaction"}):null,i&&cr(t)&&cr(n)?c.jsx(uW,{x:t,y:n,label:i,labelStyle:a,labelShowBg:l,labelBgStyle:o,labelBgPadding:d,labelBgBorderRadius:f}):null]})}function QS({pos:e,x1:t,y1:n,x2:i,y2:a}){return e===Ke.Left||e===Ke.Right?[.5*(t+i),n]:[t,.5*(n+a)]}function LA({sourceX:e,sourceY:t,sourcePosition:n=Ke.Bottom,targetX:i,targetY:a,targetPosition:l=Ke.Top}){const[o,d]=QS({pos:n,x1:e,y1:t,x2:i,y2:a}),[f,p]=QS({pos:l,x1:i,y1:a,x2:e,y2:t}),[g,m,y,b]=nA({sourceX:e,sourceY:t,targetX:i,targetY:a,sourceControlX:o,sourceControlY:d,targetControlX:f,targetControlY:p});return[`M${e},${t} C${o},${d} ${f},${p} ${i},${a}`,g,m,y,b]}function IA(e){return j.memo(({id:t,sourceX:n,sourceY:i,targetX:a,targetY:l,sourcePosition:o,targetPosition:d,label:f,labelStyle:p,labelShowBg:g,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:b,style:k,markerEnd:v,markerStart:S,interactionWidth:E})=>{const[C,N,_]=LA({sourceX:n,sourceY:i,sourcePosition:o,targetX:a,targetY:l,targetPosition:d}),T=e.isInternal?void 0:t;return c.jsx(Eh,{id:T,path:C,labelX:N,labelY:_,label:f,labelStyle:p,labelShowBg:g,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:b,style:k,markerEnd:v,markerStart:S,interactionWidth:E})})}const dW=IA({isInternal:!1}),zA=IA({isInternal:!0});dW.displayName="SimpleBezierEdge";zA.displayName="SimpleBezierEdgeInternal";function PA(e){return j.memo(({id:t,sourceX:n,sourceY:i,targetX:a,targetY:l,label:o,labelStyle:d,labelShowBg:f,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:m,style:y,sourcePosition:b=Ke.Bottom,targetPosition:k=Ke.Top,markerEnd:v,markerStart:S,pathOptions:E,interactionWidth:C})=>{const[N,_,T]=wb({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}),M=e.isInternal?void 0:t;return c.jsx(Eh,{id:M,path:N,labelX:_,labelY:T,label:o,labelStyle:d,labelShowBg:f,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:m,style:y,markerEnd:v,markerStart:S,interactionWidth:C})})}const BA=PA({isInternal:!1}),$A=PA({isInternal:!0});BA.displayName="SmoothStepEdge";$A.displayName="SmoothStepEdgeInternal";function UA(e){return j.memo(({id:t,...n})=>{var a;const i=e.isInternal?void 0:t;return c.jsx(BA,{...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 fW=UA({isInternal:!1}),FA=UA({isInternal:!0});fW.displayName="StepEdge";FA.displayName="StepEdgeInternal";function qA(e){return j.memo(({id:t,sourceX:n,sourceY:i,targetX:a,targetY:l,label:o,labelStyle:d,labelShowBg:f,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:m,style:y,markerEnd:b,markerStart:k,interactionWidth:v})=>{const[S,E,C]=aA({sourceX:n,sourceY:i,targetX:a,targetY:l}),N=e.isInternal?void 0:t;return c.jsx(Eh,{id:N,path:S,labelX:E,labelY:C,label:o,labelStyle:d,labelShowBg:f,labelBgStyle:p,labelBgPadding:g,labelBgBorderRadius:m,style:y,markerEnd:b,markerStart:k,interactionWidth:v})})}const pW=qA({isInternal:!1}),HA=qA({isInternal:!0});pW.displayName="StraightEdge";HA.displayName="StraightEdgeInternal";function KA(e){return j.memo(({id:t,sourceX:n,sourceY:i,targetX:a,targetY:l,sourcePosition:o=Ke.Bottom,targetPosition:d=Ke.Top,label:f,labelStyle:p,labelShowBg:g,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:b,style:k,markerEnd:v,markerStart:S,pathOptions:E,interactionWidth:C})=>{const[N,_,T]=iA({sourceX:n,sourceY:i,sourcePosition:o,targetX:a,targetY:l,targetPosition:d,curvature:E==null?void 0:E.curvature}),M=e.isInternal?void 0:t;return c.jsx(Eh,{id:M,path:N,labelX:_,labelY:T,label:f,labelStyle:p,labelShowBg:g,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:b,style:k,markerEnd:v,markerStart:S,interactionWidth:C})})}const hW=KA({isInternal:!1}),GA=KA({isInternal:!0});hW.displayName="BezierEdge";GA.displayName="BezierEdgeInternal";const XS={default:GA,straight:HA,step:FA,smoothstep:$A,simplebezier:zA},ZS={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},mW=(e,t,n)=>n===Ke.Left?e-t:n===Ke.Right?e+t:e,gW=(e,t,n)=>n===Ke.Top?e-t:n===Ke.Bottom?e+t:e,JS="react-flow__edgeupdater";function eN({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:_n([JS,`${JS}-${d}`]),cx:mW(t,i,e),cy:gW(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function yW({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:i,sourceY:a,targetX:l,targetY:o,sourcePosition:d,targetPosition:f,onReconnect:p,onReconnectStart:g,onReconnectEnd:m,setReconnecting:y,setUpdateHover:b}){const k=nn(),v=(_,T)=>{if(_.button!==0)return;const{autoPanOnConnect:M,domNode:O,connectionMode:R,connectionRadius:B,lib:U,onConnectStart:K,cancelConnection:q,nodeLookup:Y,rfId:D,panBy:F,updateConnection:I}=k.getState(),H=T.type==="target",W=(z,V)=>{y(!1),m==null||m(z,n,T.type,V)},G=z=>p==null?void 0:p(n,z),L=(z,V)=>{y(!0),g==null||g(_,n,T.type),K==null||K(z,V)};Sb.onPointerDown(_.nativeEvent,{autoPanOnConnect:M,connectionMode:R,connectionRadius:B,domNode:O,handleId:T.id,nodeId:T.nodeId,nodeLookup:Y,isTarget:H,edgeUpdaterType:T.type,lib:U,flowId:D,cancelConnection:q,panBy:F,isValidConnection:(...z)=>{var V,P;return((P=(V=k.getState()).isValidConnection)==null?void 0:P.call(V,...z))??!0},onConnect:G,onConnectStart:L,onConnectEnd:(...z)=>{var V,P;return(P=(V=k.getState()).onConnectEnd)==null?void 0:P.call(V,...z)},onReconnectEnd:W,updateConnection:I,getTransform:()=>k.getState().transform,getFromHandle:()=>k.getState().connection.fromHandle,dragThreshold:k.getState().connectionDragThreshold,handleDomNode:_.currentTarget})},S=_=>v(_,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),E=_=>v(_,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),C=()=>b(!0),N=()=>b(!1);return c.jsxs(c.Fragment,{children:[(e===!0||e==="source")&&c.jsx(eN,{position:d,centerX:i,centerY:a,radius:t,onMouseDown:S,onMouseEnter:C,onMouseOut:N,type:"source"}),(e===!0||e==="target")&&c.jsx(eN,{position:f,centerX:l,centerY:o,radius:t,onMouseDown:E,onMouseEnter:C,onMouseOut:N,type:"target"})]})}function bW({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:a,onDoubleClick:l,onContextMenu:o,onMouseEnter:d,onMouseMove:f,onMouseLeave:p,reconnectRadius:g,onReconnect:m,onReconnectStart:y,onReconnectEnd:b,rfId:k,edgeTypes:v,noPanClassName:S,onError:E,disableKeyboardA11y:C}){let N=Nt(we=>we.edgeLookup.get(e));const _=Nt(we=>we.defaultEdgeOptions);N=_?{..._,...N}:N;let T=N.type||"default",M=(v==null?void 0:v[T])||XS[T];M===void 0&&(E==null||E("011",pr.error011(T)),T="default",M=(v==null?void 0:v.default)||XS.default);const O=!!(N.focusable||t&&typeof N.focusable>"u"),R=typeof m<"u"&&(N.reconnectable||n&&typeof N.reconnectable>"u"),B=!!(N.selectable||i&&typeof N.selectable>"u"),U=j.useRef(null),[K,q]=j.useState(!1),[Y,D]=j.useState(!1),F=nn(),{zIndex:I=N.zIndex,sourceX:H,sourceY:W,targetX:G,targetY:L,sourcePosition:z,targetPosition:V}=Nt(j.useCallback(we=>{const re=we.nodeLookup.get(N.source),Ce=we.nodeLookup.get(N.target);if(!re||!Ce)return ZS;const Me=aV({id:e,sourceNode:re,targetNode:Ce,sourceHandle:N.sourceHandle||null,targetHandle:N.targetHandle||null,connectionMode:we.connectionMode,onError:E}),_e=XG({selected:N.selected,zIndex:N.zIndex,sourceNode:re,targetNode:Ce,elevateOnSelect:we.elevateEdgesOnSelect,zIndexMode:we.zIndexMode});return{...Me||ZS,zIndex:_e}},[N.source,N.target,N.sourceHandle,N.targetHandle,N.selected,N.zIndex]),tn),P=j.useMemo(()=>N.markerStart?`url('#${kb(N.markerStart,k)}')`:void 0,[N.markerStart,k]),le=j.useMemo(()=>N.markerEnd?`url('#${kb(N.markerEnd,k)}')`:void 0,[N.markerEnd,k]);if(N.hidden||H===null||W===null||G===null||L===null)return null;const xe=we=>{var _e;const{addSelectedEdges:re,unselectNodesAndEdges:Ce,multiSelectionActive:Me}=F.getState();B&&(F.setState({nodesSelectionActive:!1}),N.selected&&Me?(Ce({nodes:[],edges:[N]}),(_e=U.current)==null||_e.blur()):re([e])),a&&a(we,N)},ke=l?we=>{l(we,{...N})}:void 0,Ne=o?we=>{o(we,{...N})}:void 0,se=d?we=>{d(we,{...N})}:void 0,ve=f?we=>{f(we,{...N})}:void 0,ue=p?we=>{p(we,{...N})}:void 0,J=we=>{var re;if(!C&&UC.includes(we.key)&&B){const{unselectNodesAndEdges:Ce,addSelectedEdges:Me}=F.getState();we.key==="Escape"?((re=U.current)==null||re.blur(),Ce({edges:[N]})):Me([e])}};return c.jsx("svg",{style:{zIndex:I},children:c.jsxs("g",{className:_n(["react-flow__edge",`react-flow__edge-${T}`,N.className,S,{selected:N.selected,animated:N.animated,inactive:!B&&!a,updating:K,selectable:B}]),onClick:xe,onDoubleClick:ke,onContextMenu:Ne,onMouseEnter:se,onMouseMove:ve,onMouseLeave:ue,onKeyDown:O?J:void 0,tabIndex:O?0:void 0,role:N.ariaRole??(O?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":N.ariaLabel===null?void 0:N.ariaLabel||`Edge from ${N.source} to ${N.target}`,"aria-describedby":O?`${vA}-${k}`:void 0,ref:U,...N.domAttributes,children:[!Y&&c.jsx(M,{id:e,source:N.source,target:N.target,type:N.type,selected:N.selected,animated:N.animated,selectable:B,deletable:N.deletable??!0,label:N.label,labelStyle:N.labelStyle,labelShowBg:N.labelShowBg,labelBgStyle:N.labelBgStyle,labelBgPadding:N.labelBgPadding,labelBgBorderRadius:N.labelBgBorderRadius,sourceX:H,sourceY:W,targetX:G,targetY:L,sourcePosition:z,targetPosition:V,data:N.data,style:N.style,sourceHandleId:N.sourceHandle,targetHandleId:N.targetHandle,markerStart:P,markerEnd:le,pathOptions:"pathOptions"in N?N.pathOptions:void 0,interactionWidth:N.interactionWidth}),R&&c.jsx(yW,{edge:N,isReconnectable:R,reconnectRadius:g,onReconnect:m,onReconnectStart:y,onReconnectEnd:b,sourceX:H,sourceY:W,targetX:G,targetY:L,sourcePosition:z,targetPosition:V,setUpdateHover:q,setReconnecting:D})]})})}var xW=j.memo(bW);const vW=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function VA({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:a,onReconnect:l,onEdgeContextMenu:o,onEdgeMouseEnter:d,onEdgeMouseMove:f,onEdgeMouseLeave:p,onEdgeClick:g,reconnectRadius:m,onEdgeDoubleClick:y,onReconnectStart:b,onReconnectEnd:k,disableKeyboardA11y:v}){const{edgesFocusable:S,edgesReconnectable:E,elementsSelectable:C,onError:N}=Nt(vW,tn),_=rW(t);return c.jsxs("div",{className:"react-flow__edges",children:[c.jsx(cW,{defaultColor:e,rfId:n}),_.map(T=>c.jsx(xW,{id:T,edgesFocusable:S,edgesReconnectable:E,elementsSelectable:C,noPanClassName:a,onReconnect:l,onContextMenu:o,onMouseEnter:d,onMouseMove:f,onMouseLeave:p,onClick:g,reconnectRadius:m,onDoubleClick:y,onReconnectStart:b,onReconnectEnd:k,rfId:n,onError:N,edgeTypes:i,disableKeyboardA11y:v},T))]})}VA.displayName="EdgeRenderer";const wW=j.memo(VA),kW=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function EW({children:e}){const t=Nt(kW);return c.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function SW(e){const t=wh(),n=j.useRef(!1);j.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const NW=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function _W(e){const t=Nt(NW),n=nn();return j.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function jW(e){return e.connection.inProgress?{...e.connection,to:cd(e.connection.to,e.transform)}:{...e.connection}}function CW(e){return jW}function AW(e){const t=CW();return Nt(t,tn)}const TW=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function MW({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:a,width:l,height:o,isValid:d,inProgress:f}=Nt(TW,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:_n(["react-flow__connection",HC(d)]),children:c.jsx(YA,{style:t,type:n,CustomComponent:i,isValid:d})})})}const YA=({style:e,type:t=os.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:a,from:l,fromNode:o,fromHandle:d,fromPosition:f,to:p,toNode:g,toHandle:m,toPosition:y,pointer:b}=AW();if(!a)return;if(n)return c.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:d,fromX:l.x,fromY:l.y,toX:p.x,toY:p.y,fromPosition:f,toPosition:y,connectionStatus:HC(i),toNode:g,toHandle:m,pointer:b});let k="";const v={sourceX:l.x,sourceY:l.y,sourcePosition:f,targetX:p.x,targetY:p.y,targetPosition:y};switch(t){case os.Bezier:[k]=iA(v);break;case os.SimpleBezier:[k]=LA(v);break;case os.Step:[k]=wb({...v,borderRadius:0});break;case os.SmoothStep:[k]=wb(v);break;default:[k]=aA(v)}return c.jsx("path",{d:k,fill:"none",className:"react-flow__connection-path",style:e})};YA.displayName="ConnectionLine";const DW={};function tN(e=DW){j.useRef(e),nn(),j.useEffect(()=>{},[e])}function OW(){nn(),j.useRef(!1),j.useEffect(()=>{},[])}function WA({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:o,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:p,onNodeContextMenu:g,onSelectionContextMenu:m,onSelectionStart:y,onSelectionEnd:b,connectionLineType:k,connectionLineStyle:v,connectionLineComponent:S,connectionLineContainerStyle:E,selectionKeyCode:C,selectionOnDrag:N,selectionMode:_,multiSelectionKeyCode:T,panActivationKeyCode:M,zoomActivationKeyCode:O,deleteKeyCode:R,onlyRenderVisibleElements:B,elementsSelectable:U,defaultViewport:K,translateExtent:q,minZoom:Y,maxZoom:D,preventScrolling:F,defaultMarkerColor:I,zoomOnScroll:H,zoomOnPinch:W,panOnScroll:G,panOnScrollSpeed:L,panOnScrollMode:z,zoomOnDoubleClick:V,panOnDrag:P,autoPanOnSelection:le,onPaneClick:xe,onPaneMouseEnter:ke,onPaneMouseMove:Ne,onPaneMouseLeave:se,onPaneScroll:ve,onPaneContextMenu:ue,paneClickDistance:J,nodeClickDistance:we,onEdgeContextMenu:re,onEdgeMouseEnter:Ce,onEdgeMouseMove:Me,onEdgeMouseLeave:_e,reconnectRadius:Qe,onReconnect:Ue,onReconnectStart:ce,onReconnectEnd:be,noDragClassName:ge,noWheelClassName:pe,noPanClassName:Se,disableKeyboardA11y:je,nodeExtent:He,rfId:te,viewport:de,onViewportChange:Le}){return tN(e),tN(t),OW(),SW(n),_W(de),c.jsx(YY,{onPaneClick:xe,onPaneMouseEnter:ke,onPaneMouseMove:Ne,onPaneMouseLeave:se,onPaneContextMenu:ue,onPaneScroll:ve,paneClickDistance:J,deleteKeyCode:R,selectionKeyCode:C,selectionOnDrag:N,selectionMode:_,onSelectionStart:y,onSelectionEnd:b,multiSelectionKeyCode:T,panActivationKeyCode:M,zoomActivationKeyCode:O,elementsSelectable:U,zoomOnScroll:H,zoomOnPinch:W,zoomOnDoubleClick:V,panOnScroll:G,panOnScrollSpeed:L,panOnScrollMode:z,panOnDrag:P,autoPanOnSelection:le,defaultViewport:K,translateExtent:q,minZoom:Y,maxZoom:D,onSelectionContextMenu:m,preventScrolling:F,noDragClassName:ge,noWheelClassName:pe,noPanClassName:Se,disableKeyboardA11y:je,onViewportChange:Le,isControlledViewport:!!de,children:c.jsxs(EW,{children:[c.jsx(wW,{edgeTypes:t,onEdgeClick:a,onEdgeDoubleClick:o,onReconnect:Ue,onReconnectStart:ce,onReconnectEnd:be,onlyRenderVisibleElements:B,onEdgeContextMenu:re,onEdgeMouseEnter:Ce,onEdgeMouseMove:Me,onEdgeMouseLeave:_e,reconnectRadius:Qe,defaultMarkerColor:I,noPanClassName:Se,disableKeyboardA11y:je,rfId:te}),c.jsx(MW,{style:v,type:k,component:S,containerStyle:E}),c.jsx("div",{className:"react-flow__edgelabel-renderer"}),c.jsx(iW,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:l,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:p,onNodeContextMenu:g,nodeClickDistance:we,onlyRenderVisibleElements:B,noPanClassName:Se,noDragClassName:ge,disableKeyboardA11y:je,nodeExtent:He,rfId:te}),c.jsx("div",{className:"react-flow__viewport-portal"})]})})}WA.displayName="GraphView";const RW=j.memo(WA),LW=QC(),nN=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:a,height:l,fitView:o,fitViewOptions:d,minZoom:f=.5,maxZoom:p=2,nodeOrigin:g,nodeExtent:m,zIndexMode:y="basic"}={})=>{const b=new Map,k=new Map,v=new Map,S=new Map,E=i??t??[],C=n??e??[],N=g??[0,0],_=m??Ru;oA(v,S,E);const{nodesInitialized:T}=Eb(C,b,k,{nodeOrigin:N,nodeExtent:_,zIndexMode:y});let M=[0,0,1];if(o&&a&&l){const O=ld(b,{filter:K=>!!((K.width||K.initialWidth)&&(K.height||K.initialHeight))}),{x:R,y:B,zoom:U}=Jx(O,a,l,f,p,(d==null?void 0:d.padding)??.1);M=[R,B,U]}return{rfId:"1",width:a??0,height:l??0,transform:M,nodes:C,nodesInitialized:T,nodeLookup:b,parentLookup:k,edges:E,edgeLookup:S,connectionLookup:v,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:f,maxZoom:p,translateExtent:Ru,nodeExtent:_,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ko.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:N,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:{...qC},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:LW,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:FC,zIndexMode:y,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},IW=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:a,height:l,fitView:o,fitViewOptions:d,minZoom:f,maxZoom:p,nodeOrigin:g,nodeExtent:m,zIndexMode:y})=>YV((b,k)=>{async function v(){const{nodeLookup:S,panZoom:E,fitViewOptions:C,fitViewResolver:N,width:_,height:T,minZoom:M,maxZoom:O}=k();E&&(await HG({nodes:S,width:_,height:T,panZoom:E,minZoom:M,maxZoom:O},C),N==null||N.resolve(!0),b({fitViewResolver:null}))}return{...nN({nodes:e,edges:t,width:a,height:l,fitView:o,fitViewOptions:d,minZoom:f,maxZoom:p,nodeOrigin:g,nodeExtent:m,defaultNodes:n,defaultEdges:i,zIndexMode:y}),setNodes:S=>{const{nodeLookup:E,parentLookup:C,nodeOrigin:N,elevateNodesOnSelect:_,fitViewQueued:T,zIndexMode:M,nodesSelectionActive:O}=k(),{nodesInitialized:R,hasSelectedNodes:B}=Eb(S,E,C,{nodeOrigin:N,nodeExtent:m,elevateNodesOnSelect:_,checkEquality:!0,zIndexMode:M}),U=O&&B;T&&R?(v(),b({nodes:S,nodesInitialized:R,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:U})):b({nodes:S,nodesInitialized:R,nodesSelectionActive:U})},setEdges:S=>{const{connectionLookup:E,edgeLookup:C}=k();oA(E,C,S),b({edges:S})},setDefaultNodesAndEdges:(S,E)=>{if(S){const{setNodes:C}=k();C(S),b({hasDefaultNodes:!0})}if(E){const{setEdges:C}=k();C(E),b({hasDefaultEdges:!0})}},updateNodeInternals:S=>{const{triggerNodeChanges:E,nodeLookup:C,parentLookup:N,domNode:_,nodeOrigin:T,nodeExtent:M,debug:O,fitViewQueued:R,zIndexMode:B}=k(),{changes:U,updatedInternals:K}=pV(S,C,N,_,T,M,B);K&&(cV(C,N,{nodeOrigin:T,nodeExtent:M,zIndexMode:B}),R?(v(),b({fitViewQueued:!1,fitViewOptions:void 0})):b({}),(U==null?void 0:U.length)>0&&(O&&console.log("React Flow: trigger node changes",U),E==null||E(U)))},updateNodePositions:(S,E=!1)=>{const C=[];let N=[];const{nodeLookup:_,triggerNodeChanges:T,connection:M,updateConnection:O,onNodesChangeMiddlewareMap:R}=k();for(const[B,U]of S){const K=_.get(B),q=!!(K!=null&&K.expandParent&&(K!=null&&K.parentId)&&(U!=null&&U.position)),Y={id:B,type:"position",position:q?{x:Math.max(0,U.position.x),y:Math.max(0,U.position.y)}:U.position,dragging:E};if(K&&M.inProgress&&M.fromNode.id===K.id){const D=vl(K,M.fromHandle,Ke.Left,!0);O({...M,from:D})}q&&K.parentId&&C.push({id:B,parentId:K.parentId,rect:{...U.internals.positionAbsolute,width:U.measured.width??0,height:U.measured.height??0}}),N.push(Y)}if(C.length>0){const{parentLookup:B,nodeOrigin:U}=k(),K=av(C,_,B,U);N.push(...K)}for(const B of R.values())N=B(N);T(N)},triggerNodeChanges:S=>{const{onNodesChange:E,setNodes:C,nodes:N,hasDefaultNodes:_,debug:T}=k();if(S!=null&&S.length){if(_){const M=EA(S,N);C(M)}T&&console.log("React Flow: trigger node changes",S),E==null||E(S)}},triggerEdgeChanges:S=>{const{onEdgesChange:E,setEdges:C,edges:N,hasDefaultEdges:_,debug:T}=k();if(S!=null&&S.length){if(_){const M=SA(S,N);C(M)}T&&console.log("React Flow: trigger edge changes",S),E==null||E(S)}},addSelectedNodes:S=>{const{multiSelectionActive:E,edgeLookup:C,nodeLookup:N,triggerNodeChanges:_,triggerEdgeChanges:T}=k();if(E){const M=S.map(O=>Ys(O,!0));_(M);return}_(wo(N,new Set([...S]),!0)),T(wo(C))},addSelectedEdges:S=>{const{multiSelectionActive:E,edgeLookup:C,nodeLookup:N,triggerNodeChanges:_,triggerEdgeChanges:T}=k();if(E){const M=S.map(O=>Ys(O,!0));T(M);return}T(wo(C,new Set([...S]))),_(wo(N,new Set,!0))},unselectNodesAndEdges:({nodes:S,edges:E}={})=>{const{edges:C,nodes:N,nodeLookup:_,triggerNodeChanges:T,triggerEdgeChanges:M}=k(),O=S||N,R=E||C,B=[];for(const K of O){if(!K.selected)continue;const q=_.get(K.id);q&&(q.selected=!1),B.push(Ys(K.id,!1))}const U=[];for(const K of R)K.selected&&U.push(Ys(K.id,!1));T(B),M(U)},setMinZoom:S=>{const{panZoom:E,maxZoom:C}=k();E==null||E.setScaleExtent([S,C]),b({minZoom:S})},setMaxZoom:S=>{const{panZoom:E,minZoom:C}=k();E==null||E.setScaleExtent([C,S]),b({maxZoom:S})},setTranslateExtent:S=>{var E;(E=k().panZoom)==null||E.setTranslateExtent(S),b({translateExtent:S})},resetSelectedElements:()=>{const{edges:S,nodes:E,triggerNodeChanges:C,triggerEdgeChanges:N,elementsSelectable:_}=k();if(!_)return;const T=E.reduce((O,R)=>R.selected?[...O,Ys(R.id,!1)]:O,[]),M=S.reduce((O,R)=>R.selected?[...O,Ys(R.id,!1)]:O,[]);C(T),N(M)},setNodeExtent:S=>{const{nodes:E,nodeLookup:C,parentLookup:N,nodeOrigin:_,elevateNodesOnSelect:T,nodeExtent:M,zIndexMode:O}=k();S[0][0]===M[0][0]&&S[0][1]===M[0][1]&&S[1][0]===M[1][0]&&S[1][1]===M[1][1]||(Eb(E,C,N,{nodeOrigin:_,nodeExtent:S,elevateNodesOnSelect:T,checkEquality:!1,zIndexMode:O}),b({nodeExtent:S}))},panBy:S=>{const{transform:E,width:C,height:N,panZoom:_,translateExtent:T}=k();return hV({delta:S,panZoom:_,transform:E,translateExtent:T,width:C,height:N})},setCenter:async(S,E,C)=>{const{width:N,height:_,maxZoom:T,panZoom:M}=k();if(!M)return!1;const O=typeof(C==null?void 0:C.zoom)<"u"?C.zoom:T;return await M.setViewport({x:N/2-S*O,y:_/2-E*O,zoom:O},{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:{...qC}})},updateConnection:S=>{b({connection:S})},reset:()=>b({...nN()})}},Object.is);function QA({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:a,initialHeight:l,initialMinZoom:o,initialMaxZoom:d,initialFitViewOptions:f,fitView:p,nodeOrigin:g,nodeExtent:m,zIndexMode:y,children:b}){const[k]=j.useState(()=>IW({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:a,height:l,fitView:p,minZoom:o,maxZoom:d,fitViewOptions:f,nodeOrigin:g,nodeExtent:m,zIndexMode:y}));return c.jsx(WV,{value:k,children:c.jsx(vY,{children:c.jsx(LY,{children:b})})})}function zW({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:a,width:l,height:o,fitView:d,fitViewOptions:f,minZoom:p,maxZoom:g,nodeOrigin:m,nodeExtent:y,zIndexMode:b}){return j.useContext(xh)?c.jsx(c.Fragment,{children:e}):c.jsx(QA,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:a,initialWidth:l,initialHeight:o,fitView:d,initialFitViewOptions:f,initialMinZoom:p,initialMaxZoom:g,nodeOrigin:m,nodeExtent:y,zIndexMode:b,children:e})}const PW={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function BW({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:a,nodeTypes:l,edgeTypes:o,onNodeClick:d,onEdgeClick:f,onInit:p,onMove:g,onMoveStart:m,onMoveEnd:y,onConnect:b,onConnectStart:k,onConnectEnd:v,onClickConnectStart:S,onClickConnectEnd:E,onNodeMouseEnter:C,onNodeMouseMove:N,onNodeMouseLeave:_,onNodeContextMenu:T,onNodeDoubleClick:M,onNodeDragStart:O,onNodeDrag:R,onNodeDragStop:B,onNodesDelete:U,onEdgesDelete:K,onDelete:q,onSelectionChange:Y,onSelectionDragStart:D,onSelectionDrag:F,onSelectionDragStop:I,onSelectionContextMenu:H,onSelectionStart:W,onSelectionEnd:G,onBeforeDelete:L,connectionMode:z,connectionLineType:V=os.Bezier,connectionLineStyle:P,connectionLineComponent:le,connectionLineContainerStyle:xe,deleteKeyCode:ke="Backspace",selectionKeyCode:Ne="Shift",selectionOnDrag:se=!1,selectionMode:ve=Lu.Full,panActivationKeyCode:ue="Space",multiSelectionKeyCode:J=zu()?"Meta":"Control",zoomActivationKeyCode:we=zu()?"Meta":"Control",snapToGrid:re,snapGrid:Ce,onlyRenderVisibleElements:Me=!1,selectNodesOnDrag:_e,nodesDraggable:Qe,autoPanOnNodeFocus:Ue,nodesConnectable:ce,nodesFocusable:be,nodeOrigin:ge=wA,edgesFocusable:pe,edgesReconnectable:Se,elementsSelectable:je=!0,defaultViewport:He=oY,minZoom:te=.5,maxZoom:de=2,translateExtent:Le=Ru,preventScrolling:Ze=!0,nodeExtent:rt,defaultMarkerColor:At="#b1b1b7",zoomOnScroll:$n=!0,zoomOnPinch:dn=!0,panOnScroll:Mt=!1,panOnScrollSpeed:Wt=.5,panOnScrollMode:yt=ul.Free,zoomOnDoubleClick:Ti=!0,panOnDrag:Rn=!0,onPaneClick:Nl,onPaneMouseEnter:Pr,onPaneMouseMove:wa,onPaneMouseLeave:Br,onPaneScroll:Un,onPaneContextMenu:Z,paneClickDistance:me=1,nodeClickDistance:Oe=0,children:it,onReconnect:qt,onReconnectStart:Ot,onReconnectEnd:$e,onEdgeContextMenu:ze,onEdgeDoubleClick:et,onEdgeMouseEnter:rn,onEdgeMouseMove:Vt,onEdgeMouseLeave:Qi,reconnectRadius:ka=10,onNodesChange:Ea,onEdgesChange:Mi,noDragClassName:an="nodrag",noWheelClassName:Tn="nowheel",noPanClassName:Xi="nopan",fitView:Sa,fitViewOptions:_s,connectOnClick:Na,attributionPosition:_l,proOptions:$r,defaultEdgeOptions:js,elevateNodesOnSelect:Ln=!0,elevateEdgesOnSelect:Zi=!1,disableKeyboardA11y:Ji=!1,autoPanOnConnect:xr,autoPanOnNodeDrag:fn,autoPanOnSelection:jl=!0,autoPanSpeed:Ur,connectionRadius:er,isValidConnection:Ae,onError:Ge,style:pt,id:_t,nodeDragThreshold:sn,connectionDragThreshold:Mn,viewport:Wn,onViewportChange:Fn,width:zt,height:Qn,colorMode:Cl="light",debug:_a,onScroll:vr,ariaLabelConfig:ja,zIndexMode:Al="basic",...qn},Cs){const tr=_t||"1",Ca=fY(Cl),jn=j.useCallback(As=>{As.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),vr==null||vr(As)},[vr]);return c.jsx("div",{"data-testid":"rf__wrapper",...qn,onScroll:jn,style:{...pt,...PW},ref:Cs,className:_n(["react-flow",a,Ca]),id:_t,role:"application",children:c.jsxs(zW,{nodes:e,edges:t,width:zt,height:Qn,fitView:Sa,fitViewOptions:_s,minZoom:te,maxZoom:de,nodeOrigin:ge,nodeExtent:rt,zIndexMode:Al,children:[c.jsx(dY,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:b,onConnectStart:k,onConnectEnd:v,onClickConnectStart:S,onClickConnectEnd:E,nodesDraggable:Qe,autoPanOnNodeFocus:Ue,nodesConnectable:ce,nodesFocusable:be,edgesFocusable:pe,edgesReconnectable:Se,elementsSelectable:je,elevateNodesOnSelect:Ln,elevateEdgesOnSelect:Zi,minZoom:te,maxZoom:de,nodeExtent:rt,onNodesChange:Ea,onEdgesChange:Mi,snapToGrid:re,snapGrid:Ce,connectionMode:z,translateExtent:Le,connectOnClick:Na,defaultEdgeOptions:js,fitView:Sa,fitViewOptions:_s,onNodesDelete:U,onEdgesDelete:K,onDelete:q,onNodeDragStart:O,onNodeDrag:R,onNodeDragStop:B,onSelectionDrag:F,onSelectionDragStart:D,onSelectionDragStop:I,onMove:g,onMoveStart:m,onMoveEnd:y,noPanClassName:Xi,nodeOrigin:ge,rfId:tr,autoPanOnConnect:xr,autoPanOnNodeDrag:fn,autoPanSpeed:Ur,onError:Ge,connectionRadius:er,isValidConnection:Ae,selectNodesOnDrag:_e,nodeDragThreshold:sn,connectionDragThreshold:Mn,onBeforeDelete:L,debug:_a,ariaLabelConfig:ja,zIndexMode:Al}),c.jsx(RW,{onInit:p,onNodeClick:d,onEdgeClick:f,onNodeMouseEnter:C,onNodeMouseMove:N,onNodeMouseLeave:_,onNodeContextMenu:T,onNodeDoubleClick:M,nodeTypes:l,edgeTypes:o,connectionLineType:V,connectionLineStyle:P,connectionLineComponent:le,connectionLineContainerStyle:xe,selectionKeyCode:Ne,selectionOnDrag:se,selectionMode:ve,deleteKeyCode:ke,multiSelectionKeyCode:J,panActivationKeyCode:ue,zoomActivationKeyCode:we,onlyRenderVisibleElements:Me,defaultViewport:He,translateExtent:Le,minZoom:te,maxZoom:de,preventScrolling:Ze,zoomOnScroll:$n,zoomOnPinch:dn,zoomOnDoubleClick:Ti,panOnScroll:Mt,panOnScrollSpeed:Wt,panOnScrollMode:yt,panOnDrag:Rn,autoPanOnSelection:jl,onPaneClick:Nl,onPaneMouseEnter:Pr,onPaneMouseMove:wa,onPaneMouseLeave:Br,onPaneScroll:Un,onPaneContextMenu:Z,paneClickDistance:me,nodeClickDistance:Oe,onSelectionContextMenu:H,onSelectionStart:W,onSelectionEnd:G,onReconnect:qt,onReconnectStart:Ot,onReconnectEnd:$e,onEdgeContextMenu:ze,onEdgeDoubleClick:et,onEdgeMouseEnter:rn,onEdgeMouseMove:Vt,onEdgeMouseLeave:Qi,reconnectRadius:ka,defaultMarkerColor:At,noDragClassName:an,noWheelClassName:Tn,noPanClassName:Xi,rfId:tr,disableKeyboardA11y:Ji,nodeExtent:rt,viewport:Wn,onViewportChange:Fn}),c.jsx(lY,{onSelectionChange:Y}),it,c.jsx(nY,{proOptions:$r,position:_l}),c.jsx(tY,{rfId:tr,disableKeyboardA11y:Ji})]})})}var $W=NA(BW);function UW(e){const[t,n]=j.useState(e),i=j.useCallback(a=>n(l=>EA(a,l)),[]);return[t,n,i]}function FW(e){const[t,n]=j.useState(e),i=j.useCallback(a=>n(l=>SA(a,l)),[]);return[t,n,i]}function qW({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:_n(["react-flow__background-pattern",n,i])})}function HW({radius:e,className:t}){return c.jsx("circle",{cx:e,cy:e,r:e,className:_n(["react-flow__background-pattern","dots",t])})}var ha;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ha||(ha={}));const KW={[ha.Dots]:1,[ha.Lines]:1,[ha.Cross]:6},GW=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function XA({id:e,variant:t=ha.Dots,gap:n=20,size:i,lineWidth:a=1,offset:l=0,color:o,bgColor:d,style:f,className:p,patternClassName:g}){const m=j.useRef(null),{transform:y,patternId:b}=Nt(GW,tn),k=i||KW[t],v=t===ha.Dots,S=t===ha.Cross,E=Array.isArray(n)?n:[n,n],C=[E[0]*y[2]||1,E[1]*y[2]||1],N=k*y[2],_=Array.isArray(l)?l:[l,l],T=S?[N,N]:C,M=[_[0]*y[2]||1+T[0]/2,_[1]*y[2]||1+T[1]/2],O=`${b}${e||""}`;return c.jsxs("svg",{className:_n(["react-flow__background",p]),style:{...f,...kh,"--xy-background-color-props":d,"--xy-background-pattern-color-props":o},ref:m,"data-testid":"rf__background",children:[c.jsx("pattern",{id:O,x:y[0]%C[0],y:y[1]%C[1],width:C[0],height:C[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${M[0]},-${M[1]})`,children:v?c.jsx(HW,{radius:N/2,className:g}):c.jsx(qW,{dimensions:T,lineWidth:a,variant:t,className:g})}),c.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${O})`})]})}XA.displayName="Background";const VW=j.memo(XA);function YW(){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 WW(){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 QW(){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 XW(){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 ZW(){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 Qf({children:e,className:t,...n}){return c.jsx("button",{type:"button",className:_n(["react-flow__controls-button",t]),...n,children:e})}const JW=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function ZA({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:a,onZoomIn:l,onZoomOut:o,onFitView:d,onInteractiveChange:f,className:p,children:g,position:m="bottom-left",orientation:y="vertical","aria-label":b}){const k=nn(),{isInteractive:v,minZoomReached:S,maxZoomReached:E,ariaLabelConfig:C}=Nt(JW,tn),{zoomIn:N,zoomOut:_,fitView:T}=wh(),M=()=>{N(),l==null||l()},O=()=>{_(),o==null||o()},R=()=>{T(a),d==null||d()},B=()=>{k.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),f==null||f(!v)},U=y==="horizontal"?"horizontal":"vertical";return c.jsxs(vh,{className:_n(["react-flow__controls",U,p]),position:m,style:e,"data-testid":"rf__controls","aria-label":b??C["controls.ariaLabel"],children:[t&&c.jsxs(c.Fragment,{children:[c.jsx(Qf,{onClick:M,className:"react-flow__controls-zoomin",title:C["controls.zoomIn.ariaLabel"],"aria-label":C["controls.zoomIn.ariaLabel"],disabled:E,children:c.jsx(YW,{})}),c.jsx(Qf,{onClick:O,className:"react-flow__controls-zoomout",title:C["controls.zoomOut.ariaLabel"],"aria-label":C["controls.zoomOut.ariaLabel"],disabled:S,children:c.jsx(WW,{})})]}),n&&c.jsx(Qf,{className:"react-flow__controls-fitview",onClick:R,title:C["controls.fitView.ariaLabel"],"aria-label":C["controls.fitView.ariaLabel"],children:c.jsx(QW,{})}),i&&c.jsx(Qf,{className:"react-flow__controls-interactive",onClick:B,title:C["controls.interactive.ariaLabel"],"aria-label":C["controls.interactive.ariaLabel"],children:v?c.jsx(ZW,{}):c.jsx(XW,{})}),g]})}ZA.displayName="Controls";const eQ=j.memo(ZA);function tQ({id:e,x:t,y:n,width:i,height:a,style:l,color:o,strokeColor:d,strokeWidth:f,className:p,borderRadius:g,shapeRendering:m,selected:y,onClick:b}){const{background:k,backgroundColor:v}=l||{},S=o||k||v;return c.jsx("rect",{className:_n(["react-flow__minimap-node",{selected:y},p]),x:t,y:n,rx:g,ry:g,width:i,height:a,style:{fill:S,stroke:d,strokeWidth:f},shapeRendering:m,onClick:b?E=>b(E,e):void 0})}const nQ=j.memo(tQ),iQ=e=>e.nodes.map(t=>t.id),Ny=e=>e instanceof Function?e:()=>e;function rQ({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:l=nQ,onClick:o}){const d=Nt(iQ,tn),f=Ny(t),p=Ny(e),g=Ny(n),m=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return c.jsx(c.Fragment,{children:d.map(y=>c.jsx(sQ,{id:y,nodeColorFunc:f,nodeStrokeColorFunc:p,nodeClassNameFunc:g,nodeBorderRadius:i,nodeStrokeWidth:a,NodeComponent:l,onClick:o,shapeRendering:m},y))})}function aQ({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:a,nodeStrokeWidth:l,shapeRendering:o,NodeComponent:d,onClick:f}){const{node:p,x:g,y:m,width:y,height:b}=Nt(k=>{const v=k.nodeLookup.get(e);if(!v)return{node:void 0,x:0,y:0,width:0,height:0};const S=v.internals.userNode,{x:E,y:C}=v.internals.positionAbsolute,{width:N,height:_}=va(S);return{node:S,x:E,y:C,width:N,height:_}},tn);return!p||p.hidden||!XC(p)?null:c.jsx(d,{x:g,y:m,width:y,height:b,style:p.style,selected:!!p.selected,className:i(p),color:t(p),borderRadius:a,strokeColor:n(p),strokeWidth:l,shapeRendering:o,onClick:f,id:p.id})}const sQ=j.memo(aQ);var lQ=j.memo(rQ);const oQ=200,cQ=150,uQ=e=>!e.hidden,dQ=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?YC(ld(e.nodeLookup,{filter:uQ}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},fQ="react-flow__minimap-desc";function JA({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:a="",nodeBorderRadius:l=5,nodeStrokeWidth:o,nodeComponent:d,bgColor:f,maskColor:p,maskStrokeColor:g,maskStrokeWidth:m,position:y="bottom-right",onClick:b,onNodeClick:k,pannable:v=!1,zoomable:S=!1,ariaLabel:E,inversePan:C,zoomStep:N=1,offsetScale:_=5}){const T=nn(),M=j.useRef(null),{boundingRect:O,viewBB:R,rfId:B,panZoom:U,translateExtent:K,flowWidth:q,flowHeight:Y,ariaLabelConfig:D}=Nt(dQ,tn),F=(e==null?void 0:e.width)??oQ,I=(e==null?void 0:e.height)??cQ,H=O.width/F,W=O.height/I,G=Math.max(H,W),L=G*F,z=G*I,V=_*G,P=O.x-(L-O.width)/2-V,le=O.y-(z-O.height)/2-V,xe=L+V*2,ke=z+V*2,Ne=`${fQ}-${B}`,se=j.useRef(0),ve=j.useRef();se.current=G,j.useEffect(()=>{if(M.current&&U)return ve.current=EV({domNode:M.current,panZoom:U,getTransform:()=>T.getState().transform,getViewScale:()=>se.current}),()=>{var re;(re=ve.current)==null||re.destroy()}},[U]),j.useEffect(()=>{var re;(re=ve.current)==null||re.update({translateExtent:K,width:q,height:Y,inversePan:C,pannable:v,zoomStep:N,zoomable:S})},[v,S,C,N,K,q,Y]);const ue=b?re=>{var _e;const[Ce,Me]=((_e=ve.current)==null?void 0:_e.pointer(re))||[0,0];b(re,{x:Ce,y:Me})}:void 0,J=k?j.useCallback((re,Ce)=>{const Me=T.getState().nodeLookup.get(Ce).internals.userNode;k(re,Me)},[]):void 0,we=E??D["minimap.ariaLabel"];return c.jsx(vh,{position:y,style:{...e,"--xy-minimap-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-background-color-props":typeof p=="string"?p: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:_n(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:c.jsxs("svg",{width:F,height:I,viewBox:`${P} ${le} ${xe} ${ke}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Ne,ref:M,onClick:ue,children:[we&&c.jsx("title",{id:Ne,children:we}),c.jsx(lQ,{onClick:J,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:l,nodeClassName:a,nodeStrokeWidth:o,nodeComponent:d}),c.jsx("path",{className:"react-flow__minimap-mask",d:`M${P-V},${le-V}h${xe+V*2}v${ke+V*2}h${-xe-V*2}z
685
+ M${R.x},${R.y}h${R.width}v${R.height}h${-R.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}JA.displayName="MiniMap";j.memo(JA);const pQ=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,hQ={[Yo.Line]:"right",[Yo.Handle]:"bottom-right"};function mQ({nodeId:e,position:t,variant:n=Yo.Handle,className:i,style:a=void 0,children:l,color:o,minWidth:d=10,minHeight:f=10,maxWidth:p=Number.MAX_VALUE,maxHeight:g=Number.MAX_VALUE,keepAspectRatio:m=!1,resizeDirection:y,autoScale:b=!0,shouldResize:k,onResizeStart:v,onResize:S,onResizeEnd:E}){const C=AA(),N=typeof e=="string"?e:C,_=nn(),T=j.useRef(null),M=n===Yo.Handle,O=Nt(j.useCallback(pQ(M&&b),[M,b]),tn),R=j.useRef(null),B=t??hQ[n];j.useEffect(()=>{if(!(!T.current||!N))return R.current||(R.current=IV({domNode:T.current,nodeId:N,getStoreItems:()=>{const{nodeLookup:K,transform:q,snapGrid:Y,snapToGrid:D,nodeOrigin:F,domNode:I}=_.getState();return{nodeLookup:K,transform:q,snapGrid:Y,snapToGrid:D,nodeOrigin:F,paneDomNode:I}},onChange:(K,q)=>{const{triggerNodeChanges:Y,nodeLookup:D,parentLookup:F,nodeOrigin:I}=_.getState(),H=[],W={x:K.x,y:K.y},G=D.get(N);if(G&&G.expandParent&&G.parentId){const L=G.origin??I,z=K.width??G.measured.width??0,V=K.height??G.measured.height??0,P={id:G.id,parentId:G.parentId,rect:{width:z,height:V,...ZC({x:K.x??G.position.x,y:K.y??G.position.y},{width:z,height:V},G.parentId,D,L)}},le=av([P],D,F,I);H.push(...le),W.x=K.x?Math.max(L[0]*z,K.x):void 0,W.y=K.y?Math.max(L[1]*V,K.y):void 0}if(W.x!==void 0&&W.y!==void 0){const L={id:N,type:"position",position:{...W}};H.push(L)}if(K.width!==void 0&&K.height!==void 0){const z={id:N,type:"dimensions",resizing:!0,setAttributes:y?y==="horizontal"?"width":"height":!0,dimensions:{width:K.width,height:K.height}};H.push(z)}for(const L of q){const z={...L,type:"position"};H.push(z)}Y(H)},onEnd:({width:K,height:q})=>{const Y={id:N,type:"dimensions",resizing:!1,dimensions:{width:K,height:q}};_.getState().triggerNodeChanges([Y])}})),R.current.update({controlPosition:B,boundaries:{minWidth:d,minHeight:f,maxWidth:p,maxHeight:g},keepAspectRatio:m,resizeDirection:y,onResizeStart:v,onResize:S,onResizeEnd:E,shouldResize:k}),()=>{var K;(K=R.current)==null||K.destroy()}},[B,d,f,p,g,m,v,S,E,k]);const U=B.split("-");return c.jsx("div",{className:_n(["react-flow__resize-control","nodrag",...U,n,i]),ref:T,style:{...a,scale:O,...o&&{[M?"backgroundColor":"borderColor"]:o}},children:l})}j.memo(mQ);function gQ(e){return ct(`/api/smartarrange/${encodeURIComponent(e)}`)}async function yQ(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 _y=["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 iN(e,t){return _y[t%_y.length]??_y[0]}const eT={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)"},bQ=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(Dr,{id:"l-t",type:"target",position:Ke.Left,style:fo}),c.jsx(Dr,{id:"r-t",type:"target",position:Ke.Right,style:fo}),c.jsx(Dr,{id:"t-t",type:"target",position:Ke.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:eT[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(Dr,{id:"r-s",type:"source",position:Ke.Right,style:fo}),c.jsx(Dr,{id:"l-s",type:"source",position:Ke.Left,style:fo}),c.jsx(Dr,{id:"b-s",type:"source",position:Ke.Bottom,style:fo})]})});function xQ({card:e,status:t,onClose:n}){var a;const i=Pe();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:eT[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(gn,{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(t_,{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(mx,{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}`:"—",`
686
+ ${e.at??""} [状态] ${t}`]})]})]})]})})}const vQ=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})]})}),wQ={card:bQ,laneBox:vQ},lv=260,tT=lv+36,kQ=200,EQ={todo:"var(--color-text-subtle)",doing:"var(--color-secondary-dark)",done:"var(--color-cta)",rework:"var(--color-secondary-dark)"};function _b(e,t,n){return e==="doing"&&t<n?"stuck":e}function SQ(e,t){const n=Math.floor(e/t),i=e%t;return{x:(n%2===0?i:t-1-i)*tT,y:n*kQ}}function NQ(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 _Q(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 nT=158,rN=lv+60,aN=nT+28,sN=40;function jQ({cards:e,taskMeta:t,view:n,onSelect:i}){const a=j.useRef(null),[l,o]=j.useState(4),d=wh(),[f,p,g]=UW([]),[m,y]=FW([]),b=j.useRef("");return j.useEffect(()=>{const k=a.current;if(!k)return;const v=new ResizeObserver(S=>{var C;const E=((C=S[0])==null?void 0:C.contentRect.width)??800;o(Math.max(1,Math.min(8,Math.floor((E-40)/tT))))});return v.observe(k),()=>v.disconnect()},[]),j.useEffect(()=>{const k=[...e].sort((M,O)=>M.seq-O.seq),v=`${n}:${l}:${k.length}`,S=b.current!==v;b.current=v;const E=new Map,C=(M,O)=>{var R;if(n==="lane"){const B=((R=t.get(M.taskId))==null?void 0:R.order)??0,U=E.get(M.taskId)??0;return E.set(M.taskId,U+1),{x:B*rN,y:U*aN}}return SQ(O,l)},N=[];if(n==="lane"){const M=new Map;for(const O of k)M.set(O.taskId,(M.get(O.taskId)??0)+1);for(const[O,R]of M){const B=t.get(O),U=(B==null?void 0:B.order)??0;N.push({id:`lane-${O}`,type:"laneBox",position:{x:U*rN-16,y:-sN},data:{label:B!=null&&B.title?`T${O} · ${B.title}`:`T${O}`,color:(B==null?void 0:B.color)??"var(--color-bg-cream)"},style:{width:lv+32,height:sN+(R-1)*aN+nT+14},draggable:!1,selectable:!1,zIndex:0})}}const _=k.length?k[k.length-1].seq:0;p(M=>{const O=new Map(M.map(B=>[B.id,B])),R=k.map((B,U)=>{const K=t.get(B.taskId),q={seq:B.seq,title:B.title,skills:B.skills??[],taskLabel:`T${B.taskId}`,status:_b(B.status,B.seq,_),color:(K==null?void 0:K.color)??"var(--color-bg-cream)"},Y=String(B.seq),D=O.get(Y),F=C(B,U);return{...D&&!S?{...D,data:q}:{id:Y,type:"card",position:F,data:q},zIndex:1}});return[...N,...R]});const T=[];for(let M=1;M<k.length;M++){const O=k[M-1],R=k[M];if(!O||!R)continue;const B=n==="lane"?O.taskId===R.taskId?{sourceHandle:"b-s",targetHandle:"t-t"}:{sourceHandle:"r-s",targetHandle:"l-t"}:NQ(M-1,M,l);T.push({id:`e${O.seq}-${R.seq}`,source:String(O.seq),target:String(R.seq),...B,..._Q(_b(R.status,R.seq,_))})}y(T),S&&requestAnimationFrame(()=>d.fitView({padding:.2,maxZoom:1.1,duration:300}))},[e,l,t,n,p,y,d]),c.jsx("div",{ref:a,className:"w-full h-full",children:c.jsxs($W,{nodes:f,edges:m,onNodesChange:g,nodeTypes:wQ,onNodeClick:(k,v)=>i(Number(v.id)),fitView:!0,fitViewOptions:{padding:.2,maxZoom:1.1},proOptions:{hideAttribution:!0},minZoom:.15,children:[c.jsx(VW,{variant:ha.Dots,gap:20,size:1.5,color:"var(--color-border-light)"}),c.jsx(eQ,{showInteractive:!1})]})})}function CQ(){var U,K,q;const e=Pe(),t=Ft(),{alert:n}=un(),a=(((U=Ve({queryKey:["projects"],queryFn:Es,refetchInterval:3e3}).data)==null?void 0:U.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 p=a.find(Y=>Y.name===f),g=(p==null?void 0:p.pipelineStatus)==="running",m=Ve({queryKey:["smartarrange",f],queryFn:()=>gQ(f),enabled:!!f,refetchInterval:3e3}),y=Et({mutationFn:()=>yQ(f),onSuccess:()=>t.invalidateQueries({queryKey:["smartarrange",f]}),onError:Y=>void n({title:e("arrange.approveErr"),body:Y instanceof Error?Y.message:String(Y)})}),b=Et({mutationFn:()=>A2(f),onSuccess:()=>t.invalidateQueries({queryKey:["projects"]}),onError:Y=>void n({title:e("arrange.startErr"),body:Y instanceof Error?Y.message:String(Y)})}),k=Et({mutationFn:()=>T2(f),onSuccess:()=>t.invalidateQueries({queryKey:["projects"]}),onError:Y=>void n({title:e("arrange.startErr"),body:Y instanceof Error?Y.message:String(Y)})}),v=(K=m.data)==null?void 0:K.plan,S=j.useMemo(()=>{var Y;return((Y=m.data)==null?void 0:Y.cards)??[]},[(q=m.data)==null?void 0:q.cards]),[E,C]=j.useState(()=>localStorage.getItem("arrange.view")==="lane"?"lane":"free");j.useEffect(()=>{localStorage.setItem("arrange.view",E)},[E]);const N=j.useMemo(()=>{const Y=new Map;return((v==null?void 0:v.tasks)??[]).forEach((D,F)=>Y.set(D.id,{order:F,status:D.status,color:iN(D.id,F),title:D.title})),Y},[v==null?void 0:v.tasks]),[_,T]=j.useState(()=>localStorage.getItem("arrange.panel")!=="0");j.useEffect(()=>{localStorage.setItem("arrange.panel",_?"1":"0")},[_]);const[M,O]=j.useState(null),R=j.useMemo(()=>S.find(Y=>Y.seq===M),[S,M]),B=S.length?Math.max(...S.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(Hb,{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(Qu,{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(mp,{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(p3,{size:14,strokeWidth:2.5}):c.jsx(r_,{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:[S.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(QA,{children:c.jsx(jQ,{cards:S,taskMeta:N,view:E,onSelect:O})}),!_&&c.jsxs("button",{className:"nb-btn absolute right-3 top-3 z-10",style:{padding:"6px 10px",fontSize:12},onClick:()=>T(!0),type:"button","aria-label":e("arrange.expand"),children:[c.jsx(Jo,{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:()=>T(!1),type:"button","aria-label":e("arrange.collapse"),children:c.jsx(ZL,{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:iN(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:EQ[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")})}),R&&c.jsx(xQ,{card:R,status:_b(R.status,R.seq,B),onClose:()=>O(null)})]})}function AQ(){const e=Pe();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 TQ(){return c.jsx(SI,{children:c.jsxs(tR,{children:[c.jsxs(Sn,{element:c.jsx(bk,{contentMode:"workspace"}),children:[c.jsx(Sn,{index:!0,element:c.jsx(ZO,{to:"/projects",replace:!0})}),c.jsx(Sn,{path:"/projects",element:c.jsx(Lk,{})}),c.jsx(Sn,{path:"/projects/:name",element:c.jsx(Lk,{})}),c.jsx(Sn,{path:"/board",element:c.jsx(p5,{})}),c.jsx(Sn,{path:"/workers",element:c.jsx(A5,{})}),c.jsx(Sn,{path:"/prompts",element:c.jsx(J8,{})}),c.jsx(Sn,{path:"/chat",element:c.jsx(UE,{})}),c.jsx(Sn,{path:"/chat/:sessionId",element:c.jsx(UE,{})}),c.jsx(Sn,{path:"/arrange",element:c.jsx(CQ,{})})]}),c.jsxs(Sn,{element:c.jsx(bk,{contentMode:"document"}),children:[c.jsx(Sn,{path:"/projects/new",element:c.jsx(C2,{})}),c.jsx(Sn,{path:"/skills",element:c.jsx(V8,{})}),c.jsx(Sn,{path:"/system",element:c.jsx(rq,{})}),c.jsx(Sn,{path:"/processes",element:c.jsx(Mq,{})}),c.jsx(Sn,{path:"/audit",element:c.jsx(Lq,{})}),c.jsx(Sn,{path:"/memory",element:c.jsx(Fq,{})}),c.jsx(Sn,{path:"/plugins",element:c.jsx(Qq,{})}),c.jsx(Sn,{path:"*",element:c.jsx(AQ,{})})]})]})})}EI();Y3();const MQ=new FD({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1}}}),iT=document.getElementById("root");if(!iT)throw new Error("#root not found");yD.createRoot(iT).render(c.jsx(j.StrictMode,{children:c.jsx(K3,{children:c.jsx(qD,{client:MQ,children:c.jsx(_R,{children:c.jsx(RI,{children:c.jsx(TQ,{})})})})})}));