@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.
- package/dist/console/routes/cards.d.ts.map +1 -1
- package/dist/console/routes/cards.js +39 -0
- package/dist/console/routes/cards.js.map +1 -1
- package/dist/console-assets/assets/index-CKyH_olo.js +686 -0
- package/dist/console-assets/assets/{index-OaQ1Imtf.css → index-Do-xvsh3.css} +1 -1
- package/dist/console-assets/index.html +2 -2
- package/dist/services/promptPreview.d.ts +27 -0
- package/dist/services/promptPreview.d.ts.map +1 -0
- package/dist/services/promptPreview.js +87 -0
- package/dist/services/promptPreview.js.map +1 -0
- package/package.json +1 -1
- package/dist/console-assets/assets/index-CoEXYM0y.js +0 -686
|
@@ -1,686 +0,0 @@
|
|
|
1
|
-
var ZM=Object.defineProperty;var R1=e=>{throw TypeError(e)};var JM=(e,t,n)=>t in e?ZM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var L1=(e,t,n)=>JM(e,typeof t!="symbol"?t+"":t,n),kg=(e,t,n)=>t.has(e)||R1("Cannot "+n);var X=(e,t,n)=>(kg(e,t,"read from private field"),n?n.call(e):t.get(e)),Qe=(e,t,n)=>t.has(e)?R1("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ie=(e,t,n,i)=>(kg(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n),ut=(e,t,n)=>(kg(e,t,"access private method"),n);var xf=(e,t,n,i)=>({set _(a){Ie(e,t,a,n)},get _(){return X(e,t,i)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))i(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(a){if(a.ep)return;a.ep=!0;const l=n(a);fetch(a.href,l)}})();function qu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Eg={exports:{}},Xc={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var I1;function eD(){if(I1)return Xc;I1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(i,a,l){var o=null;if(l!==void 0&&(o=""+l),a.key!==void 0&&(o=""+a.key),"key"in a){l={};for(var d in a)d!=="key"&&(l[d]=a[d])}else l=a;return a=l.ref,{$$typeof:e,type:i,key:o,ref:a!==void 0?a:null,props:l}}return Xc.Fragment=t,Xc.jsx=n,Xc.jsxs=n,Xc}var z1;function tD(){return z1||(z1=1,Eg.exports=eD()),Eg.exports}var c=tD(),Sg={exports:{}},at={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var P1;function nD(){if(P1)return at;P1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),o=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),y=Symbol.iterator;function b(z){return z===null||typeof z!="object"?null:(z=y&&z[y]||z["@@iterator"],typeof z=="function"?z:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,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 R={H:null,A:null,T:null,S:null},O=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,ve){var ke=typeof z;(ke==="undefined"||ke==="boolean")&&(z=null);var Se=!1;if(z===null)Se=!0;else switch(ke){case"bigint":case"string":case"number":Se=!0;break;case"object":switch(z.$$typeof){case e:case t:Se=!0;break;case g:return Se=z._init,I(Se(z._payload),V,P,le,ve)}}if(Se)return ve=ve(z),Se=le===""?"."+D(z,0):le,T(ve)?(P="",Se!=null&&(P=Se.replace(Y,"$&/")+"/"),I(ve,V,P,"",function(Te){return Te})):ve!=null&&(K(ve)&&(ve=U(ve,P+(ve.key==null||z&&z.key===ve.key?"":(""+ve.key).replace(Y,"$&/")+"/")+Se)),V.push(ve)),1;Se=0;var J=le===""?".":le+":";if(T(z))for(var ue=0;ue<z.length;ue++)le=z[ue],ke=J+D(le,ue),Se+=I(le,V,P,ke,ve);else if(ue=b(z),typeof ue=="function")for(z=ue.call(z),ue=0;!(le=z.next()).done;)le=le.value,ke=J+D(le,ue++),Se+=I(le,V,P,ke,ve);else if(ke==="object"){if(typeof z.then=="function")return I(F(z),V,P,le,ve);throw V=String(z),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return Se}function H(z,V,P){if(z==null)return z;var le=[],ve=0;return I(z,le,"","",function(ke){return V.call(P,ke,ve++)}),le}function Q(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=R,at.__COMPILER_RUNTIME={__proto__:null,c:function(z){return R.H.useMemoCache(z)}},at.cache=function(z){return function(){return z.apply(null,arguments)}},at.cacheSignal=function(){return null},at.cloneElement=function(z,V,P){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var le=v({},z.props),ve=z.key;if(V!=null)for(ke in V.key!==void 0&&(ve=""+V.key),V)!O.call(V,ke)||ke==="key"||ke==="__self"||ke==="__source"||ke==="ref"&&V.ref===void 0||(le[ke]=V[ke]);var ke=arguments.length-2;if(ke===1)le.children=P;else if(1<ke){for(var Se=Array(ke),J=0;J<ke;J++)Se[J]=arguments[J+2];le.children=Se}return B(z.type,ve,le)},at.createContext=function(z){return z={$$typeof:o,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:l,_context:z},z},at.createElement=function(z,V,P){var le,ve={},ke=null;if(V!=null)for(le in V.key!==void 0&&(ke=""+V.key),V)O.call(V,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(ve[le]=V[le]);var Se=arguments.length-2;if(Se===1)ve.children=P;else if(1<Se){for(var J=Array(Se),ue=0;ue<Se;ue++)J[ue]=arguments[ue+2];ve.children=J}if(z&&z.defaultProps)for(le in Se=z.defaultProps,Se)ve[le]===void 0&&(ve[le]=Se[le]);return B(z,ke,ve)},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:Q}},at.memo=function(z,V){return{$$typeof:h,type:z,compare:V===void 0?null:V}},at.startTransition=function(z){var V=R.T,P={};R.T=P;try{var le=z(),ve=R.S;ve!==null&&ve(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),R.T=V}},at.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},at.use=function(z){return R.H.use(z)},at.useActionState=function(z,V,P){return R.H.useActionState(z,V,P)},at.useCallback=function(z,V){return R.H.useCallback(z,V)},at.useContext=function(z){return R.H.useContext(z)},at.useDebugValue=function(){},at.useDeferredValue=function(z,V){return R.H.useDeferredValue(z,V)},at.useEffect=function(z,V){return R.H.useEffect(z,V)},at.useEffectEvent=function(z){return R.H.useEffectEvent(z)},at.useId=function(){return R.H.useId()},at.useImperativeHandle=function(z,V,P){return R.H.useImperativeHandle(z,V,P)},at.useInsertionEffect=function(z,V){return R.H.useInsertionEffect(z,V)},at.useLayoutEffect=function(z,V){return R.H.useLayoutEffect(z,V)},at.useMemo=function(z,V){return R.H.useMemo(z,V)},at.useOptimistic=function(z,V){return R.H.useOptimistic(z,V)},at.useReducer=function(z,V,P){return R.H.useReducer(z,V,P)},at.useRef=function(z){return R.H.useRef(z)},at.useState=function(z){return R.H.useState(z)},at.useSyncExternalStore=function(z,V,P){return R.H.useSyncExternalStore(z,V,P)},at.useTransition=function(){return R.H.useTransition()},at.version="19.2.5",at}var B1;function Hu(){return B1||(B1=1,Sg.exports=nD()),Sg.exports}var j=Hu();const iD=qu(j);var Ng={exports:{}},Zc={},_g={exports:{}},jg={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var $1;function rD(){return $1||($1=1,(function(e){function t(I,H){var Q=I.length;I.push(H);e:for(;0<Q;){var G=Q-1>>>1,L=I[G];if(0<a(L,H))I[G]=H,I[Q]=L,Q=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],Q=I.pop();if(Q!==H){I[0]=Q;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,ve=I[le];if(0>a(P,Q))le<L&&0>a(ve,P)?(I[G]=ve,I[le]=Q,G=le):(I[G]=P,I[V]=Q,G=V);else if(le<L&&0>a(ve,Q))I[G]=ve,I[le]=Q,G=le;else break e}}return H}function a(I,H){var Q=I.sortIndex-H.sortIndex;return Q!==0?Q: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=[],h=[],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(h);H!==null;){if(H.callback===null)i(h);else if(H.startTime<=I)i(h),H.sortIndex=H.expirationTime,t(f,H);else break;H=n(h)}}function T(I){if(v=!1,_(I),!k)if(n(f)!==null)k=!0,M||(M=!0,q());else{var H=n(h);H!==null&&F(T,H.startTime-I)}}var M=!1,R=-1,O=5,B=-1;function U(){return S?!0:!(e.unstable_now()-B<O)}function K(){if(S=!1,M){var I=e.unstable_now();B=I;var H=!0;try{e:{k=!1,v&&(v=!1,C(R),R=-1),b=!0;var Q=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(h);z!==null&&F(T,z.startTime-I),H=!1}}break e}finally{m=null,y=Q,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){R=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"):O=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 Q=y;y=H;try{return I()}finally{y=Q}},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 Q=y;y=I;try{return H()}finally{y=Q}},e.unstable_scheduleCallback=function(I,H,Q){var G=e.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?G+Q:G):Q=G,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=Q+L,I={id:g++,callback:H,priorityLevel:I,startTime:Q,expirationTime:L,sortIndex:-1},Q>G?(I.sortIndex=Q,t(h,I),n(f)===null&&I===n(h)&&(v?(C(R),R=-1):v=!0,F(T,Q-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 Q=y;y=H;try{return I.apply(this,arguments)}finally{y=Q}}}})(jg)),jg}var U1;function aD(){return U1||(U1=1,_g.exports=rD()),_g.exports}var Cg={exports:{}},Hn={};/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var F1;function sD(){if(F1)return Hn;F1=1;var e=Hu();function t(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+f+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function l(f,h,g){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:m==null?null:""+m,children:f,containerInfo:h,implementation:g}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Hn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Hn.createPortal=function(f,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return l(f,h,null,g)},Hn.flushSync=function(f){var h=o.T,g=i.p;try{if(o.T=null,i.p=2,f)return f()}finally{o.T=h,i.p=g,i.d.f()}},Hn.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(f,h))},Hn.prefetchDNS=function(f){typeof f=="string"&&i.d.D(f)},Hn.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var g=h.as,m=d(g,h.crossOrigin),y=typeof h.integrity=="string"?h.integrity:void 0,b=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?i.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:m,integrity:y,fetchPriority:b}):g==="script"&&i.d.X(f,{crossOrigin:m,integrity:y,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Hn.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=d(h.as,h.crossOrigin);i.d.M(f,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(f)},Hn.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,m=d(g,h.crossOrigin);i.d.L(f,g,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Hn.preloadModule=function(f,h){if(typeof f=="string")if(h){var g=d(h.as,h.crossOrigin);i.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(f)},Hn.requestFormReset=function(f){i.d.r(f)},Hn.unstable_batchedUpdates=function(f,h){return f(h)},Hn.useFormState=function(f,h,g){return o.H.useFormState(f,h,g)},Hn.useFormStatus=function(){return o.H.useHostTransitionStatus()},Hn.version="19.2.5",Hn}var q1;function dN(){if(q1)return Cg.exports;q1=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Cg.exports=sD(),Cg.exports}/**
|
|
34
|
-
* @license React
|
|
35
|
-
* react-dom-client.production.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var H1;function lD(){if(H1)return Zc;H1=1;var e=aD(),t=Hu(),n=dN();function i(r){var s="https://react.dev/errors/"+r;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)s+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+r+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function l(r){var s=r,u=r;if(r.alternate)for(;s.return;)s=s.return;else{r=s;do s=r,(s.flags&4098)!==0&&(u=s.return),r=s.return;while(r)}return s.tag===3?u:null}function o(r){if(r.tag===13){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function d(r){if(r.tag===31){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function f(r){if(l(r)!==r)throw Error(i(188))}function h(r){var s=r.alternate;if(!s){if(s=l(r),s===null)throw Error(i(188));return s!==r?null:r}for(var u=r,p=s;;){var x=u.return;if(x===null)break;var w=x.alternate;if(w===null){if(p=x.return,p!==null){u=p;continue}break}if(x.child===w.child){for(w=x.child;w;){if(w===u)return f(x),r;if(w===p)return f(x),s;w=w.sibling}throw Error(i(188))}if(u.return!==p.return)u=x,p=w;else{for(var A=!1,$=x.child;$;){if($===u){A=!0,u=x,p=w;break}if($===p){A=!0,p=x,u=w;break}$=$.sibling}if(!A){for($=w.child;$;){if($===u){A=!0,u=w,p=x;break}if($===p){A=!0,p=w,u=x;break}$=$.sibling}if(!A)throw Error(i(189))}}if(u.alternate!==p)throw Error(i(190))}if(u.tag!==3)throw Error(i(188));return u.stateNode.current===u?r:s}function g(r){var s=r.tag;if(s===5||s===26||s===27||s===6)return r;for(r=r.child;r!==null;){if(s=g(r),s!==null)return s;r=r.sibling}return null}var m=Object.assign,y=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),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"),R=Symbol.for("react.memo"),O=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 R:return s=r.displayName||null,s!==null?s:D(r.type)||"Memo";case O:s=r._payload,r=r._init;try{return D(r(s))}catch{}}return null}var 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,Q={pending:!1,data:null,method:null,action:null},G=[],L=-1;function z(r){return{current:r}}function V(r){0>L||(r.current=G[L],G[L]=null,L--)}function P(r,s){L++,G[L]=r.current,r.current=s}var le=z(null),ve=z(null),ke=z(null),Se=z(null);function J(r,s){switch(P(ke,s),P(ve,r),P(le,null),s.nodeType){case 9:case 11:r=(r=s.documentElement)&&(r=r.namespaceURI)?i1(r):0;break;default:if(r=s.tagName,s=s.namespaceURI)s=i1(s),r=r1(s,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}V(le),P(le,r)}function ue(){V(le),V(ve),V(ke)}function Te(r){r.memoizedState!==null&&P(Se,r);var s=le.current,u=r1(s,r.type);s!==u&&(P(ve,r),P(le,u))}function Re(r){ve.current===r&&(V(le),V(ve)),Se.current===r&&(V(Se),Vc._currentValue=Q)}var Oe,ce;function Ce(r){if(Oe===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);Oe=s&&s[1]||"",ce=-1<u.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Oe+r+ce}var te=!1;function pe(r,s){if(!r||te)return"";te=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(s){var we=function(){throw Error()};if(Object.defineProperty(we.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(we,[])}catch(fe){var oe=fe}Reflect.construct(r,[],we)}else{try{we.call()}catch(fe){oe=fe}r.call(we.prototype)}}else{try{throw Error()}catch(fe){oe=fe}(we=r())&&typeof we.catch=="function"&&we.catch(function(){})}}catch(fe){if(fe&&oe&&typeof fe.stack=="string")return[fe.stack,oe.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var x=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");x&&x.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=p.DetermineComponentFrameRoot(),A=w[0],$=w[1];if(A&&$){var W=A.split(`
|
|
44
|
-
`),se=$.split(`
|
|
45
|
-
`);for(x=p=0;p<W.length&&!W[p].includes("DetermineComponentFrameRoot");)p++;for(;x<se.length&&!se[x].includes("DetermineComponentFrameRoot");)x++;if(p===W.length||x===se.length)for(p=W.length-1,x=se.length-1;1<=p&&0<=x&&W[p]!==se[x];)x--;for(;1<=p&&0<=x;p--,x--)if(W[p]!==se[x]){if(p!==1||x!==1)do if(p--,x--,0>x||W[p]!==se[x]){var me=`
|
|
46
|
-
`+W[p].replace(" at new "," at ");return r.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",r.displayName)),me}while(1<=p&&0<=x);break}}}finally{te=!1,Error.prepareStackTrace=u}return(u=r?r.displayName||r.name:"")?Ce(u):""}function Fe(r,s){switch(r.tag){case 26:case 27:case 5:return Ce(r.type);case 16:return Ce("Lazy");case 13:return r.child!==s&&s!==null?Ce("Suspense Fallback"):Ce("Suspense");case 19:return Ce("SuspenseList");case 0:case 15:return pe(r.type,!1);case 11:return pe(r.type.render,!1);case 1:return pe(r.type,!0);case 31:return Ce("Activity");default:return""}}function ze(r){try{var s="",u=null;do s+=Fe(r,u),u=r,r=r.return;while(r);return s}catch(p){return`
|
|
47
|
-
Error generating stack: `+p.message+`
|
|
48
|
-
`+p.stack}}var ae=Object.prototype.hasOwnProperty,be=e.unstable_scheduleCallback,ye=e.unstable_cancelCallback,he=e.unstable_shouldYield,Ee=e.unstable_requestPaint,Ne=e.unstable_now,Ke=e.unstable_getCurrentPriorityLevel,ne=e.unstable_ImmediatePriority,de=e.unstable_UserBlockingPriority,Le=e.unstable_NormalPriority,Ze=e.unstable_LowPriority,rt=e.unstable_IdlePriority,At=e.log,$n=e.unstable_setDisableYieldValue,dn=null,Mt=null;function Qt(r){if(typeof At=="function"&&$n(r),Mt&&typeof Mt.setStrictMode=="function")try{Mt.setStrictMode(dn,r)}catch{}}var yt=Math.clz32?Math.clz32:Nl,Ti=Math.log,Rn=Math.LN2;function Nl(r){return r>>>=0,r===0?32:31-(Ti(r)/Rn|0)|0}var Pr=256,wa=262144,Br=4194304;function Un(r){var s=r&42;if(s!==0)return s;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Z(r,s,u){var p=r.pendingLanes;if(p===0)return 0;var x=0,w=r.suspendedLanes,A=r.pingedLanes;r=r.warmLanes;var $=p&134217727;return $!==0?(p=$&~w,p!==0?x=Un(p):(A&=$,A!==0?x=Un(A):u||(u=$&~r,u!==0&&(x=Un(u))))):($=p&~w,$!==0?x=Un($):A!==0?x=Un(A):u||(u=p&~r,u!==0&&(x=Un(u)))),x===0?0:s!==0&&s!==x&&(s&w)===0&&(w=x&-x,u=s&-s,w>=u||w===32&&(u&4194048)!==0)?s:x}function ge(r,s){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&s)===0}function Me(r,s){switch(r){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function it(){var r=Br;return Br<<=1,(Br&62914560)===0&&(Br=4194304),r}function 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 Ue(r,s,u,p,x,w){var A=r.pendingLanes;r.pendingLanes=u,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=u,r.entangledLanes&=u,r.errorRecoveryDisabledLanes&=u,r.shellSuspendCounter=0;var $=r.entanglements,W=r.expirationTimes,se=r.hiddenUpdates;for(u=A&~u;0<u;){var me=31-yt(u),we=1<<me;$[me]=0,W[me]=-1;var oe=se[me];if(oe!==null)for(se[me]=null,me=0;me<oe.length;me++){var fe=oe[me];fe!==null&&(fe.lane&=-536870913)}u&=~we}p!==0&&Pe(r,p,0),w!==0&&x===0&&r.tag!==0&&(r.suspendedLanes|=w&~(A&~s))}function Pe(r,s,u){r.pendingLanes|=s,r.suspendedLanes&=~s;var p=31-yt(s);r.entangledLanes|=s,r.entanglements[p]=r.entanglements[p]|1073741824|u&261930}function et(r,s){var u=r.entangledLanes|=s;for(r=r.entanglements;u;){var p=31-yt(u),x=1<<p;x&s|r[p]&s&&(r[p]|=s),u&=~x}}function rn(r,s){var u=s&-s;return u=(u&42)!==0?1:Vt(u),(u&(r.suspendedLanes|s))!==0?0:u}function Vt(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Wi(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:j1(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=d1(r);r!==null;){if(u=r[an])return u;r=d1(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){_e(r,s),_e(r+"Capture",s)}function _e(r,s){for(Ur[r]=s,r=0;r<s.length;r++)jl.add(s[r])}var Ve=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),ht={},_t={};function sn(r){return ae.call(_t,r)?!0:ae.call(ht,r)?!1:Ve.test(r)?_t[r]=!0:(ht[r]=!0,!1)}function Mn(r,s,u){if(sn(s))if(u===null)r.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":r.removeAttribute(s);return;case"boolean":var p=s.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){r.removeAttribute(s);return}}r.setAttribute(s,""+u)}}function Qn(r,s,u){if(u===null)r.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttribute(s,""+u)}}function Fn(r,s,u,p){if(p===null)r.removeAttribute(u);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(u);return}r.setAttributeNS(s,u,""+p)}}function zt(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Wn(r){var s=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Cl(r,s,u){var p=Object.getOwnPropertyDescriptor(r.constructor.prototype,s);if(!r.hasOwnProperty(s)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var x=p.get,w=p.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return x.call(this)},set:function(A){u=""+A,w.call(this,A)}}),Object.defineProperty(r,s,{enumerable:p.enumerable}),{getValue:function(){return u},setValue:function(A){u=""+A},stopTracking:function(){r._valueTracker=null,delete r[s]}}}}function _a(r){if(!r._valueTracker){var s=Wn(r)?"checked":"value";r._valueTracker=Cl(r,s,""+r[s])}}function vr(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var u=s.getValue(),p="";return r&&(p=Wn(r)?r.checked?"true":"false":r.value),r=p,r!==u?(s.setValue(r),!0):!1}function ja(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var Al=/[\n"\\]/g;function qn(r){return r.replace(Al,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Cs(r,s,u,p,x,w,A,$){r.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?r.type=A:r.removeAttribute("type"),s!=null?A==="number"?(s===0&&r.value===""||r.value!=s)&&(r.value=""+zt(s)):r.value!==""+zt(s)&&(r.value=""+zt(s)):A!=="submit"&&A!=="reset"||r.removeAttribute("value"),s!=null?Ca(r,A,zt(s)):u!=null?Ca(r,A,zt(u)):p!=null&&r.removeAttribute("value"),x==null&&w!=null&&(r.defaultChecked=!!w),x!=null&&(r.checked=x&&typeof x!="function"&&typeof x!="symbol"),$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?r.name=""+zt($):r.removeAttribute("name")}function tr(r,s,u,p,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}p=p??x,p=typeof p!="function"&&typeof p!="symbol"&&!!p,r.checked=$?r.checked:!!p,r.defaultChecked=!!p,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(r.name=A),_a(r)}function Ca(r,s,u){s==="number"&&ja(r.ownerDocument)===r||r.defaultValue===""+u||(r.defaultValue=""+u)}function _n(r,s,u,p){if(r=r.options,s){s={};for(var x=0;x<u.length;x++)s["$"+u[x]]=!0;for(u=0;u<r.length;u++)x=s.hasOwnProperty("$"+r[u].value),r[u].selected!==x&&(r[u].selected=x),x&&p&&(r[u].defaultSelected=!0)}else{for(u=""+zt(u),s=null,x=0;x<r.length;x++){if(r[x].value===u){r[x].selected=!0,p&&(r[x].defaultSelected=!0);return}s!==null||r[x].disabled||(s=r[x])}s!==null&&(s.selected=!0)}}function As(r,s,u){if(s!=null&&(s=""+zt(s),s!==r.value&&(r.value=s),u==null)){r.defaultValue!==s&&(r.defaultValue=s);return}r.defaultValue=u!=null?""+zt(u):""}function Tl(r,s,u,p){if(s==null){if(p!=null){if(u!=null)throw Error(i(92));if(F(p)){if(1<p.length)throw Error(i(93));p=p[0]}u=p}u==null&&(u=""),s=u}u=zt(s),r.defaultValue=u,p=r.textContent,p===u&&p!==""&&p!==null&&(r.value=p),_a(r)}function nt(r,s){if(s){var u=r.firstChild;if(u&&u===r.lastChild&&u.nodeType===3){u.nodeValue=s;return}}r.textContent=s}var od=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function xn(r,s,u){var p=s.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?p?r.setProperty(s,""):s==="float"?r.cssFloat="":r[s]="":p?r.setProperty(s,u):typeof u!="number"||u===0||od.has(s)?s==="float"?r.cssFloat=u:r[s]=(""+u).trim():r[s]=u+"px"}function Rt(r,s,u){if(s!=null&&typeof s!="object")throw Error(i(62));if(r=r.style,u!=null){for(var p in u)!u.hasOwnProperty(p)||s!=null&&s.hasOwnProperty(p)||(p.indexOf("--")===0?r.setProperty(p,""):p==="float"?r.cssFloat="":r[p]="");for(var x in s)p=s[x],s.hasOwnProperty(x)&&u[x]!==p&&xn(r,x,p)}else for(var w in s)s.hasOwnProperty(w)&&xn(r,w,s[w])}function Aa(r){if(r.indexOf("-")===-1)return!1;switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Fr=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),oc=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ta(r){return oc.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Ae(){}var qe=null;function lt(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var bt=null,ln=null;function Di(r){var s=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 p=u[s];if(p!==r&&p.form===r.form){var x=p[Tn]||null;if(!x)throw Error(i(90));Cs(p,x.value,x.defaultValue,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name)}}for(s=0;s<u.length;s++)p=u[s],p.form===r.form&&vr(p)}break e;case"textarea":As(r,u.value,u.defaultValue);break e;case"select":s=u.value,s!=null&&_n(r,!!u.multiple,s,!1)}}}var cc=!1;function cd(r,s,u){if(cc)return r(s,u);cc=!0;try{var p=r(s);return p}finally{if(cc=!1,(bt!==null||ln!==null)&&(Wd(),bt&&(s=bt,r=ln,ln=bt=null,Di(s),r)))for(s=0;s<r.length;s++)Di(r[s])}}function uc(r,s){var u=r.stateNode;if(u===null)return null;var p=u[Tn]||null;if(p===null)return null;u=p[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(r=r.type,p=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!p;break e;default:r=!1}if(r)return null;if(u&&typeof u!="function")throw Error(i(231,s,typeof u));return u}var qr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),kp=!1;if(qr)try{var dc={};Object.defineProperty(dc,"passive",{get:function(){kp=!0}}),window.addEventListener("test",dc,dc),window.removeEventListener("test",dc,dc)}catch{kp=!1}var Ma=null,Ep=null,ud=null;function rv(){if(ud)return ud;var r,s=Ep,u=s.length,p,x="value"in Ma?Ma.value:Ma.textContent,w=x.length;for(r=0;r<u&&s[r]===x[r];r++);var A=u-r;for(p=1;p<=A&&s[u-p]===x[w-p];p++);return ud=x.slice(r,1<p?1-p:void 0)}function dd(r){var s=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&s===13&&(r=13)):r=s,r===10&&(r=13),32<=r||r===13?r:0}function fd(){return!0}function av(){return!1}function ii(r){function s(u,p,x,w,A){this._reactName=u,this._targetInst=x,this.type=p,this.nativeEvent=w,this.target=A,this.currentTarget=null;for(var $ in r)r.hasOwnProperty($)&&(u=r[$],this[$]=u?u(w):w[$]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?fd:av,this.isPropagationStopped=av,this}return m(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=fd)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=fd)},persist:function(){},isPersistent:fd}),s}var Ts={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hd=ii(Ts),fc=m({},Ts,{view:0,detail:0}),WA=ii(fc),Sp,Np,hc,pd=m({},fc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jp,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==hc&&(hc&&r.type==="mousemove"?(Sp=r.screenX-hc.screenX,Np=r.screenY-hc.screenY):Np=Sp=0,hc=r),Sp)},movementY:function(r){return"movementY"in r?r.movementY:Np}}),sv=ii(pd),XA=m({},pd,{dataTransfer:0}),ZA=ii(XA),JA=m({},fc,{relatedTarget:0}),_p=ii(JA),eT=m({},Ts,{animationName:0,elapsedTime:0,pseudoElement:0}),tT=ii(eT),nT=m({},Ts,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),iT=ii(nT),rT=m({},Ts,{data:0}),lv=ii(rT),aT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},sT={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"},lT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function oT(r){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(r):(r=lT[r])?!!s[r]:!1}function jp(){return oT}var cT=m({},fc,{key:function(r){if(r.key){var s=aT[r.key]||r.key;if(s!=="Unidentified")return s}return r.type==="keypress"?(r=dd(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?sT[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jp,charCode:function(r){return r.type==="keypress"?dd(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?dd(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),uT=ii(cT),dT=m({},pd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ov=ii(dT),fT=m({},fc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jp}),hT=ii(fT),pT=m({},Ts,{propertyName:0,elapsedTime:0,pseudoElement:0}),mT=ii(pT),gT=m({},pd,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),yT=ii(gT),bT=m({},Ts,{newState:0,oldState:0}),xT=ii(bT),vT=[9,13,27,32],Cp=qr&&"CompositionEvent"in window,pc=null;qr&&"documentMode"in document&&(pc=document.documentMode);var wT=qr&&"TextEvent"in window&&!pc,cv=qr&&(!Cp||pc&&8<pc&&11>=pc),uv=" ",dv=!1;function fv(r,s){switch(r){case"keyup":return vT.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hv(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ml=!1;function kT(r,s){switch(r){case"compositionend":return hv(s);case"keypress":return s.which!==32?null:(dv=!0,uv);case"textInput":return r=s.data,r===uv&&dv?null:r;default:return null}}function ET(r,s){if(Ml)return r==="compositionend"||!Cp&&fv(r,s)?(r=rv(),ud=Ep=Ma=null,Ml=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return cv&&s.locale!=="ko"?null:s.data;default:return null}}var ST={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 pv(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s==="input"?!!ST[r.type]:s==="textarea"}function mv(r,s,u,p){bt?ln?ln.push(p):ln=[p]:bt=p,s=rf(s,"onChange"),0<s.length&&(u=new hd("onChange","change",null,u,p),r.push({event:u,listeners:s}))}var mc=null,gc=null;function NT(r){Xw(r,0)}function md(r){var s=Ji(r);if(vr(s))return r}function gv(r,s){if(r==="change")return s}var yv=!1;if(qr){var Ap;if(qr){var Tp="oninput"in document;if(!Tp){var bv=document.createElement("div");bv.setAttribute("oninput","return;"),Tp=typeof bv.oninput=="function"}Ap=Tp}else Ap=!1;yv=Ap&&(!document.documentMode||9<document.documentMode)}function xv(){mc&&(mc.detachEvent("onpropertychange",vv),gc=mc=null)}function vv(r){if(r.propertyName==="value"&&md(gc)){var s=[];mv(s,gc,r,lt(r)),cd(NT,s)}}function _T(r,s,u){r==="focusin"?(xv(),mc=s,gc=u,mc.attachEvent("onpropertychange",vv)):r==="focusout"&&xv()}function jT(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return md(gc)}function CT(r,s){if(r==="click")return md(s)}function AT(r,s){if(r==="input"||r==="change")return md(s)}function TT(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var gi=typeof Object.is=="function"?Object.is:TT;function yc(r,s){if(gi(r,s))return!0;if(typeof r!="object"||r===null||typeof s!="object"||s===null)return!1;var u=Object.keys(r),p=Object.keys(s);if(u.length!==p.length)return!1;for(p=0;p<u.length;p++){var x=u[p];if(!ae.call(s,x)||!gi(r[x],s[x]))return!1}return!0}function wv(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function kv(r,s){var u=wv(r);r=0;for(var p;u;){if(u.nodeType===3){if(p=r+u.textContent.length,r<=s&&p>=s)return{node:u,offset:s-r};r=p}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=wv(u)}}function Ev(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?Ev(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function Sv(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var s=ja(r.document);s instanceof r.HTMLIFrameElement;){try{var u=typeof s.contentWindow.location.href=="string"}catch{u=!1}if(u)r=s.contentWindow;else break;s=ja(r.document)}return s}function Mp(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s&&(s==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||s==="textarea"||r.contentEditable==="true")}var MT=qr&&"documentMode"in document&&11>=document.documentMode,Dl=null,Dp=null,bc=null,Op=!1;function Nv(r,s,u){var p=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Op||Dl==null||Dl!==ja(p)||(p=Dl,"selectionStart"in p&&Mp(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),bc&&yc(bc,p)||(bc=p,p=rf(Dp,"onSelect"),0<p.length&&(s=new hd("onSelect","select",null,s,u),r.push({event:s,listeners:p}),s.target=Dl)))}function Ms(r,s){var u={};return u[r.toLowerCase()]=s.toLowerCase(),u["Webkit"+r]="webkit"+s,u["Moz"+r]="moz"+s,u}var Ol={animationend:Ms("Animation","AnimationEnd"),animationiteration:Ms("Animation","AnimationIteration"),animationstart:Ms("Animation","AnimationStart"),transitionrun:Ms("Transition","TransitionRun"),transitionstart:Ms("Transition","TransitionStart"),transitioncancel:Ms("Transition","TransitionCancel"),transitionend:Ms("Transition","TransitionEnd")},Rp={},_v={};qr&&(_v=document.createElement("div").style,"AnimationEvent"in window||(delete Ol.animationend.animation,delete Ol.animationiteration.animation,delete Ol.animationstart.animation),"TransitionEvent"in window||delete Ol.transitionend.transition);function Ds(r){if(Rp[r])return Rp[r];if(!Ol[r])return r;var s=Ol[r],u;for(u in s)if(s.hasOwnProperty(u)&&u in _v)return Rp[r]=s[u];return r}var jv=Ds("animationend"),Cv=Ds("animationiteration"),Av=Ds("animationstart"),DT=Ds("transitionrun"),OT=Ds("transitionstart"),RT=Ds("transitioncancel"),Tv=Ds("transitionend"),Mv=new Map,Lp="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Lp.push("scrollEnd");function nr(r,s){Mv.set(r,s),er(s,[r])}var gd=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},Oi=[],Rl=0,Ip=0;function yd(){for(var r=Rl,s=Ip=Rl=0;s<r;){var u=Oi[s];Oi[s++]=null;var p=Oi[s];Oi[s++]=null;var x=Oi[s];Oi[s++]=null;var w=Oi[s];if(Oi[s++]=null,p!==null&&x!==null){var A=p.pending;A===null?x.next=x:(x.next=A.next,A.next=x),p.pending=x}w!==0&&Dv(u,x,w)}}function bd(r,s,u,p){Oi[Rl++]=r,Oi[Rl++]=s,Oi[Rl++]=u,Oi[Rl++]=p,Ip|=p,r.lanes|=p,r=r.alternate,r!==null&&(r.lanes|=p)}function zp(r,s,u,p){return bd(r,s,u,p),xd(r)}function Os(r,s){return bd(r,null,null,s),xd(r)}function Dv(r,s,u){r.lanes|=u;var p=r.alternate;p!==null&&(p.lanes|=u);for(var x=!1,w=r.return;w!==null;)w.childLanes|=u,p=w.alternate,p!==null&&(p.childLanes|=u),w.tag===22&&(r=w.stateNode,r===null||r._visibility&1||(x=!0)),r=w,w=w.return;return r.tag===3?(w=r.stateNode,x&&s!==null&&(x=31-yt(u),r=w.hiddenUpdates,p=r[x],p===null?r[x]=[s]:p.push(s),s.lane=u|536870912),w):null}function xd(r){if(50<$c)throw $c=0,Gm=null,Error(i(185));for(var s=r.return;s!==null;)r=s,s=r.return;return r.tag===3?r.stateNode:null}var Ll={};function LT(r,s,u,p){this.tag=r,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yi(r,s,u,p){return new LT(r,s,u,p)}function Pp(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Hr(r,s){var u=r.alternate;return u===null?(u=yi(r.tag,s,r.key,r.mode),u.elementType=r.elementType,u.type=r.type,u.stateNode=r.stateNode,u.alternate=r,r.alternate=u):(u.pendingProps=s,u.type=r.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=r.flags&65011712,u.childLanes=r.childLanes,u.lanes=r.lanes,u.child=r.child,u.memoizedProps=r.memoizedProps,u.memoizedState=r.memoizedState,u.updateQueue=r.updateQueue,s=r.dependencies,u.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},u.sibling=r.sibling,u.index=r.index,u.ref=r.ref,u.refCleanup=r.refCleanup,u}function Ov(r,s){r.flags&=65011714;var u=r.alternate;return u===null?(r.childLanes=0,r.lanes=s,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=u.childLanes,r.lanes=u.lanes,r.child=u.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=u.memoizedProps,r.memoizedState=u.memoizedState,r.updateQueue=u.updateQueue,r.type=u.type,s=u.dependencies,r.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),r}function vd(r,s,u,p,x,w){var A=0;if(p=r,typeof r=="function")Pp(r)&&(A=1);else if(typeof r=="string")A=$M(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 R:A=14;break e;case O:A=16,p=null;break e}A=29,u=Error(i(130,r===null?"null":typeof r,"")),p=null}return s=yi(A,u,s,x),s.elementType=r,s.type=p,s.lanes=w,s}function Rs(r,s,u,p){return r=yi(7,r,p,s),r.lanes=u,r}function Bp(r,s,u){return r=yi(6,r,null,s),r.lanes=u,r}function Rv(r){var s=yi(18,null,null,0);return s.stateNode=r,s}function $p(r,s,u){return s=yi(4,r.children!==null?r.children:[],r.key,s),s.lanes=u,s.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},s}var Lv=new WeakMap;function Ri(r,s){if(typeof r=="object"&&r!==null){var u=Lv.get(r);return u!==void 0?u:(s={value:r,source:s,stack:ze(s)},Lv.set(r,s),s)}return{value:r,source:s,stack:ze(s)}}var Il=[],zl=0,wd=null,xc=0,Li=[],Ii=0,Da=null,wr=1,kr="";function Kr(r,s){Il[zl++]=xc,Il[zl++]=wd,wd=r,xc=s}function Iv(r,s,u){Li[Ii++]=wr,Li[Ii++]=kr,Li[Ii++]=Da,Da=r;var p=wr;r=kr;var x=32-yt(p)-1;p&=~(1<<x),u+=1;var w=32-yt(s)+x;if(30<w){var A=x-x%5;w=(p&(1<<A)-1).toString(32),p>>=A,x-=A,wr=1<<32-yt(s)+x|u<<x|p,kr=w+r}else wr=1<<w|u<<x|p,kr=r}function Up(r){r.return!==null&&(Kr(r,1),Iv(r,1,0))}function Fp(r){for(;r===wd;)wd=Il[--zl],Il[zl]=null,xc=Il[--zl],Il[zl]=null;for(;r===Da;)Da=Li[--Ii],Li[Ii]=null,kr=Li[--Ii],Li[Ii]=null,wr=Li[--Ii],Li[Ii]=null}function zv(r,s){Li[Ii++]=wr,Li[Ii++]=kr,Li[Ii++]=Da,wr=s.id,kr=s.overflow,Da=r}var In=null,Wt=null,wt=!1,Oa=null,zi=!1,qp=Error(i(519));function Ra(r){var s=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw vc(Ri(s,r)),qp}function Pv(r){var s=r.stateNode,u=r.type,p=r.memoizedProps;switch(s[an]=r,s[Tn]=p,u){case"dialog":mt("cancel",s),mt("close",s);break;case"iframe":case"object":case"embed":mt("load",s);break;case"video":case"audio":for(u=0;u<Fc.length;u++)mt(Fc[u],s);break;case"source":mt("error",s);break;case"img":case"image":case"link":mt("error",s),mt("load",s);break;case"details":mt("toggle",s);break;case"input":mt("invalid",s),tr(s,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":mt("invalid",s);break;case"textarea":mt("invalid",s),Tl(s,p.value,p.defaultValue,p.children)}u=p.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||s.textContent===""+u||p.suppressHydrationWarning===!0||t1(s.textContent,u)?(p.popover!=null&&(mt("beforetoggle",s),mt("toggle",s)),p.onScroll!=null&&mt("scroll",s),p.onScrollEnd!=null&&mt("scrollend",s),p.onClick!=null&&(s.onclick=Ae),s=!0):s=!1,s||Ra(r,!0)}function Bv(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 Bv(r),wt=!0,!1;var s=r.tag,u;if((u=s!==3&&s!==27)&&((u=s===5)&&(u=r.type,u=!(u!=="form"&&u!=="button")||lg(r.type,r.memoizedProps)),u=!u),u&&Wt&&Ra(r),Bv(r),s===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));Wt=u1(r)}else if(s===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));Wt=u1(r)}else s===27?(s=Wt,Ya(r.type)?(r=fg,fg=null,Wt=r):Wt=s):Wt=In?Bi(r.stateNode.nextSibling):null;return!0}function Ls(){Wt=In=null,wt=!1}function Hp(){var r=Oa;return r!==null&&(li===null?li=r:li.push.apply(li,r),Oa=null),r}function vc(r){Oa===null?Oa=[r]:Oa.push(r)}var Kp=z(null),Is=null,Gr=null;function La(r,s,u){P(Kp,s._currentValue),s._currentValue=u}function Vr(r){r._currentValue=Kp.current,V(Kp)}function Gp(r,s,u){for(;r!==null;){var p=r.alternate;if((r.childLanes&s)!==s?(r.childLanes|=s,p!==null&&(p.childLanes|=s)):p!==null&&(p.childLanes&s)!==s&&(p.childLanes|=s),r===u)break;r=r.return}}function Vp(r,s,u,p){var x=r.child;for(x!==null&&(x.return=r);x!==null;){var w=x.dependencies;if(w!==null){var A=x.child;w=w.firstContext;e:for(;w!==null;){var $=w;w=x;for(var W=0;W<s.length;W++)if($.context===s[W]){w.lanes|=u,$=w.alternate,$!==null&&($.lanes|=u),Gp(w.return,u,r),p||(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),Gp(A,u,r),A=null}else A=x.child;if(A!==null)A.return=x;else for(A=x;A!==null;){if(A===r){A=null;break}if(x=A.sibling,x!==null){x.return=A.return,A=x;break}A=A.return}x=A}}function Bl(r,s,u,p){r=null;for(var x=s,w=!1;x!==null;){if(!w){if((x.flags&524288)!==0)w=!0;else if((x.flags&262144)!==0)break}if(x.tag===10){var A=x.alternate;if(A===null)throw Error(i(387));if(A=A.memoizedProps,A!==null){var $=x.type;gi(x.pendingProps.value,A.value)||(r!==null?r.push($):r=[$])}}else if(x===Se.current){if(A=x.alternate,A===null)throw Error(i(387));A.memoizedState.memoizedState!==x.memoizedState.memoizedState&&(r!==null?r.push(Vc):r=[Vc])}x=x.return}r!==null&&Vp(s,r,u,p),s.flags|=262144}function kd(r){for(r=r.firstContext;r!==null;){if(!gi(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function zs(r){Is=r,Gr=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function zn(r){return $v(Is,r)}function Ed(r,s){return Is===null&&zs(r),$v(r,s)}function $v(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 IT=typeof AbortController<"u"?AbortController:function(){var r=[],s=this.signal={aborted:!1,addEventListener:function(u,p){r.push(p)}};this.abort=function(){s.aborted=!0,r.forEach(function(u){return u()})}},zT=e.unstable_scheduleCallback,PT=e.unstable_NormalPriority,vn={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Yp(){return{controller:new IT,data:new Map,refCount:0}}function wc(r){r.refCount--,r.refCount===0&&zT(PT,function(){r.controller.abort()})}var kc=null,Qp=0,$l=0,Ul=null;function BT(r,s){if(kc===null){var u=kc=[];Qp=0,$l=Zm(),Ul={status:"pending",value:void 0,then:function(p){u.push(p)}}}return Qp++,s.then(Uv,Uv),s}function Uv(){if(--Qp===0&&kc!==null){Ul!==null&&(Ul.status="fulfilled");var r=kc;kc=null,$l=0,Ul=null;for(var s=0;s<r.length;s++)(0,r[s])()}}function $T(r,s){var u=[],p={status:"pending",value:null,reason:null,then:function(x){u.push(x)}};return r.then(function(){p.status="fulfilled",p.value=s;for(var x=0;x<u.length;x++)(0,u[x])(s)},function(x){for(p.status="rejected",p.reason=x,x=0;x<u.length;x++)(0,u[x])(void 0)}),p}var Fv=I.S;I.S=function(r,s){Nw=Ne(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&BT(r,s),Fv!==null&&Fv(r,s)};var Ps=z(null);function Wp(){var r=Ps.current;return r!==null?r:Ht.pooledCache}function Sd(r,s){s===null?P(Ps,Ps.current):P(Ps,s.pool)}function qv(){var r=Wp();return r===null?null:{parent:vn._currentValue,pool:r}}var Fl=Error(i(460)),Xp=Error(i(474)),Nd=Error(i(542)),_d={then:function(){}};function Hv(r){return r=r.status,r==="fulfilled"||r==="rejected"}function Kv(r,s,u){switch(u=r[u],u===void 0?r.push(s):u!==s&&(s.then(Ae,Ae),s=u),s.status){case"fulfilled":return s.value;case"rejected":throw r=s.reason,Vv(r),r;default:if(typeof s.status=="string")s.then(Ae,Ae);else{if(r=Ht,r!==null&&100<r.shellSuspendCounter)throw Error(i(482));r=s,r.status="pending",r.then(function(p){if(s.status==="pending"){var x=s;x.status="fulfilled",x.value=p}},function(p){if(s.status==="pending"){var x=s;x.status="rejected",x.reason=p}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw r=s.reason,Vv(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 Gv(){if($s===null)throw Error(i(459));var r=$s;return $s=null,r}function Vv(r){if(r===Fl||r===Nd)throw Error(i(483))}var ql=null,Ec=0;function jd(r){var s=Ec;return Ec+=1,ql===null&&(ql=[]),Kv(ql,r,s)}function Sc(r,s){s=s.props.ref,r.ref=s!==void 0?s:null}function Cd(r,s){throw s.$$typeof===y?Error(i(525)):(r=Object.prototype.toString.call(s),Error(i(31,r==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":r)))}function Yv(r){function s(ie,ee){if(r){var re=ie.deletions;re===null?(ie.deletions=[ee],ie.flags|=16):re.push(ee)}}function u(ie,ee){if(!r)return null;for(;ee!==null;)s(ie,ee),ee=ee.sibling;return null}function p(ie){for(var ee=new Map;ie!==null;)ie.key!==null?ee.set(ie.key,ie):ee.set(ie.index,ie),ie=ie.sibling;return ee}function x(ie,ee){return ie=Hr(ie,ee),ie.index=0,ie.sibling=null,ie}function w(ie,ee,re){return ie.index=re,r?(re=ie.alternate,re!==null?(re=re.index,re<ee?(ie.flags|=67108866,ee):re):(ie.flags|=67108866,ee)):(ie.flags|=1048576,ee)}function A(ie){return r&&ie.alternate===null&&(ie.flags|=67108866),ie}function $(ie,ee,re,xe){return ee===null||ee.tag!==6?(ee=Bp(re,ie.mode,xe),ee.return=ie,ee):(ee=x(ee,re),ee.return=ie,ee)}function W(ie,ee,re,xe){var We=re.type;return We===v?me(ie,ee,re.props.children,xe,re.key):ee!==null&&(ee.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===O&&Bs(We)===ee.type)?(ee=x(ee,re.props),Sc(ee,re),ee.return=ie,ee):(ee=vd(re.type,re.key,re.props,null,ie.mode,xe),Sc(ee,re),ee.return=ie,ee)}function se(ie,ee,re,xe){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==re.containerInfo||ee.stateNode.implementation!==re.implementation?(ee=$p(re,ie.mode,xe),ee.return=ie,ee):(ee=x(ee,re.children||[]),ee.return=ie,ee)}function me(ie,ee,re,xe,We){return ee===null||ee.tag!==7?(ee=Rs(re,ie.mode,xe,We),ee.return=ie,ee):(ee=x(ee,re),ee.return=ie,ee)}function we(ie,ee,re){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ee=Bp(""+ee,ie.mode,re),ee.return=ie,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:return re=vd(ee.type,ee.key,ee.props,null,ie.mode,re),Sc(re,ee),re.return=ie,re;case k:return ee=$p(ee,ie.mode,re),ee.return=ie,ee;case O:return ee=Bs(ee),we(ie,ee,re)}if(F(ee)||q(ee))return ee=Rs(ee,ie.mode,re,null),ee.return=ie,ee;if(typeof ee.then=="function")return we(ie,jd(ee),re);if(ee.$$typeof===N)return we(ie,Ed(ie,ee),re);Cd(ie,ee)}return null}function oe(ie,ee,re,xe){var We=ee!==null?ee.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return We!==null?null:$(ie,ee,""+re,xe);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case b:return re.key===We?W(ie,ee,re,xe):null;case k:return re.key===We?se(ie,ee,re,xe):null;case O:return re=Bs(re),oe(ie,ee,re,xe)}if(F(re)||q(re))return We!==null?null:me(ie,ee,re,xe,null);if(typeof re.then=="function")return oe(ie,ee,jd(re),xe);if(re.$$typeof===N)return oe(ie,ee,Ed(ie,re),xe);Cd(ie,re)}return null}function fe(ie,ee,re,xe,We){if(typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint")return ie=ie.get(re)||null,$(ee,ie,""+xe,We);if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case b:return ie=ie.get(xe.key===null?re:xe.key)||null,W(ee,ie,xe,We);case k:return ie=ie.get(xe.key===null?re:xe.key)||null,se(ee,ie,xe,We);case O:return xe=Bs(xe),fe(ie,ee,re,xe,We)}if(F(xe)||q(xe))return ie=ie.get(re)||null,me(ee,ie,xe,We,null);if(typeof xe.then=="function")return fe(ie,ee,re,jd(xe),We);if(xe.$$typeof===N)return fe(ie,ee,re,Ed(ee,xe),We);Cd(ee,xe)}return null}function $e(ie,ee,re,xe){for(var We=null,jt=null,He=ee,ct=ee=0,vt=null;He!==null&&ct<re.length;ct++){He.index>ct?(vt=He,He=null):vt=He.sibling;var Ct=oe(ie,He,re[ct],xe);if(Ct===null){He===null&&(He=vt);break}r&&He&&Ct.alternate===null&&s(ie,He),ee=w(Ct,ee,ct),jt===null?We=Ct:jt.sibling=Ct,jt=Ct,He=vt}if(ct===re.length)return u(ie,He),wt&&Kr(ie,ct),We;if(He===null){for(;ct<re.length;ct++)He=we(ie,re[ct],xe),He!==null&&(ee=w(He,ee,ct),jt===null?We=He:jt.sibling=He,jt=He);return wt&&Kr(ie,ct),We}for(He=p(He);ct<re.length;ct++)vt=fe(He,ie,ct,re[ct],xe),vt!==null&&(r&&vt.alternate!==null&&He.delete(vt.key===null?ct:vt.key),ee=w(vt,ee,ct),jt===null?We=vt:jt.sibling=vt,jt=vt);return r&&He.forEach(function(Ja){return s(ie,Ja)}),wt&&Kr(ie,ct),We}function tt(ie,ee,re,xe){if(re==null)throw Error(i(151));for(var We=null,jt=null,He=ee,ct=ee=0,vt=null,Ct=re.next();He!==null&&!Ct.done;ct++,Ct=re.next()){He.index>ct?(vt=He,He=null):vt=He.sibling;var Ja=oe(ie,He,Ct.value,xe);if(Ja===null){He===null&&(He=vt);break}r&&He&&Ja.alternate===null&&s(ie,He),ee=w(Ja,ee,ct),jt===null?We=Ja:jt.sibling=Ja,jt=Ja,He=vt}if(Ct.done)return u(ie,He),wt&&Kr(ie,ct),We;if(He===null){for(;!Ct.done;ct++,Ct=re.next())Ct=we(ie,Ct.value,xe),Ct!==null&&(ee=w(Ct,ee,ct),jt===null?We=Ct:jt.sibling=Ct,jt=Ct);return wt&&Kr(ie,ct),We}for(He=p(He);!Ct.done;ct++,Ct=re.next())Ct=fe(He,ie,ct,Ct.value,xe),Ct!==null&&(r&&Ct.alternate!==null&&He.delete(Ct.key===null?ct:Ct.key),ee=w(Ct,ee,ct),jt===null?We=Ct:jt.sibling=Ct,jt=Ct);return r&&He.forEach(function(XM){return s(ie,XM)}),wt&&Kr(ie,ct),We}function $t(ie,ee,re,xe){if(typeof re=="object"&&re!==null&&re.type===v&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case b:e:{for(var We=re.key;ee!==null;){if(ee.key===We){if(We=re.type,We===v){if(ee.tag===7){u(ie,ee.sibling),xe=x(ee,re.props.children),xe.return=ie,ie=xe;break e}}else if(ee.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===O&&Bs(We)===ee.type){u(ie,ee.sibling),xe=x(ee,re.props),Sc(xe,re),xe.return=ie,ie=xe;break e}u(ie,ee);break}else s(ie,ee);ee=ee.sibling}re.type===v?(xe=Rs(re.props.children,ie.mode,xe,re.key),xe.return=ie,ie=xe):(xe=vd(re.type,re.key,re.props,null,ie.mode,xe),Sc(xe,re),xe.return=ie,ie=xe)}return A(ie);case k:e:{for(We=re.key;ee!==null;){if(ee.key===We)if(ee.tag===4&&ee.stateNode.containerInfo===re.containerInfo&&ee.stateNode.implementation===re.implementation){u(ie,ee.sibling),xe=x(ee,re.children||[]),xe.return=ie,ie=xe;break e}else{u(ie,ee);break}else s(ie,ee);ee=ee.sibling}xe=$p(re,ie.mode,xe),xe.return=ie,ie=xe}return A(ie);case O:return re=Bs(re),$t(ie,ee,re,xe)}if(F(re))return $e(ie,ee,re,xe);if(q(re)){if(We=q(re),typeof We!="function")throw Error(i(150));return re=We.call(re),tt(ie,ee,re,xe)}if(typeof re.then=="function")return $t(ie,ee,jd(re),xe);if(re.$$typeof===N)return $t(ie,ee,Ed(ie,re),xe);Cd(ie,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,ee!==null&&ee.tag===6?(u(ie,ee.sibling),xe=x(ee,re),xe.return=ie,ie=xe):(u(ie,ee),xe=Bp(re,ie.mode,xe),xe.return=ie,ie=xe),A(ie)):u(ie,ee)}return function(ie,ee,re,xe){try{Ec=0;var We=$t(ie,ee,re,xe);return ql=null,We}catch(He){if(He===Fl||He===Nd)throw He;var jt=yi(29,He,null,ie.mode);return jt.lanes=xe,jt.return=ie,jt}finally{}}}var Us=Yv(!0),Qv=Yv(!1),Ia=!1;function Zp(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Jp(r,s){r=r.updateQueue,s.updateQueue===r&&(s.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function za(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Pa(r,s,u){var p=r.updateQueue;if(p===null)return null;if(p=p.shared,(Tt&2)!==0){var x=p.pending;return x===null?s.next=s:(s.next=x.next,x.next=s),p.pending=s,s=xd(r),Dv(r,null,u),s}return bd(r,p,s,u),xd(r)}function Nc(r,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194048)!==0)){var p=s.lanes;p&=r.pendingLanes,u|=p,s.lanes=u,et(r,u)}}function em(r,s){var u=r.updateQueue,p=r.alternate;if(p!==null&&(p=p.updateQueue,u===p)){var x=null,w=null;if(u=u.firstBaseUpdate,u!==null){do{var A={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};w===null?x=w=A:w=w.next=A,u=u.next}while(u!==null);w===null?x=w=s:w=w.next=s}else x=w=s;u={baseState:p.baseState,firstBaseUpdate:x,lastBaseUpdate:w,shared:p.shared,callbacks:p.callbacks},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=s:r.next=s,u.lastBaseUpdate=s}var tm=!1;function _c(){if(tm){var r=Ul;if(r!==null)throw r}}function jc(r,s,u,p){tm=!1;var x=r.updateQueue;Ia=!1;var w=x.firstBaseUpdate,A=x.lastBaseUpdate,$=x.shared.pending;if($!==null){x.shared.pending=null;var W=$,se=W.next;W.next=null,A===null?w=se:A.next=se,A=W;var me=r.alternate;me!==null&&(me=me.updateQueue,$=me.lastBaseUpdate,$!==A&&($===null?me.firstBaseUpdate=se:$.next=se,me.lastBaseUpdate=W))}if(w!==null){var we=x.baseState;A=0,me=se=W=null,$=w;do{var oe=$.lane&-536870913,fe=oe!==$.lane;if(fe?(xt&oe)===oe:(p&oe)===oe){oe!==0&&oe===$l&&(tm=!0),me!==null&&(me=me.next={lane:0,tag:$.tag,payload:$.payload,callback:null,next:null});e:{var $e=r,tt=$;oe=s;var $t=u;switch(tt.tag){case 1:if($e=tt.payload,typeof $e=="function"){we=$e.call($t,we,oe);break e}we=$e;break e;case 3:$e.flags=$e.flags&-65537|128;case 0:if($e=tt.payload,oe=typeof $e=="function"?$e.call($t,we,oe):$e,oe==null)break e;we=m({},we,oe);break e;case 2:Ia=!0}}oe=$.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},me===null?(se=me=fe,W=we):me=me.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);me===null&&(W=we),x.baseState=W,x.firstBaseUpdate=se,x.lastBaseUpdate=me,w===null&&(x.shared.lanes=0),qa|=A,r.lanes=A,r.memoizedState=we}}function Wv(r,s){if(typeof r!="function")throw Error(i(191,r));r.call(s)}function Xv(r,s){var u=r.callbacks;if(u!==null)for(r.callbacks=null,r=0;r<u.length;r++)Wv(u[r],s)}var Hl=z(null),Ad=z(0);function Zv(r,s){r=na,P(Ad,r),P(Hl,s),na=r|s.baseLanes}function nm(){P(Ad,na),P(Hl,Hl.current)}function im(){na=Ad.current,V(Hl),V(Ad)}var bi=z(null),Pi=null;function Ba(r){var s=r.alternate;P(gn,gn.current&1),P(bi,r),Pi===null&&(s===null||Hl.current!==null||s.memoizedState!==null)&&(Pi=r)}function rm(r){P(gn,gn.current),P(bi,r),Pi===null&&(Pi=r)}function Jv(r){r.tag===22?(P(gn,gn.current),P(bi,r),Pi===null&&(Pi=r)):$a()}function $a(){P(gn,gn.current),P(bi,bi.current)}function xi(r){V(bi),Pi===r&&(Pi=null),V(gn)}var gn=z(0);function Td(r){for(var s=r;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||ug(u)||dg(u)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Yr=0,ot=null,Pt=null,wn=null,Md=!1,Kl=!1,Fs=!1,Dd=0,Cc=0,Gl=null,UT=0;function hn(){throw Error(i(321))}function am(r,s){if(s===null)return!1;for(var u=0;u<s.length&&u<r.length;u++)if(!gi(r[u],s[u]))return!1;return!0}function sm(r,s,u,p,x,w){return Yr=w,ot=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,I.H=r===null||r.memoizedState===null?I0:wm,Fs=!1,w=u(p,x),Fs=!1,Kl&&(w=t0(s,u,p,x)),e0(r),w}function e0(r){I.H=Mc;var s=Pt!==null&&Pt.next!==null;if(Yr=0,wn=Pt=ot=null,Md=!1,Cc=0,Gl=null,s)throw Error(i(300));r===null||kn||(r=r.dependencies,r!==null&&kd(r)&&(kn=!0))}function t0(r,s,u,p){ot=r;var x=0;do{if(Kl&&(Gl=null),Cc=0,Kl=!1,25<=x)throw Error(i(301));if(x+=1,wn=Pt=null,r.updateQueue!=null){var w=r.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}I.H=z0,w=s(u,p)}while(Kl);return w}function FT(){var r=I.H,s=r.useState()[0];return s=typeof s.then=="function"?Ac(s):s,r=r.useState()[0],(Pt!==null?Pt.memoizedState:null)!==r&&(ot.flags|=1024),s}function lm(){var r=Dd!==0;return Dd=0,r}function om(r,s,u){s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~u}function cm(r){if(Md){for(r=r.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Md=!1}Yr=0,wn=Pt=ot=null,Kl=!1,Cc=Dd=0,Gl=null}function Xn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wn===null?ot.memoizedState=wn=r:wn=wn.next=r,wn}function yn(){if(Pt===null){var r=ot.alternate;r=r!==null?r.memoizedState:null}else r=Pt.next;var s=wn===null?ot.memoizedState:wn.next;if(s!==null)wn=s,Pt=r;else{if(r===null)throw ot.alternate===null?Error(i(467)):Error(i(310));Pt=r,r={memoizedState:Pt.memoizedState,baseState:Pt.baseState,baseQueue:Pt.baseQueue,queue:Pt.queue,next:null},wn===null?ot.memoizedState=wn=r:wn=wn.next=r}return wn}function Od(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ac(r){var s=Cc;return Cc+=1,Gl===null&&(Gl=[]),r=Kv(Gl,r,s),s=ot,(wn===null?s.memoizedState:wn.next)===null&&(s=s.alternate,I.H=s===null||s.memoizedState===null?I0:wm),r}function Rd(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Ac(r);if(r.$$typeof===N)return zn(r)}throw Error(i(438,String(r)))}function um(r){var s=null,u=ot.updateQueue;if(u!==null&&(s=u.memoCache),s==null){var p=ot.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(s={data:p.data.map(function(x){return x.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),u===null&&(u=Od(),ot.updateQueue=u),u.memoCache=s,u=s.data[s.index],u===void 0)for(u=s.data[s.index]=Array(r),p=0;p<r;p++)u[p]=U;return s.index++,u}function Qr(r,s){return typeof s=="function"?s(r):s}function Ld(r){var s=yn();return dm(s,Pt,r)}function dm(r,s,u){var p=r.queue;if(p===null)throw Error(i(311));p.lastRenderedReducer=u;var x=r.baseQueue,w=p.pending;if(w!==null){if(x!==null){var A=x.next;x.next=w.next,w.next=A}s.baseQueue=x=w,p.pending=null}if(w=r.baseState,x===null)r.memoizedState=w;else{s=x.next;var $=A=null,W=null,se=s,me=!1;do{var we=se.lane&-536870913;if(we!==se.lane?(xt&we)===we:(Yr&we)===we){var oe=se.revertLane;if(oe===0)W!==null&&(W=W.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),we===$l&&(me=!0);else if((Yr&oe)===oe){se=se.next,oe===$l&&(me=!0);continue}else we={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},W===null?($=W=we,A=w):W=W.next=we,ot.lanes|=oe,qa|=oe;we=se.action,Fs&&u(w,we),w=se.hasEagerState?se.eagerState:u(w,we)}else oe={lane:we,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},W===null?($=W=oe,A=w):W=W.next=oe,ot.lanes|=we,qa|=we;se=se.next}while(se!==null&&se!==s);if(W===null?A=w:W.next=$,!gi(w,r.memoizedState)&&(kn=!0,me&&(u=Ul,u!==null)))throw u;r.memoizedState=w,r.baseState=A,r.baseQueue=W,p.lastRenderedState=w}return x===null&&(p.lanes=0),[r.memoizedState,p.dispatch]}function fm(r){var s=yn(),u=s.queue;if(u===null)throw Error(i(311));u.lastRenderedReducer=r;var p=u.dispatch,x=u.pending,w=s.memoizedState;if(x!==null){u.pending=null;var A=x=x.next;do w=r(w,A.action),A=A.next;while(A!==x);gi(w,s.memoizedState)||(kn=!0),s.memoizedState=w,s.baseQueue===null&&(s.baseState=w),u.lastRenderedState=w}return[w,p]}function n0(r,s,u){var p=ot,x=yn(),w=wt;if(w){if(u===void 0)throw Error(i(407));u=u()}else u=s();var A=!gi((Pt||x).memoizedState,u);if(A&&(x.memoizedState=u,kn=!0),x=x.queue,mm(a0.bind(null,p,x,r),[r]),x.getSnapshot!==s||A||wn!==null&&wn.memoizedState.tag&1){if(p.flags|=2048,Vl(9,{destroy:void 0},r0.bind(null,p,x,u,s),null),Ht===null)throw Error(i(349));w||(Yr&127)!==0||i0(p,s,u)}return u}function i0(r,s,u){r.flags|=16384,r={getSnapshot:s,value:u},s=ot.updateQueue,s===null?(s=Od(),ot.updateQueue=s,s.stores=[r]):(u=s.stores,u===null?s.stores=[r]:u.push(r))}function r0(r,s,u,p){s.value=u,s.getSnapshot=p,s0(s)&&l0(r)}function a0(r,s,u){return u(function(){s0(s)&&l0(r)})}function s0(r){var s=r.getSnapshot;r=r.value;try{var u=s();return!gi(r,u)}catch{return!0}}function l0(r){var s=Os(r,2);s!==null&&oi(s,r,2)}function hm(r){var s=Xn();if(typeof r=="function"){var u=r;if(r=u(),Fs){Qt(!0);try{u()}finally{Qt(!1)}}}return s.memoizedState=s.baseState=r,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qr,lastRenderedState:r},s}function o0(r,s,u,p){return r.baseState=u,dm(r,Pt,typeof p=="function"?p:Qr)}function qT(r,s,u,p,x){if(Pd(r))throw Error(i(485));if(r=s.action,r!==null){var w={payload:x,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){w.listeners.push(A)}};I.T!==null?u(!0):w.isTransition=!1,p(w),u=s.pending,u===null?(w.next=s.pending=w,c0(s,w)):(w.next=u.next,s.pending=u.next=w)}}function c0(r,s){var u=s.action,p=s.payload,x=r.state;if(s.isTransition){var w=I.T,A={};I.T=A;try{var $=u(x,p),W=I.S;W!==null&&W(A,$),u0(r,s,$)}catch(se){pm(r,s,se)}finally{w!==null&&A.types!==null&&(w.types=A.types),I.T=w}}else try{w=u(x,p),u0(r,s,w)}catch(se){pm(r,s,se)}}function u0(r,s,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(p){d0(r,s,p)},function(p){return pm(r,s,p)}):d0(r,s,u)}function d0(r,s,u){s.status="fulfilled",s.value=u,f0(s),r.state=u,s=r.pending,s!==null&&(u=s.next,u===s?r.pending=null:(u=u.next,s.next=u,c0(r,u)))}function pm(r,s,u){var p=r.pending;if(r.pending=null,p!==null){p=p.next;do s.status="rejected",s.reason=u,f0(s),s=s.next;while(s!==p)}r.action=null}function f0(r){r=r.listeners;for(var s=0;s<r.length;s++)(0,r[s])()}function h0(r,s){return s}function p0(r,s){if(wt){var u=Ht.formState;if(u!==null){e:{var p=ot;if(wt){if(Wt){t:{for(var x=Wt,w=zi;x.nodeType!==8;){if(!w){x=null;break t}if(x=Bi(x.nextSibling),x===null){x=null;break t}}w=x.data,x=w==="F!"||w==="F"?x:null}if(x){Wt=Bi(x.nextSibling),p=x.data==="F!";break e}}Ra(p)}p=!1}p&&(s=u[0])}}return u=Xn(),u.memoizedState=u.baseState=s,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:h0,lastRenderedState:s},u.queue=p,u=O0.bind(null,ot,p),p.dispatch=u,p=hm(!1),w=vm.bind(null,ot,!1,p.queue),p=Xn(),x={state:s,dispatch:null,action:r,pending:null},p.queue=x,u=qT.bind(null,ot,x,w,u),x.dispatch=u,p.memoizedState=r,[s,u,!1]}function m0(r){var s=yn();return g0(s,Pt,r)}function g0(r,s,u){if(s=dm(r,s,h0)[0],r=Ld(Qr)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var p=Ac(s)}catch(A){throw A===Fl?Nd:A}else p=s;s=yn();var x=s.queue,w=x.dispatch;return u!==s.memoizedState&&(ot.flags|=2048,Vl(9,{destroy:void 0},HT.bind(null,x,u),null)),[p,w,r]}function HT(r,s){r.action=s}function y0(r){var s=yn(),u=Pt;if(u!==null)return g0(s,u,r);yn(),s=s.memoizedState,u=yn();var p=u.queue.dispatch;return u.memoizedState=r,[s,p,!1]}function Vl(r,s,u,p){return r={tag:r,create:u,deps:p,inst:s,next:null},s=ot.updateQueue,s===null&&(s=Od(),ot.updateQueue=s),u=s.lastEffect,u===null?s.lastEffect=r.next=r:(p=u.next,u.next=r,r.next=p,s.lastEffect=r),r}function b0(){return yn().memoizedState}function Id(r,s,u,p){var x=Xn();ot.flags|=r,x.memoizedState=Vl(1|s,{destroy:void 0},u,p===void 0?null:p)}function zd(r,s,u,p){var x=yn();p=p===void 0?null:p;var w=x.memoizedState.inst;Pt!==null&&p!==null&&am(p,Pt.memoizedState.deps)?x.memoizedState=Vl(s,w,u,p):(ot.flags|=r,x.memoizedState=Vl(1|s,w,u,p))}function x0(r,s){Id(8390656,8,r,s)}function mm(r,s){zd(2048,8,r,s)}function KT(r){ot.flags|=4;var s=ot.updateQueue;if(s===null)s=Od(),ot.updateQueue=s,s.events=[r];else{var u=s.events;u===null?s.events=[r]:u.push(r)}}function v0(r){var s=yn().memoizedState;return KT({ref:s,nextImpl:r}),function(){if((Tt&2)!==0)throw Error(i(440));return s.impl.apply(void 0,arguments)}}function w0(r,s){return zd(4,2,r,s)}function k0(r,s){return zd(4,4,r,s)}function E0(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 S0(r,s,u){u=u!=null?u.concat([r]):null,zd(4,4,E0.bind(null,s,r),u)}function gm(){}function N0(r,s){var u=yn();s=s===void 0?null:s;var p=u.memoizedState;return s!==null&&am(s,p[1])?p[0]:(u.memoizedState=[r,s],r)}function _0(r,s){var u=yn();s=s===void 0?null:s;var p=u.memoizedState;if(s!==null&&am(s,p[1]))return p[0];if(p=r(),Fs){Qt(!0);try{r()}finally{Qt(!1)}}return u.memoizedState=[p,s],p}function ym(r,s,u){return u===void 0||(Yr&1073741824)!==0&&(xt&261930)===0?r.memoizedState=s:(r.memoizedState=u,r=jw(),ot.lanes|=r,qa|=r,u)}function j0(r,s,u,p){return gi(u,s)?u:Hl.current!==null?(r=ym(r,u,p),gi(r,s)||(kn=!0),r):(Yr&42)===0||(Yr&1073741824)!==0&&(xt&261930)===0?(kn=!0,r.memoizedState=u):(r=jw(),ot.lanes|=r,qa|=r,s)}function C0(r,s,u,p,x){var w=H.p;H.p=w!==0&&8>w?w:8;var A=I.T,$={};I.T=$,vm(r,!1,s,u);try{var W=x(),se=I.S;if(se!==null&&se($,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var me=$T(W,p);Tc(r,s,me,ki(r))}else Tc(r,s,p,ki(r))}catch(we){Tc(r,s,{then:function(){},status:"rejected",reason:we},ki())}finally{H.p=w,A!==null&&$.types!==null&&(A.types=$.types),I.T=A}}function GT(){}function bm(r,s,u,p){if(r.tag!==5)throw Error(i(476));var x=A0(r).queue;C0(r,x,s,Q,u===null?GT:function(){return T0(r),u(p)})}function A0(r){var s=r.memoizedState;if(s!==null)return s;s={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qr,lastRenderedState:Q},next:null};var u={};return s.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qr,lastRenderedState:u},next:null},r.memoizedState=s,r=r.alternate,r!==null&&(r.memoizedState=s),s}function T0(r){var s=A0(r);s.next===null&&(s=r.alternate.memoizedState),Tc(r,s.next.queue,{},ki())}function xm(){return zn(Vc)}function M0(){return yn().memoizedState}function D0(){return yn().memoizedState}function VT(r){for(var s=r.return;s!==null;){switch(s.tag){case 24:case 3:var u=ki();r=za(u);var p=Pa(s,r,u);p!==null&&(oi(p,s,u),Nc(p,s,u)),s={cache:Yp()},r.payload=s;return}s=s.return}}function YT(r,s,u){var p=ki();u={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Pd(r)?R0(s,u):(u=zp(r,s,u,p),u!==null&&(oi(u,r,p),L0(u,s,p)))}function O0(r,s,u){var p=ki();Tc(r,s,u,p)}function Tc(r,s,u,p){var x={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Pd(r))R0(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 bd(r,s,x,0),Ht===null&&yd(),!1}catch{}finally{}if(u=zp(r,s,x,p),u!==null)return oi(u,r,p),L0(u,s,p),!0}return!1}function vm(r,s,u,p){if(p={lane:2,revertLane:Zm(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Pd(r)){if(s)throw Error(i(479))}else s=zp(r,u,p,2),s!==null&&oi(s,r,2)}function Pd(r){var s=r.alternate;return r===ot||s!==null&&s===ot}function R0(r,s){Kl=Md=!0;var u=r.pending;u===null?s.next=s:(s.next=u.next,u.next=s),r.pending=s}function L0(r,s,u){if((u&4194048)!==0){var p=s.lanes;p&=r.pendingLanes,u|=p,s.lanes=u,et(r,u)}}var Mc={readContext:zn,use:Rd,useCallback:hn,useContext:hn,useEffect:hn,useImperativeHandle:hn,useLayoutEffect:hn,useInsertionEffect:hn,useMemo:hn,useReducer:hn,useRef:hn,useState:hn,useDebugValue:hn,useDeferredValue:hn,useTransition:hn,useSyncExternalStore:hn,useId:hn,useHostTransitionStatus:hn,useFormState:hn,useActionState:hn,useOptimistic:hn,useMemoCache:hn,useCacheRefresh:hn};Mc.useEffectEvent=hn;var I0={readContext:zn,use:Rd,useCallback:function(r,s){return Xn().memoizedState=[r,s===void 0?null:s],r},useContext:zn,useEffect:x0,useImperativeHandle:function(r,s,u){u=u!=null?u.concat([r]):null,Id(4194308,4,E0.bind(null,s,r),u)},useLayoutEffect:function(r,s){return Id(4194308,4,r,s)},useInsertionEffect:function(r,s){Id(4,2,r,s)},useMemo:function(r,s){var u=Xn();s=s===void 0?null:s;var p=r();if(Fs){Qt(!0);try{r()}finally{Qt(!1)}}return u.memoizedState=[p,s],p},useReducer:function(r,s,u){var p=Xn();if(u!==void 0){var x=u(s);if(Fs){Qt(!0);try{u(s)}finally{Qt(!1)}}}else x=s;return p.memoizedState=p.baseState=x,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:x},p.queue=r,r=r.dispatch=YT.bind(null,ot,r),[p.memoizedState,r]},useRef:function(r){var s=Xn();return r={current:r},s.memoizedState=r},useState:function(r){r=hm(r);var s=r.queue,u=O0.bind(null,ot,s);return s.dispatch=u,[r.memoizedState,u]},useDebugValue:gm,useDeferredValue:function(r,s){var u=Xn();return ym(u,r,s)},useTransition:function(){var r=hm(!1);return r=C0.bind(null,ot,r.queue,!0,!1),Xn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,s,u){var p=ot,x=Xn();if(wt){if(u===void 0)throw Error(i(407));u=u()}else{if(u=s(),Ht===null)throw Error(i(349));(xt&127)!==0||i0(p,s,u)}x.memoizedState=u;var w={value:u,getSnapshot:s};return x.queue=w,x0(a0.bind(null,p,w,r),[r]),p.flags|=2048,Vl(9,{destroy:void 0},r0.bind(null,p,w,u,s),null),u},useId:function(){var r=Xn(),s=Ht.identifierPrefix;if(wt){var u=kr,p=wr;u=(p&~(1<<32-yt(p)-1)).toString(32)+u,s="_"+s+"R_"+u,u=Dd++,0<u&&(s+="H"+u.toString(32)),s+="_"}else u=UT++,s="_"+s+"r_"+u.toString(32)+"_";return r.memoizedState=s},useHostTransitionStatus:xm,useFormState:p0,useActionState:p0,useOptimistic:function(r){var s=Xn();s.memoizedState=s.baseState=r;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=u,s=vm.bind(null,ot,!0,u),u.dispatch=s,[r,s]},useMemoCache:um,useCacheRefresh:function(){return Xn().memoizedState=VT.bind(null,ot)},useEffectEvent:function(r){var s=Xn(),u={impl:r};return s.memoizedState=u,function(){if((Tt&2)!==0)throw Error(i(440));return u.impl.apply(void 0,arguments)}}},wm={readContext:zn,use:Rd,useCallback:N0,useContext:zn,useEffect:mm,useImperativeHandle:S0,useInsertionEffect:w0,useLayoutEffect:k0,useMemo:_0,useReducer:Ld,useRef:b0,useState:function(){return Ld(Qr)},useDebugValue:gm,useDeferredValue:function(r,s){var u=yn();return j0(u,Pt.memoizedState,r,s)},useTransition:function(){var r=Ld(Qr)[0],s=yn().memoizedState;return[typeof r=="boolean"?r:Ac(r),s]},useSyncExternalStore:n0,useId:M0,useHostTransitionStatus:xm,useFormState:m0,useActionState:m0,useOptimistic:function(r,s){var u=yn();return o0(u,Pt,r,s)},useMemoCache:um,useCacheRefresh:D0};wm.useEffectEvent=v0;var z0={readContext:zn,use:Rd,useCallback:N0,useContext:zn,useEffect:mm,useImperativeHandle:S0,useInsertionEffect:w0,useLayoutEffect:k0,useMemo:_0,useReducer:fm,useRef:b0,useState:function(){return fm(Qr)},useDebugValue:gm,useDeferredValue:function(r,s){var u=yn();return Pt===null?ym(u,r,s):j0(u,Pt.memoizedState,r,s)},useTransition:function(){var r=fm(Qr)[0],s=yn().memoizedState;return[typeof r=="boolean"?r:Ac(r),s]},useSyncExternalStore:n0,useId:M0,useHostTransitionStatus:xm,useFormState:y0,useActionState:y0,useOptimistic:function(r,s){var u=yn();return Pt!==null?o0(u,Pt,r,s):(u.baseState=r,[r,u.queue.dispatch])},useMemoCache:um,useCacheRefresh:D0};z0.useEffectEvent=v0;function km(r,s,u,p){s=r.memoizedState,u=u(p,s),u=u==null?s:m({},s,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}var Em={enqueueSetState:function(r,s,u){r=r._reactInternals;var p=ki(),x=za(p);x.payload=s,u!=null&&(x.callback=u),s=Pa(r,x,p),s!==null&&(oi(s,r,p),Nc(s,r,p))},enqueueReplaceState:function(r,s,u){r=r._reactInternals;var p=ki(),x=za(p);x.tag=1,x.payload=s,u!=null&&(x.callback=u),s=Pa(r,x,p),s!==null&&(oi(s,r,p),Nc(s,r,p))},enqueueForceUpdate:function(r,s){r=r._reactInternals;var u=ki(),p=za(u);p.tag=2,s!=null&&(p.callback=s),s=Pa(r,p,u),s!==null&&(oi(s,r,u),Nc(s,r,u))}};function P0(r,s,u,p,x,w,A){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(p,w,A):s.prototype&&s.prototype.isPureReactComponent?!yc(u,p)||!yc(x,w):!0}function B0(r,s,u,p){r=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,p),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,p),s.state!==r&&Em.enqueueReplaceState(s,s.state,null)}function qs(r,s){var u=s;if("ref"in s){u={};for(var p in s)p!=="ref"&&(u[p]=s[p])}if(r=r.defaultProps){u===s&&(u=m({},u));for(var x in r)u[x]===void 0&&(u[x]=r[x])}return u}function $0(r){gd(r)}function U0(r){console.error(r)}function F0(r){gd(r)}function Bd(r,s){try{var u=r.onUncaughtError;u(s.value,{componentStack:s.stack})}catch(p){setTimeout(function(){throw p})}}function q0(r,s,u){try{var p=r.onCaughtError;p(u.value,{componentStack:u.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function Sm(r,s,u){return u=za(u),u.tag=3,u.payload={element:null},u.callback=function(){Bd(r,s)},u}function H0(r){return r=za(r),r.tag=3,r}function K0(r,s,u,p){var x=u.type.getDerivedStateFromError;if(typeof x=="function"){var w=p.value;r.payload=function(){return x(w)},r.callback=function(){q0(s,u,p)}}var A=u.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(r.callback=function(){q0(s,u,p),typeof x!="function"&&(Ha===null?Ha=new Set([this]):Ha.add(this));var $=p.stack;this.componentDidCatch(p.value,{componentStack:$!==null?$:""})})}function QT(r,s,u,p,x){if(u.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(s=u.alternate,s!==null&&Bl(s,u,x,!0),u=bi.current,u!==null){switch(u.tag){case 31:case 13:return Pi===null?Xd():u.alternate===null&&pn===0&&(pn=3),u.flags&=-257,u.flags|=65536,u.lanes=x,p===_d?u.flags|=16384:(s=u.updateQueue,s===null?u.updateQueue=new Set([p]):s.add(p),Qm(r,p,x)),!1;case 22:return u.flags|=65536,p===_d?u.flags|=16384:(s=u.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([p])},u.updateQueue=s):(u=s.retryQueue,u===null?s.retryQueue=new Set([p]):u.add(p)),Qm(r,p,x)),!1}throw Error(i(435,u.tag))}return Qm(r,p,x),Xd(),!1}if(wt)return s=bi.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=x,p!==qp&&(r=Error(i(422),{cause:p}),vc(Ri(r,u)))):(p!==qp&&(s=Error(i(423),{cause:p}),vc(Ri(s,u))),r=r.current.alternate,r.flags|=65536,x&=-x,r.lanes|=x,p=Ri(p,u),x=Sm(r.stateNode,p,x),em(r,x),pn!==4&&(pn=2)),!1;var w=Error(i(520),{cause:p});if(w=Ri(w,u),Bc===null?Bc=[w]:Bc.push(w),pn!==4&&(pn=2),s===null)return!0;p=Ri(p,u),u=s;do{switch(u.tag){case 3:return u.flags|=65536,r=x&-x,u.lanes|=r,r=Sm(u.stateNode,p,r),em(u,r),!1;case 1:if(s=u.type,w=u.stateNode,(u.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Ha===null||!Ha.has(w))))return u.flags|=65536,x&=-x,u.lanes|=x,x=H0(x),K0(x,r,u,p),em(u,x),!1}u=u.return}while(u!==null);return!1}var Nm=Error(i(461)),kn=!1;function Pn(r,s,u,p){s.child=r===null?Qv(s,null,u,p):Us(s,r.child,u,p)}function G0(r,s,u,p,x){u=u.render;var w=s.ref;if("ref"in p){var A={};for(var $ in p)$!=="ref"&&(A[$]=p[$])}else A=p;return zs(s),p=sm(r,s,u,A,w,x),$=lm(),r!==null&&!kn?(om(r,s,x),Wr(r,s,x)):(wt&&$&&Up(s),s.flags|=1,Pn(r,s,p,x),s.child)}function V0(r,s,u,p,x){if(r===null){var w=u.type;return typeof w=="function"&&!Pp(w)&&w.defaultProps===void 0&&u.compare===null?(s.tag=15,s.type=w,Y0(r,s,w,p,x)):(r=vd(u.type,null,p,s,s.mode,x),r.ref=s.ref,r.return=s,s.child=r)}if(w=r.child,!Om(r,x)){var A=w.memoizedProps;if(u=u.compare,u=u!==null?u:yc,u(A,p)&&r.ref===s.ref)return Wr(r,s,x)}return s.flags|=1,r=Hr(w,p),r.ref=s.ref,r.return=s,s.child=r}function Y0(r,s,u,p,x){if(r!==null){var w=r.memoizedProps;if(yc(w,p)&&r.ref===s.ref)if(kn=!1,s.pendingProps=p=w,Om(r,x))(r.flags&131072)!==0&&(kn=!0);else return s.lanes=r.lanes,Wr(r,s,x)}return _m(r,s,u,p,x)}function Q0(r,s,u,p){var x=p.children,w=r!==null?r.memoizedState:null;if(r===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((s.flags&128)!==0){if(w=w!==null?w.baseLanes|u:u,r!==null){for(p=s.child=r.child,x=0;p!==null;)x=x|p.lanes|p.childLanes,p=p.sibling;p=x&~w}else p=0,s.child=null;return W0(r,s,w,u,p)}if((u&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},r!==null&&Sd(s,w!==null?w.cachePool:null),w!==null?Zv(s,w):nm(),Jv(s);else return p=s.lanes=536870912,W0(r,s,w!==null?w.baseLanes|u:u,u,p)}else w!==null?(Sd(s,w.cachePool),Zv(s,w),$a(),s.memoizedState=null):(r!==null&&Sd(s,null),nm(),$a());return Pn(r,s,x,u),s.child}function Dc(r,s){return r!==null&&r.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function W0(r,s,u,p,x){var w=Wp();return w=w===null?null:{parent:vn._currentValue,pool:w},s.memoizedState={baseLanes:u,cachePool:w},r!==null&&Sd(s,null),nm(),Jv(s),r!==null&&Bl(r,s,p,!0),s.childLanes=x,null}function $d(r,s){return s=Fd({mode:s.mode,children:s.children},r.mode),s.ref=r.ref,r.child=s,s.return=r,s}function X0(r,s,u){return Us(s,r.child,null,u),r=$d(s,s.pendingProps),r.flags|=2,xi(s),s.memoizedState=null,r}function WT(r,s,u){var p=s.pendingProps,x=(s.flags&128)!==0;if(s.flags&=-129,r===null){if(wt){if(p.mode==="hidden")return r=$d(s,p),s.lanes=536870912,Dc(null,r);if(rm(s),(r=Wt)?(r=c1(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=Rv(r),u.return=s,s.child=u,In=s,Wt=null)):r=null,r===null)throw Ra(s);return s.lanes=536870912,null}return $d(s,p)}var w=r.memoizedState;if(w!==null){var A=w.dehydrated;if(rm(s),x)if(s.flags&256)s.flags&=-257,s=X0(r,s,u);else if(s.memoizedState!==null)s.child=r.child,s.flags|=128,s=null;else throw Error(i(558));else if(kn||Bl(r,s,u,!1),x=(u&r.childLanes)!==0,kn||x){if(p=Ht,p!==null&&(A=rn(p,u),A!==0&&A!==w.retryLane))throw w.retryLane=A,Os(r,A),oi(p,r,A),Nm;Xd(),s=X0(r,s,u)}else r=w.treeContext,Wt=Bi(A.nextSibling),In=s,wt=!0,Oa=null,zi=!1,r!==null&&zv(s,r),s=$d(s,p),s.flags|=4096;return s}return r=Hr(r.child,{mode:p.mode,children:p.children}),r.ref=s.ref,s.child=r,r.return=s,r}function Ud(r,s){var u=s.ref;if(u===null)r!==null&&r.ref!==null&&(s.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(i(284));(r===null||r.ref!==u)&&(s.flags|=4194816)}}function _m(r,s,u,p,x){return zs(s),u=sm(r,s,u,p,void 0,x),p=lm(),r!==null&&!kn?(om(r,s,x),Wr(r,s,x)):(wt&&p&&Up(s),s.flags|=1,Pn(r,s,u,x),s.child)}function Z0(r,s,u,p,x,w){return zs(s),s.updateQueue=null,u=t0(s,p,u,x),e0(r),p=lm(),r!==null&&!kn?(om(r,s,w),Wr(r,s,w)):(wt&&p&&Up(s),s.flags|=1,Pn(r,s,u,w),s.child)}function J0(r,s,u,p,x){if(zs(s),s.stateNode===null){var w=Ll,A=u.contextType;typeof A=="object"&&A!==null&&(w=zn(A)),w=new u(p,w),s.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=Em,s.stateNode=w,w._reactInternals=s,w=s.stateNode,w.props=p,w.state=s.memoizedState,w.refs={},Zp(s),A=u.contextType,w.context=typeof A=="object"&&A!==null?zn(A):Ll,w.state=s.memoizedState,A=u.getDerivedStateFromProps,typeof A=="function"&&(km(s,u,A,p),w.state=s.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(A=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),A!==w.state&&Em.enqueueReplaceState(w,w.state,null),jc(s,p,w,x),_c(),w.state=s.memoizedState),typeof w.componentDidMount=="function"&&(s.flags|=4194308),p=!0}else if(r===null){w=s.stateNode;var $=s.memoizedProps,W=qs(u,$);w.props=W;var se=w.context,me=u.contextType;A=Ll,typeof me=="object"&&me!==null&&(A=zn(me));var we=u.getDerivedStateFromProps;me=typeof we=="function"||typeof w.getSnapshotBeforeUpdate=="function",$=s.pendingProps!==$,me||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||($||se!==A)&&B0(s,w,p,A),Ia=!1;var oe=s.memoizedState;w.state=oe,jc(s,p,w,x),_c(),se=s.memoizedState,$||oe!==se||Ia?(typeof we=="function"&&(km(s,u,we,p),se=s.memoizedState),(W=Ia||P0(s,u,W,p,oe,se,A))?(me||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(s.flags|=4194308)):(typeof w.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=p,s.memoizedState=se),w.props=p,w.state=se,w.context=A,p=W):(typeof w.componentDidMount=="function"&&(s.flags|=4194308),p=!1)}else{w=s.stateNode,Jp(r,s),A=s.memoizedProps,me=qs(u,A),w.props=me,we=s.pendingProps,oe=w.context,se=u.contextType,W=Ll,typeof se=="object"&&se!==null&&(W=zn(se)),$=u.getDerivedStateFromProps,(se=typeof $=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(A!==we||oe!==W)&&B0(s,w,p,W),Ia=!1,oe=s.memoizedState,w.state=oe,jc(s,p,w,x),_c();var fe=s.memoizedState;A!==we||oe!==fe||Ia||r!==null&&r.dependencies!==null&&kd(r.dependencies)?(typeof $=="function"&&(km(s,u,$,p),fe=s.memoizedState),(me=Ia||P0(s,u,me,p,oe,fe,W)||r!==null&&r.dependencies!==null&&kd(r.dependencies))?(se||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(p,fe,W),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(p,fe,W)),typeof w.componentDidUpdate=="function"&&(s.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof w.componentDidUpdate!="function"||A===r.memoizedProps&&oe===r.memoizedState||(s.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||A===r.memoizedProps&&oe===r.memoizedState||(s.flags|=1024),s.memoizedProps=p,s.memoizedState=fe),w.props=p,w.state=fe,w.context=W,p=me):(typeof w.componentDidUpdate!="function"||A===r.memoizedProps&&oe===r.memoizedState||(s.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||A===r.memoizedProps&&oe===r.memoizedState||(s.flags|=1024),p=!1)}return w=p,Ud(r,s),p=(s.flags&128)!==0,w||p?(w=s.stateNode,u=p&&typeof u.getDerivedStateFromError!="function"?null:w.render(),s.flags|=1,r!==null&&p?(s.child=Us(s,r.child,null,x),s.child=Us(s,null,u,x)):Pn(r,s,u,x),s.memoizedState=w.state,r=s.child):r=Wr(r,s,x),r}function ew(r,s,u,p){return Ls(),s.flags|=256,Pn(r,s,u,p),s.child}var jm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cm(r){return{baseLanes:r,cachePool:qv()}}function Am(r,s,u){return r=r!==null?r.childLanes&~u:0,s&&(r|=wi),r}function tw(r,s,u){var p=s.pendingProps,x=!1,w=(s.flags&128)!==0,A;if((A=w)||(A=r!==null&&r.memoizedState===null?!1:(gn.current&2)!==0),A&&(x=!0,s.flags&=-129),A=(s.flags&32)!==0,s.flags&=-33,r===null){if(wt){if(x?Ba(s):$a(),(r=Wt)?(r=c1(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=Rv(r),u.return=s,s.child=u,In=s,Wt=null)):r=null,r===null)throw Ra(s);return dg(r)?s.lanes=32:s.lanes=536870912,null}var $=p.children;return p=p.fallback,x?($a(),x=s.mode,$=Fd({mode:"hidden",children:$},x),p=Rs(p,x,u,null),$.return=s,p.return=s,$.sibling=p,s.child=$,p=s.child,p.memoizedState=Cm(u),p.childLanes=Am(r,A,u),s.memoizedState=jm,Dc(null,p)):(Ba(s),Tm(s,$))}var W=r.memoizedState;if(W!==null&&($=W.dehydrated,$!==null)){if(w)s.flags&256?(Ba(s),s.flags&=-257,s=Mm(r,s,u)):s.memoizedState!==null?($a(),s.child=r.child,s.flags|=128,s=null):($a(),$=p.fallback,x=s.mode,p=Fd({mode:"visible",children:p.children},x),$=Rs($,x,u,null),$.flags|=2,p.return=s,$.return=s,p.sibling=$,s.child=p,Us(s,r.child,null,u),p=s.child,p.memoizedState=Cm(u),p.childLanes=Am(r,A,u),s.memoizedState=jm,s=Dc(null,p));else if(Ba(s),dg($)){if(A=$.nextSibling&&$.nextSibling.dataset,A)var se=A.dgst;A=se,p=Error(i(419)),p.stack="",p.digest=A,vc({value:p,source:null,stack:null}),s=Mm(r,s,u)}else if(kn||Bl(r,s,u,!1),A=(u&r.childLanes)!==0,kn||A){if(A=Ht,A!==null&&(p=rn(A,u),p!==0&&p!==W.retryLane))throw W.retryLane=p,Os(r,p),oi(A,r,p),Nm;ug($)||Xd(),s=Mm(r,s,u)}else ug($)?(s.flags|=192,s.child=r.child,s=null):(r=W.treeContext,Wt=Bi($.nextSibling),In=s,wt=!0,Oa=null,zi=!1,r!==null&&zv(s,r),s=Tm(s,p.children),s.flags|=4096);return s}return x?($a(),$=p.fallback,x=s.mode,W=r.child,se=W.sibling,p=Hr(W,{mode:"hidden",children:p.children}),p.subtreeFlags=W.subtreeFlags&65011712,se!==null?$=Hr(se,$):($=Rs($,x,u,null),$.flags|=2),$.return=s,p.return=s,p.sibling=$,s.child=p,Dc(null,p),p=s.child,$=r.child.memoizedState,$===null?$=Cm(u):(x=$.cachePool,x!==null?(W=vn._currentValue,x=x.parent!==W?{parent:W,pool:W}:x):x=qv(),$={baseLanes:$.baseLanes|u,cachePool:x}),p.memoizedState=$,p.childLanes=Am(r,A,u),s.memoizedState=jm,Dc(r.child,p)):(Ba(s),u=r.child,r=u.sibling,u=Hr(u,{mode:"visible",children:p.children}),u.return=s,u.sibling=null,r!==null&&(A=s.deletions,A===null?(s.deletions=[r],s.flags|=16):A.push(r)),s.child=u,s.memoizedState=null,u)}function Tm(r,s){return s=Fd({mode:"visible",children:s},r.mode),s.return=r,r.child=s}function Fd(r,s){return r=yi(22,r,null,s),r.lanes=0,r}function Mm(r,s,u){return Us(s,r.child,null,u),r=Tm(s,s.pendingProps.children),r.flags|=2,s.memoizedState=null,r}function nw(r,s,u){r.lanes|=s;var p=r.alternate;p!==null&&(p.lanes|=s),Gp(r.return,s,u)}function Dm(r,s,u,p,x,w){var A=r.memoizedState;A===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:p,tail:u,tailMode:x,treeForkCount:w}:(A.isBackwards=s,A.rendering=null,A.renderingStartTime=0,A.last=p,A.tail=u,A.tailMode=x,A.treeForkCount=w)}function iw(r,s,u){var p=s.pendingProps,x=p.revealOrder,w=p.tail;p=p.children;var A=gn.current,$=(A&2)!==0;if($?(A=A&1|2,s.flags|=128):A&=1,P(gn,A),Pn(r,s,p,u),p=wt?xc:0,!$&&r!==null&&(r.flags&128)!==0)e:for(r=s.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&nw(r,u,s);else if(r.tag===19)nw(r,u,s);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break e;for(;r.sibling===null;){if(r.return===null||r.return===s)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(x){case"forwards":for(u=s.child,x=null;u!==null;)r=u.alternate,r!==null&&Td(r)===null&&(x=u),u=u.sibling;u=x,u===null?(x=s.child,s.child=null):(x=u.sibling,u.sibling=null),Dm(s,!1,x,u,w,p);break;case"backwards":case"unstable_legacy-backwards":for(u=null,x=s.child,s.child=null;x!==null;){if(r=x.alternate,r!==null&&Td(r)===null){s.child=x;break}r=x.sibling,x.sibling=u,u=x,x=r}Dm(s,!0,u,null,w,p);break;case"together":Dm(s,!1,null,null,void 0,p);break;default:s.memoizedState=null}return s.child}function Wr(r,s,u){if(r!==null&&(s.dependencies=r.dependencies),qa|=s.lanes,(u&s.childLanes)===0)if(r!==null){if(Bl(r,s,u,!1),(u&s.childLanes)===0)return null}else return null;if(r!==null&&s.child!==r.child)throw Error(i(153));if(s.child!==null){for(r=s.child,u=Hr(r,r.pendingProps),s.child=u,u.return=s;r.sibling!==null;)r=r.sibling,u=u.sibling=Hr(r,r.pendingProps),u.return=s;u.sibling=null}return s.child}function Om(r,s){return(r.lanes&s)!==0?!0:(r=r.dependencies,!!(r!==null&&kd(r)))}function XT(r,s,u){switch(s.tag){case 3:J(s,s.stateNode.containerInfo),La(s,vn,r.memoizedState.cache),Ls();break;case 27:case 5:Te(s);break;case 4:J(s,s.stateNode.containerInfo);break;case 10:La(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,rm(s),null;break;case 13:var p=s.memoizedState;if(p!==null)return p.dehydrated!==null?(Ba(s),s.flags|=128,null):(u&s.child.childLanes)!==0?tw(r,s,u):(Ba(s),r=Wr(r,s,u),r!==null?r.sibling:null);Ba(s);break;case 19:var x=(r.flags&128)!==0;if(p=(u&s.childLanes)!==0,p||(Bl(r,s,u,!1),p=(u&s.childLanes)!==0),x){if(p)return iw(r,s,u);s.flags|=128}if(x=s.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),P(gn,gn.current),p)break;return null;case 22:return s.lanes=0,Q0(r,s,u,s.pendingProps);case 24:La(s,vn,r.memoizedState.cache)}return Wr(r,s,u)}function rw(r,s,u){if(r!==null)if(r.memoizedProps!==s.pendingProps)kn=!0;else{if(!Om(r,u)&&(s.flags&128)===0)return kn=!1,XT(r,s,u);kn=(r.flags&131072)!==0}else kn=!1,wt&&(s.flags&1048576)!==0&&Iv(s,xc,s.index);switch(s.lanes=0,s.tag){case 16:e:{var p=s.pendingProps;if(r=Bs(s.elementType),s.type=r,typeof r=="function")Pp(r)?(p=qs(r,p),s.tag=1,s=J0(null,s,r,p,u)):(s.tag=0,s=_m(null,s,r,p,u));else{if(r!=null){var x=r.$$typeof;if(x===_){s.tag=11,s=G0(null,s,r,p,u);break e}else if(x===R){s.tag=14,s=V0(null,s,r,p,u);break e}}throw s=D(r)||r,Error(i(306,s,""))}}return s;case 0:return _m(r,s,s.type,s.pendingProps,u);case 1:return p=s.type,x=qs(p,s.pendingProps),J0(r,s,p,x,u);case 3:e:{if(J(s,s.stateNode.containerInfo),r===null)throw Error(i(387));p=s.pendingProps;var w=s.memoizedState;x=w.element,Jp(r,s),jc(s,p,null,u);var A=s.memoizedState;if(p=A.cache,La(s,vn,p),p!==w.cache&&Vp(s,[vn],u,!0),_c(),p=A.element,w.isDehydrated)if(w={element:p,isDehydrated:!1,cache:A.cache},s.updateQueue.baseState=w,s.memoizedState=w,s.flags&256){s=ew(r,s,p,u);break e}else if(p!==x){x=Ri(Error(i(424)),s),vc(x),s=ew(r,s,p,u);break e}else{switch(r=s.stateNode.containerInfo,r.nodeType){case 9:r=r.body;break;default:r=r.nodeName==="HTML"?r.ownerDocument.body:r}for(Wt=Bi(r.firstChild),In=s,wt=!0,Oa=null,zi=!0,u=Qv(s,null,p,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Ls(),p===x){s=Wr(r,s,u);break e}Pn(r,s,p,u)}s=s.child}return s;case 26:return Ud(r,s),r===null?(u=m1(s.type,null,s.pendingProps,null))?s.memoizedState=u:wt||(u=s.type,r=s.pendingProps,p=af(ke.current).createElement(u),p[an]=s,p[Tn]=r,Bn(p,u,r),fn(p),s.stateNode=p):s.memoizedState=m1(s.type,r.memoizedProps,s.pendingProps,r.memoizedState),null;case 27:return Te(s),r===null&&wt&&(p=s.stateNode=f1(s.type,s.pendingProps,ke.current),In=s,zi=!0,x=Wt,Ya(s.type)?(fg=x,Wt=Bi(p.firstChild)):Wt=x),Pn(r,s,s.pendingProps.children,u),Ud(r,s),r===null&&(s.flags|=4194304),s.child;case 5:return r===null&&wt&&((x=p=Wt)&&(p=jM(p,s.type,s.pendingProps,zi),p!==null?(s.stateNode=p,In=s,Wt=Bi(p.firstChild),zi=!1,x=!0):x=!1),x||Ra(s)),Te(s),x=s.type,w=s.pendingProps,A=r!==null?r.memoizedProps:null,p=w.children,lg(x,w)?p=null:A!==null&&lg(x,A)&&(s.flags|=32),s.memoizedState!==null&&(x=sm(r,s,FT,null,null,u),Vc._currentValue=x),Ud(r,s),Pn(r,s,p,u),s.child;case 6:return r===null&&wt&&((r=u=Wt)&&(u=CM(u,s.pendingProps,zi),u!==null?(s.stateNode=u,In=s,Wt=null,r=!0):r=!1),r||Ra(s)),null;case 13:return tw(r,s,u);case 4:return J(s,s.stateNode.containerInfo),p=s.pendingProps,r===null?s.child=Us(s,null,p,u):Pn(r,s,p,u),s.child;case 11:return G0(r,s,s.type,s.pendingProps,u);case 7:return Pn(r,s,s.pendingProps,u),s.child;case 8:return Pn(r,s,s.pendingProps.children,u),s.child;case 12:return Pn(r,s,s.pendingProps.children,u),s.child;case 10:return p=s.pendingProps,La(s,s.type,p.value),Pn(r,s,p.children,u),s.child;case 9:return x=s.type._context,p=s.pendingProps.children,zs(s),x=zn(x),p=p(x),s.flags|=1,Pn(r,s,p,u),s.child;case 14:return V0(r,s,s.type,s.pendingProps,u);case 15:return Y0(r,s,s.type,s.pendingProps,u);case 19:return iw(r,s,u);case 31:return WT(r,s,u);case 22:return Q0(r,s,u,s.pendingProps);case 24:return zs(s),p=zn(vn),r===null?(x=Wp(),x===null&&(x=Ht,w=Yp(),x.pooledCache=w,w.refCount++,w!==null&&(x.pooledCacheLanes|=u),x=w),s.memoizedState={parent:p,cache:x},Zp(s),La(s,vn,x)):((r.lanes&u)!==0&&(Jp(r,s),jc(s,null,null,u),_c()),x=r.memoizedState,w=s.memoizedState,x.parent!==p?(x={parent:p,cache:p},s.memoizedState=x,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=x),La(s,vn,p)):(p=w.cache,La(s,vn,p),p!==x.cache&&Vp(s,[vn],u,!0))),Pn(r,s,s.pendingProps.children,u),s.child;case 29:throw s.pendingProps}throw Error(i(156,s.tag))}function Xr(r){r.flags|=4}function Rm(r,s,u,p,x){if((s=(r.mode&32)!==0)&&(s=!1),s){if(r.flags|=16777216,(x&335544128)===x)if(r.stateNode.complete)r.flags|=8192;else if(Mw())r.flags|=8192;else throw $s=_d,Xp}else r.flags&=-16777217}function aw(r,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!v1(s))if(Mw())r.flags|=8192;else throw $s=_d,Xp}function qd(r,s){s!==null&&(r.flags|=4),r.flags&16384&&(s=r.tag!==22?it():536870912,r.lanes|=s,Xl|=s)}function Oc(r,s){if(!wt)switch(r.tailMode){case"hidden":s=r.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?r.tail=null:u.sibling=null;break;case"collapsed":u=r.tail;for(var p=null;u!==null;)u.alternate!==null&&(p=u),u=u.sibling;p===null?s||r.tail===null?r.tail=null:r.tail.sibling=null:p.sibling=null}}function Xt(r){var s=r.alternate!==null&&r.alternate.child===r.child,u=0,p=0;if(s)for(var x=r.child;x!==null;)u|=x.lanes|x.childLanes,p|=x.subtreeFlags&65011712,p|=x.flags&65011712,x.return=r,x=x.sibling;else for(x=r.child;x!==null;)u|=x.lanes|x.childLanes,p|=x.subtreeFlags,p|=x.flags,x.return=r,x=x.sibling;return r.subtreeFlags|=p,r.childLanes=u,s}function ZT(r,s,u){var p=s.pendingProps;switch(Fp(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xt(s),null;case 1:return Xt(s),null;case 3:return u=s.stateNode,p=null,r!==null&&(p=r.memoizedState.cache),s.memoizedState.cache!==p&&(s.flags|=2048),Vr(vn),ue(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(r===null||r.child===null)&&(Pl(s)?Xr(s):r===null||r.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Hp())),Xt(s),null;case 26:var x=s.type,w=s.memoizedState;return r===null?(Xr(s),w!==null?(Xt(s),aw(s,w)):(Xt(s),Rm(s,x,null,p,u))):w?w!==r.memoizedState?(Xr(s),Xt(s),aw(s,w)):(Xt(s),s.flags&=-16777217):(r=r.memoizedProps,r!==p&&Xr(s),Xt(s),Rm(s,x,r,p,u)),null;case 27:if(Re(s),u=ke.current,x=s.type,r!==null&&s.stateNode!=null)r.memoizedProps!==p&&Xr(s);else{if(!p){if(s.stateNode===null)throw Error(i(166));return Xt(s),null}r=le.current,Pl(s)?Pv(s):(r=f1(x,p,u),s.stateNode=r,Xr(s))}return Xt(s),null;case 5:if(Re(s),x=s.type,r!==null&&s.stateNode!=null)r.memoizedProps!==p&&Xr(s);else{if(!p){if(s.stateNode===null)throw Error(i(166));return Xt(s),null}if(w=le.current,Pl(s))Pv(s);else{var A=af(ke.current);switch(w){case 1:w=A.createElementNS("http://www.w3.org/2000/svg",x);break;case 2:w=A.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;default:switch(x){case"svg":w=A.createElementNS("http://www.w3.org/2000/svg",x);break;case"math":w=A.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;case"script":w=A.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof p.is=="string"?A.createElement("select",{is:p.is}):A.createElement("select"),p.multiple?w.multiple=!0:p.size&&(w.size=p.size);break;default:w=typeof p.is=="string"?A.createElement(x,{is:p.is}):A.createElement(x)}}w[an]=s,w[Tn]=p;e:for(A=s.child;A!==null;){if(A.tag===5||A.tag===6)w.appendChild(A.stateNode);else if(A.tag!==4&&A.tag!==27&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===s)break e;for(;A.sibling===null;){if(A.return===null||A.return===s)break e;A=A.return}A.sibling.return=A.return,A=A.sibling}s.stateNode=w;e:switch(Bn(w,x,p),x){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&Xr(s)}}return Xt(s),Rm(s,s.type,r===null?null:r.memoizedProps,s.pendingProps,u),null;case 6:if(r&&s.stateNode!=null)r.memoizedProps!==p&&Xr(s);else{if(typeof p!="string"&&s.stateNode===null)throw Error(i(166));if(r=ke.current,Pl(s)){if(r=s.stateNode,u=s.memoizedProps,p=null,x=In,x!==null)switch(x.tag){case 27:case 5:p=x.memoizedProps}r[an]=s,r=!!(r.nodeValue===u||p!==null&&p.suppressHydrationWarning===!0||t1(r.nodeValue,u)),r||Ra(s,!0)}else r=af(r).createTextNode(p),r[an]=s,s.stateNode=r}return Xt(s),null;case 31:if(u=s.memoizedState,r===null||r.memoizedState!==null){if(p=Pl(s),u!==null){if(r===null){if(!p)throw Error(i(318));if(r=s.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(557));r[an]=s}else Ls(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Xt(s),r=!1}else u=Hp(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=u),r=!0;if(!r)return s.flags&256?(xi(s),s):(xi(s),null);if((s.flags&128)!==0)throw Error(i(558))}return Xt(s),null;case 13:if(p=s.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(x=Pl(s),p!==null&&p.dehydrated!==null){if(r===null){if(!x)throw Error(i(318));if(x=s.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(i(317));x[an]=s}else Ls(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Xt(s),x=!1}else x=Hp(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=x),x=!0;if(!x)return s.flags&256?(xi(s),s):(xi(s),null)}return xi(s),(s.flags&128)!==0?(s.lanes=u,s):(u=p!==null,r=r!==null&&r.memoizedState!==null,u&&(p=s.child,x=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(x=p.alternate.memoizedState.cachePool.pool),w=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(w=p.memoizedState.cachePool.pool),w!==x&&(p.flags|=2048)),u!==r&&u&&(s.child.flags|=8192),qd(s,s.updateQueue),Xt(s),null);case 4:return ue(),r===null&&ng(s.stateNode.containerInfo),Xt(s),null;case 10:return Vr(s.type),Xt(s),null;case 19:if(V(gn),p=s.memoizedState,p===null)return Xt(s),null;if(x=(s.flags&128)!==0,w=p.rendering,w===null)if(x)Oc(p,!1);else{if(pn!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(w=Td(r),w!==null){for(s.flags|=128,Oc(p,!1),r=w.updateQueue,s.updateQueue=r,qd(s,r),s.subtreeFlags=0,r=u,u=s.child;u!==null;)Ov(u,r),u=u.sibling;return P(gn,gn.current&1|2),wt&&Kr(s,p.treeForkCount),s.child}r=r.sibling}p.tail!==null&&Ne()>Yd&&(s.flags|=128,x=!0,Oc(p,!1),s.lanes=4194304)}else{if(!x)if(r=Td(w),r!==null){if(s.flags|=128,x=!0,r=r.updateQueue,s.updateQueue=r,qd(s,r),Oc(p,!0),p.tail===null&&p.tailMode==="hidden"&&!w.alternate&&!wt)return Xt(s),null}else 2*Ne()-p.renderingStartTime>Yd&&u!==536870912&&(s.flags|=128,x=!0,Oc(p,!1),s.lanes=4194304);p.isBackwards?(w.sibling=s.child,s.child=w):(r=p.last,r!==null?r.sibling=w:s.child=w,p.last=w)}return p.tail!==null?(r=p.tail,p.rendering=r,p.tail=r.sibling,p.renderingStartTime=Ne(),r.sibling=null,u=gn.current,P(gn,x?u&1|2:u&1),wt&&Kr(s,p.treeForkCount),r):(Xt(s),null);case 22:case 23:return xi(s),im(),p=s.memoizedState!==null,r!==null?r.memoizedState!==null!==p&&(s.flags|=8192):p&&(s.flags|=8192),p?(u&536870912)!==0&&(s.flags&128)===0&&(Xt(s),s.subtreeFlags&6&&(s.flags|=8192)):Xt(s),u=s.updateQueue,u!==null&&qd(s,u.retryQueue),u=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),p=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),p!==u&&(s.flags|=2048),r!==null&&V(Ps),null;case 24:return u=null,r!==null&&(u=r.memoizedState.cache),s.memoizedState.cache!==u&&(s.flags|=2048),Vr(vn),Xt(s),null;case 25:return null;case 30:return null}throw Error(i(156,s.tag))}function JT(r,s){switch(Fp(s),s.tag){case 1:return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return Vr(vn),ue(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 26:case 27:case 5:return Re(s),null;case 31:if(s.memoizedState!==null){if(xi(s),s.alternate===null)throw Error(i(340));Ls()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 13:if(xi(s),r=s.memoizedState,r!==null&&r.dehydrated!==null){if(s.alternate===null)throw Error(i(340));Ls()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 19:return V(gn),null;case 4:return ue(),null;case 10:return Vr(s.type),null;case 22:case 23:return xi(s),im(),r!==null&&V(Ps),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 24:return Vr(vn),null;case 25:return null;default:return null}}function sw(r,s){switch(Fp(s),s.tag){case 3:Vr(vn),ue();break;case 26:case 27:case 5:Re(s);break;case 4:ue();break;case 31:s.memoizedState!==null&&xi(s);break;case 13:xi(s);break;case 19:V(gn);break;case 10:Vr(s.type);break;case 22:case 23:xi(s),im(),r!==null&&V(Ps);break;case 24:Vr(vn)}}function Rc(r,s){try{var u=s.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var x=p.next;u=x;do{if((u.tag&r)===r){p=void 0;var w=u.create,A=u.inst;p=w(),A.destroy=p}u=u.next}while(u!==x)}}catch($){It(s,s.return,$)}}function Ua(r,s,u){try{var p=s.updateQueue,x=p!==null?p.lastEffect:null;if(x!==null){var w=x.next;p=w;do{if((p.tag&r)===r){var A=p.inst,$=A.destroy;if($!==void 0){A.destroy=void 0,x=s;var W=u,se=$;try{se()}catch(me){It(x,W,me)}}}p=p.next}while(p!==w)}}catch(me){It(s,s.return,me)}}function lw(r){var s=r.updateQueue;if(s!==null){var u=r.stateNode;try{Xv(s,u)}catch(p){It(r,r.return,p)}}}function ow(r,s,u){u.props=qs(r.type,r.memoizedProps),u.state=r.memoizedState;try{u.componentWillUnmount()}catch(p){It(r,s,p)}}function Lc(r,s){try{var u=r.ref;if(u!==null){switch(r.tag){case 26:case 27:case 5:var p=r.stateNode;break;case 30:p=r.stateNode;break;default:p=r.stateNode}typeof u=="function"?r.refCleanup=u(p):u.current=p}}catch(x){It(r,s,x)}}function Er(r,s){var u=r.ref,p=r.refCleanup;if(u!==null)if(typeof p=="function")try{p()}catch(x){It(r,s,x)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(x){It(r,s,x)}else u.current=null}function cw(r){var s=r.type,u=r.memoizedProps,p=r.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":u.autoFocus&&p.focus();break e;case"img":u.src?p.src=u.src:u.srcSet&&(p.srcset=u.srcSet)}}catch(x){It(r,r.return,x)}}function Lm(r,s,u){try{var p=r.stateNode;wM(p,r.type,u,s),p[Tn]=s}catch(x){It(r,r.return,x)}}function uw(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Ya(r.type)||r.tag===4}function Im(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||uw(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Ya(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function zm(r,s,u){var p=r.tag;if(p===5||p===6)r=r.stateNode,s?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(r,s):(s=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,s.appendChild(r),u=u._reactRootContainer,u!=null||s.onclick!==null||(s.onclick=Ae));else if(p!==4&&(p===27&&Ya(r.type)&&(u=r.stateNode,s=null),r=r.child,r!==null))for(zm(r,s,u),r=r.sibling;r!==null;)zm(r,s,u),r=r.sibling}function Hd(r,s,u){var p=r.tag;if(p===5||p===6)r=r.stateNode,s?u.insertBefore(r,s):u.appendChild(r);else if(p!==4&&(p===27&&Ya(r.type)&&(u=r.stateNode),r=r.child,r!==null))for(Hd(r,s,u),r=r.sibling;r!==null;)Hd(r,s,u),r=r.sibling}function dw(r){var s=r.stateNode,u=r.memoizedProps;try{for(var p=r.type,x=s.attributes;x.length;)s.removeAttributeNode(x[0]);Bn(s,p,u),s[an]=r,s[Tn]=u}catch(w){It(r,r.return,w)}}var Zr=!1,En=!1,Pm=!1,fw=typeof WeakSet=="function"?WeakSet:Set,Dn=null;function eM(r,s){if(r=r.containerInfo,ag=ff,r=Sv(r),Mp(r)){if("selectionStart"in r)var u={start:r.selectionStart,end:r.selectionEnd};else e:{u=(u=r.ownerDocument)&&u.defaultView||window;var p=u.getSelection&&u.getSelection();if(p&&p.rangeCount!==0){u=p.anchorNode;var x=p.anchorOffset,w=p.focusNode;p=p.focusOffset;try{u.nodeType,w.nodeType}catch{u=null;break e}var A=0,$=-1,W=-1,se=0,me=0,we=r,oe=null;t:for(;;){for(var fe;we!==u||x!==0&&we.nodeType!==3||($=A+x),we!==w||p!==0&&we.nodeType!==3||(W=A+p),we.nodeType===3&&(A+=we.nodeValue.length),(fe=we.firstChild)!==null;)oe=we,we=fe;for(;;){if(we===r)break t;if(oe===u&&++se===x&&($=A),oe===w&&++me===p&&(W=A),(fe=we.nextSibling)!==null)break;we=oe,oe=we.parentNode}we=fe}u=$===-1||W===-1?null:{start:$,end:W}}else u=null}u=u||{start:0,end:0}}else u=null;for(sg={focusedElem:r,selectionRange:u},ff=!1,Dn=s;Dn!==null;)if(s=Dn,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,Dn=r;else for(;Dn!==null;){switch(s=Dn,w=s.alternate,r=s.flags,s.tag){case 0:if((r&4)!==0&&(r=s.updateQueue,r=r!==null?r.events:null,r!==null))for(u=0;u<r.length;u++)x=r[u],x.ref.impl=x.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&w!==null){r=void 0,u=s,x=w.memoizedProps,w=w.memoizedState,p=u.stateNode;try{var $e=qs(u.type,x);r=p.getSnapshotBeforeUpdate($e,w),p.__reactInternalSnapshotBeforeUpdate=r}catch(tt){It(u,u.return,tt)}}break;case 3:if((r&1024)!==0){if(r=s.stateNode.containerInfo,u=r.nodeType,u===9)cg(r);else if(u===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":cg(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(i(163))}if(r=s.sibling,r!==null){r.return=s.return,Dn=r;break}Dn=s.return}}function hw(r,s,u){var p=u.flags;switch(u.tag){case 0:case 11:case 15:ea(r,u),p&4&&Rc(5,u);break;case 1:if(ea(r,u),p&4)if(r=u.stateNode,s===null)try{r.componentDidMount()}catch(A){It(u,u.return,A)}else{var x=qs(u.type,s.memoizedProps);s=s.memoizedState;try{r.componentDidUpdate(x,s,r.__reactInternalSnapshotBeforeUpdate)}catch(A){It(u,u.return,A)}}p&64&&lw(u),p&512&&Lc(u,u.return);break;case 3:if(ea(r,u),p&64&&(r=u.updateQueue,r!==null)){if(s=null,u.child!==null)switch(u.child.tag){case 27:case 5:s=u.child.stateNode;break;case 1:s=u.child.stateNode}try{Xv(r,s)}catch(A){It(u,u.return,A)}}break;case 27:s===null&&p&4&&dw(u);case 26:case 5:ea(r,u),s===null&&p&4&&cw(u),p&512&&Lc(u,u.return);break;case 12:ea(r,u);break;case 31:ea(r,u),p&4&&gw(r,u);break;case 13:ea(r,u),p&4&&yw(r,u),p&64&&(r=u.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(u=cM.bind(null,u),AM(r,u))));break;case 22:if(p=u.memoizedState!==null||Zr,!p){s=s!==null&&s.memoizedState!==null||En,x=Zr;var w=En;Zr=p,(En=s)&&!w?ta(r,u,(u.subtreeFlags&8772)!==0):ea(r,u),Zr=x,En=w}break;case 30:break;default:ea(r,u)}}function pw(r){var s=r.alternate;s!==null&&(r.alternate=null,pw(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;)mw(r,s,u),u=u.sibling}function mw(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 p=Zt,x=ri;Ya(u.type)&&(Zt=u.stateNode,ri=!1),Jr(r,s,u),Hc(u.stateNode),Zt=p,ri=x;break;case 5:En||Er(u,s);case 6:if(p=Zt,x=ri,Zt=null,Jr(r,s,u),Zt=p,ri=x,Zt!==null)if(ri)try{(Zt.nodeType===9?Zt.body:Zt.nodeName==="HTML"?Zt.ownerDocument.body:Zt).removeChild(u.stateNode)}catch(w){It(u,s,w)}else try{Zt.removeChild(u.stateNode)}catch(w){It(u,s,w)}break;case 18:Zt!==null&&(ri?(r=Zt,l1(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,u.stateNode),ao(r)):l1(Zt,u.stateNode));break;case 4:p=Zt,x=ri,Zt=u.stateNode.containerInfo,ri=!0,Jr(r,s,u),Zt=p,ri=x;break;case 0:case 11:case 14:case 15:Ua(2,u,s),En||Ua(4,u,s),Jr(r,s,u);break;case 1:En||(Er(u,s),p=u.stateNode,typeof p.componentWillUnmount=="function"&&ow(u,s,p)),Jr(r,s,u);break;case 21:Jr(r,s,u);break;case 22:En=(p=En)||u.memoizedState!==null,Jr(r,s,u),En=p;break;default:Jr(r,s,u)}}function gw(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 yw(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 tM(r){switch(r.tag){case 31:case 13:case 19:var s=r.stateNode;return s===null&&(s=r.stateNode=new fw),s;case 22:return r=r.stateNode,s=r._retryCache,s===null&&(s=r._retryCache=new fw),s;default:throw Error(i(435,r.tag))}}function Kd(r,s){var u=tM(r);s.forEach(function(p){if(!u.has(p)){u.add(p);var x=uM.bind(null,r,p);p.then(x,x)}})}function ai(r,s){var u=s.deletions;if(u!==null)for(var p=0;p<u.length;p++){var x=u[p],w=r,A=s,$=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));mw(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;)bw(s,r),s=s.sibling}var ir=null;function bw(r,s){var u=r.alternate,p=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:ai(s,r),si(r),p&4&&(Ua(3,r,r.return),Rc(3,r),Ua(5,r,r.return));break;case 1:ai(s,r),si(r),p&512&&(En||u===null||Er(u,u.return)),p&64&&Zr&&(r=r.updateQueue,r!==null&&(p=r.callbacks,p!==null&&(u=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=u===null?p:u.concat(p))));break;case 26:var x=ir;if(ai(s,r),si(r),p&512&&(En||u===null||Er(u,u.return)),p&4){var w=u!==null?u.memoizedState:null;if(p=r.memoizedState,u===null)if(p===null)if(r.stateNode===null){e:{p=r.type,u=r.memoizedProps,x=x.ownerDocument||x;t:switch(p){case"title":w=x.getElementsByTagName("title")[0],(!w||w[$r]||w[an]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=x.createElement(p),x.head.insertBefore(w,x.querySelector("head > title"))),Bn(w,p,u),w[an]=r,fn(w),p=w;break e;case"link":var A=b1("link","href",x).get(p+(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(p),Bn(w,p,u),x.head.appendChild(w);break;case"meta":if(A=b1("meta","content",x).get(p+(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(p),Bn(w,p,u),x.head.appendChild(w);break;default:throw Error(i(468,p))}w[an]=r,fn(w),p=w}r.stateNode=p}else x1(x,r.type,r.stateNode);else r.stateNode=y1(x,p,r.memoizedProps);else w!==p?(w===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):w.count--,p===null?x1(x,r.type,r.stateNode):y1(x,p,r.memoizedProps)):p===null&&r.stateNode!==null&&Lm(r,r.memoizedProps,u.memoizedProps)}break;case 27:ai(s,r),si(r),p&512&&(En||u===null||Er(u,u.return)),u!==null&&p&4&&Lm(r,r.memoizedProps,u.memoizedProps);break;case 5:if(ai(s,r),si(r),p&512&&(En||u===null||Er(u,u.return)),r.flags&32){x=r.stateNode;try{nt(x,"")}catch($e){It(r,r.return,$e)}}p&4&&r.stateNode!=null&&(x=r.memoizedProps,Lm(r,x,u!==null?u.memoizedProps:x)),p&1024&&(Pm=!0);break;case 6:if(ai(s,r),si(r),p&4){if(r.stateNode===null)throw Error(i(162));p=r.memoizedProps,u=r.stateNode;try{u.nodeValue=p}catch($e){It(r,r.return,$e)}}break;case 3:if(of=null,x=ir,ir=sf(s.containerInfo),ai(s,r),ir=x,si(r),p&4&&u!==null&&u.memoizedState.isDehydrated)try{ao(s.containerInfo)}catch($e){It(r,r.return,$e)}Pm&&(Pm=!1,xw(r));break;case 4:p=ir,ir=sf(r.stateNode.containerInfo),ai(s,r),si(r),ir=p;break;case 12:ai(s,r),si(r);break;case 31:ai(s,r),si(r),p&4&&(p=r.updateQueue,p!==null&&(r.updateQueue=null,Kd(r,p)));break;case 13:ai(s,r),si(r),r.child.flags&8192&&r.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Vd=Ne()),p&4&&(p=r.updateQueue,p!==null&&(r.updateQueue=null,Kd(r,p)));break;case 22:x=r.memoizedState!==null;var W=u!==null&&u.memoizedState!==null,se=Zr,me=En;if(Zr=se||x,En=me||W,ai(s,r),En=me,Zr=se,si(r),p&8192)e:for(s=r.stateNode,s._visibility=x?s._visibility&-2:s._visibility|1,x&&(u===null||W||Zr||En||Hs(r)),u=null,s=r;;){if(s.tag===5||s.tag===26){if(u===null){W=u=s;try{if(w=W.stateNode,x)A=w.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{$=W.stateNode;var we=W.memoizedProps.style,oe=we!=null&&we.hasOwnProperty("display")?we.display:null;$.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch($e){It(W,W.return,$e)}}}else if(s.tag===6){if(u===null){W=s;try{W.stateNode.nodeValue=x?"":W.memoizedProps}catch($e){It(W,W.return,$e)}}}else if(s.tag===18){if(u===null){W=s;try{var fe=W.stateNode;x?o1(fe,!0):o1(W.stateNode,!1)}catch($e){It(W,W.return,$e)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===r)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break e;for(;s.sibling===null;){if(s.return===null||s.return===r)break e;u===s&&(u=null),s=s.return}u===s&&(u=null),s.sibling.return=s.return,s=s.sibling}p&4&&(p=r.updateQueue,p!==null&&(u=p.retryQueue,u!==null&&(p.retryQueue=null,Kd(r,u))));break;case 19:ai(s,r),si(r),p&4&&(p=r.updateQueue,p!==null&&(r.updateQueue=null,Kd(r,p)));break;case 30:break;case 21:break;default:ai(s,r),si(r)}}function si(r){var s=r.flags;if(s&2){try{for(var u,p=r.return;p!==null;){if(uw(p)){u=p;break}p=p.return}if(u==null)throw Error(i(160));switch(u.tag){case 27:var x=u.stateNode,w=Im(r);Hd(r,w,x);break;case 5:var A=u.stateNode;u.flags&32&&(nt(A,""),u.flags&=-33);var $=Im(r);Hd(r,$,A);break;case 3:case 4:var W=u.stateNode.containerInfo,se=Im(r);zm(r,se,W);break;default:throw Error(i(161))}}catch(me){It(r,r.return,me)}r.flags&=-3}s&4096&&(r.flags&=-4097)}function xw(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var s=r;xw(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;)hw(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"&&ow(s,s.return,u),Hs(s);break;case 27:Hc(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 p=s.alternate,x=r,w=s,A=w.flags;switch(w.tag){case 0:case 11:case 15:ta(x,w,u),Rc(4,w);break;case 1:if(ta(x,w,u),p=w,x=p.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(se){It(p,p.return,se)}if(p=w,x=p.updateQueue,x!==null){var $=p.stateNode;try{var W=x.shared.hiddenCallbacks;if(W!==null)for(x.shared.hiddenCallbacks=null,x=0;x<W.length;x++)Wv(W[x],$)}catch(se){It(p,p.return,se)}}u&&A&64&&lw(w),Lc(w,w.return);break;case 27:dw(w);case 26:case 5:ta(x,w,u),u&&p===null&&A&4&&cw(w),Lc(w,w.return);break;case 12:ta(x,w,u);break;case 31:ta(x,w,u),u&&A&4&&gw(x,w);break;case 13:ta(x,w,u),u&&A&4&&yw(x,w);break;case 22:w.memoizedState===null&&ta(x,w,u),Lc(w,w.return);break;case 30:break;default:ta(x,w,u)}s=s.sibling}}function Bm(r,s){var u=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),r=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(r=s.memoizedState.cachePool.pool),r!==u&&(r!=null&&r.refCount++,u!=null&&wc(u))}function $m(r,s){r=null,s.alternate!==null&&(r=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==r&&(s.refCount++,r!=null&&wc(r))}function rr(r,s,u,p){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)vw(r,s,u,p),s=s.sibling}function vw(r,s,u,p){var x=s.flags;switch(s.tag){case 0:case 11:case 15:rr(r,s,u,p),x&2048&&Rc(9,s);break;case 1:rr(r,s,u,p);break;case 3:rr(r,s,u,p),x&2048&&(r=null,s.alternate!==null&&(r=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==r&&(s.refCount++,r!=null&&wc(r)));break;case 12:if(x&2048){rr(r,s,u,p),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(W){It(s,s.return,W)}}else rr(r,s,u,p);break;case 31:rr(r,s,u,p);break;case 13:rr(r,s,u,p);break;case 23:break;case 22:w=s.stateNode,A=s.alternate,s.memoizedState!==null?w._visibility&2?rr(r,s,u,p):Ic(r,s):w._visibility&2?rr(r,s,u,p):(w._visibility|=2,Yl(r,s,u,p,(s.subtreeFlags&10256)!==0||!1)),x&2048&&Bm(A,s);break;case 24:rr(r,s,u,p),x&2048&&$m(s.alternate,s);break;default:rr(r,s,u,p)}}function Yl(r,s,u,p,x){for(x=x&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var w=r,A=s,$=u,W=p,se=A.flags;switch(A.tag){case 0:case 11:case 15:Yl(w,A,$,W,x),Rc(8,A);break;case 23:break;case 22:var me=A.stateNode;A.memoizedState!==null?me._visibility&2?Yl(w,A,$,W,x):Ic(w,A):(me._visibility|=2,Yl(w,A,$,W,x)),x&&se&2048&&Bm(A.alternate,A);break;case 24:Yl(w,A,$,W,x),x&&se&2048&&$m(A.alternate,A);break;default:Yl(w,A,$,W,x)}s=s.sibling}}function Ic(r,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var u=r,p=s,x=p.flags;switch(p.tag){case 22:Ic(u,p),x&2048&&Bm(p.alternate,p);break;case 24:Ic(u,p),x&2048&&$m(p.alternate,p);break;default:Ic(u,p)}s=s.sibling}}var zc=8192;function Ql(r,s,u){if(r.subtreeFlags&zc)for(r=r.child;r!==null;)ww(r,s,u),r=r.sibling}function ww(r,s,u){switch(r.tag){case 26:Ql(r,s,u),r.flags&zc&&r.memoizedState!==null&&UM(u,ir,r.memoizedState,r.memoizedProps);break;case 5:Ql(r,s,u);break;case 3:case 4:var p=ir;ir=sf(r.stateNode.containerInfo),Ql(r,s,u),ir=p;break;case 22:r.memoizedState===null&&(p=r.alternate,p!==null&&p.memoizedState!==null?(p=zc,zc=16777216,Ql(r,s,u),zc=p):Ql(r,s,u));break;default:Ql(r,s,u)}}function kw(r){var s=r.alternate;if(s!==null&&(r=s.child,r!==null)){s.child=null;do s=r.sibling,r.sibling=null,r=s;while(r!==null)}}function Pc(r){var s=r.deletions;if((r.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var p=s[u];Dn=p,Sw(p,r)}kw(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Ew(r),r=r.sibling}function Ew(r){switch(r.tag){case 0:case 11:case 15:Pc(r),r.flags&2048&&Ua(9,r,r.return);break;case 3:Pc(r);break;case 12:Pc(r);break;case 22:var s=r.stateNode;r.memoizedState!==null&&s._visibility&2&&(r.return===null||r.return.tag!==13)?(s._visibility&=-3,Gd(r)):Pc(r);break;default:Pc(r)}}function Gd(r){var s=r.deletions;if((r.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var p=s[u];Dn=p,Sw(p,r)}kw(r)}for(r=r.child;r!==null;){switch(s=r,s.tag){case 0:case 11:case 15:Ua(8,s,s.return),Gd(s);break;case 22:u=s.stateNode,u._visibility&2&&(u._visibility&=-3,Gd(s));break;default:Gd(s)}r=r.sibling}}function Sw(r,s){for(;Dn!==null;){var u=Dn;switch(u.tag){case 0:case 11:case 15:Ua(8,u,s);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var p=u.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:wc(u.memoizedState.cache)}if(p=u.child,p!==null)p.return=u,Dn=p;else e:for(u=r;Dn!==null;){p=Dn;var x=p.sibling,w=p.return;if(pw(p),p===u){Dn=null;break e}if(x!==null){x.return=w,Dn=x;break e}Dn=w}}}var nM={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}},iM=typeof WeakMap=="function"?WeakMap:Map,Tt=0,Ht=null,pt=null,xt=0,Lt=0,vi=null,Fa=!1,Wl=!1,Um=!1,na=0,pn=0,qa=0,Ks=0,Fm=0,wi=0,Xl=0,Bc=null,li=null,qm=!1,Vd=0,Nw=0,Yd=1/0,Qd=null,Ha=null,jn=0,Ka=null,Zl=null,ia=0,Hm=0,Km=null,_w=null,$c=0,Gm=null;function ki(){return(Tt&2)!==0&&xt!==0?xt&-xt:I.T!==null?Zm():ka()}function jw(){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),pn===4&&Ga(r,xt,wi,!1)),Sr(r))}function Cw(r,s,u){if((Tt&6)!==0)throw Error(i(327));var p=!u&&(s&127)===0&&(s&r.expiredLanes)===0||ge(r,s),x=p?sM(r,s):Ym(r,s,!0),w=p;do{if(x===0){Wl&&!p&&Ga(r,s,0,!1);break}else{if(u=r.current.alternate,w&&!rM(u)){x=Ym(r,s,!1),w=!1;continue}if(x===2){if(w=s,r.errorRecoveryDisabledLanes&w)var A=0;else A=r.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){s=A;e:{var $=r;x=Bc;var W=$.current.memoizedState.isDehydrated;if(W&&(Jl($,A).flags|=256),A=Ym($,A,!1),A!==2){if(Um&&!W){$.errorRecoveryDisabledLanes|=w,Ks|=w,x=4;break e}w=li,li=x,w!==null&&(li===null?li=w:li.push.apply(li,w))}x=A}if(w=!1,x!==2)continue}}if(x===1){Jl(r,0),Ga(r,s,0,!0);break}e:{switch(p=r,w=x,w){case 0:case 1:throw Error(i(345));case 4:if((s&4194048)!==s)break;case 6:Ga(p,s,wi,!Fa);break e;case 2:li=null;break;case 3:case 5:break;default:throw Error(i(329))}if((s&62914560)===s&&(x=Vd+300-Ne(),10<x)){if(Ga(p,s,wi,!Fa),Z(p,0,!0)!==0)break e;ia=s,p.timeoutHandle=a1(Aw.bind(null,p,u,li,Qd,qm,s,wi,Ks,Xl,Fa,w,"Throttled",-0,0),x);break e}Aw(p,u,li,Qd,qm,s,wi,Ks,Xl,Fa,w,null,-0,0)}}break}while(!0);Sr(r)}function Aw(r,s,u,p,x,w,A,$,W,se,me,we,oe,fe){if(r.timeoutHandle=-1,we=s.subtreeFlags,we&8192||(we&16785408)===16785408){we={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ae},ww(s,w,we);var $e=(w&62914560)===w?Vd-Ne():(w&4194048)===w?Nw-Ne():0;if($e=FM(we,$e),$e!==null){ia=w,r.cancelPendingCommit=$e(zw.bind(null,r,s,w,u,p,x,A,$,W,me,we,null,oe,fe)),Ga(r,w,A,!se);return}}zw(r,s,w,u,p,x,A,$,W)}function rM(r){for(var s=r;;){var u=s.tag;if((u===0||u===11||u===15)&&s.flags&16384&&(u=s.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var p=0;p<u.length;p++){var x=u[p],w=x.getSnapshot;x=x.value;try{if(!gi(w(),x))return!1}catch{return!1}}if(u=s.child,s.subtreeFlags&16384&&u!==null)u.return=s,s=u;else{if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Ga(r,s,u,p){s&=~Fm,s&=~Ks,r.suspendedLanes|=s,r.pingedLanes&=~s,p&&(r.warmLanes|=s),p=r.expirationTimes;for(var x=s;0<x;){var w=31-yt(x),A=1<<w;p[w]=-1,x&=~A}u!==0&&Pe(r,u,s)}function Wd(){return(Tt&6)===0?(Uc(0),!1):!0}function Vm(){if(pt!==null){if(Lt===0)var r=pt.return;else r=pt,Gr=Is=null,cm(r),ql=null,Ec=0,r=pt;for(;r!==null;)sw(r.alternate,r),r=r.return;pt=null}}function Jl(r,s){var u=r.timeoutHandle;u!==-1&&(r.timeoutHandle=-1,SM(u)),u=r.cancelPendingCommit,u!==null&&(r.cancelPendingCommit=null,u()),ia=0,Vm(),Ht=r,pt=u=Hr(r.current,null),xt=s,Lt=0,vi=null,Fa=!1,Wl=ge(r,s),Um=!1,Xl=wi=Fm=Ks=qa=pn=0,li=Bc=null,qm=!1,(s&8)!==0&&(s|=s&32);var p=r.entangledLanes;if(p!==0)for(r=r.entanglements,p&=s;0<p;){var x=31-yt(p),w=1<<x;s|=r[x],p&=~w}return na=s,yd(),u}function Tw(r,s){ot=null,I.H=Mc,s===Fl||s===Nd?(s=Gv(),Lt=3):s===Xp?(s=Gv(),Lt=4):Lt=s===Nm?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,vi=s,pt===null&&(pn=1,Bd(r,Ri(s,r.current)))}function Mw(){var r=bi.current;return r===null?!0:(xt&4194048)===xt?Pi===null:(xt&62914560)===xt||(xt&536870912)!==0?r===Pi:!1}function Dw(){var r=I.H;return I.H=Mc,r===null?Mc:r}function Ow(){var r=I.A;return I.A=nM,r}function Xd(){pn=4,Fa||(xt&4194048)!==xt&&bi.current!==null||(Wl=!0),(qa&134217727)===0&&(Ks&134217727)===0||Ht===null||Ga(Ht,xt,wi,!1)}function Ym(r,s,u){var p=Tt;Tt|=2;var x=Dw(),w=Ow();(Ht!==r||xt!==s)&&(Qd=null,Jl(r,s)),s=!1;var A=pn;e:do try{if(Lt!==0&&pt!==null){var $=pt,W=vi;switch(Lt){case 8:Vm(),A=6;break e;case 3:case 2:case 9:case 6:bi.current===null&&(s=!0);var se=Lt;if(Lt=0,vi=null,eo(r,$,W,se),u&&Wl){A=0;break e}break;default:se=Lt,Lt=0,vi=null,eo(r,$,W,se)}}aM(),A=pn;break}catch(me){Tw(r,me)}while(!0);return s&&r.shellSuspendCounter++,Gr=Is=null,Tt=p,I.H=x,I.A=w,pt===null&&(Ht=null,xt=0,yd()),A}function aM(){for(;pt!==null;)Rw(pt)}function sM(r,s){var u=Tt;Tt|=2;var p=Dw(),x=Ow();Ht!==r||xt!==s?(Qd=null,Yd=Ne()+500,Jl(r,s)):Wl=ge(r,s);e:do try{if(Lt!==0&&pt!==null){s=pt;var w=vi;t:switch(Lt){case 1:Lt=0,vi=null,eo(r,s,w,1);break;case 2:case 9:if(Hv(w)){Lt=0,vi=null,Lw(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:Hv(w)?(Lt=0,vi=null,Lw(s)):(Lt=0,vi=null,eo(r,s,w,7));break;case 5:var A=null;switch(pt.tag){case 26:A=pt.memoizedState;case 5:case 27:var $=pt;if(A?v1(A):$.stateNode.complete){Lt=0,vi=null;var W=$.sibling;if(W!==null)pt=W;else{var se=$.return;se!==null?(pt=se,Zd(se)):pt=null}break t}}Lt=0,vi=null,eo(r,s,w,5);break;case 6:Lt=0,vi=null,eo(r,s,w,6);break;case 8:Vm(),pn=6;break e;default:throw Error(i(462))}}lM();break}catch(me){Tw(r,me)}while(!0);return Gr=Is=null,I.H=p,I.A=x,Tt=u,pt!==null?0:(Ht=null,xt=0,yd(),pn)}function lM(){for(;pt!==null&&!he();)Rw(pt)}function Rw(r){var s=rw(r.alternate,r,na);r.memoizedProps=r.pendingProps,s===null?Zd(r):pt=s}function Lw(r){var s=r,u=s.alternate;switch(s.tag){case 15:case 0:s=Z0(u,s,s.pendingProps,s.type,void 0,xt);break;case 11:s=Z0(u,s,s.pendingProps,s.type.render,s.ref,xt);break;case 5:cm(s);default:sw(u,s),s=pt=Ov(s,na),s=rw(u,s,na)}r.memoizedProps=r.pendingProps,s===null?Zd(r):pt=s}function eo(r,s,u,p){Gr=Is=null,cm(s),ql=null,Ec=0;var x=s.return;try{if(QT(r,x,s,u,xt)){pn=1,Bd(r,Ri(u,r.current)),pt=null;return}}catch(w){if(x!==null)throw pt=x,w;pn=1,Bd(r,Ri(u,r.current)),pt=null;return}s.flags&32768?(wt||p===1?r=!0:Wl||(xt&536870912)!==0?r=!1:(Fa=r=!0,(p===2||p===9||p===3||p===6)&&(p=bi.current,p!==null&&p.tag===13&&(p.flags|=16384))),Iw(s,r)):Zd(s)}function Zd(r){var s=r;do{if((s.flags&32768)!==0){Iw(s,Fa);return}r=s.return;var u=ZT(s.alternate,s,na);if(u!==null){pt=u;return}if(s=s.sibling,s!==null){pt=s;return}pt=s=r}while(s!==null);pn===0&&(pn=5)}function Iw(r,s){do{var u=JT(r.alternate,r);if(u!==null){u.flags&=32767,pt=u;return}if(u=r.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!s&&(r=r.sibling,r!==null)){pt=r;return}pt=r=u}while(r!==null);pn=6,pt=null}function zw(r,s,u,p,x,w,A,$,W){r.cancelPendingCommit=null;do Jd();while(jn!==0);if((Tt&6)!==0)throw Error(i(327));if(s!==null){if(s===r.current)throw Error(i(177));if(w=s.lanes|s.childLanes,w|=Ip,Ue(r,u,w,A,$,W),r===Ht&&(pt=Ht=null,xt=0),Zl=s,Ka=r,ia=u,Hm=w,Km=x,_w=p,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,dM(Le,function(){return Fw(),null})):(r.callbackNode=null,r.callbackPriority=0),p=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||p){p=I.T,I.T=null,x=H.p,H.p=2,A=Tt,Tt|=4;try{eM(r,s,u)}finally{Tt=A,H.p=x,I.T=p}}jn=1,Pw(),Bw(),$w()}}function Pw(){if(jn===1){jn=0;var r=Ka,s=Zl,u=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||u){u=I.T,I.T=null;var p=H.p;H.p=2;var x=Tt;Tt|=4;try{bw(s,r);var w=sg,A=Sv(r.containerInfo),$=w.focusedElem,W=w.selectionRange;if(A!==$&&$&&$.ownerDocument&&Ev($.ownerDocument.documentElement,$)){if(W!==null&&Mp($)){var se=W.start,me=W.end;if(me===void 0&&(me=se),"selectionStart"in $)$.selectionStart=se,$.selectionEnd=Math.min(me,$.value.length);else{var we=$.ownerDocument||document,oe=we&&we.defaultView||window;if(oe.getSelection){var fe=oe.getSelection(),$e=$.textContent.length,tt=Math.min(W.start,$e),$t=W.end===void 0?tt:Math.min(W.end,$e);!fe.extend&&tt>$t&&(A=$t,$t=tt,tt=A);var ie=kv($,tt),ee=kv($,$t);if(ie&&ee&&(fe.rangeCount!==1||fe.anchorNode!==ie.node||fe.anchorOffset!==ie.offset||fe.focusNode!==ee.node||fe.focusOffset!==ee.offset)){var re=we.createRange();re.setStart(ie.node,ie.offset),fe.removeAllRanges(),tt>$t?(fe.addRange(re),fe.extend(ee.node,ee.offset)):(re.setEnd(ee.node,ee.offset),fe.addRange(re))}}}}for(we=[],fe=$;fe=fe.parentNode;)fe.nodeType===1&&we.push({element:fe,left:fe.scrollLeft,top:fe.scrollTop});for(typeof $.focus=="function"&&$.focus(),$=0;$<we.length;$++){var xe=we[$];xe.element.scrollLeft=xe.left,xe.element.scrollTop=xe.top}}ff=!!ag,sg=ag=null}finally{Tt=x,H.p=p,I.T=u}}r.current=s,jn=2}}function Bw(){if(jn===2){jn=0;var r=Ka,s=Zl,u=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||u){u=I.T,I.T=null;var p=H.p;H.p=2;var x=Tt;Tt|=4;try{hw(r,s.alternate,s)}finally{Tt=x,H.p=p,I.T=u}}jn=3}}function $w(){if(jn===4||jn===3){jn=0,Ee();var r=Ka,s=Zl,u=ia,p=_w;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?jn=5:(jn=0,Zl=Ka=null,Uw(r,r.pendingLanes));var x=r.pendingLanes;if(x===0&&(Ha=null),Wi(u),s=s.stateNode,Mt&&typeof Mt.onCommitFiberRoot=="function")try{Mt.onCommitFiberRoot(dn,s,void 0,(s.current.flags&128)===128)}catch{}if(p!==null){s=I.T,x=H.p,H.p=2,I.T=null;try{for(var w=r.onRecoverableError,A=0;A<p.length;A++){var $=p[A];w($.value,{componentStack:$.stack})}}finally{I.T=s,H.p=x}}(ia&3)!==0&&Jd(),Sr(r),x=r.pendingLanes,(u&261930)!==0&&(x&42)!==0?r===Gm?$c++:($c=0,Gm=r):$c=0,Uc(0)}}function Uw(r,s){(r.pooledCacheLanes&=s)===0&&(s=r.pooledCache,s!=null&&(r.pooledCache=null,wc(s)))}function Jd(){return Pw(),Bw(),$w(),Fw()}function Fw(){if(jn!==5)return!1;var r=Ka,s=Hm;Hm=0;var u=Wi(ia),p=I.T,x=H.p;try{H.p=32>u?32:u,I.T=null,u=Km,Km=null;var w=Ka,A=ia;if(jn=0,Zl=Ka=null,ia=0,(Tt&6)!==0)throw Error(i(331));var $=Tt;if(Tt|=4,Ew(w.current),vw(w,w.current,A,u),Tt=$,Uc(0,!1),Mt&&typeof Mt.onPostCommitFiberRoot=="function")try{Mt.onPostCommitFiberRoot(dn,w)}catch{}return!0}finally{H.p=x,I.T=p,Uw(r,s)}}function qw(r,s,u){s=Ri(u,s),s=Sm(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)qw(r,r,u);else for(;s!==null;){if(s.tag===3){qw(s,r,u);break}else if(s.tag===1){var p=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Ha===null||!Ha.has(p))){r=Ri(u,r),u=H0(2),p=Pa(s,u,2),p!==null&&(K0(u,p,s,r),Ot(p,2),Sr(p));break}}s=s.return}}function Qm(r,s,u){var p=r.pingCache;if(p===null){p=r.pingCache=new iM;var x=new Set;p.set(s,x)}else x=p.get(s),x===void 0&&(x=new Set,p.set(s,x));x.has(u)||(Um=!0,x.add(u),r=oM.bind(null,r,s,u),s.then(r,r))}function oM(r,s,u){var p=r.pingCache;p!==null&&p.delete(s),r.pingedLanes|=r.suspendedLanes&u,r.warmLanes&=~u,Ht===r&&(xt&u)===u&&(pn===4||pn===3&&(xt&62914560)===xt&&300>Ne()-Vd?(Tt&2)===0&&Jl(r,0):Fm|=u,Xl===xt&&(Xl=0)),Sr(r)}function Hw(r,s){s===0&&(s=it()),r=Os(r,s),r!==null&&(Ot(r,s),Sr(r))}function cM(r){var s=r.memoizedState,u=0;s!==null&&(u=s.retryLane),Hw(r,u)}function uM(r,s){var u=0;switch(r.tag){case 31:case 13:var p=r.stateNode,x=r.memoizedState;x!==null&&(u=x.retryLane);break;case 19:p=r.stateNode;break;case 22:p=r.stateNode._retryCache;break;default:throw Error(i(314))}p!==null&&p.delete(s),Hw(r,u)}function dM(r,s){return be(r,s)}var ef=null,to=null,Wm=!1,tf=!1,Xm=!1,Va=0;function Sr(r){r!==to&&r.next===null&&(to===null?ef=to=r:to=to.next=r),tf=!0,Wm||(Wm=!0,hM())}function Uc(r,s){if(!Xm&&tf){Xm=!0;do for(var u=!1,p=ef;p!==null;){if(r!==0){var x=p.pendingLanes;if(x===0)var w=0;else{var A=p.suspendedLanes,$=p.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,Yw(p,w))}else w=xt,w=Z(p,p===Ht?w:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(w&3)===0||ge(p,w)||(u=!0,Yw(p,w));p=p.next}while(u);Xm=!1}}function fM(){Kw()}function Kw(){tf=Wm=!1;var r=0;Va!==0&&EM()&&(r=Va);for(var s=Ne(),u=null,p=ef;p!==null;){var x=p.next,w=Gw(p,s);w===0?(p.next=null,u===null?ef=x:u.next=x,x===null&&(to=u)):(u=p,(r!==0||(w&3)!==0)&&(tf=!0)),p=x}jn!==0&&jn!==5||Uc(r),Va!==0&&(Va=0)}function Gw(r,s){for(var u=r.suspendedLanes,p=r.pingedLanes,x=r.expirationTimes,w=r.pendingLanes&-62914561;0<w;){var A=31-yt(w),$=1<<A,W=x[A];W===-1?(($&u)===0||($&p)!==0)&&(x[A]=Me($,s)):W<=s&&(r.expiredLanes|=$),w&=~$}if(s=Ht,u=xt,u=Z(r,r===s?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),p=r.callbackNode,u===0||r===s&&(Lt===2||Lt===9)||r.cancelPendingCommit!==null)return p!==null&&p!==null&&ye(p),r.callbackNode=null,r.callbackPriority=0;if((u&3)===0||ge(r,u)){if(s=u&-u,s===r.callbackPriority)return s;switch(p!==null&&ye(p),Wi(u)){case 2:case 8:u=de;break;case 32:u=Le;break;case 268435456:u=rt;break;default:u=Le}return p=Vw.bind(null,r),u=be(u,p),r.callbackPriority=s,r.callbackNode=u,s}return p!==null&&p!==null&&ye(p),r.callbackPriority=2,r.callbackNode=null,2}function Vw(r,s){if(jn!==0&&jn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var u=r.callbackNode;if(Jd()&&r.callbackNode!==u)return null;var p=xt;return p=Z(r,r===Ht?p:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),p===0?null:(Cw(r,p,s),Gw(r,Ne()),r.callbackNode!=null&&r.callbackNode===u?Vw.bind(null,r):null)}function Yw(r,s){if(Jd())return null;Cw(r,s,!0)}function hM(){NM(function(){(Tt&6)!==0?be(ne,fM):Kw()})}function Zm(){if(Va===0){var r=$l;r===0&&(r=Pr,Pr<<=1,(Pr&261888)===0&&(Pr=256)),Va=r}return Va}function Qw(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Ta(""+r)}function Ww(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 pM(r,s,u,p,x){if(s==="submit"&&u&&u.stateNode===x){var w=Qw((x[Tn]||null).action),A=p.submitter;A&&(s=(s=A[Tn]||null)?Qw(s.formAction):A.getAttribute("formAction"),s!==null&&(w=s,A=null));var $=new hd("action","action",null,p,x);r.push({event:$,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(Va!==0){var W=A?Ww(x,A):new FormData(x);bm(u,{pending:!0,data:W,method:x.method,action:w},null,W)}}else typeof w=="function"&&($.preventDefault(),W=A?Ww(x,A):new FormData(x),bm(u,{pending:!0,data:W,method:x.method,action:w},w,W))},currentTarget:x}]})}}for(var Jm=0;Jm<Lp.length;Jm++){var eg=Lp[Jm],mM=eg.toLowerCase(),gM=eg[0].toUpperCase()+eg.slice(1);nr(mM,"on"+gM)}nr(jv,"onAnimationEnd"),nr(Cv,"onAnimationIteration"),nr(Av,"onAnimationStart"),nr("dblclick","onDoubleClick"),nr("focusin","onFocus"),nr("focusout","onBlur"),nr(DT,"onTransitionRun"),nr(OT,"onTransitionStart"),nr(RT,"onTransitionCancel"),nr(Tv,"onTransitionEnd"),_e("onMouseEnter",["mouseout","mouseover"]),_e("onMouseLeave",["mouseout","mouseover"]),_e("onPointerEnter",["pointerout","pointerover"]),_e("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 Fc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),yM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Fc));function Xw(r,s){s=(s&4)!==0;for(var u=0;u<r.length;u++){var p=r[u],x=p.event;p=p.listeners;e:{var w=void 0;if(s)for(var A=p.length-1;0<=A;A--){var $=p[A],W=$.instance,se=$.currentTarget;if($=$.listener,W!==w&&x.isPropagationStopped())break e;w=$,x.currentTarget=se;try{w(x)}catch(me){gd(me)}x.currentTarget=null,w=W}else for(A=0;A<p.length;A++){if($=p[A],W=$.instance,se=$.currentTarget,$=$.listener,W!==w&&x.isPropagationStopped())break e;w=$,x.currentTarget=se;try{w(x)}catch(me){gd(me)}x.currentTarget=null,w=W}}}}function mt(r,s){var u=s[Sa];u===void 0&&(u=s[Sa]=new Set);var p=r+"__bubble";u.has(p)||(Zw(s,r,2,!1),u.add(p))}function tg(r,s,u){var p=0;s&&(p|=4),Zw(u,r,p,s)}var nf="_reactListening"+Math.random().toString(36).slice(2);function ng(r){if(!r[nf]){r[nf]=!0,jl.forEach(function(u){u!=="selectionchange"&&(yM.has(u)||tg(u,!1,r),tg(u,!0,r))});var s=r.nodeType===9?r:r.ownerDocument;s===null||s[nf]||(s[nf]=!0,tg("selectionchange",!1,s))}}function Zw(r,s,u,p){switch(j1(s)){case 2:var x=KM;break;case 8:x=GM;break;default:x=yg}u=x.bind(null,s,u,r),x=void 0,!kp||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(x=!0),p?x!==void 0?r.addEventListener(s,u,{capture:!0,passive:x}):r.addEventListener(s,u,!0):x!==void 0?r.addEventListener(s,u,{passive:x}):r.addEventListener(s,u,!1)}function ig(r,s,u,p,x){var w=p;if((s&1)===0&&(s&2)===0&&p!==null)e:for(;;){if(p===null)return;var A=p.tag;if(A===3||A===4){var $=p.stateNode.containerInfo;if($===x)break;if(A===4)for(A=p.return;A!==null;){var W=A.tag;if((W===3||W===4)&&A.stateNode.containerInfo===x)return;A=A.return}for(;$!==null;){if(A=Ln($),A===null)return;if(W=A.tag,W===5||W===6||W===26||W===27){p=w=A;continue e}$=$.parentNode}}p=p.return}cd(function(){var se=w,me=lt(u),we=[];e:{var oe=Mv.get(r);if(oe!==void 0){var fe=hd,$e=r;switch(r){case"keypress":if(dd(u)===0)break e;case"keydown":case"keyup":fe=uT;break;case"focusin":$e="focus",fe=_p;break;case"focusout":$e="blur",fe=_p;break;case"beforeblur":case"afterblur":fe=_p;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":fe=sv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=ZA;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=hT;break;case jv:case Cv:case Av:fe=tT;break;case Tv:fe=mT;break;case"scroll":case"scrollend":fe=WA;break;case"wheel":fe=yT;break;case"copy":case"cut":case"paste":fe=iT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=ov;break;case"toggle":case"beforetoggle":fe=xT}var tt=(s&4)!==0,$t=!tt&&(r==="scroll"||r==="scrollend"),ie=tt?oe!==null?oe+"Capture":null:oe;tt=[];for(var ee=se,re;ee!==null;){var xe=ee;if(re=xe.stateNode,xe=xe.tag,xe!==5&&xe!==26&&xe!==27||re===null||ie===null||(xe=uc(ee,ie),xe!=null&&tt.push(qc(ee,xe,re))),$t)break;ee=ee.return}0<tt.length&&(oe=new fe(oe,$e,null,u,me),we.push({event:oe,listeners:tt}))}}if((s&7)===0){e:{if(oe=r==="mouseover"||r==="pointerover",fe=r==="mouseout"||r==="pointerout",oe&&u!==qe&&($e=u.relatedTarget||u.fromElement)&&(Ln($e)||$e[Xi]))break e;if((fe||oe)&&(oe=me.window===me?me:(oe=me.ownerDocument)?oe.defaultView||oe.parentWindow:window,fe?($e=u.relatedTarget||u.toElement,fe=se,$e=$e?Ln($e):null,$e!==null&&($t=l($e),tt=$e.tag,$e!==$t||tt!==5&&tt!==27&&tt!==6)&&($e=null)):(fe=null,$e=se),fe!==$e)){if(tt=sv,xe="onMouseLeave",ie="onMouseEnter",ee="mouse",(r==="pointerout"||r==="pointerover")&&(tt=ov,xe="onPointerLeave",ie="onPointerEnter",ee="pointer"),$t=fe==null?oe:Ji(fe),re=$e==null?oe:Ji($e),oe=new tt(xe,ee+"leave",fe,u,me),oe.target=$t,oe.relatedTarget=re,xe=null,Ln(me)===se&&(tt=new tt(ie,ee+"enter",$e,u,me),tt.target=re,tt.relatedTarget=$t,xe=tt),$t=xe,fe&&$e)t:{for(tt=bM,ie=fe,ee=$e,re=0,xe=ie;xe;xe=tt(xe))re++;xe=0;for(var We=ee;We;We=tt(We))xe++;for(;0<re-xe;)ie=tt(ie),re--;for(;0<xe-re;)ee=tt(ee),xe--;for(;re--;){if(ie===ee||ee!==null&&ie===ee.alternate){tt=ie;break t}ie=tt(ie),ee=tt(ee)}tt=null}else tt=null;fe!==null&&Jw(we,oe,fe,tt,!1),$e!==null&&$t!==null&&Jw(we,$t,$e,tt,!0)}}e:{if(oe=se?Ji(se):window,fe=oe.nodeName&&oe.nodeName.toLowerCase(),fe==="select"||fe==="input"&&oe.type==="file")var jt=gv;else if(pv(oe))if(yv)jt=AT;else{jt=jT;var He=_T}else fe=oe.nodeName,!fe||fe.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?se&&Aa(se.elementType)&&(jt=gv):jt=CT;if(jt&&(jt=jt(r,se))){mv(we,jt,u,me);break e}He&&He(r,oe,se),r==="focusout"&&se&&oe.type==="number"&&se.memoizedProps.value!=null&&Ca(oe,"number",oe.value)}switch(He=se?Ji(se):window,r){case"focusin":(pv(He)||He.contentEditable==="true")&&(Dl=He,Dp=se,bc=null);break;case"focusout":bc=Dp=Dl=null;break;case"mousedown":Op=!0;break;case"contextmenu":case"mouseup":case"dragend":Op=!1,Nv(we,u,me);break;case"selectionchange":if(MT)break;case"keydown":case"keyup":Nv(we,u,me)}var ct;if(Cp)e:{switch(r){case"compositionstart":var vt="onCompositionStart";break e;case"compositionend":vt="onCompositionEnd";break e;case"compositionupdate":vt="onCompositionUpdate";break e}vt=void 0}else Ml?fv(r,u)&&(vt="onCompositionEnd"):r==="keydown"&&u.keyCode===229&&(vt="onCompositionStart");vt&&(cv&&u.locale!=="ko"&&(Ml||vt!=="onCompositionStart"?vt==="onCompositionEnd"&&Ml&&(ct=rv()):(Ma=me,Ep="value"in Ma?Ma.value:Ma.textContent,Ml=!0)),He=rf(se,vt),0<He.length&&(vt=new lv(vt,r,null,u,me),we.push({event:vt,listeners:He}),ct?vt.data=ct:(ct=hv(u),ct!==null&&(vt.data=ct)))),(ct=wT?kT(r,u):ET(r,u))&&(vt=rf(se,"onBeforeInput"),0<vt.length&&(He=new lv("onBeforeInput","beforeinput",null,u,me),we.push({event:He,listeners:vt}),He.data=ct)),pM(we,r,se,u,me)}Xw(we,s)})}function qc(r,s,u){return{instance:r,listener:s,currentTarget:u}}function rf(r,s){for(var u=s+"Capture",p=[];r!==null;){var x=r,w=x.stateNode;if(x=x.tag,x!==5&&x!==26&&x!==27||w===null||(x=uc(r,u),x!=null&&p.unshift(qc(r,x,w)),x=uc(r,s),x!=null&&p.push(qc(r,x,w))),r.tag===3)return p;r=r.return}return[]}function bM(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function Jw(r,s,u,p,x){for(var w=s._reactName,A=[];u!==null&&u!==p;){var $=u,W=$.alternate,se=$.stateNode;if($=$.tag,W!==null&&W===p)break;$!==5&&$!==26&&$!==27||se===null||(W=se,x?(se=uc(u,w),se!=null&&A.unshift(qc(u,se,W))):x||(se=uc(u,w),se!=null&&A.push(qc(u,se,W)))),u=u.return}A.length!==0&&r.push({event:s,listeners:A})}var xM=/\r\n?/g,vM=/\u0000|\uFFFD/g;function e1(r){return(typeof r=="string"?r:""+r).replace(xM,`
|
|
49
|
-
`).replace(vM,"")}function t1(r,s){return s=e1(s),e1(r)===s}function Bt(r,s,u,p,x,w){switch(u){case"children":typeof p=="string"?s==="body"||s==="textarea"&&p===""||nt(r,p):(typeof p=="number"||typeof p=="bigint")&&s!=="body"&&nt(r,""+p);break;case"className":Qn(r,"class",p);break;case"tabIndex":Qn(r,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":Qn(r,u,p);break;case"style":Rt(r,p,w);break;case"data":if(s!=="object"){Qn(r,"data",p);break}case"src":case"href":if(p===""&&(s!=="a"||u!=="href")){r.removeAttribute(u);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){r.removeAttribute(u);break}p=Ta(""+p),r.setAttribute(u,p);break;case"action":case"formAction":if(typeof p=="function"){r.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof w=="function"&&(u==="formAction"?(s!=="input"&&Bt(r,s,"name",x.name,x,null),Bt(r,s,"formEncType",x.formEncType,x,null),Bt(r,s,"formMethod",x.formMethod,x,null),Bt(r,s,"formTarget",x.formTarget,x,null)):(Bt(r,s,"encType",x.encType,x,null),Bt(r,s,"method",x.method,x,null),Bt(r,s,"target",x.target,x,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){r.removeAttribute(u);break}p=Ta(""+p),r.setAttribute(u,p);break;case"onClick":p!=null&&(r.onclick=Ae);break;case"onScroll":p!=null&&mt("scroll",r);break;case"onScrollEnd":p!=null&&mt("scrollend",r);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(i(61));if(u=p.__html,u!=null){if(x.children!=null)throw Error(i(60));r.innerHTML=u}}break;case"multiple":r.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":r.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){r.removeAttribute("xlink:href");break}u=Ta(""+p),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?r.setAttribute(u,""+p):r.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":p&&typeof p!="function"&&typeof p!="symbol"?r.setAttribute(u,""):r.removeAttribute(u);break;case"capture":case"download":p===!0?r.setAttribute(u,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?r.setAttribute(u,p):r.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?r.setAttribute(u,p):r.removeAttribute(u);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?r.removeAttribute(u):r.setAttribute(u,p);break;case"popover":mt("beforetoggle",r),mt("toggle",r),Mn(r,"popover",p);break;case"xlinkActuate":Fn(r,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":Fn(r,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":Fn(r,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":Fn(r,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":Fn(r,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":Fn(r,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":Fn(r,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":Fn(r,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":Fn(r,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":Mn(r,"is",p);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=Fr.get(u)||u,Mn(r,u,p))}}function rg(r,s,u,p,x,w){switch(u){case"style":Rt(r,p,w);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(i(61));if(u=p.__html,u!=null){if(x.children!=null)throw Error(i(60));r.innerHTML=u}}break;case"children":typeof p=="string"?nt(r,p):(typeof p=="number"||typeof p=="bigint")&&nt(r,""+p);break;case"onScroll":p!=null&&mt("scroll",r);break;case"onScrollEnd":p!=null&&mt("scrollend",r);break;case"onClick":p!=null&&(r.onclick=Ae);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ur.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(x=u.endsWith("Capture"),s=u.slice(2,x?u.length-7:void 0),w=r[Tn]||null,w=w!=null?w[u]:null,typeof w=="function"&&r.removeEventListener(s,w,x),typeof p=="function")){typeof w!="function"&&w!==null&&(u in r?r[u]=null:r.hasAttribute(u)&&r.removeAttribute(u)),r.addEventListener(s,p,x);break e}u in r?r[u]=p:p===!0?r.setAttribute(u,""):Mn(r,u,p)}}}function Bn(r,s,u){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":mt("error",r),mt("load",r);var p=!1,x=!1,w;for(w in u)if(u.hasOwnProperty(w)){var A=u[w];if(A!=null)switch(w){case"src":p=!0;break;case"srcSet":x=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,s));default:Bt(r,s,w,A,u,null)}}x&&Bt(r,s,"srcSet",u.srcSet,u,null),p&&Bt(r,s,"src",u.src,u,null);return;case"input":mt("invalid",r);var $=w=A=x=null,W=null,se=null;for(p in u)if(u.hasOwnProperty(p)){var me=u[p];if(me!=null)switch(p){case"name":x=me;break;case"type":A=me;break;case"checked":W=me;break;case"defaultChecked":se=me;break;case"value":w=me;break;case"defaultValue":$=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(i(137,s));break;default:Bt(r,s,p,me,u,null)}}tr(r,w,$,W,se,A,x,!1);return;case"select":mt("invalid",r),p=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":p=$;default:Bt(r,s,x,$,u,null)}s=w,u=A,r.multiple=!!p,s!=null?_n(r,!!p,s,!1):u!=null&&_n(r,!!p,u,!0);return;case"textarea":mt("invalid",r),w=x=p=null;for(A in u)if(u.hasOwnProperty(A)&&($=u[A],$!=null))switch(A){case"value":p=$;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,p,x,w);return;case"option":for(W in u)if(u.hasOwnProperty(W)&&(p=u[W],p!=null))switch(W){case"selected":r.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:Bt(r,s,W,p,u,null)}return;case"dialog":mt("beforetoggle",r),mt("toggle",r),mt("cancel",r),mt("close",r);break;case"iframe":case"object":mt("load",r);break;case"video":case"audio":for(p=0;p<Fc.length;p++)mt(Fc[p],r);break;case"image":mt("error",r),mt("load",r);break;case"details":mt("toggle",r);break;case"embed":case"source":case"link":mt("error",r),mt("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(se in u)if(u.hasOwnProperty(se)&&(p=u[se],p!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,s));default:Bt(r,s,se,p,u,null)}return;default:if(Aa(s)){for(me in u)u.hasOwnProperty(me)&&(p=u[me],p!==void 0&&rg(r,s,me,p,u,void 0));return}}for($ in u)u.hasOwnProperty($)&&(p=u[$],p!=null&&Bt(r,s,$,p,u,null))}function wM(r,s,u,p){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var x=null,w=null,A=null,$=null,W=null,se=null,me=null;for(fe in u){var we=u[fe];if(u.hasOwnProperty(fe)&&we!=null)switch(fe){case"checked":break;case"value":break;case"defaultValue":W=we;default:p.hasOwnProperty(fe)||Bt(r,s,fe,null,p,we)}}for(var oe in p){var fe=p[oe];if(we=u[oe],p.hasOwnProperty(oe)&&(fe!=null||we!=null))switch(oe){case"type":w=fe;break;case"name":x=fe;break;case"checked":se=fe;break;case"defaultChecked":me=fe;break;case"value":A=fe;break;case"defaultValue":$=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(i(137,s));break;default:fe!==we&&Bt(r,s,oe,fe,p,we)}}Cs(r,A,$,W,se,me,w,x);return;case"select":fe=A=$=oe=null;for(w in u)if(W=u[w],u.hasOwnProperty(w)&&W!=null)switch(w){case"value":break;case"multiple":fe=W;default:p.hasOwnProperty(w)||Bt(r,s,w,null,p,W)}for(x in p)if(w=p[x],W=u[x],p.hasOwnProperty(x)&&(w!=null||W!=null))switch(x){case"value":oe=w;break;case"defaultValue":$=w;break;case"multiple":A=w;default:w!==W&&Bt(r,s,x,w,p,W)}s=$,u=A,p=fe,oe!=null?_n(r,!!u,oe,!1):!!p!=!!u&&(s!=null?_n(r,!!u,s,!0):_n(r,!!u,u?[]:"",!1));return;case"textarea":fe=oe=null;for($ in u)if(x=u[$],u.hasOwnProperty($)&&x!=null&&!p.hasOwnProperty($))switch($){case"value":break;case"children":break;default:Bt(r,s,$,null,p,x)}for(A in p)if(x=p[A],w=u[A],p.hasOwnProperty(A)&&(x!=null||w!=null))switch(A){case"value":oe=x;break;case"defaultValue":fe=x;break;case"children":break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(i(91));break;default:x!==w&&Bt(r,s,A,x,p,w)}As(r,oe,fe);return;case"option":for(var $e in u)if(oe=u[$e],u.hasOwnProperty($e)&&oe!=null&&!p.hasOwnProperty($e))switch($e){case"selected":r.selected=!1;break;default:Bt(r,s,$e,null,p,oe)}for(W in p)if(oe=p[W],fe=u[W],p.hasOwnProperty(W)&&oe!==fe&&(oe!=null||fe!=null))switch(W){case"selected":r.selected=oe&&typeof oe!="function"&&typeof oe!="symbol";break;default:Bt(r,s,W,oe,p,fe)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var tt in u)oe=u[tt],u.hasOwnProperty(tt)&&oe!=null&&!p.hasOwnProperty(tt)&&Bt(r,s,tt,null,p,oe);for(se in p)if(oe=p[se],fe=u[se],p.hasOwnProperty(se)&&oe!==fe&&(oe!=null||fe!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(i(137,s));break;default:Bt(r,s,se,oe,p,fe)}return;default:if(Aa(s)){for(var $t in u)oe=u[$t],u.hasOwnProperty($t)&&oe!==void 0&&!p.hasOwnProperty($t)&&rg(r,s,$t,void 0,p,oe);for(me in p)oe=p[me],fe=u[me],!p.hasOwnProperty(me)||oe===fe||oe===void 0&&fe===void 0||rg(r,s,me,oe,p,fe);return}}for(var ie in u)oe=u[ie],u.hasOwnProperty(ie)&&oe!=null&&!p.hasOwnProperty(ie)&&Bt(r,s,ie,null,p,oe);for(we in p)oe=p[we],fe=u[we],!p.hasOwnProperty(we)||oe===fe||oe==null&&fe==null||Bt(r,s,we,oe,p,fe)}function n1(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function kM(){if(typeof performance.getEntriesByType=="function"){for(var r=0,s=0,u=performance.getEntriesByType("resource"),p=0;p<u.length;p++){var x=u[p],w=x.transferSize,A=x.initiatorType,$=x.duration;if(w&&$&&n1(A)){for(A=0,$=x.responseEnd,p+=1;p<u.length;p++){var W=u[p],se=W.startTime;if(se>$)break;var me=W.transferSize,we=W.initiatorType;me&&n1(we)&&(W=W.responseEnd,A+=me*(W<$?1:($-se)/(W-se)))}if(--p,s+=8*(w+A)/(x.duration/1e3),r++,10<r)break}}if(0<r)return s/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var ag=null,sg=null;function af(r){return r.nodeType===9?r:r.ownerDocument}function i1(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 r1(r,s){if(r===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&s==="foreignObject"?0:r}function lg(r,s){return r==="textarea"||r==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var og=null;function EM(){var r=window.event;return r&&r.type==="popstate"?r===og?!1:(og=r,!0):(og=null,!1)}var a1=typeof setTimeout=="function"?setTimeout:void 0,SM=typeof clearTimeout=="function"?clearTimeout:void 0,s1=typeof Promise=="function"?Promise:void 0,NM=typeof queueMicrotask=="function"?queueMicrotask:typeof s1<"u"?function(r){return s1.resolve(null).then(r).catch(_M)}:a1;function _M(r){setTimeout(function(){throw r})}function Ya(r){return r==="head"}function l1(r,s){var u=s,p=0;do{var x=u.nextSibling;if(r.removeChild(u),x&&x.nodeType===8)if(u=x.data,u==="/$"||u==="/&"){if(p===0){r.removeChild(x),ao(s);return}p--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")p++;else if(u==="html")Hc(r.ownerDocument.documentElement);else if(u==="head"){u=r.ownerDocument.head,Hc(u);for(var w=u.firstChild;w;){var A=w.nextSibling,$=w.nodeName;w[$r]||$==="SCRIPT"||$==="STYLE"||$==="LINK"&&w.rel.toLowerCase()==="stylesheet"||u.removeChild(w),w=A}}else u==="body"&&Hc(r.ownerDocument.body);u=x}while(u);ao(s)}function o1(r,s){var u=r;r=0;do{var p=u.nextSibling;if(u.nodeType===1?s?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(s?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),p&&p.nodeType===8)if(u=p.data,u==="/$"){if(r===0)break;r--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||r++;u=p}while(u)}function cg(r){var s=r.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var u=s;switch(s=s.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":cg(u),js(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}r.removeChild(u)}}function jM(r,s,u,p){for(;r.nodeType===1;){var x=u;if(r.nodeName.toLowerCase()!==s.toLowerCase()){if(!p&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(p){if(!r[$r])switch(s){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(w=r.getAttribute("rel"),w==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(w!==x.rel||r.getAttribute("href")!==(x.href==null||x.href===""?null:x.href)||r.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin)||r.getAttribute("title")!==(x.title==null?null:x.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(w=r.getAttribute("src"),(w!==(x.src==null?null:x.src)||r.getAttribute("type")!==(x.type==null?null:x.type)||r.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin))&&w&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(s==="input"&&r.type==="hidden"){var w=x.name==null?null:""+x.name;if(x.type==="hidden"&&r.getAttribute("name")===w)return r}else return r;if(r=Bi(r.nextSibling),r===null)break}return null}function CM(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 c1(r,s){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=Bi(r.nextSibling),r===null))return null;return r}function ug(r){return r.data==="$?"||r.data==="$~"}function dg(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function AM(r,s){var u=r.ownerDocument;if(r.data==="$~")r._reactRetry=s;else if(r.data!=="$?"||u.readyState!=="loading")s();else{var p=function(){s(),u.removeEventListener("DOMContentLoaded",p)};u.addEventListener("DOMContentLoaded",p),r._reactRetry=p}}function Bi(r){for(;r!=null;r=r.nextSibling){var s=r.nodeType;if(s===1||s===3)break;if(s===8){if(s=r.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return r}var fg=null;function u1(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 d1(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 f1(r,s,u){switch(s=af(u),r){case"html":if(r=s.documentElement,!r)throw Error(i(452));return r;case"head":if(r=s.head,!r)throw Error(i(453));return r;case"body":if(r=s.body,!r)throw Error(i(454));return r;default:throw Error(i(451))}}function Hc(r){for(var s=r.attributes;s.length;)r.removeAttributeNode(s[0]);js(r)}var $i=new Map,h1=new Set;function sf(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var ra=H.d;H.d={f:TM,r:MM,D:DM,C:OM,L:RM,m:LM,X:zM,S:IM,M:PM};function TM(){var r=ra.f(),s=Wd();return r||s}function MM(r){var s=Zi(r);s!==null&&s.tag===5&&s.type==="form"?T0(s):ra.r(r)}var no=typeof document>"u"?null:document;function p1(r,s,u){var p=no;if(p&&typeof s=="string"&&s){var x=qn(s);x='link[rel="'+r+'"][href="'+x+'"]',typeof u=="string"&&(x+='[crossorigin="'+u+'"]'),h1.has(x)||(h1.add(x),r={rel:r,crossOrigin:u,href:s},p.querySelector(x)===null&&(s=p.createElement("link"),Bn(s,"link",r),fn(s),p.head.appendChild(s)))}}function DM(r){ra.D(r),p1("dns-prefetch",r,null)}function OM(r,s){ra.C(r,s),p1("preconnect",r,s)}function RM(r,s,u){ra.L(r,s,u);var p=no;if(p&&r&&s){var x='link[rel="preload"][as="'+qn(s)+'"]';s==="image"&&u&&u.imageSrcSet?(x+='[imagesrcset="'+qn(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(x+='[imagesizes="'+qn(u.imageSizes)+'"]')):x+='[href="'+qn(r)+'"]';var w=x;switch(s){case"style":w=io(r);break;case"script":w=ro(r)}$i.has(w)||(r=m({rel:"preload",href:s==="image"&&u&&u.imageSrcSet?void 0:r,as:s},u),$i.set(w,r),p.querySelector(x)!==null||s==="style"&&p.querySelector(Kc(w))||s==="script"&&p.querySelector(Gc(w))||(s=p.createElement("link"),Bn(s,"link",r),fn(s),p.head.appendChild(s)))}}function LM(r,s){ra.m(r,s);var u=no;if(u&&r){var p=s&&typeof s.as=="string"?s.as:"script",x='link[rel="modulepreload"][as="'+qn(p)+'"][href="'+qn(r)+'"]',w=x;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=ro(r)}if(!$i.has(w)&&(r=m({rel:"modulepreload",href:r},s),$i.set(w,r),u.querySelector(x)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Gc(w)))return}p=u.createElement("link"),Bn(p,"link",r),fn(p),u.head.appendChild(p)}}}function IM(r,s,u){ra.S(r,s,u);var p=no;if(p&&r){var x=xr(p).hoistableStyles,w=io(r);s=s||"default";var A=x.get(w);if(!A){var $={loading:0,preload:null};if(A=p.querySelector(Kc(w)))$.loading=5;else{r=m({rel:"stylesheet",href:r,"data-precedence":s},u),(u=$i.get(w))&&hg(r,u);var W=A=p.createElement("link");fn(W),Bn(W,"link",r),W._p=new Promise(function(se,me){W.onload=se,W.onerror=me}),W.addEventListener("load",function(){$.loading|=1}),W.addEventListener("error",function(){$.loading|=2}),$.loading|=4,lf(A,s,p)}A={type:"stylesheet",instance:A,count:1,state:$},x.set(w,A)}}}function zM(r,s){ra.X(r,s);var u=no;if(u&&r){var p=xr(u).hoistableScripts,x=ro(r),w=p.get(x);w||(w=u.querySelector(Gc(x)),w||(r=m({src:r,async:!0},s),(s=$i.get(x))&&pg(r,s),w=u.createElement("script"),fn(w),Bn(w,"link",r),u.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},p.set(x,w))}}function PM(r,s){ra.M(r,s);var u=no;if(u&&r){var p=xr(u).hoistableScripts,x=ro(r),w=p.get(x);w||(w=u.querySelector(Gc(x)),w||(r=m({src:r,async:!0,type:"module"},s),(s=$i.get(x))&&pg(r,s),w=u.createElement("script"),fn(w),Bn(w,"link",r),u.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},p.set(x,w))}}function m1(r,s,u,p){var x=(x=ke.current)?sf(x):null;if(!x)throw Error(i(446));switch(r){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(s=io(u.href),u=xr(x).hoistableStyles,p=u.get(s),p||(p={type:"style",instance:null,count:0,state:null},u.set(s,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){r=io(u.href);var w=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(Kc(r)))&&!w._p&&(A.instance=w,A.state.loading=5),$i.has(r)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},$i.set(r,u),w||BM(x,r,u,A.state))),s&&p===null)throw Error(i(528,""));return A}if(s&&p!==null)throw Error(i(529,""));return null;case"script":return s=u.async,u=u.src,typeof u=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=ro(u),u=xr(x).hoistableScripts,p=u.get(s),p||(p={type:"script",instance:null,count:0,state:null},u.set(s,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,r))}}function io(r){return'href="'+qn(r)+'"'}function Kc(r){return'link[rel="stylesheet"]['+r+"]"}function g1(r){return m({},r,{"data-precedence":r.precedence,precedence:null})}function BM(r,s,u,p){r.querySelector('link[rel="preload"][as="style"]['+s+"]")?p.loading=1:(s=r.createElement("link"),p.preload=s,s.addEventListener("load",function(){return p.loading|=1}),s.addEventListener("error",function(){return p.loading|=2}),Bn(s,"link",u),fn(s),r.head.appendChild(s))}function ro(r){return'[src="'+qn(r)+'"]'}function Gc(r){return"script[async]"+r}function y1(r,s,u){if(s.count++,s.instance===null)switch(s.type){case"style":var p=r.querySelector('style[data-href~="'+qn(u.href)+'"]');if(p)return s.instance=p,fn(p),p;var x=m({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return p=(r.ownerDocument||r).createElement("style"),fn(p),Bn(p,"style",x),lf(p,u.precedence,r),s.instance=p;case"stylesheet":x=io(u.href);var w=r.querySelector(Kc(x));if(w)return s.state.loading|=4,s.instance=w,fn(w),w;p=g1(u),(x=$i.get(x))&&hg(p,x),w=(r.ownerDocument||r).createElement("link"),fn(w);var A=w;return A._p=new Promise(function($,W){A.onload=$,A.onerror=W}),Bn(w,"link",p),s.state.loading|=4,lf(w,u.precedence,r),s.instance=w;case"script":return w=ro(u.src),(x=r.querySelector(Gc(w)))?(s.instance=x,fn(x),x):(p=u,(x=$i.get(w))&&(p=m({},u),pg(p,x)),r=r.ownerDocument||r,x=r.createElement("script"),fn(x),Bn(x,"link",p),r.head.appendChild(x),s.instance=x);case"void":return null;default:throw Error(i(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(p=s.instance,s.state.loading|=4,lf(p,u.precedence,r));return s.instance}function lf(r,s,u){for(var p=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=p.length?p[p.length-1]:null,w=x,A=0;A<p.length;A++){var $=p[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 hg(r,s){r.crossOrigin==null&&(r.crossOrigin=s.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=s.referrerPolicy),r.title==null&&(r.title=s.title)}function pg(r,s){r.crossOrigin==null&&(r.crossOrigin=s.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=s.referrerPolicy),r.integrity==null&&(r.integrity=s.integrity)}var of=null;function b1(r,s,u){if(of===null){var p=new Map,x=of=new Map;x.set(u,p)}else x=of,p=x.get(u),p||(p=new Map,x.set(u,p));if(p.has(r))return p;for(p.set(r,null),u=u.getElementsByTagName(r),x=0;x<u.length;x++){var w=u[x];if(!(w[$r]||w[an]||r==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var A=w.getAttribute(s)||"";A=r+A;var $=p.get(A);$?$.push(w):p.set(A,[w])}}return p}function x1(r,s,u){r=r.ownerDocument||r,r.head.insertBefore(u,s==="title"?r.querySelector("head > title"):null)}function $M(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 v1(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function UM(r,s,u,p){if(u.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var x=io(p.href),w=s.querySelector(Kc(x));if(w){s=w._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(r.count++,r=cf.bind(r),s.then(r,r)),u.state.loading|=4,u.instance=w,fn(w);return}w=s.ownerDocument||s,p=g1(p),(x=$i.get(x))&&hg(p,x),w=w.createElement("link"),fn(w);var A=w;A._p=new Promise(function($,W){A.onload=$,A.onerror=W}),Bn(w,"link",p),u.instance=w}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(u,s),(s=u.state.preload)&&(u.state.loading&3)===0&&(r.count++,u=cf.bind(r),s.addEventListener("load",u),s.addEventListener("error",u))}}var mg=0;function FM(r,s){return r.stylesheets&&r.count===0&&df(r,r.stylesheets),0<r.count||0<r.imgCount?function(u){var p=setTimeout(function(){if(r.stylesheets&&df(r,r.stylesheets),r.unsuspend){var w=r.unsuspend;r.unsuspend=null,w()}},6e4+s);0<r.imgBytes&&mg===0&&(mg=62500*kM());var x=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&df(r,r.stylesheets),r.unsuspend)){var w=r.unsuspend;r.unsuspend=null,w()}},(r.imgBytes>mg?50:800)+s);return r.unsuspend=u,function(){r.unsuspend=null,clearTimeout(p),clearTimeout(x)}}:null}function cf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)df(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var uf=null;function df(r,s){r.stylesheets=null,r.unsuspend!==null&&(r.count++,uf=new Map,s.forEach(qM,r),uf=null,cf.call(r))}function qM(r,s){if(!(s.state.loading&4)){var u=uf.get(r);if(u)var p=u.get(null);else{u=new Map,uf.set(r,u);for(var x=r.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<x.length;w++){var A=x[w];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(u.set(A.dataset.precedence,A),p=A)}p&&u.set(null,p)}x=s.instance,A=x.getAttribute("data-precedence"),w=u.get(A)||p,w===p&&u.set(null,x),u.set(A,x),this.count++,p=cf.bind(this),x.addEventListener("load",p),x.addEventListener("error",p),w?w.parentNode.insertBefore(x,w.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(x,r.firstChild)),s.state.loading|=4}}var Vc={$$typeof:N,Provider:null,Consumer:null,_currentValue:Q,_currentValue2:Q,_threadCount:0};function HM(r,s,u,p,x,w,A,$,W){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=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=p,this.onUncaughtError=x,this.onCaughtError=w,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=W,this.incompleteTransitions=new Map}function w1(r,s,u,p,x,w,A,$,W,se,me,we){return r=new HM(r,s,u,A,W,se,me,we,$),s=1,w===!0&&(s|=24),w=yi(3,null,null,s),r.current=w,w.stateNode=r,s=Yp(),s.refCount++,r.pooledCache=s,s.refCount++,w.memoizedState={element:p,isDehydrated:u,cache:s},Zp(w),r}function k1(r){return r?(r=Ll,r):Ll}function E1(r,s,u,p,x,w){x=k1(x),p.context===null?p.context=x:p.pendingContext=x,p=za(s),p.payload={element:u},w=w===void 0?null:w,w!==null&&(p.callback=w),u=Pa(r,p,s),u!==null&&(oi(u,r,s),Nc(u,r,s))}function S1(r,s){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var u=r.retryLane;r.retryLane=u!==0&&u<s?u:s}}function gg(r,s){S1(r,s),(r=r.alternate)&&S1(r,s)}function N1(r){if(r.tag===13||r.tag===31){var s=Os(r,67108864);s!==null&&oi(s,r,67108864),gg(r,67108864)}}function _1(r){if(r.tag===13||r.tag===31){var s=ki();s=Vt(s);var u=Os(r,s);u!==null&&oi(u,r,s),gg(r,s)}}var ff=!0;function KM(r,s,u,p){var x=I.T;I.T=null;var w=H.p;try{H.p=2,yg(r,s,u,p)}finally{H.p=w,I.T=x}}function GM(r,s,u,p){var x=I.T;I.T=null;var w=H.p;try{H.p=8,yg(r,s,u,p)}finally{H.p=w,I.T=x}}function yg(r,s,u,p){if(ff){var x=bg(p);if(x===null)ig(r,s,p,hf,u),C1(r,p);else if(YM(x,r,s,u,p))p.stopPropagation();else if(C1(r,p),s&4&&-1<VM.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 W=1<<31-yt(A);$.entanglements[1]|=W,A&=~W}Sr(w),(Tt&6)===0&&(Yd=Ne()+500,Uc(0))}}break;case 31:case 13:$=Os(w,2),$!==null&&oi($,w,2),Wd(),gg(w,2)}if(w=bg(p),w===null&&ig(r,s,p,hf,u),w===x)break;x=w}x!==null&&p.stopPropagation()}else ig(r,s,p,null,u)}}function bg(r){return r=lt(r),xg(r)}var hf=null;function xg(r){if(hf=null,r=Ln(r),r!==null){var s=l(r);if(s===null)r=null;else{var u=s.tag;if(u===13){if(r=o(s),r!==null)return r;r=null}else if(u===31){if(r=d(s),r!==null)return r;r=null}else if(u===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;r=null}else s!==r&&(r=null)}}return hf=r,null}function j1(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ke()){case ne:return 2;case de:return 8;case Le:case Ze:return 32;case rt:return 268435456;default:return 32}default:return 32}}var vg=!1,Qa=null,Wa=null,Xa=null,Yc=new Map,Qc=new Map,Za=[],VM="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 C1(r,s){switch(r){case"focusin":case"focusout":Qa=null;break;case"dragenter":case"dragleave":Wa=null;break;case"mouseover":case"mouseout":Xa=null;break;case"pointerover":case"pointerout":Yc.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qc.delete(s.pointerId)}}function Wc(r,s,u,p,x,w){return r===null||r.nativeEvent!==w?(r={blockedOn:s,domEventName:u,eventSystemFlags:p,nativeEvent:w,targetContainers:[x]},s!==null&&(s=Zi(s),s!==null&&N1(s)),r):(r.eventSystemFlags|=p,s=r.targetContainers,x!==null&&s.indexOf(x)===-1&&s.push(x),r)}function YM(r,s,u,p,x){switch(s){case"focusin":return Qa=Wc(Qa,r,s,u,p,x),!0;case"dragenter":return Wa=Wc(Wa,r,s,u,p,x),!0;case"mouseover":return Xa=Wc(Xa,r,s,u,p,x),!0;case"pointerover":var w=x.pointerId;return Yc.set(w,Wc(Yc.get(w)||null,r,s,u,p,x)),!0;case"gotpointercapture":return w=x.pointerId,Qc.set(w,Wc(Qc.get(w)||null,r,s,u,p,x)),!0}return!1}function A1(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(){_1(u)});return}}else if(s===31){if(s=d(u),s!==null){r.blockedOn=s,Ea(r.priority,function(){_1(u)});return}}else if(s===3&&u.stateNode.current.memoizedState.isDehydrated){r.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}r.blockedOn=null}function pf(r){if(r.blockedOn!==null)return!1;for(var s=r.targetContainers;0<s.length;){var u=bg(r.nativeEvent);if(u===null){u=r.nativeEvent;var p=new u.constructor(u.type,u);qe=p,u.target.dispatchEvent(p),qe=null}else return s=Zi(u),s!==null&&N1(s),r.blockedOn=u,!1;s.shift()}return!0}function T1(r,s,u){pf(r)&&u.delete(s)}function QM(){vg=!1,Qa!==null&&pf(Qa)&&(Qa=null),Wa!==null&&pf(Wa)&&(Wa=null),Xa!==null&&pf(Xa)&&(Xa=null),Yc.forEach(T1),Qc.forEach(T1)}function mf(r,s){r.blockedOn===s&&(r.blockedOn=null,vg||(vg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,QM)))}var gf=null;function M1(r){gf!==r&&(gf=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){gf===r&&(gf=null);for(var s=0;s<r.length;s+=3){var u=r[s],p=r[s+1],x=r[s+2];if(typeof p!="function"){if(xg(p||u)===null)continue;break}var w=Zi(u);w!==null&&(r.splice(s,3),s-=3,bm(w,{pending:!0,data:x,method:u.method,action:p},p,x))}}))}function ao(r){function s(W){return mf(W,r)}Qa!==null&&mf(Qa,r),Wa!==null&&mf(Wa,r),Xa!==null&&mf(Xa,r),Yc.forEach(s),Qc.forEach(s);for(var u=0;u<Za.length;u++){var p=Za[u];p.blockedOn===r&&(p.blockedOn=null)}for(;0<Za.length&&(u=Za[0],u.blockedOn===null);)A1(u),u.blockedOn===null&&Za.shift();if(u=(r.ownerDocument||r).$$reactFormReplay,u!=null)for(p=0;p<u.length;p+=3){var x=u[p],w=u[p+1],A=x[Tn]||null;if(typeof w=="function")A||M1(u);else if(A){var $=null;if(w&&w.hasAttribute("formAction")){if(x=w,A=w[Tn]||null)$=A.formAction;else if(xg(x)!==null)continue}else $=A.action;typeof $=="function"?u[p+1]=$:(u.splice(p,3),p-=3),M1(u)}}}function D1(){function r(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(A){return x=A})},focusReset:"manual",scroll:"manual"})}function s(){x!==null&&(x(),x=null),p||setTimeout(u,20)}function u(){if(!p&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,x=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(u,100),function(){p=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),x!==null&&(x(),x=null)}}}function wg(r){this._internalRoot=r}yf.prototype.render=wg.prototype.render=function(r){var s=this._internalRoot;if(s===null)throw Error(i(409));var u=s.current,p=ki();E1(u,p,r,s,null,null)},yf.prototype.unmount=wg.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var s=r.containerInfo;E1(r.current,2,null,r,null,null),Wd(),s[Xi]=null}};function yf(r){this._internalRoot=r}yf.prototype.unstable_scheduleHydration=function(r){if(r){var s=ka();r={blockedOn:null,target:r,priority:s};for(var u=0;u<Za.length&&s!==0&&s<Za[u].priority;u++);Za.splice(u,0,r),u===0&&A1(r)}};var O1=t.version;if(O1!=="19.2.5")throw Error(i(527,O1,"19.2.5"));H.findDOMNode=function(r){var s=r._reactInternals;if(s===void 0)throw typeof r.render=="function"?Error(i(188)):(r=Object.keys(r).join(","),Error(i(268,r)));return r=h(s),r=r!==null?g(r):null,r=r===null?null:r.stateNode,r};var WM={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var bf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bf.isDisabled&&bf.supportsFiber)try{dn=bf.inject(WM),Mt=bf}catch{}}return Zc.createRoot=function(r,s){if(!a(r))throw Error(i(299));var u=!1,p="",x=$0,w=U0,A=F0;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(x=s.onUncaughtError),s.onCaughtError!==void 0&&(w=s.onCaughtError),s.onRecoverableError!==void 0&&(A=s.onRecoverableError)),s=w1(r,1,!1,null,null,u,p,null,x,w,A,D1),r[Xi]=s.current,ng(r),new wg(s)},Zc.hydrateRoot=function(r,s,u){if(!a(r))throw Error(i(299));var p=!1,x="",w=$0,A=U0,$=F0,W=null;return u!=null&&(u.unstable_strictMode===!0&&(p=!0),u.identifierPrefix!==void 0&&(x=u.identifierPrefix),u.onUncaughtError!==void 0&&(w=u.onUncaughtError),u.onCaughtError!==void 0&&(A=u.onCaughtError),u.onRecoverableError!==void 0&&($=u.onRecoverableError),u.formState!==void 0&&(W=u.formState)),s=w1(r,1,!0,s,u??null,p,x,W,w,A,$,D1),s.context=k1(null),u=s.current,p=ki(),p=Vt(p),x=za(p),x.callback=null,Pa(u,x,p),u=p,s.current.lanes=u,Ot(s,u),Sr(s),r[Xi]=s.current,ng(r),new yf(s)},Zc.version="19.2.5",Zc}var K1;function oD(){if(K1)return Ng.exports;K1=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ng.exports=lD(),Ng.exports}var cD=oD(),Yo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},el,cs,jo,eN,uD=(eN=class extends Yo{constructor(){super();Qe(this,el);Qe(this,cs);Qe(this,jo);Ie(this,jo,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){X(this,cs)||this.setEventListener(X(this,jo))}onUnsubscribe(){var t;this.hasListeners()||((t=X(this,cs))==null||t.call(this),Ie(this,cs,void 0))}setEventListener(t){var n;Ie(this,jo,t),(n=X(this,cs))==null||n.call(this),Ie(this,cs,t(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(t){X(this,el)!==t&&(Ie(this,el,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof X(this,el)=="boolean"?X(this,el):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},el=new WeakMap,cs=new WeakMap,jo=new WeakMap,eN),_b=new uD,dD={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},us,Nb,tN,fD=(tN=class{constructor(){Qe(this,us,dD);Qe(this,Nb,!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,Nb=new WeakMap,tN),Qs=new fD;function hD(e){setTimeout(e,0)}var pD=typeof window>"u"||"Deno"in globalThis;function ei(){}function mD(e,t){return typeof e=="function"?e(t):e}function Ny(e){return typeof e=="number"&&e>=0&&e!==1/0}function fN(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 G1(e,t){const{type:n="all",exact:i,fetchStatus:a,predicate:l,queryKey:o,stale:d}=e;if(o){if(i){if(t.queryHash!==jb(o,t.options))return!1}else if(!xu(t.queryKey,o))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof d=="boolean"&&t.isStale()!==d||a&&a!==t.state.fetchStatus||l&&!l(t))}function V1(e,t){const{exact:n,status:i,predicate:a,mutationKey:l}=e;if(l){if(!t.options.mutationKey)return!1;if(n){if(dl(t.options.mutationKey)!==dl(l))return!1}else if(!xu(t.options.mutationKey,l))return!1}return!(i&&t.state.status!==i||a&&!a(t))}function jb(e,t){return((t==null?void 0:t.queryKeyHashFn)||dl)(e)}function dl(e){return JSON.stringify(e,(t,n)=>_y(n)?Object.keys(n).sort().reduce((i,a)=>(i[a]=n[a],i),{}):n)}function xu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>xu(e[n],t[n])):!1}var gD=Object.prototype.hasOwnProperty;function hN(e,t,n=0){if(e===t)return e;if(n>500)return t;const i=Y1(e)&&Y1(t);if(!i&&!(_y(e)&&_y(t)))return t;const l=(i?e:Object.keys(e)).length,o=i?t:Object.keys(t),d=o.length,f=i?new Array(d):{};let h=0;for(let g=0;g<d;g++){const m=i?g:o[g],y=e[m],b=t[m];if(y===b){f[m]=y,(i?g<l:gD.call(e,m))&&h++;continue}if(y===null||b===null||typeof y!="object"||typeof b!="object"){f[m]=b;continue}const k=hN(y,b,n+1);f[m]=k,k===y&&h++}return l===d&&h===l?e:f}function oh(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Y1(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function _y(e){if(!Q1(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Q1(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Q1(e){return Object.prototype.toString.call(e)==="[object Object]"}function yD(e){return new Promise(t=>{Qs.setTimeout(t,e)})}function jy(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?hN(e,t):t}function bD(e,t,n=0){const i=[...e,t];return n&&i.length>n?i.slice(1):i}function xD(e,t,n=0){const i=[t,...e];return n&&i.length>n?i.slice(0,-1):i}var Cb=Symbol();function pN(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Cb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ab(e,t){return typeof e=="function"?e(...t):!!e}function vD(e,t,n){let i=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??(a=t()),i||(i=!0,a.aborted?n():a.addEventListener("abort",n,{once:!0})),a)}),e}var vu=(()=>{let e=()=>pD;return{isServer(){return e()},setIsServer(t){e=t}}})();function Cy(){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 wD=hD;function kD(){let e=[],t=0,n=d=>{d()},i=d=>{d()},a=wD;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=kD(),Co,ds,Ao,nN,ED=(nN=class extends Yo{constructor(){super();Qe(this,Co,!0);Qe(this,ds);Qe(this,Ao);Ie(this,Ao,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),i=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",i)}}})}onSubscribe(){X(this,ds)||this.setEventListener(X(this,Ao))}onUnsubscribe(){var t;this.hasListeners()||((t=X(this,ds))==null||t.call(this),Ie(this,ds,void 0))}setEventListener(t){var n;Ie(this,Ao,t),(n=X(this,ds))==null||n.call(this),Ie(this,ds,t(this.setOnline.bind(this)))}setOnline(t){X(this,Co)!==t&&(Ie(this,Co,t),this.listeners.forEach(i=>{i(t)}))}isOnline(){return X(this,Co)}},Co=new WeakMap,ds=new WeakMap,Ao=new WeakMap,nN),ch=new ED;function SD(e){return Math.min(1e3*2**e,3e4)}function mN(e){return(e??"online")==="online"?ch.isOnline():!0}var Ay=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function gN(e){let t=!1,n=0,i;const a=Cy(),l=()=>a.status!=="pending",o=v=>{var S;if(!l()){const E=new Ay(v);y(E),(S=e.onCancel)==null||S.call(e,E)}},d=()=>{t=!0},f=()=>{t=!1},h=()=>_b.isFocused()&&(e.networkMode==="always"||ch.isOnline())&&e.canRun(),g=()=>mN(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()||h())&&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??(vu.isServer()?0:3),N=e.retryDelay??SD,_=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),yD(_).then(()=>h()?void 0:b()).then(()=>{t?y(E):k()})})};return{promise:a,status:()=>a.status,cancel:o,continue:()=>(i==null||i(),a),cancelRetry:d,continueRetry:f,canStart:g,start:()=>(g()?k():b().then(k),a)}}var tl,iN,yN=(iN=class{constructor(){Qe(this,tl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ny(this.gcTime)&&Ie(this,tl,Qs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(vu.isServer()?1/0:300*1e3))}clearGcTimeout(){X(this,tl)!==void 0&&(Qs.clearTimeout(X(this,tl)),Ie(this,tl,void 0))}},tl=new WeakMap,iN),nl,To,Fi,il,On,Pu,rl,Si,bN,sa,rN,ND=(rN=class extends yN{constructor(t){super();Qe(this,Si);Qe(this,nl);Qe(this,To);Qe(this,Fi);Qe(this,il);Qe(this,On);Qe(this,Pu);Qe(this,rl);Ie(this,rl,!1),Ie(this,Pu,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ie(this,il,t.client),Ie(this,Fi,X(this,il).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ie(this,nl,X1(this.options)),this.state=t.state??X(this,nl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=X(this,On))==null?void 0:t.promise}setOptions(t){if(this.options={...X(this,Pu),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=X1(this.options);n.data!==void 0&&(this.setState(W1(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=jy(this.state.data,t,this.options);return ut(this,Si,sa).call(this,{data:i,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),i}setState(t,n){ut(this,Si,sa).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var i,a;const n=(i=X(this,On))==null?void 0:i.promise;return(a=X(this,On))==null||a.cancel(t),n?n.then(ei).catch(ei):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return X(this,nl)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>qi(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Cb||!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:!fN(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(i=>i.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=X(this,On))==null||n.continue()}onOnline(){var n;const t=this.observers.find(i=>i.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=X(this,On))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),X(this,Fi).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(X(this,On)&&(X(this,rl)||ut(this,Si,bN).call(this)?X(this,On).cancel({revert:!0}):X(this,On).cancelRetry()),this.scheduleGc()),X(this,Fi).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ut(this,Si,sa).call(this,{type:"invalidate"})}async fetch(t,n){var f,h,g,m,y,b,k,v,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 _=pN(this.options,n),M=(()=>{const R={client:X(this,il),queryKey:this.queryKey,meta:this.meta};return a(R),R})();return Ie(this,rl,!1),this.options.persister?this.options.persister(_,M,this):_(M)},d=(()=>{const _={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:X(this,il),state:this.state,fetchFn:l};return a(_),_})();(h=this.options.behavior)==null||h.onFetch(d,this),Ie(this,To,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=d.fetchOptions)==null?void 0:g.meta))&&ut(this,Si,sa).call(this,{type:"fetch",meta:(m=d.fetchOptions)==null?void 0:m.meta}),Ie(this,On,gN({initialPromise:n==null?void 0:n.initialPromise,fn:d.fetchFn,onCancel:_=>{_ instanceof Ay&&_.revert&&this.setState({...X(this,To),fetchStatus:"idle"}),i.abort()},onFail:(_,T)=>{ut(this,Si,sa).call(this,{type:"failed",failureCount:_,error:T})},onPause:()=>{ut(this,Si,sa).call(this,{type:"pause"})},onContinue:()=>{ut(this,Si,sa).call(this,{type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0}));try{const _=await X(this,On).start();if(_===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(_),(b=(y=X(this,Fi).config).onSuccess)==null||b.call(y,_,this),(v=(k=X(this,Fi).config).onSettled)==null||v.call(k,_,this.state.error,this),_}catch(_){if(_ instanceof Ay){if(_.silent)return X(this,On).promise;if(_.revert){if(this.state.data===void 0)throw _;return this.state.data}}throw ut(this,Si,sa).call(this,{type:"error",error:_}),(E=(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,To=new WeakMap,Fi=new WeakMap,il=new WeakMap,On=new WeakMap,Pu=new WeakMap,rl=new WeakMap,Si=new WeakSet,bN=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,...xN(i.data,this.options),fetchMeta:t.meta??null};case"success":const a={...i,...W1(t.data,t.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ie(this,To,t.manual?a:void 0),a;case"error":const l=t.error;return{...i,error:l,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:l,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...t.state}}};this.state=n(this.state),An.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),X(this,Fi).notify({query:this,type:"updated",action:t})})},rN);function xN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:mN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function W1(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function X1(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,i=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var ui,kt,Bu,Zn,al,Mo,la,fs,$u,Do,Oo,sl,ll,hs,Ro,Dt,ou,Ty,My,Dy,Oy,Ry,Ly,Iy,vN,aN,_D=(aN=class extends Yo{constructor(t,n){super();Qe(this,Dt);Qe(this,ui);Qe(this,kt);Qe(this,Bu);Qe(this,Zn);Qe(this,al);Qe(this,Mo);Qe(this,la);Qe(this,fs);Qe(this,$u);Qe(this,Do);Qe(this,Oo);Qe(this,sl);Qe(this,ll);Qe(this,hs);Qe(this,Ro,new Set);this.options=n,Ie(this,ui,t),Ie(this,fs,null),Ie(this,la,Cy()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(X(this,kt).addObserver(this),Z1(X(this,kt),this.options)?ut(this,Dt,ou).call(this):this.updateResult(),ut(this,Dt,Oy).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return zy(X(this,kt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return zy(X(this,kt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ut(this,Dt,Ry).call(this),ut(this,Dt,Ly).call(this),X(this,kt).removeObserver(this)}setOptions(t){const n=this.options,i=X(this,kt);if(this.options=X(this,ui).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof qi(this.options.enabled,X(this,kt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ut(this,Dt,Iy).call(this),X(this,kt).setOptions(this.options),n._defaulted&&!oh(this.options,n)&&X(this,ui).getQueryCache().notify({type:"observerOptionsUpdated",query:X(this,kt),observer:this});const a=this.hasListeners();a&&J1(X(this,kt),i,this.options,n)&&ut(this,Dt,ou).call(this),this.updateResult(),a&&(X(this,kt)!==i||qi(this.options.enabled,X(this,kt))!==qi(n.enabled,X(this,kt))||bs(this.options.staleTime,X(this,kt))!==bs(n.staleTime,X(this,kt)))&&ut(this,Dt,Ty).call(this);const l=ut(this,Dt,My).call(this);a&&(X(this,kt)!==i||qi(this.options.enabled,X(this,kt))!==qi(n.enabled,X(this,kt))||l!==X(this,hs))&&ut(this,Dt,Dy).call(this,l)}getOptimisticResult(t){const n=X(this,ui).getQueryCache().build(X(this,ui),t),i=this.createResult(n,t);return CD(this,i)&&(Ie(this,Zn,i),Ie(this,Mo,this.options),Ie(this,al,X(this,kt).state)),i}getCurrentResult(){return X(this,Zn)}trackResult(t,n){return new Proxy(t,{get:(i,a)=>(this.trackProp(a),n==null||n(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&X(this,la).status==="pending"&&X(this,la).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,a))})}trackProp(t){X(this,Ro).add(t)}getCurrentQuery(){return X(this,kt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=X(this,ui).defaultQueryOptions(t),i=X(this,ui).getQueryCache().build(X(this,ui),n);return i.fetch().then(()=>this.createResult(i,n))}fetch(t){return ut(this,Dt,ou).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),X(this,Zn)))}createResult(t,n){var B;const i=X(this,kt),a=this.options,l=X(this,Zn),o=X(this,al),d=X(this,Mo),h=t!==i?t.state:X(this,Bu),{state:g}=t;let m={...g},y=!1,b;if(n._optimisticResults){const U=this.hasListeners(),K=!U&&Z1(t,n),q=U&&J1(t,i,n,a);(K||q)&&(m={...m,...xN(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,Oo))==null?void 0:B.state.data,X(this,Oo)):n.placeholderData,U!==void 0&&(S="success",b=jy(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,$u))b=X(this,Do);else try{Ie(this,$u,n.select),b=n.select(b),b=jy(l==null?void 0:l.data,b,n),Ie(this,Do,b),Ie(this,fs,null)}catch(U){Ie(this,fs,U)}X(this,fs)&&(k=X(this,fs),b=X(this,Do),v=Date.now(),S="error");const C=m.fetchStatus==="fetching",N=S==="pending",_=S==="error",T=N&&C,M=b!==void 0,O={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>h.dataUpdateCount||m.errorUpdateCount>h.errorUpdateCount,isFetching:C,isRefetching:C&&!N,isLoadingError:_&&!M,isPaused:m.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:_&&M,isStale:Tb(t,n),refetch:this.refetch,promise:X(this,la),isEnabled:qi(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const U=O.data!==void 0,K=O.status==="error"&&!U,q=F=>{K?F.reject(O.error):U&&F.resolve(O.data)},Y=()=>{const F=Ie(this,la,O.promise=Cy());q(F)},D=X(this,la);switch(D.status){case"pending":t.queryHash===i.queryHash&&q(D);break;case"fulfilled":(K||O.data!==D.value)&&Y();break;case"rejected":(!K||O.error!==D.reason)&&Y();break}}return O}updateResult(){const t=X(this,Zn),n=this.createResult(X(this,kt),this.options);if(Ie(this,al,X(this,kt).state),Ie(this,Mo,this.options),X(this,al).data!==void 0&&Ie(this,Oo,X(this,kt)),oh(n,t))return;Ie(this,Zn,n);const i=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,l=typeof a=="function"?a():a;if(l==="all"||!l&&!X(this,Ro).size)return!0;const o=new Set(l??X(this,Ro));return this.options.throwOnError&&o.add("error"),Object.keys(X(this,Zn)).some(d=>{const f=d;return X(this,Zn)[f]!==t[f]&&o.has(f)})};ut(this,Dt,vN).call(this,{listeners:i()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ut(this,Dt,Oy).call(this)}},ui=new WeakMap,kt=new WeakMap,Bu=new WeakMap,Zn=new WeakMap,al=new WeakMap,Mo=new WeakMap,la=new WeakMap,fs=new WeakMap,$u=new WeakMap,Do=new WeakMap,Oo=new WeakMap,sl=new WeakMap,ll=new WeakMap,hs=new WeakMap,Ro=new WeakMap,Dt=new WeakSet,ou=function(t){ut(this,Dt,Iy).call(this);let n=X(this,kt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(ei)),n},Ty=function(){ut(this,Dt,Ry).call(this);const t=bs(this.options.staleTime,X(this,kt));if(vu.isServer()||X(this,Zn).isStale||!Ny(t))return;const i=fN(X(this,Zn).dataUpdatedAt,t)+1;Ie(this,sl,Qs.setTimeout(()=>{X(this,Zn).isStale||this.updateResult()},i))},My=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(X(this,kt)):this.options.refetchInterval)??!1},Dy=function(t){ut(this,Dt,Ly).call(this),Ie(this,hs,t),!(vu.isServer()||qi(this.options.enabled,X(this,kt))===!1||!Ny(X(this,hs))||X(this,hs)===0)&&Ie(this,ll,Qs.setInterval(()=>{(this.options.refetchIntervalInBackground||_b.isFocused())&&ut(this,Dt,ou).call(this)},X(this,hs)))},Oy=function(){ut(this,Dt,Ty).call(this),ut(this,Dt,Dy).call(this,ut(this,Dt,My).call(this))},Ry=function(){X(this,sl)!==void 0&&(Qs.clearTimeout(X(this,sl)),Ie(this,sl,void 0))},Ly=function(){X(this,ll)!==void 0&&(Qs.clearInterval(X(this,ll)),Ie(this,ll,void 0))},Iy=function(){const t=X(this,ui).getQueryCache().build(X(this,ui),this.options);if(t===X(this,kt))return;const n=X(this,kt);Ie(this,kt,t),Ie(this,Bu,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},vN=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"})})},aN);function jD(e,t){return qi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Z1(e,t){return jD(e,t)||e.state.data!==void 0&&zy(e,t,t.refetchOnMount)}function zy(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&&Tb(e,t)}return!1}function J1(e,t,n,i){return(e!==t||qi(i.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Tb(e,n)}function Tb(e,t){return qi(t.enabled,e)!==!1&&e.isStaleByTime(bs(t.staleTime,e))}function CD(e,t){return!oh(e.getCurrentResult(),t)}function ek(e){return{onFetch:(t,n)=>{var g,m,y,b,k;const i=t.options,a=(y=(m=(g=t.fetchOptions)==null?void 0:g.meta)==null?void 0:m.fetchMore)==null?void 0:y.direction,l=((b=t.state.data)==null?void 0:b.pages)||[],o=((k=t.state.data)==null?void 0:k.pageParams)||[];let d={pages:[],pageParams:[]},f=0;const h=async()=>{let v=!1;const S=N=>{vD(N,()=>t.signal,()=>v=!0)},E=pN(t.options,t.fetchOptions),C=async(N,_,T)=>{if(v)return Promise.reject();if(_==null&&N.pages.length)return Promise.resolve(N);const R=(()=>{const K={client:t.client,queryKey:t.queryKey,pageParam:_,direction:T?"backward":"forward",meta:t.options.meta};return S(K),K})(),O=await E(R),{maxPages:B}=t.options,U=T?xD:bD;return{pages:U(N.pages,O,B),pageParams:U(N.pageParams,_,B)}};if(a&&l.length){const N=a==="backward",_=N?AD:tk,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:tk(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,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=h}}}function tk(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 AD(e,{pages:t,pageParams:n}){var i;return t.length>0?(i=e.getPreviousPageParam)==null?void 0:i.call(e,t[0],t,n[0],n):void 0}var Uu,Cr,Kn,ol,Ar,ss,sN,TD=(sN=class extends yN{constructor(t){super();Qe(this,Ar);Qe(this,Uu);Qe(this,Cr);Qe(this,Kn);Qe(this,ol);Ie(this,Uu,t.client),this.mutationId=t.mutationId,Ie(this,Kn,t.mutationCache),Ie(this,Cr,[]),this.state=t.state||wN(),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,h,g,m,y,b,k,v,S,E,C,N,_,T,M,R;const n=()=>{ut(this,Ar,ss).call(this,{type:"continue"})},i={client:X(this,Uu),meta:this.options.meta,mutationKey:this.options.mutationKey};Ie(this,ol,gN({fn:()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(new Error("No mutationFn found")),onFail:(O,B)=>{ut(this,Ar,ss).call(this,{type:"failed",failureCount:O,error:B})},onPause:()=>{ut(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{ut(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&&ut(this,Ar,ss).call(this,{type:"pending",context:B,variables:t,isPaused:l})}const O=await X(this,ol).start();return await((h=(f=X(this,Kn).config).onSuccess)==null?void 0:h.call(f,O,t,this.state.context,this,i)),await((m=(g=this.options).onSuccess)==null?void 0:m.call(g,O,t,this.state.context,i)),await((b=(y=X(this,Kn).config).onSettled)==null?void 0:b.call(y,O,null,this.state.variables,this.state.context,this,i)),await((v=(k=this.options).onSettled)==null?void 0:v.call(k,O,null,t,this.state.context,i)),ut(this,Ar,ss).call(this,{type:"success",data:O}),O}catch(O){try{await((E=(S=X(this,Kn).config).onError)==null?void 0:E.call(S,O,t,this.state.context,this,i))}catch(B){Promise.reject(B)}try{await((N=(C=this.options).onError)==null?void 0:N.call(C,O,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,O,this.state.variables,this.state.context,this,i))}catch(B){Promise.reject(B)}try{await((R=(M=this.options).onSettled)==null?void 0:R.call(M,void 0,O,t,this.state.context,i))}catch(B){Promise.reject(B)}throw ut(this,Ar,ss).call(this,{type:"error",error:O}),O}finally{X(this,Kn).runNext(this)}}},Uu=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})})},sN);function wN(){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,Fu,lN,MD=(lN=class extends Yo{constructor(t={}){super();Qe(this,oa);Qe(this,sr);Qe(this,Fu);this.config=t,Ie(this,oa,new Set),Ie(this,sr,new Map),Ie(this,Fu,0)}build(t,n,i){const a=new TD({client:t,mutationCache:this,mutationId:++xf(this,Fu)._,options:t.defaultMutationOptions(n),state:i});return this.add(a),a}add(t){X(this,oa).add(t);const n=vf(t);if(typeof n=="string"){const i=X(this,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=vf(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=vf(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=vf(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=>V1(n,i))}findAll(t={}){return this.getAll().filter(n=>V1(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,Fu=new WeakMap,lN);function vf(e){var t;return(t=e.options.scope)==null?void 0:t.id}var ca,ps,di,ua,ma,Qf,Py,oN,DD=(oN=class extends Yo{constructor(n,i){super();Qe(this,ma);Qe(this,ca);Qe(this,ps);Qe(this,di);Qe(this,ua);Ie(this,ca,n),this.setOptions(i),this.bindMethods(),ut(this,ma,Qf).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var a;const i=this.options;this.options=X(this,ca).defaultMutationOptions(n),oh(this.options,i)||X(this,ca).getMutationCache().notify({type:"observerOptionsUpdated",mutation:X(this,di),observer:this}),i!=null&&i.mutationKey&&this.options.mutationKey&&dl(i.mutationKey)!==dl(this.options.mutationKey)?this.reset():((a=X(this,di))==null?void 0:a.state.status)==="pending"&&X(this,di).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=X(this,di))==null||n.removeObserver(this)}onMutationUpdate(n){ut(this,ma,Qf).call(this),ut(this,ma,Py).call(this,n)}getCurrentResult(){return X(this,ps)}reset(){var n;(n=X(this,di))==null||n.removeObserver(this),Ie(this,di,void 0),ut(this,ma,Qf).call(this),ut(this,ma,Py).call(this)}mutate(n,i){var a;return Ie(this,ua,i),(a=X(this,di))==null||a.removeObserver(this),Ie(this,di,X(this,ca).getMutationCache().build(X(this,ca),this.options)),X(this,di).addObserver(this),X(this,di).execute(n)}},ca=new WeakMap,ps=new WeakMap,di=new WeakMap,ua=new WeakMap,ma=new WeakSet,Qf=function(){var i;const n=((i=X(this,di))==null?void 0:i.state)??wN();Ie(this,ps,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Py=function(n){An.batch(()=>{var i,a,l,o,d,f,h,g;if(X(this,ua)&&this.hasListeners()){const m=X(this,ps).variables,y=X(this,ps).context,b={client:X(this,ca),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(a=(i=X(this,ua)).onSuccess)==null||a.call(i,n.data,m,y,b)}catch(k){Promise.reject(k)}try{(o=(l=X(this,ua)).onSettled)==null||o.call(l,n.data,null,m,y,b)}catch(k){Promise.reject(k)}}else if((n==null?void 0:n.type)==="error"){try{(f=(d=X(this,ua)).onError)==null||f.call(d,n.error,m,y,b)}catch(k){Promise.reject(k)}try{(g=(h=X(this,ua)).onSettled)==null||g.call(h,void 0,n.error,m,y,b)}catch(k){Promise.reject(k)}}}this.listeners.forEach(m=>{m(X(this,ps))})})},oN),Tr,cN,OD=(cN=class extends Yo{constructor(t={}){super();Qe(this,Tr);this.config=t,Ie(this,Tr,new Map)}build(t,n,i){const a=n.queryKey,l=n.queryHash??jb(a,n);let o=this.get(l);return o||(o=new ND({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=>G1(n,i))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(i=>G1(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,cN),mn,ms,gs,Lo,Io,ys,zo,Po,uN,RD=(uN=class{constructor(e={}){Qe(this,mn);Qe(this,ms);Qe(this,gs);Qe(this,Lo);Qe(this,Io);Qe(this,ys);Qe(this,zo);Qe(this,Po);Ie(this,mn,e.queryCache||new OD),Ie(this,ms,e.mutationCache||new MD),Ie(this,gs,e.defaultOptions||{}),Ie(this,Lo,new Map),Ie(this,Io,new Map),Ie(this,ys,0)}mount(){xf(this,ys)._++,X(this,ys)===1&&(Ie(this,zo,_b.subscribe(async e=>{e&&(await this.resumePausedMutations(),X(this,mn).onFocus())})),Ie(this,Po,ch.subscribe(async e=>{e&&(await this.resumePausedMutations(),X(this,mn).onOnline())})))}unmount(){var e,t;xf(this,ys)._--,X(this,ys)===0&&((e=X(this,zo))==null||e.call(this),Ie(this,zo,void 0),(t=X(this,Po))==null||t.call(this),Ie(this,Po,void 0))}isFetching(e){return X(this,mn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return X(this,ms).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=X(this,mn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=X(this,mn).build(this,t),i=n.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(bs(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return X(this,mn).findAll(e).map(({queryKey:t,state:n})=>{const i=n.data;return[t,i]})}setQueryData(e,t,n){const i=this.defaultQueryOptions({queryKey:e}),a=X(this,mn).get(i.queryHash),l=a==null?void 0:a.state.data,o=mD(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=ek(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ei).catch(ei)}ensureInfiniteQueryData(e){return e.behavior=ek(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ch.isOnline()?X(this,ms).resumePausedMutations():Promise.resolve()}getQueryCache(){return X(this,mn)}getMutationCache(){return X(this,ms)}getDefaultOptions(){return X(this,gs)}setDefaultOptions(e){Ie(this,gs,e)}setQueryDefaults(e,t){X(this,Lo).set(dl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...X(this,Lo).values()],n={};return t.forEach(i=>{xu(e,i.queryKey)&&Object.assign(n,i.defaultOptions)}),n}setMutationDefaults(e,t){X(this,Io).set(dl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...X(this,Io).values()],n={};return t.forEach(i=>{xu(e,i.mutationKey)&&Object.assign(n,i.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...X(this,gs).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=jb(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===Cb&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...X(this,gs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){X(this,mn).clear(),X(this,ms).clear()}},mn=new WeakMap,ms=new WeakMap,gs=new WeakMap,Lo=new WeakMap,Io=new WeakMap,ys=new WeakMap,zo=new WeakMap,Po=new WeakMap,uN),kN=j.createContext(void 0),Ft=e=>{const t=j.useContext(kN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},LD=({client:e,children:t})=>(j.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(kN.Provider,{value:e,children:t})),EN=j.createContext(!1),ID=()=>j.useContext(EN);EN.Provider;function zD(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var PD=j.createContext(zD()),BD=()=>j.useContext(PD),$D=(e,t,n)=>{const i=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Ab(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||i)&&(t.isReset()||(e.retryOnMount=!1))},UD=e=>{j.useEffect(()=>{e.clearReset()},[e])},FD=({result:e,errorResetBoundary:t,throwOnError:n,query:i,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(a&&e.data===void 0||Ab(n,[e.error,i])),qD=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))}},HD=(e,t)=>e.isLoading&&e.isFetching&&!t,KD=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,nk=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function GD(e,t,n){var y,b,k,v;const i=ID(),a=BD(),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",qD(o),$D(o,a,d),UD(a);const f=!l.getQueryCache().get(o.queryHash),[h]=j.useState(()=>new t(l,o)),g=h.getOptimisticResult(o),m=!i&&e.subscribed!==!1;if(j.useSyncExternalStore(j.useCallback(S=>{const E=m?h.subscribe(An.batchCalls(S)):ei;return h.updateResult(),E},[h,m]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),j.useEffect(()=>{h.setOptions(o)},[o,h]),KD(o,g))throw nk(o,h,a);if(FD({result:g,errorResetBoundary:a,throwOnError:o.throwOnError,query:d,suspense:o.suspense}))throw g.error;if((v=(k=l.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||v.call(k,o,g),o.experimental_prefetchInRender&&!vu.isServer()&&HD(g,i)){const S=f?nk(o,h,a):d==null?void 0:d.promise;S==null||S.catch(ei).finally(()=>{h.updateResult()})}return o.notifyOnChangeProps?g:h.trackResult(g)}function Ye(e,t){return GD(e,_D)}function Et(e,t){const n=Ft(),[i]=j.useState(()=>new DD(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&&Ab(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 ik="popstate";function rk(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function VD(e={}){function t(i,a){var h;let l=(h=a.state)==null?void 0:h.masked,{pathname:o,search:d,hash:f}=l||i.location;return By("",{pathname:o,search:d,hash:f},a.state&&a.state.usr||null,a.state&&a.state.key||"default",l?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function n(i,a){return typeof a=="string"?a:wu(a)}return QD(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 YD(){return Math.random().toString(36).substring(2,10)}function ak(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 By(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||YD(),unstable_mask:a}}function wu({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Qo(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let i=e.indexOf("?");i>=0&&(t.search=e.substring(i),e=e.substring(0,i)),e&&(t.pathname=e)}return t}function QD(e,t,n,i={}){let{window:a=document.defaultView,v5Compat:l=!1}=i,o=a.history,d="POP",f=null,h=g();h==null&&(h=0,o.replaceState({...o.state,idx:h},""));function g(){return(o.state||{idx:null}).idx}function m(){d="POP";let S=g(),E=S==null?null:S-h;h=S,f&&f({action:d,location:v.location,delta:E})}function y(S,E){d="PUSH";let C=rk(S)?S:By(v.location,S,E);h=g()+1;let N=ak(C,h),_=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=rk(S)?S:By(v.location,S,E);h=g();let N=ak(C,h),_=v.createHref(C.unstable_mask||C);o.replaceState(N,"",_),l&&f&&f({action:d,location:v.location,delta:0})}function k(S){return WD(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(ik,m),f=S,()=>{a.removeEventListener(ik,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 WD(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Jt(n,"No window.location.(origin|href) available to create URL");let i=typeof e=="string"?e:wu(e);return i=i.replace(/ $/,"%20"),!t&&i.startsWith("//")&&(i=n+i),new URL(i,n)}function SN(e,t,n="/"){return XD(e,t,n,!1)}function XD(e,t,n,i){let a=typeof t=="string"?Qo(t):t,l=ga(a.pathname||"/",n);if(l==null)return null;let o=NN(e);ZD(o);let d=null;for(let f=0;d==null&&f<o.length;++f){let h=cO(l);d=lO(o[f],h,i)}return d}function NN(e,t=[],n=[],i="",a=!1){let l=(o,d,f=a,h)=>{let g={relativePath:h===void 0?o.path||"":h,caseSensitive:o.caseSensitive===!0,childrenIndex:d,route:o};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(i)&&f)return;Jt(g.relativePath.startsWith(i),`Absolute route path "${g.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(i.length)}let m=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}".`),NN(o.children,t,y,m,f)),!(o.path==null&&!o.index)&&t.push({path:m,score:aO(m,o.index),routesMeta:y})};return e.forEach((o,d)=>{var f;if(o.path===""||!((f=o.path)!=null&&f.includes("?")))l(o,d);else for(let h of _N(o.path))l(o,d,!0,h)}),t}function _N(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=_N(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 ZD(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:sO(t.routesMeta.map(i=>i.childrenIndex),n.routesMeta.map(i=>i.childrenIndex)))}var JD=/^:[\w-]+$/,eO=3,tO=2,nO=1,iO=10,rO=-2,sk=e=>e==="*";function aO(e,t){let n=e.split("/"),i=n.length;return n.some(sk)&&(i+=rO),t&&(i+=tO),n.filter(a=>!sk(a)).reduce((a,l)=>a+(JD.test(l)?eO:l===""?nO:iO),i)}function sO(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 lO(e,t,n=!1){let{routesMeta:i}=e,a={},l="/",o=[];for(let d=0;d<i.length;++d){let f=i[d],h=d===i.length-1,g=l==="/"?t:t.slice(l.length)||"/",m=uh({path:f.relativePath,caseSensitive:f.caseSensitive,end:h},g),y=f.route;if(!m&&h&&n&&!i[i.length-1].route.index&&(m=uh({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},g)),!m)return null;Object.assign(a,m.params),o.push({params:a,pathname:dr([l,m.pathname]),pathnameBase:hO(dr([l,m.pathnameBase])),route:y}),m.pathnameBase!=="/"&&(l=dr([l,m.pathnameBase]))}return o}function uh(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,i]=oO(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let l=a[0],o=l.replace(/(.)\/+$/,"$1"),d=a.slice(1);return{params:i.reduce((h,{paramName:g,isOptional:m},y)=>{if(g==="*"){let k=d[y]||"";o=l.slice(0,l.length-k.length).replace(/(.)\/+$/,"$1")}const b=d[y];return m&&!b?h[g]=void 0:h[g]=(b||"").replace(/%2F/g,"/"),h},{}),pathname:l,pathnameBase:o,pattern:e}}function oO(e,t=!1,n=!0){Gi(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let i=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,d,f,h,g)=>{if(i.push({paramName:d,isOptional:f!=null}),f){let m=g.charAt(h+o.length);return m&&m!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(i.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),i]}function cO(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 uO=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function dO(e,t="/"){let{pathname:n,search:i="",hash:a=""}=typeof e=="string"?Qo(e):e,l;return n?(n=jN(n),n.startsWith("/")?l=lk(n.substring(1),"/"):l=lk(n,t)):l=t,{pathname:l,search:pO(i),hash:mO(a)}}function lk(e,t){let n=dh(t).split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Ag(e,t,n,i){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function fO(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Mb(e){let t=fO(e);return t.map((n,i)=>i===t.length-1?n.pathname:n.pathnameBase)}function zh(e,t,n,i=!1){let a;typeof e=="string"?a=Qo(e):(a={...e},Jt(!a.pathname||!a.pathname.includes("?"),Ag("?","pathname","search",a)),Jt(!a.pathname||!a.pathname.includes("#"),Ag("#","pathname","hash",a)),Jt(!a.search||!a.search.includes("#"),Ag("#","search","hash",a)));let l=e===""||a.pathname==="",o=l?"/":a.pathname,d;if(o==null)d=n;else{let m=t.length-1;if(!i&&o.startsWith("..")){let y=o.split("/");for(;y[0]==="..";)y.shift(),m-=1;a.pathname=y.join("/")}d=m>=0?t[m]:"/"}let f=dO(a,d),h=o&&o!=="/"&&o.endsWith("/"),g=(l||o===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(h||g)&&(f.pathname+="/"),f}var jN=e=>e.replace(/\/\/+/g,"/"),dr=e=>jN(e.join("/")),dh=e=>e.replace(/\/+$/,""),hO=e=>dh(e).replace(/^\/*/,"/"),pO=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,mO=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,gO=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 yO(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function bO(e){let t=e.map(n=>n.route.path).filter(Boolean);return dr(t)||"/"}var CN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function AN(e,t){let n=e;if(typeof n!="string"||!uO.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let i=n,a=!1;if(CN)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 TN=["POST","PUT","PATCH","DELETE"];new Set(TN);var xO=["GET",...TN];new Set(xO);var Wo=j.createContext(null);Wo.displayName="DataRouter";var Ph=j.createContext(null);Ph.displayName="DataRouterState";var MN=j.createContext(!1);function vO(){return j.useContext(MN)}var DN=j.createContext({isTransitioning:!1});DN.displayName="ViewTransition";var wO=j.createContext(new Map);wO.displayName="Fetchers";var kO=j.createContext(null);kO.displayName="Await";var Ai=j.createContext(null);Ai.displayName="Navigation";var Ku=j.createContext(null);Ku.displayName="Location";var Qi=j.createContext({outlet:null,matches:[],isDataRoute:!1});Qi.displayName="Route";var Db=j.createContext(null);Db.displayName="RouteError";var ON="REACT_ROUTER_ERROR",EO="REDIRECT",SO="ROUTE_ERROR_RESPONSE";function NO(e){if(e.startsWith(`${ON}:${EO}:{`))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 _O(e){if(e.startsWith(`${ON}:${SO}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new gO(t.status,t.statusText,t.data)}catch{}}function jO(e,{relative:t}={}){Jt(Xo(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:i}=j.useContext(Ai),{hash:a,pathname:l,search:o}=Gu(e,{relative:t}),d=l;return n!=="/"&&(d=l==="/"?n:dr([n,l])),i.createHref({pathname:d,search:o,hash:a})}function Xo(){return j.useContext(Ku)!=null}function pr(){return Jt(Xo(),"useLocation() may be used only in the context of a <Router> component."),j.useContext(Ku).location}var RN="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function LN(e){j.useContext(Ai).static||j.useLayoutEffect(e)}function ks(){let{isDataRoute:e}=j.useContext(Qi);return e?FO():CO()}function CO(){Jt(Xo(),"useNavigate() may be used only in the context of a <Router> component.");let e=j.useContext(Wo),{basename:t,navigator:n}=j.useContext(Ai),{matches:i}=j.useContext(Qi),{pathname:a}=pr(),l=JSON.stringify(Mb(i)),o=j.useRef(!1);return LN(()=>{o.current=!0}),j.useCallback((f,h={})=>{if(Gi(o.current,RN),!o.current)return;if(typeof f=="number"){n.go(f);return}let g=zh(f,JSON.parse(l),a,h.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:dr([t,g.pathname])),(h.replace?n.replace:n.push)(g,h.state,h)},[t,n,l,a,e])}var AO=j.createContext(null);function TO(e){let t=j.useContext(Qi).outlet;return j.useMemo(()=>t&&j.createElement(AO.Provider,{value:e},t),[t,e])}function Ob(){let{matches:e}=j.useContext(Qi),t=e[e.length-1];return(t==null?void 0:t.params)??{}}function Gu(e,{relative:t}={}){let{matches:n}=j.useContext(Qi),{pathname:i}=pr(),a=JSON.stringify(Mb(n));return j.useMemo(()=>zh(e,JSON.parse(a),i,t==="path"),[e,a,i,t])}function MO(e,t){return IN(e,t)}function IN(e,t,n){var S;Jt(Xo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=j.useContext(Ai),{matches:a}=j.useContext(Qi),l=a[a.length-1],o=l?l.params:{},d=l?l.pathname:"/",f=l?l.pathnameBase:"/",h=l&&l.route;{let E=h&&h.path||"";PN(d,!h||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${E}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
-
|
|
60
|
-
Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let g=pr(),m;if(t){let E=typeof t=="string"?Qo(t):t;Jt(f==="/"||((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=SN(e,{pathname:b});Gi(h||k!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),Gi(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let v=IO(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(Ku.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...m},navigationType:"POP"}},v):v}function DO(){let e=UO(),t=yO(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 OO=j.createElement(DO,null),zN=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=_O(e.digest);n&&(e=n)}let t=e!==void 0?j.createElement(Qi.Provider,{value:this.props.routeContext},j.createElement(Db.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?j.createElement(RO,{error:e},t):t}};zN.contextType=MN;var Tg=new WeakMap;function RO({children:e,error:t}){let{basename:n}=j.useContext(Ai);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let i=NO(t.digest);if(i){let a=Tg.get(t);if(a)throw a;let l=AN(i.location,n);if(CN&&!Tg.get(t))if(l.isExternal||i.reloadDocument)window.location.href=l.absoluteURL||l.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:i.replace}));throw Tg.set(t,o),o}return j.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function LO({routeContext:e,match:t,children:n}){let i=j.useContext(Wo);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),j.createElement(Qi.Provider,{value:e},n)}function IO(e,t=[],n){let i=n==null?void 0:n.state;if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(t.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let a=e,l=i==null?void 0:i.errors;if(l!=null){let g=a.findIndex(m=>m.route.id&&(l==null?void 0:l[m.route.id])!==void 0);Jt(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),a=a.slice(0,Math.min(a.length,g+1))}let o=!1,d=-1;if(n&&i){o=i.renderFallback;for(let g=0;g<a.length;g++){let m=a[g];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(d=g),m.route.id){let{loaderData:y,errors:b}=i,k=m.route.loader&&!y.hasOwnProperty(m.route.id)&&(!b||b[m.route.id]===void 0);if(m.route.lazy||k){n.isStatic&&(o=!0),d>=0?a=a.slice(0,d+1):a=[a[0]];break}}}}let f=n==null?void 0:n.onError,h=i&&f?(g,m)=>{var y,b;f(g,{location:i.location,params:((b=(y=i.matches)==null?void 0:y[0])==null?void 0:b.params)??{},unstable_pattern:bO(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||OO,o&&(d<0&&y===0?(PN("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(LO,{match:m,routeContext:{outlet:g,matches:E,isDataRoute:i!=null},children:N})};return i&&(m.route.ErrorBoundary||m.route.errorElement||y===0)?j.createElement(zN,{location:i.location,revalidation:i.revalidation,component:v,error:b,children:C(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:h}):C()},null)}function Rb(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function zO(e){let t=j.useContext(Wo);return Jt(t,Rb(e)),t}function PO(e){let t=j.useContext(Ph);return Jt(t,Rb(e)),t}function BO(e){let t=j.useContext(Qi);return Jt(t,Rb(e)),t}function Lb(e){let t=BO(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 $O(){return Lb("useRouteId")}function UO(){var i;let e=j.useContext(Db),t=PO("useRouteError"),n=Lb("useRouteError");return e!==void 0?e:(i=t.errors)==null?void 0:i[n]}function FO(){let{router:e}=zO("useNavigate"),t=Lb("useNavigate"),n=j.useRef(!1);return LN(()=>{n.current=!0}),j.useCallback(async(a,l={})=>{Gi(n.current,RN),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...l}))},[e,t])}var ok={};function PN(e,t,n){!t&&!ok[e]&&(ok[e]=!0,Gi(!1,n))}j.memo(qO);function qO({routes:e,future:t,state:n,isStatic:i,onError:a}){return IN(e,void 0,{state:n,isStatic:i,onError:a})}function HO({to:e,replace:t,state:n,relative:i}){Jt(Xo(),"<Navigate> may be used only in the context of a <Router> component.");let{static:a}=j.useContext(Ai);Gi(!a,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:l}=j.useContext(Qi),{pathname:o}=pr(),d=ks(),f=zh(e,Mb(l),o,i==="path"),h=JSON.stringify(f);return j.useEffect(()=>{d(JSON.parse(h),{replace:t,state:n,relative:i})},[d,h,i,t,n]),null}function KO(e){return TO(e.context)}function Cn(e){Jt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function GO({basename:e="/",children:t=null,location:n,navigationType:i="POP",navigator:a,static:l=!1,unstable_useTransitions:o}){Jt(!Xo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),f=j.useMemo(()=>({basename:d,navigator:a,static:l,unstable_useTransitions:o,future:{}}),[d,a,l,o]);typeof n=="string"&&(n=Qo(n));let{pathname:h="/",search:g="",hash:m="",state:y=null,key:b="default",unstable_mask:k}=n,v=j.useMemo(()=>{let S=ga(h,d);return S==null?null:{location:{pathname:S,search:g,hash:m,state:y,key:b,unstable_mask:k},navigationType:i}},[d,h,g,m,y,b,i,k]);return Gi(v!=null,`<Router basename="${d}"> is not able to match the URL "${h}${g}${m}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:j.createElement(Ai.Provider,{value:f},j.createElement(Ku.Provider,{children:t,value:v}))}function VO({children:e,location:t}){return MO($y(e),t)}function $y(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,$y(i.props.children,l));return}Jt(i.type===Cn,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Jt(!i.props.index||!i.props.children,"An index route cannot have child routes.");let o={id:i.props.id||l.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(o.children=$y(i.props.children,l)),n.push(o)}),n}var Wf="get",Xf="application/x-www-form-urlencoded";function Bh(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function YO(e){return Bh(e)&&e.tagName.toLowerCase()==="button"}function QO(e){return Bh(e)&&e.tagName.toLowerCase()==="form"}function WO(e){return Bh(e)&&e.tagName.toLowerCase()==="input"}function XO(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ZO(e,t){return e.button===0&&(!t||t==="_self")&&!XO(e)}function Uy(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 JO(e,t){let n=Uy(e);return t&&t.forEach((i,a)=>{n.has(a)||t.getAll(a).forEach(l=>{n.append(a,l)})}),n}var wf=null;function eR(){if(wf===null)try{new FormData(document.createElement("form"),0),wf=!1}catch{wf=!0}return wf}var tR=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Mg(e){return e!=null&&!tR.has(e)?(Gi(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Xf}"`),null):e}function nR(e,t){let n,i,a,l,o;if(QO(e)){let d=e.getAttribute("action");i=d?ga(d,t):null,n=e.getAttribute("method")||Wf,a=Mg(e.getAttribute("enctype"))||Xf,l=new FormData(e)}else if(YO(e)||WO(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||d.getAttribute("action");if(i=f?ga(f,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||Wf,a=Mg(e.getAttribute("formenctype"))||Mg(d.getAttribute("enctype"))||Xf,l=new FormData(d,e),!eR()){let{name:h,type:g,value:m}=e;if(g==="image"){let y=h?`${h}.`:"";l.append(`${y}x`,"0"),l.append(`${y}y`,"0")}else h&&l.append(h,m)}}else{if(Bh(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Wf,i=null,a=Xf,o=e}return l&&a==="text/plain"&&(o=l,l=void 0),{action:i,method:n.toLowerCase(),encType:a,formData:l,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ib(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function BN(e,t,n,i){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${i}`:a.pathname=`${a.pathname}.${i}`:a.pathname==="/"?a.pathname=`_root.${i}`:t&&ga(a.pathname,t)==="/"?a.pathname=`${dh(t)}/_root.${i}`:a.pathname=`${dh(a.pathname)}.${i}`,a}async function iR(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 rR(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 aR(e,t,n){let i=await Promise.all(e.map(async a=>{let l=t.routes[a.route.id];if(l){let o=await iR(l,n);return o.links?o.links():[]}return[]}));return cR(i.flat(1).filter(rR).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function ck(e,t,n,i,a,l){let o=(f,h)=>n[h]?f.route.id!==n[h].route.id:!0,d=(f,h)=>{var g;return n[h].pathname!==f.pathname||((g=n[h].route.path)==null?void 0:g.endsWith("*"))&&n[h].params["*"]!==f.params["*"]};return l==="assets"?t.filter((f,h)=>o(f,h)||d(f,h)):l==="data"?t.filter((f,h)=>{var m;let g=i.routes[f.route.id];if(!g||!g.hasLoader)return!1;if(o(f,h)||d(f,h))return!0;if(f.route.shouldRevalidate){let y=f.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((m=n[0])==null?void 0:m.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function sR(e,t,{includeHydrateFallback:n}={}){return lR(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 lR(e){return[...new Set(e)]}function oR(e){let t={},n=Object.keys(e).sort();for(let i of n)t[i]=e[i];return t}function cR(e,t){let n=new Set;return new Set(t),e.reduce((i,a)=>{let l=JSON.stringify(oR(a));return n.has(l)||(n.add(l),i.push({key:l,link:a})),i},[])}function zb(){let e=j.useContext(Wo);return Ib(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function uR(){let e=j.useContext(Ph);return Ib(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Pb=j.createContext(void 0);Pb.displayName="FrameworkContext";function Bb(){let e=j.useContext(Pb);return Ib(e,"You must render this element inside a <HydratedRouter> element"),e}function dR(e,t){let n=j.useContext(Pb),[i,a]=j.useState(!1),[l,o]=j.useState(!1),{onFocus:d,onBlur:f,onMouseEnter:h,onMouseLeave:g,onTouchStart:m}=t,y=j.useRef(null);j.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let v=E=>{E.forEach(C=>{o(C.isIntersecting)})},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:Jc(d,b),onBlur:Jc(f,k),onMouseEnter:Jc(h,b),onMouseLeave:Jc(g,k),onTouchStart:Jc(m,b)}]:[!1,y,{}]}function Jc(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function fR({page:e,...t}){let n=vO(),{router:i}=zb(),a=j.useMemo(()=>SN(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?n?j.createElement(pR,{page:e,matches:a,...t}):j.createElement(mR,{page:e,matches:a,...t}):null}function hR(e){let{manifest:t,routeModules:n}=Bb(),[i,a]=j.useState([]);return j.useEffect(()=>{let l=!1;return aR(e,t,n).then(o=>{l||a(o)}),()=>{l=!0}},[e,t,n]),i}function pR({page:e,matches:t,...n}){let i=pr(),{future:a}=Bb(),{basename:l}=zb(),o=j.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let d=BN(e,l,a.unstable_trailingSlashAwareDataRequests,"rsc"),f=!1,h=[];for(let g of t)typeof g.route.shouldRevalidate=="function"?f=!0:h.push(g.route.id);return f&&h.length>0&&d.searchParams.set("_routes",h.join(",")),[d.pathname+d.search]},[l,a.unstable_trailingSlashAwareDataRequests,e,i,t]);return j.createElement(j.Fragment,null,o.map(d=>j.createElement("link",{key:d,rel:"prefetch",as:"fetch",href:d,...n})))}function mR({page:e,matches:t,...n}){let i=pr(),{future:a,manifest:l,routeModules:o}=Bb(),{basename:d}=zb(),{loaderData:f,matches:h}=uR(),g=j.useMemo(()=>ck(e,t,h,l,i,"data"),[e,t,h,l,i]),m=j.useMemo(()=>ck(e,t,h,l,i,"assets"),[e,t,h,l,i]),y=j.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let v=new Set,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=BN(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(()=>sR(m,l),[m,l]),k=hR(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 gR(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var yR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{yR&&(window.__reactRouterVersion="7.14.2")}catch{}function bR({basename:e,children:t,unstable_useTransitions:n,window:i}){let a=j.useRef();a.current==null&&(a.current=VD({window:i,v5Compat:!0}));let l=a.current,[o,d]=j.useState({action:l.action,location:l.location}),f=j.useCallback(h=>{n===!1?d(h):j.startTransition(()=>d(h))},[n]);return j.useLayoutEffect(()=>l.listen(f),[l,f]),j.createElement(GO,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:l,unstable_useTransitions:n})}var $N=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vs=j.forwardRef(function({onClick:t,discover:n="render",prefetch:i="none",relative:a,reloadDocument:l,replace:o,unstable_mask:d,state:f,target:h,to:g,preventScrollReset:m,viewTransition:y,unstable_defaultShouldRevalidate:b,...k},v){let{basename:S,navigator:E,unstable_useTransitions:C}=j.useContext(Ai),N=typeof g=="string"&&$N.test(g),_=AN(g,S);g=_.to;let T=jO(g,{relative:a}),M=pr(),R=null;if(d){let F=zh(d,[],M.unstable_mask?M.unstable_mask.pathname:"/",!0);S!=="/"&&(F.pathname=F.pathname==="/"?S:dr([S,F.pathname])),R=E.createHref(F)}let[O,B,U]=dR(i,k),K=wR(g,{replace:o,unstable_mask:d,state:f,target:h,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?R:void 0)||_.absoluteURL||T,onClick:Y?q:t,ref:gR(v,B),target:h,"data-discover":!N&&n==="render"?"true":void 0});return O&&!N?j.createElement(j.Fragment,null,D,j.createElement(fR,{page:T})):D});vs.displayName="Link";var UN=j.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:i="",end:a=!1,style:l,to:o,viewTransition:d,children:f,...h},g){let m=Gu(o,{relative:h.relative}),y=pr(),b=j.useContext(Ph),{navigator:k,basename:v}=j.useContext(Ai),S=b!=null&&_R(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)==="/"),R={isActive:T,isPending:M,isTransitioning:S},O=T?t:void 0,B;typeof i=="function"?B=i(R):B=[i,T?"active":null,M?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let U=typeof l=="function"?l(R):l;return j.createElement(vs,{...h,"aria-current":O,className:B,ref:g,style:U,to:o,viewTransition:d},typeof f=="function"?f(R):f)});UN.displayName="NavLink";var xR=j.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:i,replace:a,state:l,method:o=Wf,action:d,onSubmit:f,relative:h,preventScrollReset:g,viewTransition:m,unstable_defaultShouldRevalidate:y,...b},k)=>{let{unstable_useTransitions:v}=j.useContext(Ai),S=SR(),E=NR(d,{relative:h}),C=o.toLowerCase()==="get"?"get":"post",N=typeof d=="string"&&$N.test(d),_=T=>{if(f&&f(T),T.defaultPrevented)return;T.preventDefault();let M=T.nativeEvent.submitter,R=(M==null?void 0:M.getAttribute("formmethod"))||o,O=()=>S(M||T.currentTarget,{fetcherKey:t,method:R,navigate:n,replace:a,state:l,relative:h,preventScrollReset:g,viewTransition:m,unstable_defaultShouldRevalidate:y});v&&n!==!1?j.startTransition(()=>O()):O()};return j.createElement("form",{ref:k,method:C,action:E,onSubmit:i?f:_,...b,"data-discover":!N&&e==="render"?"true":void 0})});xR.displayName="Form";function vR(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function FN(e){let t=j.useContext(Wo);return Jt(t,vR(e)),t}function wR(e,{target:t,replace:n,unstable_mask:i,state:a,preventScrollReset:l,relative:o,viewTransition:d,unstable_defaultShouldRevalidate:f,unstable_useTransitions:h}={}){let g=ks(),m=pr(),y=Gu(e,{relative:o});return j.useCallback(b=>{if(ZO(b,t)){b.preventDefault();let k=n!==void 0?n:wu(m)===wu(y),v=()=>g(e,{replace:k,unstable_mask:i,state:a,preventScrollReset:l,relative:o,viewTransition:d,unstable_defaultShouldRevalidate:f});h?j.startTransition(()=>v()):v()}},[m,g,y,n,i,a,t,e,l,o,d,f,h])}function 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(Uy(e)),n=j.useRef(!1),i=pr(),a=j.useMemo(()=>JO(i.search,n.current?null:t.current),[i.search]),l=ks(),o=j.useCallback((d,f)=>{const h=Uy(typeof d=="function"?d(new URLSearchParams(a)):d);n.current=!0,l("?"+h,f)},[l,a]);return[a,o]}var kR=0,ER=()=>`__${String(++kR)}__`;function SR(){let{router:e}=FN("useSubmit"),{basename:t}=j.useContext(Ai),n=$O(),i=e.fetch,a=e.navigate;return j.useCallback(async(l,o={})=>{let{action:d,method:f,encType:h,formData:g,body:m}=nR(l,t);if(o.navigate===!1){let y=o.fetcherKey||ER();await i(y,n,o.action||d,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:g,body:m,formMethod:o.method||f,formEncType:o.encType||h,flushSync:o.flushSync})}else await a(o.action||d,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:g,body:m,formMethod:o.method||f,formEncType:o.encType||h,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[i,a,t,n])}function NR(e,{relative:t}={}){let{basename:n}=j.useContext(Ai),i=j.useContext(Qi);Jt(i,"useFormAction must be used inside a RouteContext");let[a]=i.matches.slice(-1),l={...Gu(e||".",{relative:t})},o=pr();if(e==null){l.search=o.search;let d=new URLSearchParams(l.search),f=d.getAll("index");if(f.some(g=>g==="")){d.delete("index"),f.filter(m=>m).forEach(m=>d.append("index",m));let g=d.toString();l.search=g?`?${g}`:""}}return(!e||e===".")&&a.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:dr([n,l.pathname])),wu(l)}function _R(e,{relative:t}={}){let n=j.useContext(DN);Jt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=FN("useViewTransitionState"),a=Gu(e,{relative:t});if(!n.isTransitioning)return!1;let l=ga(n.currentLocation.pathname,i)||n.currentLocation.pathname,o=ga(n.nextLocation.pathname,i)||n.nextLocation.pathname;return uh(a.pathname,o)!=null||uh(a.pathname,l)!=null}dN();/**
|
|
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 jR=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),CR=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,i)=>i?i.toUpperCase():n.toLowerCase()),uk=e=>{const t=CR(e);return t.charAt(0).toUpperCase()+t.slice(1)},HN=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim(),AR=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 TR={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 MR=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,...TR,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:HN("lucide",a),...!l&&!AR(d)&&{"aria-hidden":"true"},...d},[...o.map(([h,g])=>j.createElement(h,g)),...Array.isArray(l)?l:[l]]));/**
|
|
76
|
-
* @license lucide-react v0.544.0 - ISC
|
|
77
|
-
*
|
|
78
|
-
* This source code is licensed under the ISC license.
|
|
79
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
-
*/const De=(e,t)=>{const n=j.forwardRef(({className:i,...a},l)=>j.createElement(MR,{ref:l,iconNode:t,className:HN(`lucide-${jR(uk(e))}`,`lucide-${e}`,i),...a}));return n.displayName=uk(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 DR=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],$h=De("activity",DR);/**
|
|
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 OR=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],RR=De("arrow-down",OR);/**
|
|
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 LR=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],KN=De("arrow-left",LR);/**
|
|
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 IR=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],GN=De("arrow-up",IR);/**
|
|
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 zR=[["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"}]],PR=De("book-lock",zR);/**
|
|
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 BR=[["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"}]],$R=De("brain",BR);/**
|
|
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 UR=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],FR=De("check",UR);/**
|
|
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 qR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Vu=De("chevron-down",qR);/**
|
|
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 HR=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Zo=De("chevron-right",HR);/**
|
|
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 KR=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],GR=De("chevron-up",KR);/**
|
|
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 VR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],ku=De("circle-alert",VR);/**
|
|
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 YR=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],fh=De("circle-check-big",YR);/**
|
|
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 QR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Eu=De("circle-check",QR);/**
|
|
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 WR=[["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"}]],VN=De("circle-x",WR);/**
|
|
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 XR=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],YN=De("clock",XR);/**
|
|
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 ZR=[["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"}]],JR=De("copy",ZR);/**
|
|
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 eL=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],hh=De("cpu",eL);/**
|
|
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 tL=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Uh=De("download",tL);/**
|
|
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 nL=[["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"}]],iL=De("external-link",nL);/**
|
|
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 rL=[["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"}]],aL=De("eye",rL);/**
|
|
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 sL=[["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"}]],dk=De("file-code",sL);/**
|
|
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 lL=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Fh=De("file-text",lL);/**
|
|
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 oL=[["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"}]],cL=De("folder-git-2",oL);/**
|
|
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 uL=[["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"}]],QN=De("folder-open",uL);/**
|
|
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 dL=[["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"}]],fL=De("folder-plus",dL);/**
|
|
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 hL=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],ph=De("folder",hL);/**
|
|
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 pL=[["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"}]],mL=De("funnel",pL);/**
|
|
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 gL=[["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"}]],yL=De("git-branch",gL);/**
|
|
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 bL=[["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"}]],xL=De("git-pull-request-arrow",bL);/**
|
|
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 vL=[["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"}]],wL=De("globe",vL);/**
|
|
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 kL=[["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"}]],EL=De("hammer",kL);/**
|
|
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 SL=[["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"}]],NL=De("history",SL);/**
|
|
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 _L=[["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"}]],jL=De("house",_L);/**
|
|
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 CL=[["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"}]],AL=De("image",CL);/**
|
|
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 TL=[["path",{d:"M5 3v14",key:"9nsxs2"}],["path",{d:"M12 3v8",key:"1h2ygw"}],["path",{d:"M19 3v18",key:"1sk56x"}]],ML=De("kanban",TL);/**
|
|
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 DL=[["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"}]],OL=De("key-round",DL);/**
|
|
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 RL=[["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"}]],LL=De("languages",RL);/**
|
|
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 IL=[["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"}]],WN=De("layout-grid",IL);/**
|
|
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 zL=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Xe=De("loader-circle",zL);/**
|
|
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 PL=[["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"}]],fk=De("message-circle",PL);/**
|
|
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 BL=[["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"}]],XN=De("message-square",BL);/**
|
|
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 $L=[["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"}]],UL=De("moon",$L);/**
|
|
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 FL=[["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"}]],ZN=De("network",FL);/**
|
|
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"}]],JN=De("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 HL=[["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"}]],KL=De("panel-right-close",HL);/**
|
|
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 GL=[["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"}]],VL=De("paperclip",GL);/**
|
|
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 YL=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],QL=De("pause",YL);/**
|
|
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 WL=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],qh=De("pen-line",WL);/**
|
|
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 XL=[["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"}]],e_=De("pencil",XL);/**
|
|
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 ZL=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Yu=De("play",ZL);/**
|
|
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 JL=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],pi=De("plus",JL);/**
|
|
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 e3=[["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"}]],t3=De("puzzle",e3);/**
|
|
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 n3=[["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"}]],t_=De("radio",n3);/**
|
|
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 i3=[["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=De("refresh-cw",i3);/**
|
|
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 r3=[["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"}]],$b=De("rotate-ccw",r3);/**
|
|
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 a3=[["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"}]],s3=De("rows-3",a3);/**
|
|
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 l3=[["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=De("save",l3);/**
|
|
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 o3=[["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"}]],Ub=De("scroll-text",o3);/**
|
|
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 c3=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],fl=De("search",c3);/**
|
|
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 u3=[["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"}]],n_=De("settings",u3);/**
|
|
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 d3=[["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"}]],i_=De("shield-check",d3);/**
|
|
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 f3=[["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"}]],h3=De("skull",f3);/**
|
|
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 p3=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],hl=De("sparkles",p3);/**
|
|
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 m3=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Fb=De("square",m3);/**
|
|
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 g3=[["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"}]],r_=De("star",g3);/**
|
|
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 y3=[["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"}]],b3=De("sun",y3);/**
|
|
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 x3=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],a_=De("terminal",x3);/**
|
|
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 v3=[["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"}]],w3=De("timer-reset",v3);/**
|
|
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 k3=[["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"}]],E3=De("timer",k3);/**
|
|
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 S3=[["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=De("trash-2",S3);/**
|
|
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 N3=[["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"}]],_3=De("triangle-alert",N3);/**
|
|
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 j3=[["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"}]],s_=De("upload",j3);/**
|
|
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 C3=[["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"}]],l_=De("users",C3);/**
|
|
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 A3=[["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"}]],qb=De("workflow",A3);/**
|
|
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 T3=[["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"}]],o_=De("wrench",T3);/**
|
|
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 M3=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],bn=De("x",M3);/**
|
|
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 D3=[["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"}]],O3=De("zap",D3),R3={"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.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…"},L3={"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.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":"高亮文件…"},c_=j.createContext(null),u_="sps-console-lang";function I3(){if(typeof window>"u")return"en";try{const e=window.localStorage.getItem(u_);if(e==="en"||e==="zh")return e}catch{}return"en"}function z3(e){try{window.localStorage.setItem(u_,e)}catch{}}function P3({children:e}){const[t,n]=j.useState(()=>I3());j.useEffect(()=>{typeof document<"u"&&(document.documentElement.lang=t==="zh"?"zh-CN":"en")},[t]);const i=j.useCallback(o=>{n(o),z3(o)},[]),a=j.useMemo(()=>{const o=t==="zh"?L3:R3;return(d,f)=>{let h=o[d]??d;if(f)for(const[g,m]of Object.entries(f))m!==void 0&&(h=h.replace(`{${g}}`,String(m)));return h}},[t]),l=j.useMemo(()=>({lang:t,setLang:i,t:a}),[t,i,a]);return c.jsx(c_.Provider,{value:l,children:e})}function d_(){const e=j.useContext(c_);if(!e)throw new Error("useLang must be used inside I18nProvider");return e}function Be(){return d_().t}function B3(){const{lang:e,setLang:t,t:n}=d_();return c.jsxs("div",{role:"group","aria-label":n("lang.toggle.aria"),className:"dimension-segmented flex-1 min-w-0",children:[c.jsx(hk,{active:e==="en",onClick:()=>t("en"),label:n("lang.en"),ariaLabel:"English"}),c.jsx(hk,{active:e==="zh",onClick:()=>t("zh"),label:n("lang.zh"),ariaLabel:"中文"})]})}function hk({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 f_="sps-console-theme";function h_(){if(typeof window>"u")return"dark";try{const e=window.localStorage.getItem(f_);if(e==="dark"||e==="light")return e}catch{}return"dark"}function Fy(e){typeof document>"u"||(document.documentElement.dataset.theme=e)}function $3(e){try{window.localStorage.setItem(f_,e)}catch{}}function U3(){const e=h_();return Fy(e),e}const F3=["dark","light"];function q3(){const e=Be(),[t,n]=j.useState(()=>h_());j.useEffect(()=>{Fy(t)},[t]);const i=j.useCallback(a=>{n(a),$3(a),Fy(a)},[]);return c.jsx("div",{role:"group","aria-label":e("theme.toggle.aria"),className:"dimension-segmented shrink-0",children:F3.map(a=>{const l=t===a,o=a==="dark"?UL:b3;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 H3=[{to:"/chat",labelKey:"nav.chat",icon:XN},{to:"/projects",labelKey:"nav.projects",icon:WN},{to:"/board",labelKey:"nav.board",icon:ML},{to:"/workers",labelKey:"nav.workers",icon:l_},{to:"/skills",labelKey:"nav.skills",icon:wL},{to:"/prompts",labelKey:"nav.prompts",icon:JN},{to:"/arrange",labelKey:"nav.arrange",icon:qb},{to:"/plugins",labelKey:"nav.plugins",icon:t3},{to:"/system",labelKey:"nav.system",icon:n_},{to:"/processes",labelKey:"nav.processes",icon:hh},{to:"/audit",labelKey:"nav.audit",icon:Ub},{to:"/memory",labelKey:"nav.memory",icon:$R}];function K3(){const e=Be();return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"font-[family-name:var(--font-heading)] font-bold text-lg px-3 pt-2 pb-4 flex items-center gap-3 text-[var(--color-text)]",children:[c.jsx(hl,{size:20,strokeWidth:2.5}),e("app.title")]}),c.jsx("nav",{className:"flex flex-col gap-0.5 mt-2","aria-label":e("nav.aria"),children:H3.map(t=>{const n=t.icon;return c.jsxs(UN,{to:t.to,className:({isActive:i})=>["dimension-menu-item gap-3 px-3 py-2.5 pl-4 font-semibold text-sm cursor-pointer",i?"dimension-menu-item-active":""].join(" "),children:[c.jsx(n,{size:18,strokeWidth:2.5}),e(t.labelKey)]},t.to)})}),c.jsxs("div",{className:"mt-auto pt-3 flex items-center gap-2",children:[c.jsx(B3,{}),c.jsx(q3,{})]})]})}class G3 extends Error{constructor(t,n,i){super(n),this.status=t,this.detail=i,this.name="ApiError"}}async function Hb(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 G3(e.status,i,n)}async function ft(e){const t=await fetch(e,{headers:{Accept:"application/json"}});if(!t.ok)throw await Hb(t);return await t.json()}async function gr(e,t){return m_("POST",e,t)}async function Kb(e,t){return m_("PUT",e,t)}async function p_(e){const t=await fetch(e,{method:"DELETE",headers:{Accept:"application/json"}});if(!t.ok)throw await Hb(t)}async function m_(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 Hb(i);return await i.json()}function g_(){return ft("/api/system/info")}function V3(){return ft("/api/system/env")}function Y3(){return ft("/api/system/env/raw")}async function Q3(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 W3(){return ft("/api/system/memory")}async function X3(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 Gb(){return ft("/api/system/agents")}async function Z3(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 J3(){return ft("/api/system/latest-version")}async function eI(){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 tI(e,t=!1){const n=t?"?fix=1":"",i=await fetch(`/api/system/doctor/${encodeURIComponent(e)}${n}`,{method:"POST"});if(!i.ok)throw new Error(`${i.status}: ${await i.text()}`);return i.json()}function Es(){return ft("/api/projects")}function nI(e){return ft(`/api/projects/${encodeURIComponent(e)}`)}async function iI(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 rI(e){return ft(`/api/projects/${encodeURIComponent(e)}/conf`)}async function aI(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 sI(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 lI(e){return ft(`/api/projects/${encodeURIComponent(e)}/pipelines`)}async function oI(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 cI(e,t){return ft(`/api/projects/${encodeURIComponent(e)}/pipelines/${encodeURIComponent(t)}`)}async function uI(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 dI(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 fI(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 hI(){var f;const e=Be(),t=Ye({queryKey:["system-info"],queryFn:g_,refetchInterval:3e4}),n=Ye({queryKey:["projects"],queryFn:Es,refetchInterval:1e4}),i=mI(),a=!t.isError,l=((f=n.data)==null?void 0:f.data)??[],o=l.filter(h=>h.pipelineStatus==="running").length,d=l.reduce((h,g)=>h+g.workers.active,0);return c.jsxs("div",{className:"h-full flex items-center gap-3 px-6 font-[family-name:var(--font-mono)] text-[11px] text-[var(--color-text-muted)]",children:[c.jsx("span",{className:"nb-status",style:{background:a?"var(--color-running-bg)":"var(--color-crashed-bg)",color:a?"var(--color-running)":"var(--color-crashed)",padding:"2px 8px 2px 7px"},children:e(a?"status.server":"status.offline")}),c.jsx(pI,{state:i}),c.jsx("span",{className:"text-[var(--color-text-subtle)]",children:"·"}),c.jsxs("span",{className:"flex items-center gap-1",title:e("status.pipelines.tooltip"),children:[c.jsx($h,{size:10,strokeWidth:2.5}),c.jsx("span",{className:"font-bold text-[var(--color-text)]",children:o})," ",e("status.pipeline.unit")]}),c.jsx("span",{className:"text-[var(--color-text-subtle)]",children:"·"}),c.jsxs("span",{className:"flex items-center gap-1",title:e("status.workers.tooltip"),children:[c.jsx(t_,{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 pI({state:e}){const t=Be();return e==="open"?c.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)",padding:"2px 8px 2px 7px"},children:t("status.sse.open")}):e==="connecting"?c.jsx("span",{className:"nb-status",style:{background:"var(--color-stuck-bg)",color:"var(--color-stuck)",padding:"2px 8px 2px 7px"},children:t("status.sse.connecting")}):c.jsxs("span",{className:"nb-status",style:{background:"var(--color-crashed-bg)",color:"var(--color-crashed)",padding:"2px 8px 2px 7px"},children:[c.jsx(ku,{size:9,strokeWidth:2.5}),t("status.sse.down")]})}function mI(){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 gI(){return c.jsxs("div",{className:"grid grid-cols-[240px_1fr] grid-rows-[1fr_40px] h-screen",children:[c.jsx("aside",{className:"row-span-1 row-start-1 border-r-[3px] border-[var(--color-text)] bg-[var(--color-bg)] p-4 flex flex-col",children:c.jsx(K3,{})}),c.jsx("main",{className:"row-start-1 overflow-auto p-6 flex flex-col gap-4",children:c.jsx(KO,{})}),c.jsx("footer",{className:"col-span-2 row-start-2 border-t-[3px] border-[var(--color-text)] bg-[var(--color-bg)]",children:c.jsx(hI,{})})]})}function qy(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 yI(){typeof window>"u"||(window.addEventListener("error",e=>{qy(e.error??e.message??"unknown error","window.error")}),window.addEventListener("unhandledrejection",e=>{const t=e.reason;qy(t instanceof Error?t:String(t),"unhandledrejection")}))}class bI extends j.Component{constructor(){super(...arguments);L1(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,i){var a;qy(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 Vb(e,t){const[n,i]=j.useState(()=>{try{const a=localStorage.getItem(e);return a!==null?JSON.parse(a):t}catch{return t}});return j.useEffect(()=>{try{localStorage.setItem(e,JSON.stringify(n))}catch{}},[e,n]),[n,i]}const kf=e=>e.lastActivityAt?Date.parse(e.lastActivityAt):0;function y_(e,t){const n=[...e];return t==="name"?n.sort((i,a)=>i.name.localeCompare(a.name)):t==="date"?n.sort((i,a)=>kf(a)-kf(i)):n.sort((i,a)=>{const l=i.pipelineStatus==="running"?1:0,o=a.pipelineStatus==="running"?1:0;return l!==o?o-l:kf(a)-kf(i)})}function xI(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 vI(e){const t=new URLSearchParams;return e.project&&t.set("project",e.project),e.worker&&t.set("worker",e.worker),t.set("limit",String(e.limit)),e.since&&t.set("since",e.since),e.file&&t.set("file",e.file),ft(`/api/logs?${t}`)}function wI(e){return ft(`/api/logs/sources?project=${encodeURIComponent(e)}`)}const kI=["error","warn","info","debug"],EI=["error","warn","info"];function SI({project:e,initialWorker:t}){const n=Be(),i=t??"",[a,l]=j.useState([]),[o,d]=j.useState(!1),[f,h]=j.useState(!0),[g,m]=j.useState(()=>new Set(EI)),[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}=Ye({queryKey:["log-sources",e],queryFn:()=>wI(e),enabled:!!e,refetchInterval:5e3}),M=j.useMemo(()=>(T==null?void 0:T.sources)??[],[T]),R=M.find(q=>q.key===N)??(i?M.find(q=>q.worker===Number(i)):void 0)??M.find(q=>q.kind==="pipeline")??M[0],O=R==null?void 0:R.file;j.useEffect(()=>{l([])},[e,O]);const{data:B,refetch:U}=Ye({queryKey:["logs",e,O,k,k==="history"?S:"live"],queryFn:()=>vI({project:e,file:O,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(pk,{s:q,active:(R==null?void 0:R.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(pk,{s:q,active:(R==null?void 0:R.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(t_,{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(NL,{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:kI.map(q=>c.jsx(NI,{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:()=>h(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(Yu,{size:12,strokeWidth:3})," Resume"]}):c.jsxs(c.Fragment,{children:[c.jsx(QL,{size:12,strokeWidth:3})," Pause"]})})]}),c.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>{const 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(Uh,{size:12,strokeWidth:2.5})," Export"]})]})]}),c.jsxs("div",{className:"scroll-frame flex min-h-0 flex-1 flex-col rounded-lg border-2 border-[var(--color-border-light)] bg-[var(--color-bg-cream)]",children:[c.jsxs("div",{className:"px-4 bg-color-bg-soft py-2 bg-[var(--color-bg-cream)] border-b-2 border-[var(--color-border-light)] flex shrink-0 items-center justify-between font-[family-name:var(--font-mono)] text-xs",children:[c.jsxs("span",{className:"text-[var(--color-text-muted)]",children:[(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&&h(!1)},children:[K.map((q,Y)=>c.jsx(_I,{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 NI({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 _I({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 pk({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 jI({title:e,body:t,confirm:n,cancel:i,onConfirm:a,onCancel:l,danger:o}){const d=Be();return j.useEffect(()=>{const f=h=>{h.key==="Escape"&&l()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[l]),c.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"confirm-title",className:"fixed inset-0 z-50 flex items-center justify-center p-6 bg-black/30",children:c.jsxs("div",{className:"nb-card max-w-md w-full",children:[c.jsx("h2",{id:"confirm-title",className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-2",children:e}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mb-5",children:t}),c.jsxs("div",{className:"flex gap-3 justify-end",children:[c.jsx("button",{className:"nb-btn",onClick:l,type:"button",children:i??d("dialog.cancel.default")}),c.jsx("button",{className:o?"nb-btn nb-btn-danger":"nb-btn nb-btn-yellow",onClick:async()=>{await a()},type:"button",children:n})]})]})})}const b_=j.createContext(null);function CI({children:e}){const t=Be(),[n,i]=j.useState(null),a=j.useCallback(d=>new Promise(f=>{i({kind:"confirm",opts:d,resolve:h=>{i(null),f(h)}})}),[]),l=j.useCallback(d=>new Promise(f=>{i({kind:"alert",opts:d,resolve:()=>{i(null),f()}})}),[]),o=j.useCallback(d=>new Promise(f=>{i({kind:"prompt",opts:d,resolve:h=>{i(null),f(h)}})}),[]);return c.jsxs(b_.Provider,{value:{confirm:a,alert:l,prompt:o},children:[e,(n==null?void 0:n.kind)==="confirm"&&c.jsx(jI,{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(AI,{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(TI,{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(b_);if(!e)throw new Error("useDialog must be used inside <DialogProvider>");return e}function AI({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 TI({title:e,body:t,placeholder:n,defaultValue:i,confirm:a,cancel:l,onConfirm:o,onCancel:d}){const[f,h]=j.useState(i??""),g=j.useRef(null);j.useEffect(()=>{var b,k;(b=g.current)==null||b.focus(),(k=g.current)==null||k.select();const y=v=>{v.key==="Escape"&&d()};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[d]);const m=()=>{const y=f.trim();y&&o(y)};return c.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-50 flex items-center justify-center p-6 bg-black/30",children:c.jsxs("div",{className:"nb-card max-w-md w-full",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-2",children:e}),t&&c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mb-3 whitespace-pre-wrap break-words",children:t}),c.jsx("input",{ref:g,type:"text",className:"nb-input w-full mb-5",placeholder:n,value:f,onChange:y=>h(y.target.value),onKeyDown:y=>{y.key==="Enter"&&!y.nativeEvent.isComposing&&(y.preventDefault(),m())}}),c.jsxs("div",{className:"flex gap-3 justify-end",children:[c.jsx("button",{className:"nb-btn",onClick:d,type:"button",children:l}),c.jsx("button",{className:"nb-btn nb-btn-primary",onClick:m,type:"button",disabled:!f.trim(),children:a})]})]})})}const Yb=Symbol.for("yaml.alias"),Hy=Symbol.for("yaml.document"),xs=Symbol.for("yaml.map"),x_=Symbol.for("yaml.pair"),Lr=Symbol.for("yaml.scalar"),Jo=Symbol.for("yaml.seq"),Yi=Symbol.for("yaml.node.type"),Ss=e=>!!e&&typeof e=="object"&&e[Yi]===Yb,wl=e=>!!e&&typeof e=="object"&&e[Yi]===Hy,ec=e=>!!e&&typeof e=="object"&&e[Yi]===xs,en=e=>!!e&&typeof e=="object"&&e[Yi]===x_,Gt=e=>!!e&&typeof e=="object"&&e[Yi]===Lr,tc=e=>!!e&&typeof e=="object"&&e[Yi]===Jo;function on(e){if(e&&typeof e=="object")switch(e[Yi]){case xs:case Jo:return!0}return!1}function cn(e){if(e&&typeof e=="object")switch(e[Yi]){case Yb:case xs:case Lr:case Jo:return!0}return!1}const v_=e=>(Gt(e)||on(e))&&!!e.anchor,fi=Symbol("break visit"),w_=Symbol("skip children"),Or=Symbol("remove node");function kl(e,t){const n=k_(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=w_;kl.REMOVE=Or;function go(e,t,n,i){const a=E_(e,t,n,i);if(cn(a)||en(a))return S_(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 Hh(e,t){const n=k_(t);wl(e)?await yo(null,e.contents,n,Object.freeze([e]))===Or&&(e.contents=null):await yo(null,e,n,Object.freeze([]))}Hh.BREAK=fi;Hh.SKIP=w_;Hh.REMOVE=Or;async function yo(e,t,n,i){const a=await E_(e,t,n,i);if(cn(a)||en(a))return S_(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 k_(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 E_(e,t,n,i){var a,l,o,d,f;if(typeof n=="function")return n(e,t,i);if(ec(t))return(a=n.Map)==null?void 0:a.call(n,e,t,i);if(tc(t))return(l=n.Seq)==null?void 0:l.call(n,e,t,i);if(en(t))return(o=n.Pair)==null?void 0:o.call(n,e,t,i);if(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 S_(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 MI={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},DI=e=>e.replace(/[!,[\]{}]/g,t=>MI[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+DI(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 N_(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 __(e){const t=new Set;return kl(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function j_(e,t){for(let n=1;;++n){const i=`${e}${n}`;if(!t.has(i))return i}}function OI(e,t){const n=[],i=new Map;let a=null;return{onAnchor:l=>{n.push(l),a??(a=__(e));const o=j_(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||!v_(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 Qb{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:h}of o.anchors.values())a(h,f);return typeof l=="function"?bo(l,{"":d},"",d):d}}class Kh extends Qb{constructor(t){super(Yb),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)||v_(o))&&i.push(o)}}),n&&(n.aliasResolveCache=i));let a;for(const l of i){if(l===this)break;l.anchor===this.source&&(a=l)}return a}toJSON(t,n){if(!n)return{source:this.source};const{anchors:i,doc:a,maxAliasCount:l}=n,o=this.resolve(a,n);if(!o){const f=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(f)}let d=i.get(o);if(d||(Ki(o,null,n),d=i.get(o)),(d==null?void 0:d.res)===void 0){const f="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(f)}if(l>=0&&(d.count+=1,d.aliasCount===0&&(d.aliasCount=Zf(a,o,i)),d.count*d.aliasCount>l)){const f="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(f)}return d.res}toString(t,n,i){const a=`*${this.source}`;if(t){if(N_(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(l)}if(t.implicitKey)return`${a} `}return a}}function Zf(e,t,n){if(Ss(t)){const i=t.resolve(e),a=n&&i&&n.get(i);return a?a.count*a.aliasCount:0}else if(on(t)){let i=0;for(const a of t.items){const l=Zf(e,a,n);l>i&&(i=l)}return i}else if(en(t)){const i=Zf(e,t.key,n),a=Zf(e,t.value,n);return Math.max(i,a)}return 1}const C_=e=>!e||typeof e!="function"&&typeof e!="object";class st extends Qb{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 RI="tag:yaml.org,2002:";function LI(e,t,n){if(t){const i=n.filter(l=>l.tag===t),a=i.find(l=>!l.format)??i[0];if(!a)throw new Error(`Tag ${t} not found`);return a}return n.find(i=>{var a;return((a=i.identify)==null?void 0:a.call(i,e))&&!i.format})}function Su(e,t,n){var m,y,b;if(wl(e)&&(e=e.contents),cn(e))return e;if(en(e)){const k=(y=(m=n.schema[xs]).createNode)==null?void 0:y.call(m,n.schema,null,n);return k.items.push(e),k}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:i,onAnchor:a,onTagObj:l,schema:o,sourceObjects:d}=n;let f;if(i&&e&&typeof e=="object"){if(f=d.get(e),f)return f.anchor??(f.anchor=a(e)),new Kh(f.anchor);f={anchor:null,node:null},d.set(e,f)}t!=null&&t.startsWith("!!")&&(t=RI+t.slice(2));let h=LI(e,t,o.tags);if(!h){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const k=new st(e);return f&&(f.node=k),k}h=e instanceof Map?o[xs]:Symbol.iterator in Object(e)?o[Jo]:o[xs]}l&&(l(h),delete n.onTagObj);const g=h!=null&&h.createNode?h.createNode(n.schema,e,n):typeof((b=h==null?void 0:h.nodeClass)==null?void 0:b.from)=="function"?h.nodeClass.from(n.schema,e,n):new st(e);return t?g.tag=t:h.default||(g.tag=h.tag),f&&(f.node=g),g}function mh(e,t,n){let i=n;for(let a=t.length-1;a>=0;--a){const l=t[a];if(typeof l=="number"&&Number.isInteger(l)&&l>=0){const o=[];o[l]=i,i=o}else i=new Map([[l,i]])}return Su(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const cu=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class A_ extends Qb{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(i=>cn(i)||en(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(cu(t))this.add(n);else{const[i,...a]=t,l=this.get(i,!0);if(on(l))l.addIn(a,n);else if(l===void 0&&this.schema)this.set(i,mh(this.schema,a,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${a}`)}}deleteIn(t){const[n,...i]=t;if(i.length===0)return this.delete(n);const a=this.get(n,!0);if(on(a))return a.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(t,n){const[i,...a]=t,l=this.get(i,!0);return a.length===0?!n&&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,mh(this.schema,a,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${a}`)}}}const II=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function da(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Ws=(e,t,n)=>e.endsWith(`
|
|
480
|
-
`)?da(n,t):n.includes(`
|
|
481
|
-
`)?`
|
|
482
|
-
`+da(n,t):(e.endsWith(" ")?"":" ")+n,T_="flow",Ky="block",Jf="quoted";function Gh(e,t,n="flow",{indentAtStart:i,lineWidth:a=80,minContentWidth:l=20,onFold:o,onOverflow:d}={}){if(!a||a<0)return e;a<l&&(l=0);const f=Math.max(1+l,1+a-t.length);if(e.length<=f)return e;const h=[],g={};let m=a-t.length;typeof i=="number"&&(i>a-Math.max(2,l)?h.push(0):m=a-i);let y,b,k=!1,v=-1,S=-1,E=-1;n===Ky&&(v=mk(e,v,t.length),v!==-1&&(m=v+f));for(let N;N=e[v+=1];){if(n===Jf&&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===Ky&&(v=mk(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)h.push(y),m=y+f,y=void 0;else if(n===Jf){for(;b===" "||b===" ";)b=N,N=e[v+=1],k=!0;const _=v>E+1?v-2:S-1;if(g[_])return e;h.push(_),g[_]=!0,m=_+f,y=void 0}else k=!0}b=N}if(k&&d&&d(),h.length===0)return e;o&&o();let C=e.slice(0,h[0]);for(let N=0;N<h.length;++N){const _=h[N],T=h[N+1]||e.length;_===0?C=`
|
|
486
|
-
${t}${e.slice(0,T)}`:(n===Jf&&g[_]&&(C+=`${e[_]}\\`),C+=`
|
|
487
|
-
${t}${e.slice(_+1,T)}`)}return C}function mk(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 Vh=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Yh=e=>/^(%|---|\.\.\.)/m.test(e);function zI(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 fu(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:i}=t,a=t.options.doubleQuotedMinMultiLineLength,l=t.indent||(Yh(e)?" ":"");let o="",d=0;for(let f=0,h=n[f];h;h=n[++f])if(h===" "&&n[f+1]==="\\"&&n[f+2]==="n"&&(o+=n.slice(d,f)+"\\ ",f+=1,d=f,h="\\"),h==="\\")switch(n[f+1]){case"u":{o+=n.slice(d,f);const g=n.substr(f+2,4);switch(g){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:g.substr(0,2)==="00"?o+="\\x"+g.substr(2):o+=n.substr(f,6)}f+=5,d=f+1}break;case"n":if(i||n[f+2]==='"'||n.length<a)f+=1;else{for(o+=n.slice(d,f)+`
|
|
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:Gh(o,l,Jf,Vh(t,!1))}function Gy(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
493
|
-
`)||/[ \t]\n|\n[ \t]/.test(e))return fu(e,t);const n=t.indent||(Yh(e)?" ":""),i="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
494
|
-
${n}`)+"'";return t.implicitKey?i:Gh(i,n,T_,Vh(t,!1))}function xo(e,t){const{singleQuote:n}=t.options;let i;if(n===!1)i=fu;else{const a=e.includes('"'),l=e.includes("'");a&&!l?i=Gy:l&&!a?i=fu:i=n?Gy:fu}return i(e,t)}let Vy;try{Vy=new RegExp(`(^|(?<!
|
|
495
|
-
))
|
|
496
|
-
+(?!
|
|
497
|
-
|$)`,"g")}catch{Vy=/\n+(?!\n|$)/g}function eh({comment:e,type:t,value:n},i,a,l){const{blockQuote:o,commentString:d,lineWidth:f}=i.options;if(!o||/\n[\t ]+$/.test(n))return xo(n,i);const h=i.indent||(i.forceBlockIndent||Yh(n)?" ":""),g=o==="literal"?!0:o==="folded"||t===st.BLOCK_FOLDED?!1:t===st.BLOCK_LITERAL?!0:!zI(n,f,h.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(Vy,`$&${h}`));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,`$&${h}`));let _=(v?h?"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,`$&${h}`);let M=!1;const R=Vh(i,!0);o!=="folded"&&t!==st.BLOCK_FOLDED&&(R.onOverflow=()=>{M=!0});const O=Gh(`${C}${T}${b}`,h,Ky,R);if(!M)return`>${_}
|
|
505
|
-
${h}${O}`}return n=n.replace(/\n+/g,`$&${h}`),`|${_}
|
|
506
|
-
${h}${C}${n}${b}`}function PI(e,t,n,i){const{type:a,value:l}=e,{actualString:o,implicitKey:d,indent:f,indentStep:h,inFlow:g}=t;if(d&&l.includes(`
|
|
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):eh(e,t,n,i);if(!d&&!g&&a!==st.PLAIN&&l.includes(`
|
|
509
|
-
`))return eh(e,t,n,i);if(Yh(l)){if(f==="")return t.forceBlockIndent=!0,eh(e,t,n,i);if(d&&f===h)return xo(l,t)}const m=l.replace(/\n+/g,`$&
|
|
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:Gh(m,f,T_,Vh(t,!1))}function Qu(e,t,n,i){const{implicitKey:a,inFlow:l}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:d}=e;d!==st.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(d=st.QUOTE_DOUBLE);const f=g=>{switch(g){case st.BLOCK_FOLDED:case st.BLOCK_LITERAL:return a||l?xo(o.value,t):eh(o,t,n,i);case st.QUOTE_DOUBLE:return fu(o.value,t);case st.QUOTE_SINGLE:return Gy(o.value,t);case st.PLAIN:return PI(o,t,n,i);default:return null}};let h=f(d);if(h===null){const{defaultKeyType:g,defaultStringType:m}=t.options,y=a&&g||m;if(h=f(y),h===null)throw new Error(`Unsupported default string type ${y}`)}return h}function M_(e,t){const n=Object.assign({blockQuote:!0,commentString:II,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 BI(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 $I(e,t,{anchors:n,doc:i}){if(!i.directives)return"";const a=[],l=(Gt(e)||on(e))&&e.anchor;l&&N_(l)&&(n.add(l),a.push(`&${l}`));const o=e.tag??(t.default?null:t.tag);return o&&a.push(i.directives.tagString(o)),a.join(" ")}function Bo(e,t,n,i){var f;if(en(e))return e.toString(t,n,i);if(Ss(e)){if(t.doc.directives)return e.toString(t);if((f=t.resolvedAliases)!=null&&f.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let a;const l=cn(e)?e:t.doc.createNode(e,{onTagObj:h=>a=h});a??(a=BI(t.doc.schema.tags,l));const o=$I(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)?Qu(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 UI({key:e,value:t},n,i,a){const{allNullValues:l,doc:o,indent:d,indentStep:f,options:{commentString:h,indentSeq:g,simpleKeys:m}}=n;let y=cn(e)&&e.comment||null;if(m){if(y)throw new Error("With simple keys, key nodes cannot have comments");if(on(e)||!cn(e)&&typeof e=="object"){const R="With simple keys, collection cannot be used as a key value";throw new Error(R)}}let b=!m&&(!e||y&&t==null&&!n.inFlow||on(e)||(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=Bo(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+=Ws(S,n.indent,h(y)):v&&a&&a(),S;k&&(y=null),b?(y&&(S+=Ws(S,n.indent,h(y))),S=`? ${S}
|
|
512
|
-
${d}:`):(S=`${S}:`,y&&(S+=Ws(S,n.indent,h(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&&tc(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let _=!1;const T=Bo(t,n,()=>_=!0,()=>v=!0);let M=" ";if(y||E||C){if(M=E?`
|
|
513
|
-
`:"",C){const R=h(C);M+=`
|
|
514
|
-
${da(R,n.indent)}`}T===""&&!n.inFlow?M===`
|
|
515
|
-
`&&N&&(M=`
|
|
516
|
-
|
|
517
|
-
`):M+=`
|
|
518
|
-
${n.indent}`}else if(!b&&on(t)){const R=T[0],O=T.indexOf(`
|
|
519
|
-
`),B=O!==-1,U=n.inFlow??t.flow??t.items.length===0;if(B||!U){let K=!1;if(B&&(R==="&"||R==="!")){let q=T.indexOf(" ");R==="&"&&q!==-1&&q<O&&T[q+1]==="!"&&(q=T.indexOf(" ",q+1)),(q===-1||O<q)&&(K=!0)}K||(M=`
|
|
520
|
-
${n.indent}`)}}else(T===""||T[0]===`
|
|
521
|
-
`)&&(M="");return S+=M+T,n.inFlow?_&&i&&i():N&&!_?S+=Ws(S,n.indent,h(N)):v&&a&&a(),S}function D_(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Ef="<<",ha={identify:e=>e===Ef||typeof e=="symbol"&&e.description===Ef,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new st(Symbol(Ef)),{addToJSMap:O_}),stringify:()=>Ef},FI=(e,t)=>(ha.identify(t)||Gt(t)&&(!t.type||t.type===st.PLAIN)&&ha.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===ha.tag&&n.default));function O_(e,t,n){if(n=e&&Ss(n)?n.resolve(e.doc):n,tc(n))for(const i of n.items)Dg(e,t,i);else if(Array.isArray(n))for(const i of n)Dg(e,t,i);else Dg(e,t,n)}function Dg(e,t,n){const i=e&&Ss(n)?n.resolve(e.doc):n;if(!ec(i))throw new Error("Merge sources must be maps or map aliases");const a=i.toJSON(null,e,Map);for(const[l,o]of a)t instanceof Map?t.has(l)||t.set(l,o):t instanceof Set?t.add(l):Object.prototype.hasOwnProperty.call(t,l)||Object.defineProperty(t,l,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function R_(e,t,{key:n,value:i}){if(cn(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(FI(e,n))O_(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=qI(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 qI(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(cn(e)&&(n!=null&&n.doc)){const i=M_(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)+'..."'),D_(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 Wb(e,t,n){const i=Su(e,void 0,n),a=Su(t,void 0,n);return new Vn(i,a)}class Vn{constructor(t,n=null){Object.defineProperty(this,Yi,{value:x_}),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 R_(n,i,this)}toString(t,n,i){return t!=null&&t.doc?UI(this,t,n,i):JSON.stringify(this)}}function L_(e,t,n){return(t.inFlow??e.flow?KI:HI)(e,t,n)}function HI({comment:e,items:t},n,{blockItemPrefix:i,flowChars:a,itemIndent:l,onChompKeep:o,onComment:d}){const{indent:f,options:{commentString:h}}=n,g=Object.assign({},n,{indent:l,type:null});let m=!1;const y=[];for(let k=0;k<t.length;++k){const v=t[k];let S=null;if(cn(v))!m&&v.spaceBefore&&y.push(""),gh(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(""),gh(n,y,C.commentBefore,m))}m=!1;let E=Bo(v,g,()=>S=null,()=>m=!0);S&&(E+=Ws(E,l,h(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(h(e),f),d&&d()):m&&o&&o(),b}function KI({items:e},t,{flowChars:n,itemIndent:i}){const{indent:a,indentStep:l,flowCollectionPadding:o,options:{commentString:d}}=t;i+=l;const f=Object.assign({},t,{indent:i,inFlow:!0,type:null});let h=!1,g=0;const m=[];for(let k=0;k<e.length;++k){const v=e[k];let S=null;if(cn(v))v.spaceBefore&&m.push(""),gh(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(""),gh(t,m,C.commentBefore,!1),C.comment&&(h=!0));const N=cn(v.value)?v.value:null;N?(N.comment&&(S=N.comment),N.commentBefore&&(h=!0)):v.value==null&&(C!=null&&C.comment)&&(S=C.comment)}S&&(h=!0);let E=Bo(v,f,()=>S=null);h||(h=m.length>g||E.includes(`
|
|
525
|
-
`)),k<e.length-1?E+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(h||(h=m.reduce((C,N)=>C+N.length+2,2)+(E.length+2)>t.options.lineWidth)),h&&(E+=",")),S&&(E+=Ws(E,i,d(S))),m.push(E),g=m.length}const{start:y,end:b}=n;if(m.length===0)return y+b;if(!h){const k=m.reduce((v,S)=>v+S.length+2,2);h=t.options.lineWidth>0&&k>t.options.lineWidth}if(h){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 gh({indent:e,options:{commentString:t}},n,i,a){if(i&&a&&(i=i.replace(/^\n+/,"")),i){const l=da(t(i),e);n.push(l.trimStart())}}function Xs(e,t){const n=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 A_{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(xs,t),this.items=[]}static from(t,n,i){const{keepUndefined:a,replacer:l}=i,o=new this(t),d=(f,h)=>{if(typeof l=="function")h=l.call(n,f,h);else if(Array.isArray(l)&&!l.includes(f))return;(h!==void 0||a)&&o.items.push(Wb(f,h,i))};if(n instanceof Map)for(const[f,h]of n)d(f,h);else if(n&&typeof n=="object")for(const f of Object.keys(n))d(f,n[f]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){var o;let i;en(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new Vn(t,t==null?void 0:t.value):i=new Vn(t.key,t.value);const a=Xs(this.items,i.key),l=(o=this.schema)==null?void 0:o.sortMapEntries;if(a){if(!n)throw new Error(`Key ${i.key} already set`);Gt(a.value)&&C_(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)R_(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})),L_(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:n})}}const nc={collection:"map",default:!0,nodeClass:Ni,tag:"tag:yaml.org,2002:map",resolve(e,t){return ec(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Ni.from(e,t,n)};class ws extends A_{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Jo,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Sf(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const i=Sf(t);if(typeof i!="number")return;const a=this.items[i];return!n&&Gt(a)?a.value:a}has(t){const n=Sf(t);return typeof n=="number"&&n<this.items.length}set(t,n){const i=Sf(t);if(typeof i!="number")throw new Error(`Expected a valid index, not ${t}.`);const a=this.items[i];Gt(a)&&C_(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?L_(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:i,onComment:n}):JSON.stringify(this)}static from(t,n,i){const{replacer:a}=i,l=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let d of n){if(typeof a=="function"){const f=n instanceof Set?d:String(o++);d=a.call(n,f,d)}l.items.push(Su(d,void 0,i))}}return l}}function Sf(e){let t=Gt(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const ic={collection:"seq",default:!0,nodeClass:ws,tag:"tag:yaml.org,2002:seq",resolve(e,t){return tc(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>ws.from(e,t,n)},Qh={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,i){return t=Object.assign({actualString:!0},t),Qu(e,t,n,i)}},Wh={identify:e=>e==null,createNode:()=>new st(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new st(null),stringify:({source:e},t)=>typeof e=="string"&&Wh.test.test(e)?e:t.options.nullStr},Xb={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&&Xb.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 I_={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},z_={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)}},P_={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},Xh=e=>typeof e=="bigint"||Number.isInteger(e),Zb=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function B_(e,t,n){const{value:i}=e;return Xh(i)&&i>=0?n+i.toString(t):yr(e)}const $_={identify:e=>Xh(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Zb(e,2,8,n),stringify:e=>B_(e,8,"0o")},U_={identify:Xh,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Zb(e,0,10,n),stringify:yr},F_={identify:e=>Xh(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Zb(e,2,16,n),stringify:e=>B_(e,16,"0x")},GI=[nc,ic,Qh,Wh,Xb,$_,U_,F_,I_,z_,P_];function gk(e){return typeof e=="bigint"||Number.isInteger(e)}const Nf=({value:e})=>JSON.stringify(e),VI=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Nf},{identify:e=>e==null,createNode:()=>new st(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Nf},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Nf},{identify:gk,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})=>gk(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Nf}],YI={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},QI=[nc,ic].concat(VI,YI),Jb={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let a=0;a<n.length;++a)i[a]=n.charCodeAt(a);return i}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},i,a,l){if(!n)return"";const o=n;let d;if(typeof btoa=="function"){let f="";for(let h=0;h<o.length;++h)f+=String.fromCharCode(o[h]);d=btoa(f)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=st.BLOCK_LITERAL),t!==st.QUOTE_DOUBLE){const f=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),h=Math.ceil(d.length/f),g=new Array(h);for(let m=0,y=0;m<h;++m,y+=f)g[m]=d.substr(y,f);d=g.join(t===st.BLOCK_LITERAL?`
|
|
529
|
-
`:" ")}return Qu({comment:e,type:t,value:d},i,a,l)}};function q_(e,t){if(tc(e))for(let n=0;n<e.items.length;++n){let i=e.items[n];if(!en(i)){if(ec(i)){i.items.length>1&&t("Each pair must have its own sequence indicator");const a=i.items[0]||new Vn(new st(null));if(i.commentBefore&&(a.key.commentBefore=a.key.commentBefore?`${i.commentBefore}
|
|
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 H_(e,t,n){const{replacer:i}=n,a=new ws(e);a.tag="tag:yaml.org,2002:pairs";let l=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof i=="function"&&(o=i.call(t,String(l++),o));let d,f;if(Array.isArray(o))if(o.length===2)d=o[0],f=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const h=Object.keys(o);if(h.length===1)d=h[0],f=o[d];else throw new TypeError(`Expected tuple with one key, not ${h.length} keys`)}else d=o;a.items.push(Wb(d,f,n))}return a}const ex={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:q_,createNode:H_};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=H_(t,n,i),l=new this;return l.items=a.items,l}}ko.tag="tag:yaml.org,2002:omap";const tx={collection:"seq",identify:e=>e instanceof Map,nodeClass:ko,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=q_(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 K_({value:e,source:t},n){return t&&(e?G_:V_).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const G_={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:K_},V_={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:K_},WI={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},XI={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)}},ZI={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},Wu=e=>typeof e=="bigint"||Number.isInteger(e);function Zh(e,t,n,{intAsBigInt:i}){const a=e[0];if((a==="-"||a==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),i){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return a==="-"?BigInt(-1)*o:o}const l=parseInt(e,n);return a==="-"?-1*l:l}function nx(e,t,n){const{value:i}=e;if(Wu(i)){const a=i.toString(t);return i<0?"-"+n+a.substr(1):n+a}return yr(e)}const JI={identify:Wu,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Zh(e,2,2,n),stringify:e=>nx(e,2,"0b")},ez={identify:Wu,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Zh(e,1,8,n),stringify:e=>nx(e,8,"0")},tz={identify:Wu,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Zh(e,0,10,n),stringify:yr},nz={identify:Wu,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Zh(e,2,16,n),stringify:e=>nx(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(Wb(o,null,i));return l}}Eo.tag="tag:yaml.org,2002:set";const ix={collection:"map",identify:e=>e instanceof Set,nodeClass:Eo,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Eo.from(e,t,n),resolve(e,t){if(ec(e)){if(e.hasAllNullValues(!0))return Object.assign(new Eo,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function rx(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 Y_(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 Q_={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})=>rx(e,n),stringify:Y_},W_={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=>rx(e,!1),stringify:Y_},Jh={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(Jh.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,i,a,l,o,d]=t.map(Number),f=t[7]?Number((t[7]+"00").substr(1,3)):0;let h=Date.UTC(n,i-1,a,l||0,o||0,d||0,f);const g=t[8];if(g&&g!=="Z"){let m=rx(g,!1);Math.abs(m)<30&&(m*=60),h-=6e4*m}return new Date(h)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},yk=[nc,ic,Qh,Wh,G_,V_,JI,ez,tz,nz,WI,XI,ZI,Jb,ha,tx,ex,ix,Q_,W_,Jh],bk=new Map([["core",GI],["failsafe",[nc,ic,Qh]],["json",QI],["yaml11",yk],["yaml-1.1",yk]]),xk={binary:Jb,bool:Xb,float:P_,floatExp:z_,floatNaN:I_,floatTime:W_,int:U_,intHex:F_,intOct:$_,intTime:Q_,map:nc,merge:ha,null:Wh,omap:tx,pairs:ex,seq:ic,set:ix,timestamp:Jh},iz={"tag:yaml.org,2002:binary":Jb,"tag:yaml.org,2002:merge":ha,"tag:yaml.org,2002:omap":tx,"tag:yaml.org,2002:pairs":ex,"tag:yaml.org,2002:set":ix,"tag:yaml.org,2002:timestamp":Jh};function Og(e,t,n){const i=bk.get(t);if(i&&!e)return n&&!i.includes(ha)?i.concat(ha):i.slice();let a=i;if(!a)if(Array.isArray(e))a=[];else{const l=Array.from(bk.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${l} or define customTags array`)}if(Array.isArray(e))for(const l of e)a=a.concat(l);else typeof e=="function"&&(a=e(a.slice()));return n&&(a=a.concat(ha)),a.reduce((l,o)=>{const d=typeof o=="string"?xk[o]:o;if(!d){const f=JSON.stringify(o),h=Object.keys(xk).map(g=>JSON.stringify(g)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${h}`)}return l.includes(d)||l.push(d),l},[])}const rz=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;let X_=class Z_{constructor({compat:t,customTags:n,merge:i,resolveKnownTags:a,schema:l,sortMapEntries:o,toStringDefaults:d}){this.compat=Array.isArray(t)?Og(t,"compat"):t?Og(null,t):null,this.name=typeof l=="string"&&l||"core",this.knownTags=a?iz:{},this.tags=Og(n,this.name,i),this.toStringOptions=d??null,Object.defineProperty(this,xs,{value:nc}),Object.defineProperty(this,Lr,{value:Qh}),Object.defineProperty(this,Jo,{value:ic}),this.sortMapEntries=typeof o=="function"?o:o===!0?rz:null}clone(){const t=Object.create(Z_.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function az(e,t){var f;const n=[];let i=t.directives===!0;if(t.directives!==!1&&e.directives){const h=e.directives.toString(e);h?(n.push(h),i=!0):e.directives.docStart&&(i=!0)}i&&n.push("---");const a=M_(e,t),{commentString:l}=a.options;if(e.commentBefore){n.length!==1&&n.unshift("");const h=l(e.commentBefore);n.unshift(da(h,""))}let o=!1,d=null;if(e.contents){if(cn(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){const m=l(e.contents.commentBefore);n.push(da(m,""))}a.forceBlockIndent=!!e.comment,d=e.contents.comment}const h=d?void 0:()=>o=!0;let g=Bo(e.contents,a,()=>d=null,h);d&&(g+=Ws(g,"",l(d))),(g[0]==="|"||g[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${g}`:n.push(g)}else n.push(Bo(e.contents,a));if((f=e.directives)!=null&&f.docEnd)if(e.comment){const h=l(e.comment);h.includes(`
|
|
532
|
-
`)?(n.push("..."),n.push(da(h,""))):n.push(`... ${h}`)}else n.push("...");else{let h=e.comment;h&&o&&(h=h.replace(/^\n+/,"")),h&&((!o||d)&&n[n.length-1]!==""&&n.push(""),n.push(da(l(h),"")))}return n.join(`
|
|
533
|
-
`)+`
|
|
534
|
-
`}class rc{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Yi,{value:Hy});let a=null;typeof n=="function"||Array.isArray(n)?a=n:i===void 0&&n&&(i=n,n=void 0);const l=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=l;let{version:o}=l;i!=null&&i._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new ti({version:o}),this.setSchema(o,i),this.contents=t===void 0?null:this.createNode(t,a,i)}clone(){const t=Object.create(rc.prototype,{[Yi]:{value:Hy}});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=__(this);t.anchor=!n||i.has(n)?j_(n||"a",i):n}return new Kh(t.anchor)}createNode(t,n,i){let a;if(typeof n=="function")t=n.call({"":t},"",t),a=n;else if(Array.isArray(n)){const 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:h,tag:g}=i??{},{onAnchor:m,setAnchors:y,sourceObjects:b}=OI(this,o||"a"),k={aliasDuplicateObjects:l??!0,keepUndefined:f??!1,onAnchor:m,onTagObj:h,replacer:a,schema:this.schema,sourceObjects:b},v=Su(t,g,k);return d&&on(v)&&(v.flow=!0),y(),v}createPair(t,n,i={}){const a=this.createNode(t,null,i),l=this.createNode(n,null,i);return new Vn(a,l)}delete(t){return so(this.contents)?this.contents.delete(t):!1}deleteIn(t){return cu(t)?this.contents==null?!1:(this.contents=null,!0):so(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return on(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return cu(t)?!n&&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 cu(t)?this.contents!==void 0:on(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=mh(this.schema,[t],n):so(this.contents)&&this.contents.set(t,n)}setIn(t,n){cu(t)?this.contents=n:this.contents==null?this.contents=mh(this.schema,Array.from(t),n):so(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let i;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ti({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new ti({version:t}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{const a=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${a}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new X_(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:i,maxAliasCount:a,onAnchor:l,reviver:o}={}){const d={anchors:new Map,doc:this,keep:!t,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof a=="number"?a:100},f=Ki(this.contents,n??"",d);if(typeof l=="function")for(const{count:h,res:g}of d.anchors.values())l(g,h);return typeof o=="function"?bo(o,{"":f},"",f):f}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return az(this,t)}}function so(e){if(on(e))return!0;throw new Error("Expected a YAML collection as document contents")}class ax extends Error{constructor(t,n,i,a){super(),this.name=t,this.code=i,this.message=a,this.pos=n}}class Zs extends ax{constructor(t,n,i){super("YAMLParseError",t,n,i)}}class J_ extends ax{constructor(t,n,i){super("YAMLWarning",t,n,i)}}const yh=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(d=>t.linePos(d));const{line:i,col:a}=n.linePos[0];n.message+=` at line ${i}, column ${a}`;let l=a-1,o=e.substring(t.lineStarts[i-1],t.lineStarts[i]).replace(/[\n\r]+$/,"");if(l>=60&&o.length>80){const d=Math.min(l-39,o.length-79);o="…"+o.substring(d),l-=d-1}if(o.length>80&&(o=o.substring(0,79)+"…"),i>1&&/^ *$/.test(o.substring(0,l))){let d=e.substring(t.lineStarts[i-2],t.lineStarts[i-1]);d.length>80&&(d=d.substring(0,79)+`…
|
|
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 h=" ".repeat(l)+"^".repeat(d);n.message+=`:
|
|
536
|
-
|
|
537
|
-
${o}
|
|
538
|
-
${h}
|
|
539
|
-
`}};function $o(e,{flow:t,indicator:n,next:i,offset:a,onError:l,parentIndent:o,startOnNewline:d}){let f=!1,h=d,g=d,m="",y="",b=!1,k=!1,v=null,S=null,E=null,C=null,N=null,_=null,T=null;for(const O of e)switch(k&&(O.type!=="space"&&O.type!=="newline"&&O.type!=="comma"&&l(O.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),k=!1),v&&(h&&O.type!=="comment"&&O.type!=="newline"&&l(v,"TAB_AS_INDENT","Tabs are not allowed as indentation"),v=null),O.type){case"space":!t&&(n!=="doc-start"||(i==null?void 0:i.type)!=="flow-collection")&&O.source.includes(" ")&&(v=O),g=!0;break;case"comment":{g||l(O,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const B=O.source.substring(1)||" ";m?m+=y+B:m=B,y="",h=!1;break}case"newline":h?m?m+=O.source:(!_||n!=="seq-item-ind")&&(f=!0):y+=O.source,h=!0,b=!0,(S||E)&&(C=O),g=!0;break;case"anchor":S&&l(O,"MULTIPLE_ANCHORS","A node can have at most one anchor"),O.source.endsWith(":")&&l(O.offset+O.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),S=O,T??(T=O.offset),h=!1,g=!1,k=!0;break;case"tag":{E&&l(O,"MULTIPLE_TAGS","A node can have at most one tag"),E=O,T??(T=O.offset),h=!1,g=!1,k=!0;break}case n:(S||E)&&l(O,"BAD_PROP_ORDER",`Anchors and tags must be after the ${O.source} indicator`),_&&l(O,"UNEXPECTED_TOKEN",`Unexpected ${O.source} in ${t??"collection"}`),_=O,h=n==="seq-item-ind"||n==="explicit-key-ind",g=!1;break;case"comma":if(t){N&&l(O,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),N=O,h=!1,g=!1;break}default:l(O,"UNEXPECTED_TOKEN",`Unexpected ${O.type} token`),h=!1,g=!1}const M=e[e.length-1],R=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&&(h&&v.indent<=o||(i==null?void 0:i.type)==="block-map"||(i==null?void 0:i.type)==="block-seq")&&l(v,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:N,found:_,spaceBefore:f,comment:m,hasNewline:b,anchor:S,tag:E,newlineAfterProp:C,end:R,start:T??R}}function Nu(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
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(Nu(t.key)||Nu(t.value))return!0}return!1;default:return!0}}function Yy(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const i=t.end[0];i.indent===e&&(i.source==="]"||i.source==="}")&&Nu(t)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function e2(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 vk="All mapping items must start at the same column";function sz({composeNode:e,composeEmptyNode:t},n,i,a,l){var g;const o=(l==null?void 0:l.nodeClass)??Ni,d=new o(n.schema);n.atRoot&&(n.atRoot=!1);let f=i.offset,h=null;for(const m of i.items){const{start:y,key:b,sep:k,value:v}=m,S=$o(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",vk)),!S.anchor&&!S.tag&&!k){h=S.end,S.comment&&(d.comment?d.comment+=`
|
|
541
|
-
`+S.comment:d.comment=S.comment);continue}(S.newlineAfterProp||Nu(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",vk);n.atKey=!0;const C=S.end,N=b?e(n,b,S,a):t(n,C,y,null,S,a);n.schema.compat&&Yy(i.indent,b,a),n.atKey=!1,e2(n,d.items,N)&&a(C,"DUPLICATE_KEY","Map keys must be unique");const _=$o(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&&Yy(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 h&&h<f&&a(h,"IMPOSSIBLE","Map comment with trailing content"),d.range=[i.offset,f,h??f],d}function lz({composeNode:e,composeEmptyNode:t},n,i,a,l){const o=(l==null?void 0:l.nodeClass)??ws,d=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=i.offset,h=null;for(const{start:g,value:m}of i.items){const y=$o(g,{indicator:"seq-item-ind",next:m,offset:f,onError:a,parentIndent:i.indent,startOnNewline:!0});if(!y.found)if(y.anchor||y.tag||m)(m==null?void 0:m.type)==="block-seq"?a(y.end,"BAD_INDENT","All sequence items must start at the same column"):a(f,"MISSING_CHAR","Sequence item without - indicator");else{h=y.end,y.comment&&(d.comment=y.comment);continue}const b=m?e(n,m,y,a):t(n,y.end,g,null,y,a);n.schema.compat&&Yy(i.indent,m,a),f=b.range[2],d.items.push(b)}return d.range=[i.offset,f,h??f],d}function Xu(e,t,n,i){let a="";if(e){let l=!1,o="";for(const d of e){const{source:f,type:h}=d;switch(h){case"space":l=!0;break;case"comment":{n&&!l&&i(d,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const g=f.substring(1)||" ";a?a+=o+g:a=g,o="";break}case"newline":a&&(o+=f),l=!0;break;default:i(d,"UNEXPECTED_TOKEN",`Unexpected ${h} at node end`)}t+=f.length}}return{comment:a,offset:t}}const Rg="Block collections are not allowed within flow collections",Lg=e=>e&&(e.type==="block-map"||e.type==="block-seq");function oz({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),h=new f(n.schema);h.flow=!0;const g=n.atRoot;g&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let m=i.offset+i.start.source.length;for(let E=0;E<i.items.length;++E){const C=i.items[E],{start:N,key:_,sep:T,value:M}=C,R=$o(N,{flow:d,indicator:"explicit-key-ind",next:_??(T==null?void 0:T[0]),offset:m,onError:a,parentIndent:i.indent,startOnNewline:!1});if(!R.found){if(!R.anchor&&!R.tag&&!T&&!M){E===0&&R.comma?a(R.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${d}`):E<i.items.length-1&&a(R.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${d}`),R.comment&&(h.comment?h.comment+=`
|
|
543
|
-
`+R.comment:h.comment=R.comment),m=R.end;continue}!o&&n.options.strict&&Nu(_)&&a(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(E===0)R.comma&&a(R.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${d}`);else if(R.comma||a(R.start,"MISSING_CHAR",`Missing , between ${d} items`),R.comment){let O="";e:for(const B of N)switch(B.type){case"comma":case"space":break;case"comment":O=B.source.substring(1);break e;default:break e}if(O){let B=h.items[h.items.length-1];en(B)&&(B=B.value??B.key),B.comment?B.comment+=`
|
|
544
|
-
`+O:B.comment=O,R.comment=R.comment.substring(O.length+1)}}if(!o&&!T&&!R.found){const O=M?e(n,M,R,a):t(n,R.end,T,null,R,a);h.items.push(O),m=O.range[2],Lg(M)&&a(O.range,"BLOCK_IN_FLOW",Rg)}else{n.atKey=!0;const O=R.end,B=_?e(n,_,R,a):t(n,O,N,null,R,a);Lg(_)&&a(B.range,"BLOCK_IN_FLOW",Rg),n.atKey=!1;const U=$o(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&&!R.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}}R.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?Lg(M)&&a(K.range,"BLOCK_IN_FLOW",Rg):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=h;e2(n,Y.items,B)&&a(O,"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]],h.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=Xu(k,v,n.options.strict,a);E.comment&&(h.comment?h.comment+=`
|
|
546
|
-
`+E.comment:h.comment=E.comment),h.range=[i.offset,v,E.offset]}else h.range=[i.offset,v,v];return h}function Ig(e,t,n,i,a,l){const o=n.type==="block-map"?sz(e,t,n,i,l):n.type==="block-seq"?lz(e,t,n,i,l):oz(e,t,n,i,l),d=o.constructor;return a==="!"||a===d.tagName?(o.tag=d.tagName,o):(a&&(o.tag=a),o)}function cz(e,t,n,i,a){var y;const l=i.tag,o=l?t.directives.tagName(l.source,b=>a(l,"TAG_RESOLVE_FAILED",b)):null;if(n.type==="block-seq"){const{anchor:b,newlineAfterProp:k}=i,v=b&&l?b.offset>l.offset?b:l:b??l;v&&(!k||k.offset<v.offset)&&a(v,"MISSING_CHAR","Missing newline after block sequence props")}const d=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!l||!o||o==="!"||o===Ni.tagName&&d==="map"||o===ws.tagName&&d==="seq")return Ig(e,t,n,a,o);let f=t.schema.tags.find(b=>b.tag===o&&b.collection===d);if(!f){const b=t.schema.knownTags[o];if((b==null?void 0:b.collection)===d)t.schema.tags.push(Object.assign({},b,{default:!1})),f=b;else return b?a(l,"BAD_COLLECTION_TYPE",`${b.tag} used for ${d} collection, but expects ${b.collection??"scalar"}`,!0):a(l,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Ig(e,t,n,a,o)}const h=Ig(e,t,n,a,o,f),g=((y=f.resolve)==null?void 0:y.call(f,h,b=>a(l,"TAG_RESOLVE_FAILED",b),t.options))??h,m=cn(g)?g:new st(g);return m.range=h.range,m.tag=o,f!=null&&f.format&&(m.format=f.format),m}function t2(e,t,n){const i=t.offset,a=uz(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?dz(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,h=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(h+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(h,"BAD_INDENT","Block scalar values in collections must be indented");break}h+=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];h+=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(h-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 uz({offset:e,props:t},n,i){if(t[0].type!=="block-scalar-header")return i(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:a}=t[0],l=a[0];let o=0,d="",f=-1;for(let y=1;y<a.length;++y){const b=a[y];if(!d&&(b==="-"||b==="+"))d=b;else{const k=Number(b);!o&&k?o=k:f===-1&&(f=e+y)}}f!==-1&&i(f,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${a}`);let h=!1,g="",m=a.length;for(let y=1;y<t.length;++y){const b=t[y];switch(b.type){case"space":h=!0;case"newline":m+=b.source.length;break;case"comment":n&&!h&&i(b,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),m+=b.source.length,g=b.source.substring(1);break;case"error":i(b,"UNEXPECTED_TOKEN",b.message),m+=b.source.length;break;default:{const k=`Unexpected token in block scalar header: ${b.type}`;i(b,"UNEXPECTED_TOKEN",k);const v=b.source;v&&typeof v=="string"&&(m+=v.length)}}}return{mode:l,indent:o,chomp:d,comment:g,length:m}}function dz(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 n2(e,t,n){const{offset:i,type:a,source:l,end:o}=e;let d,f;const h=(y,b,k)=>n(i+y,b,k);switch(a){case"scalar":d=st.PLAIN,f=fz(l,h);break;case"single-quoted-scalar":d=st.QUOTE_SINGLE,f=hz(l,h);break;case"double-quoted-scalar":d=st.QUOTE_DOUBLE,f=pz(l,h);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${a}`),{value:"",type:null,comment:"",range:[i,i+l.length,i+l.length]}}const g=i+l.length,m=Xu(o,g,t,n);return{value:f,type:d,comment:m.comment,range:[i,g,m.offset]}}function fz(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}`),i2(e)}function hz(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),i2(e.slice(1,-1)).replace(/''/g,"'")}function i2(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 pz(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}=mz(e,i);n+=l,i=o}else if(a==="\\"){let l=e[++i];const o=gz[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+=yz(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 mz(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 gz={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
576
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function yz(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 r2(e,t,n,i){const{value:a,type:l,comment:o,range:d}=t.type==="block-scalar"?t2(e,t,i):n2(t,e.options.strict,i),f=n?e.directives.tagName(n.source,m=>i(n,"TAG_RESOLVE_FAILED",m)):null;let h;e.options.stringKeys&&e.atKey?h=e.schema[Lr]:f?h=bz(e.schema,a,f,n,i):t.type==="scalar"?h=xz(e,a,t,i):h=e.schema[Lr];let g;try{const m=h.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),h.format&&(g.format=h.format),o&&(g.comment=o),g}function bz(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 xz({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 h;return f.default&&((h=f.test)==null?void 0:h.test(i))})??n[Lr];if(o.tag!==d.tag){const f=t.tagString(o.tag),h=t.tagString(d.tag),g=`Value may be parsed as either ${f} or ${h}`;l(a,"TAG_RESOLVE_FAILED",g,!0)}}return o}function vz(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 wz={composeNode:a2,composeEmptyNode:sx};function a2(e,t,n,i){const a=e.atKey,{spaceBefore:l,comment:o,anchor:d,tag:f}=n;let h,g=!0;switch(t.type){case"alias":h=kz(e,t,i),(d||f)&&i(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":h=r2(e,t,f,i),d&&(h.anchor=d.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{h=cz(wz,e,t,n,i),d&&(h.anchor=d.source.substring(1))}catch(m){const y=m instanceof Error?m.message:String(m);i(t,"RESOURCE_EXHAUSTION",y)}break;default:{const m=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;i(t,"UNEXPECTED_TOKEN",m),g=!1}}return h??(h=sx(e,t.offset,void 0,null,n,i)),d&&h.anchor===""&&i(d,"BAD_ALIAS","Anchor cannot be an empty string"),a&&e.options.stringKeys&&(!Gt(h)||typeof h.value!="string"||h.tag&&h.tag!=="tag:yaml.org,2002:str")&&i(f??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),l&&(h.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?h.comment=o:h.commentBefore=o),e.options.keepSourceTokens&&g&&(h.srcToken=t),h}function sx(e,t,n,i,{spaceBefore:a,comment:l,anchor:o,tag:d,end:f},h){const g={type:"scalar",offset:vz(t,n,i),indent:-1,source:""},m=r2(e,g,d,h);return o&&(m.anchor=o.source.substring(1),m.anchor===""&&h(o,"BAD_ALIAS","Anchor cannot be an empty string")),a&&(m.spaceBefore=!0),l&&(m.comment=l,m.range[2]=f),m}function kz({options:e},{offset:t,source:n,end:i},a){const l=new Kh(n.substring(1));l.source===""&&a(t,"BAD_ALIAS","Alias cannot be an empty string"),l.source.endsWith(":")&&a(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,d=Xu(i,o,e.strict,a);return l.range=[t,o,d.offset],d.comment&&(l.comment=d.comment),l}function Ez(e,t,{offset:n,start:i,value:a,end:l},o){const d=Object.assign({_directives:t},e),f=new rc(void 0,d),h={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},g=$o(i,{indicator:"doc-start",next:a??(l==null?void 0:l[0]),offset:n,onError:o,parentIndent:0,startOnNewline:!0});g.found&&(f.directives.docStart=!0,a&&(a.type==="block-map"||a.type==="block-seq")&&!g.hasNewline&&o(g.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),f.contents=a?a2(h,a,g,o):sx(h,g.end,i,null,g,o);const m=f.contents.range[2],y=Xu(l,m,!1,o);return y.comment&&(f.comment=y.comment),f.range=[n,m,y.offset],f}function eu(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function wk(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 lx{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,a,l)=>{const o=eu(n);l?this.warnings.push(new J_(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}=wk(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:wk(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,i=-1){for(const a of t)yield*this.next(a);yield*this.end(n,i)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,i,a)=>{const l=eu(t);l[0]+=n,this.onError(l,"BAD_DIRECTIVE",i,a)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=Ez(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,i=new Zs(eu(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){const i="Unexpected doc-end without preceding document";this.errors.push(new Zs(eu(t),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;const n=Xu(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const i=this.doc.comment;this.doc.comment=i?`${i}
|
|
583
|
-
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Zs(eu(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const i=Object.assign({_directives:this.directives},this.options),a=new rc(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),a.range=[0,n,n],this.decorate(a,!1),yield a}}}function Sz(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 n2(e,t,i);case"block-scalar":return t2({options:{strict:t}},e,i)}}return null}function Nz(e,t){const{implicitKey:n=!1,indent:i,inFlow:a=!1,offset:l=-1,type:o="PLAIN"}=t,d=Qu({type:o,value:e},{implicitKey:n,indent:i>0?" ".repeat(i):"",inFlow:a,options:{blockQuote:!0,lineWidth:-1}}),f=t.end??[{type:"newline",offset:-1,indent:i,source:`
|
|
584
|
-
`}];switch(d[0]){case"|":case">":{const h=d.indexOf(`
|
|
585
|
-
`),g=d.substring(0,h),m=d.substring(h+1)+`
|
|
586
|
-
`,y=[{type:"block-scalar-header",offset:l,indent:i,source:g}];return s2(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 _z(e,t,n={}){let{afterKey:i=!1,implicitKey:a=!1,inFlow:l=!1,type:o}=n,d="indent"in e?e.indent:null;if(i&&typeof d=="number"&&(d+=2),!o)switch(e.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{const h=e.props[0];if(h.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=h.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}const f=Qu({type:o,value:t},{implicitKey:a||d===null,indent:d!==null&&d>0?" ".repeat(d):"",inFlow:l,options:{blockQuote:!0,lineWidth:-1}});switch(f[0]){case"|":case">":jz(e,f);break;case'"':zg(e,f,"double-quoted-scalar");break;case"'":zg(e,f,"single-quoted-scalar");break;default:zg(e,f,"scalar")}}function jz(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}];s2(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 s2(e,t){if(t)for(const n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function zg(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{const i=e.props.slice(1);let a=t.length;e.props[0].type==="block-scalar-header"&&(a-=e.props[0].source.length);for(const l of i)l.offset+=a;delete e.props,Object.assign(e,{type:n,source:t,end:i});break}case"block-map":case"block-seq":{const a={type:"newline",offset:e.offset+t.length,indent:e.indent,source:`
|
|
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 Cz=e=>"type"in e?bh(e):th(e);function bh(e){switch(e.type){case"block-scalar":{let t="";for(const n of e.props)t+=bh(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(const n of e.items)t+=th(n);return t}case"flow-collection":{let t=e.start.source;for(const n of e.items)t+=th(n);for(const n of e.end)t+=n.source;return t}case"document":{let t=th(e);if(e.end)for(const n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(const n of e.end)t+=n.source;return t}}}function th({start:e,key:t,sep:n,value:i}){let a="";for(const l of e)a+=l.source;if(t&&(a+=bh(t)),n)for(const l of n)a+=l.source;return i&&(a+=bh(i)),a}const Qy=Symbol("break visit"),Az=Symbol("skip children"),l2=Symbol("remove item");function pl(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),o2(Object.freeze([]),e,t)}pl.BREAK=Qy;pl.SKIP=Az;pl.REMOVE=l2;pl.itemAtPath=(e,t)=>{let n=e;for(const[i,a]of t){const l=n==null?void 0:n[i];if(l&&"items"in l)n=l.items[a];else return}return n};pl.parentCollection=(e,t)=>{const n=pl.itemAtPath(e,t.slice(0,-1)),i=t[t.length-1][0],a=n==null?void 0:n[i];if(a&&"items"in a)return a;throw new Error("Parent collection not found")};function o2(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=o2(Object.freeze(e.concat([[a,o]])),l.items[o],n);if(typeof d=="number")o=d-1;else{if(d===Qy)return Qy;d===l2&&(l.items.splice(o,1),o-=1)}}typeof i=="function"&&a==="key"&&(i=i(t,e))}}return typeof i=="function"?i(t,e):i}const ep="\uFEFF",tp="",np="",_u="",Tz=e=>!!e&&"items"in e,Mz=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function Dz(e){switch(e){case ep:return"<BOM>";case tp:return"<DOC>";case np:return"<FLOW_END>";case _u:return"<SCALAR>";default:return JSON.stringify(e)}}function c2(e){switch(e){case ep:return"byte-order-mark";case tp:return"doc-mode";case np:return"flow-error-end";case _u:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
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 Oz=Object.freeze(Object.defineProperty({__proto__:null,BOM:ep,DOCUMENT:tp,FLOW_END:np,SCALAR:_u,createScalarToken:Nz,isCollection:Tz,isScalar:Mz,prettyToken:Dz,resolveAsScalar:Sz,setScalarValue:_z,stringify:Cz,tokenType:c2,visit:pl},Symbol.toStringTag,{value:"Module"}));function ar(e){switch(e){case void 0:case" ":case`
|
|
594
|
-
`:case"\r":case" ":return!0;default:return!1}}const kk=new Set("0123456789ABCDEFabcdef"),Rz=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),_f=new Set(",[]{}"),Lz=new Set(` ,[]{}
|
|
595
|
-
\r `),Pg=e=>!e||Lz.has(e);class u2{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]===ep&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,i=t.indexOf("#");for(;i!==-1;){const l=t[i-1];if(l===" "||l===" "){n=i-1;break}else i=t.indexOf("#",i+1)}for(;;){const l=t[n-1];if(l===" "||l===" ")n-=1;else break}const a=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-a),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield tp,yield*this.parseLineStart()}*parseLineStart(){const t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const n=this.peek(3);if((n==="---"||n==="...")&&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(Pg),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,i=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const a=this.getLine();if(a===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&a[0]!=="#"||i===0&&(a.startsWith("---")||a.startsWith("..."))&&ar(a[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(a[0]==="]"||a[0]==="}")))return this.flowLevel=0,yield np,yield*this.parseLineStart();let l=0;for(;a[l]===",";)l+=yield*this.pushCount(1),l+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(l+=yield*this.pushIndicators(),a[l]){case void 0:return"flow";case"#":return yield*this.pushCount(a.length-l),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Pg),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||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 _u,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,i=this.pos-1,a;for(;a=this.buffer[++i];)if(a===":"){const l=this.buffer[i+1];if(ar(l)||t&&_f.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&&_f.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&&_f.has(a))break;n=i}return!a&&!this.atEnd?this.setNext("plain-scalar"):(yield _u,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const i=this.buffer.slice(this.pos,t);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Pg))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(ar(n)||t&&_f.has(n))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!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(Rz.has(n))n=this.buffer[++t];else if(n==="%"&&kk.has(this.buffer[t+1])&&kk.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 d2{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 Ek(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 f2(e){switch(e==null?void 0:e.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function jf(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function lo(e){var n;if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function Sk(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,f2(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 ox{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 u2,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=c2(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"&&Sk(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&&Ek(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":{Ek(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}const n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){const n=jf(this.peek(2)),i=lo(n);let a;t.end?(a=t.end,a.push(this.sourceToken),delete t.end):a=[this.sourceToken];const l={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:i,key:t,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
|
|
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 h=n.sep[f];switch(h.type){case"newline":d.push(f);break;case"space":break;case"comment":h.indent>t.indent&&(d.length=0);break;default:d.length=0}}d.length>=2&&(o=n.sep.splice(d[1]))}switch(this.type){case"anchor":case"tag":l||n.value?(o.push(this.sourceToken),t.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):l||n.value?(o.push(this.sourceToken),t.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ls(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(f2(n.key)&&!ls(n.sep,"newline")){const d=lo(n.start),f=n.key,h=n.sep;h.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:f,sep:h}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(ls(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const d=lo(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||l?t.items.push({start:o,key:null,sep:[this.sourceToken]}):ls(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const d=this.flowScalar(this.type);l||n.value?(t.items.push({start:o,key:d,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(d):(Object.assign(n,{key:d,sep:[]}),this.onKeyLine=!0);return}default:{const d=this.startBlockValue(t);if(d){if(d.type==="block-seq"){if(!n.explicitKey&&n.sep&&!ls(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else a&&t.items.push({start:o});this.stack.push(d);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var i;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const a="end"in n.value?n.value.end:void 0,l=Array.isArray(a)?a[a.length-1]:void 0;(l==null?void 0:l.type)==="comment"?a==null||a.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const a=t.items[t.items.length-2],l=(i=a==null?void 0:a.value)==null?void 0:i.end;if(Array.isArray(l)){Array.prototype.push.apply(l,n.start),l.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||ls(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const a=this.startBlockValue(t);if(a){this.stack.push(a);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while((i==null?void 0:i.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const a=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:a,sep:[]}):n.sep?this.stack.push(a):Object.assign(n,{key:a,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const i=this.startBlockValue(t);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{const i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===t.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){const a=jf(i),l=lo(a);Sk(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=jf(t),i=lo(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=jf(t),i=lo(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function h2(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new d2||null,prettyErrors:t}}function Iz(e,t={}){const{lineCounter:n,prettyErrors:i}=h2(t),a=new ox(n==null?void 0:n.addNewLine),l=new lx(t),o=Array.from(l.compose(a.parse(e)));if(i&&n)for(const d of o)d.errors.forEach(yh(e,n)),d.warnings.forEach(yh(e,n));return o.length>0?o:Object.assign([],{empty:!0},l.streamInfo())}function p2(e,t={}){const{lineCounter:n,prettyErrors:i}=h2(t),a=new ox(n==null?void 0:n.addNewLine),l=new lx(t);let o=null;for(const d of l.compose(a.parse(e),!0,e.length))if(!o)o=d;else if(o.options.logLevel!=="silent"){o.errors.push(new Zs(d.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(o.errors.forEach(yh(e,n)),o.warnings.forEach(yh(e,n))),o}function zz(e,t,n){let i;typeof t=="function"?i=t:n===void 0&&t&&typeof t=="object"&&(n=t);const a=p2(e,n);if(!a)return null;if(a.warnings.forEach(l=>D_(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 Pz(e,t,n){let i=null;if(typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){const a=Math.round(n);n=a<1?void 0:a>8?{indent:8}:{indent:a}}if(e===void 0){const{keepUndefined:a}=n??t??{};if(!a)return}return wl(e)&&!i?e.toString(n):new rc(e,i,n).toString(n)}const Nk=Object.freeze(Object.defineProperty({__proto__:null,Alias:Kh,CST:Oz,Composer:lx,Document:rc,Lexer:u2,LineCounter:d2,Pair:Vn,Parser:ox,Scalar:st,Schema:X_,YAMLError:ax,YAMLMap:Ni,YAMLParseError:Zs,YAMLSeq:ws,YAMLWarning:J_,isAlias:Ss,isCollection:on,isDocument:wl,isMap:ec,isNode:cn,isPair:en,isScalar:Gt,isSeq:tc,parse:zz,parseAllDocuments:Iz,parseDocument:p2,stringify:Pz,visit:kl,visitAsync:Hh},Symbol.toStringTag,{value:"Module"}));function Bz({projectName:e,file:t,onClose:n,onSaved:i}){const a=Be(),l=Ft(),{alert:o}=un(),{data:d,isLoading:f,isError:h,error:g,refetch:m}=Ye({queryKey:["pipeline-file",e,t],queryFn:()=>cI(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 R=O=>{O.key==="Escape"&&n()};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[n]);const C=Et({mutationFn:()=>{if(k===null||S===null)throw new Error("no draft");return uI(e,t,k,S)},onSuccess:R=>{E(R.etag),l.invalidateQueries({queryKey:["pipeline-file",e,t]}),l.invalidateQueries({queryKey:["project-pipelines",e]}),i()},onError:R=>{const O=R.status;o({title:a(O===409?"pipelineEditor.error.conflict.title":O===422?"pipelineEditor.error.yaml.title":"pipelineEditor.error.save.title"),body:R instanceof Error?R.message:String(R)})}}),N=k!==null&&d&&k!==d.content,{parsed:_,parseError:T}=j.useMemo(()=>{if(k===null)return{parsed:null,parseError:null};try{return{parsed:Nk.parse(k)??{},parseError:null}}catch(R){return{parsed:null,parseError:R instanceof Error?R.message:String(R)}}},[k]),M=R=>{try{const O=Nk.stringify(R,{lineWidth:0});v(O)}catch(O){o({title:a("pipelineEditor.error.serialize.title"),body:O instanceof Error?O.message:String(O)})}};return c.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",children:c.jsxs("div",{className:"nb-card mt-8 w-full max-w-4xl flex flex-col",style:{maxHeight:"calc(100vh - 64px)"},children:[c.jsxs("header",{className:"flex items-start justify-between gap-3 mb-3 flex-shrink-0",children:[c.jsxs("div",{children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold flex items-center gap-2",children:[c.jsx(dk,{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(bn,{size:14,strokeWidth:3})})]}),f&&c.jsx("p",{className:"text-[var(--color-text-muted)]",children:a("common.loading")}),h&&c.jsx("p",{className:"text-[var(--color-crashed)]",children:a("pipelineEditor.error.load",{detail:g instanceof Error?g.message:String(g)})}),d&&k!==null&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center gap-3 mb-3 flex-shrink-0 flex-wrap",children:[c.jsxs("div",{className:"flex gap-1 p-1 bg-[var(--color-bg)] border-[2px] border-[var(--color-text)] rounded-full shadow-[2px_2px_0_var(--color-text)]",children:[c.jsxs("button",{type:"button",onClick:()=>b("structured"),"aria-pressed":y==="structured",disabled:!!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(Fh,{size:11,strokeWidth:2.5}),a("pipelineEditor.mode.structured")]}),c.jsxs("button",{type:"button",onClick:()=>b("yaml"),"aria-pressed":y==="yaml",className:["px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1.5",y==="yaml"?"bg-[var(--color-primary)] text-[var(--color-text)] shadow-[1px_1px_0_var(--color-text)]":"text-[var(--color-text-muted)]"].join(" "),children:[c.jsx(dk,{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(ku,{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($z,{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:R=>v(R.target.value),spellCheck:!1,"aria-label":a("pipelineEditor.yamlAria")})]}),c.jsxs("div",{className:"flex items-center justify-between mt-3 pt-3 border-t-2 border-dashed border-[var(--color-text)] flex-shrink-0",children:[c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children: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(Eu,{size:12,strokeWidth:2.5})," ",a("pipelineEditor.status.saved")]}):a("pipelineEditor.status.noChanges")}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{className:"nb-btn",style:{padding:"6px 14px"},onClick:()=>{v(null),m()},disabled:C.isPending,type:"button",children:a("pipelineEditor.reload")}),c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 14px"},onClick:()=>C.mutate(),disabled:!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 $z({parsed:e,onChange:t}){const n=Be(),i=e.stages??[],a=h=>{t({...e,stages:h})},l=()=>{a([...i,{name:`stage-${i.length+1}`,on_complete:"move_card Done"}])},o=h=>{a(i.filter((g,m)=>m!==h))},d=(h,g)=>{const m=[...i],y=h+g;y<0||y>=m.length||([m[h],m[y]]=[m[y],m[h]],a(m))},f=(h,g)=>{a(i.map((m,y)=>y===h?{...m,...g}:m))};return c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{className:"flex bg-surface-input items-center gap-3 p-3 border-2 border-[var(--color-text)] rounded-lg",children:[c.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[c.jsx("span",{className:"font-bold",children:"mode:"}),c.jsxs("select",{className:"nb-input",style:{padding:"4px 10px",fontSize:12},value:e.mode??"project",onChange:h=>t({...e,mode:h.target.value}),children:[c.jsx("option",{value:"project",children:"project"}),c.jsx("option",{value:"steps",children:"steps"})]})]}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:n("pipelineEditor.modeHint")})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider",children:n("pipelineEditor.stages.heading",{count:i.length})}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",style:{padding:"4px 12px",fontSize:12},onClick:l,"aria-label":n("pipelineEditor.stages.add"),children:[c.jsx(pi,{size:11,strokeWidth:3})," ",n("pipelineEditor.stages.add")]})]}),i.length===0?c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] italic p-4 border-2 border-dashed border-[var(--color-text)] rounded-lg text-center",children:n("pipelineEditor.stages.empty")}):c.jsx("div",{className:"flex flex-col gap-3",children:i.map((h,g)=>c.jsx(Uz,{stage:h,index:g,total:i.length,onChange:m=>f(g,m),onRemove:()=>o(g),onMoveUp:()=>d(g,-1),onMoveDown:()=>d(g,1)},g))})]})]})}function Uz({stage:e,index:t,total:n,onChange:i,onRemove:a,onMoveUp:l,onMoveDown:o}){const d=Be(),f=e.on_fail??{};return c.jsxs("div",{className:"nb-card bg-[var(--color-bg-cream)] p-4",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsxs("h4",{className:"font-[family-name:var(--font-heading)] font-bold text-sm",children:["Stage #",t+1,e.name&&c.jsx("code",{className:"ml-2 text-xs font-[family-name:var(--font-mono)] bg-[var(--color-bg)] border-2 border-[var(--color-text)] px-2 py-0.5 rounded",children:e.name})]}),c.jsxs("div",{className:"flex gap-1",children:[c.jsx("button",{type:"button",className:"nb-btn",style:{padding:"3px 8px"},onClick:l,disabled:t===0,"aria-label":d("pipelineEditor.stage.moveUp"),children:c.jsx(GR,{size:12,strokeWidth:3})}),c.jsx("button",{type:"button",className:"nb-btn",style:{padding:"3px 8px"},onClick:o,disabled:t===n-1,"aria-label":d("pipelineEditor.stage.moveDown"),children:c.jsx(Vu,{size:12,strokeWidth:3})}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-danger",style:{padding:"3px 8px"},onClick:a,"aria-label":d("pipelineEditor.stage.remove"),children:c.jsx(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:h=>i({name:h.target.value}),placeholder:"develop"})}),c.jsx(es,{label:"profile",hint:d("pipelineEditor.stage.profile.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.profile??"",onChange:h=>i({profile:h.target.value||void 0}),placeholder:"fullstack"})}),c.jsx(es,{label:"card_state",hint:d("pipelineEditor.stage.cardState.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.card_state??"",onChange:h=>i({card_state:h.target.value||void 0}),placeholder:"Inprogress"})}),c.jsx(es,{label:"timeout",hint:d("pipelineEditor.stage.timeout.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.timeout??"",onChange:h=>i({timeout:h.target.value||void 0}),placeholder:"2h"})}),c.jsx(es,{label:"trigger",hint:d("pipelineEditor.stage.trigger.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.trigger??"",onChange:h=>i({trigger:h.target.value||void 0}),placeholder:"card_enters 'Todo'"})}),c.jsx(es,{label:"on_complete",hint:d("pipelineEditor.stage.onComplete.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.on_complete??"",onChange:h=>i({on_complete:h.target.value}),placeholder:"move_card Done"})})]}),c.jsxs("div",{className:"mt-4 pt-3 border-t-2 border-dashed border-[var(--color-text)]",children:[c.jsx("h5",{className:"text-xs font-bold uppercase tracking-wider mb-2 text-[var(--color-text-muted)]",children:"on_fail"}),c.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[c.jsx(es,{label:"action",hint:d("pipelineEditor.stage.onFail.action.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:f.action??"",onChange:h=>i({on_fail:{...f,action:h.target.value||void 0}}),placeholder:"label NEEDS-FIX"})}),c.jsx(es,{label:"comment",hint:d("pipelineEditor.stage.onFail.comment.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:f.comment??"",onChange:h=>i({on_fail:{...f,comment:h.target.value||void 0}}),placeholder:"Worker failed. Check logs."})})]}),c.jsxs("label",{className:"flex items-center gap-2 mt-3 text-sm cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:f.halt??!0,onChange:h=>i({on_fail:{...f,halt:h.target.checked}})}),c.jsx("span",{className:"font-bold",children:"halt"}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:d("pipelineEditor.stage.halt.note")})]})]})]})}function es({label:e,hint:t,children:n}){return c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-xs font-bold font-[family-name:var(--font-mono)]",children:e}),n,t&&c.jsx("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:t})]})}function Fz({onCancel:e,onCreate:t,hasActive:n,hasSample:i,isPending:a}){const l=Be(),[o,d]=j.useState(""),[f,h]=j.useState("blank");j.useEffect(()=>{const 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(bn,{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(Bg,{value:"blank",current:f,label:l("newPipelineDialog.template.blank.label"),desc:l("newPipelineDialog.template.blank.desc"),onSelect:h}),c.jsx(Bg,{value:"sample",current:f,label:l("newPipelineDialog.template.sample.label"),desc:l("newPipelineDialog.template.sample.desc"),onSelect:h,disabled:!i,disabledReason:l("newPipelineDialog.template.sample.unavailable")}),c.jsx(Bg,{value:"active",current:f,label:l("newPipelineDialog.template.active.label"),desc:l("newPipelineDialog.template.active.desc"),onSelect:h,disabled:!n,disabledReason:l("newPipelineDialog.template.active.unavailable")})]}),c.jsxs("div",{className:"flex gap-3 justify-end pt-2",children:[c.jsx("button",{className:"nb-btn",onClick:e,type:"button",disabled:a,children:l("common.cancel")}),c.jsxs("button",{className:"nb-btn nb-btn-primary",type:"submit",disabled:!y||a,"aria-label":l("newPipelineDialog.create.aria"),children:[a?c.jsx(Xe,{size:13,strokeWidth:3,className:"animate-spin"}):c.jsx(pi,{size:13,strokeWidth:3}),l("common.create")]})]})]})]})})}function Bg({value:e,current:t,label:n,desc:i,onSelect:a,disabled:l,disabledReason:o}){const d=t===e;return c.jsxs("label",{className:["flex items-start gap-2 p-2 rounded-lg border-2 cursor-pointer",l?"border-[var(--color-border-light)] opacity-50 cursor-not-allowed":d?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)]":"border-[var(--color-border-light)] hover:bg-[var(--color-bg-cream)] hover:border-[var(--color-text)]"].join(" "),children:[c.jsx("input",{type:"radio",name:"pipeline-template",value:e,checked:d,disabled:l,onChange:()=>a(e),className:"mt-1 flex-shrink-0"}),c.jsxs("div",{className:"flex-1",children:[c.jsx("div",{className:"text-sm font-bold",children:n}),c.jsx("div",{className:"text-xs text-[var(--color-text-muted)]",children:l?o:i})]})]})}function qz(e){return ft(`/api/rules/${encodeURIComponent(e)}`)}function cx(e){const t=e?`?project=${encodeURIComponent(e)}`:"";return ft(`/api/skills${t}`)}function Hz(e){return ft(`/api/skills/${encodeURIComponent(e)}`)}function Kz(e,t){return ft(`/api/skills/${encodeURIComponent(e)}/references/${encodeURIComponent(t)}`)}async function Gz(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 Vz(e){return p_(`/api/skills/${encodeURIComponent(e)}`)}function Yz(e){return gr(`/api/skills/${encodeURIComponent(e)}/translate`)}async function Qz(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 Wz(){return Qz("/api/skills/sync")}function Xz(e){return ft(`/api/skills/policy/${encodeURIComponent(e)}`)}function Zz(e,t){return Kb(`/api/skills/policy/${encodeURIComponent(e)}`,t)}function Jz(){return ft("/api/skills/updates")}function e4(e,t,n){return gr("/api/skills/import",{name:e,files:t,overwrite:n})}function t4(e){return ft(`/api/skills/${encodeURIComponent(e)}/export`)}function n4(e,t){return gr("/api/skills/create",{name:e,intent:t})}function m2(){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 g2({msg:e}){return c.jsx("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:c.jsx("p",{children:e})})}function i4({name:e}){var b,k;const t=Be(),n=Ft(),{alert:i}=un(),a=Ye({queryKey:["skill-policy",e],queryFn:()=>Xz(e),enabled:!!e}),l=(b=a.data)==null?void 0:b.data,[o,d]=j.useState(null),[f,h]=j.useState(null);j.useEffect(()=>{var v;l&&o===null&&d((v=l.policy.allow)!=null&&v.length?new Set(l.policy.allow):new Set(l.skills.map(S=>S.name)))},[l,o]);const g=Et({mutationFn:v=>Zz(e,v),onSuccess:v=>{h(v),d(null),n.invalidateQueries({queryKey:["skill-policy",e]})},onError:v=>void i({title:t("projectDetail.skills.saveError"),body:v instanceof Error?v.message:String(v)})});if(a.isLoading||l&&o===null)return c.jsx(m2,{});if(a.isError)return c.jsx(g2,{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(i_,{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($b,{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 r4({name:e}){var a;const t=Be(),n=Ye({queryKey:["rules",e],queryFn:()=>qz(e),enabled:!!e});if(n.isLoading)return c.jsx(m2,{});if(n.isError)return c.jsx(g2,{msg:n.error instanceof Error?n.error.message:String(n.error)});const i=((a=n.data)==null?void 0:a.data)??[];return c.jsxs("div",{className:"flex flex-col gap-4 min-h-full",children:[c.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:t("projectDetail.rules.readonly")}),i.map(l=>c.jsxs("div",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[c.jsx("code",{className:"font-[family-name:var(--font-mono)] text-sm font-bold border-2 border-[var(--color-text)] px-2 py-0.5 rounded",children:l.name}),!l.exists&&c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:t("projectDetail.rules.missing")})]}),l.exists&&c.jsx("pre",{className:"overflow-auto max-h-[28rem] text-xs font-[family-name:var(--font-mono)] whitespace-pre-wrap break-words bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded p-3",children:l.content})]},l.name))]})}const ip=e=>`/api/projects/${encodeURIComponent(e)}/graph`;function a4(e){return ft(`${ip(e)}/status`)}function s4(e){return ft(`${ip(e)}/data`)}function l4(e){return gr(`${ip(e)}/build`)}function o4(e){return gr(`${ip(e)}/sync`)}const c4={typescript:"#1D4E89",tsx:"#2563EB",javascript:"#B8860B",json:"#6B7280",yaml:"#C2410C"},Cf=e=>c4[e]??"#2D6A4F";function _k(e){return[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)]}const u4=e=>Math.max(8,Math.min(22,8+e*2.5));function d4(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/1024/1024).toFixed(2)} MB`}function f4(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 h4({name:e,status:t}){var y,b,k,v;const n=Be(),i=Ye({queryKey:["graph-data",e],queryFn:()=>s4(e)}),[a,l]=j.useState(""),o=j.useRef(null),d=j.useRef(null),f=j.useRef(null),h=j.useRef(null),g=[...new Set((((b=(y=i.data)==null?void 0:y.data)==null?void 0:b.nodes)??[]).map(S=>S.language))];if(j.useEffect(()=>{h.current&&(h.current.search=a.trim().toLowerCase())},[a]),j.useEffect(()=>{var Oe;const S=(Oe=i.data)==null?void 0:Oe.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 ce of S.links)_[ce.source]=(_[ce.source]??0)+1,_[ce.target]=(_[ce.target]??0)+1;const T=S.nodes.length,M=window.devicePixelRatio||1,R=C.getBoundingClientRect(),O=R.width||800,B=R.height||500,U=Math.min(O,B)*.35+T*1.5,K=S.nodes.map((ce,Ce)=>{const te=2*Math.PI*Ce/Math.max(T,1),pe=_[ce.id]??0;return{id:ce.id,language:ce.language,symbols:ce.symbols,deg:pe,name:ce.id.split("/").pop()||ce.id,x:Math.cos(te)*U+Math.sin(Ce*12.9898)*43758.5453%1*40,y:Math.sin(te)*U+Math.sin(Ce*78.233)*12345.678%1*40,vx:0,vy:0,r:u4(pe)}}),q={};for(const ce of K)q[ce.id]=ce;const Y=S.links.map(ce=>({source:ce.source,target:ce.target,weight:ce.weight})),D={nodes:K,edges:Y,map:q,panX:O/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};h.current=D;const F=()=>{const ce=C.getBoundingClientRect();E.width=ce.width*M,E.height=ce.height*M,E.style.width=ce.width+"px",E.style.height=ce.height+"px",N.setTransform(M,0,0,M,0,0)};F();const I=new ResizeObserver(F);I.observe(C);const H=()=>{let ce=1/0,Ce=1/0,te=-1/0,pe=-1/0;for(const be of K)ce=Math.min(ce,be.x-be.r),Ce=Math.min(Ce,be.y-be.r),te=Math.max(te,be.x+be.r),pe=Math.max(pe,be.y+be.r);const Fe=E.width/M,ze=E.height/M,ae=Math.min(Fe/Math.max(te-ce,1),ze/Math.max(pe-Ce,1),1.4)*.88;D.zoom=ae,D.panX=Fe/2-(ce+te)/2*ae,D.panY=ze/2-(Ce+pe)/2*ae},Q=()=>{const ce=K.length;D.tick++;const Ce=.9-Math.min(.4,D.tick/1500),te=ce>1e3?3e3:ce>100?2e3:ce>50?1200:800,pe=ce>100?.002:.005,Fe=ce>1e3?.012:ce>100?.005:.01,ze=ce>1e3?6:ce>200?12:24;for(let ye=0;ye<ce;ye++){const he=K[ye];let Ee=-he.x*Fe,Ne=-he.y*Fe;for(let Ke=0;Ke<ce;Ke++){if(ye===Ke)continue;const ne=K[Ke],de=he.x-ne.x,Le=he.y-ne.y,Ze=de*de+Le*Le||1,rt=Math.sqrt(Ze),At=te/Ze;Ee+=de/rt*At,Ne+=Le/rt*At}if(he!==D.drag){let Ke=(he.vx+Ee)*Ce,ne=(he.vy+Ne)*Ce;Ke=Math.max(-ze,Math.min(ze,Ke)),ne=Math.max(-ze,Math.min(ze,ne)),he.vx=Ke,he.vy=ne}}for(const ye of Y){const he=q[ye.source],Ee=q[ye.target];if(!he||!Ee)continue;const Ne=Ee.x-he.x,Ke=Ee.y-he.y,ne=Math.sqrt(Ne*Ne+Ke*Ke)||1,de=(ne-100)*pe,Le=Ne/ne*de,Ze=Ke/ne*de;he!==D.drag&&(he.vx+=Le,he.vy+=Ze),Ee!==D.drag&&(Ee.vx-=Le,Ee.vy-=Ze)}let ae=0;for(const ye of K)ye!==D.drag&&(ye.x+=ye.vx,ye.y+=ye.vy,ae+=ye.vx*ye.vx+ye.vy*ye.vy);(ce?Math.sqrt(ae/ce):0)<.05&&D.tick>60&&!D.drag?D.quiet++:D.quiet=0,!D.fitted&&(D.quiet>8||D.tick>400)&&(D.fitted=!0,H())},G=()=>{const ce=E.width/M,Ce=E.height/M;N.clearRect(0,0,ce,Ce),N.strokeStyle="rgba(45,55,72,0.05)",N.lineWidth=.5;for(let be=0;be<ce;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(ce,be),N.stroke();N.save(),N.translate(D.panX,D.panY),N.scale(D.zoom,D.zoom);const te=D.search,pe=K.length>40;let Fe=null;if(!D.drag){const be=E.getBoundingClientRect(),ye=(D.mouseX-be.left-D.panX)/D.zoom,he=(D.mouseY-be.top-D.panY)/D.zoom;for(let Ee=K.length-1;Ee>=0;Ee--){const Ne=K[Ee],Ke=Ne.x-ye,ne=Ne.y-he;if(Ke*Ke+ne*ne<Ne.r*Ne.r+25){Fe=Ne.id;break}}}const ze=D.sel||Fe;for(const be of Y){const ye=q[be.source],he=q[be.target];if(!ye||!he)continue;const Ee=te&&!(ye.name.toLowerCase().includes(te)||he.name.toLowerCase().includes(te)),Ne=ze&&(be.source===ze||be.target===ze),Ke=he.x-ye.x,ne=he.y-ye.y,de=Math.sqrt(Ke*Ke+ne*ne)||1,Le=pe?12:18,Ze=(ye.x+he.x)/2+-ne/de*Le,rt=(ye.y+he.y)/2+Ke/de*Le,[At,$n,dn]=_k(Cf(ye.language));let Mt;if(Ee?Mt=.05:ze&&Ne?Mt=.6:ze&&!Ne?Mt=.05:Mt=pe?.14:.24,N.beginPath(),N.moveTo(ye.x,ye.y),N.quadraticCurveTo(Ze,rt,he.x,he.y),N.strokeStyle=`rgba(${At},${$n},${dn},${Mt})`,N.lineWidth=Ne?2+be.weight*.4:1+be.weight*.25,N.stroke(),!pe||Ne){const Qt=Math.atan2(he.y-rt,he.x-Ze),yt=5+N.lineWidth;N.beginPath(),N.moveTo(he.x-he.r*Math.cos(Qt),he.y-he.r*Math.sin(Qt)),N.lineTo(he.x-(he.r+yt)*Math.cos(Qt-.3),he.y-(he.r+yt)*Math.sin(Qt-.3)),N.lineTo(he.x-(he.r+yt)*Math.cos(Qt+.3),he.y-(he.r+yt)*Math.sin(Qt+.3)),N.closePath(),N.fillStyle=`rgba(${At},${$n},${dn},${Ee?.05:Ne?.55:.18})`,N.fill()}}const ae=pe?1.5:.5;for(const be of K){const ye=Cf(be.language),he=D.sel===be.id,Ee=Fe===be.id,Ne=!te||be.name.toLowerCase().includes(te),Ke=ze&&be.id!==ze&&!Y.some(At=>At.source===ze&&At.target===be.id||At.target===ze&&At.source===be.id),ne=Ne?Ke?.2:1:.12;N.save(),N.globalAlpha=ne,Ne&&!Ke&&(he||Ee||!te)&&(N.shadowColor=ye,N.shadowBlur=he?20:Ee?16:pe?4:8);const[de,Le,Ze]=_k(ye),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,ye),N.beginPath(),N.arc(be.x,be.y,be.r,0,Math.PI*2),N.fillStyle=rt,N.fill(),N.shadowBlur=0,N.lineWidth=he?2.5:1,N.strokeStyle=he?"#111827":"rgba(255,255,255,0.7)",N.stroke(),N.restore(),Ne&&!Ke&&(he||Ee||D.zoom>ae)){const At=1/D.zoom;N.save(),N.globalAlpha=ne,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(Q(),G(),D.quiet>40&&!D.drag){D.raf=null;return}D.raf=requestAnimationFrame(L)},z=()=>{D.raf==null&&(D.quiet=0,D.raf=requestAnimationFrame(L))};D.raf=requestAnimationFrame(L);let V=!1,P=0,le=0;const ve=ce=>{const Ce=E.getBoundingClientRect();return{x:(ce.clientX-Ce.left-D.panX)/D.zoom,y:(ce.clientY-Ce.top-D.panY)/D.zoom}},ke=(ce,Ce)=>{for(let te=K.length-1;te>=0;te--){const pe=K[te];if(!pe)continue;const Fe=pe.x-ce,ze=pe.y-Ce;if(Fe*Fe+ze*ze<pe.r*pe.r+25)return pe}return null},Se=ce=>{const Ce=ve(ce),te=ke(Ce.x,Ce.y);te?D.drag=te:V=!0,P=ce.clientX,le=ce.clientY,z()},J=ce=>{const Ce=ce.clientX-P,te=ce.clientY-le;D.drag?(D.drag.x+=Ce/D.zoom,D.drag.y+=te/D.zoom,D.drag.vx=0,D.drag.vy=0,z()):V&&(D.panX+=Ce,D.panY+=te,z()),P=ce.clientX,le=ce.clientY,D.mouseX=ce.clientX,D.mouseY=ce.clientY;const pe=f.current,Fe=ve(ce),ze=!D.drag&&!V?ke(Fe.x,Fe.y):null;if(pe)if(ze){const ae=Y.filter(ye=>ye.source===ze.id||ye.target===ze.id).length;pe.innerHTML=`<div style="font-weight:700;word-break:break-all">${ze.id}</div><div style="margin-top:4px;color:#64748b;font-family:var(--font-mono,monospace)"><span style="color:${Cf(ze.language)}">●</span> ${ze.language} · ${ze.symbols} symbols · ${ae} links</div>`;const be=E.getBoundingClientRect();pe.style.left=ce.clientX-be.left+14+"px",pe.style.top=ce.clientY-be.top+14+"px",pe.style.display="block",E.style.cursor="pointer"}else pe.style.display="none",E.style.cursor=D.drag||V?"grabbing":"grab";z()},ue=ce=>{D.drag&&!V?Math.abs(ce.clientX-P)>3||(D.sel=D.sel===D.drag.id?null:D.drag.id):V&&Math.abs(ce.clientX-P)<3&&Math.abs(ce.clientY-le)<3&&(D.sel=null),D.drag=null,V=!1,z()},Te=ce=>{ce.preventDefault();const Ce=E.getBoundingClientRect(),te=ce.clientX-Ce.left,pe=ce.clientY-Ce.top,Fe=ce.deltaY>0?.9:1.1,ze=Math.max(.1,Math.min(5,D.zoom*Fe));D.panX=te-(te-D.panX)/D.zoom*ze,D.panY=pe-(pe-D.panY)/D.zoom*ze,D.zoom=ze,z()},Re=()=>{f.current&&(f.current.style.display="none")};return E.addEventListener("mousedown",Se),window.addEventListener("mousemove",J),window.addEventListener("mouseup",ue),E.addEventListener("wheel",Te,{passive:!1}),E.addEventListener("mouseleave",Re),()=>{D.raf!=null&&cancelAnimationFrame(D.raf),I.disconnect(),E.removeEventListener("mousedown",Se),window.removeEventListener("mousemove",J),window.removeEventListener("mouseup",ue),E.removeEventListener("wheel",Te),E.removeEventListener("mouseleave",Re),h.current=null}},[i.data]),i.isLoading)return c.jsxs("div",{className:"nb-card flex items-center gap-2 text-sm text-[var(--color-text-muted)]",children:[c.jsx(Xe,{size:14,className:"animate-spin"})," ",n("graph.viz.loading")]});if(!((v=(k=i.data)==null?void 0:k.data)!=null&&v.nodes.length))return c.jsx("div",{className:"nb-card text-sm text-[var(--color-text-muted)]",children:n("graph.viz.empty")});const m=[{label:n("graph.stat.files"),value:t.files.toLocaleString()},{label:n("graph.stat.nodes"),value:t.nodes.toLocaleString()},{label:n("graph.stat.edges"),value:t.edges.toLocaleString()},{label:n("graph.stat.db"),value:d4(t.dbSizeBytes)},{label:n("graph.stat.lastBuilt"),value:f4(t.lastIndexedAt)}];return c.jsxs("div",{ref:o,className:"relative w-full flex-1 min-h-[420px] nb-card p-0 overflow-hidden",style:{background:"var(--color-bg-cream)"},children:[c.jsx("canvas",{ref:d,className:"block absolute inset-0",style:{cursor:"grab"}}),c.jsx("div",{ref:f,className:"absolute z-40 pointer-events-none nb-card bg-[var(--color-bg)] px-3 py-2 text-xs max-w-xs",style:{display:"none"}}),c.jsxs("div",{className:"absolute top-3 right-3 w-52 flex flex-col gap-2 pointer-events-none",children:[c.jsxs("div",{className:"relative pointer-events-auto",children:[c.jsx(fl,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-subtle)]"}),c.jsx("input",{className:"nb-input pl-9 w-full text-sm",placeholder:n("graph.viz.search"),value:a,onChange: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:Cf(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 p4({name:e}){var m,y;const t=Be(),n=Ft(),i=Ye({queryKey:["graph-status",e],queryFn:()=>a4(e)}),a=()=>{n.invalidateQueries({queryKey:["graph-status",e]}),n.invalidateQueries({queryKey:["graph-data",e]})},l=Et({mutationFn:()=>l4(e),onSuccess:a}),o=Et({mutationFn:()=>o4(e),onSuccess:a}),d=((m=i.data)==null?void 0:m.data)??null,f=l.isPending,h=o.isPending,g=f||h;return c.jsxs("div",{className:"flex flex-col gap-3 max-w-full flex-1 min-h-0",children:[c.jsxs("header",{className:"flex items-center justify-between flex-wrap gap-3 shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx(ZN,{size:20,strokeWidth:2.5,className:"shrink-0"}),c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold shrink-0",children:t("graph.title")}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)] truncate hidden sm:inline",children:t("graph.desc")})]}),c.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[d&&c.jsxs("button",{className:"nb-btn shrink-0",onClick:()=>o.mutate(),disabled:g,type:"button",title:t("graph.sync.desc"),children:[h?c.jsx(Xe,{size:14,strokeWidth:2.5,className:"animate-spin"}):c.jsx(xL,{size:14,strokeWidth:2.5}),t(h?"graph.syncing":"graph.sync")]}),c.jsxs("button",{className:"nb-btn nb-btn-mint shrink-0",onClick:()=>l.mutate(),disabled:g,type:"button",children:[f?c.jsx(Xe,{size:14,strokeWidth:2.5,className:"animate-spin"}):d?c.jsx(ya,{size:14,strokeWidth:2.5}):c.jsx(EL,{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(h4,{name:e,status:d}):c.jsx("div",{className:"nb-card text-sm text-[var(--color-text-muted)]",children:t("graph.empty")})]})}const jk=["overview","config","pipelines","skills","rules","graph","logs"];function m4({name:e,embedded:t}={}){var v;const n=Be(),{name:i=""}=Ob(),a=e??i,l=ks(),[o]=qN(),[d,f]=Vb("projectDetail.tab","overview"),h=jk.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&&jk.includes(y)&&f(y)},[y]);const k=Ye({queryKey:["project",a],queryFn:()=>nI(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(KN,{size:14,strokeWidth:3}),n("newProject.back")]}),c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-3xl font-bold flex-1 truncate",children:a})]}),c.jsxs("nav",{className:"flex items-center gap-2 flex-wrap shrink-0",children:[c.jsx(ts,{current:h,value:"overview",onSelect:f,icon:cL,children:n("projectDetail.tab.overview")}),c.jsx(ts,{current:h,value:"config",onSelect:f,icon:n_,children:n("projectDetail.tab.config")}),c.jsx(ts,{current:h,value:"pipelines",onSelect:f,icon:qb,children:n("projectDetail.tab.pipelines")}),c.jsx(ts,{current:h,value:"skills",onSelect:f,icon:i_,children:n("projectDetail.tab.skills")}),c.jsx(ts,{current:h,value:"rules",onSelect:f,icon:PR,children:n("projectDetail.tab.rules")}),c.jsx(ts,{current:h,value:"graph",onSelect:f,icon:ZN,children:n("projectDetail.tab.graph")}),c.jsx(ts,{current:h,value:"logs",onSelect:f,icon:Ub,children:n("projectDetail.tab.logs")}),c.jsx(ts,{current:h,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",h==="logs"?"overflow-hidden":"overflow-y-auto"].join(" "),children:[h==="overview"&&c.jsx(g4,{name:a,data:k.data,loading:k.isLoading}),h==="config"&&c.jsx(y4,{name:a}),h==="pipelines"&&c.jsx(b4,{name:a}),h==="skills"&&c.jsx(i4,{name:a}),h==="rules"&&c.jsx(r4,{name:a}),h==="graph"&&c.jsx(p4,{name:a}),h==="logs"&&c.jsx(SI,{project:a,initialWorker:h==="logs"?b:void 0})]}),g&&c.jsx(x4,{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 g4({name:e,data:t,loading:n}){const i=Be();return n?c.jsx("div",{className:"nb-card",children:c.jsx("p",{className:"text-[var(--color-text-muted)]",children:i("common.loading")})}):t?c.jsx("div",{className:"nb-card",children:c.jsxs("dl",{className:"grid grid-cols-[160px_1fr] gap-y-3 text-sm",children:[c.jsx("dt",{className:"font-bold",children:i("projectDetail.overview.repoDir")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.repoDir??"—"}),c.jsx("dt",{className:"font-bold",children:i("projectDetail.overview.pmBackend")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.pmBackend}),c.jsx("dt",{className:"font-bold",children:i("projectDetail.overview.agent")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.agentProvider}),c.jsx("dt",{className:"font-bold",children:i("projectDetail.overview.cards")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:i("projectDetail.overview.cards.value",{total:t.cards.total,inprogress:t.cards.inprogress,done:t.cards.done})}),c.jsx("dt",{className:"font-bold",children:i("projectDetail.overview.workers")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:i("projectDetail.overview.workers.value",{total:t.workers.total,active:t.workers.active})}),c.jsx("dt",{className:"font-bold",children:i("projectDetail.overview.pipeline")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.pipelineStatus}),c.jsx("dt",{className:"font-bold",children:i("projectDetail.overview.lastActivity")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.lastActivityAt?new Date(t.lastActivityAt).toLocaleString():"—"})]})}):c.jsx("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:c.jsx("p",{children:i("projectDetail.overview.notFound",{name:e})})})}function y4({name:e}){const t=Be(),n=Ft(),{alert:i}=un(),{data:a,isLoading:l,isError:o,error:d,refetch:f}=Ye({queryKey:["project-conf",e],queryFn:()=>rI(e)}),[h,g]=j.useState(null),[m,y]=j.useState(null);j.useEffect(()=>{a&&h===null&&(g(a.content),y(a.etag))},[a,h]);const b=h!==null&&a!==void 0&&h!==a.content,k=Et({mutationFn:()=>{if(h===null||m===null)throw new Error("no draft");return aI(e,h,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(FR,{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:h??"",onChange:v=>g(v.target.value),spellCheck:!1,"aria-label":t("projectDetail.config.editorAria")}),b&&c.jsx("p",{className:"text-xs text-[var(--color-stuck)] mt-2 font-bold",children:t("projectDetail.config.confDirty")})]})}function b4({name:e}){const t=Be(),n=Ft(),{confirm:i,alert:a}=un(),{data:l,isLoading:o}=Ye({queryKey:["project-pipelines",e],queryFn:()=>lI(e)}),[d,f]=j.useState(null),[h,g]=j.useState(!1),m=Et({mutationFn:v=>oI(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=>fI(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=>dI(e,v.name,v.template),onSuccess:v=>{n.invalidateQueries({queryKey:["project-pipelines",e]}),g(!1),f(v.name)},onError:v=>{a({title:t("projectDetail.pipelines.create.error"),body:v instanceof Error?v.message:String(v)})}});if(o)return c.jsx("div",{className:"nb-card",children:c.jsx("p",{className:"text-[var(--color-text-muted)]",children:t("common.loading")})});const k=[];l!=null&&l.active&&k.push({name:l.active,isActive:!0});for(const v of(l==null?void 0:l.available)??[])k.push({name:v.name,isActive:!1});return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold",children:t("projectDetail.pipelines.title")}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",style:{padding:"6px 12px",fontSize:12},onClick:()=>g(!0),disabled:b.isPending,"aria-label":t("projectDetail.pipelines.add"),children:[c.jsx(pi,{size:12,strokeWidth:3}),t("projectDetail.pipelines.add")]})]}),k.length===0?c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] italic p-4 border-2 border-dashed border-[var(--color-text)] rounded-lg text-center",children:t("projectDetail.pipelines.empty")}):c.jsx("ul",{className:"flex flex-col gap-2",children:k.map(v=>c.jsxs("li",{className:"flex bg-surface-input items-center gap-3 p-3 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg",children:[c.jsx(qb,{size:16,strokeWidth:2.5}),c.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold flex-1",children:v.name}),v.isActive&&c.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:t("projectDetail.pipelines.activeBadge")}),c.jsxs("div",{className:"flex gap-1",children:[c.jsxs("button",{type:"button",className:"nb-btn",style:{padding:"4px 10px",fontSize:11},onClick:()=>f(v.name),"aria-label":t("projectDetail.pipelines.editAria",{name:v.name}),children:[c.jsx(qh,{size:11,strokeWidth:2.5}),t("projectDetail.pipelines.edit")]}),!v.isActive&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"nb-btn nb-btn-primary",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{await i({title:t("projectDetail.pipelines.switch.confirm.title",{name:v.name}),body:t("projectDetail.pipelines.switch.confirm.body",{name:v.name}),confirm:t("projectDetail.pipelines.switch.confirm.button")})&&m.mutate(v.name)},disabled:m.isPending,"aria-label":t("projectDetail.pipelines.switchAria",{name:v.name}),children:t("projectDetail.pipelines.switch")}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-danger",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{await i({title:t("projectDetail.pipelines.delete.confirm.title",{name:v.name}),body:t("projectDetail.pipelines.delete.confirm.body"),confirm:t("common.delete"),danger:!0})&&y.mutate(v.name)},disabled:y.isPending,"aria-label":t("projectDetail.pipelines.deleteAria",{name:v.name}),children:c.jsx(Vi,{size:11,strokeWidth:2.5})})]})]})]},v.name))})]}),d&&c.jsx(Bz,{projectName:e,file:d,onClose:()=>f(null),onSaved:()=>{n.invalidateQueries({queryKey:["project-pipelines",e]})}}),h&&c.jsx(Fz,{hasActive:!!(l!=null&&l.active),hasSample:!0,isPending:b.isPending,onCancel:()=>g(!1),onCreate:(v,S)=>b.mutate({name:v,template:S})})]})}function x4({name:e,repoDir:t,onClose:n}){const i=Be(),a=ks(),l=Ft(),{alert:o}=un(),[d,f]=j.useState(""),[h,g]=j.useState(!0),m=Et({mutationFn:()=>sI(e,{includeClaudeDir:h}),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(bn,{size:14,strokeWidth:3})})]}),c.jsxs("p",{className:"text-sm mb-4",children:[b[0],c.jsxs("code",{className:"font-[family-name:var(--font-mono)] bg-[var(--color-bg)] border-2 border-[var(--color-text)] px-1.5 py-0.5 rounded",children:["~/.coral/projects/",e,"/"]}),b[1]]}),t&&c.jsxs("label",{className:"flex items-start gap-2 mb-4 p-3 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-lg cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:h,onChange: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 ux(){return ft("/api/providers")}function y2(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 v4(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 w4(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 b2(e){const t=e?`?path=${encodeURIComponent(e)}`:"";return ft(`/api/fs/browse${t}`)}async function k4(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 x2=50*1024*1024;async function E4(e,t){if(t.size>x2)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 Wy(e,t){return`/api/fs/file?${new URLSearchParams({path:t,sessionId:e}).toString()}`}function dx({initialPath:e,onCancel:t,onSelect:n,title:i,mode:a="directory"}){var C,N,_;const l=Be(),{prompt:o,alert:d}=un(),f=i??l("dirPicker.title.default"),[h,g]=j.useState(e??null),[m,y]=j.useState(null),b=Ye({queryKey:["fs-browse",h],queryFn:()=>b2(h??void 0),staleTime:0,gcTime:0}),k=((C=b.data)==null?void 0:C.path)??h??"",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 R=await k4(k,T);g(R.path)}catch(R){d({title:l("dirPicker.newDir.error.title"),body:R instanceof Error?R.message:String(R)})}};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 p-5 flex flex-col",style:{maxHeight:"70vh"},role:"dialog","aria-modal":"true","aria-label":f,children:[c.jsxs("header",{className:"flex items-center justify-between mb-3 shrink-0",children:[c.jsx("div",{className:"flex items-center gap-2 min-w-0",children:c.jsx("h3",{className:"font-[family-name:var(--font-heading)] font-bold text-base truncate",children:f})}),c.jsx("button",{type:"button",className:"p-1 hover:bg-[var(--color-bg-cream)] rounded",onClick:t,"aria-label":l("dirPicker.close.aria"),children:c.jsx(bn,{size:14,strokeWidth:3})})]}),c.jsxs("div",{className:"flex items-center gap-2 mb-3 shrink-0",children:[c.jsx("button",{type:"button",className:"nb-btn flex-shrink-0",style:{padding:"4px 10px",fontSize:12},onClick:()=>v&&g(v),disabled:!v||b.isLoading,"aria-label":l("dirPicker.up.aria"),title:l("dirPicker.up.title"),children:c.jsx(GN,{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(jL,{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(fL,{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}`})(),R=a==="file"&&m===M,O=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",R?"bg-[var(--color-accent-mint)] font-bold":"hover:bg-[var(--color-accent-mint)]"].join(" "),disabled:!O,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(ph,{size:14,strokeWidth:2.5,className:"flex-shrink-0 text-[var(--color-text)]"}):c.jsx("span",{className:"w-3.5 h-3.5 flex-shrink-0"}),c.jsx("span",{className:"truncate",children:T.name}),T.isDirectory&&c.jsx(Zo,{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(Eu,{size:14,strokeWidth:3}),l("dirPicker.useFile")]}):c.jsxs("button",{type:"button",className:"nb-btn nb-btn-primary",onClick:()=>n(k),disabled:!k||b.isLoading||b.isError,children:[c.jsx(Eu,{size:14,strokeWidth:3}),l("dirPicker.useDir")]})]})]})})}function Af(e){return(e.replace(/\/+$/,"").split("/").pop()??"").replace(/[^a-zA-Z0-9_-]/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function v2({onCancel:e,onCreated:t,dialogMode:n=!1}={}){var K,q,Y,D,F,I;const i=Be(),a=ks(),l=Ft(),{alert:o}=un(),d=e??(()=>a("/projects")),[f,h]=j.useState({name:"",projectDir:"",enableGit:!0,createIfMissing:!0,mergeBranch:"main",maxWorkers:"1",ackTimeoutMin:"5",pipelineMode:"pipeline"}),g=f.pipelineMode==="smartArrange",m=Ye({queryKey:["system-agents"],queryFn:Gb}),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=Ye({queryKey:["providers"],queryFn:ux}),S=y2(((D=v.data)==null?void 0:D.anthropic)??[]),E=f.workerModel?`${f.workerProviderId??""}::${f.workerModel}`:"",[C,N]=j.useState(!1),_=Et({mutationFn:H=>iI(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,R=f.projectDir.trim(),O=Ye({queryKey:["fs-browse-probe",R],queryFn:()=>b2(R),enabled:R.startsWith("/"),staleTime:0,gcTime:0,retry:!1}),B=O.isSuccess&&(((F=O.data)==null?void 0:F.entries.length)??0)>0,U=O.isError||O.isSuccess&&(((I=O.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(KN,{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 Q=f.pipelineMode===H;return c.jsxs("button",{type:"button",onClick:()=>h({...f,pipelineMode:H}),"aria-pressed":Q,className:["text-left rounded-xl border-2 p-3 transition-all",Q?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[3px_3px_0_var(--color-text)] font-bold":"bg-[var(--color-bg)] border-[var(--color-border-light)] hover:border-[var(--color-text)]"].join(" "),children:[c.jsx("div",{className:"text-sm font-bold",children:i(H==="pipeline"?"newProject.field.mode.pipeline":"newProject.field.mode.smart")}),c.jsx("div",{className:"text-xs text-[var(--color-text-muted)] mt-0.5",children:i(H==="pipeline"?"newProject.field.mode.pipelineDesc":"newProject.field.mode.smartDesc")})]},H)})})}),g&&c.jsx(Ui,{className:"md:col-span-2",label:i("newProject.field.goal"),hint:i("newProject.field.goal.hint"),children:c.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-sm",style:{minHeight:110,resize:"vertical"},placeholder:i("newProject.field.goal.placeholder"),value:f.goal??"",onChange:H=>h({...f,goal:H.target.value})})}),c.jsx(Ui,{label:"Worker 模型",hint:`默认:${y||"全局默认"}(留空用默认)`,children:c.jsxs("select",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:E,onChange:H=>{const Q=H.target.value;if(!Q)return h({...f,workerModel:void 0,workerProviderId:void 0});const[G,L]=Q.split("::");h({...f,workerModel:L,workerProviderId:G||void 0})},children:[c.jsx("option",{value:"",children:"用全局默认模型"}),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=>h({...f,reviewerModel:H.target.value}),placeholder:b,list:"np-reviewer-models",spellCheck:!1}),c.jsx("datalist",{id:"np-reviewer-models",children:k.map(H=>c.jsx("option",{value:H},H))})]}),c.jsxs(Ui,{label:i("newProject.field.name"),hint:i("newProject.field.name.derived"),children:[c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:i("newProject.field.name.placeholder"),value:f.name,onChange:H=>h({...f,name:H.target.value}),required:!0}),f.name&&!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 Q=H.target.value,G=Af(Q),L=Af(f.projectDir),z=f.name&&f.name!==L;h({...f,projectDir:Q,name:z?f.name:G})},required:!0}),c.jsxs("button",{type:"button",className:"nb-btn flex-shrink-0",onClick:()=>N(!0),"aria-label":i("newProject.dir.browseAria"),title:i("newProject.dir.browseAria"),children:[c.jsx(QN,{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&&R.startsWith("/")&&c.jsx("p",{className:"text-xs mt-1.5 text-[var(--color-text-muted)]",children:i("newProject.field.dir.fresh")}),c.jsxs("label",{className:"flex items-center gap-2 mt-2 cursor-pointer select-none",children:[c.jsx("input",{type:"checkbox",checked:f.createIfMissing!==!1,onChange:H=>h({...f,createIfMissing:H.target.checked}),className:"w-4 h-4 cursor-pointer"}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:i("newProject.field.dir.createIfMissing")})]})]}),c.jsx(Ui,{label:i("newProject.field.maxWorkers.short"),children:c.jsx("input",{type:"number",min:"1",max:"8",className:"nb-input w-full font-[family-name:var(--font-mono)]",value:f.maxWorkers,onChange:H=>h({...f,maxWorkers:H.target.value})})}),c.jsx(Ui,{label:i("newProject.field.ackTimeout.minutes"),hint:i("newProject.field.ackTimeout.minutes.help"),children:c.jsx("input",{type:"number",min:"1",max:"30",className:"nb-input w-full font-[family-name:var(--font-mono)]",value:f.ackTimeoutMin??"5",onChange:H=>h({...f,ackTimeoutMin:H.target.value})})}),c.jsxs("div",{className:"md:col-span-2 pt-3 border-t-2 border-[var(--color-text)] border-dashed",children:[c.jsxs("label",{className:"flex items-center gap-3 mb-2 cursor-pointer select-none",children:[c.jsx("input",{type:"checkbox",checked:f.enableReview??!1,onChange:H=>h({...f,enableReview:H.target.checked}),className:"w-4 h-4 cursor-pointer"}),c.jsx("span",{className:"text-sm font-bold",children:i("newProject.field.review.label")})]}),c.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:i("newProject.field.review.detail")})]}),c.jsxs("div",{className:"md:col-span-2 pt-3 border-t-2 border-[var(--color-text)] border-dashed",children:[c.jsxs("label",{className:"flex items-center gap-3 mb-3 cursor-pointer select-none",children:[c.jsx("input",{type:"checkbox",checked:f.enableGit??!0,onChange:H=>h({...f,enableGit:H.target.checked}),className:"w-4 h-4 cursor-pointer"}),c.jsx("span",{className:"text-sm font-bold",children:i("newProject.field.git.label")})]}),c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] mb-3",children:i("newProject.field.git.detail")}),f.enableGit!==!1&&c.jsxs("div",{className:"flex flex-col gap-4 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4",children:[c.jsx(Ui,{label:i("newProject.field.git.branch"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",value:f.mergeBranch??"main",onChange:H=>h({...f,mergeBranch:H.target.value})})}),c.jsx(Ui,{label:i("newProject.field.gitlabProject.label"),hint:i("newProject.field.gitlabProject.help2"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:i("newProject.field.gitlabProject.placeholder"),value:f.gitlabProject??"",onChange:H=>h({...f,gitlabProject:H.target.value})})}),f.gitlabProject&&c.jsx(Ui,{label:i("newProject.field.gitlabProjectId"),hint:i("newProject.field.gitlabProjectId.help"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:i("newProject.field.gitlabProjectId.placeholder"),value:f.gitlabProjectId??"",onChange:H=>h({...f,gitlabProjectId:H.target.value})})})]})]}),c.jsxs("div",{className:"md:col-span-2 pt-3 border-t-2 border-[var(--color-text)] border-dashed",children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider mb-3 text-[var(--color-text-muted)]",children:i("newProject.section.notifications")}),c.jsx(Ui,{label:i("newProject.field.matrixRoom.label"),hint:i("newProject.field.matrixRoom.help2"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:i("newProject.field.matrixRoom.placeholder"),value:f.matrixRoomId??"",onChange:H=>h({...f,matrixRoomId:H.target.value})})})]})]}),c.jsxs("div",{className:n?"flex shrink-0 gap-3 justify-end border-t-2 border-dashed border-[var(--color-text)] pt-4 mt-4":"flex gap-3 justify-end pt-3",children:[c.jsx("button",{type:"button",className:"nb-btn",onClick:d,disabled:_.isPending,children:i("common.cancel")}),c.jsx("button",{type:"submit",className:"nb-btn nb-btn-primary",disabled:!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(pi,{size:14,strokeWidth:3}),i("common.create")]})})]})]})]}),C&&c.jsx(dx,{title:i("newProject.field.dir.pickerTitle"),initialPath:f.projectDir.trim()||void 0,onCancel:()=>N(!1),onSelect:H=>{const Q=Af(H),G=Af(f.projectDir),L=f.name&&f.name!==G;h({...f,projectDir:H,name:L?f.name:Q}),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 S4({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(v2,{dialogMode:!0,onCancel:e,onCreated:n=>{e(),t(n)}})})})}const Ck="projects.last",N4=["activity","date","name"];function Ak(){const e=Be(),t=ks(),{name:n}=Ob(),[i,a]=Vb("projects.sort","activity"),[l,o]=j.useState(!1),[d,f]=j.useState(!1),{data:h,isLoading:g,isError:m,error:y,refetch:b}=Ye({queryKey:["projects"],queryFn:Es}),k=T=>t(`/projects/${encodeURIComponent(T)}`),v=h?y_(h.data,i):[],S=i!=="name",{recent:E,older:C}=S?xI(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(Ck,n)}catch{}},[n]),j.useEffect(()=>{if(n||!h)return;let T=null;try{T=localStorage.getItem(Ck)}catch{}T&&h.data.some(M=>M.name===T)&&t(`/projects/${encodeURIComponent(T)}`,{replace:!0})},[n,h,t]),c.jsxs("div",{className:"flex flex-col flex-1 min-h-0 w-full",children:[m?c.jsxs("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-2",children:e("projects.load.failed")}),c.jsx("p",{className:"text-sm text-[var(--color-text)]",children:y instanceof Error?y.message:String(y)}),c.jsx("button",{className:"nb-btn mt-4",onClick:()=>b(),type:"button",children:e("common.retry")})]}):h&&h.data.length===0?c.jsx(A4,{onNew:()=>f(!0)}):c.jsxs("div",{className:"flex gap-5 flex-1 min-h-0",children:[c.jsxs("aside",{className:"w-80 shrink-0 flex flex-col min-h-0",children:[c.jsxs("div",{className:"shrink-0 flex flex-col gap-2 pb-3",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold truncate",children:e("projects.title")}),c.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:h?e("projects.count",{count:h.data.length}):e("common.loading")})]}),c.jsxs("button",{className:"nb-btn nb-btn-primary shrink-0",type:"button",onClick:()=>f(!0),"aria-label":e("projects.new"),children:[c.jsx(pi,{size:16,strokeWidth:3}),e("projects.new")]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"inline-flex flex-1 rounded-full overflow-hidden bg-color-bg-soft",role:"group","aria-label":e("projects.sort.label"),children:N4.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($h,{size:16,strokeWidth:2.5})})]})]}),c.jsx("ul",{className:"flex-1 min-h-0 overflow-y-auto flex flex-col gap-0.5 pr-1",children:g?c.jsx(C4,{}):c.jsxs(c.Fragment,{children:[[...E,...N].map(T=>c.jsx(_4,{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(m4,{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(S4,{onClose:()=>f(!1),onCreated:k})]})}function _4({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(j4,{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 j4({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 C4(){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 A4({onNew:e}){const t=Be(),n=t("projects.empty.hint",{cmd:"__CMD__"}),[i,a]=n.split("__CMD__");return c.jsxs("div",{className:"nb-card bg-[var(--color-accent-yellow)] flex items-center gap-6 p-8",children:[c.jsx("div",{className:"w-20 h-20 rounded-3xl bg-[rgba(255,255,255,0.12)] text-[var(--color-text)] flex items-center justify-center shadow-[rgba(255,255,255,0.10)_0_0_0_1px_inset]",children:c.jsx(l_,{size:32,strokeWidth:2.5})}),c.jsxs("div",{className:"flex-1",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold mb-2",children:t("projects.empty.title")}),c.jsxs("p",{className:"text-sm text-[var(--color-text)] mb-4",children:[i,c.jsx("code",{className:"bg-[rgba(0,0,0,0.35)] px-2 py-0.5 rounded-md font-[family-name:var(--font-mono)]",children:"sps project init <name>"}),a]}),c.jsxs("button",{className:"nb-btn nb-btn-primary",type:"button",onClick:e,children:[c.jsx(pi,{size:16,strokeWidth:3}),t("projects.new")]})]})]})}function T4({project:e,isPending:t,onCancel:n,onCreate:i}){var N;const a=Be(),[l,o]=j.useState(""),[d,f]=j.useState(""),[h,g]=j.useState(new Set),[m,y]=j.useState(!1),b=Ye({queryKey:["skills-all",e],queryFn:()=>cx(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(h);T.has(_)?T.delete(_):T.add(_),g(T)},E=()=>{v&&i({title:l.trim(),description:d.trim(),skills:[...h],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(bn,{size:14,strokeWidth:3})})]}),c.jsx("form",{onSubmit:_=>{_.preventDefault(),E()},className:"flex min-h-0 flex-1 flex-col",children:c.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-1 gap-4 overflow-y-auto pr-1 md:grid-cols-[minmax(0,1fr)_minmax(280px,380px)] md:overflow-hidden md:pr-0",children:[c.jsxs("div",{className:"flex min-h-0 flex-col gap-4 md:overflow-y-auto md:pr-1",children:[c.jsxs("label",{className:"flex flex-col gap-1.5",children:[c.jsx("span",{className:"text-sm font-bold",children:a("newCard.field.title")}),c.jsx("input",{type:"text",className:"nb-input w-full",placeholder:a("newCard.field.title.placeholder"),value:l,onChange:_=>o(_.target.value),maxLength:200,autoFocus:!0,required:!0}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:a("newCard.field.title.help")})]}),c.jsxs("label",{className:"flex flex-col gap-1.5",children:[c.jsx("span",{className:"text-sm font-bold",children:a("newCard.field.description")}),c.jsx("textarea",{className:"nb-input w-full",style:{minHeight:160,resize:"vertical"},placeholder:a("newCard.field.description.placeholder"),value:d,onChange:_=>f(_.target.value)}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:a("newCard.field.description.help")})]}),c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("span",{className:"text-sm font-bold",children:a("newCard.field.dispatch")}),c.jsxs("label",{className:"flex items-center gap-3 cursor-pointer select-none p-3 border-[2px] border-[var(--color-text)] rounded-lg bg-[var(--color-bg-cream)]",children:[c.jsx("input",{type:"checkbox",className:"w-4 h-4 accent-[var(--color-cta)] cursor-pointer",checked:m,onChange:_=>y(_.target.checked)}),c.jsxs("div",{className:"flex-1",children:[c.jsx("div",{className:"text-sm font-bold",children:a("newCard.field.dispatch.label")}),c.jsx("div",{className:"text-xs text-[var(--color-text-muted)] mt-0.5",children:a("newCard.field.dispatch.help")})]})]})]})]}),c.jsxs("section",{className:"flex min-h-[240px] flex-col gap-2 md:min-h-0 md:overflow-hidden",children:[c.jsx("span",{className:"text-sm font-bold",children:a("newCard.field.skills")}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:a("newCard.field.skills.help")}),c.jsx("div",{className:"scroll-frame min-h-0 flex-1 rounded-lg border-2 border-[var(--color-border-light)] bg-[var(--color-bg-cream)]",children:c.jsxs("div",{className:"scroll-frame-body h-full p-2",children:[b.isLoading&&c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:a("newCard.field.skills.loading")}),b.isError&&c.jsx("p",{className:"text-xs text-[var(--color-crashed)]",children:a("newCard.field.skills.error",{detail:b.error instanceof Error?b.error.message:String(b.error)})}),C.length>0&&c.jsx("div",{className:"flex flex-wrap gap-2",children:C.map(_=>{const T=h.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)})})]})}),h.size>0&&c.jsx("p",{className:"max-h-14 overflow-y-auto break-words text-xs text-[var(--color-text-muted)]",children:a("newCard.field.skills.selected",{count:h.size,names:[...h].join(", ")})})]})]})}),c.jsxs("div",{className:"flex gap-2 justify-end mt-4 pt-3 border-t-2 border-dashed border-[var(--color-text)] flex-shrink-0",children:[c.jsx("button",{className:"nb-btn",style:{padding:"6px 14px"},onClick:n,disabled:t,type:"button",children:a("common.cancel")}),c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 14px"},onClick:E,disabled:!v,type:"button","aria-label":a("newCard.create.aria"),children:[t?c.jsx(Xe,{size:13,strokeWidth:3,className:"animate-spin"}):c.jsx(pi,{size:13,strokeWidth:3}),a("common.create")]})]})]})})}function M4(e){return ft(`/api/projects/${encodeURIComponent(e)}/cards`)}function D4(e,t){return ft(`/api/projects/${encodeURIComponent(e)}/cards/${t}`)}async function ac(e,t){const n=await fetch(e,{method:"POST",headers:t?{"Content-Type":"application/json"}:void 0,body:t?JSON.stringify(t):void 0});if(!n.ok){const i=await n.text();throw new Error(`${n.status} ${n.statusText}: ${i}`)}return n.json().catch(()=>({}))}function O4(e,t){return ac(`/api/projects/${encodeURIComponent(e)}/cards/${t}/reset`)}async function R4(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 L4(e,t){return ac(`/api/projects/${encodeURIComponent(e)}/cards/${t}/launch`)}function I4(e,t){const n=typeof t=="string"?{title:t}:t;return ac(`/api/projects/${encodeURIComponent(e)}/cards`,n)}async function z4(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 P4(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 w2(e){return ac(`/api/projects/${encodeURIComponent(e)}/pipeline/start`)}function k2(e){return ac(`/api/projects/${encodeURIComponent(e)}/pipeline/stop`)}function B4(e,t){return ac(`/api/projects/${encodeURIComponent(e)}/pipeline/reset`,t??{})}function $4(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 U4=new Set(["python","typescript","golang","rust","kotlin","swift","java"]),F4=new Set(["frontend","backend","mobile","database","devops"]),q4=new Set(["backend-architect","frontend-developer","code-reviewer","database-optimizer","devops-automator","security-engineer","qa-tester","security","qa","architect","db-opt"]),H4=new Set(["coding-standards","tdd-workflow","git-workflow","architecture-decision-records","debugging-workflow"]);function K4(e){return U4.has(e)?"lang":F4.has(e)?"end":q4.has(e)?"persona":H4.has(e)?"workflow":"other"}const G4={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 fx({name:e}){const t=G4[K4(e)];return c.jsx("span",{className:"nb-badge",style:{background:t},children:e})}function E2({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 V4({card:e,onClick:t,done:n,draggable:i}){const a=Be(),l=e.labels.some(o=>o.startsWith("STARTED-"))&&!n;return c.jsxs("article",{onClick:t,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),t())},draggable:i,onDragStart:o=>{o.dataTransfer.setData("application/x-sps-card-seq",String(e.seq)),o.dataTransfer.effectAllowed="move"},tabIndex:0,role:"button","aria-label":`Card #${e.seq}: ${e.title}`,className:["nb-card nb-card-interactive p-3 cursor-pointer","transition-[transform,background-color,border-color] duration-[180ms] ease-out","focus:outline-none focus-visible:ring-[3px] focus-visible:ring-offset-2 focus-visible:ring-[var(--color-text)]",n?"opacity-60":"",i?"active:cursor-grabbing":""].join(" "),children:[c.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[c.jsxs("span",{className:"nb-badge font-[family-name:var(--font-mono)] text-[11px] px-2 py-0.5",children:["#",e.seq]}),l&&c.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:"running"})]}),c.jsx("p",{className:`font-bold text-sm leading-5 mb-2 line-clamp-2 ${n?"line-through decoration-2":""}`,children:e.title}),(e.skills.length>0||e.labels.length>0)&&c.jsxs("div",{className:"flex flex-wrap gap-1 mb-2",children:[e.skills.slice(0,3).map(o=>c.jsx(fx,{name:o},o)),e.labels.filter(o=>o==="NEEDS-FIX").map(o=>c.jsx(E2,{label:o,kind:"warn"},o))]}),e.checklist&&e.checklist.total>0&&c.jsx(Y4,{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:Q4(e.updatedAt??e.createdAt,a)}),e.branch&&c.jsxs("span",{className:"truncate",children:["· ",e.branch]})]})]})}function Y4({stats:e}){const t=Be();return c.jsxs("div",{className:"mb-2",children:[c.jsxs("div",{className:"flex items-center justify-between text-[11px] font-[family-name:var(--font-mono)] mb-1",children:[c.jsx("span",{className:"font-bold",children:t("kanban.checklist.label",{done:e.done,total:e.total})}),c.jsxs("span",{className:"text-[var(--color-text-subtle)]",children:[e.percent,"%"]})]}),c.jsx("div",{className:"w-full h-1.5 bg-[rgba(255,255,255,0.08)] rounded-full overflow-hidden mb-1.5",children:c.jsx("div",{className:"h-full bg-[var(--color-snow-white)] transition-[width] duration-200",style:{width:`${e.percent}%`}})}),c.jsxs("ul",{className:"text-[11px] space-y-0.5",children:[e.items.slice(0,3).map((n,i)=>c.jsxs("li",{className:`flex items-start gap-1 ${n.done?"opacity-60 line-through":""}`,children:[c.jsx("span",{className:"flex-shrink-0 mt-0.5",children:n.done?"✓":"○"}),c.jsx("span",{className:"line-clamp-1",children:n.text})]},i)),e.items.length>3&&c.jsx("li",{className:"text-[var(--color-text-subtle)] italic pl-3",children:t("kanban.checklist.more",{count:e.items.length-3})})]})]})}function Q4(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 W4({label:e,bg:t,badgeVars:n,cards:i,onCardClick:a,onDropCard:l}){const o=Be(),[d,f]=j.useState(!1);return c.jsxs("div",{className:["nb-card flex flex-col p-3 min-h-[280px] h-full min-h-0 overflow-hidden","transition-all",d?"bg-[rgba(255,255,255,0.16)]":""].join(" "),style:{background:t,...n},onDragOver:h=>{!l||!h.dataTransfer.types.includes("application/x-sps-card-seq")||(h.preventDefault(),h.dataTransfer.dropEffect="move",d||f(!0))},onDragLeave:()=>f(!1),onDrop:h=>{if(f(!1),!l)return;const g=h.dataTransfer.getData("application/x-sps-card-seq"),m=Number.parseInt(g,10);Number.isFinite(m)&&(h.preventDefault(),l(m))},children:[c.jsxs("div",{className:"flex items-center justify-between px-1 pb-2 mb-2 border-b border-[var(--color-border-light)] shrink-0",children:[c.jsx("span",{className:"font-[family-name:var(--font-heading)] font-bold text-sm uppercase tracking-wider",children:e}),c.jsx("span",{className:"nb-badge font-[family-name:var(--font-mono)] text-xs px-2 py-0.5",children:i.length})]}),c.jsxs("div",{className:"flex flex-col gap-2 flex-1 min-h-0 overflow-y-auto pr-1 -mr-1",style:{scrollbarWidth:"thin",scrollbarColor:"rgba(229,229,229,0.36) transparent"},children:[i.length===0&&c.jsx("div",{className:"text-xs text-[var(--color-text-muted)] text-center py-6 italic",children:o("kanban.column.empty")}),i.map(h=>c.jsx(V4,{card:h,onClick:()=>a(h),done:e==="Done",draggable:!!l},h.seq))]})]})}function Xy(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 $g(e){return Xy(e,"描述")}function X4({project:e,seq:t,onClose:n,onChanged:i}){var H,Q,G,L,z,V,P,le,ve,ke,Se;const a=Be(),l=Ft(),{confirm:o,alert:d}=un(),{data:f,isLoading:h,isError:g,error:m,refetch:y}=Ye({queryKey:["card",e,t],queryFn:()=>D4(e,t)}),[b,k]=j.useState(!1),[v,S]=j.useState(""),[E,C]=j.useState(""),[N,_]=j.useState(new Set),[T,M]=j.useState([]),[R,O]=j.useState(""),B=Ye({queryKey:["skills-all",e],queryFn:()=>cx(e),enabled:b}),K=((Q=(H=Ye({queryKey:["projects"],queryFn:Es,refetchInterval:1e4}).data)==null?void 0:H.data.find(J=>J.name===e))==null?void 0:Q.pipelineStatus)==="running";j.useEffect(()=>{b&&f&&(S(f.title),C($g(f.body)),_(new Set(f.skills)),M([...f.labels]))},[b,f]),j.useEffect(()=>{const J=ue=>{ue.key==="Escape"&&(b?k(!1):n())};return window.addEventListener("keydown",J),()=>window.removeEventListener("keydown",J)},[n,b]);const q=Et({mutationFn:()=>{if(!f)throw new Error("no data");const J={},ue=v.trim();ue&&ue!==f.title&&(J.title=ue);const Te=$g(f.body);E!==Te&&(J.description=E);const Re=[...N].sort(),Oe=[...f.skills].sort();return JSON.stringify(Re)!==JSON.stringify(Oe)&&(J.skills=Re),JSON.stringify(T)!==JSON.stringify(f.labels)&&(J.labels=T),Object.keys(J).length===0?Promise.resolve({ok:!0,noop:!0}):P4(e,t,J)},onSuccess:()=>{l.invalidateQueries({queryKey:["card",e,t]}),l.invalidateQueries({queryKey:["cards",e]}),k(!1),i()},onError:J=>{d({title:a("cardModal.error.save.title"),body:J instanceof Error?J.message:String(J)})}}),Y=j.useMemo(()=>{if(!b||!f)return!1;if(v.trim()!==f.title||E!==$g(f.body))return!0;const J=[...N].sort(),ue=[...f.skills].sort();return JSON.stringify(J)!==JSON.stringify(ue)||JSON.stringify(T)!==JSON.stringify(f.labels)},[b,f,v,E,N,T]),D=J=>{const ue=new Set(N);ue.has(J)?ue.delete(J):ue.add(J),_(ue)},F=()=>{const J=R.trim();if(J){if(T.includes(J)){O("");return}M([...T,J]),O("")}},I=J=>{M(T.filter(ue=>ue!==J))};return c.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"card-modal-title",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",children:c.jsxs("div",{className:"nb-card mt-12 w-full max-w-3xl bg-[var(--color-bg)]",children:[c.jsxs("header",{className:"flex items-start justify-between gap-4 mb-4",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[c.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-xs px-2 py-0.5 bg-[var(--color-accent-purple)] border-2 border-[var(--color-text)] rounded-full",children:["#",t]}),(f==null?void 0:f.state)&&c.jsx("span",{className:"font-[family-name:var(--font-mono)] text-xs px-2 py-0.5 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-full font-semibold",children:f.state}),b&&c.jsx("span",{className:"text-xs font-bold text-[var(--color-stuck)]",children:a("cardModal.editing")})]}),b?c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-heading)] text-xl font-bold",value:v,onChange:J=>S(J.target.value),maxLength:200,"aria-label":a("cardModal.title.aria")}):c.jsx("h2",{id:"card-modal-title",className:"font-[family-name:var(--font-heading)] text-2xl font-bold break-words",children:(f==null?void 0:f.title)??a("common.loading")})]}),c.jsxs("div",{className:"flex gap-2 flex-shrink-0",children:[!b&&f&&c.jsxs("button",{onClick:()=>k(!0),className:"nb-btn",style:{padding:"6px 12px"},type:"button","aria-label":a("cardModal.editAria"),children:[c.jsx(qh,{size:12,strokeWidth:2.5})," ",a("cardModal.edit")]}),c.jsx("button",{onClick:n,className:"nb-btn nb-btn-mint p-2","aria-label":a("cardModal.close.aria"),type:"button",children:c.jsx(bn,{size:14,strokeWidth:3})})]})]}),h&&c.jsx("p",{className:"text-[var(--color-text-muted)]",children:a("common.loading")}),g&&c.jsx("p",{className:"text-[var(--color-crashed)]",children:a("cardModal.error.load",{detail:m instanceof Error?m.message:String(m)})}),f&&c.jsxs("div",{className:"flex flex-col gap-4",children:[f.branch&&!b&&c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[c.jsx(yL,{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"}),B.isLoading&&c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:a("cardModal.skills.loading")}),B.data&&B.data.data.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1.5",children:B.data.data.map(J=>{const ue=N.has(J.name);return c.jsx("button",{type:"button",onClick:()=>D(J.name),"aria-pressed":ue,className:["px-2.5 py-1 text-xs font-[family-name:var(--font-mono)] rounded-full border-2 transition-all",ue?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)] font-bold":"bg-[var(--color-bg)] border-[var(--color-border-light)] hover:border-[var(--color-text)]"].join(" "),children:J.name},J.name)})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Labels"}),c.jsxs("div",{className:"flex flex-wrap gap-1.5 items-center",children:[T.map(J=>c.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-xs font-[family-name:var(--font-mono)] bg-[var(--color-accent-yellow)] border-2 border-[var(--color-text)] rounded-full",children:[J,c.jsx("button",{type:"button",onClick:()=>I(J),className:"hover:text-[var(--color-crashed)]","aria-label":a("cardModal.label.removeAria",{label:J}),children:c.jsx(bn,{size:10,strokeWidth:3})})]},J)),c.jsx("input",{type:"text",className:"nb-input",style:{padding:"4px 8px",fontSize:12,width:140},placeholder:a("cardModal.label.addPlaceholder"),value:R,onChange:J=>O(J.target.value),onKeyDown:J=>{J.key==="Enter"&&!J.nativeEvent.isComposing&&(J.preventDefault(),F())}}),R&&c.jsx("button",{type:"button",className:"nb-btn",style:{padding:"2px 6px",fontSize:11},onClick:F,"aria-label":a("cardModal.label.addAria"),children:c.jsx(pi,{size:10,strokeWidth:3})})]}),c.jsx("p",{className:"text-[10px] text-[var(--color-text-muted)] mt-1",children:a("cardModal.label.note")})]})]}):c.jsxs(c.Fragment,{children:[f.skills.length>0&&c.jsxs("div",{children:[c.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Skills"}),c.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:f.skills.map(J=>c.jsx(fx,{name:J},J))})]}),f.labels.length>0&&c.jsxs("div",{children:[c.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Labels"}),c.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:f.labels.map(J=>c.jsx(E2,{label:J,kind:J==="NEEDS-FIX"?"warn":"default"},J))})]})]}),b?c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:a("cardModal.section.description")}),c.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",style:{minHeight:180,resize:"vertical"},value:E,onChange:J=>C(J.target.value),"aria-label":a("cardModal.body.aria")}),c.jsx("p",{className:"text-[10px] text-[var(--color-text-muted)] mt-1",children:a("cardModal.body.replaceNote")})]}),(((le=f.checklist)==null?void 0:le.total)??0)>0&&c.jsxs("div",{className:"nb-card bg-[var(--color-bg-cream)] p-3",children:[c.jsx("div",{className:"flex items-center justify-between mb-2",children:c.jsxs("span",{className:"font-bold text-sm",children:[a("cardModal.section.checklist")," ",((ve=f.checklist)==null?void 0:ve.done)??0,"/",((ke=f.checklist)==null?void 0:ke.total)??0]})}),c.jsx("ul",{className:"text-sm space-y-1",children:(((Se=f.checklist)==null?void 0:Se.items)??[]).map((J,ue)=>c.jsxs("li",{className:`flex items-start gap-2 ${J.done?"opacity-60 line-through":""}`,children:[c.jsx("span",{children:J.done?"✓":"○"}),c.jsx("span",{children:J.text})]},ue))})]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:a("cardModal.section.description")}),c.jsx("pre",{className:"text-xs whitespace-pre-wrap font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4 max-h-64 overflow-auto",children:Xy(f.body,"描述")||a("cardModal.section.empty")})]}),c.jsxs("div",{children:[c.jsxs("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:[a("cardModal.section.checklist")," ",c.jsxs("span",{className:"text-[var(--color-text-muted)] normal-case tracking-normal",children:[((G=f.checklist)==null?void 0:G.done)??0,"/",((L=f.checklist)==null?void 0:L.total)??0]})]}),c.jsx("div",{className:"nb-card bg-[var(--color-bg-cream)] p-3",children:(((z=f.checklist)==null?void 0:z.total)??0)>0?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"flex items-center justify-end mb-2",children:c.jsx("div",{className:"w-24 h-2 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-full overflow-hidden",children:c.jsx("div",{className:"h-full bg-[var(--color-cta)]",style:{width:`${((V=f.checklist)==null?void 0:V.percent)??0}%`}})})}),c.jsx("ul",{className:"text-sm space-y-1",children:(((P=f.checklist)==null?void 0:P.items)??[]).map((J,ue)=>c.jsxs("li",{className:`flex items-start gap-2 ${J.done?"opacity-60 line-through":""}`,children:[c.jsx("span",{children:J.done?"✓":"○"}),c.jsx("span",{children:J.text})]},ue))})]}):c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:a("cardModal.checklist.empty")})})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:a("cardModal.section.log")}),c.jsx("pre",{className:"text-xs whitespace-pre-wrap font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4 max-h-64 overflow-auto",children:Xy(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:q.isPending,children:a("common.cancel")}),c.jsxs("button",{className:"nb-btn nb-btn-primary",type:"button",onClick:()=>q.mutate(),disabled:!Y||!v.trim()||q.isPending,"aria-label":a("cardDetail.save"),children:[q.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"||K,title:f.state==="Done"?a("cardModal.action.launch.disabledDone"):K?a("cardModal.action.launch.disabledRunning"):void 0,onClick:async()=>{try{await L4(e,t),i()}catch(J){d({title:a("cardModal.action.launch.error"),body:J instanceof Error?J.message:String(J)})}},children:[c.jsx(Yu,{size:14,strokeWidth:3}),a("cardModal.action.launch")]}),c.jsxs("button",{className:"nb-btn nb-btn-yellow",type:"button",onClick:async()=>{if(await o({title:a("cardModal.action.reset.confirm.title",{seq:t}),body:a("cardModal.action.reset.confirm.body"),confirm:a("cardModal.action.reset.confirm.button"),danger:!0}))try{await O4(e,t),i(),n()}catch(ue){d({title:a("cardModal.action.reset.error"),body:ue instanceof Error?ue.message:String(ue)})}},children:[c.jsx($b,{size:14,strokeWidth:2.5}),a("cardModal.action.reset")]}),c.jsxs("button",{className:"nb-btn",style:{background:"var(--color-crashed)",color:"var(--color-bg)"},type:"button",onClick:async()=>{if(!(!await o({title:a("cardModal.action.delete.confirm1.title",{seq:t}),body:a("cardModal.action.delete.confirm1.body",{title:f.title}),confirm:a("cardModal.action.delete.confirm1.button"),danger:!0})||!await o({title:a("cardModal.action.delete.confirm2.title"),body:a("cardModal.action.delete.confirm2.body",{seq:t}),confirm:a("cardModal.action.delete"),danger:!0})))try{await R4(e,t),i(),n()}catch(Te){d({title:a("projectDetail.pipelines.delete.error"),body:Te instanceof Error?Te.message:String(Te)})}},"aria-label":a("cardModal.action.delete"),children:[c.jsx(Vi,{size:14,strokeWidth:2.5}),a("cardModal.action.delete")]})]})})]})]})})}function Z4({current:e,onChange:t}){const[n,i]=j.useState(!1),a=j.useRef(null),{data:l}=Ye({queryKey:["projects"],queryFn:Es});return j.useEffect(()=>{const o=d=>{var f;(f=a.current)!=null&&f.contains(d.target)||i(!1)};return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[]),c.jsxs("div",{className:"relative",ref:a,children:[c.jsxs("button",{type:"button",className:"nb-btn font-[family-name:var(--font-mono)] text-sm",onClick:()=>i(o=>!o),children:[e,c.jsx(Vu,{size:14,strokeWidth:2.5})]}),n&&l&&c.jsx("div",{className:"absolute right-0 mt-2 z-20 min-w-[200px] nb-card p-1 overflow-hidden",children:c.jsx("div",{className:"max-h-[60vh] overflow-y-auto",children:y_(l.data,"activity").map(o=>{const d=o.pipelineStatus==="running";return c.jsxs("button",{type:"button",onClick:()=>{t(o.name),i(!1)},className:["dimension-menu-item w-full text-left px-4 py-2 text-sm font-semibold flex items-center gap-2",o.name===e?"dimension-menu-item-active":""].join(" "),children:[d&&c.jsx(Yu,{size:12,strokeWidth:3,className:"text-[var(--color-running)] shrink-0","aria-label":"运行中"}),c.jsx("span",{className:"font-[family-name:var(--font-mono)]",children:o.name}),c.jsxs("span",{className:"ml-auto text-xs text-[var(--color-text-muted)]",children:[o.cards.total," cards"]})]},o.name)})})})]})}const J4=[{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)"}}],S2="sps-console:last-board-project";function e5(){if(typeof window>"u")return null;try{return localStorage.getItem(S2)}catch{return null}}function t5(e){if(!(typeof window>"u"))try{localStorage.setItem(S2,e)}catch{}}function n5(){var I,H,Q;const e=Be(),[t,n]=qN(),i=t.get("project"),[a,l]=j.useState(null),[o,d]=j.useState(""),[f,h]=j.useState(()=>new Set),[g,m]=j.useState(()=>new Set),{confirm:y,alert:b}=un();$4(i);const k=Ye({queryKey:["projects"],queryFn:Es}),v=Ye({queryKey:["cards",i],queryFn:()=>M4(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){t5(i);return}const G=e5();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:()=>w2(i),onSuccess:()=>{E()},onError:G=>{b({title:e("board.action.startError"),body:G instanceof Error?G.message:String(G)})}}),_=Et({mutationFn:()=>k2(i),onSuccess:()=>E(),onError:G=>{b({title:e("board.action.stopError"),body:G instanceof Error?G.message:String(G)})}}),T=Et({mutationFn:()=>B4(i,{all:!0}),onSuccess:()=>E(),onError:G=>{b({title:e("board.action.resetError"),body:G instanceof Error?G.message:String(G)})}}),[M,R]=j.useState(!1),O=Et({mutationFn:G=>I4(i,G),onSuccess:()=>{E(),R(!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})=>z4(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=(Q=k.data)==null?void 0:Q.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(Z4,{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(Fb,{size:14,strokeWidth:3}):c.jsx(Yu,{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($b,{size:14,strokeWidth:2.5}),e("board.action.reset")]}),c.jsxs("button",{className:"nb-btn nb-btn-mint",type:"button",onClick:()=>R(!0),disabled:O.isPending,children:[O.isPending?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(pi,{size:14,strokeWidth:3}),e("board.action.newCard")]})]})]}),c.jsxs("div",{className:"flex items-center gap-3 flex-wrap shrink-0",children:[c.jsxs("div",{className:"relative flex-1 max-w-md",children:[c.jsx(fl,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-subtle)]"}),c.jsx("input",{className:"nb-input pl-9 w-full",placeholder:e("board.search.placeholder"),value:o,onChange:G=>d(G.target.value),"aria-label":e("board.search.aria")})]}),c.jsx(Tk,{label:"skill",options:K,selected:f,onChange:h}),c.jsx(Tk,{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(""),h(new Set),m(new Set)},type:"button","aria-label":e("board.filter.clearAria"),children:[c.jsx(bn,{size:11,strokeWidth:3}),e("board.filter.clear")]}),c.jsxs("span",{className:"text-xs text-[var(--color-text-muted)] flex items-center gap-1 font-[family-name:var(--font-mono)]",children:[c.jsx(mL,{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:J4.map(G=>c.jsx(W4,{label:e(G.labelKey),bg:G.bg,badgeVars:G.badgeVars,cards:Y.filter(i5(G.state)),onCardClick:L=>l(L.seq),onDropCard:L=>B.mutate({seq:L,state:G.state})},G.state))}),a!==null&&c.jsx(X4,{project:i,seq:a,onClose:()=>l(null),onChanged:E}),M&&c.jsx(T4,{project:i,isPending:O.isPending,onCancel:()=>R(!1),onCreate:G=>O.mutate(G)})]})}function i5(e){return t=>e==="QA"?t.state==="QA"||t.state==="Review":e==="Done"?t.state==="Done"||t.state==="Canceled":t.state===e}function Tk({label:e,options:t,selected:n,onChange:i}){const a=Be(),[l,o]=j.useState(!1),d=j.useRef(null);j.useEffect(()=>{if(!l)return;const m=b=>{var k;(k=d.current)!=null&&k.contains(b.target)||o(!1)},y=b=>{b.key==="Escape"&&o(!1)};return window.addEventListener("click",m),window.addEventListener("keydown",y),()=>{window.removeEventListener("click",m),window.removeEventListener("keydown",y)}},[l]);const f=m=>{const y=new Set(n);y.has(m)?y.delete(m):y.add(m),i(y)},h=t.length===0,g=n.size;return c.jsxs("div",{ref:d,className:"relative",children:[c.jsxs("button",{type:"button",className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>!h&&o(m=>!m),disabled:h,"aria-haspopup":"listbox","aria-expanded":l,"aria-label":a("board.filter.aria",{label:e}),children:[e,g>0&&c.jsx("span",{className:"ml-1 px-1.5 py-0.5 text-[10px] font-bold rounded-full bg-[var(--color-primary)] text-[var(--color-text)] border border-[var(--color-text)]",children:g}),c.jsx(Vu,{size:11,strokeWidth:3,className:["transition-transform",l?"rotate-180":""].join(" ")})]}),l&&c.jsx("div",{className:"absolute left-0 top-full mt-2 z-20 min-w-[200px] nb-card p-2 overflow-hidden",style:{padding:8},children:c.jsxs("div",{role:"listbox",className:"max-h-64 overflow-auto",children:[t.map(m=>{const y=n.has(m);return c.jsxs("label",{className:["flex items-center gap-2 px-2 py-1.5 rounded cursor-pointer text-sm font-[family-name:var(--font-mono)]",y?"bg-[var(--color-accent-mint)]":"hover:bg-[var(--color-bg-cream)]"].join(" "),children:[c.jsx("input",{type:"checkbox",checked:y,onChange:()=>f(m),className:"flex-shrink-0"}),c.jsx("span",{className:"truncate",children:m})]},m)}),g>0&&c.jsx("button",{type:"button",className:"w-full mt-2 pt-2 border-t-2 border-dashed border-[var(--color-text)] text-xs font-bold text-[var(--color-crashed)] text-center",onClick:()=>i(new Set),children:a("board.filter.clearSelection")})]})})]})}function r5(){return ft("/api/workers/all")}function a5(e){return ft(`/api/projects/${encodeURIComponent(e)}/workers`)}function s5(e,t){return ft(`/api/projects/${encodeURIComponent(e)}/workers/${t}`)}async function N2(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 Mk(e,t){return N2(`/api/projects/${encodeURIComponent(e)}/workers/${t}/kill`)}function l5(e,t,n){return N2(`/api/projects/${encodeURIComponent(e)}/workers/${t}/launch`,n?{seq:n}:void 0)}function hx({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(h3,{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 px(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 o5(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 mx(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 c5({alerts:e,selected:t,onSelect:n}){const i=Be();return e.length===0?c.jsxs("div",{className:"nb-card bg-[var(--color-running-bg)] flex items-center gap-3",children:[c.jsx(Eu,{size:18,strokeWidth:2.5,className:"text-[var(--color-running)]"}),c.jsx("span",{className:"text-sm font-bold text-[var(--color-running)]",children:i("workers.alerts.allHealthy")})]}):c.jsxs("section",{children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider mb-2 flex items-center gap-2 text-[var(--color-crashed)]",children:[c.jsx(_3,{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(hx,{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(YN,{size:10,strokeWidth:2.5}),px(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:mx(a.markerUpdatedAt)})})]},`${a.project}-${a.slot}`)})})]})}function u5({active:e,selected:t,onSelect:n}){const i=Be();return e.length===0?c.jsx("div",{className:"nb-card",children:c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] italic",children:i("workers.active.empty")})}):c.jsxs("section",{children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider mb-2 flex items-center gap-2",children:[c.jsx($h,{size:14,strokeWidth:2.5}),"Active (",e.length,")"]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:e.map(a=>{const l=(t==null?void 0:t.project)===a.project&&(t==null?void 0:t.slot)===a.slot;return c.jsxs("button",{type:"button",onClick:()=>n(a.project,a.slot),className:["nb-card p-3 text-left",a.state==="starting"?"bg-[var(--color-secondary)]":"bg-[var(--color-running-bg)]",l?"ring-4 ring-[var(--color-text)]":""].join(" "),children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsx(hx,{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)] ${o5(a.runtimeMs)}`,children:px(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 ",mx(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(a_,{size:9,strokeWidth:2.5,className:"inline-block mr-1 align-text-bottom"}),a.lastLogLine.msg]})]},`${a.project}-${a.slot}`)})})]})}function d5({capacity:e,selected:t,onSelect:n}){const i=Be();return e.length===0?null:c.jsxs("section",{className:"flex flex-col min-h-0 flex-1",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider mb-2 shrink-0",children:"Capacity"}),c.jsxs("div",{className:"scroll-frame min-h-0 flex-1 rounded-lg border-2 border-[var(--color-border-light)] bg-[var(--color-bg-cream)] flex flex-col",children:[c.jsxs("table",{className:"w-full table-fixed text-sm shrink-0",children:[c.jsx(Dk,{}),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(Dk,{}),c.jsx("tbody",{children:e.map(a=>c.jsx(f5,{capacity:a,selected:(t==null?void 0:t.project)===a.project,onSelect:()=>n(a.project)},a.project))})]})})]})]})}function Dk(){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 f5({capacity:e,selected:t,onSelect:n}){const i=Be(),a=e.running+e.starting+e.stuck+e.crashed;return c.jsxs("tr",{onClick:n,className:["border-b border-dashed border-[var(--color-border-light)] last:border-0 cursor-pointer hover:bg-[var(--color-accent-yellow)]",t?"bg-[var(--color-accent-yellow)]":""].join(" "),children:[c.jsx("td",{className:"px-3 py-2 font-[family-name:var(--font-mono)] font-bold",children:e.project}),c.jsx("td",{className:"px-3 py-2",children:c.jsx(h5,{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 h5({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:p5(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 p5(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 m5({project:e,initialSlot:t,onChange:n}){var h;const i=Be(),a=Ye({queryKey:["workers",e],queryFn:()=>a5(e),refetchInterval:3e3}),l=((h=a.data)==null?void 0:h.data)??[],[o,d]=j.useState(null);j.useEffect(()=>{if(l.length===0){d(null);return}const g=l[0].slot;d(m=>m!=null&&l.some(y=>y.slot===m)?m:t!=null&&l.some(y=>y.slot===t)?t:g)},[e,t,l.length]);const f=l.find(g=>g.slot===o)??null;return c.jsxs("div",{className:"flex flex-col h-full",children:[c.jsxs("div",{className:"px-4 bg-color-bg-soft py-3 border-b-2 border-[var(--color-text)] bg-[var(--color-bg-cream)]",children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold truncate",children:e}),c.jsx(vs,{to:`/board?project=${encodeURIComponent(e)}`,className:"text-xs underline text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:i("workers.panel.boardLink")})]}),a.isLoading&&l.length===0?c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:i("workers.panel.loading")}):l.length===0?c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:i("workers.panel.empty.slots")}):c.jsx("div",{className:"flex flex-wrap gap-2",children:l.map(g=>c.jsx(g5,{worker:g,active:g.slot===o,onClick:()=>d(g.slot)},g.slot))})]}),f?c.jsx(y5,{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 g5({worker:e,active:t,onClick:n}){const i=Be();return c.jsxs("button",{type:"button",onClick:n,className:["nb-card p-2 text-left min-w-[130px] transition-transform",t?"ring-4 ring-[var(--color-text)]":"opacity-80 hover:opacity-100"].join(" "),children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsx(hx,{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 y5({project:e,worker:t,onChange:n}){var y,b;const i=Be(),{confirm:a,alert:l}=un(),o=t.state==="crashed"||t.state==="stuck",d=Ye({queryKey:["worker-detail",e,t.slot],queryFn:()=>s5(e,t.slot),refetchInterval:3e3}),f=((y=d.data)==null?void 0:y.recentOutput)??[],h=((b=d.data)==null?void 0:b.recentLogs)??[],g=j.useRef(null),m=j.useRef(!0);return j.useEffect(()=>{const k=g.current;k&&m.current&&(k.scrollTop=k.scrollHeight)},[f]),c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex-1 overflow-auto p-4 flex flex-col gap-4",children:[t.card?c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-text-muted)] mb-1",children:i("workers.panel.section.currentCard")}),c.jsxs("div",{className:"text-sm font-semibold break-words",children:["#",t.card.seq," · ",t.card.title]})]}):c.jsx("div",{className:"text-sm text-[var(--color-text-muted)] italic",children:i("workers.panel.idle.full")}),c.jsxs("dl",{className:"grid grid-cols-[100px_1fr] gap-y-2 text-sm",children:[c.jsx("dt",{className:"font-bold",children:"Stage"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.stage??"—"}),c.jsx("dt",{className:"font-bold",children:"PID"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.pid??"—"}),c.jsx("dt",{className:"font-bold",children:"Runtime"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:px(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?mx(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(a_,{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
|
-
`)})]}),h.length>0&&c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-text-muted)] mb-1 opacity-60",children:i("workers.panel.section.heartbeat",{n:h.length})}),c.jsx("pre",{className:"text-xs font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded p-2 max-h-40 overflow-auto whitespace-pre-wrap break-words opacity-80",children:h.map(k=>`${k.ts??""} [${k.level}] ${k.msg}`).join(`
|
|
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 Mk(e,t.slot)}catch{}try{await l5(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(w3,{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 Mk(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(O3,{size:11,strokeWidth:2.5})," ",i("workers.panel.action.kill")]})]})]})}function b5(){var o;const e=Be(),t=Ft(),[n,i]=j.useState(null),a=Ye({queryKey:["workers-agg"],queryFn:r5,refetchInterval:5e3});j.useEffect(()=>{if(!a.data)return;const d=a.data.capacity.map(h=>h.project),f=[];for(const h of d){const g=new EventSource(`/stream/projects/${encodeURIComponent(h)}`),m=()=>{t.invalidateQueries({queryKey:["workers-agg"]})};g.addEventListener("worker.updated",m),g.addEventListener("worker.added",m),g.addEventListener("worker.deleted",m),g.addEventListener("card.updated",m),f.push(g)}return()=>{for(const h of f)h.close()}},[(o=a.data)==null?void 0:o.capacity.map(d=>d.project).join(","),t]);const l=j.useMemo(()=>{if(!a.data)return{projects:0,running:0,starting:0,stuck:0,crashed:0,idle:0};const d={projects:a.data.capacity.length,running:0,starting:0,stuck:0,crashed:0,idle:0};for(const f of a.data.capacity)d.running+=f.running,d.starting+=f.starting,d.stuck+=f.stuck,d.crashed+=f.crashed,d.idle+=f.idle;return d},[a.data]);return c.jsxs("div",{className:"flex flex-col gap-4 h-[calc(100vh-140px)]",children:[c.jsxs("header",{className:"flex items-center justify-between flex-wrap gap-3",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold tracking-tight",children:e("workers.title")}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:e("workers.summary",{projects:l.projects,running:l.running,starting:l.starting,stuck:l.stuck,crashed:l.crashed,idle:l.idle})})]}),c.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>a.refetch(),disabled:a.isFetching,type:"button","aria-label":e("workers.refresh.aria"),children:[a.isFetching?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(ya,{size:12,strokeWidth:2.5}),e("workers.refresh")]})]}),c.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-4 flex-1 min-h-0",children:[c.jsxs("div",{className:"flex flex-col gap-4 min-h-0 pr-2",children:[a.isLoading&&c.jsx("p",{className:"text-[var(--color-text-muted)] italic",children:e("common.loading")}),a.isError&&c.jsx("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:c.jsx("p",{children:e("workers.error.load",{detail:a.error instanceof Error?a.error.message:String(a.error)})})}),a.data&&c.jsxs(c.Fragment,{children:[c.jsx(c5,{alerts:a.data.alerts,selected:n,onSelect:(d,f)=>i({project:d,slot:f})}),c.jsx(u5,{active:a.data.active,selected:n,onSelect:(d,f)=>i({project:d,slot:f})}),c.jsx(d5,{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(m5,{project:n.project,initialSlot:n.slot,onChange:()=>t.invalidateQueries({queryKey:["workers-agg"]})}):c.jsx("div",{className:"flex-1 bg-color-bg-soft bg-surface-input flex items-center justify-center p-6 text-center",children:c.jsxs("div",{children:[c.jsx($h,{size:32,className:"mx-auto mb-3 text-[var(--color-text-subtle)]",strokeWidth:2}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:e("workers.empty.hint")})]})})})]})]})}function _2(){return ft("/api/gen/jobs")}function x5(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const v5=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,w5=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,k5={};function Ok(e,t){return(k5.jsx?w5:v5).test(e)}const E5=/[ \t\n\f\r]/g;function S5(e){return typeof e=="object"?e.type==="text"?Rk(e.value):!1:Rk(e)}function Rk(e){return e.replace(E5,"")===""}class Zu{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}Zu.prototype.normal={};Zu.prototype.property={};Zu.prototype.space=void 0;function j2(e,t){const n={},i={};for(const a of e)Object.assign(n,a.property),Object.assign(i,a.normal);return new Zu(n,i,t)}function Zy(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 N5=0;const dt=El(),Sn=El(),Jy=El(),je=El(),Yt=El(),So=El(),Ei=El();function El(){return 2**++N5}const eb=Object.freeze(Object.defineProperty({__proto__:null,boolean:dt,booleanish:Sn,commaOrSpaceSeparated:Ei,commaSeparated:So,number:je,overloadedBoolean:Jy,spaceSeparated:Yt},Symbol.toStringTag,{value:"Module"})),Ug=Object.keys(eb);class gx extends mi{constructor(t,n,i,a){let l=-1;if(super(t,n),Lk(this,"space",a),typeof i=="number")for(;++l<Ug.length;){const o=Ug[l];Lk(this,Ug[l],(i&eb[o])===eb[o])}}}gx.prototype.defined=!0;function Lk(e,t,n){n&&(e[t]=n)}function sc(e){const t={},n={};for(const[i,a]of Object.entries(e.properties)){const l=new gx(i,e.transform(e.attributes||{},i),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(l.mustUseProperty=!0),t[i]=l,n[Zy(i)]=i,n[Zy(l.attribute)]=i}return new Zu(t,n,e.space)}const C2=sc({properties:{ariaActiveDescendant:null,ariaAtomic:Sn,ariaAutoComplete:null,ariaBusy:Sn,ariaChecked:Sn,ariaColCount:je,ariaColIndex:je,ariaColSpan:je,ariaControls:Yt,ariaCurrent:null,ariaDescribedBy:Yt,ariaDetails:null,ariaDisabled:Sn,ariaDropEffect:Yt,ariaErrorMessage:null,ariaExpanded:Sn,ariaFlowTo:Yt,ariaGrabbed:Sn,ariaHasPopup:null,ariaHidden:Sn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Yt,ariaLevel:je,ariaLive:null,ariaModal:Sn,ariaMultiLine:Sn,ariaMultiSelectable:Sn,ariaOrientation:null,ariaOwns:Yt,ariaPlaceholder:null,ariaPosInSet:je,ariaPressed:Sn,ariaReadOnly:Sn,ariaRelevant:null,ariaRequired:Sn,ariaRoleDescription:Yt,ariaRowCount:je,ariaRowIndex:je,ariaRowSpan:je,ariaSelected:Sn,ariaSetSize:je,ariaSort:null,ariaValueMax:je,ariaValueMin:je,ariaValueNow:je,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function A2(e,t){return t in e?e[t]:t}function T2(e,t){return A2(e,t.toLowerCase())}const _5=sc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:So,acceptCharset:Yt,accessKey:Yt,action:null,allow:null,allowFullScreen:dt,allowPaymentRequest:dt,allowUserMedia:dt,alt:null,as:null,async:dt,autoCapitalize:null,autoComplete:Yt,autoFocus:dt,autoPlay:dt,blocking:Yt,capture:null,charSet:null,checked:dt,cite:null,className:Yt,cols:je,colSpan:null,content:null,contentEditable:Sn,controls:dt,controlsList:Yt,coords:je|So,crossOrigin:null,data:null,dateTime:null,decoding:null,default:dt,defer:dt,dir:null,dirName:null,disabled:dt,download:Jy,draggable:Sn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:dt,formTarget:null,headers:Yt,height:je,hidden:Jy,high:je,href:null,hrefLang:null,htmlFor:Yt,httpEquiv:Yt,id:null,imageSizes:null,imageSrcSet:null,inert:dt,inputMode:null,integrity:null,is:null,isMap:dt,itemId:null,itemProp:Yt,itemRef:Yt,itemScope:dt,itemType:Yt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:dt,low:je,manifest:null,max:null,maxLength:je,media:null,method:null,min:null,minLength:je,multiple:dt,muted:dt,name:null,nonce:null,noModule:dt,noValidate:dt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:dt,optimum:je,pattern:null,ping:Yt,placeholder:null,playsInline:dt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:dt,referrerPolicy:null,rel:Yt,required:dt,reversed:dt,rows:je,rowSpan:je,sandbox:Yt,scope:null,scoped:dt,seamless:dt,selected:dt,shadowRootClonable:dt,shadowRootDelegatesFocus:dt,shadowRootMode:null,shape:null,size:je,sizes:null,slot:null,span:je,spellCheck:Sn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:je,step:null,style:null,tabIndex:je,target:null,title:null,translate:null,type:null,typeMustMatch:dt,useMap:null,value:Sn,width:je,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Yt,axis:null,background:null,bgColor:null,border:je,borderColor:null,bottomMargin:je,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:dt,declare:dt,event:null,face:null,frame:null,frameBorder:null,hSpace:je,leftMargin:je,link:null,longDesc:null,lowSrc:null,marginHeight:je,marginWidth:je,noResize:dt,noHref:dt,noShade:dt,noWrap:dt,object:null,profile:null,prompt:null,rev:null,rightMargin:je,rules:null,scheme:null,scrolling:Sn,standby:null,summary:null,text:null,topMargin:je,valueType:null,version:null,vAlign:null,vLink:null,vSpace:je,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:dt,disableRemotePlayback:dt,prefix:null,property:null,results:je,security:null,unselectable:null},space:"html",transform:T2}),j5=sc({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ei,accentHeight:je,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:je,amplitude:je,arabicForm:null,ascent:je,attributeName:null,attributeType:null,azimuth:je,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:je,by:null,calcMode:null,capHeight:je,className:Yt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:je,diffuseConstant:je,direction:null,display:null,dur:null,divisor:je,dominantBaseline:null,download:dt,dx:null,dy:null,edgeMode:null,editable:null,elevation:je,enableBackground:null,end:null,event:null,exponent:je,externalResourcesRequired:null,fill:null,fillOpacity:je,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:So,g2:So,glyphName:So,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:je,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:je,horizOriginX:je,horizOriginY:je,id:null,ideographic:je,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:je,k:je,k1:je,k2:je,k3:je,k4:je,kernelMatrix:Ei,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:je,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:je,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:je,overlineThickness:je,paintOrder:null,panose1:null,path:null,pathLength:je,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Yt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:je,pointsAtY:je,pointsAtZ:je,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ei,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ei,rev:Ei,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ei,requiredFeatures:Ei,requiredFonts:Ei,requiredFormats:Ei,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:je,specularExponent:je,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:je,strikethroughThickness:je,string:null,stroke:null,strokeDashArray:Ei,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:je,strokeOpacity:je,strokeWidth:null,style:null,surfaceScale:je,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ei,tabIndex:je,tableValues:null,target:null,targetX:je,targetY:je,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ei,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:je,underlineThickness:je,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:je,values:null,vAlphabetic:je,vMathematical:je,vectorEffect:null,vHanging:je,vIdeographic:je,version:null,vertAdvY:je,vertOriginX:je,vertOriginY:je,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:je,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:A2}),M2=sc({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),D2=sc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:T2}),O2=sc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),C5={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"},A5=/[A-Z]/g,Ik=/-[a-z]/g,T5=/^data[-\w.:]+$/i;function M5(e,t){const n=Zy(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"&&T5.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(Ik,O5);i="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!Ik.test(l)){let o=l.replace(A5,D5);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}a=gx}return new a(i,t)}function D5(e){return"-"+e.toLowerCase()}function O5(e){return e.charAt(1).toUpperCase()}const R5=j2([C2,_5,M2,D2,O2],"html"),yx=j2([C2,j5,M2,D2,O2],"svg");function L5(e){return e.join(" ").trim()}var oo={},Fg,zk;function I5(){if(zk)return Fg;zk=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
|
-
`,h="/",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 R(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 O(D){var F=D.exec(S);if(F){var I=F[0];return _(I),S=S.slice(I.length),F}}function B(){O(n)}function U(D){var F;for(D=D||[];F=K();)F!==!1&&D.push(F);return D}function K(){var D=T();if(!(h!=S.charAt(0)||g!=S.charAt(1))){for(var F=2;m!=S.charAt(F)&&(g!=S.charAt(F)||h!=S.charAt(F+1));)++F;if(F+=2,m===S.charAt(F-1))return R("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=O(i);if(F){if(K(),!O(a))return R("property missing ':'");var I=O(l),H=D({type:b,property:v(F[0].replace(e,m)),value:I?v(I[0].replace(e,m)):m});return O(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 Fg=k,Fg}var Pk;function z5(){if(Pk)return oo;Pk=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(I5());function n(i,a){let l=null;if(!i||typeof i!="string")return l;const o=(0,t.default)(i),d=typeof a=="function";return o.forEach(f=>{if(f.type!=="declaration")return;const{property:h,value:g}=f;d?a(h,g,f):g&&(l=l||{},l[h]=g)}),l}return oo}var tu={},Bk;function P5(){if(Bk)return tu;Bk=1,Object.defineProperty(tu,"__esModule",{value:!0}),tu.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,l=function(h){return!h||n.test(h)||e.test(h)},o=function(h,g){return g.toUpperCase()},d=function(h,g){return"".concat(g,"-")},f=function(h,g){return g===void 0&&(g={}),l(h)?h:(h=h.toLowerCase(),g.reactCompat?h=h.replace(a,d):h=h.replace(i,d),h.replace(t,o))};return tu.camelCase=f,tu}var nu,$k;function B5(){if($k)return nu;$k=1;var e=nu&&nu.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(z5()),n=P5();function i(a,l){var o={};return!a||typeof a!="string"||(0,t.default)(a,function(d,f){d&&f&&(o[(0,n.camelCase)(d,l)]=f)}),o}return i.default=i,nu=i,nu}var $5=B5();const U5=qu($5),R2=L2("end"),bx=L2("start");function L2(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 F5(e){const t=bx(e),n=R2(e);if(t&&n)return{start:t,end:n}}function hu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Uk(e.position):"start"in e||"end"in e?Uk(e):"line"in e||"column"in e?tb(e):""}function tb(e){return Fk(e&&e.line)+":"+Fk(e&&e.column)}function Uk(e){return tb(e&&e.start)+"-"+tb(e&&e.end)}function Fk(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 xx={}.hasOwnProperty,q5=new Map,H5=/[A-Z]/g,K5=new Set(["table","tbody","thead","tfoot","tr"]),G5=new Set(["td","th"]),I2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function V5(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=tP(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=eP(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"?yx:R5,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=z2(a,e,void 0);return l&&typeof l!="string"?l:a.create(e,a.Fragment,{children:l||void 0},void 0)}function z2(e,t,n){if(t.type==="element")return Y5(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Q5(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return X5(e,t,n);if(t.type==="mdxjsEsm")return W5(e,t);if(t.type==="root")return Z5(e,t,n);if(t.type==="text")return J5(e,t)}function Y5(e,t,n){const i=e.schema;let a=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(a=yx,e.schema=a),e.ancestors.push(t);const l=B2(e,t.tagName,!1),o=nP(e,t);let d=wx(e,t);return K5.has(t.tagName)&&(d=d.filter(function(f){return typeof f=="string"?!S5(f):!0})),P2(e,o,l,t),vx(o,d),e.ancestors.pop(),e.schema=i,e.create(t,l,o,n)}function Q5(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}ju(e,t.position)}function W5(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ju(e,t.position)}function X5(e,t,n){const i=e.schema;let a=i;t.name==="svg"&&i.space==="html"&&(a=yx,e.schema=a),e.ancestors.push(t);const l=t.name===null?e.Fragment:B2(e,t.name,!0),o=iP(e,t),d=wx(e,t);return P2(e,o,l,t),vx(o,d),e.ancestors.pop(),e.schema=i,e.create(t,l,o,n)}function Z5(e,t,n){const i={};return vx(i,wx(e,t)),e.create(t,e.Fragment,i,n)}function J5(e,t){return t.value}function P2(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function vx(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function eP(e,t,n){return i;function i(a,l,o,d){const h=Array.isArray(o.children)?n:t;return d?h(l,o,d):h(l,o)}}function tP(e,t){return n;function n(i,a,l,o){const d=Array.isArray(l.children),f=bx(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 nP(e,t){const n={};let i,a;for(a in t.properties)if(a!=="children"&&xx.call(t.properties,a)){const l=rP(e,a,t.properties[a]);if(l){const[o,d]=l;e.tableCellAlignToStyle&&o==="align"&&typeof d=="string"&&G5.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 iP(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const l=i.data.estree.body[0];l.type;const o=l.expression;o.type;const d=o.properties[0];d.type,Object.assign(n,e.evaluater.evaluateExpression(d.argument))}else ju(e,t.position);else{const a=i.name;let l;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const d=i.value.data.estree.body[0];d.type,l=e.evaluater.evaluateExpression(d.expression)}else ju(e,t.position);else l=i.value===null?!0:i.value;n[a]=l}return n}function wx(e,t){const n=[];let i=-1;const a=e.passKeys?new Map:q5;for(;++i<t.children.length;){const l=t.children[i];let o;if(e.passKeys){const f=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(f){const h=a.get(f)||0;o=f+"-"+h,a.set(f,h+1)}}const d=z2(e,l,o);d!==void 0&&n.push(d)}return n}function rP(e,t,n){const i=M5(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?x5(n):L5(n)),i.property==="style"){let a=typeof n=="object"?n:aP(e,String(n));return e.stylePropertyNameCase==="css"&&(a=sP(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&i.space?C5[i.property]||i.property:i.attribute,n]}}function aP(e,t){try{return U5(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=I2+"#cannot-parse-style-attribute",a}}function B2(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=Ok(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=Ok(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const a=i.value;return xx.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(i);ju(e)}function ju(e,t){const n=new Yn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=I2+"#cannot-handle-mdx-estrees-without-createevaluater",n}function sP(e){const t={};let n;for(n in e)xx.call(e,n)&&(t[lP(n)]=e[n]);return t}function lP(e){let t=e.replace(H5,oP);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function oP(e){return"-"+e.toLowerCase()}const qg={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},cP={};function kx(e,t){const n=cP,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return $2(e,i,a)}function $2(e,t,n){if(uP(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 qk(e.children,t,n)}return Array.isArray(e)?qk(e,t,n):""}function qk(e,t,n){const i=[];let a=-1;for(;++a<e.length;)i[a]=$2(e[a],t,n);return i.join("")}function uP(e){return!!(e&&typeof e=="object")}const Hk=document.createElement("i");function Ex(e){const t="&"+e+";";Hk.innerHTML=t;const n=Hk.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 Kk={}.hasOwnProperty;function U2(e){const t={};let n=-1;for(;++n<e.length;)dP(t,e[n]);return t}function dP(e,t){let n;for(n in t){const a=(Kk.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let o;if(l)for(o in l){Kk.call(a,o)||(a[o]=[]);const d=l[o];fP(a[o],Array.isArray(d)?d:d?[d]:[])}}}function fP(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 F2(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]/),hP=Ns(/[#-'*+\--9=?A-Z^-~]/);function xh(e){return e!==null&&(e<32||e===127)}const nb=Ns(/\d/),pP=Ns(/[\dA-Fa-f]/),mP=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 rp=Ns(new RegExp("\\p{P}|\\p{S}","u")),ml=Ns(/\s/);function Ns(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function lc(e){const t=[];let n=-1,i=0,a=0;for(;++n<e.length;){const l=e.charCodeAt(n);let o="";if(l===37&&Gn(e.charCodeAt(n+1))&&Gn(e.charCodeAt(n+2)))a=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(o=String.fromCharCode(l));else if(l>55295&&l<57344){const d=e.charCodeAt(n+1);l<56320&&d>56319&&d<57344?(o=String.fromCharCode(l,d),a=1):o="�"}else o=String.fromCharCode(l);o&&(t.push(e.slice(i,n),encodeURIComponent(o)),i=n+a+1,o=""),a&&(n+=a,a=0)}return t.join("")+e.slice(i)}function 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 gP={tokenize:yP};function yP(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 bP={tokenize:xP},Gk={tokenize:vP};function xP(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,h)(N)}return h(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 R=_;for(;R<t.events.length;)t.events[R][1].end={...M},R++;return ji(t.events,T+1,0,t.events.slice(_)),t.events.length=R,h(N)}return d(N)}function h(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(Gk,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(Gk,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 R=t.events.length;let O=R,B,U;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){if(B){U=t.events[O][1].end;break}B=!0}for(E(i),M=R;M<t.events.length;)t.events[M][1].end={...U},M++;ji(t.events,O+1,0,t.events.slice(R)),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 vP(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 Uo(e){if(e===null||Kt(e)||ml(e))return 1;if(rp(e))return 2}function ap(e,t,n){const i=[];let a=-1;for(;++a<e.length;){const l=e[a].resolveAll;l&&!i.includes(l)&&(t=l(t,n),i.push(l))}return t}const ib={name:"attention",resolveAll:wP,tokenize:kP};function wP(e,t){let n=-1,i,a,l,o,d,f,h,g;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(i=n;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;f=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[i][1].end},y={...e[n][1].start};Vk(m,-f),Vk(y,f),o={type:f>1?"strongSequence":"emphasisSequence",start:m,end:{...e[i][1].end}},d={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},l={type:f>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},a={type:f>1?"strong":"emphasis",start:{...o.start},end:{...d.end}},e[i][1].end={...o.start},e[n][1].start={...d.end},h=[],e[i][1].end.offset-e[i][1].start.offset&&(h=Hi(h,[["enter",e[i][1],t],["exit",e[i][1],t]])),h=Hi(h,[["enter",a,t],["enter",o,t],["exit",o,t],["enter",l,t]]),h=Hi(h,ap(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),h=Hi(h,[["exit",l,t],["enter",d,t],["exit",d,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,h=Hi(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,ji(e,i-1,n-i+3,h),n=i+h.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function kP(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,a=Uo(i);let l;return o;function o(f){return l=f,e.enter("attentionSequence"),d(f)}function d(f){if(f===l)return e.consume(f),d;const h=e.exit("attentionSequence"),g=Uo(f),m=!g||g===2&&a||n.includes(f),y=!a||a===2&&g||n.includes(i);return h._open=!!(l===42?m:m&&(a||!y)),h._close=!!(l===42?y:y&&(g||!m)),t(f)}}function Vk(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const EP={name:"autolink",tokenize:SP};function SP(e,t,n){let i=0;return a;function a(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(b){return ni(b)?(e.consume(b),o):b===64?n(b):h(b)}function o(b){return b===43||b===45||b===46||Gn(b)?(i=1,d(b)):h(b)}function d(b){return b===58?(e.consume(b),i=0,f):(b===43||b===45||b===46||Gn(b))&&i++<32?(e.consume(b),d):(i=0,h(b))}function f(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||xh(b)?n(b):(e.consume(b),f)}function h(b){return b===64?(e.consume(b),g):hP(b)?(e.consume(b),h):n(b)}function g(b){return Gn(b)?m(b):n(b)}function m(b){return b===46?(e.consume(b),i=0,g):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):y(b)}function y(b){if((b===45||Gn(b))&&i++<63){const k=b===45?y:m;return e.consume(b),k}return n(b)}}const Ju={partial:!0,tokenize:NP};function NP(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 q2={continuation:{tokenize:jP},exit:CP,name:"blockQuote",tokenize:_P};function _P(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 jP(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(q2,t,n)(o)}}function CP(e){e.exit("blockQuote")}const H2={name:"characterEscape",tokenize:AP};function AP(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 mP(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const K2={name:"characterReference",tokenize:TP};function TP(e,t,n){const i=this;let a=0,l,o;return d;function d(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),f}function f(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),l=31,o=Gn,g(m))}function h(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,o=pP,g):(e.enter("characterReferenceValue"),l=7,o=nb,g(m))}function g(m){if(m===59&&a){const y=e.exit("characterReferenceValue");return o===Gn&&!Ex(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 Yk={partial:!0,tokenize:DP},Qk={concrete:!0,name:"codeFenced",tokenize:MP};function MP(e,t,n){const i=this,a={partial:!0,tokenize:T};let l=0,o=0,d;return f;function f(M){return h(M)}function h(M){const R=i.events[i.events.length-1];return l=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[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(Yk,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&>(M)?St(e,C,"linePrefix",l+1)(M):C(M)}function C(M){return M===null||Je(M)?e.check(Yk,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,R,O){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)):O(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)):O(F)}function D(F){return F===null||Je(F)?(M.exit("codeFencedFence"),R(F)):O(F)}}}function DP(e,t,n){const i=this;return a;function a(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l)}function l(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}const Hg={name:"codeIndented",tokenize:RP},OP={partial:!0,tokenize:LP};function RP(e,t,n){const i=this;return a;function a(h){return e.enter("codeIndented"),St(e,l,"linePrefix",5)(h)}function l(h){const g=i.events[i.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?o(h):n(h)}function o(h){return h===null?f(h):Je(h)?e.attempt(OP,o,f)(h):(e.enter("codeFlowValue"),d(h))}function d(h){return h===null||Je(h)?(e.exit("codeFlowValue"),o(h)):(e.consume(h),d)}function f(h){return e.exit("codeIndented"),t(h)}}function LP(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 IP={name:"codeText",previous:PP,resolve:zP,tokenize:BP};function zP(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 PP(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function BP(e,t,n){let i=0,a,l;return o;function o(m){return e.enter("codeText"),e.enter("codeTextSequence"),d(m)}function d(m){return m===96?(e.consume(m),i++,d):(e.exit("codeTextSequence"),f(m))}function f(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),f):m===96?(l=e.enter("codeTextSequence"),a=0,g(m)):Je(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),f):(e.enter("codeTextData"),h(m))}function h(m){return m===null||m===32||m===96||Je(m)?(e.exit("codeTextData"),f(m)):(e.consume(m),h)}function g(m){return m===96?(e.consume(m),a++,g):a===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(l.type="codeTextData",h(m))}}class $P{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(t,i):t>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const a=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return i&&iu(this.left,i),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),iu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),iu(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);iu(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);iu(this.left,n.reverse())}}}function iu(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function G2(e){const t={};let n=-1,i,a,l,o,d,f,h;const g=new $P(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,UP(g,n)),n=t[n],h=!0);else if(i[1]._container){for(l=n,a=void 0;l--;)if(o=g.get(l),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(a&&(g.get(a)[1].type="lineEndingBlank"),o[1].type="lineEnding",a=l);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;a&&(i[1].end={...g.get(a)[1].start},d=g.slice(a,n),d.unshift(i),g.splice(a,n-a+1,d))}}return ji(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!h}function UP(e,t){const n=e.get(t)[1],i=e.get(t)[2];let a=t-1;const l=[];let o=n._tokenizer;o||(o=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const d=o.events,f=[],h={};let g,m,y=-1,b=n,k=0,v=0;const 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;)h[k+f[y][0]]=k+f[y][1],k+=f[y][1]-f[y][0]-1;return h}const FP={resolve:HP,tokenize:KP},qP={partial:!0,tokenize:GP};function HP(e){return G2(e),e}function KP(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(qP,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 GP(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 V2(e,t,n,i,a,l,o,d,f){const h=f||Number.POSITIVE_INFINITY;let g=0;return m;function m(E){return E===60?(e.enter(i),e.enter(a),e.enter(l),e.consume(E),e.exit(l),y):E===null||E===32||E===41||xh(E)?n(E):(e.enter(i),e.enter(o),e.enter(d),e.enter("chunkString",{contentType:"string"}),v(E))}function y(E){return E===62?(e.enter(l),e.consume(E),e.exit(l),e.exit(a),e.exit(i),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),b(E))}function b(E){return E===62?(e.exit("chunkString"),e.exit(d),y(E)):E===null||E===60||Je(E)?n(E):(e.consume(E),E===92?k:b)}function k(E){return E===60||E===62||E===92?(e.consume(E),b):b(E)}function v(E){return!g&&(E===null||E===41||Kt(E))?(e.exit("chunkString"),e.exit(d),e.exit(o),e.exit(i),t(E)):g<h&&E===40?(e.consume(E),g++,v):E===41?(e.consume(E),g--,v):E===null||E===32||E===40||xh(E)?n(E):(e.consume(E),E===92?S:v)}function S(E){return E===40||E===41||E===92?(e.consume(E),v):v(E)}}function Y2(e,t,n,i,a,l){const o=this;let d=0,f;return h;function h(b){return e.enter(i),e.enter(a),e.consume(b),e.exit(a),e.enter(l),g}function g(b){return d>999||b===null||b===91||b===93&&!f||b===94&&!d&&"_hiddenFootnoteSupport"in o.parser.constructs?n(b):b===93?(e.exit(l),e.enter(a),e.consume(b),e.exit(a),e.exit(i),t):Je(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===null||b===91||b===93||Je(b)||d++>999?(e.exit("chunkString"),g(b)):(e.consume(b),f||(f=!gt(b)),b===92?y:m)}function y(b){return b===91||b===92||b===93?(e.consume(b),d++,m):m(b)}}function Q2(e,t,n,i,a,l){let o;return d;function d(y){return y===34||y===39||y===40?(e.enter(i),e.enter(a),e.consume(y),e.exit(a),o=y===40?41:y,f):n(y)}function f(y){return y===o?(e.enter(a),e.consume(y),e.exit(a),e.exit(i),t):(e.enter(l),h(y))}function h(y){return y===o?(e.exit(l),f(o)):y===null?n(y):Je(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),St(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(y))}function g(y){return y===o||y===null||Je(y)?(e.exit("chunkString"),h(y)):(e.consume(y),y===92?m:g)}function m(y){return y===o||y===92?(e.consume(y),g):g(y)}}function pu(e,t){let n;return i;function i(a){return Je(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,i):gt(a)?St(e,i,n?"linePrefix":"lineSuffix")(a):t(a)}}const VP={name:"definition",tokenize:QP},YP={partial:!0,tokenize:WP};function QP(e,t,n){const i=this;let a;return l;function l(b){return e.enter("definition"),o(b)}function o(b){return Y2.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)?pu(e,h)(b):h(b)}function h(b){return V2(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function g(b){return e.attempt(YP,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 WP(e,t,n){return i;function i(d){return Kt(d)?pu(e,a)(d):n(d)}function a(d){return Q2(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 XP={name:"hardBreakEscape",tokenize:ZP};function ZP(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 JP={name:"headingAtx",resolve:eB,tokenize:tB};function eB(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 tB(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"),h(g))}function f(g){return g===35?(e.consume(g),f):(e.exit("atxHeadingSequence"),d(g))}function h(g){return g===null||g===35||Kt(g)?(e.exit("atxHeadingText"),d(g)):(e.consume(g),h)}}const nB=["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"],Wk=["pre","script","style","textarea"],iB={concrete:!0,name:"htmlFlow",resolveTo:sB,tokenize:lB},rB={partial:!0,tokenize:cB},aB={partial:!0,tokenize:oB};function sB(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 lB(e,t,n){const i=this;let a,l,o,d,f;return h;function h(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,ve=o.toLowerCase();return!le&&!l&&Wk.includes(ve)?(a=1,i.interrupt?t(P):q(P)):nB.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,R):gt(P)?(e.consume(P),M):O(P)}function R(P){return P===f?(e.consume(P),f=null,B):P===null||Je(P)?n(P):(e.consume(P),R)}function O(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),O)}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(rB,V,Y)(P)):P===null||Je(P)?(e.exit("htmlFlowData"),Y(P)):(e.consume(P),q)}function Y(P){return e.check(aB,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="",Q):q(P)}function Q(P){if(P===62){const le=o.toLowerCase();return Wk.includes(le)?(e.consume(P),z):q(P)}return ni(P)&&o.length<8?(e.consume(P),o+=String.fromCharCode(P),Q):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 oB(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 cB(e,t,n){return i;function i(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(Ju,t,n)}}const uB={name:"htmlText",tokenize:dB};function dB(e,t,n){const i=this;let a,l,o;return d;function d(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),f}function f(L){return L===33?(e.consume(L),h):L===47?(e.consume(L),T):L===63?(e.consume(L),N):ni(L)?(e.consume(L),O):n(L)}function h(L){return L===45?(e.consume(L),g):L===91?(e.consume(L),l=0,k):ni(L)?(e.consume(L),C):n(L)}function g(L){return L===45?(e.consume(L),b):n(L)}function m(L){return L===null?n(L):L===45?(e.consume(L),y):Je(L)?(o=m,H(L)):(e.consume(L),m)}function y(L){return L===45?(e.consume(L),b):m(L)}function b(L){return L===62?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):R(L)}function R(L){return Je(L)?(o=R,H(L)):gt(L)?(e.consume(L),R):I(L)}function O(L){return L===45||Gn(L)?(e.consume(L),O):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"),Q}function Q(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 Sx={name:"labelEnd",resolveAll:mB,resolveTo:gB,tokenize:yB},fB={tokenize:bB},hB={tokenize:xB},pB={tokenize:vB};function mB(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 gB(e,t){let n=e.length,i=0,a,l,o,d;for(;n--;)if(a=e[n][1],l){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(l=n,a.type!=="labelLink")){i=2;break}}else a.type==="labelEnd"&&(o=n);const f={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[l][1].start},end:{...e[o][1].end}},g={type:"labelText",start:{...e[l+i+2][1].end},end:{...e[o-2][1].start}};return d=[["enter",f,t],["enter",h,t]],d=Hi(d,e.slice(l+1,l+i+3)),d=Hi(d,[["enter",g,t]]),d=Hi(d,ap(t.parser.constructs.insideSpan.null,e.slice(l+i+4,o-3),t)),d=Hi(d,[["exit",g,t],e[o-2],e[o-1],["exit",h,t]]),d=Hi(d,e.slice(o+1)),d=Hi(d,[["exit",f,t]]),ji(e,l,e.length,d),e}function yB(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(fB,g,o?g:m)(y):y===91?e.attempt(hB,g,o?h:m)(y):o?g(y):m(y)}function h(y){return e.attempt(pB,g,m)(y)}function g(y){return t(y)}function m(y){return l._balanced=!0,n(y)}}function bB(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)?pu(e,l)(m):l(m)}function l(m){return m===41?g(m):V2(e,o,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function o(m){return Kt(m)?pu(e,f)(m):g(m)}function d(m){return n(m)}function f(m){return m===34||m===39||m===40?Q2(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):g(m)}function h(m){return Kt(m)?pu(e,g)(m):g(m)}function g(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function xB(e,t,n){const i=this;return a;function a(d){return Y2.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 vB(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 wB={name:"labelStartImage",resolveAll:Sx.resolveAll,tokenize:kB};function kB(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 EB={name:"labelStartLink",resolveAll:Sx.resolveAll,tokenize:SB};function SB(e,t,n){const i=this;return a;function a(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),l}function l(o){return o===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(o):t(o)}}const Kg={name:"lineEnding",tokenize:NB};function NB(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),St(e,t,"linePrefix")}}const nh={name:"thematicBreak",tokenize:_B};function _B(e,t,n){let i=0,a;return l;function l(h){return e.enter("thematicBreak"),o(h)}function o(h){return a=h,d(h)}function d(h){return h===a?(e.enter("thematicBreakSequence"),f(h)):i>=3&&(h===null||Je(h))?(e.exit("thematicBreak"),t(h)):n(h)}function f(h){return h===a?(e.consume(h),i++,f):(e.exit("thematicBreakSequence"),gt(h)?St(e,d,"whitespace")(h):d(h))}}const ci={continuation:{tokenize:TB},exit:DB,name:"list",tokenize:AB},jB={partial:!0,tokenize:OB},CB={partial:!0,tokenize:MB};function AB(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:nb(b)){if(i.containerState.type||(i.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(nh,n,h)(b):h(b);if(!i.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(b)}return n(b)}function f(b){return nb(b)&&++o<10?(e.consume(b),f):(!i.interrupt||o<2)&&(i.containerState.marker?b===i.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),h(b)):n(b)}function h(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||b,e.check(Ju,i.interrupt?n:g,e.attempt(jB,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 TB(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(Ju,a,l);function a(d){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,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(CB,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 MB(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 DB(e){e.exit(this.containerState.type)}function OB(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 Xk={name:"setextUnderline",resolveTo:RB,tokenize:LB};function RB(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 LB(e,t,n){const i=this;let a;return l;function l(h){let g=i.events.length,m;for(;g--;)if(i.events[g][1].type!=="lineEnding"&&i.events[g][1].type!=="linePrefix"&&i.events[g][1].type!=="content"){m=i.events[g][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||m)?(e.enter("setextHeadingLine"),a=h,o(h)):n(h)}function o(h){return e.enter("setextHeadingLineSequence"),d(h)}function d(h){return h===a?(e.consume(h),d):(e.exit("setextHeadingLineSequence"),gt(h)?St(e,f,"lineSuffix")(h):f(h))}function f(h){return h===null||Je(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const IB={tokenize:zB};function zB(e){const t=this,n=e.attempt(Ju,i,e.attempt(this.parser.constructs.flowInitial,a,St(e,e.attempt(this.parser.constructs.flow,a,e.attempt(FP,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 PB={resolveAll:X2()},BB=W2("string"),$B=W2("text");function W2(e){return{resolveAll:X2(e==="text"?UB:void 0),tokenize:t};function t(n){const i=this,a=this.parser.constructs[e],l=n.attempt(a,o,d);return o;function o(g){return h(g)?l(g):d(g)}function d(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),f}function f(g){return h(g)?(n.exit("data"),l(g)):(n.consume(g),f)}function h(g){if(g===null)return!0;const m=a[g];let y=-1;if(m)for(;++y<m.length;){const b=m[y];if(!b.previous||b.previous.call(i,i.previous))return!0}return!1}}}function X2(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 UB(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const i=e[n-1][1],a=t.sliceStream(i);let l=a.length,o=-1,d=0,f;for(;l--;){const h=a[l];if(typeof h=="string"){for(o=h.length;h.charCodeAt(o-1)===32;)d++,o--;if(o)break;o=-1}else if(h===-2)f=!0,d++;else if(h!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(d=0),d){const h={type:n===e.length||f||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?o:i.start._bufferIndex+o,_index:i.start._index+l,line:i.end.line,column:i.end.column-d,offset:i.end.offset-d},end:{...i.end}};i.end={...h.start},i.start.offset===i.end.offset?Object.assign(i,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const FB={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:q2},qB={91:VP},HB={[-2]:Hg,[-1]:Hg,32:Hg},KB={35:JP,42:nh,45:[Xk,nh],60:iB,61:Xk,95:nh,96:Qk,126:Qk},GB={38:K2,92:H2},VB={[-5]:Kg,[-4]:Kg,[-3]:Kg,33:wB,38:K2,42:ib,60:[EP,uB],91:EB,92:[XP,H2],93:Sx,95:ib,96:IP},YB={null:[ib,PB]},QB={null:[42,95]},WB={null:[]},XB=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:QB,contentInitial:qB,disable:WB,document:FB,flow:KB,flowInitial:HB,insideSpan:YB,string:GB,text:VB},Symbol.toStringTag,{value:"Module"}));function ZB(e,t,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},l=[];let o=[],d=[];const f={attempt:R(T),check:R(M),consume:C,enter:N,exit:_,interrupt:R(M,{interrupt:!0})},h={code:null,containerState:{},defineSkip:v,events:[],now:k,parser:e,previous:null,sliceSerialize:y,sliceStream:b,write:m};let g=t.tokenize.call(h,f);return t.resolveAll&&l.push(t),h;function m(K){return o=Hi(o,K),S(),o[o.length-1]!==null?[]:(O(t,0),h.events=ap(l,h.events,h),h.events)}function y(K,q){return e6(b(K),q)}function b(K){return JB(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++)),h.previous=K}function N(K,q){const Y=q||{};return Y.type=K,Y.start=k(),h.events.push(["enter",Y,h]),d.push(Y),Y}function _(K){const q=d.pop();return q.end=k(),h.events.push(["exit",q,h]),q}function T(K,q){O(K,q.from)}function M(K,q){q.restore()}function R(K,q){return Y;function Y(D,F,I){let H,Q,G,L;return Array.isArray(D)?V(D):"tokenize"in D?V([D]):z(D);function z(ke){return Se;function Se(J){const ue=J!==null&&ke[J],Te=J!==null&&ke.null,Re=[...Array.isArray(ue)?ue:ue?[ue]:[],...Array.isArray(Te)?Te:Te?[Te]:[]];return V(Re)(J)}}function V(ke){return H=ke,Q=0,ke.length===0?I:P(ke[Q])}function P(ke){return Se;function Se(J){return L=B(),G=ke,ke.partial||(h.currentConstruct=ke),ke.name&&h.parser.constructs.disable.null.includes(ke.name)?ve():ke.tokenize.call(q?Object.assign(Object.create(h),q):h,f,le,ve)(J)}}function le(ke){return K(G,L),F}function ve(ke){return L.restore(),++Q<H.length?P(H[Q]):I}}}function O(K,q){K.resolveAll&&!l.includes(K)&&l.push(K),K.resolve&&ji(h.events,q,h.events.length-q,K.resolve(h.events.slice(q),h)),K.resolveTo&&(h.events=K.resolveTo(h.events,h))}function B(){const K=k(),q=h.previous,Y=h.currentConstruct,D=h.events.length,F=Array.from(d);return{from:D,restore:I};function I(){i=K,h.previous=q,h.currentConstruct=Y,h.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 JB(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 e6(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 t6(e){const i={constructs:U2([XB,...(e||{}).extensions||[]]),content:a(gP),defined:[],document:a(bP),flow:a(IB),lazy:{},string:a(BB),text:a($B)};return i;function a(l){return o;function o(d){return ZB(i,l,d)}}}function n6(e){for(;!G2(e););return e}const Zk=/[\0\t\n\r]/g;function i6(){let e=1,t="",n=!0,i;return a;function a(l,o,d){const f=[];let h,g,m,y,b;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(o||void 0).decode(l)),m=0,t="",n&&(l.charCodeAt(0)===65279&&m++,n=void 0);m<l.length;){if(Zk.lastIndex=m,h=Zk.exec(l),y=h&&h.index!==void 0?h.index:l.length,b=l.charCodeAt(y),!h){t=l.slice(m);break}if(b===10&&m===y&&i)f.push(-3),i=void 0;else switch(i&&(f.push(-5),i=void 0),m<y&&(f.push(l.slice(m,y)),e+=y-m),b){case 0:{f.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,f.push(-2);e++<g;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:i=!0,e=1}m=y+1}return d&&(i&&f.push(-5),t&&f.push(t),f.push(null)),f}}const r6=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function a6(e){return e.replace(r6,s6)}function s6(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),l=a===120||a===88;return F2(n.slice(l?2:1),l?16:10)}return Ex(n)||e}const Z2={}.hasOwnProperty;function l6(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),o6(n)(n6(t6(n).document().write(i6()(e,t,!0))))}function o6(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(ae),autolinkProtocol:B,autolinkEmail:B,atxHeading:l(te),blockQuote:l(Te),characterEscape:B,characterReference:B,codeFenced:l(Re),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:l(Re,o),codeText:l(Oe,o),codeTextData:B,data:B,codeFlowValue:B,definition:l(ce),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:l(Ce),hardBreakEscape:l(pe),hardBreakTrailing:l(pe),htmlFlow:l(Fe,o),htmlFlowData:B,htmlText:l(Fe,o),htmlTextData:B,image:l(ze),label:o,link:l(ae),listItem:l(ye),listItemValue:y,listOrdered:l(be,m),listUnordered:l(be),paragraph:l(he),reference:P,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:l(te),strong:l(Ee),thematicBreak:l(Ke)},exit:{atxHeading:f(),atxHeadingSequence:T,autolink:f(),autolinkEmail:ue,autolinkProtocol:J,blockQuote:f(),characterEscapeValue:U,characterReferenceMarkerHexadecimal:ve,characterReferenceMarkerNumeric:ve,characterReferenceValue:ke,characterReference:Se,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:Q,lineEnding:K,link:f(I),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:le,resourceDestinationString:L,resourceTitleString:z,resource:V,setextHeading:f(O),setextHeadingLineSequence:R,setextHeadingText:M,strong:f(),thematicBreak:f()}};J2(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(ne){let de={type:"root",children:[]};const Le={stack:[de],tokenStack:[],config:t,enter:d,exit:h,buffer:o,resume:g,data:n},Ze=[];let rt=-1;for(;++rt<ne.length;)if(ne[rt][1].type==="listOrdered"||ne[rt][1].type==="listUnordered")if(ne[rt][0]==="enter")Ze.push(rt);else{const At=Ze.pop();rt=a(ne,At,rt)}for(rt=-1;++rt<ne.length;){const At=t[ne[rt][0]];Z2.call(At,ne[rt][1].type)&&At[ne[rt][1].type].call(Object.assign({sliceSerialize:ne[rt][2].sliceSerialize},Le),ne[rt][1])}if(Le.tokenStack.length>0){const At=Le.tokenStack[Le.tokenStack.length-1];(At[1]||Jk).call(Le,void 0,At[0])}for(de.position={start:ns(ne.length>0?ne[0][1].start:{line:1,column:1,offset:0}),end:ns(ne.length>0?ne[ne.length-2][1].end:{line:1,column:1,offset:0})},rt=-1;++rt<t.transforms.length;)de=t.transforms[rt](de)||de;return de}function a(ne,de,Le){let Ze=de-1,rt=-1,At=!1,$n,dn,Mt,Qt;for(;++Ze<=Le;){const yt=ne[Ze];switch(yt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{yt[0]==="enter"?rt++:rt--,Qt=void 0;break}case"lineEndingBlank":{yt[0]==="enter"&&($n&&!Qt&&!rt&&!Mt&&(Mt=Ze),Qt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Qt=void 0}if(!rt&&yt[0]==="enter"&&yt[1].type==="listItemPrefix"||rt===-1&&yt[0]==="exit"&&(yt[1].type==="listUnordered"||yt[1].type==="listOrdered")){if($n){let Ti=Ze;for(dn=void 0;Ti--;){const Rn=ne[Ti];if(Rn[1].type==="lineEnding"||Rn[1].type==="lineEndingBlank"){if(Rn[0]==="exit")continue;dn&&(ne[dn][1].type="lineEndingBlank",At=!0),Rn[1].type="lineEnding",dn=Ti}else if(!(Rn[1].type==="linePrefix"||Rn[1].type==="blockQuotePrefix"||Rn[1].type==="blockQuotePrefixWhitespace"||Rn[1].type==="blockQuoteMarker"||Rn[1].type==="listItemIndent"))break}Mt&&(!dn||Mt<dn)&&($n._spread=!0),$n.end=Object.assign({},dn?ne[dn][1].start:yt[1].end),ne.splice(dn||Ze,0,["exit",$n,yt[2]]),Ze++,Le++}if(yt[1].type==="listItemPrefix"){const Ti={type:"listItem",_spread:!1,start:Object.assign({},yt[1].start),end:void 0};$n=Ti,ne.splice(Ze,0,["enter",Ti,yt[2]]),Ze++,Le++,Mt=void 0,Qt=!0}}}return ne[de][1]._spread=At,Le}function l(ne,de){return Le;function Le(Ze){d.call(this,ne(Ze),Ze),de&&de.call(this,Ze)}}function o(){this.stack.push({type:"fragment",children:[]})}function d(ne,de,Le){this.stack[this.stack.length-1].children.push(ne),this.stack.push(ne),this.tokenStack.push([de,Le||void 0]),ne.position={start:ns(de.start),end:void 0}}function f(ne){return de;function de(Le){ne&&ne.call(this,Le),h.call(this,Le)}}function h(ne,de){const Le=this.stack.pop(),Ze=this.tokenStack.pop();if(Ze)Ze[0].type!==ne.type&&(de?de.call(this,ne,Ze[0]):(Ze[1]||Jk).call(this,ne,Ze[0]));else throw new Error("Cannot close `"+ne.type+"` ("+hu({start:ne.start,end:ne.end})+"): it’s not open");Le.position.end=ns(ne.end)}function g(){return kx(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function y(ne){if(this.data.expectingFirstListItemValue){const de=this.stack[this.stack.length-2];de.start=Number.parseInt(this.sliceSerialize(ne),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.lang=ne}function k(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.meta=ne}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne.replace(/(\r?\n|\r)$/g,"")}function C(ne){const de=this.resume(),Le=this.stack[this.stack.length-1];Le.label=de,Le.identifier=fr(this.sliceSerialize(ne)).toLowerCase()}function N(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.title=ne}function _(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.url=ne}function T(ne){const de=this.stack[this.stack.length-1];if(!de.depth){const Le=this.sliceSerialize(ne).length;de.depth=Le}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function R(ne){const de=this.stack[this.stack.length-1];de.depth=this.sliceSerialize(ne).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function B(ne){const Le=this.stack[this.stack.length-1].children;let Ze=Le[Le.length-1];(!Ze||Ze.type!=="text")&&(Ze=Ne(),Ze.position={start:ns(ne.start),end:void 0},Le.push(Ze)),this.stack.push(Ze)}function U(ne){const de=this.stack.pop();de.value+=this.sliceSerialize(ne),de.position.end=ns(ne.end)}function K(ne){const de=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Le=de.children[de.children.length-1];Le.position.end=ns(ne.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(de.type)&&(B.call(this,ne),U.call(this,ne))}function q(){this.data.atHardBreak=!0}function Y(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne}function D(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne}function F(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne}function I(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=de,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function H(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=de,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function Q(ne){const de=this.sliceSerialize(ne),Le=this.stack[this.stack.length-2];Le.label=a6(de),Le.identifier=fr(de).toLowerCase()}function G(){const ne=this.stack[this.stack.length-1],de=this.resume(),Le=this.stack[this.stack.length-1];if(this.data.inReference=!0,Le.type==="link"){const Ze=ne.children;Le.children=Ze}else Le.alt=de}function L(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.url=ne}function z(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.title=ne}function V(){this.data.inReference=void 0}function P(){this.data.referenceType="collapsed"}function le(ne){const de=this.resume(),Le=this.stack[this.stack.length-1];Le.label=de,Le.identifier=fr(this.sliceSerialize(ne)).toLowerCase(),this.data.referenceType="full"}function ve(ne){this.data.characterReferenceType=ne.type}function ke(ne){const de=this.sliceSerialize(ne),Le=this.data.characterReferenceType;let Ze;Le?(Ze=F2(de,Le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ze=Ex(de);const rt=this.stack[this.stack.length-1];rt.value+=Ze}function Se(ne){const de=this.stack.pop();de.position.end=ns(ne.end)}function J(ne){U.call(this,ne);const de=this.stack[this.stack.length-1];de.url=this.sliceSerialize(ne)}function ue(ne){U.call(this,ne);const de=this.stack[this.stack.length-1];de.url="mailto:"+this.sliceSerialize(ne)}function Te(){return{type:"blockquote",children:[]}}function Re(){return{type:"code",lang:null,meta:null,value:""}}function Oe(){return{type:"inlineCode",value:""}}function ce(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ce(){return{type:"emphasis",children:[]}}function te(){return{type:"heading",depth:0,children:[]}}function pe(){return{type:"break"}}function Fe(){return{type:"html",value:""}}function ze(){return{type:"image",title:null,url:"",alt:null}}function ae(){return{type:"link",title:null,url:"",children:[]}}function be(ne){return{type:"list",ordered:ne.type==="listOrdered",start:null,spread:ne._spread,children:[]}}function ye(ne){return{type:"listItem",spread:ne._spread,checked:null,children:[]}}function he(){return{type:"paragraph",children:[]}}function Ee(){return{type:"strong",children:[]}}function Ne(){return{type:"text",value:""}}function Ke(){return{type:"thematicBreak"}}}function ns(e){return{line:e.line,column:e.column,offset:e.offset}}function J2(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?J2(e,i):c6(e,i)}}function c6(e,t){let n;for(n in t)if(Z2.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 Jk(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 u6(e){const t=this;t.parser=n;function n(i){return l6(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function d6(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 f6(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
625
|
-
`}]}function h6(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 p6(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function m6(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function g6(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),a=lc(i.toLowerCase()),l=e.footnoteOrder.indexOf(i);let o,d=e.footnoteCounts.get(i);d===void 0?(d=0,e.footnoteOrder.push(i),o=e.footnoteOrder.length):o=l+1,d+=1,e.footnoteCounts.set(i,d);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,f);const h={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,h),e.applyData(t,h)}function y6(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 b6(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function ej(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 x6(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return ej(e,t);const a={src:lc(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(a.title=i.title);const l={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,l),e.applyData(t,l)}function v6(e,t){const n={src:lc(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)}function w6(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 k6(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return ej(e,t);const a={href:lc(i.url||"")};i.title!==null&&i.title!==void 0&&(a.title=i.title);const l={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function E6(e,t){const n={href:lc(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function S6(e,t,n){const i=e.all(t),a=n?N6(n):tj(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 h={type:"element",tagName:"li",properties:l,children:o};return e.patch(t,h),e.applyData(t,h)}function N6(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=tj(n[i])}return t}function tj(e){const t=e.spread;return t??e.children.length>1}function _6(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 j6(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function C6(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function A6(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function T6(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=bx(t.children[1]),f=R2(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 M6(e,t,n){const i=n?n.children:void 0,l=(i?i.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,d=o?o.length:t.children.length;let f=-1;const h=[];for(;++f<d;){const m=t.children[f],y={},b=o?o[f]:void 0;b&&(y.align=b);let k={type:"element",tagName:l,properties:y,children:[]};m&&(k.children=e.all(m),e.patch(m,k),k=e.applyData(m,k)),h.push(k)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,g),e.applyData(t,g)}function D6(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const eE=9,tE=32;function O6(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),a=0;const l=[];for(;i;)l.push(nE(t.slice(a,i.index),a>0,!0),i[0]),a=i.index+i[0].length,i=n.exec(t);return l.push(nE(t.slice(a),a>0,!1)),l.join("")}function nE(e,t,n){let i=0,a=e.length;if(t){let l=e.codePointAt(i);for(;l===eE||l===tE;)i++,l=e.codePointAt(i)}if(n){let l=e.codePointAt(a-1);for(;l===eE||l===tE;)a--,l=e.codePointAt(a-1)}return a>i?e.slice(i,a):""}function R6(e,t){const n={type:"text",value:O6(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function L6(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const I6={blockquote:d6,break:f6,code:h6,delete:p6,emphasis:m6,footnoteReference:g6,heading:y6,html:b6,imageReference:x6,image:v6,inlineCode:w6,linkReference:k6,link:E6,listItem:S6,list:_6,paragraph:j6,root:C6,strong:A6,table:T6,tableCell:D6,tableRow:M6,text:R6,thematicBreak:L6,toml:Tf,yaml:Tf,definition:Tf,footnoteDefinition:Tf};function Tf(){}const nj=-1,sp=0,mu=1,vh=2,Nx=3,_x=4,jx=5,Cx=6,ij=7,rj=8,iE=typeof self=="object"?self:globalThis,z6=(e,t)=>{const n=(a,l)=>(e.set(l,a),a),i=a=>{if(e.has(a))return e.get(a);const[l,o]=t[a];switch(l){case sp:case nj:return n(o,a);case mu:{const d=n([],a);for(const f of o)d.push(i(f));return d}case vh:{const d=n({},a);for(const[f,h]of o)d[i(f)]=i(h);return d}case Nx:return n(new Date(o),a);case _x:{const{source:d,flags:f}=o;return n(new RegExp(d,f),a)}case jx:{const d=n(new Map,a);for(const[f,h]of o)d.set(i(f),i(h));return d}case Cx:{const d=n(new Set,a);for(const f of o)d.add(i(f));return d}case ij:{const{name:d,message:f}=o;return n(new iE[d](f),a)}case rj: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 iE[l](o),a)};return i},rE=e=>z6(new Map,e)(0),co="",{toString:P6}={},{keys:B6}=Object,ru=e=>{const t=typeof e;if(t!=="object"||!e)return[sp,t];const n=P6.call(e).slice(8,-1);switch(n){case"Array":return[mu,co];case"Object":return[vh,co];case"Date":return[Nx,co];case"RegExp":return[_x,co];case"Map":return[jx,co];case"Set":return[Cx,co];case"DataView":return[mu,n]}return n.includes("Array")?[mu,n]:n.includes("Error")?[ij,n]:[vh,n]},Mf=([e,t])=>e===sp&&(t==="function"||t==="symbol"),$6=(e,t,n,i)=>{const a=(o,d)=>{const f=i.push(o)-1;return n.set(d,f),f},l=o=>{if(n.has(o))return n.get(o);let[d,f]=ru(o);switch(d){case sp:{let g=o;switch(f){case"bigint":d=rj,g=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);g=null;break;case"undefined":return a([nj],o)}return a([d,g],o)}case mu:{if(f){let y=o;return f==="DataView"?y=new Uint8Array(o.buffer):f==="ArrayBuffer"&&(y=new Uint8Array(o)),a([f,[...y]],o)}const g=[],m=a([d,g],o);for(const y of o)g.push(l(y));return m}case vh:{if(f)switch(f){case"BigInt":return a([f,o.toString()],o);case"Boolean":case"Number":case"String":return a([f,o.valueOf()],o)}if(t&&"toJSON"in o)return l(o.toJSON());const g=[],m=a([d,g],o);for(const y of B6(o))(e||!Mf(ru(o[y])))&&g.push([l(y),l(o[y])]);return m}case Nx:return a([d,o.toISOString()],o);case _x:{const{source:g,flags:m}=o;return a([d,{source:g,flags:m}],o)}case jx:{const g=[],m=a([d,g],o);for(const[y,b]of o)(e||!(Mf(ru(y))||Mf(ru(b))))&&g.push([l(y),l(b)]);return m}case Cx:{const g=[],m=a([d,g],o);for(const y of o)(e||!Mf(ru(y)))&&g.push(l(y));return m}}const{message:h}=o;return a([d,{name:f,message:h}],o)};return l},aE=(e,{json:t,lossy:n}={})=>{const i=[];return $6(!(t||n),!!t,new Map,i)(e),i},wh=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?rE(aE(e,t)):structuredClone(e):(e,t)=>rE(aE(e,t));function U6(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 F6(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function q6(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||U6,i=e.options.footnoteBackLabel||F6,a=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let f=-1;for(;++f<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[f]);if(!h)continue;const g=e.all(h),m=String(h.identifier).toUpperCase(),y=lc(m.toLowerCase());let b=0;const k=[],v=e.footnoteCounts.get(m);for(;v!==void 0&&++b<=v;){k.length>0&&k.push({type:"text",value:" "});let C=typeof n=="string"?n:n(f,b);typeof C=="string"&&(C={type:"text",value:C}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(f,b),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const 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(h,E),d.push(E)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...wh(o),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
|
|
629
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
|
|
630
|
-
`}]}}const ed=(function(e){if(e==null)return V6;if(typeof e=="function")return lp(e);if(typeof e=="object")return Array.isArray(e)?H6(e):K6(e);if(typeof e=="string")return G6(e);throw new Error("Expected function, string, or object as test")});function H6(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ed(e[n]);return lp(i);function i(...a){let l=-1;for(;++l<t.length;)if(t[l].apply(this,a))return!0;return!1}}function K6(e){const t=e;return lp(n);function n(i){const a=i;let l;for(l in e)if(a[l]!==t[l])return!1;return!0}}function G6(e){return lp(t);function t(n){return n&&n.type===e}}function lp(e){return t;function t(n,i,a){return!!(Y6(n)&&e.call(this,n,typeof i=="number"?i:void 0,a||void 0))}}function V6(){return!0}function Y6(e){return e!==null&&typeof e=="object"&&"type"in e}const aj=[],Q6=!0,rb=!1,W6="skip";function sj(e,t,n,i){let a;typeof t=="function"&&typeof n!="function"?(i=n,n=t):a=t;const l=ed(a),o=i?-1:1;d(e,void 0,[])();function d(f,h,g){const m=f&&typeof f=="object"?f:{};if(typeof m.type=="string"){const b=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(f.type+(b?"<"+b+">":""))+")"})}return y;function y(){let b=aj,k,v,S;if((!t||l(f,h,g[g.length-1]||void 0))&&(b=X6(n(f,g)),b[0]===rb))return b;if("children"in f&&f.children){const E=f;if(E.children&&b[0]!==W6)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]===rb)return k;v=typeof k[1]=="number"?k[1]:v+o}}return b}}}function X6(e){return Array.isArray(e)?e:typeof e=="number"?[Q6,e]:e==null?aj:[e]}function op(e,t,n,i){let a,l,o;typeof t=="function"&&typeof n!="function"?(l=void 0,o=t,a=n):(l=t,o=n,a=i),sj(e,l,d,a);function d(f,h){const g=h[h.length-1],m=g?g.children.indexOf(f):void 0;return o(f,m,g)}}const ab={}.hasOwnProperty,Z6={};function J6(e,t){const n=t||Z6,i=new Map,a=new Map,l=new Map,o={...I6,...n.handlers},d={all:h,applyData:t$,definitionById:i,footnoteById:a,footnoteCounts:l,footnoteOrder:[],handlers:o,one:f,options:n,patch:e$,wrap:i$};return op(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const m=g.type==="definition"?i:a,y=String(g.identifier).toUpperCase();m.has(y)||m.set(y,g)}}),d;function f(g,m){const y=g.type,b=d.handlers[y];if(ab.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=wh(S);return E.children=d.all(g),E}return wh(g)}return(d.options.unknownHandler||n$)(d,g,m)}function h(g){const m=[];if("children"in g){const y=g.children;let b=-1;for(;++b<y.length;){const k=d.one(y[b],g);if(k){if(b&&y[b-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=sE(k.value)),!Array.isArray(k)&&k.type==="element")){const v=k.children[0];v&&v.type==="text"&&(v.value=sE(v.value))}Array.isArray(k)?m.push(...k):m.push(k)}}}return m}}function e$(e,t){e.position&&(t.position=F5(e))}function t$(e,t){let n=t;if(e&&e.data){const i=e.data.hName,a=e.data.hChildren,l=e.data.hProperties;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const o="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:o}}n.type==="element"&&l&&Object.assign(n.properties,wh(l)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function n$(e,t){const n=t.data||{},i="value"in t&&!(ab.call(n,"hProperties")||ab.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 i$(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 sE(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function lE(e,t){const n=J6(e,t),i=n.one(e,void 0),a=q6(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 r$(e,t){return e&&"run"in e?async function(n,i){const a=lE(n,{file:i,...t});await e.run(a,i)}:function(n,i){return lE(n,{file:i,...e||t})}}function oE(e){if(e)throw e}var Gg,cE;function a$(){if(cE)return Gg;cE=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},l=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var g=e.call(h,"constructor"),m=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!g&&!m)return!1;var y;for(y in h);return typeof y>"u"||e.call(h,y)},o=function(h,g){n&&g.name==="__proto__"?n(h,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):h[g.name]=g.newValue},d=function(h,g){if(g==="__proto__")if(e.call(h,g)){if(i)return i(h,g).value}else return;return h[g]};return Gg=function f(){var h,g,m,y,b,k,v=arguments[0],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(h=arguments[S],h!=null)for(g in h)m=d(v,g),y=d(h,g),v!==y&&(C&&y&&(l(y)||(b=a(y)))?(b?(b=!1,k=m&&a(m)?m:[]):k=m&&l(m)?m:{},o(v,{name:g,newValue:f(C,k,y)})):typeof y<"u"&&o(v,{name:g,newValue:y}));return v},Gg}var s$=a$();const Vg=qu(s$);function sb(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 l$(){const e=[],t={run:n,use:i};return t;function n(...a){let l=-1;const o=a.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);d(null,...a);function d(f,...h){const g=e[++l];let m=-1;if(f){o(f);return}for(;++m<a.length;)(h[m]===null||h[m]===void 0)&&(h[m]=a[m]);a=h,g?o$(g,d)(...h):o(null,...h)}}function i(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function o$(e,t){let n;return i;function i(...o){const d=e.length>o.length;let f;d&&o.push(a);try{f=e.apply(this,o)}catch(h){const g=h;if(d&&n)throw g;return a(g)}d||(f&&f.then&&typeof f.then=="function"?f.then(l,a):f instanceof Error?a(f):l(f))}function a(o,...d){n||(n=!0,t(o,...d))}function l(o){a(null,o)}}const jr={basename:c$,dirname:u$,extname:d$,join:f$,sep:"/"};function c$(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');td(e);let n=0,i=-1,a=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(l){n=a+1;break}}else i<0&&(l=!0,i=a+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let o=-1,d=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(l){n=a+1;break}}else o<0&&(l=!0,o=a+1),d>-1&&(e.codePointAt(a)===t.codePointAt(d--)?d<0&&(i=a):(d=-1,i=o));return n===i?i=o:i<0&&(i=e.length),e.slice(n,i)}function u$(e){if(td(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function d$(e){td(e);let t=e.length,n=-1,i=0,a=-1,l=0,o;for(;t--;){const d=e.codePointAt(t);if(d===47){if(o){i=t+1;break}continue}n<0&&(o=!0,n=t+1),d===46?a<0?a=t:l!==1&&(l=1):a>-1&&(l=-1)}return a<0||n<0||l===0||l===1&&a===n-1&&a===i+1?"":e.slice(a,n)}function f$(...e){let t=-1,n;for(;++t<e.length;)td(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":h$(n)}function h$(e){td(e);const t=e.codePointAt(0)===47;let n=p$(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function p$(e,t){let n="",i=0,a=-1,l=0,o=-1,d,f;for(;++o<=e.length;){if(o<e.length)d=e.codePointAt(o);else{if(d===47)break;d=47}if(d===47){if(!(a===o-1||l===1))if(a!==o-1&&l===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",i=0):(n=n.slice(0,f),i=n.length-1-n.lastIndexOf("/")),a=o,l=0;continue}}else if(n.length>0){n="",i=0,a=o,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(a+1,o):n=e.slice(a+1,o),i=o-a-1;a=o,l=0}else d===46&&l>-1?l++:l=-1}return n}function td(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const m$={cwd:g$};function g$(){return"/"}function lb(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function y$(e){if(typeof e=="string")e=new URL(e);else if(!lb(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 b$(e)}function b$(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const i=t.codePointAt(n+2);if(i===70||i===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const Yg=["history","path","basename","stem","extname","dirname"];class lj{constructor(t){let n;t?lb(t)?n={path:t}:typeof t=="string"||x$(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":m$.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<Yg.length;){const l=Yg[i];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let a;for(a in n)Yg.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?jr.basename(this.path):void 0}set basename(t){Wg(t,"basename"),Qg(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){uE(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(Qg(t,"extname"),uE(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){lb(t)&&(t=y$(t)),Wg(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){Wg(t,"stem"),Qg(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 Qg(e,t){if(e&&e.includes(jr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+jr.sep+"`")}function Wg(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function uE(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function x$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const v$=(function(e){const i=this.constructor.prototype,a=i[e],l=function(){return a.apply(l,arguments)};return Object.setPrototypeOf(l,i),l}),w$={}.hasOwnProperty;class Ax extends v${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=l$()}copy(){const t=new Ax;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(Vg(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Jg("data",this.frozen),this.namespace[t]=n,this):w$.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Jg("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const a=n.call(t,...i);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Df(t),i=this.parser||this.Parser;return Xg("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),Xg("process",this.parser||this.Parser),Zg("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(l,o){const d=Df(t),f=i.parse(d);i.run(f,d,function(g,m,y){if(g||!m||!y)return h(g);const b=m,k=i.stringify(b,y);S$(k)?y.value=k:y.result=k,h(g,y)});function h(g,m){g||!m?o(g):l?l(m):n(void 0,m)}}}processSync(t){let n=!1,i;return this.freeze(),Xg("processSync",this.parser||this.Parser),Zg("processSync",this.compiler||this.Compiler),this.process(t,a),fE("processSync","process",n),i;function a(l,o){n=!0,oE(l),i=o}}run(t,n,i){dE(t),this.freeze();const a=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?l(void 0,i):new Promise(l);function l(o,d){const f=Df(n);a.run(t,f,h);function h(g,m,y){const b=m||t;g?d(g):o?o(b):i(void 0,b,y)}}}runSync(t,n){let i=!1,a;return this.run(t,n,l),fE("runSync","run",i),a;function l(o,d){oE(o),a=d,i=!0}}stringify(t,n){this.freeze();const i=Df(n),a=this.compiler||this.Compiler;return Zg("stringify",a),dE(t),a(t,i)}use(t,...n){const i=this.attachers,a=this.namespace;if(Jg("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?d(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(h){if(typeof h=="function")f(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[g,...m]=h;f(g,m)}else o(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function o(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");d(h.plugins),h.settings&&(a.settings=Vg(!0,a.settings,h.settings))}function d(h){let g=-1;if(h!=null)if(Array.isArray(h))for(;++g<h.length;){const m=h[g];l(m)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function f(h,g){let m=-1,y=-1;for(;++m<i.length;)if(i[m][0]===h){y=m;break}if(y===-1)i.push([h,...g]);else if(g.length>0){let[b,...k]=g;const v=i[y][1];sb(v)&&sb(b)&&(b=Vg(!0,v,b)),i[y]=[h,b,...k]}}}}const k$=new Ax().freeze();function Xg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Zg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Jg(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function dE(e){if(!sb(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function fE(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Df(e){return E$(e)?e:new lj(e)}function E$(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function S$(e){return typeof e=="string"||N$(e)}function N$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const _$="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",hE=[],pE={allowDangerousHtml:!0},j$=/^(https?|ircs?|mailto|xmpp)$/i,C$=[{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 Tx(e){const t=A$(e),n=T$(e);return M$(t.runSync(t.parse(n),n),e)}function A$(e){const t=e.rehypePlugins||hE,n=e.remarkPlugins||hE,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...pE}:pE;return k$().use(u6).use(n).use(r$,i).use(t)}function T$(e){const t=e.children||"",n=new lj;return typeof t=="string"&&(n.value=t),n}function M$(e,t){const n=t.allowedElements,i=t.allowElement,a=t.components,l=t.disallowedElements,o=t.skipHtml,d=t.unwrapDisallowed,f=t.urlTransform||D$;for(const g of C$)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+_$+g.id,void 0);return op(e,h),V5(e,{Fragment:c.Fragment,components:a,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function h(g,m,y){if(g.type==="raw"&&y&&typeof m=="number")return o?y.children.splice(m,1):y.children[m]={type:"text",value:g.value},m;if(g.type==="element"){let b;for(b in qg)if(Object.hasOwn(qg,b)&&Object.hasOwn(g.properties,b)){const k=g.properties[b],v=qg[b];(v===null||v.includes(g.tagName))&&(g.properties[b]=f(String(k||""),b,g))}}if(g.type==="element"){let b=n?!n.includes(g.tagName):l?l.includes(g.tagName):!1;if(!b&&i&&typeof m=="number"&&(b=!i(g,m,y)),b&&y&&typeof m=="number")return d&&g.children?y.children.splice(m,1,...g.children):y.children.splice(m,1),m}}}function D$(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||j$.test(e.slice(0,t))?e:""}function mE(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 O$(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function R$(e,t,n){const a=ed((n||{}).ignore||[]),l=L$(t);let o=-1;for(;++o<l.length;)sj(e,"text",d);function d(h,g){let m=-1,y;for(;++m<g.length;){const b=g[m],k=y?y.children:void 0;if(a(b,k?k.indexOf(b):void 0,y))return;y=b}if(y)return f(h,g)}function f(h,g){const m=g[g.length-1],y=l[o][0],b=l[o][1];let k=0;const S=m.children.indexOf(h);let E=!1,C=[];y.lastIndex=0;let N=y.exec(h.value);for(;N;){const _=N.index,T={index:N.index,input:N.input,stack:[...g,h]};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:h.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(h.value)}return E?(k<h.value.length&&C.push({type:"text",value:h.value.slice(k)}),m.children.splice(S,1,...C)):C=[h],S+C.length}}function L$(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([I$(a[0]),z$(a[1])])}return t}function I$(e){return typeof e=="string"?new RegExp(O$(e),"g"):e}function z$(e){return typeof e=="function"?e:function(){return e}}const ey="phrasing",ty=["autolink","link","image","label"];function P$(){return{transforms:[K$],enter:{literalAutolink:$$,literalAutolinkEmail:ny,literalAutolinkHttp:ny,literalAutolinkWww:ny},exit:{literalAutolink:H$,literalAutolinkEmail:q$,literalAutolinkHttp:U$,literalAutolinkWww:F$}}}function B$(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ey,notInConstruct:ty},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ey,notInConstruct:ty},{character:":",before:"[ps]",after:"\\/",inConstruct:ey,notInConstruct:ty}]}}function $$(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ny(e){this.config.enter.autolinkProtocol.call(this,e)}function U$(e){this.config.exit.autolinkProtocol.call(this,e)}function F$(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 q$(e){this.config.exit.autolinkEmail.call(this,e)}function H$(e){this.exit(e)}function K$(e){R$(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,G$],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),V$]],{ignore:["link","linkReference"]})}function G$(e,t,n,i,a){let l="";if(!oj(a)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!Y$(n)))return!1;const o=Q$(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 V$(e,t,n,i){return!oj(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Y$(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 Q$(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=mE(e,"(");let l=mE(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 oj(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||ml(n)||rp(n))&&(!t||n!==47)}cj.peek=rU;function W$(){this.buffer()}function X$(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Z$(){this.buffer()}function J$(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function eU(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 tU(e){this.exit(e)}function nU(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 iU(e){this.exit(e)}function rU(){return"["}function cj(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 aU(){return{enter:{gfmFootnoteCallString:W$,gfmFootnoteCall:X$,gfmFootnoteDefinitionLabelString:Z$,gfmFootnoteDefinition:J$},exit:{gfmFootnoteCallString:eU,gfmFootnoteCall:tU,gfmFootnoteDefinitionLabelString:nU,gfmFootnoteDefinition:iU}}}function sU(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:cj},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,a,l,o){const d=l.createTracker(o);let f=d.move("[^");const h=l.enter("footnoteDefinition"),g=l.enter("label");return f+=d.move(l.safe(l.associationId(i),{before:f,after:"]"})),g(),f+=d.move("]:"),i.children&&i.children.length>0&&(d.shift(4),f+=d.move((t?`
|
|
635
|
-
`:" ")+l.indentLines(l.containerFlow(i,d.current()),t?uj:lU))),h(),f}}function lU(e,t,n){return t===0?e:uj(e,t,n)}function uj(e,t,n){return(n?"":" ")+e}const oU=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];dj.peek=hU;function cU(){return{canContainEols:["delete"],enter:{strikethrough:dU},exit:{strikethrough:fU}}}function uU(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:oU}],handlers:{delete:dj}}}function dU(e){this.enter({type:"delete",children:[]},e)}function fU(e){this.exit(e)}function dj(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 hU(){return"~"}function pU(e){return e.length}function mU(e,t){const n=t||{},i=(n.align||[]).concat(),a=n.stringLength||pU,l=[],o=[],d=[],f=[];let h=0,g=-1;for(;++g<e.length;){const v=[],S=[];let E=-1;for(e[g].length>h&&(h=e[g].length);++E<e[g].length;){const C=gU(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<h;)l[m]=gE(i[m]);else{const v=gE(i);for(;++m<h;)l[m]=v}m=-1;const y=[],b=[];for(;++m<h;){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<h;){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!==h-1)&&E.push("|")}k.push(n.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return k.join(`
|
|
636
|
-
`)}function gU(e){return e==null?"":String(e)}function gE(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 yU(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()),bU);return a(),o}function bU(e,t,n){return">"+(n?"":" ")+e}function xU(e,t){return yE(e,t.inConstruct,!0)&&!yE(e,t.notInConstruct,!1)}function yE(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 bE(e,t,n,i){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
|
|
637
|
-
`&&xU(n.stack,n.unsafe[a]))return/[ \t]/.test(i.before)?"":" ";return`\\
|
|
638
|
-
`}function vU(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 wU(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 kU(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 EU(e,t,n,i){const a=kU(n),l=e.value||"",o=a==="`"?"GraveAccent":"Tilde";if(wU(e,n)){const m=n.enter("codeIndented"),y=n.indentLines(l,SU);return m(),y}const d=n.createTracker(i),f=a.repeat(Math.max(vU(l,a)+1,3)),h=n.enter("codeFenced");let g=d.move(f);if(e.lang){const m=n.enter(`codeFencedLang${o}`);g+=d.move(n.safe(e.lang,{before:g,after:" ",encode:["`"],...d.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${o}`);g+=d.move(" "),g+=d.move(n.safe(e.meta,{before:g,after:`
|
|
639
|
-
`,encode:["`"],...d.current()})),m()}return g+=d.move(`
|
|
640
|
-
`),l&&(g+=d.move(l+`
|
|
641
|
-
`)),g+=d.move(f),h(),g}function SU(e,t,n){return(n?"":" ")+e}function Mx(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 NU(e,t,n,i){const a=Mx(n),l=a==='"'?"Quote":"Apostrophe",o=n.enter("definition");let d=n.enter("label");const f=n.createTracker(i);let h=f.move("[");return h+=f.move(n.safe(n.associationId(e),{before:h,after:"]",...f.current()})),h+=f.move("]: "),d(),!e.url||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(n.safe(e.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(d=n.enter("destinationRaw"),h+=f.move(n.safe(e.url,{before:h,after:e.title?" ":`
|
|
642
|
-
`,...f.current()}))),d(),e.title&&(d=n.enter(`title${l}`),h+=f.move(" "+a),h+=f.move(n.safe(e.title,{before:h,after:a,...f.current()})),h+=f.move(a),d()),o(),h}function _U(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Cu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function kh(e,t,n){const i=Uo(e),a=Uo(t);return i===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}fj.peek=jU;function fj(e,t,n,i){const a=_U(n),l=n.enter("emphasis"),o=n.createTracker(i),d=o.move(a);let f=o.move(n.containerPhrasing(e,{after:a,before:d,...o.current()}));const h=f.charCodeAt(0),g=kh(i.before.charCodeAt(i.before.length-1),h,a);g.inside&&(f=Cu(h)+f.slice(1));const m=f.charCodeAt(f.length-1),y=kh(i.after.charCodeAt(0),m,a);y.inside&&(f=f.slice(0,-1)+Cu(m));const b=o.move(a);return l(),n.attentionEncodeSurroundingInfo={after:y.outside,before:g.outside},d+f+b}function jU(e,t,n){return n.options.emphasis||"*"}function CU(e,t){let n=!1;return op(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,rb}),!!((!e.depth||e.depth<3)&&kx(e)&&(t.options.setext||n))}function AU(e,t,n,i){const a=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(i);if(CU(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 h=n.containerPhrasing(e,{before:"# ",after:`
|
|
647
|
-
`,...l.current()});return/^[\t ]/.test(h)&&(h=Cu(h.charCodeAt(0))+h.slice(1)),h=h?o+" "+h:o,n.options.closeAtx&&(h+=" "+o),f(),d(),h}hj.peek=TU;function hj(e){return e.value||""}function TU(){return"<"}pj.peek=MU;function pj(e,t,n,i){const a=Mx(n),l=a==='"'?"Quote":"Apostrophe",o=n.enter("image");let d=n.enter("label");const f=n.createTracker(i);let h=f.move("![");return h+=f.move(n.safe(e.alt,{before:h,after:"]",...f.current()})),h+=f.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(n.safe(e.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(d=n.enter("destinationRaw"),h+=f.move(n.safe(e.url,{before:h,after:e.title?" ":")",...f.current()}))),d(),e.title&&(d=n.enter(`title${l}`),h+=f.move(" "+a),h+=f.move(n.safe(e.title,{before:h,after:a,...f.current()})),h+=f.move(a),d()),h+=f.move(")"),o(),h}function MU(){return"!"}mj.peek=DU;function mj(e,t,n,i){const a=e.referenceType,l=n.enter("imageReference");let o=n.enter("label");const d=n.createTracker(i);let f=d.move("![");const h=n.safe(e.alt,{before:f,after:"]",...d.current()});f+=d.move(h+"]["),o();const g=n.stack;n.stack=[],o=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...d.current()});return o(),n.stack=g,l(),a==="full"||!h||h!==m?f+=d.move(m+"]"):a==="shortcut"?f=f.slice(0,-1):f+=d.move("]"),f}function DU(){return"!"}gj.peek=OU;function gj(e,t,n){let i=e.value||"",a="`",l=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(i);)a+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++l<n.unsafe.length;){const o=n.unsafe[l],d=n.compilePattern(o);let f;if(o.atBreak)for(;f=d.exec(i);){let h=f.index;i.charCodeAt(h)===10&&i.charCodeAt(h-1)===13&&h--,i=i.slice(0,h)+" "+i.slice(f.index+1)}}return a+i+a}function OU(){return"`"}function yj(e,t){const n=kx(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))}bj.peek=RU;function bj(e,t,n,i){const a=Mx(n),l=a==='"'?"Quote":"Apostrophe",o=n.createTracker(i);let d,f;if(yj(e,n)){const g=n.stack;n.stack=[],d=n.enter("autolink");let m=o.move("<");return m+=o.move(n.containerPhrasing(e,{before:m,after:">",...o.current()})),m+=o.move(">"),d(),n.stack=g,m}d=n.enter("link"),f=n.enter("label");let h=o.move("[");return h+=o.move(n.containerPhrasing(e,{before:h,after:"](",...o.current()})),h+=o.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=o.move("<"),h+=o.move(n.safe(e.url,{before:h,after:">",...o.current()})),h+=o.move(">")):(f=n.enter("destinationRaw"),h+=o.move(n.safe(e.url,{before:h,after:e.title?" ":")",...o.current()}))),f(),e.title&&(f=n.enter(`title${l}`),h+=o.move(" "+a),h+=o.move(n.safe(e.title,{before:h,after:a,...o.current()})),h+=o.move(a),f()),h+=o.move(")"),d(),h}function RU(e,t,n){return yj(e,n)?"<":"["}xj.peek=LU;function xj(e,t,n,i){const a=e.referenceType,l=n.enter("linkReference");let o=n.enter("label");const d=n.createTracker(i);let f=d.move("[");const h=n.containerPhrasing(e,{before:f,after:"]",...d.current()});f+=d.move(h+"]["),o();const g=n.stack;n.stack=[],o=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...d.current()});return o(),n.stack=g,l(),a==="full"||!h||h!==m?f+=d.move(m+"]"):a==="shortcut"?f=f.slice(0,-1):f+=d.move("]"),f}function LU(){return"["}function Dx(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 IU(e){const t=Dx(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 zU(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 vj(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 PU(e,t,n,i){const a=n.enter("list"),l=n.bulletCurrent;let o=e.ordered?zU(n):Dx(n);const d=e.ordered?o==="."?")":".":IU(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),vj(n)===o&&g){let m=-1;for(;++m<e.children.length;){const y=e.children[m];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(o=d),n.bulletCurrent=o;const h=n.containerFlow(e,i);return n.bulletLastUsed=o,n.bulletCurrent=l,a(),h}function BU(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 $U(e,t,n,i){const a=BU(n);let l=n.bulletCurrent||Dx(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let o=l.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const d=n.createTracker(i);d.move(l+" ".repeat(o-l.length)),d.shift(o);const f=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,d.current()),g);return f(),h;function g(m,y,b){return y?(b?"":" ".repeat(o))+m:(b?l:l+" ".repeat(o-l.length))+m}}function UU(e,t,n,i){const a=n.enter("paragraph"),l=n.enter("phrasing"),o=n.containerPhrasing(e,i);return l(),a(),o}const FU=ed(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function qU(e,t,n,i){return(e.children.some(function(o){return FU(o)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function HU(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}wj.peek=KU;function wj(e,t,n,i){const a=HU(n),l=n.enter("strong"),o=n.createTracker(i),d=o.move(a+a);let f=o.move(n.containerPhrasing(e,{after:a,before:d,...o.current()}));const h=f.charCodeAt(0),g=kh(i.before.charCodeAt(i.before.length-1),h,a);g.inside&&(f=Cu(h)+f.slice(1));const m=f.charCodeAt(f.length-1),y=kh(i.after.charCodeAt(0),m,a);y.inside&&(f=f.slice(0,-1)+Cu(m));const b=o.move(a+a);return l(),n.attentionEncodeSurroundingInfo={after:y.outside,before:g.outside},d+f+b}function KU(e,t,n){return n.options.strong||"*"}function GU(e,t,n,i){return n.safe(e.value,i)}function VU(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 YU(e,t,n){const i=(vj(n)+(n.options.ruleSpaces?" ":"")).repeat(VU(n));return n.options.ruleSpaces?i.slice(0,-1):i}const kj={blockquote:yU,break:bE,code:EU,definition:NU,emphasis:fj,hardBreak:bE,heading:AU,html:hj,image:pj,imageReference:mj,inlineCode:gj,link:bj,linkReference:xj,list:PU,listItem:$U,paragraph:UU,root:qU,strong:wj,text:GU,thematicBreak:YU};function QU(){return{enter:{table:WU,tableData:xE,tableHeader:xE,tableRow:ZU},exit:{codeText:JU,table:XU,tableData:iy,tableHeader:iy,tableRow:iy}}}function WU(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 XU(e){this.exit(e),this.data.inTable=void 0}function ZU(e){this.enter({type:"tableRow",children:[]},e)}function iy(e){this.exit(e)}function xE(e){this.enter({type:"tableCell",children:[]},e)}function JU(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,e9));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function e9(e,t){return t==="|"?t:e}function t9(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 h(g(b,v,S),b.align)}function d(b,k,v,S){const E=m(b,v,S),C=h([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 h(b,k){return mU(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=kj.inlineCode(b,k,v);return v.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function n9(){return{exit:{taskListCheckValueChecked:vE,taskListCheckValueUnchecked:vE,paragraph:r9}}}function i9(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:a9}}}function vE(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function r9(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 a9(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=kj.listItem(e,t,n,{...i,...d.current()});return l&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),f;function h(g){return g+o}}function s9(){return[P$(),aU(),cU(),QU(),n9()]}function l9(e){return{extensions:[B$(),sU(e),uU(),t9(e),i9()]}}const o9={tokenize:p9,partial:!0},Ej={tokenize:m9,partial:!0},Sj={tokenize:g9,partial:!0},Nj={tokenize:y9,partial:!0},c9={tokenize:b9,partial:!0},_j={name:"wwwAutolink",tokenize:f9,previous:Cj},jj={name:"protocolAutolink",tokenize:h9,previous:Aj},xa={name:"emailAutolink",tokenize:d9,previous:Tj},Ir={};function u9(){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,jj];Ir[104]=[xa,jj];Ir[87]=[xa,_j];Ir[119]=[xa,_j];function d9(e,t,n){const i=this;let a,l;return o;function o(m){return!ob(m)||!Tj.call(i,i.previous)||Ox(i.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(m))}function d(m){return ob(m)?(e.consume(m),d):m===64?(e.consume(m),f):n(m)}function f(m){return m===46?e.check(c9,g,h)(m):m===45||m===95||Gn(m)?(l=!0,e.consume(m),f):g(m)}function h(m){return e.consume(m),a=!0,f}function g(m){return l&&a&&ni(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):n(m)}}function f9(e,t,n){const i=this;return a;function a(o){return o!==87&&o!==119||!Cj.call(i,i.previous)||Ox(i.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(o9,e.attempt(Ej,e.attempt(Sj,l),n),n)(o))}function l(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function h9(e,t,n){const i=this;let a="",l=!1;return o;function o(m){return(m===72||m===104)&&Aj.call(i,i.previous)&&!Ox(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(m),e.consume(m),d):n(m)}function d(m){if(ni(m)&&a.length<5)return a+=String.fromCodePoint(m),e.consume(m),d;if(m===58){const y=a.toLowerCase();if(y==="http"||y==="https")return e.consume(m),f}return n(m)}function f(m){return m===47?(e.consume(m),l?h:(l=!0,f)):n(m)}function h(m){return m===null||xh(m)||Kt(m)||ml(m)||rp(m)?n(m):e.attempt(Ej,e.attempt(Sj,g),n)(m)}function g(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function p9(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 m9(e,t,n){let i,a,l;return o;function o(h){return h===46||h===95?e.check(Nj,f,d)(h):h===null||Kt(h)||ml(h)||h!==45&&rp(h)?f(h):(l=!0,e.consume(h),o)}function d(h){return h===95?i=!0:(a=i,i=void 0),e.consume(h),o}function f(h){return a||i||!l?n(h):t(h)}}function g9(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(Nj,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 y9(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 b9(e,t,n){return i;function i(l){return e.consume(l),a}function a(l){return Gn(l)?n(l):t(l)}}function Cj(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Kt(e)}function Aj(e){return!ni(e)}function Tj(e){return!(e===47||ob(e))}function ob(e){return e===43||e===45||e===46||e===95||Gn(e)}function Ox(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 x9={tokenize:j9,partial:!0};function v9(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:S9,continuation:{tokenize:N9},exit:_9}},text:{91:{name:"gfmFootnoteCall",tokenize:E9},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:w9,resolveTo:k9}}}}function w9(e,t,n){const i=this;let a=i.events.length;const l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o;for(;a--;){const f=i.events[a][1];if(f.type==="labelImage"){o=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return d;function d(f){if(!o||!o._balanced)return n(f);const h=fr(i.sliceSerialize({start:o.end,end:i.now()}));return h.codePointAt(0)!==94||!l.includes(h.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function k9(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 E9(e,t,n){const i=this,a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l=0,o;return d;function d(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),f}function f(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(m){if(l>999||m===93&&!o||m===null||m===91||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:h}function g(m){return m===91||m===92||m===93?(e.consume(m),l++,h):h(m)}}function S9(e,t,n){const i=this,a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l,o=0,d;return f;function f(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):n(k)}function g(k){if(o>999||k===93&&!d||k===null||k===91||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 N9(e,t,n){return e.check(Ju,t,e.attempt(x9,t,n))}function _9(e){e.exit("gfmFootnoteDefinition")}function j9(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 C9(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:l,resolveAll:a};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function a(o,d){let f=-1;for(;++f<o.length;)if(o[f][0]==="enter"&&o[f][1].type==="strikethroughSequenceTemporary"&&o[f][1]._close){let h=f;for(;h--;)if(o[h][0]==="exit"&&o[h][1].type==="strikethroughSequenceTemporary"&&o[h][1]._open&&o[f][1].end.offset-o[f][1].start.offset===o[h][1].end.offset-o[h][1].start.offset){o[f][1].type="strikethroughSequence",o[h][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},o[h][1].start),end:Object.assign({},o[f][1].end)},m={type:"strikethroughText",start:Object.assign({},o[h][1].end),end:Object.assign({},o[f][1].start)},y=[["enter",g,d],["enter",o[h][1],d],["exit",o[h][1],d],["enter",m,d]],b=d.parser.constructs.insideSpan.null;b&&ji(y,y.length,0,ap(b,o.slice(h+1,f),d)),ji(y,y.length,0,[["exit",m,d],["enter",o[f][1],d],["exit",o[f][1],d],["exit",g,d]]),ji(o,h-1,f-h+3,y),f=h+y.length-2;break}}for(f=-1;++f<o.length;)o[f][1].type==="strikethroughSequenceTemporary"&&(o[f][1].type="data");return o}function l(o,d,f){const h=this.previous,g=this.events;let m=0;return y;function y(k){return h===126&&g[g.length-1][1].type!=="characterEscape"?f(k):(o.enter("strikethroughSequenceTemporary"),b(k))}function b(k){const v=Uo(h);if(k===126)return m>1?f(k):(o.consume(k),m++,b);if(m<2&&!n)return f(k);const S=o.exit("strikethroughSequenceTemporary"),E=Uo(k);return S._open=!E||E===2&&!!v,S._close=!v||v===2&&!!E,d(k)}}}class A9{constructor(){this.map=[]}add(t,n,i){T9(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 T9(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 M9(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 D9(){return{flow:{null:{name:"table",tokenize:O9,resolveAll:R9}}}}function O9(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"),h(U)}function h(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"),R(U)}function R(U){return U===124?(e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),R):U===null||Je(U)?(e.exit("tableRow"),t(U)):gt(U)?St(e,R,"whitespace")(U):(e.enter("data"),O(U))}function O(U){return U===null||U===124||Kt(U)?(e.exit("data"),R(U)):(e.consume(U),U===92?B:O)}function B(U){return U===92||U===124?(e.consume(U),O):O(U)}}function R9(e,t){let n=-1,i=!0,a=0,l=[0,0,0,0],o=[0,0,0,0],d=!1,f=0,h,g,m;const y=new A9;for(;++n<e.length;){const b=e[n],k=b[1];b[0]==="enter"?k.type==="tableHead"?(d=!1,f!==0&&(wE(y,t,f,h,g),g=void 0,f=0),h={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},y.add(n,0,[["enter",h,t]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(i=!0,m=void 0,l=[0,0,0,0],o=[0,n+1,0,0],d&&(d=!1,g={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},y.add(n,0,[["enter",g,t]])),a=k.type==="tableDelimiterRow"?2:g?3:1):a&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(i=!1,o[2]===0&&(l[1]!==0&&(o[0]=o[1],m=Of(y,t,l,a,void 0,m),l=[0,0,0,0]),o[2]=n)):k.type==="tableCellDivider"&&(i?i=!1:(l[1]!==0&&(o[0]=o[1],m=Of(y,t,l,a,void 0,m)),l=o,o=[l[1],n,0,0])):k.type==="tableHead"?(d=!0,f=n):k.type==="tableRow"||k.type==="tableDelimiterRow"?(f=n,l[1]!==0?(o[0]=o[1],m=Of(y,t,l,a,n,m)):o[1]!==0&&(m=Of(y,t,o,a,n,m)),a=0):a&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(o[3]=n)}for(f!==0&&wE(y,t,f,h,g),y.consume(t.events),n=-1;++n<t.events.length;){const b=t.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=M9(t.events,n))}return e}function Of(e,t,n,i,a,l){const o=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",d="tableContent";n[0]!==0&&(l.end=Object.assign({},ho(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const f=ho(t.events,n[1]);if(l={type:o,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const h=ho(t.events,n[2]),g=ho(t.events,n[3]),m={type:d,start:Object.assign({},h),end:Object.assign({},g)};if(e.add(n[2],0,[["enter",m,t]]),i!==2){const y=t.events[n[2]],b=t.events[n[3]];if(y[1].end=Object.assign({},b[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const k=n[2]+1,v=n[3]-n[2]-1;e.add(k,v,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return a!==void 0&&(l.end=Object.assign({},ho(t.events,a)),e.add(a,0,[["exit",l,t]]),l=void 0),l}function wE(e,t,n,i,a){const l=[],o=ho(t.events,n);a&&(a.end=Object.assign({},o),l.push(["exit",a,t])),i.end=Object.assign({},o),l.push(["exit",i,t]),e.add(n+1,0,l)}function ho(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const L9={name:"tasklistCheck",tokenize:z9};function I9(){return{text:{91:L9}}}function z9(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:P9},t,n)(f):n(f)}}function P9(e,t,n){return St(e,i,"whitespace");function i(a){return a===null?n(a):t(a)}}function B9(e){return U2([u9(),v9(),C9(e),D9(),I9()])}const $9={};function Rx(e){const t=this,n=e||$9,i=t.data(),a=i.micromarkExtensions||(i.micromarkExtensions=[]),l=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),o=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);a.push(B9(n)),l.push(s9()),o.push(l9(n))}const kE=(function(e,t,n){const i=ed(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(i(e.children[t],t,e))return e.children[t]}),Sl=(function(e){if(e==null)return q9;if(typeof e=="string")return F9(e);if(typeof e=="object")return U9(e);if(typeof e=="function")return Lx(e);throw new Error("Expected function, string, or array as `test`")});function U9(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Sl(e[n]);return Lx(i);function i(...a){let l=-1;for(;++l<t.length;)if(t[l].apply(this,a))return!0;return!1}}function F9(e){return Lx(t);function t(n){return n.tagName===e}}function Lx(e){return t;function t(n,i,a){return!!(H9(n)&&e.call(this,n,typeof i=="number"?i:void 0,a||void 0))}}function q9(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function H9(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const EE=/\n/g,SE=/[\t ]+/g,cb=Sl("br"),NE=Sl(Z9),K9=Sl("p"),_E=Sl("tr"),G9=Sl(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",X9,J9]),Mj=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 V9(e,t){const n=t||{},i="children"in e?e.children:[],a=Mj(e),l=Rj(e,{whitespace:n.whitespace||"normal"}),o=[];(e.type==="text"||e.type==="comment")&&o.push(...Oj(e,{breakBefore:!0,breakAfter:!0}));let d=-1;for(;++d<i.length;)o.push(...Dj(i[d],e,{whitespace:l,breakBefore:d?void 0:a,breakAfter:d<i.length-1?cb(i[d+1]):a}));const f=[];let h;for(d=-1;++d<o.length;){const g=o[d];typeof g=="number"?h!==void 0&&g>h&&(h=g):g&&(h!==void 0&&h>-1&&f.push(`
|
|
650
|
-
`.repeat(h)||" "),h=-1,f.push(g))}return f.join("")}function Dj(e,t,n){return e.type==="element"?Y9(e,t,n):e.type==="text"?n.whitespace==="normal"?Oj(e,n):Q9(e):[]}function Y9(e,t,n){const i=Rj(e,n),a=e.children||[];let l=-1,o=[];if(G9(e))return o;let d,f;for(cb(e)||_E(e)&&kE(t,e,_E)?f=`
|
|
651
|
-
`:K9(e)?(d=2,f=2):Mj(e)&&(d=1,f=1);++l<a.length;)o=o.concat(Dj(a[l],e,{whitespace:i,breakBefore:l?void 0:d,breakAfter:l<a.length-1?cb(a[l+1]):f}));return NE(e)&&kE(t,e,NE)&&o.push(" "),d&&o.unshift(d),f&&o.push(f),o}function Oj(e,t){const n=String(e.value),i=[],a=[];let l=0;for(;l<=n.length;){EE.lastIndex=l;const f=EE.exec(n),h=f&&"index"in f?f.index:n.length;i.push(W9(n.slice(l,h).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),l===0?t.breakBefore:!0,h===n.length?t.breakAfter:!0)),l=h+1}let o=-1,d;for(;++o<i.length;)i[o].charCodeAt(i[o].length-1)===8203||o<i.length-1&&i[o+1].charCodeAt(0)===8203?(a.push(i[o]),d=void 0):i[o]?(typeof d=="number"&&a.push(d),a.push(i[o]),d=0):(o===0||o===i.length-1)&&a.push(0);return a}function Q9(e){return[String(e.value)]}function W9(e,t,n){const i=[];let a=0,l;for(;a<e.length;){SE.lastIndex=a;const o=SE.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 Rj(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 X9(e){return!!(e.properties||{}).hidden}function Z9(e){return e.tagName==="td"||e.tagName==="th"}function J9(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function eF(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",o="(?!struct)("+i+"|"+t.optional(a)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",d={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},g={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},m={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:t.optional(a)+e.IDENT_RE,relevance:0},b=t.optional(a)+e.IDENT_RE+"\\s*\\(",k=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],v=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],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,h],R={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},O={className:"function",begin:"("+o+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:_,relevance:0},{begin:b,returnBegin:!0,contains:[y],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[h,g]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,h,g,d,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,h,g,d]}]},d,n,e.C_BLOCK_COMMENT_MODE,m]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(R,O,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 tF(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=eF(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 nF(e){const t=e.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const a={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},l=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},d={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,a]};a.contains.push(d);const f={match:/\\"/},h={className:"string",begin:/'/,end:/'/},g={match:/\\'/},m={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},y=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],b=e.SHEBANG({binary:`(${y.join("|")})`,relevance:10}),k={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},v=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],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,h,g,n]}}function iF(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",o="("+i+"|"+t.optional(a)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",d={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},g={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},m={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:t.optional(a)+e.IDENT_RE,relevance:0},b=t.optional(a)+e.IDENT_RE+"\\s*\\(",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,h],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,h,g,d,{begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,h,g,d]}]},d,n,e.C_BLOCK_COMMENT_MODE,m]};return{name:"C",aliases:["h"],keywords: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:h,keywords:S}}}function rF(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",o="(?!struct)("+i+"|"+t.optional(a)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",d={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},g={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},m={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:t.optional(a)+e.IDENT_RE,relevance:0},b=t.optional(a)+e.IDENT_RE+"\\s*\\(",k=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],v=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],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,h],R={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},O={className:"function",begin:"("+o+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:_,relevance:0},{begin:b,returnBegin:!0,contains:[y],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[h,g]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,h,g,d,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,h,g,d]}]},d,n,e.C_BLOCK_COMMENT_MODE,m]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(R,O,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 aF(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],i=["default","false","null","true"],a=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],l=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],o={keyword:a.concat(l),built_in:t,literal:i},d=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),f={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},h={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},g={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},m=e.inherit(g,{illegal:/\n/}),y={className:"subst",begin:/\{/,end:/\}/,keywords:o},b=e.inherit(y,{illegal:/\n/}),k={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,b]},v={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},y]},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:[h,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 sF=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_-]*/}}),lF=["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"],oF=["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"],cF=[...lF,...oF],uF=["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(),dF=["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(),fF=["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();function pF(e){const t=e.regex,n=sF(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:":("+dF.join("|")+")"},{begin:":(:)?("+fF.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+hF.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:uF.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...d,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+cF.join("|")+")\\b"}]}}function mF(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 gF(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 yF(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 bF(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},i=e.COMMENT();i.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const a={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},l={className:"literal",begin:/\bon|off|true|false|yes|no\b/},o={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},d={begin:/\[/,end:/\]/,contains:[i,l,a,o,n,"self"],relevance:0},f=/[A-Za-z0-9_-]+/,h=/"(\\"|[^"])*"/,g=/'[^']*'/,m=t.either(f,h,g),y=t.concat(m,"(\\s*\\.\\s*",m,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[i,{className:"section",begin:/\[+/,end:/\]+/},{begin:y,className:"attr",starts:{end:/$/,contains:[i,d,l,a,o,n]}}]}}var po="[0-9](_*[0-9])*",Rf=`\\.(${po})`,Lf="[0-9a-fA-F](_*[0-9a-fA-F])*",jE={className:"number",variants:[{begin:`(\\b(${po})((${Rf})|\\.)?|(${Rf}))[eE][+-]?(${po})[fFdD]?\\b`},{begin:`\\b(${po})((${Rf})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Rf})[fFdD]?\\b`},{begin:`\\b(${po})[fFdD]\\b`},{begin:`\\b0[xX]((${Lf})\\.?|(${Lf})?\\.(${Lf}))[pP][+-]?(${po})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Lf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Lj(e,t,n){return n===-1?"":e.replace(t,i=>Lj(e,t,n-1))}function xF(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+Lj("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),f={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},h={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},g={className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:f,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[g,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:f,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[h,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,jE,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},jE,h]}}const CE="[A-Za-z$_][0-9A-Za-z$_]*",vF=["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"],wF=["true","false","null","undefined","NaN","Infinity"],Ij=["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"],zj=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Pj=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],kF=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],EF=[].concat(Pj,Ij,zj);function SF(e){const t=e.regex,n=(Q,{after:G})=>{const L="</"+Q[0].slice(1);return Q.input.indexOf(L,G)!==-1},i=CE,a={begin:"<>",end:"</>"},l=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Q,G)=>{const L=Q[0].length+Q.index,z=Q.input[L];if(z==="<"||z===","){G.ignoreMatch();return}z===">"&&(n(Q,{after:L})||G.ignoreMatch());let V;const P=Q.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:CE,keyword:vF,literal:wF,built_in:EF,"variable.language":kF},f="[0-9](_?[0-9])*",h=`\\.(${f})`,g="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",m={className:"number",variants:[{begin:`(\\b(${g})((${h})|\\.)?|(${h}))[eE][+-]?(${f})\\b`},{begin:`\\b(${g})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:d,contains:[]},b={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},k={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"css"}},v={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},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},R={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},O={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Ij,...zj]}},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(Q){return t.concat("(?!",Q.join("|"),")")}const Y={match:t.concat(/\b/,q([...Pj,"super","import"].map(Q=>`${Q}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},D={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},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:O},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,O,{scope:"attr",match:i+t.lookahead(":"),relevance:0},H,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[C,e.REGEXP_MODE,{className:"function",begin: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,R,F,{match:/\$[(.]/}]}}function NF(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],a={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[t,n,e.QUOTE_STRING_MODE,a,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var mo="[0-9](_*[0-9])*",If=`\\.(${mo})`,zf="[0-9a-fA-F](_*[0-9a-fA-F])*",_F={className:"number",variants:[{begin:`(\\b(${mo})((${If})|\\.)?|(${If}))[eE][+-]?(${mo})[fFdD]?\\b`},{begin:`\\b(${mo})((${If})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${If})[fFdD]?\\b`},{begin:`\\b(${mo})[fFdD]\\b`},{begin:`\\b0[xX]((${zf})\\.?|(${zf})?\\.(${zf}))[pP][+-]?(${mo})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${zf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function jF(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},i={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},a={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},l={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[l,a]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,l,a]}]};a.contains.push(o);const d={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},f={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:"string"}),"self"]}]},h=_F,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
|
-
`},h]}}const CF=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_-]*/}}),AF=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],TF=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],MF=[...AF,...TF],DF=["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(),Bj=["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(),$j=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),OF=["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(),RF=Bj.concat($j).sort().reverse();function LF(e){const t=CF(e),n=RF,i="and or not only",a="[\\w-]+",l="("+a+"|@\\{"+a+"\\})",o=[],d=[],f=function(N){return{className:"string",begin:"~?"+N+".*?"+N}},h=function(N,_,T){return{className:N,begin:_,relevance:T}},g={$pattern:/[a-z-]+/,keyword:i,attribute:DF.join(" ")},m={begin:"\\(",end:"\\)",contains:d,keywords:g,relevance:0};d.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,f("'"),f('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,m,h("variable","@@?"+a,10),h("variable","@\\{"+a+"\\}"),h("built_in","~?`[^`]*?`"),{className:"attribute",begin:a+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const y=d.concat({begin:/\{/,end:/\}/,contains:o}),b={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(d)},k={begin:l+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+OF.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,h("keyword","all\\b"),h("variable","@\\{"+a+"\\}"),{begin:"\\b("+MF.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,h("selector-tag",l,0),h("selector-id","#"+l),h("selector-class","\\."+l,0),h("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+Bj.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+$j.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 IF(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 zF(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 PF(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},a={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},l={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},d=/[A-Za-z][A-Za-z0-9+.-]*/,f={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,d,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},h={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},g={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},m=e.inherit(h,{contains:[]}),y=e.inherit(g,{contains:[]});h.contains.push(y),g.contains.push(m);let b=[n,f];return[h,g,m,y].forEach(E=>{E.contains=E.contains.concat(b)}),b=b.concat(h,g),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:b},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:b}]}]},n,l,h,g,{className:"quote",begin:"^>\\s+",contains:b,end:"$"},a,i,f,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function BF(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 $F(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],i=/[dualxmsipngr]{0,12}/,a={$pattern:/[\w.]+/,keyword:n.join(" ")},l={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:a},o={begin:/->\{/,end:/\}/},d={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},f={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[d]},h={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},g=[e.BACKSLASH_ESCAPE,l,f],m=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],y=(v,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}]},h,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:y("s|tr|y",t.either(...m,{capture:!0}))},{begin:y("s|tr|y","\\(","\\)")},{begin:y("s|tr|y","\\[","\\]")},{begin:y("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:b("(?:m|qr)?",/\//,/\//)},{begin:b("m|qr",t.either(...m,{capture:!0}),/\1/)},{begin:b("m|qr",/\(/,/\)/)},{begin:b("m|qr",/\[/,/\]/)},{begin:b("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,d]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,d,h]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return l.contains=k,o.contains=k,{name:"Perl",aliases:["pl","pm"],keywords:a,contains:k}}function UF(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,i=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),a=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),l=t.concat(/[A-Z]+/,n),o={scope:"variable",match:"\\$+"+i},d={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},f={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},h=e.inherit(e.APOS_STRING_MODE,{illegal:null}),g=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(f)}),m={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(f),"on:begin":(D,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,h,m,y]},v={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},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"}}]},R=t.concat(i,"\\b(?!\\()"),O={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),R],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[a,t.concat(/::/,t.lookahead(/(?!class\b)/)),R],scope:{1:"title.class",3:"variable.constant"}},{match:[a,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[a,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},B={scope:"attr",match:t.concat(i,t.lookahead(":"),t.lookahead(/(?!::)/))},U={relevance:0,begin:/\(/,end:/\)/,keywords:_,contains:[B,o,O,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,O,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,O,{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,O,e.C_BLOCK_COMMENT_MODE,k,v]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},k,v]}}function FF(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 qF(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function HF(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],d={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},f={className:"meta",begin:/^(>>>|\.\.\.) /},h={className:"subst",begin:/\{/,end:/\}/,keywords:d,illegal:/#/},g={begin:/\{\{/,relevance:0},m={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,f],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,f],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,f,g,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,f,g,h]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,g,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,g,h]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},y="[0-9](_?[0-9])*",b=`(\\b(${y}))?\\.(${y})|\\b(${y})\\.`,k=`\\b|${i.join("|")}`,v={className:"number",relevance:0,variants:[{begin:`(\\b(${y})|(${b}))[eE][+-]?(${y})[jJ]?(?=${k})`},{begin:`(${b})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${k})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${k})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${k})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${k})`},{begin:`\\b(${y})[jJ](?=${k})`}]},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 h.contains=[m,v,f],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:d,illegal:/(<\/|\?)|=>/,contains:[f,v,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},m,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 KF(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function GF(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 VF(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),a=t.concat(i,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},d={className:"doctag",begin:"@[A-Za-z]+"},f={begin:"#<",end:">"},h=[e.COMMENT("#","$",{contains:[d]}),e.COMMENT("^=begin","^=end",{contains:[d],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],g={className:"subst",begin:/#\{/,end:/\}/,keywords:o},m={className:"string",contains:[e.BACKSLASH_ESCAPE,g],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,g]})]}]},y="[1-9](_?[0-9])*|0",b="[0-9](_?[0-9])*",k={className:"number",relevance:0,variants:[{begin:`\\b(${y})(\\.(${b}))?([eE][+-]?(${b})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},v={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},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,h),relevance:0}].concat(f,h);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 h.unshift(f),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(U).concat(h).concat(M)}}function YF(e){const t=e.regex,n=/(r#)?/,i=t.concat(n,e.UNDERSCORE_IDENT_RE),a=t.concat(n,e.IDENT_RE),l={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,a,t.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",d=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],f=["true","false","Some","None","Ok","Err"],h=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],g=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:g,keyword:d,literal:f,built_in:h},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+o},{begin:"\\b0o([0-7_]+)"+o},{begin:"\\b0x([A-Fa-f0-9_]+)"+o},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+o}],relevance:0},{begin:[/fn/,/\s+/,i],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,i],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,i,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:h,type:g}},{className:"punctuation",begin:"->"},l]}}const QF=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_-]*/}}),WF=["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"],ZF=[...WF,...XF],JF=["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(),e8=["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(),t8=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),n8=["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 i8(e){const t=QF(e),n=t8,i=e8,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("+ZF.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("+n8.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:JF.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 r8(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function a8(e){const t=e.regex,n=e.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},a={begin:/"/,end:/"/,contains:[{match:/""/}]},l=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],d=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],f=["add","asc","collation","desc","final","first","last","view"],h=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],g=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],m=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],y=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],b=g,k=[...h,...f].filter(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:R}={}){const O=R;return M=M||[],T.map(B=>B.match(/\|\d+$/)||M.includes(B)?B:O(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 Uj(e){return e?typeof e=="string"?e:e.source:null}function au(e){return Ut("(?=",e,")")}function Ut(...e){return e.map(n=>Uj(n)).join("")}function s8(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"("+(s8(e).capture?"":"?:")+e.map(i=>Uj(i)).join("|")+")"}const Ix=e=>Ut(/\b/,e,/\w$/.test(e)?/\b/:/\B/),l8=["Protocol","Type"].map(Ix),AE=["init","self"].map(Ix),o8=["Any","Self"],ry=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],TE=["false","nil","true"],c8=["assignment","associativity","higherThan","left","lowerThan","none","right"],u8=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],ME=["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"],Fj=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]/),qj=Jn(Fj,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),ay=Ut(Fj,qj,"*"),Hj=Jn(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Eh=Jn(Hj,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),_r=Ut(Hj,Eh,"*"),Pf=Ut(/[A-Z]/,Eh,"*"),d8=["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"],f8=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function h8(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[e.C_LINE_COMMENT_MODE,n],a={match:[/\./,Jn(...l8,...AE)],className:{2:"keyword"}},l={match:Ut(/\./,Jn(...ry)),relevance:0},o=ry.filter(pe=>typeof pe=="string").concat(["_|0"]),d=ry.filter(pe=>typeof pe!="string").concat(o8).map(Ix),f={variants:[{className:"keyword",match:Jn(...d,...AE)}]},h={$pattern:Jn(/\b\w+/,/#\w+/),keyword:o.concat(u8),literal:TE},g=[a,l,f],m={match:Ut(/\./,Jn(...ME)),relevance:0},y={className:"built_in",match:Ut(/\b/,Jn(...ME),/(?=\()/)},b=[m,y],k={match:/->/,relevance:0},v={className:"operator",relevance:0,variants:[{match:ay},{match:`\\.(\\.|${qj})+`}]},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/}]},_=(pe="")=>({className:"subst",variants:[{match:Ut(/\\/,pe,/[0\\tnr"']/)},{match:Ut(/\\/,pe,/u\{[0-9a-fA-F]{1,8}\}/)}]}),T=(pe="")=>({className:"subst",match:Ut(/\\/,pe,/[\t ]*(?:[\r\n]|\r\n)/)}),M=(pe="")=>({className:"subst",label:"interpol",begin:Ut(/\\/,pe,/\(/),end:/\)/}),R=(pe="")=>({begin:Ut(pe,/"""/),end:Ut(/"""/,pe),contains:[_(pe),T(pe),M(pe)]}),O=(pe="")=>({begin:Ut(pe,/"/),end:Ut(/"/,pe),contains:[_(pe),M(pe)]}),B={className:"string",variants:[R(),R("#"),R("##"),R("###"),O(),O("#"),O("##"),O("###")]},U=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],K={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:U},q=pe=>{const Fe=Ut(pe,/\//),ze=Ut(/\//,pe);return{begin:Fe,end:ze,contains:[...U,{scope:"comment",begin:`#(?!.*${ze})`,end:/$/}]}},Y={scope:"regexp",variants:[q("###"),q("##"),q("#"),K]},D={match:Ut(/`/,_r,/`/)},F={className:"variable",match:/\$\d+/},I={className:"variable",match:`\\$${Eh}+`},H=[D,F,I],Q={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:f8,contains:[...S,N,B]}]}},G={scope:"keyword",match:Ut(/@/,Jn(...d8),au(Jn(/\(/,/\s+/)))},L={scope:"meta",match:Ut(/@/,_r)},z=[Q,G,L],V={match:au(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Ut(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Eh,"+")},{className:"type",match:Pf,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Ut(/\s+&\s+/,au(Pf)),relevance:0}]},P={begin:/</,end:/>/,keywords:h,contains:[...i,...g,...z,k,V]};V.contains.push(P);const le={match:Ut(_r,/\s*:/),keywords:"_|0",relevance:0},ve={begin:/\(/,end:/\)/,relevance:0,keywords:h,contains:["self",le,...i,Y,...g,...b,...S,N,B,...H,...z,V]},ke={begin:/</,end:/>/,keywords:"repeat each",contains:[...i,V]},Se={begin:Jn(au(Ut(_r,/\s*:/)),au(Ut(_r,/\s+/,_r,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:_r}]},J={begin:/\(/,end:/\)/,keywords:h,contains:[Se,...i,...g,...S,N,B,...z,V,ve],endsParent:!0,illegal:/["']/},ue={match:[/(func|macro)/,/\s+/,Jn(D.match,_r,ay)],className:{1:"keyword",3:"title.function"},contains:[ke,J,t],illegal:[/\[/,/%/]},Te={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ke,J,t],illegal:/\[|%/},Re={match:[/operator/,/\s+/,ay],className:{1:"keyword",3:"title"}},Oe={begin:[/precedencegroup/,/\s+/,Pf],className:{1:"keyword",3:"title"},contains:[V],keywords:[...c8,...TE],end:/}/},ce={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Ce={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},te={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,_r,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:h,contains:[ke,...g,{begin:/:/,end:/\{/,keywords:h,contains:[{scope:"title.class.inherited",match:Pf},...g],relevance:0}]};for(const pe of B.variants){const Fe=pe.contains.find(ae=>ae.label==="interpol");Fe.keywords=h;const ze=[...g,...b,...S,N,B,...H];Fe.contains=[...ze,{begin:/\(/,end:/\)/,contains:["self",...ze]}]}return{name:"Swift",keywords:h,contains:[...i,ue,Te,ce,Ce,te,Re,Oe,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},Y,...g,...b,...S,N,B,...H,...z,V,ve]}}const Sh="[A-Za-z$_][0-9A-Za-z$_]*",Kj=["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"],Gj=["true","false","null","undefined","NaN","Infinity"],Vj=["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"],Yj=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Qj=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Wj=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Xj=[].concat(Qj,Vj,Yj);function p8(e){const t=e.regex,n=(Q,{after:G})=>{const L="</"+Q[0].slice(1);return Q.input.indexOf(L,G)!==-1},i=Sh,a={begin:"<>",end:"</>"},l=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Q,G)=>{const L=Q[0].length+Q.index,z=Q.input[L];if(z==="<"||z===","){G.ignoreMatch();return}z===">"&&(n(Q,{after:L})||G.ignoreMatch());let V;const P=Q.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:Sh,keyword:Kj,literal:Gj,built_in:Xj,"variable.language":Wj},f="[0-9](_?[0-9])*",h=`\\.(${f})`,g="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",m={className:"number",variants:[{begin:`(\\b(${g})((${h})|\\.)?|(${h}))[eE][+-]?(${f})\\b`},{begin:`\\b(${g})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:d,contains:[]},b={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},k={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"css"}},v={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},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},R={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},O={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Vj,...Yj]}},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(Q){return t.concat("(?!",Q.join("|"),")")}const Y={match:t.concat(/\b/,q([...Qj,"super","import"].map(Q=>`${Q}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},D={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},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:O},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,O,{scope:"attr",match:i+t.lookahead(":"),relevance:0},H,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[C,e.REGEXP_MODE,{className:"function",begin: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,R,F,{match:/\$[(.]/}]}}function m8(e){const t=e.regex,n=p8(e),i=Sh,a=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],l={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:a},contains:[n.exports.CLASS_REFERENCE]},d={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},f=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],h={$pattern:Sh,keyword:Kj.concat(f),literal:Gj,built_in:Xj.concat(a),"variable.language":Wj},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,h),n.exports.PARAMS_CONTAINS.push(g);const y=n.contains.find(v=>v.scope==="attr"),b=Object.assign({},y,{match:t.concat(i,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,y,b]),n.contains=n.contains.concat([g,l,o,b]),m(n,"shebang",e.SHEBANG()),m(n,"use_strict",d);const k=n.contains.find(v=>v.label==="func.def");return k.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function g8(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},i={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},a=/\d{1,2}\/\d{1,2}\/\d{4}/,l=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,d=/\d{1,2}(:\d{1,2}){1,2}/,f={className:"literal",variants:[{begin:t.concat(/# */,t.either(l,a),/ *#/)},{begin:t.concat(/# */,d,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(l,a),/ +/,t.either(o,d),/ *#/)}]},h={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},g={className:"label",begin:/^\w+:/},m=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),y=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,i,f,h,g,m,y,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[y]}]}}function y8(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),i=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],a={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},l={className:"variable",begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},d={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},f={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},h={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:i},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},l,o,a,e.QUOTE_STRING_MODE,f,h,d]}}function b8(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,a={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},l={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(l,{begin:/\(/,end:/\)/}),d=e.inherit(e.APOS_STRING_MODE,{className:"string"}),f=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),h={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:i,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[a]},{begin:/'/,end:/'/,contains:[a]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[l,f,d,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[l,o,f,d]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},a,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[f]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[h],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[h],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:h}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function x8(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 v8={arduino:tF,bash:nF,c:iF,cpp:rF,csharp:aF,css:pF,diff:mF,go:gF,graphql:yF,ini:bF,java:xF,javascript:SF,json:NF,kotlin:jF,less:LF,lua:IF,makefile:zF,markdown:PF,objectivec:BF,perl:$F,php:UF,"php-template":FF,plaintext:qF,python:HF,"python-repl":KF,r:GF,ruby:VF,rust:YF,scss:i8,shell:r8,sql:a8,swift:h8,typescript:m8,vbnet:g8,wasm:y8,xml:b8,yaml:x8};var sy,DE;function w8(){if(DE)return sy;DE=1;function e(Z){return Z instanceof Map?Z.clear=Z.delete=Z.set=function(){throw new Error("map is read-only")}:Z instanceof Set&&(Z.add=Z.clear=Z.delete=function(){throw new Error("set is read-only")}),Object.freeze(Z),Object.getOwnPropertyNames(Z).forEach(ge=>{const Me=Z[ge],it=typeof Me;(it==="object"||it==="function")&&!Object.isFrozen(Me)&&e(Me)}),Z}class t{constructor(ge){ge.data===void 0&&(ge.data={}),this.data=ge.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(Z){return Z.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function i(Z,...ge){const Me=Object.create(null);for(const it in Z)Me[it]=Z[it];return ge.forEach(function(it){for(const qt in it)Me[qt]=it[qt]}),Me}const a="</span>",l=Z=>!!Z.scope,o=(Z,{prefix:ge})=>{if(Z.startsWith("language:"))return Z.replace("language:","language-");if(Z.includes(".")){const Me=Z.split(".");return[`${ge}${Me.shift()}`,...Me.map((it,qt)=>`${it}${"_".repeat(qt+1)}`)].join(" ")}return`${ge}${Z}`};class d{constructor(ge,Me){this.buffer="",this.classPrefix=Me.classPrefix,ge.walk(this)}addText(ge){this.buffer+=n(ge)}openNode(ge){if(!l(ge))return;const Me=o(ge.scope,{prefix:this.classPrefix});this.span(Me)}closeNode(ge){l(ge)&&(this.buffer+=a)}value(){return this.buffer}span(ge){this.buffer+=`<span class="${ge}">`}}const f=(Z={})=>{const ge={children:[]};return Object.assign(ge,Z),ge};class h{constructor(){this.rootNode=f(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(ge){this.top.children.push(ge)}openNode(ge){const Me=f({scope:ge});this.add(Me),this.stack.push(Me)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(ge){return this.constructor._walk(ge,this.rootNode)}static _walk(ge,Me){return typeof Me=="string"?ge.addText(Me):Me.children&&(ge.openNode(Me),Me.children.forEach(it=>this._walk(ge,it)),ge.closeNode(Me)),ge}static _collapse(ge){typeof ge!="string"&&ge.children&&(ge.children.every(Me=>typeof Me=="string")?ge.children=[ge.children.join("")]:ge.children.forEach(Me=>{h._collapse(Me)}))}}class g extends h{constructor(ge){super(),this.options=ge}addText(ge){ge!==""&&this.add(ge)}startScope(ge){this.openNode(ge)}endScope(){this.closeNode()}__addSublanguage(ge,Me){const it=ge.root;Me&&(it.scope=`language:${Me}`),this.add(it)}toHTML(){return new d(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function m(Z){return Z?typeof Z=="string"?Z:Z.source:null}function y(Z){return v("(?=",Z,")")}function b(Z){return v("(?:",Z,")*")}function k(Z){return v("(?:",Z,")?")}function v(...Z){return Z.map(Me=>m(Me)).join("")}function S(Z){const ge=Z[Z.length-1];return typeof ge=="object"&&ge.constructor===Object?(Z.splice(Z.length-1,1),ge):{}}function E(...Z){return"("+(S(Z).capture?"":"?:")+Z.map(it=>m(it)).join("|")+")"}function C(Z){return new RegExp(Z.toString()+"|").exec("").length-1}function N(Z,ge){const Me=Z&&Z.exec(ge);return Me&&Me.index===0}const _=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function T(Z,{joinWith:ge}){let Me=0;return Z.map(it=>{Me+=1;const qt=Me;let Ot=m(it),Ue="";for(;Ot.length>0;){const Pe=_.exec(Ot);if(!Pe){Ue+=Ot;break}Ue+=Ot.substring(0,Pe.index),Ot=Ot.substring(Pe.index+Pe[0].length),Pe[0][0]==="\\"&&Pe[1]?Ue+="\\"+String(Number(Pe[1])+qt):(Ue+=Pe[0],Pe[0]==="("&&Me++)}return Ue}).map(it=>`(${it})`).join(ge)}const M=/\b\B/,R="[a-zA-Z]\\w*",O="[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 ge=/^#![ ]*\//;return Z.binary&&(Z.begin=v(ge,/.*\b/,Z.binary,/\b.*/)),i({scope:"meta",begin:ge,end:/$/,relevance:0,"on:begin":(Me,it)=>{Me.index!==0&&it.ignoreMatch()}},Z)},D={begin:"\\\\[\\s\\S]",relevance:0},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/},Q=function(Z,ge,Me={}){const it=i({scope:"comment",begin:Z,end:ge,contains:[]},Me);it.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const 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=Q("//","$"),L=Q("/\\*","\\*/"),z=Q("#","$"),V={scope:"number",begin:B,relevance:0},P={scope:"number",begin:U,relevance:0},le={scope:"number",begin:K,relevance:0},ve={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[D,{begin:/\[/,end:/\]/,relevance:0,contains:[D]}]},ke={scope:"title",begin:R,relevance:0},Se={scope:"title",begin:O,relevance:0},J={begin:"\\.\\s*"+O,relevance:0};var Te=Object.freeze({__proto__:null,APOS_STRING_MODE:F,BACKSLASH_ESCAPE:D,BINARY_NUMBER_MODE:le,BINARY_NUMBER_RE:K,COMMENT:Q,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":(ge,Me)=>{Me.data._beginMatch=ge[1]},"on:end":(ge,Me)=>{Me.data._beginMatch!==ge[1]&&Me.ignoreMatch()}})},HASH_COMMENT_MODE:z,IDENT_RE:R,MATCH_NOTHING_RE:M,METHOD_GUARD:J,NUMBER_MODE:V,NUMBER_RE:B,PHRASAL_WORDS_MODE:H,QUOTE_STRING_MODE:I,REGEXP_MODE:ve,RE_STARTERS_RE:q,SHEBANG:Y,TITLE_MODE:ke,UNDERSCORE_IDENT_RE:O,UNDERSCORE_TITLE_MODE:Se});function Re(Z,ge){Z.input[Z.index-1]==="."&&ge.ignoreMatch()}function Oe(Z,ge){Z.className!==void 0&&(Z.scope=Z.className,delete Z.className)}function ce(Z,ge){ge&&Z.beginKeywords&&(Z.begin="\\b("+Z.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",Z.__beforeBegin=Re,Z.keywords=Z.keywords||Z.beginKeywords,delete Z.beginKeywords,Z.relevance===void 0&&(Z.relevance=0))}function Ce(Z,ge){Array.isArray(Z.illegal)&&(Z.illegal=E(...Z.illegal))}function te(Z,ge){if(Z.match){if(Z.begin||Z.end)throw new Error("begin & end are not supported with match");Z.begin=Z.match,delete Z.match}}function pe(Z,ge){Z.relevance===void 0&&(Z.relevance=1)}const Fe=(Z,ge)=>{if(!Z.beforeMatch)return;if(Z.starts)throw new Error("beforeMatch cannot be used with starts");const Me=Object.assign({},Z);Object.keys(Z).forEach(it=>{delete Z[it]}),Z.keywords=Me.keywords,Z.begin=v(Me.beforeMatch,y(Me.begin)),Z.starts={relevance:0,contains:[Object.assign(Me,{endsParent:!0})]},Z.relevance=0,delete Me.beforeMatch},ze=["of","and","for","in","not","or","if","then","parent","list","value"],ae="keyword";function be(Z,ge,Me=ae){const it=Object.create(null);return typeof Z=="string"?qt(Me,Z.split(" ")):Array.isArray(Z)?qt(Me,Z):Object.keys(Z).forEach(function(Ot){Object.assign(it,be(Z[Ot],ge,Ot))}),it;function qt(Ot,Ue){ge&&(Ue=Ue.map(Pe=>Pe.toLowerCase())),Ue.forEach(function(Pe){const et=Pe.split("|");it[et[0]]=[Ot,ye(et[0],et[1])]})}}function ye(Z,ge){return ge?Number(ge):he(Z)?0:1}function he(Z){return ze.includes(Z.toLowerCase())}const Ee={},Ne=Z=>{console.error(Z)},Ke=(Z,...ge)=>{console.log(`WARN: ${Z}`,...ge)},ne=(Z,ge)=>{Ee[`${Z}/${ge}`]||(console.log(`Deprecated as of ${Z}. ${ge}`),Ee[`${Z}/${ge}`]=!0)},de=new Error;function Le(Z,ge,{key:Me}){let it=0;const qt=Z[Me],Ot={},Ue={};for(let Pe=1;Pe<=ge.length;Pe++)Ue[Pe+it]=qt[Pe],Ot[Pe+it]=!0,it+=C(ge[Pe-1]);Z[Me]=Ue,Z[Me]._emit=Ot,Z[Me]._multi=!0}function Ze(Z){if(Array.isArray(Z.begin)){if(Z.skip||Z.excludeBegin||Z.returnBegin)throw Ne("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),de;if(typeof Z.beginScope!="object"||Z.beginScope===null)throw Ne("beginScope must be object"),de;Le(Z,Z.begin,{key:"beginScope"}),Z.begin=T(Z.begin,{joinWith:""})}}function rt(Z){if(Array.isArray(Z.end)){if(Z.skip||Z.excludeEnd||Z.returnEnd)throw Ne("skip, excludeEnd, returnEnd not compatible with endScope: {}"),de;if(typeof Z.endScope!="object"||Z.endScope===null)throw Ne("endScope must be object"),de;Le(Z,Z.end,{key:"endScope"}),Z.end=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 ge(Ue,Pe){return new RegExp(m(Ue),"m"+(Z.case_insensitive?"i":"")+(Z.unicodeRegex?"u":"")+(Pe?"g":""))}class Me{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Pe,et){et.position=this.position++,this.matchIndexes[this.matchAt]=et,this.regexes.push([et,Pe]),this.matchAt+=C(Pe)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Pe=this.regexes.map(et=>et[1]);this.matcherRe=ge(T(Pe,{joinWith:"|"}),!0),this.lastIndex=0}exec(Pe){this.matcherRe.lastIndex=this.lastIndex;const et=this.matcherRe.exec(Pe);if(!et)return null;const rn=et.findIndex((Wi,ka)=>ka>0&&Wi!==void 0),Vt=this.matchIndexes[rn];return et.splice(0,rn),Object.assign(et,Vt)}}class it{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Pe){if(this.multiRegexes[Pe])return this.multiRegexes[Pe];const et=new Me;return this.rules.slice(Pe).forEach(([rn,Vt])=>et.addRule(rn,Vt)),et.compile(),this.multiRegexes[Pe]=et,et}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Pe,et){this.rules.push([Pe,et]),et.type==="begin"&&this.count++}exec(Pe){const et=this.getMatcher(this.regexIndex);et.lastIndex=this.lastIndex;let rn=et.exec(Pe);if(this.resumingScanAtSamePosition()&&!(rn&&rn.index===this.lastIndex)){const Vt=this.getMatcher(0);Vt.lastIndex=this.lastIndex+1,rn=Vt.exec(Pe)}return rn&&(this.regexIndex+=rn.position+1,this.regexIndex===this.count&&this.considerAll()),rn}}function qt(Ue){const Pe=new it;return Ue.contains.forEach(et=>Pe.addRule(et.begin,{rule:et,type:"begin"})),Ue.terminatorEnd&&Pe.addRule(Ue.terminatorEnd,{type:"end"}),Ue.illegal&&Pe.addRule(Ue.illegal,{type:"illegal"}),Pe}function Ot(Ue,Pe){const et=Ue;if(Ue.isCompiled)return et;[Oe,te,$n,Fe].forEach(Vt=>Vt(Ue,Pe)),Z.compilerExtensions.forEach(Vt=>Vt(Ue,Pe)),Ue.__beforeBegin=null,[ce,Ce,pe].forEach(Vt=>Vt(Ue,Pe)),Ue.isCompiled=!0;let rn=null;return typeof Ue.keywords=="object"&&Ue.keywords.$pattern&&(Ue.keywords=Object.assign({},Ue.keywords),rn=Ue.keywords.$pattern,delete Ue.keywords.$pattern),rn=rn||/\w+/,Ue.keywords&&(Ue.keywords=be(Ue.keywords,Z.case_insensitive)),et.keywordPatternRe=ge(rn,!0),Pe&&(Ue.begin||(Ue.begin=/\B|\b/),et.beginRe=ge(et.begin),!Ue.end&&!Ue.endsWithParent&&(Ue.end=/\B|\b/),Ue.end&&(et.endRe=ge(et.end)),et.terminatorEnd=m(et.end)||"",Ue.endsWithParent&&Pe.terminatorEnd&&(et.terminatorEnd+=(Ue.end?"|":"")+Pe.terminatorEnd)),Ue.illegal&&(et.illegalRe=ge(Ue.illegal)),Ue.contains||(Ue.contains=[]),Ue.contains=[].concat(...Ue.contains.map(function(Vt){return Qt(Vt==="self"?Ue:Vt)})),Ue.contains.forEach(function(Vt){Ot(Vt,et)}),Ue.starts&&Ot(Ue.starts,Pe),et.matcher=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 Qt(Z){return Z.variants&&!Z.cachedVariants&&(Z.cachedVariants=Z.variants.map(function(ge){return i(Z,{variants:null},ge)})),Z.cachedVariants?Z.cachedVariants:Mt(Z)?i(Z,{starts:Z.starts?i(Z.starts):null}):Object.isFrozen(Z)?i(Z):Z}var yt="11.11.1";class Ti extends Error{constructor(ge,Me){super(ge),this.name="HTMLInjectionError",this.html=Me}}const Rn=n,Nl=i,Pr=Symbol("nomatch"),wa=7,Br=function(Z){const ge=Object.create(null),Me=Object.create(null),it=[];let qt=!0;const Ot="Could not find the language '{}', did you forget to load/include a language module?",Ue={disableAutodetect:!0,name:"Plain text",contains:[]};let Pe={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:g};function et(_e){return Pe.noHighlightRe.test(_e)}function rn(_e){let Ve=_e.className+" ";Ve+=_e.parentNode?_e.parentNode.className:"";const ht=Pe.languageDetectRe.exec(Ve);if(ht){const _t=Ln(ht[1]);return _t||(Ke(Ot.replace("{}",ht[1])),Ke("Falling back to no-highlight mode for this block.",_e)),_t?ht[1]:"no-highlight"}return Ve.split(/\s+/).find(_t=>et(_t)||Ln(_t))}function Vt(_e,Ve,ht){let _t="",sn="";typeof Ve=="object"?(_t=_e,ht=Ve.ignoreIllegals,sn=Ve.language):(ne("10.7.0","highlight(lang, code, ...args) has been deprecated."),ne("10.7.0",`Please use highlight(code, options) instead.
|
|
654
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),sn=_e,_t=Ve),ht===void 0&&(ht=!0);const Mn={code:_t,language:sn};Ur("before:highlight",Mn);const Qn=Mn.result?Mn.result:Wi(Mn.language,Mn.code,ht);return Qn.code=Mn.code,Ur("after:highlight",Qn),Qn}function Wi(_e,Ve,ht,_t){const sn=Object.create(null);function Mn(Ae,qe){return Ae.keywords[qe]}function Qn(){if(!nt.keywords){xn.addText(Rt);return}let Ae=0;nt.keywordPatternRe.lastIndex=0;let qe=nt.keywordPatternRe.exec(Rt),lt="";for(;qe;){lt+=Rt.substring(Ae,qe.index);const bt=_n.case_insensitive?qe[0].toLowerCase():qe[0],ln=Mn(nt,bt);if(ln){const[Di,cc]=ln;if(xn.addText(lt),lt="",sn[bt]=(sn[bt]||0)+1,sn[bt]<=wa&&(Aa+=cc),Di.startsWith("_"))lt+=qe[0];else{const cd=_n.classNameAliases[Di]||Di;Wn(qe[0],cd)}}else lt+=qe[0];Ae=nt.keywordPatternRe.lastIndex,qe=nt.keywordPatternRe.exec(Rt)}lt+=Rt.substring(Ae),xn.addText(lt)}function Fn(){if(Rt==="")return;let Ae=null;if(typeof nt.subLanguage=="string"){if(!ge[nt.subLanguage]){xn.addText(Rt);return}Ae=Wi(nt.subLanguage,Rt,!0,od[nt.subLanguage]),od[nt.subLanguage]=Ae._top}else Ae=Ea(Rt,nt.subLanguage.length?nt.subLanguage:null);nt.relevance>0&&(Aa+=Ae.relevance),xn.__addSublanguage(Ae._emitter,Ae.language)}function zt(){nt.subLanguage!=null?Fn():Qn(),Rt=""}function Wn(Ae,qe){Ae!==""&&(xn.startScope(qe),xn.addText(Ae),xn.endScope())}function Cl(Ae,qe){let lt=1;const bt=qe.length-1;for(;lt<=bt;){if(!Ae._emit[lt]){lt++;continue}const ln=_n.classNameAliases[Ae[lt]]||Ae[lt],Di=qe[lt];ln?Wn(Di,ln):(Rt=Di,Qn(),Rt=""),lt++}}function _a(Ae,qe){return Ae.scope&&typeof Ae.scope=="string"&&xn.openNode(_n.classNameAliases[Ae.scope]||Ae.scope),Ae.beginScope&&(Ae.beginScope._wrap?(Wn(Rt,_n.classNameAliases[Ae.beginScope._wrap]||Ae.beginScope._wrap),Rt=""):Ae.beginScope._multi&&(Cl(Ae.beginScope,qe),Rt="")),nt=Object.create(Ae,{parent:{value:nt}}),nt}function vr(Ae,qe,lt){let bt=N(Ae.endRe,lt);if(bt){if(Ae["on:end"]){const ln=new t(Ae);Ae["on:end"](qe,ln),ln.isMatchIgnored&&(bt=!1)}if(bt){for(;Ae.endsParent&&Ae.parent;)Ae=Ae.parent;return Ae}}if(Ae.endsWithParent)return vr(Ae.parent,qe,lt)}function ja(Ae){return nt.matcher.regexIndex===0?(Rt+=Ae[0],1):(Ta=!0,0)}function Al(Ae){const qe=Ae[0],lt=Ae.rule,bt=new t(lt),ln=[lt.__beforeBegin,lt["on:begin"]];for(const Di of ln)if(Di&&(Di(Ae,bt),bt.isMatchIgnored))return ja(qe);return lt.skip?Rt+=qe:(lt.excludeBegin&&(Rt+=qe),zt(),!lt.returnBegin&&!lt.excludeBegin&&(Rt=qe)),_a(lt,Ae),lt.returnBegin?0:qe.length}function qn(Ae){const qe=Ae[0],lt=Ve.substring(Ae.index),bt=vr(nt,Ae,lt);if(!bt)return Pr;const ln=nt;nt.endScope&&nt.endScope._wrap?(zt(),Wn(qe,nt.endScope._wrap)):nt.endScope&&nt.endScope._multi?(zt(),Cl(nt.endScope,Ae)):ln.skip?Rt+=qe:(ln.returnEnd||ln.excludeEnd||(Rt+=qe),zt(),ln.excludeEnd&&(Rt=qe));do nt.scope&&xn.closeNode(),!nt.skip&&!nt.subLanguage&&(Aa+=nt.relevance),nt=nt.parent;while(nt!==bt.parent);return bt.starts&&_a(bt.starts,Ae),ln.returnEnd?0:qe.length}function Cs(){const Ae=[];for(let qe=nt;qe!==_n;qe=qe.parent)qe.scope&&Ae.unshift(qe.scope);Ae.forEach(qe=>xn.openNode(qe))}let tr={};function Ca(Ae,qe){const lt=qe&&qe[0];if(Rt+=Ae,lt==null)return zt(),0;if(tr.type==="begin"&&qe.type==="end"&&tr.index===qe.index&<===""){if(Rt+=Ve.slice(qe.index,qe.index+1),!qt){const bt=new Error(`0 width match regex (${_e})`);throw bt.languageName=_e,bt.badRule=tr.rule,bt}return 1}if(tr=qe,qe.type==="begin")return Al(qe);if(qe.type==="illegal"&&!ht){const bt=new Error('Illegal lexeme "'+lt+'" for mode "'+(nt.scope||"<unnamed>")+'"');throw bt.mode=nt,bt}else if(qe.type==="end"){const bt=qn(qe);if(bt!==Pr)return bt}if(qe.type==="illegal"&<==="")return Rt+=`
|
|
655
|
-
`,1;if(oc>1e5&&oc>qe.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Rt+=lt,lt.length}const _n=Ln(_e);if(!_n)throw Ne(Ot.replace("{}",_e)),new Error('Unknown language: "'+_e+'"');const As=dn(_n);let Tl="",nt=_t||As;const od={},xn=new Pe.__emitter(Pe);Cs();let Rt="",Aa=0,Fr=0,oc=0,Ta=!1;try{if(_n.__emitTokens)_n.__emitTokens(Ve,xn);else{for(nt.matcher.considerAll();;){oc++,Ta?Ta=!1:nt.matcher.considerAll(),nt.matcher.lastIndex=Fr;const Ae=nt.matcher.exec(Ve);if(!Ae)break;const qe=Ve.substring(Fr,Ae.index),lt=Ca(qe,Ae);Fr=Ae.index+lt}Ca(Ve.substring(Fr))}return xn.finalize(),Tl=xn.toHTML(),{language:_e,value:Tl,relevance:Aa,illegal:!1,_emitter:xn,_top:nt}}catch(Ae){if(Ae.message&&Ae.message.includes("Illegal"))return{language:_e,value:Rn(Ve),illegal:!0,relevance:0,_illegalBy:{message:Ae.message,index:Fr,context:Ve.slice(Fr-100,Fr+100),mode:Ae.mode,resultSoFar:Tl},_emitter:xn};if(qt)return{language:_e,value:Rn(Ve),illegal:!1,relevance:0,errorRaised:Ae,_emitter:xn,_top:nt};throw Ae}}function ka(_e){const Ve={value:Rn(_e),illegal:!1,relevance:0,_top:Ue,_emitter:new Pe.__emitter(Pe)};return Ve._emitter.addText(_e),Ve}function Ea(_e,Ve){Ve=Ve||Pe.languages||Object.keys(ge);const ht=ka(_e),_t=Ve.filter(Ln).filter(Ji).map(zt=>Wi(zt,_e,!1));_t.unshift(ht);const sn=_t.sort((zt,Wn)=>{if(zt.relevance!==Wn.relevance)return Wn.relevance-zt.relevance;if(zt.language&&Wn.language){if(Ln(zt.language).supersetOf===Wn.language)return 1;if(Ln(Wn.language).supersetOf===zt.language)return-1}return 0}),[Mn,Qn]=sn,Fn=Mn;return Fn.secondBest=Qn,Fn}function Mi(_e,Ve,ht){const _t=Ve&&Me[Ve]||ht;_e.classList.add("hljs"),_e.classList.add(`language-${_t}`)}function an(_e){let Ve=null;const ht=rn(_e);if(et(ht))return;if(Ur("before:highlightElement",{el:_e,language:ht}),_e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",_e);return}if(_e.children.length>0&&(Pe.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(_e)),Pe.throwUnescapedHTML))throw new Ti("One of your code blocks includes unescaped HTML.",_e.innerHTML);Ve=_e;const _t=Ve.textContent,sn=ht?Vt(_t,{language:ht,ignoreIllegals:!0}):Ea(_t);_e.innerHTML=sn.value,_e.dataset.highlighted="yes",Mi(_e,ht,sn.language),_e.result={language:sn.language,re:sn.relevance,relevance:sn.relevance},sn.secondBest&&(_e.secondBest={language:sn.secondBest.language,relevance:sn.secondBest.relevance}),Ur("after:highlightElement",{el:_e,result:sn,text:_t})}function Tn(_e){Pe=Nl(Pe,_e)}const Xi=()=>{Na(),ne("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Sa(){Na(),ne("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let _s=!1;function Na(){function _e(){Na()}if(document.readyState==="loading"){_s||window.addEventListener("DOMContentLoaded",_e,!1),_s=!0;return}document.querySelectorAll(Pe.cssSelector).forEach(an)}function _l(_e,Ve){let ht=null;try{ht=Ve(Z)}catch(_t){if(Ne("Language definition for '{}' could not be registered.".replace("{}",_e)),qt)Ne(_t);else throw _t;ht=Ue}ht.name||(ht.name=_e),ge[_e]=ht,ht.rawDefinition=Ve.bind(null,Z),ht.aliases&&Zi(ht.aliases,{languageName:_e})}function $r(_e){delete ge[_e];for(const Ve of Object.keys(Me))Me[Ve]===_e&&delete Me[Ve]}function js(){return Object.keys(ge)}function Ln(_e){return _e=(_e||"").toLowerCase(),ge[_e]||ge[Me[_e]]}function Zi(_e,{languageName:Ve}){typeof _e=="string"&&(_e=[_e]),_e.forEach(ht=>{Me[ht.toLowerCase()]=Ve})}function Ji(_e){const Ve=Ln(_e);return Ve&&!Ve.disableAutodetect}function xr(_e){_e["before:highlightBlock"]&&!_e["before:highlightElement"]&&(_e["before:highlightElement"]=Ve=>{_e["before:highlightBlock"](Object.assign({block:Ve.el},Ve))}),_e["after:highlightBlock"]&&!_e["after:highlightElement"]&&(_e["after:highlightElement"]=Ve=>{_e["after:highlightBlock"](Object.assign({block:Ve.el},Ve))})}function fn(_e){xr(_e),it.push(_e)}function jl(_e){const Ve=it.indexOf(_e);Ve!==-1&&it.splice(Ve,1)}function Ur(_e,Ve){const ht=_e;it.forEach(function(_t){_t[ht]&&_t[ht](Ve)})}function er(_e){return ne("10.7.0","highlightBlock will be removed entirely in v12.0"),ne("10.7.0","Please use highlightElement now."),an(_e)}Object.assign(Z,{highlight:Vt,highlightAuto:Ea,highlightAll:Na,highlightElement:an,highlightBlock: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 _e in Te)typeof Te[_e]=="object"&&e(Te[_e]);return Object.assign(Z,Te),Z},Un=Br({});return Un.newInstance=()=>Br({}),sy=Un,Un.HighlightJS=Un,Un.default=Un,sy}var k8=w8();const E8=qu(k8),OE={},S8="hljs-";function N8(e){const t=E8.newInstance();return e&&l(e),{highlight:n,highlightAuto:i,listLanguages:a,register:l,registerAlias:o,registered:d};function n(f,h,g){const m=g||OE,y=typeof m.prefix=="string"?m.prefix:S8;if(!t.getLanguage(f))throw new Error("Unknown language: `"+f+"` is not registered");t.configure({__emitter:_8,classPrefix:y});const b=t.highlight(h,{ignoreIllegals:!0,language:f});if(b.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:b.errorRaised});const k=b._emitter.root,v=k.data;return v.language=b.language,v.relevance=b.relevance,k}function i(f,h){const m=(h||OE).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,h);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,h){if(typeof f=="string")t.registerLanguage(f,h);else{let g;for(g in f)Object.hasOwn(f,g)&&t.registerLanguage(g,f[g])}}function o(f,h){if(typeof f=="string")t.registerAliases(typeof h=="string"?h:[...h],{languageName:f});else{let g;for(g in f)if(Object.hasOwn(f,g)){const m=f[g];t.registerAliases(typeof m=="string"?m:[...m],{languageName:g})}}}function d(f){return!!t.getLanguage(f)}}class _8{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 j8={};function zx(e){const t=e||j8,n=t.aliases,i=t.detect||!1,a=t.languages||v8,l=t.plainText,o=t.prefix,d=t.subset;let f="hljs";const h=N8(a);if(n&&h.registerAlias(n),o){const g=o.indexOf("-");f=g===-1?o:o.slice(0,g)}return function(g,m){op(g,"element",function(y,b,k){if(y.tagName!=="code"||!k||k.type!=="element"||k.tagName!=="pre")return;const v=C8(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=V9(y,{whitespace:"pre"});let E;try{E=v?h.highlight(v,S,{prefix:o}):h.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 C8(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 ly=e=>e instanceof Error?e.message:String(e),RE=e=>e.replace(/^---\n[\s\S]*?\n---\n?/,"");function A8({name:e,onClose:t}){const n=Be(),i=Ft(),{data:a,isLoading:l,isError:o,error:d}=Ye({queryKey:["skill",e],queryFn:()=>Hz(e)}),[f,h]=j.useState(!1),[g,m]=j.useState(""),[y,b]=j.useState(!1),[k,v]=j.useState(null),S=T=>{m(T),h(!0),b(!1),v(null)},E=Et({mutationFn:()=>Gz(e,g),onSuccess:()=>{i.invalidateQueries({queryKey:["skill",e]}),i.invalidateQueries({queryKey:["skills"]}),h(!1)},onError:T=>v(n("skillDetail.saveFailed",{detail:ly(T)}))}),C=Et({mutationFn:()=>Yz(e),onSuccess:T=>S(T.content),onError:T=>v(n("skillDetail.translateFailed",{detail:ly(T)}))}),N=Et({mutationFn:()=>Vz(e),onSuccess:()=>{i.invalidateQueries({queryKey:["skills"]}),t()},onError:T=>v(n("skillDetail.deleteFailed",{detail:ly(T)}))}),_=E.isPending||C.isPending||N.isPending;return j.useEffect(()=>{const T=M=>{M.key==="Escape"&&(f?h(!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(e_,{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(LL,{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:()=>h(!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(bn,{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:RE(a.body).trim()?c.jsx(Tx,{remarkPlugins:[Rx],rehypePlugins:[zx],children:RE(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(T8,{skillName:e,file:T.name,lines:T.lines},T.name))})]})]})]})})}function T8({skillName:e,file:t,lines:n}){const i=Be(),[a,l]=j.useState(!1),{data:o,isLoading:d,isError:f,error:h}=Ye({queryKey:["skill-ref",e,t],queryFn:()=>Kz(e,t),enabled:a,staleTime:1/0});return c.jsxs("li",{className:"border-2 border-[var(--color-text)] rounded-lg overflow-hidden bg-[var(--color-bg-cream)]",children:[c.jsxs("button",{type:"button",onClick:()=>l(g=>!g),"aria-label":i("skillDetail.toggleSection.aria",{action:i(a?"skillDetail.collapse":"skillDetail.expand"),file:t}),"aria-expanded":a,className:"w-full flex items-center gap-2 px-3 py-2 text-sm font-[family-name:var(--font-mono)] hover:bg-[var(--color-accent-yellow)] transition-colors",children:[c.jsx(Zo,{size:12,strokeWidth:3,className:["transition-transform",a?"rotate-90":""].join(" ")}),c.jsx(Fh,{size:12,strokeWidth:2.5}),c.jsx("span",{className:"flex-1 text-left font-bold",children:t}),c.jsxs("span",{className:"text-xs text-[var(--color-text-subtle)]",children:[n," lines"]})]}),a&&c.jsxs("div",{className:"px-4 py-3 border-t-2 border-[var(--color-text)] bg-[var(--color-bg)] max-h-96 overflow-auto",children:[d&&c.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:i("skillDetail.loading")}),f&&c.jsx("p",{className:"text-xs text-[var(--color-crashed)]",children:i("skillDetail.error.load",{detail:h instanceof Error?h.message:String(h)})}),o&&c.jsx("div",{className:"prose-chat text-sm",children:c.jsx(Tx,{remarkPlugins:[Rx],rehypePlugins:[zx],children:o.content})})]})]})}function M8({onClose:e}){const t=Be(),n=Ft(),{alert:i}=un(),[a,l]=j.useState(""),[o,d]=j.useState(""),f=/^[a-z0-9][a-z0-9-]*$/.test(a),h=Et({mutationFn:()=>e4(a,{"SKILL.md":o}),onSuccess:()=>{n.invalidateQueries({queryKey:["skills"]}),n.invalidateQueries({queryKey:["skill-updates"]}),e()},onError:g=>void i({title:t("skills.import.error"),body:g instanceof Error?g.message:String(g)})});return c.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/30 p-4",onClick:e,children:c.jsxs("div",{className:"nb-card mt-16 w-full max-w-xl flex flex-col gap-3",onClick:g=>g.stopPropagation(),children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold",children:t("skills.import.title")}),c.jsx("button",{type:"button",className:"nb-btn p-2",onClick:e,"aria-label":"close",children:c.jsx(bn,{size:14,strokeWidth:3})})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:t("skills.import.name")}),c.jsx("input",{className:"nb-input w-full",value:a,onChange:g=>l(g.target.value),placeholder:"code-review","aria-label":t("skills.import.name")})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:t("skills.import.body")}),c.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-sm",rows:12,value:o,onChange:g=>d(g.target.value),placeholder:`---
|
|
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:h.isPending||!f||!o.trim(),onClick:()=>h.mutate(),children:[h.isPending?c.jsx(Xe,{size:14,className:"animate-spin"}):c.jsx(s_,{size:14,strokeWidth:3}),t("skills.import.submit")]})]})})}function D8({onClose:e,onSubmit:t}){const n=Be(),[i,a]=j.useState(""),[l,o]=j.useState(""),d=/^[a-z0-9][a-z0-9-]*$/.test(i);return c.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/30 p-4 overflow-auto",children:c.jsx("div",{className:"w-full max-w-xl my-8",children:c.jsxs("div",{className:"nb-card flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-center justify-between shrink-0",children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold flex items-center gap-2",children:[c.jsx(hl,{size:16,strokeWidth:2.5}),n("skills.ai.title")]}),c.jsx("button",{type:"button",className:"nb-btn p-2",onClick:e,"aria-label":"close",children:c.jsx(bn,{size:14,strokeWidth:3})})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:n("skills.ai.name")}),c.jsx("input",{type:"text",value:i,onChange:f=>a(f.target.value),placeholder:"rust-error-handling",className:"nb-input w-full font-[family-name:var(--font-mono)]","aria-label":n("skills.ai.name")})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:n("skills.ai.intent")}),c.jsx("textarea",{value:l,onChange:f=>o(f.target.value),placeholder:n("skills.ai.placeholder"),rows:5,className:"nb-input w-full text-sm","aria-label":n("skills.ai.intent")})]}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint self-start",disabled:!d||!l.trim(),onClick:()=>t(i,l),children:[c.jsx(hl,{size:14,strokeWidth:2.5}),n("skills.ai.submit")]})]})})})}async function O8(e){const{files:t}=await t4(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 R8=[{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"}],L8={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 I8(){var q,Y;const e=Be(),[t,n]=j.useState("all"),[i,a]=j.useState([]),[l,o]=j.useState(""),[d,f]=j.useState(null),[h,g]=j.useState(!1),[m,y]=j.useState(!1),b=Ft(),v=(((q=Ye({queryKey:["gen-jobs"],queryFn:_2,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)=>{n4(D,F).then(()=>b.invalidateQueries({queryKey:["gen-jobs"]})).catch(()=>{})},_=(((Y=Ye({queryKey:["skill-updates"],queryFn:Jz}).data)==null?void 0:Y.data)??[]).filter(D=>D.status!=="same").length,{data:T,isLoading:M}=Ye({queryKey:["skills"],queryFn:()=>cx()}),R=Ye({queryKey:["projects"],queryFn:Es}),O=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(hl,{size:14,strokeWidth:2.5}),e("skills.ai")]}),c.jsxs("button",{className:"nb-btn",onClick:()=>g(!0),type:"button",children:[c.jsx(s_,{size:14,strokeWidth:2.5}),e("skills.import")]}),c.jsxs("button",{className:"nb-btn nb-btn-mint",onClick:async()=>{await Wz(),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:R8.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(bn,{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)),O.map(D=>{var F;return c.jsx(z8,{skill:D,projectCount:((F=R.data)==null?void 0:F.data.length)??0,onOpen:()=>f(D.name),onExport:()=>void O8(D.name)},D.name)})]}),d&&c.jsx(A8,{name:d,onClose:()=>f(null)}),h&&c.jsx(M8,{onClose:()=>g(!1)}),m&&c.jsx(D8,{onClose:()=>y(!1),onSubmit:(D,F)=>{C(D,F),y(!1)}})]})}function z8({skill:e,projectCount:t,onOpen:n,onExport:i}){const a=Be(),l=L8[e.category];return c.jsxs("article",{onClick:n,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),n())},tabIndex:0,role:"button","aria-label":`Open ${e.name}`,className:"nb-card nb-card-interactive flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:e.name}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("button",{type:"button",className:"nb-btn p-1",onClick:o=>{o.stopPropagation(),i()},"aria-label":a("skills.export"),title:a("skills.export"),children:c.jsx(Uh,{size:12,strokeWidth:2.5})}),c.jsx("span",{className:"nb-badge text-[10px]",style:{background:l},children:e.category})]})]}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] leading-5 line-clamp-3",children:e.description||"(no description)"}),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 Zj(e){const t=e?`?q=${encodeURIComponent(e)}`:"";return ft(`/api/prompts${t}`)}function Px(e){return ft(`/api/prompts/${encodeURIComponent(e)}`)}function P8(e){return gr("/api/prompts",e)}function B8(e,t){return Kb(`/api/prompts/${encodeURIComponent(e)}`,t)}function $8(e){return p_(`/api/prompts/${encodeURIComponent(e)}`)}function U8(e){return gr("/api/prompts/generate",{intent:e})}function Jj(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 F8(){var M,R;const e=Be(),[t,n]=Vb("prompts.last",""),[i,a]=j.useState(null),[l,o]=j.useState(!1),[d,f]=j.useState(""),[h,g]=j.useState(new Set),m=Ft(),y=Ye({queryKey:["prompts"],queryFn:()=>Zj()}),b=((M=y.data)==null?void 0:M.data)??[],k=j.useMemo(()=>[...new Set(b.flatMap(O=>O.tags))].sort(),[b]),S=(((R=Ye({queryKey:["gen-jobs"],queryFn:_2,refetchInterval:3e3}).data)==null?void 0:R.data)??[]).filter(O=>O.kind==="prompt"),E=S.filter(O=>O.status!=="done"),C=j.useRef(new Set);j.useEffect(()=>{for(const O of S)(O.status==="done"||O.status==="error")&&!C.current.has(O.id)&&(C.current.add(O.id),m.invalidateQueries({queryKey:["prompts"]}),O.status==="done"&&O.result&&n(O.result))},[S,m,n]);const N=O=>{U8(O).then(()=>m.invalidateQueries({queryKey:["gen-jobs"]})).catch(()=>{})},_=j.useMemo(()=>{const O=d.trim().toLowerCase();return b.filter(B=>!(h.size&&![...h].every(U=>B.tags.includes(U))||O&&!(B.name.toLowerCase().includes(O)||B.description.toLowerCase().includes(O)||B.tags.some(K=>K.toLowerCase().includes(O)))))},[b,h,d]);j.useEffect(()=>{t&&b.length&&!b.some(O=>O.name===t)&&n("")},[t,b,n]);const T=O=>g(B=>{const U=new Set(B);return U.has(O)?U.delete(O):U.add(O),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(hl,{size:14,strokeWidth:2.5}),e("prompts.ai")]}),c.jsxs("button",{className:"nb-btn nb-btn-mint",type:"button",onClick:()=>a({mode:"new"}),children:[c.jsx(pi,{size:14,strokeWidth:3}),e("prompts.new")]})]})]}),c.jsxs("div",{className:"shrink-0 flex flex-col gap-2",children:[c.jsxs("label",{className:"nb-input flex items-center gap-2 w-full",style:{padding:"6px 10px"},children:[c.jsx(fl,{size:14}),c.jsx("input",{type:"text",value:d,onChange:O=>f(O.target.value),placeholder:e("prompts.search"),className:"bg-transparent outline-none flex-1 text-sm","aria-label":e("prompts.search")})]}),k.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1.5",children:k.map(O=>c.jsx("button",{type:"button",onClick:()=>T(O),className:`text-xs border-2 border-[var(--color-text)] rounded-full px-2 py-0.5 ${h.has(O)?"bg-[var(--color-accent-mint)] font-bold":""}`,children:O},O))})]}),c.jsxs("div",{className:"flex gap-5 flex-1 min-h-0",children:[c.jsxs("aside",{className:"w-80 shrink-0 min-h-0 overflow-y-auto flex flex-col gap-2 pr-1",children:[E.map(O=>c.jsxs("div",{className:`nb-card flex items-center gap-2 ${O.status==="error"?"bg-[var(--color-crashed-bg)]":"opacity-70"}`,style:{padding:"8px 10px"},children:[O.status==="running"?c.jsx(Xe,{size:12,className:"animate-spin"}):c.jsx(bn,{size:12,strokeWidth:3}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)] truncate",children:O.status==="running"?e("prompts.ai.wait"):`${e("prompts.ai.error")}: ${O.error??""}`})]},O.id)),y.isLoading?c.jsx("div",{className:"nb-card",children:c.jsx(Xe,{size:14,className:"animate-spin"})}):_.length===0?c.jsx("div",{className:"nb-card",children:c.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:e("prompts.empty")})}):_.map(O=>c.jsxs("button",{type:"button",onClick:()=>n(O.name),className:`nb-card w-full text-left ${t===O.name?"bg-[var(--color-accent-mint)]":""}`,style:{padding:"8px 10px"},children:[c.jsxs("span",{className:"flex items-center gap-1.5",children:[O.favorite&&c.jsx(r_,{size:12,fill:"currentColor"}),c.jsx("code",{className:"font-[family-name:var(--font-mono)] text-sm font-bold truncate",children:O.name})]}),O.description&&c.jsx("span",{className:"block text-xs text-[var(--color-text-muted)] truncate",children:O.description})]},O.name))]}),c.jsx("div",{className:"flex-1 min-w-0 min-h-0",children:t?c.jsx(H8,{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(G8,{name:i.mode==="edit"?i.name:null,onClose:()=>a(null),onSaved:O=>{a(null),n(O)}}),l&&c.jsx(q8,{onClose:()=>o(!1),onSubmit:O=>{N(O),o(!1)}})]})}function q8({onClose:e,onSubmit:t}){const n=Be(),[i,a]=j.useState("");return c.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/30 p-4 overflow-auto",children:c.jsx("div",{className:"w-full max-w-xl my-8",children:c.jsxs("div",{className:"nb-card flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-center justify-between shrink-0",children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold flex items-center gap-2",children:[c.jsx(hl,{size:16,strokeWidth:2.5}),n("prompts.ai.title")]}),c.jsx("button",{type:"button",className:"nb-btn p-2",onClick:e,"aria-label":"close",children:c.jsx(bn,{size:14,strokeWidth:3})})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:n("prompts.ai.intent")}),c.jsx("textarea",{value:i,onChange:l=>a(l.target.value),placeholder:n("prompts.ai.placeholder"),rows:5,className:"nb-input w-full text-sm","aria-label":n("prompts.ai.intent")})]}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint self-start",disabled:!i.trim(),onClick:()=>t(i),children:[c.jsx(hl,{size:14,strokeWidth:2.5}),n("prompts.ai.submit")]})]})})})}function H8({name:e,onEdit:t,onDeleted:n}){const i=Be(),a=Ft(),{confirm:l}=un(),o=Ye({queryKey:["prompt",e],queryFn:()=>Px(e)}),d=Et({mutationFn:()=>$8(e),onSuccess:()=>{a.invalidateQueries({queryKey:["prompts"]}),n()}});if(o.isLoading)return c.jsx("div",{className:"nb-card",children:c.jsx(Xe,{size:14,className:"animate-spin"})});const f=o.data;if(!f)return null;const h=Jj(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(r_,{size:16,fill:"currentColor"}),c.jsx("code",{className:"font-[family-name:var(--font-mono)] truncate",children:f.name})]}),f.description&&c.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:f.description})]}),c.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",onClick:t,children:[c.jsx(qh,{size:14,strokeWidth:3}),i("common.edit")]}),c.jsx("button",{type:"button",className:"nb-btn",disabled:d.isPending,onClick:async()=>{await l({title:i("prompts.delete"),body:i("prompts.deleteConfirm",{name:e})})&&d.mutate()},"aria-label":i("prompts.delete"),children:c.jsx(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:h.length?i("prompts.vars",{names:h.join(", ")}):i("prompts.noVars")})]})}function K8({tags:e,onChange:t}){const n=Be(),[i,a]=j.useState(""),l=()=>{const o=i.trim();o&&!e.includes(o)&&t([...e,o]),a("")};return c.jsxs("div",{className:"nb-input w-full flex flex-wrap gap-1.5 items-center",children:[e.map(o=>c.jsxs("span",{className:"inline-flex items-center gap-1 text-xs bg-[var(--color-accent-mint)] border-2 border-[var(--color-text)] rounded px-1.5 py-0.5",children:[o,c.jsx("button",{type:"button",onClick:()=>t(e.filter(d=>d!==o)),"aria-label":`remove ${o}`,children:c.jsx(bn,{size:10,strokeWidth:3})})]},o)),c.jsx("input",{className:"flex-1 min-w-[90px] bg-transparent outline-none text-sm",value:i,onChange:o=>a(o.target.value),onKeyDown:o=>{o.key==="Enter"?(o.preventDefault(),l()):o.key==="Backspace"&&!i&&e.length&&t(e.slice(0,-1))},placeholder:e.length?"":n("prompts.tagAdd"),"aria-label":n("prompts.tags")})]})}function G8({name:e,onClose:t,onSaved:n}){const i=Be(),a=Ft(),{alert:l}=un(),o=e===null,d=Ye({queryKey:["prompt",e],queryFn:()=>Px(e),enabled:!o}),[f,h]=j.useState(o?{name:"",description:"",tags:[],body:"",favorite:!1}:null);j.useEffect(()=>{if(!o&&d.data&&f===null){const b=d.data;h({name:b.name,description:b.description,tags:b.tags,body:b.body,favorite:b.favorite})}},[o,d.data,f]);const g=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?P8({name:f.name,...b}):B8(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?Jj(f.body):[],[f]);return c.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/30 p-4 overflow-auto",children:c.jsx("div",{className:"w-full max-w-2xl my-8",children:c.jsxs("div",{className:"nb-card flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-center justify-between shrink-0",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold",children:o?i("prompts.new"):e}),c.jsx("button",{type:"button",className:"nb-btn p-2",onClick:t,"aria-label":"close",children:c.jsx(bn,{size:14,strokeWidth:3})})]}),!o&&d.isLoading?c.jsx(Xe,{size:14,className:"animate-spin"}):f?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:i("prompts.name")}),c.jsx("input",{type:"text",value:f.name,disabled:!o,onChange:b=>h({...f,name:b.target.value}),placeholder:i("prompts.namePlaceholder"),className:"nb-input w-full","aria-label":i("prompts.name")}),o&&f.name&&!m&&c.jsx("span",{className:"text-xs text-[var(--color-crashed)]",children:i("prompts.nameError")})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:i("prompts.description")}),c.jsx("input",{type:"text",value:f.description,onChange:b=>h({...f,description:b.target.value}),className:"nb-input w-full","aria-label":i("prompts.description")})]})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:i("prompts.tags")}),c.jsx(K8,{tags:f.tags,onChange:b=>h({...f,tags:b})})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:i("prompts.body")}),c.jsx("textarea",{value:f.body,onChange:b=>h({...f,body:b.target.value}),placeholder:i("prompts.bodyPlaceholder"),rows:12,className:"nb-input w-full font-[family-name:var(--font-mono)] text-sm","aria-label":i("prompts.body")}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:y.length?i("prompts.vars",{names:y.join(", ")}):i("prompts.noVars")})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",disabled:g.isPending||o&&!m||!f.body.trim(),onClick:()=>g.mutate(),children:[g.isPending?c.jsx(Xe,{size:14,className:"animate-spin"}):c.jsx(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=>h({...f,favorite:b.target.checked})}),i("prompts.favorite")]})]})]}):null]})})})}function V8(){var l;const e=Be(),t=Ye({queryKey:["system-info"],queryFn:g_}),n=Ye({queryKey:["system-env"],queryFn:V3}),[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(Y8,{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:Z8(t.data.uptimeMs)})]}):c.jsx("p",{className:"text-[var(--color-text-muted)]",children:e("common.loading")})]}),c.jsxs("section",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold",children:[e("system.env.title.prefix"),c.jsx("code",{className:"text-sm font-[family-name:var(--font-mono)] font-normal bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] px-2 py-0.5 rounded",children:"~/.coral/env"})]}),i?c.jsx("span",{className:"text-xs text-[var(--color-stuck)] font-bold",children:e("system.env.editing.label")}):c.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>a(!0),type:"button","aria-label":e("system.env.edit.aria"),children:[c.jsx(qh,{size:12,strokeWidth:2.5})," ",e("system.env.edit.button")]})]}),i?c.jsx(Q8,{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(W8,{})]})}function Y8({current:e}){var v;const t=Be(),{confirm:n,alert:i}=un(),[a,l]=j.useState(!1),[o,d]=j.useState(null),f=Ye({queryKey:["latest-version"],queryFn:J3,enabled:!1}),[h,g]=j.useState(null),[m,y]=j.useState("npm i -g @coralai/sps-cli@latest"),b=async()=>{var E;if(await n({title:t("system.upgrade.confirm.title"),body:t("system.upgrade.confirm.body",{current:e??"?",latest:((E=f.data)==null?void 0:E.latest)??"?"}),confirm:t("system.upgrade.confirm.button")})){l(!0),d(null),g(null);try{const C=await eI();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(Uh,{size:11,strokeWidth:2.5}),t("system.upgrade.button.upgrade")]}),c.jsxs("button",{className:"nb-btn",style:{padding:"3px 10px",fontSize:11},onClick:k,type:"button","aria-label":t("system.upgrade.button.copyAria"),title:t("system.upgrade.button.copyTitle"),children:[c.jsx(JR,{size:11,strokeWidth:2.5})," ",t("system.upgrade.button.copy")]})]})]})]}),h&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{className:"font-bold",children:t("system.upgrade.label.installed")}),c.jsxs("dd",{className:"font-[family-name:var(--font-mono)] flex items-center gap-2",children:[h,h===((v=f.data)==null?void 0:v.latest)?c.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:t("system.upgrade.installed.ok")}):h===e?c.jsx("span",{className:"nb-status",style:{background:"var(--color-stuck-bg)",color:"var(--color-stuck)"},children:t("system.upgrade.installed.fail")}):null]})]}),f.isError&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{className:"font-bold",children:t("system.upgrade.label.check")}),c.jsx("dd",{className:"text-[var(--color-crashed)] text-xs",children:f.error instanceof Error?f.error.message:String(f.error)})]})]}),o&&c.jsx("pre",{className:"mt-3 text-xs font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-3 max-h-40 overflow-auto whitespace-pre-wrap",children:o})]})}function Q8({onClose:e}){const t=Be(),n=Ft(),{alert:i}=un(),a=Ye({queryKey:["system-env-raw"],queryFn:Y3}),[l,o]=j.useState(null),[d,f]=j.useState(null);j.useEffect(()=>{a.data&&l===null&&(o(a.data.content),f(a.data.etag))},[a.data,l]);const h=l!==null&&a.data&&l!==a.data.content,g=Et({mutationFn:()=>{if(l===null)throw new Error("no draft");return Q3(l,d??"")},onSuccess:()=>{n.invalidateQueries({queryKey:["system-env"]}),n.invalidateQueries({queryKey:["system-env-raw"]}),e()},onError:m=>{const y=m.status;i({title:t(y===409?"system.env.error.conflict.title":"system.env.error.save.title"),body:y===409?t("system.env.error.conflict.body"):m instanceof Error?m.message:String(m)})}});return a.isLoading?c.jsx("p",{className:"text-[var(--color-text-muted)]",children:t("common.loading")}):c.jsxs("div",{children:[c.jsx("p",{className:"text-xs text-[var(--color-stuck)] font-bold mb-2",children:t("system.env.warning")}),c.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",style:{minHeight:320,resize:"vertical"},value:l??"",onChange:m=>o(m.target.value),spellCheck:!1,"aria-label":t("system.env.aria")}),c.jsxs("div",{className:"flex items-center justify-between mt-3",children:[c.jsxs("span",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)]",children:[d?`etag: ${d}`:"",h?t("system.env.dirtyMark"):""]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px"},onClick:e,disabled:g.isPending,type:"button",children:[c.jsx(bn,{size:12,strokeWidth:3})," ",t("system.env.cancel")]}),c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 12px"},onClick:()=>g.mutate(),disabled:!h||g.isPending,type:"button","aria-label":t("system.env.save.aria"),children:[g.isPending?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(mr,{size:12,strokeWidth:3}),t("system.env.save")]})]})]})]})}function W8(){var y;const e=Be(),{alert:t}=un(),n=Ye({queryKey:["projects"],queryFn:Es}),[i,a]=j.useState({}),[l,o]=j.useState({}),[d,f]=j.useState({}),h=(((y=n.data)==null?void 0:y.data)??[]).map(b=>({project:b.name})),g=async(b,k)=>{o(v=>({...v,[b]:k?"fix":"check"}));try{const v=await tI(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 h)await g(b.project,!1)};return c.jsxs("section",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold",children:e("system.diagnostics.title")}),c.jsxs("button",{className:"nb-btn nb-btn-mint",style:{padding:"6px 12px",fontSize:12},onClick:()=>{m()},disabled:h.length===0||Object.values(l).some(Boolean),type:"button",children:[c.jsx(ya,{size:12,strokeWidth:2.5}),e("system.diagnostics.checkAll")]})]}),h.length===0?c.jsx("p",{className:"text-[var(--color-text-muted)] text-sm",children:e("system.diagnostics.empty")}):c.jsx("ul",{className:"flex flex-col gap-2",children:h.map(b=>{const k=i[b.project],v=l[b.project],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-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg",children:[c.jsxs("div",{className:"flex items-center gap-3 px-3 py-2",children:[c.jsxs("button",{type:"button",onClick:()=>f(_=>({..._,[b.project]:!C})),disabled:!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(fh,{size:16,className:"text-[var(--color-running)] shrink-0",strokeWidth:2.5}):N?c.jsx(ku,{size:16,className:"text-[var(--color-stuck)] shrink-0",strokeWidth:2.5}):c.jsx(fh,{size:16,className:"text-[var(--color-text-subtle)] shrink-0",strokeWidth:2.5}),N&&(C?c.jsx(Vu,{size:12}):c.jsx(Zo,{size:12})),c.jsx("span",{className:"font-bold font-[family-name:var(--font-mono)]",children:b.project}),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(o_,{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(X8,{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 X8({check:e}){const t=e.status==="pass"?c.jsx(fh,{size:12,className:"text-[var(--color-running)]",strokeWidth:2.5}):e.status==="fail"?c.jsx(ku,{size:12,className:"text-[var(--color-crashed)]",strokeWidth:2.5}):e.status==="warn"?c.jsx(ku,{size:12,className:"text-[var(--color-stuck)]",strokeWidth:2.5}):c.jsx("span",{className:"w-3 h-3 rounded-full bg-[var(--color-text-subtle)] inline-block"});return c.jsxs("li",{className:"flex items-start gap-2",children:[c.jsx("span",{className:"pt-0.5 shrink-0",children:t}),c.jsx("span",{className:"font-bold w-32 shrink-0",children:e.name}),c.jsx("span",{className:"text-[var(--color-text-muted)] break-words",children:e.message})]})}function Z8(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 J8(){return ft("/api/chat/sessions")}function eq(e){return ft(`/api/chat/sessions/${e}`)}async function oy(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 tq(e){const t=await fetch(`/api/chat/sessions/${e}`,{method:"DELETE"});if(!t.ok)throw new Error(`${t.status}`)}async function nq(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 iq(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 rq(e,t){const n=t?`?since=${encodeURIComponent(t)}`:"";return ft(`/api/chat/sessions/${e}/messages${n}`)}function aq({onInsert:e,disabled:t,className:n="nb-btn"}){var m;const i=Be(),[a,l]=j.useState(!1),[o,d]=j.useState(""),h=((m=Ye({queryKey:["prompts",o],queryFn:()=>Zj(o||void 0),enabled:a}).data)==null?void 0:m.data)??[],g=async y=>{try{const b=await Px(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(JN,{size:15,strokeWidth:2.5})}),a&&c.jsxs("div",{className:"absolute bottom-full mb-2 left-0 z-20 w-72 nb-card overflow-hidden flex flex-col gap-2",children:[c.jsxs("label",{className:"flex items-center gap-2 border-2 border-[var(--color-text)] rounded px-2 py-1",children:[c.jsx(fl,{size:12}),c.jsx("input",{autoFocus:!0,value:o,onChange:y=>d(y.target.value),placeholder:i("prompts.search"),className:"bg-transparent outline-none flex-1 text-sm","aria-label":i("prompts.search")})]}),c.jsx("div",{className:"max-h-64 overflow-auto flex flex-col gap-1",children:h.length===0?c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] px-1 py-2",children:i("prompts.empty")}):h.map(y=>c.jsxs("button",{type:"button",onClick:()=>void g(y.name),className:"text-left px-2 py-1 rounded hover:bg-[var(--color-bg-cream)]",children:[c.jsx("code",{className:"font-[family-name:var(--font-mono)] text-sm font-bold",children:y.name}),y.description&&c.jsx("span",{className:"block text-xs text-[var(--color-text-muted)] truncate",children:y.description})]},y.name))})]})]})}function LE(){var Te,Re,Oe,ce,Ce,te,pe,Fe,ze;const e=Be(),{sessionId:t}=Ob(),n=ks(),i=Ft(),{confirm:a,alert:l}=un(),o=Ye({queryKey:["chat-sessions"],queryFn:J8,refetchInterval:5e3}),d=Ye({queryKey:["chat-session",t],queryFn:()=>eq(t??""),enabled:!!t,refetchInterval:4e3}),[f,h]=j.useState(null),g=ae=>`chat-draft:${ae??""}`,[m,y]=j.useState(()=>localStorage.getItem(g(t))??""),b=j.useCallback(ae=>{y(be=>{const ye=typeof ae=="function"?ae(be):ae;try{t&&localStorage.setItem(g(t),ye)}catch{}return ye})},[t]);j.useEffect(()=>{y(localStorage.getItem(g(t))??"")},[t]);const[k,v]=j.useState(!1),S=j.useRef(null),E=j.useRef(!0),[C,N]=j.useState(!1),_=()=>{const ae=S.current;return!ae||ae.scrollHeight-ae.scrollTop-ae.clientHeight<40},T=j.useCallback(()=>{const ae=S.current;ae&&(ae.scrollTop=ae.scrollHeight),E.current=!0,N(!1)},[]),M=j.useCallback(()=>{const ae=_();E.current=ae,N(!ae)},[]),R=j.useRef(null);j.useEffect(()=>{const ae=R.current;ae&&(ae.style.height="auto",ae.style.height=`${Math.min(ae.scrollHeight,200)}px`,ae.scrollTop=ae.scrollHeight)},[m]);const O="w-8 h-8 flex items-center justify-center rounded-full bg-[rgba(255,255,255,0.08)] text-[var(--color-text-muted)] hover:bg-[rgba(255,255,255,0.14)] hover:text-[var(--color-text)] transition-colors disabled:opacity-50",[B,U]=j.useState(!1),[K,q]=j.useState([]),[Y,D]=j.useState(!1),[F,I]=j.useState(!1),[H,Q]=j.useState(!1),[G,L]=j.useState(null),[z,V]=j.useState(!1);j.useEffect(()=>{if(!t)return;const ae=new EventSource(`/stream/chat/${encodeURIComponent(t)}`);let be=!0;return ae.addEventListener("open",()=>{if(be){be=!1;return}const ye=i.getQueryData(["chat-session",t]),he=ye!=null&&ye.messages.length?ye.messages[ye.messages.length-1].ts:void 0;rq(t,he).then(Ee=>{Ee.data.length!==0&&i.setQueryData(["chat-session",t],Ne=>{if(!Ne)return Ne;const Ke=new Set(Ne.messages.map(de=>de.id)),ne=Ee.data.filter(de=>!Ke.has(de.id));return ne.length===0?Ne:{...Ne,messages:[...Ne.messages,...ne],lastMessageAt:ne[ne.length-1].ts,messageCount:Ne.messageCount+ne.length}})}).catch(()=>{})}),ae.addEventListener("chat.message",ye=>{try{const he=JSON.parse(ye.data);i.setQueryData(["chat-session",t],Ee=>{if(!Ee||Ee.messages.some(ne=>ne.id===he.message.id))return Ee;const Ke=Ee.messages.findIndex(ne=>ne.role==="user"&&ne.id.startsWith("optim-")&&ne.content===he.message.content);if(Ke>=0){const ne=[...Ee.messages];return ne[Ke]=he.message,{...Ee,messages:ne}}return{...Ee,messages:[...Ee.messages,he.message]}})}catch{}}),ae.addEventListener("chat.message.pending",ye=>{try{const he=JSON.parse(ye.data);h({sessionId:t,id:he.assistantId,blocks:[],done:!1,finalMessage:null})}catch{}}),ae.addEventListener("chat.message.snapshot",ye=>{try{const he=JSON.parse(ye.data);h({sessionId:t,id:he.assistantId,blocks:he.blocks.map(Ee=>Ee.type==="text"?{type:"text",target:Ee.text,displayed:Ee.text}:{type:"tool_use",id:Ee.id,title:Ee.title,kind:Ee.kind,status:Ee.status,input:Ee.input,locations:Ee.locations}),done:!1,finalMessage:null})}catch{}}),ae.addEventListener("chat.message.chunk.text",ye=>{try{const he=JSON.parse(ye.data);h(Ee=>{if(!Ee||Ee.id!==he.assistantId)return Ee;const Ne=[...Ee.blocks],Ke=Ne[Ne.length-1];return Ke&&Ke.type==="text"?Ne[Ne.length-1]={...Ke,target:Ke.target+he.text}:Ne.push({type:"text",target:he.text,displayed:""}),{...Ee,blocks:Ne}})}catch{}}),ae.addEventListener("chat.message.chunk.tool_use",ye=>{try{const he=JSON.parse(ye.data);h(Ee=>!Ee||Ee.id!==he.assistantId?Ee:{...Ee,blocks:[...Ee.blocks,{type:"tool_use",id:he.id,title:he.title,kind:he.kind,status:he.status,input:he.input,locations:he.locations}]})}catch{}}),ae.addEventListener("chat.message.chunk.tool_update",ye=>{try{const he=JSON.parse(ye.data);h(Ee=>!Ee||Ee.id!==he.assistantId?Ee:{...Ee,blocks:Ee.blocks.map(Ne=>Ne.type==="tool_use"&&Ne.id===he.id?{...Ne,status:he.status,input:Ne.input??he.input,locations:Ne.locations??he.locations}:Ne)})}catch{}}),ae.addEventListener("chat.message.complete",ye=>{try{const he=JSON.parse(ye.data);h(Ee=>Ee&&Ee.id===he.assistantId?{...Ee,done:!0,finalMessage:he.message}:Ee)}catch{}}),ae.addEventListener("chat.message.error",ye=>{try{const he=JSON.parse(ye.data);h(Ne=>Ne&&Ne.sessionId===t&&(!he.assistantId||Ne.id===he.assistantId||Ne.id===he.turnId)?null:Ne),v(!1);const Ee=he.message;Ee&&i.setQueryData(["chat-session",t],Ne=>!Ne||Ne.messages.some(Ke=>Ke.id===Ee.id)?Ne:{...Ne,messages:[...Ne.messages,Ee],lastMessageAt:Ee.ts,messageCount:Ne.messageCount+1})}catch{}}),()=>ae.close()},[t,i]),j.useEffect(()=>{if(!f||f.sessionId!==t)return;const ae=f.blocks.reduce((ye,he)=>he.type==="text"?ye+(he.target.length-he.displayed.length):ye,0);if(ae<=0){if(f.done&&f.finalMessage){const ye=f.finalMessage;i.setQueryData(["chat-session",t],he=>!he||he.messages.some(Ee=>Ee.id===ye.id)?he:{...he,messages:[...he.messages,ye],lastMessageAt:ye.ts,messageCount:he.messageCount+1}),i.invalidateQueries({queryKey:["chat-sessions"]}),i.invalidateQueries({queryKey:["chat-session",t]}),h(null),v(!1)}return}const be=setTimeout(()=>{h(ye=>{if(!ye)return ye;let he=Math.max(1,Math.ceil(ae/40));const Ee=ye.blocks.map(Ne=>{if(Ne.type!=="text"||he<=0)return Ne;const Ke=Ne.target.length-Ne.displayed.length;if(Ke<=0)return Ne;const ne=Math.min(Ke,he);return he-=ne,{...Ne,displayed:Ne.target.slice(0,Ne.displayed.length+ne)}});return{...ye,blocks:Ee}})},25);return()=>clearTimeout(be)},[f,i,t]),j.useEffect(()=>{if(E.current){const ae=S.current;ae&&(ae.scrollTop=ae.scrollHeight)}},[d.data,f]),j.useEffect(()=>{E.current=!0,N(!1),v(!1)},[t]);const P=j.useCallback(async(ae={})=>{var be,ye;try{const he=await oy({cwd:((be=ae.cwd)==null?void 0:be.trim())||void 0,title:((ye=ae.title)==null?void 0:ye.trim())||void 0,agentKind:ae.agentKind,model:ae.model,providerId:ae.providerId});i.invalidateQueries({queryKey:["chat-sessions"]}),n(`/chat/${he.id}`),U(!1)}catch(he){l({title:e("chat.error.create.title"),body:he instanceof Error?he.message:String(he)})}},[i,n,l,e]),le=j.useCallback(async()=>{const ae=m.trim();if(!ae&&K.length===0||k)return;let be=t;if(!be){const Ee=await oy();i.invalidateQueries({queryKey:["chat-sessions"]}),be=Ee.id,n(`/chat/${be}`,{replace:!0})}E.current=!0,N(!1);const ye=K.map(Ee=>Ee.path),he={id:`optim-${Date.now()}`,role:"user",content:ae||e("chat.placeholder.attachment"),ts:new Date().toISOString(),status:"complete",attachments:ye.length>0?ye:void 0};i.setQueryData(["chat-session",be],Ee=>Ee?{...Ee,messages:[...Ee.messages,he],lastMessageAt:he.ts,messageCount:Ee.messageCount+1}:{id:be,createdAt:he.ts,lastMessageAt:he.ts,title:ae.slice(0,60)||e("chat.placeholder.attachmentTitle"),project:null,messageCount:1,messages:[he]}),b(""),q([]),v(!0);try{await nq(be,ae||e("chat.placeholder.viewAttachment"),ye.length>0?ye:void 0)}catch(Ee){v(!1),console.error("sendMessage failed",Ee),l({title:e("chat.error.send.title"),body:Ee instanceof Error?Ee.message:String(Ee)})}},[m,K,k,t,i,n,l,e]),ve=j.useCallback(async ae=>{if(ae.size>x2){l({title:e("chat.error.fileTooBig.title"),body:e("chat.error.fileTooBig.body",{size:(ae.size/1024/1024).toFixed(2),name:ae.name})});return}let be=t;if(!be){const ye=await oy();i.invalidateQueries({queryKey:["chat-sessions"]}),be=ye.id,n(`/chat/${be}`,{replace:!0})}D(!0);try{const ye=await E4(be,ae);q(he=>[...he,{path:ye.path,name:ye.name}])}catch(ye){l({title:e("chat.error.uploadAttachment.title"),body:ye instanceof Error?ye.message:String(ye)})}finally{D(!1)}},[t,i,n,l,e]),ke=j.useCallback(ae=>{q(be=>be.filter(ye=>ye.path!==ae))},[]),Se=j.useCallback(async(ae,be)=>{await a({title:e("chat.delete.confirm.title"),body:e(be==="cli"?"chat.delete.confirm.body.cli":"chat.delete.confirm.body.console"),confirm:e("chat.delete.confirm.button"),danger:!0})&&(await tq(ae),i.invalidateQueries({queryKey:["chat-sessions"]}),t===ae&&n("/chat"))},[i,t,n,a,e]),J=j.useCallback(async()=>{if(t)try{await iq(t)}catch(ae){l({title:e("chat.error.interrupt.title"),body:ae instanceof Error?ae.message:String(ae)})}},[t,l,e]),ue=f&&f.sessionId===t?f:null;return c.jsxs("div",{className:"grid flex-1 min-h-0 grid-cols-[260px_minmax(0,1fr)] items-stretch gap-4",children:[c.jsxs("aside",{className:"nb-card p-3 overflow-hidden flex h-full min-h-0 flex-col gap-2",children:[c.jsxs("button",{className:"nb-btn nb-btn-primary w-full justify-center",onClick:()=>U(!0),type:"button",children:[c.jsx(pi,{size:14,strokeWidth:3}),e("chat.list.new")]}),c.jsx("div",{className:"mt-2 text-xs font-[family-name:var(--font-heading)] uppercase tracking-wider text-[var(--color-text-muted)] px-2",children:e("chat.list.heading",{count:((Te=o.data)==null?void 0:Te.data.length)??0})}),c.jsx("div",{className:"flex flex-col gap-0.5 mt-1 overflow-auto min-h-0",children:(()=>{var ne;const ae=((ne=o.data)==null?void 0:ne.data)??[],be=Date.now(),ye=10080*60*1e3,he=de=>new Date(de.lastMessageAt??de.createdAt).getTime(),Ee=ae.filter(de=>be-he(de)<=ye),Ne=ae.filter(de=>be-he(de)>ye),Ke=de=>c.jsxs("div",{className:["dimension-menu-item group items-start gap-2 px-3 py-2 pl-4",t===de.id?"dimension-menu-item-active":""].join(" "),children:[c.jsxs("button",{type:"button","aria-label":e("chat.list.openAria",{title:de.title,cwd:de.cwd?e("chat.list.cwdSuffix",{cwd:de.cwd}):""}),onClick:()=>n(`/chat/${de.id}`),className:"flex items-start gap-2 flex-1 min-w-0 text-left",children:[c.jsx(fk,{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:nC(de.lastMessageAt??de.createdAt,e)})}),de.cwd&&c.jsxs("p",{className:"text-[10px] text-[var(--color-text-subtle)] font-[family-name:var(--font-mono)] truncate flex items-center gap-1",title:de.cwd,children:[c.jsx(ph,{size:9,strokeWidth:2.5,className:"flex-shrink-0"}),c.jsx("span",{className:"truncate",dir:"rtl",children:de.cwd})]})]})]}),c.jsx("button",{type:"button","aria-label":de.source==="cli"?e("chat.list.deleteCli.aria"):e("chat.list.delete.aria"),className:"opacity-0 group-hover:opacity-100 p-1 hover:text-[var(--color-crashed)]",onClick:Le=>{Le.stopPropagation(),Se(de.id,de.source)},children:c.jsx(Vi,{size:12})})]},de.id);return c.jsxs(c.Fragment,{children:[Ee.map(Ke),Ne.length>0&&c.jsxs(c.Fragment,{children:[c.jsxs("button",{type:"button",onClick:()=>V(de=>!de),"aria-expanded":z,className:"flex items-center gap-1 px-2 py-1 mt-1 rounded-lg text-xs font-semibold text-[var(--color-text-muted)] hover:text-[var(--color-text)] hover:bg-[var(--color-bg-cream)] focus-visible:outline focus-visible:outline-2",children:[z?c.jsx(Vu,{size:12,strokeWidth:2.5}):c.jsx(Zo,{size:12,strokeWidth:2.5}),e("chat.list.olderToggle",{count:Ne.length})]}),z&&Ne.map(Ke)]}),ae.length===0&&c.jsx("p",{className:"text-xs text-[var(--color-text-subtle)] italic text-center py-4",children:e("chat.list.empty")})]})})()})]}),c.jsx("div",{className:"nb-card p-0 flex h-full min-h-0 flex-col overflow-hidden",children:t?c.jsxs(c.Fragment,{children:[c.jsxs("header",{className:"px-4 py-3 border-b-2 border-[var(--color-text)] bg-color-bg-soft",children:[c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:((Re=d.data)==null?void 0:Re.title)??e("common.loading")}),((Oe=d.data)==null?void 0:Oe.model)&&c.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-[var(--color-accent-yellow)] border-2 border-[var(--color-text)] text-[10px] font-[family-name:var(--font-mono)] font-bold uppercase tracking-wider",title:e("chat.detail.model.tooltip"),children:[c.jsx(hh,{size:11,strokeWidth:2.5})," ",d.data.model]})]}),c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)]",children:t}),((ce=d.data)==null?void 0:ce.claudeSessionId)&&c.jsxs("p",{className:"text-xs text-[var(--color-text-subtle)] font-[family-name:var(--font-mono)] truncate",title:e("chat.detail.claudeSession.tooltip"),children:["claude: ",d.data.claudeSessionId]}),((Ce=d.data)==null?void 0:Ce.cwd)&&c.jsxs("p",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] flex items-center gap-1 mt-1",title:d.data.cwd,children:[c.jsx(ph,{size:11,strokeWidth:2.5,className:"flex-shrink-0"}),c.jsx("span",{className:"truncate",children:d.data.cwd})]})]}),c.jsxs("div",{className:"relative flex-1 flex flex-col min-h-0",children:[c.jsxs("div",{ref:S,onScroll:M,className:"flex-1 overflow-auto p-4 flex flex-col gap-4",children:[(((te=d.data)==null?void 0:te.messages)??[]).filter(ae=>!(ue&&ae.status==="streaming")).map(ae=>c.jsx(oq,{msg:ae,sessionId:t??null,onPreviewAttachment:be=>L(be)},ae.id)),ue&&c.jsx(uq,{pending:ue}),!d.isLoading&&(((pe=d.data)==null?void 0:pe.messages)??[]).length===0&&!ue&&!k&&c.jsx("p",{className:"text-center text-[var(--color-text-subtle)] italic mt-12",children:e("chat.session.empty")})]}),C&&c.jsx("button",{type:"button",onClick: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(RR,{size:18,strokeWidth:3})})]}),((Fe=d.data)==null?void 0:Fe.source)==="cli"?c.jsxs("div",{className:"border-t-2 border-[var(--color-text)] p-4 bg-[var(--color-accent-purple)]",children:[c.jsxs("p",{className:"text-sm font-[family-name:var(--font-mono)] text-[var(--color-text-muted)] text-center",children:[c.jsx("strong",{children:e("chat.cli.banner.bold")})," — ",e("chat.cli.banner")]}),c.jsxs("pre",{className:"mt-2 px-3 py-2 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-md text-xs font-[family-name:var(--font-mono)] overflow-x-auto",children:["sps agent --chat --name ",(t??"").replace(/^session-/,"")]})]}):c.jsxs("div",{className:["border-t-2 border-[var(--color-text)] p-3 transition-colors",H?"bg-[var(--color-accent-mint)]":""].join(" "),onDragOver:ae=>{ae.dataTransfer.types.includes("Files")&&(ae.preventDefault(),ae.dataTransfer.dropEffect="copy",H||Q(!0))},onDragLeave:()=>Q(!1),onDrop:ae=>{if(!ae.dataTransfer.types.includes("Files"))return;ae.preventDefault(),Q(!1);const be=Array.from(ae.dataTransfer.files??[]);for(const ye of be)ve(ye)},children:[(K.length>0||Y)&&c.jsxs("div",{className:"flex flex-wrap gap-2 mb-2",children:[K.map(ae=>c.jsxs("button",{type:"button",className:"flex items-center gap-1.5 px-2 py-1 rounded-md bg-[var(--color-bg)] border-2 border-[var(--color-text)] text-xs font-[family-name:var(--font-mono)] hover:bg-[var(--color-accent-mint)] group",onClick:()=>L(ae.path),title:e("chat.attachment.previewTooltip",{name:ae.name,path:ae.path}),children:[Nh(ae.path)?c.jsx(AL,{size:11,strokeWidth:2.5,className:"flex-shrink-0"}):c.jsx(Fh,{size:11,strokeWidth:2.5,className:"flex-shrink-0"}),c.jsx("span",{className:"truncate max-w-[180px]",children:ae.name}),c.jsx("span",{role:"button","aria-label":e("chat.input.removeAttachment",{name:ae.name}),className:"ml-1 hover:text-[var(--color-crashed)] cursor-pointer",onClick:be=>{be.stopPropagation(),ke(ae.path)},children:c.jsx(bn,{size:11,strokeWidth:3})})]},ae.path)),Y&&c.jsxs("span",{className:"flex items-center gap-1.5 px-2 py-1 text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)]",children:[c.jsx(Xe,{size:11,strokeWidth:2.5,className:"animate-spin"}),e("chat.input.uploading")]})]}),c.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border-[3px] border-[var(--color-text)] bg-white px-3 py-2 shadow-[3px_3px_0_var(--color-text)] focus-within:shadow-[4px_4px_0_var(--color-text)] transition-shadow",children:[c.jsx("textarea",{ref:R,className:"w-full resize-none border-0 !bg-transparent outline-none text-sm leading-relaxed max-h-[200px] px-1 pt-1",placeholder:e(H?"chat.input.dragOver":"chat.input.placeholder"),rows:1,value:m,onChange:ae=>b(ae.target.value),onKeyDown:ae=>{ae.key==="Enter"&&!ae.shiftKey&&!ae.nativeEvent.isComposing&&(ae.preventDefault(),le())},onPaste:ae=>{const ye=Array.from(ae.clipboardData.items??[]).filter(he=>he.kind==="file"&&he.type.startsWith("image/"));if(ye.length!==0){ae.preventDefault();for(const he of ye){const Ee=he.getAsFile();Ee&&ve(Ee)}}},"aria-label":e("chat.input.aria")}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("button",{type:"button",className:O,onClick:()=>I(!0),disabled:k,"aria-label":e("chat.input.attach.aria"),title:e("chat.input.attach.title"),children:c.jsx(VL,{size:15,strokeWidth:2.5})}),c.jsx(aq,{className:O,disabled:k,onInsert:ae=>b(be=>be.trim()?`${be}
|
|
661
|
-
${ae}`:ae)}),c.jsx("div",{className:"flex-1"}),ue?c.jsx("button",{className:"nb-btn nb-btn-danger w-9 h-9 p-0 justify-center",onClick:J,type:"button","aria-label":e("chat.input.interrupt.aria"),title:e("chat.input.interrupt"),children:c.jsx(Fb,{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(GN,{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(fk,{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(lq,{onCancel:()=>U(!1),onCreate:ae=>P(ae)}),F&&c.jsx(dx,{mode:"file",title:e("chat.filePicker.title"),initialPath:((ze=d.data)==null?void 0:ze.cwd)??void 0,onCancel:()=>I(!1),onSelect:ae=>{q(be=>{if(be.some(he=>he.path===ae))return be;const ye=ae.split(/[\\/]/).pop()||ae;return[...be,{path:ae,name:ye}]}),I(!1)}}),G&&t&&c.jsx(sq,{sessionId:t,path:G,onClose:()=>L(null)})]})}function Nh(e){return/\.(png|jpe?g|gif|webp|svg|avif)$/i.test(e)}function IE(e){return/\.pdf$/i.test(e)}function cy(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 sq({sessionId:e,path:t,onClose:n}){const i=Be(),[a,l]=j.useState(null),[o,d]=j.useState(null);j.useEffect(()=>{const g=m=>{m.key==="Escape"&&(m.preventDefault(),n())};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[n]),j.useEffect(()=>{if(!cy(t))return;let g=!1;return fetch(Wy(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=Wy(e,t),h=t.split(/[\\/]/).pop()??t;return c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-[rgba(45,55,72,0.6)] p-4",role:"presentation",children:c.jsxs("div",{className:"nb-card bg-[var(--color-bg)] max-w-3xl w-full p-5 flex flex-col",style:{maxHeight:"85vh"},role:"dialog","aria-modal":"true","aria-label":i("chat.attachment.preview.aria",{name:h}),children:[c.jsxs("header",{className:"flex items-center justify-between mb-3 shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx(aL,{size:16,strokeWidth:2.5,className:"flex-shrink-0"}),c.jsx("h3",{className:"font-[family-name:var(--font-heading)] font-bold text-base truncate",children:h})]}),c.jsx("button",{type:"button",className:"p-1 hover:bg-[var(--color-bg-cream)] rounded flex-shrink-0",onClick:n,"aria-label":i("chat.attachment.close.aria"),children:c.jsx(bn,{size:16,strokeWidth:3})})]}),c.jsx("p",{className:"text-[10px] text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] truncate mb-2 shrink-0",title:t,dir:"rtl",children:t}),c.jsxs("div",{className:"flex-1 overflow-auto border-2 border-[var(--color-text)] rounded-lg bg-[var(--color-bg-cream)] min-h-0",children:[Nh(t)&&c.jsx("div",{className:"flex items-center justify-center p-4",children:c.jsx("img",{src:f,alt:`Preview: ${h}`,className:"max-w-full max-h-[60vh] object-contain"})}),IE(t)&&c.jsx("iframe",{src:f,title:`PDF: ${h}`,className:"w-full",style:{height:"60vh",border:0}}),cy(t)&&c.jsx("pre",{className:"p-3 text-xs font-[family-name:var(--font-mono)] whitespace-pre-wrap break-words",children:o?c.jsx("span",{className:"text-[var(--color-crashed)]",children:i("chat.attachment.readErr",{detail:o})}):a===null?c.jsx("span",{className:"text-[var(--color-text-muted)]",children:i("chat.attachment.loading")}):a}),!Nh(t)&&!IE(t)&&!cy(t)&&c.jsxs("div",{className:"p-6 text-center text-sm text-[var(--color-text-muted)]",children:[c.jsx("p",{className:"mb-3",children:i("chat.attachment.unsupported")}),c.jsx("a",{href:f,download:h,className:"nb-btn nb-btn-primary inline-flex",children:i("chat.attachment.download")})]})]})]})})}function lq({onCancel:e,onCreate:t}){var N;const n=Be(),[i,a]=j.useState(""),[l,o]=j.useState(""),[d,f]=j.useState(""),[h,g]=j.useState(!1),[m,y]=j.useState(!1),[b,k]=j.useState(!1),v=Ye({queryKey:["providers"],queryFn:ux}),S=Ye({queryKey:["system-agents"],queryFn:Gb}),E=y2(((N=v.data)==null?void 0:N.anthropic)??[]);j.useEffect(()=>{var M;if(h)return;const _=(M=S.data)==null?void 0:M.agents.worker;if(!_)return;const T=`${_.providerId||"official"}::${_.model}`;E.some(R=>`${R.providerId}::${R.model}`===T)&&f(T)},[S.data,E,h]),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(bn,{size:16,strokeWidth:3})})]}),c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{children:[c.jsx("label",{htmlFor:"new-session-model",className:"block text-xs font-bold mb-1.5 uppercase tracking-wider",children:n("chat.newSession.field.model")}),c.jsxs("select",{id:"new-session-model",className:"nb-input w-full font-[family-name:var(--font-mono)] text-sm",value:d,onChange:_=>{g(!0),f(_.target.value)},children:[c.jsx("option",{value:"",children:n("chat.newSession.field.model.default")}),E.map(_=>c.jsx("option",{value:`${_.providerId}::${_.model}`,children:_.label},`${_.providerId}::${_.model}`))]})]}),c.jsxs("div",{children:[c.jsx("label",{htmlFor:"new-session-title",className:"block text-xs font-bold mb-1.5 uppercase tracking-wider",children:n("chat.newSession.field.title")}),c.jsx("input",{id:"new-session-title",type:"text",className:"nb-input w-full",placeholder:n("chat.newSession.field.title.placeholder"),value:i,onChange:_=>a(_.target.value),autoFocus:!0})]}),c.jsxs("div",{children:[c.jsx("label",{htmlFor:"new-session-cwd",className:"block text-xs font-bold mb-1.5 uppercase tracking-wider",children:n("chat.newSession.field.cwd")}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{id:"new-session-cwd",type:"text",className:"nb-input flex-1 font-[family-name:var(--font-mono)] text-sm",placeholder:"/home/coral/projects/my-app",value:l,onChange:_=>o(_.target.value)}),c.jsxs("button",{type:"button",className:"nb-btn flex-shrink-0",onClick:()=>k(!0),"aria-label":n("chat.newSession.field.cwd.browseAria"),title:n("chat.newSession.field.cwd.browseAria"),children:[c.jsx(QN,{size:14,strokeWidth:2.5}),n("chat.newSession.field.cwd.browse")]})]}),c.jsxs("p",{className:"text-[11px] text-[var(--color-text-muted)] mt-1.5 leading-relaxed",children:[c.jsx(ph,{size:10,strokeWidth:2.5,className:"inline mr-1 -mt-0.5"}),n("chat.newSession.field.cwd.help1")," ",n("chat.newSession.field.cwd.help2")]})]}),c.jsxs("div",{className:"flex gap-2 justify-end pt-2",children:[c.jsx("button",{type:"button",className:"nb-btn",onClick:e,children:n("chat.newSession.cancel")}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-primary",onClick:C,disabled:m,children:[m?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(pi,{size:14,strokeWidth:3}),n("chat.newSession.create")]})]})]})]}),b&&c.jsx(dx,{initialPath:l.trim()||void 0,onCancel:()=>k(!1),onSelect:_=>{o(_),k(!1)}})]})}function oq({msg:e,sessionId:t,onPreviewAttachment:n}){const i=Be(),a=e.role==="user",l=e.role==="error",o=e.blocks&&e.blocks.length>0?e.blocks:[{type:"text",text:e.content}],d=e.attachments??[];return c.jsx("div",{className:a?"self-end max-w-3xl":"self-start max-w-3xl",children:c.jsxs("div",{className:["nb-card",a?"bg-[var(--color-secondary)]":l?"bg-[var(--color-crashed-bg)]":"bg-surface-input"].join(" "),children:[c.jsxs("p",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-text-muted)] mb-2 flex items-center gap-2",children:[i(a?"chat.message.role.you":l?"chat.message.role.error":"chat.message.role.assistant"),c.jsx("span",{className:"font-normal",children:"·"}),c.jsx("span",{className:"font-normal cursor-help",title:hq(e.ts),children:nC(e.ts,i)})]}),c.jsx("div",{className:"flex flex-col gap-2",children:o.map((f,h)=>c.jsx(dq,{block:f},h))}),d.length>0&&t&&c.jsx("div",{className:"mt-3 pt-3 border-t-2 border-dashed border-[var(--color-text)]/30 flex flex-wrap gap-2",children:d.map(f=>c.jsx(cq,{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 cq({sessionId:e,path:t,onPreview:n}){const i=Be(),a=t.split(/[\\/]/).pop()??t;return Nh(t)?c.jsx("button",{type:"button",onClick:n,className:"block rounded-md overflow-hidden border-2 border-[var(--color-text)] hover:shadow-[2px_2px_0_var(--color-text)] transition-shadow",title:i("chat.attachment.previewSimpleTooltip",{name:a}),children:c.jsx("img",{src:Wy(e,t),alt:a,className:"block max-h-40 max-w-[12rem] object-cover",loading:"lazy"})}):c.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1.5 px-2 py-1 rounded-md bg-[var(--color-bg)] border-2 border-[var(--color-text)] text-xs font-[family-name:var(--font-mono)] hover:bg-[var(--color-accent-mint)]",title:i("chat.attachment.previewTooltip",{name:a,path:t}),children:[c.jsx(Fh,{size:11,strokeWidth:2.5,className:"flex-shrink-0"}),c.jsx("span",{className:"truncate max-w-[200px]",children:a})]})}function uq({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(eC,{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(tC,{tool:n},i)})]})]})})}function dq({block:e}){return e.type==="text"?c.jsx(eC,{text:e.text}):c.jsx(tC,{tool:e})}function eC({text:e}){return e?c.jsx("div",{className:"text-sm font-[family-name:var(--font-body)] break-words prose-chat",children:c.jsx(Tx,{remarkPlugins:[Rx],rehypePlugins:[zx],children:e})}):null}function fq(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 tC({tool:e}){const[t,n]=j.useState(!1),i=e.status==="completed"||e.status==="complete",a=e.status==="failed",l=!i&&!a,o=fq(e.input),d=e.input!=null&&(typeof e.input!="object"||Object.keys(e.input).length>0);return c.jsxs("div",{className:"border-2 border-[var(--color-text)] rounded-lg overflow-hidden bg-[var(--color-bg-cream)]",children:[c.jsxs("button",{type:"button",onClick:()=>n(f=>!f),className:"w-full bg-color-bg-soft-button flex items-center gap-2 px-3 py-2 text-xs font-[family-name:var(--font-mono)] hover:bg-[var(--color-accent-yellow)] transition-colors",children:[c.jsx(Zo,{size:12,strokeWidth:3,className:["transition-transform flex-shrink-0",t?"rotate-90":""].join(" ")}),c.jsx(o_,{size:12,strokeWidth:2.5,className:"flex-shrink-0"}),c.jsx("span",{className:"font-bold flex-shrink-0",children:e.title||e.kind}),c.jsx("span",{className:"flex-1 text-left text-[var(--color-text-muted)] truncate",title:o,children:o}),l&&c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin text-[var(--color-running)] flex-shrink-0"}),i&&c.jsx(Eu,{size:12,strokeWidth:2.5,className:"text-[var(--color-running)] flex-shrink-0"}),a&&c.jsx(VN,{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 nC(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 hq(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 pq(){return ft("/api/processes").then(e=>e.data)}function mq(e){return gr(`/api/processes/${e}/kill`)}function gq(){return ft("/api/processes/reclaim")}async function yq(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 zE="nb-card";function bq(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 uy(e){return e.project?e.project:e.cwd?e.cwd.split("/").filter(Boolean).pop()??e.slot:e.slot}function PE(e){const t=/^session-chat-(.+)$/.exec(e.slot);return(t==null?void 0:t[1])??null}function xq({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 vq(){var k;const e=Be(),t=Ft(),[n,i]=j.useState(null),[a,l]=j.useState("all"),o=Ye({queryKey:["processes"],queryFn:pq,refetchInterval:5e3}),d=Et({mutationFn:mq,onSuccess:v=>{i(v.message),t.invalidateQueries({queryKey:["processes"]})},onError:v=>i(v instanceof Error?v.message:String(v))}),f=Ye({queryKey:["reclaim"],queryFn:gq}),[h,g]=j.useState("");j.useEffect(()=>{f.data&&h===""&&g(String(f.data.idleMinutes))},[f.data,h]);const m=Et({mutationFn:v=>yq(v),onSuccess:v=>{i(`自动回收已设为 ${v.idleMinutes} 分钟空闲`),t.invalidateQueries({queryKey:["reclaim"]})},onError:v=>i(v instanceof Error?v.message:String(v))}),y=o.data??[],b=y.filter(v=>a==="all"?!0:v.kind===a);return c.jsxs("div",{className:"max-w-full",children:[c.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[c.jsx(hh,{size:22,strokeWidth:2.5}),c.jsx("h1",{className:"font-[family-name:var(--font-heading)] font-bold text-2xl",children:e("processes.title")}),c.jsxs("button",{type:"button","aria-label":e("processes.refresh"),onClick:()=>t.invalidateQueries({queryKey:["processes"]}),className:"nb-btn ml-auto text-sm",children:[o.isFetching?c.jsx(Xe,{size:15,className:"animate-spin"}):c.jsx(ya,{size:15}),e("processes.refresh")]})]}),c.jsxs("p",{className:"text-sm text-[var(--color-text)]/70 mb-3",children:[e("processes.subtitle")," · ",e("processes.aliveCount").replace("{n}",String(y.length))]}),c.jsxs("div",{className:`${zE} px-4 py-3 mb-4 flex flex-wrap items-center gap-2`,children:[c.jsx(E3,{size:16,strokeWidth:2.5}),c.jsx("span",{className:"text-sm font-bold",children:"自动回收"}),c.jsx("span",{className:"text-sm text-[var(--color-text)]/70",children:"会话空闲"}),c.jsx("input",{type:"number",min:1,max:1440,value:h,onChange:v=>g(v.target.value),className:"nb-input w-20 px-2 py-1 font-[family-name:var(--font-mono)] text-sm","aria-label":"自动回收空闲分钟数"}),c.jsx("span",{className:"text-sm text-[var(--color-text)]/70",children:"分钟后自动停(下次访问自动续上,不丢上下文)"}),c.jsxs("button",{type:"button",disabled:m.isPending||h===""||Number(h)===((k=f.data)==null?void 0:k.idleMinutes),onClick:()=>m.mutate(Math.round(Number(h))),className:"nb-btn nb-btn-primary ml-auto text-sm disabled:opacity-50","aria-label":"保存自动回收设置",children:[m.isPending?c.jsx(Xe,{size:14,className:"animate-spin"}):c.jsx(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:`${zE} 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"&&PE(v)?c.jsxs(vs,{to:`/chat/${PE(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(XN,{size:12,strokeWidth:2.5})," ",uy(v)]}):v.kind==="worker"&&v.project?c.jsxs(vs,{to:`/board?project=${encodeURIComponent(v.project)}`,className:"inline-flex items-center gap-1 font-semibold text-[var(--color-text)] underline decoration-2 underline-offset-2 hover:opacity-70",title:"打开该项目看板",children:[c.jsx(hh,{size:12,strokeWidth:2.5})," ",uy(v)]}):c.jsx("span",{children:uy(v)})}),c.jsx("td",{className:"px-3 py-2",children:v.pid??"—"}),c.jsx("td",{className:"px-3 py-2",children:c.jsx(xq,{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:bq(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(VN,{size:13})," ",e("processes.kill")]}):c.jsx("span",{className:"text-[var(--color-text)]/40 text-xs",children:"—"})})]},v.slot))]})]})})]})}function wq(e={}){const t=new URLSearchParams;e.project&&t.set("project",e.project),e.action&&t.set("action",e.action);const n=t.toString();return ft(`/api/audit${n?`?${n}`:""}`).then(i=>i.data)}const kq="nb-card",Eq={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 Sq(){const e=Be(),t=Ft(),[n,i]=j.useState(""),a=Ye({queryKey:["audit",n],queryFn:()=>wq(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(Ub,{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:`${kq} 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 ${Eq[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 Nq=["convention","decision","gotcha","pattern","reference","note"];function is(e){return`${e.scope}:${e.project??e.agentId??""}`}function Bf(e){return e.scope==="global"?`全局 (${e.count})`:e.scope==="project"?`项目:${e.project} (${e.count})`:`会话:${e.agentId} (${e.count})`}function Vs(e){const t={scope:e.scope};return e.project&&(t.project=e.project),e.agentId&&(t.agentId=e.agentId),t}async function 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 _q=()=>({title:"",body:"",category:"note",tags:"",salience:3});function jq(){var ke,Se,J,ue,Te,Re,Oe,ce,Ce;const e=Be(),[t,n]=j.useState([]),[i,a]=j.useState(null),[l,o]=j.useState(!1),[d,f]=j.useState([]),[h,g]=j.useState(null),[m,y]=j.useState(!1),[b,k]=j.useState(""),[v,S]=j.useState(!0),[E,C]=j.useState([]),[N,_]=j.useState(null),[T,M]=j.useState(null),[R,O]=j.useState(null),[B,U]=j.useState(null),[K,q]=j.useState(""),[Y,D]=j.useState(""),F=j.useCallback(async()=>{try{const{scopes:te}=await Nr("/api/memory/scopes");n(te),a(pe=>pe??te[0]??null)}catch(te){g(te instanceof Error?te.message:String(te))}},[]),I=j.useCallback(async te=>{try{const pe=new URLSearchParams(Vs(te)).toString(),{data:Fe}=await Nr(`/api/memory/entries?${pe}`);f(Fe)}catch(pe){g(pe instanceof Error?pe.message:String(pe))}},[]);j.useEffect(()=>{F(),Nr("/api/system/memory").then(te=>{U(te),q(te.mode),D(te.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(te=>O(te)).catch(()=>O(null)):O(null)},[i,I]);const H=j.useCallback(async()=>{if(!b.trim()){C([]);return}y(!0),g(null);try{const te=new URLSearchParams({q:b,limit:"20"});if(v)te.set("all","1");else if(i)for(const[Fe,ze]of Object.entries(Vs(i)))te.set(Fe,ze);const{results:pe}=await Nr(`/api/memory/recall?${te.toString()}`);C(pe)}catch(te){g(te instanceof Error?te.message:String(te))}finally{y(!1)}},[b,v,i]),Q=j.useCallback(async()=>{if(!(!i||!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(te=>te.trim()).filter(Boolean),salience:N.salience})}),_(null),await Promise.all([I(i),F()])}catch(te){g(te instanceof Error?te.message:String(te))}finally{y(!1)}}},[i,N,I,F]),G=j.useCallback(async te=>{if(i){y(!0),g(null);try{const pe=new URLSearchParams(Vs(i)).toString();await Nr(`/api/memory/entries/${encodeURIComponent(te)}?${pe}`,{method:"DELETE"}),await Promise.all([I(i),F()])}catch(pe){g(pe instanceof Error?pe.message:String(pe))}finally{y(!1)}}},[i,I,F]),L=j.useCallback(async(te,pe,Fe)=>{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:te.id,to:Vs(pe),move:Fe})}),M(null),await Promise.all([I(i),F()])}catch(ze){g(ze instanceof Error?ze.message:String(ze))}finally{y(!1)}}},[i,I,F]),z=j.useCallback(async()=>{if(i){y(!0),g(null);try{const pe=(await Nr("/api/memory/gc",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(Vs(i))})).results[0];pe&&g(`收敛完成:清 tombstone ${pe.purged}、去重 ${pe.deduped}、剩余 ${pe.kept}`),await Promise.all([I(i),F()])}catch(te){g(te instanceof Error?te.message:String(te))}finally{y(!1)}}},[i,I,F]),V=j.useCallback(async()=>{y(!0),g(null);try{const te=await Nr("/api/system/memory",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({mode:K,externalUrl:Y})});U(te),q(te.mode),D(te.externalUrl),g("模式已保存(重启 worker 生效)")}catch(te){g(te instanceof Error?te.message:String(te))}finally{y(!1)}},[K,Y]),P=B!=null&&(K!==B.mode||Y!==B.externalUrl),le=K==="external"||K==="local+external",ve=j.useMemo(()=>T?t.filter(te=>is(te)!==is(i??{scope:""})):[],[T,t,i]);return c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[c.jsxs("h1",{className:"font-[family-name:var(--font-heading)] font-bold text-2xl text-[var(--color-text)]",children:["🧠 ",e("nav.memory")]}),c.jsx("span",{className:"text-xs text-[var(--color-text)] opacity-60",children:"本地记忆 v2 · markdown 真源"})]}),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:te=>q(te.target.value),"aria-label":"记忆模式",children:B.modeOptions.map(te=>c.jsx("option",{value:te,children:te},te))})]}),le&&c.jsxs("label",{className:"flex flex-col gap-1 text-sm flex-1 min-w-[220px]",children:[c.jsx("span",{className:"font-bold",children:"外部后端地址"}),c.jsx("input",{className:"nb-input font-[family-name:var(--font-mono)] text-xs",value:Y,onChange:te=>D(te.target.value),placeholder:"http://127.0.0.1:3113",spellCheck:!1,"aria-label":"外部后端地址"})]}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-mint",onClick:V,disabled:m||!P,"aria-label":"保存模式",children:"保存模式"})]}),c.jsxs("div",{className:"flex gap-2 flex-wrap items-center",children:[c.jsx("input",{value:b,onChange:te=>k(te.target.value),onKeyDown:te=>te.key==="Enter"&&H(),placeholder:"检索记忆…","aria-label":"检索记忆",className:"nb-input flex-1 min-w-[200px] font-[family-name:var(--font-mono)] text-sm"}),c.jsxs("label",{className:"flex items-center gap-1 text-sm font-semibold",children:[c.jsx("input",{type:"checkbox",checked:v,onChange:te=>S(te.target.checked),"aria-label":"全局检索"}),"全局"]}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-mint",onClick:H,disabled:m,"aria-label":"检索",children:m?"…":"检索"})]}),h&&c.jsxs("div",{className:"text-sm text-[var(--color-text)] font-semibold nb-card py-2",children:["ℹ ",h]}),E.length>0&&c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] font-bold text-sm",children:["检索结果(",E.length,")"]}),E.map(te=>c.jsxs("div",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center gap-2 text-xs opacity-60 font-[family-name:var(--font-mono)]",children:[c.jsx("span",{className:"nb-badge",children:te.source==="external"?"🌐 外部":"📁 本地"}),c.jsx("span",{children:te.source==="external"?te.type??"":te.scope==="project"?`项目:${te.project}`:te.scope}),te.category&&c.jsxs(c.Fragment,{children:[c.jsx("span",{children:"·"}),c.jsx("span",{children:te.category})]})]}),c.jsx("div",{className:"font-bold text-sm mt-1",children:te.title}),c.jsx("div",{className:"text-sm mt-1 whitespace-pre-wrap opacity-80",children:te.snippet.slice(0,300)})]},te.id))]}),(()=>{const te=new Date(Date.now()-6048e5).toISOString(),pe=i?is(i):"",Fe=l?t:t.filter(ae=>ae.scope!=="project"||ae.updated>=te||is(ae)===pe),ze=t.length-Fe.length;return c.jsxs("div",{className:"flex gap-2 flex-wrap items-center",children:[c.jsx("select",{className:"nb-input",value:pe,onChange:ae=>a(t.find(be=>is(be)===ae.target.value)??null),"aria-label":"选择作用域",children:Fe.map(ae=>c.jsx("option",{value:is(ae),children:Bf(ae)},is(ae)))}),(ze>0||l)&&c.jsx("button",{type:"button",className:"nb-btn text-xs",onClick:()=>o(ae=>!ae),"aria-label":l?"收起更早项目":"显示更早项目",children:l?"收起更早":`含更早 (${ze})`}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-blue",onClick:()=>_(_q()),disabled:!i,"aria-label":"新建记忆",children:"+ 新建"}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-yellow",onClick:z,disabled:m||!i,"aria-label":"收敛去重",children:"收敛"})]})})(),R&&((Se=(ke=R.profile)==null?void 0:ke.topConcepts)!=null&&Se.length||(ue=(J=R.graph)==null?void 0:J.edges)!=null&&ue.length)?c.jsxs("section",{className:"nb-card flex flex-col gap-1",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] font-bold text-sm",children:"🌐 外部智能(agentmemory)"}),(Re=(Te=R.profile)==null?void 0:Te.topConcepts)!=null&&Re.length?c.jsxs("div",{className:"text-xs",children:[c.jsx("span",{className:"font-bold",children:"概念:"}),R.profile.topConcepts.slice(0,8).map(te=>c.jsx("span",{className:"nb-badge ml-1",children:te.concept},te.concept))]}):null,c.jsxs("div",{className:"text-xs opacity-70 font-[family-name:var(--font-mono)]",children:["知识图谱 ",((ce=(Oe=R.graph)==null?void 0:Oe.edges)==null?void 0:ce.length)??0," 条边 · 观测 ",((Ce=R.profile)==null?void 0:Ce.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:te=>_({...N,title:te.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:te=>_({...N,category:te.target.value}),"aria-label":"类别",children:Nq.map(te=>c.jsx("option",{value:te,children:te},te))}),c.jsx("input",{className:"nb-input flex-1 min-w-[160px] text-sm",value:N.tags,onChange:te=>_({...N,tags:te.target.value}),placeholder:"标签(逗号分隔)","aria-label":"标签"}),c.jsxs("label",{className:"flex items-center gap-1 text-sm",children:["显著度",c.jsx("input",{className:"nb-input w-16",type:"number",min:1,max:5,value:N.salience,onChange:te=>_({...N,salience:Number(te.target.value)}),"aria-label":"显著度"})]})]}),c.jsx("textarea",{className:"nb-input font-[family-name:var(--font-mono)] text-sm min-h-[120px]",value:N.body,onChange:te=>_({...N,body:te.target.value}),placeholder:"正文","aria-label":"正文"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"button",className:"nb-btn nb-btn-mint",onClick:Q,disabled:m||!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?Bf(i):"条目"}),d.length===0&&c.jsx("div",{className:"nb-card text-sm opacity-60",children:"(无记忆)"}),d.map(te=>c.jsxs("div",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center gap-2 text-xs opacity-60 font-[family-name:var(--font-mono)] flex-wrap",children:[c.jsx("span",{className:"nb-badge",children:te.category}),c.jsxs("span",{children:["s",te.salience]}),c.jsx("span",{children:"·"}),c.jsx("span",{children:te.source}),te.tags.map(pe=>c.jsxs("span",{children:["#",pe]},pe))]}),c.jsx("div",{className:"font-bold text-sm mt-1",children:te.title}),c.jsx("div",{className:"text-sm mt-1 whitespace-pre-wrap opacity-80",children:te.body.slice(0,400)}),c.jsxs("div",{className:"flex gap-2 mt-2",children:[c.jsx("button",{type:"button",className:"nb-btn nb-btn-blue text-xs",onClick:()=>_({id:te.id,title:te.title,body:te.body,category:te.category,tags:te.tags.join(", "),salience:te.salience}),"aria-label":"编辑",children:"编辑"}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-purple text-xs",onClick:()=>M(te),"aria-label":"提升",children:"提升"}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-danger text-xs",onClick:()=>G(te.id),"aria-label":"删除",children:"删除"})]}),(T==null?void 0:T.id)===te.id&&c.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 border-t-[3px] border-[var(--color-text)] pt-2",children:[c.jsx("span",{className:"text-xs font-bold",children:"提升到:"}),ve.map(pe=>c.jsx("button",{type:"button",className:"nb-btn nb-btn-mint text-xs",onClick:()=>L(te,pe,!1),"aria-label":`复制到${Bf(pe)}`,children:Bf(pe)},is(pe))),ve.length===0&&c.jsx("span",{className:"text-xs opacity-60",children:"(无其它作用域)"}),c.jsx("button",{type:"button",className:"nb-btn text-xs",onClick:()=>M(null),"aria-label":"取消提升",children:"取消"})]})]},te.id))]})]})}async function Cq(){return(await ft("/api/channels")).data??{console:{},adapters:[]}}async function Aq(e){return(await Kb("/api/channels",e)).data}async function Tq(){return(await ft("/api/codex-proxy")).data}async function Mq(){return(await gr("/api/codex-proxy/install")).data}async function Dq(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 Oq(){return(await gr("/api/codex-proxy/auth/start")).data}async function Rq(){await gr("/api/codex-proxy/auth/cancel")}const BE=[{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 Lq(){const e=Be(),[t,n]=j.useState("memory");return c.jsxs("div",{className:"flex flex-col gap-6 w-full",children:[c.jsxs("header",{children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold",children:e("plugins.h1")}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:e("plugins.desc")})]}),c.jsx("div",{role:"tablist","aria-label":e("plugins.h1"),className:"flex gap-2 flex-wrap",children:BE.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(qq,{}):t==="model"?c.jsx(Pq,{}):c.jsx(Iq,{label:e(BE.find(i=>i.key===t).labelKey)})})]})}function Iq({label:e}){const t=Be();return c.jsx("section",{className:"nb-card",children:c.jsxs("p",{className:"text-[var(--color-text-muted)] text-sm",children:[e," — ",t("plugins.comingSoon")]})})}function zq(){var k,v,S;const e=Be(),t=Ft(),{alert:n}=un(),i=Ye({queryKey:["system-memory"],queryFn:W3}),[a,l]=j.useState(null),[o,d]=j.useState(null);j.useEffect(()=>{i.data&&a===null&&(l(i.data.provider),d(i.data.url))},[i.data,a]);const f=a??((k=i.data)==null?void 0:k.provider)??"agentmemory",h=o??((v=i.data)==null?void 0:v.url)??"",g=i.data!=null&&(f!==i.data.provider||f==="custom"&&h!==i.data.url),m=E=>{const C=`system.memory.opt.${E}`;return e(C)},y=Et({mutationFn:()=>X3(f,f==="custom"?h:""),onSuccess:()=>{t.invalidateQueries({queryKey:["system-memory"]}),t.invalidateQueries({queryKey:["system-env"]})},onError:E=>{n({title:e("system.memory.error"),body:E instanceof Error?E.message:String(E)})}}),b=((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:h,onChange:E=>d(E.target.value),placeholder:e("system.memory.url.placeholder"),spellCheck:!1,"aria-label":e("system.memory.url")})]}),c.jsx("div",{className:"flex justify-end",children:c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 12px",fontSize:12},onClick:()=>y.mutate(),disabled:!g||y.isPending,type:"button","aria-label":e("system.memory.save.aria"),children:[y.isPending?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(mr,{size:12,strokeWidth:3}),y.isSuccess&&!g?e("system.memory.saved"):e("system.memory.save")]})})]})]})}function Pq(){var S,E,C;const e=Ft(),{alert:t,confirm:n}=un(),i=Ye({queryKey:["providers"],queryFn:ux}),l=(S=Ye({queryKey:["system-agents"],queryFn:Gb}).data)==null?void 0:S.agents,[o,d]=j.useState(null),f=Et({mutationFn:()=>v4(o.kind,o.entry),onSuccess:()=>{d(null),e.invalidateQueries({queryKey:["providers"]})},onError:N=>void t({title:"保存失败",body:N instanceof Error?N.message:String(N)})}),h=Et({mutationFn:N=>w4(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=>Z3(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 R={...l.worker,model:T};_==="official"?delete R.providerId:R.providerId=_,M={...l,worker:R}}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(pi,{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($q,{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(e_,{size:12,strokeWidth:3})}),c.jsx("button",{className:"nb-btn nb-btn-danger",style:{padding:"4px 8px"},type:"button",onClick:async()=>{await n({title:"删除端点",body:`删除 ${_.id}?`,danger:!0})&&h.mutate({kind: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(Bq,{state:o,onChange:N=>d({...o,entry:N}),onCancel:()=>d(null),onSave:()=>f.mutate(),saving:f.isPending})})})]})}function Bq({state:e,onChange:t,onCancel:n,onSave:i,saving:a}){const l=e.entry,o=f=>t({...l,...f}),d=/^[a-zA-Z0-9_-]+$/.test(l.id)&&l.name.trim()&&l.baseUrl.trim();return c.jsxs("div",{className:"border-[3px] border-[var(--color-text)] rounded-2xl p-6 bg-[var(--color-bg-cream)] shadow-[6px_6px_0_var(--color-text)] flex flex-col gap-4 w-[min(92vw,640px)] max-h-[88vh] overflow-y-auto",children:[c.jsxs("span",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:[e.isNew?"新增端点":`编辑 ${l.id}`,c.jsxs("span",{className:"text-[var(--color-text-muted)] text-sm font-normal",children:["(",e.kind,")"]})]}),c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:["id(英数 _ -)",c.jsx("input",{className:"nb-input font-[family-name:var(--font-mono)]",value:l.id,disabled:!e.isNew,onChange:f=>o({id:f.target.value}),placeholder:"如 my-openai",spellCheck:!1})]}),c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:["名称",c.jsx("input",{className:"nb-input",value:l.name,onChange:f=>o({name:f.target.value}),placeholder:"显示名"})]})]}),c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:["Base URL",c.jsx("input",{className:"nb-input font-[family-name:var(--font-mono)] text-sm",value:l.baseUrl,onChange:f=>o({baseUrl:f.target.value}),placeholder:"https://api.example.com/v1",spellCheck:!1})]}),c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:["API Key",!e.isNew&&"(留空=保留)",c.jsx("input",{className:"nb-input font-[family-name:var(--font-mono)] text-sm",type:"password",value:l.apiKey??"",onChange:f=>o({apiKey:f.target.value}),placeholder:e.isNew?"sk-...":"••••(留空不改)",spellCheck:!1})]}),c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:["Models(逗号或换行分隔)",c.jsx("textarea",{className:"nb-input font-[family-name:var(--font-mono)] text-sm",rows:5,value:l.models.join(", "),onChange:f=>o({models:f.target.value.split(/[,\n]/).map(h=>h.trim()).filter(Boolean)}),placeholder:"gpt-5.4, gpt-4o",spellCheck:!1})]}),c.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[c.jsx("button",{className:"nb-btn",style:{padding:"8px 16px"},type:"button",onClick:n,children:"取消"}),c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"8px 16px"},type:"button",disabled:!d||a,onClick:i,children:[a?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(mr,{size:14,strokeWidth:3})," 保存"]})]})]})}function $q({isDefault:e,pickDefault:t,setDefaultPending:n}){const i=Ft(),{alert:a,confirm:l}=un(),[o,d]=j.useState(!1),[f,h]=j.useState(null),[g,m]=j.useState(!1),[y,b]=j.useState(!1),[k,v]=j.useState(!1),E=Ye({queryKey:["codex-proxy"],queryFn:Tq,refetchInterval:o?3e3:!1}).data;j.useEffect(()=>{o&&(E!=null&&E.authed)&&(d(!1),h(null),i.invalidateQueries({queryKey:["codex-proxy"]}))},[o,E==null?void 0:E.authed,i]);const C=Et({mutationFn:Mq,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=>Dq(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),h(null);try{const B=await Oq();h(B)}catch(B){d(!1),a({title:"订阅失败",body:B instanceof Error?B.message:String(B)})}},M=()=>{Rq(),d(!1),h(null)},R=C.isPending||(E==null?void 0:E.installing),O=k&&(E!=null&&E.models.all.length)?E.models.all:(E==null?void 0:E.models.curated)??[];return c.jsxs("div",{className:"rounded-lg px-3 py-2 border-2 border-[var(--color-text)]",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold text-sm",children:"codex-proxy"}),c.jsx("span",{className:"text-[var(--color-text-muted)] text-sm",children:" · ChatGPT 订阅"}),c.jsx("div",{className:"text-xs text-[var(--color-text-muted)] truncate",children:E?E.binInstalled?E.authed?`已订阅${E.account?` · ${E.account.slice(0,8)}…`:""} · worker 出 GPT`:"已安装 · 未订阅":"未安装 claude-code-proxy":"加载中…"})]}),(E==null?void 0:E.binInstalled)&&c.jsx("button",{className:"nb-btn nb-btn-danger shrink-0",style:{padding:"4px 8px"},type:"button",onClick:()=>m(!0),"aria-label":"卸载 codex-proxy",children:c.jsx(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:[O.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(OL,{size:12,strokeWidth:3})," 订阅(授权 ChatGPT)"]}):c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"4px 12px",fontSize:12},type:"button",disabled:!!R,onClick:_,children:[R?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(Uh,{size:12,strokeWidth:3}),R?" 安装中…":" 安装插件"]}):c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin text-[var(--color-text-muted)]"})}),o&&c.jsxs($E,{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(iL,{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($E,{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 $E({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 Uq=["telegram","dingtalk","matrix","slack","discord","feishu"],gu={telegram:"Telegram",dingtalk:"钉钉 (Stream)",matrix:"Matrix",slack:"Slack",discord:"Discord",feishu:"飞书 / Lark"},Fq={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 qq(){var k,v,S;const e=Ft(),{alert:t}=un(),n=Ye({queryKey:["channels"],queryFn:Cq}),[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:()=>Aq(i),onSuccess:E=>{a({console:E.console??{},adapters:E.adapters??[]}),e.invalidateQueries({queryKey:["channels"]})},onError:E=>void t({title:"保存失败",body:E instanceof Error?E.message:String(E)})});if(!i)return c.jsx("section",{className:"nb-card",children:c.jsxs("p",{className:"text-sm text-[var(--color-text-muted)] flex items-center gap-2",children:[c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"})," 加载频道配置…"]})});const f=i.adapters??[],h=JSON.stringify(i)!==JSON.stringify({console:((k=n.data)==null?void 0:k.console)??{},adapters:((v=n.data)==null?void 0:v.adapters)??[]}),g=E=>{const C=[...f,{kind:E,enabled:!0}];a({...i,adapters:C}),o({type:"adapter",index:C.length-1})},m=E=>{const C=f.filter((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:!h||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(UE,{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(UE,{label:gu[E.kind]??E.kind,sub:E.enabled===!1?"已停用":"启用",active:l.type==="adapter"&&l.index===C,onClick:()=>o({type:"adapter",index:C})},C)),c.jsxs("div",{className:"mt-2",children:[c.jsx("span",{className:"text-xs font-bold text-[var(--color-text-muted)]",children:"添加频道"}),c.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1.5",children:Uq.map(E=>c.jsxs("button",{className:"nb-btn",style:{padding:"4px 8px",fontSize:12},type:"button",onClick:()=>g(E),"aria-label":`添加 ${gu[E]} 频道`,children:[c.jsx(pi,{size:11,strokeWidth:3})," ",gu[E]]},E))})]})]}),c.jsx("div",{className:"border-2 bg-surface-input border-[var(--color-text)] rounded-xl p-4 bg-[var(--color-bg-cream)]",children:(()=>{if(l.type!=="adapter")return c.jsx(FE,{console:i.console??{},onChange:b});const E=f[l.index];if(!E)return c.jsx(FE,{console:i.console??{},onChange:b});const C=l.index;return c.jsx(Hq,{adapter:E,onChange:N=>y(C,N),onRemove:()=>m(C)})})()})]})]})}function UE({label:e,sub:t,active:n,onClick:i}){return c.jsxs("button",{type:"button",onClick:i,"aria-pressed":n,className:["text-left rounded-lg px-3 py-2 border-2 border-[var(--color-text)] transition-transform duration-150",n?"bg-[var(--color-accent-mint)] shadow-[3px_3px_0_var(--color-text)]":"bg-white hover:-translate-x-px hover:-translate-y-px hover:shadow-[3px_3px_0_var(--color-text)]"].join(" "),children:[c.jsx("div",{className:"font-bold text-sm",children:e}),c.jsx("div",{className:"text-xs text-[var(--color-text-muted)] truncate font-[family-name:var(--font-mono)]",children:t})]})}function FE({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 Hq({adapter:e,onChange:t,onRemove:n}){const{confirm:i}=un(),a=Fq[e.kind]??[],l=e.enabled!==!1;return c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{className:"flex items-start justify-between gap-2",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:gu[e.kind]??e.kind}),c.jsxs("span",{className:"text-[var(--color-text-muted)] text-sm font-[family-name:var(--font-mono)]",children:[" · ",e.kind]})]}),c.jsxs("button",{className:"nb-btn nb-btn-danger shrink-0",style:{padding:"4px 10px",fontSize:12},type:"button",onClick:async()=>{await i({title:"删除频道",body:`删除 ${gu[e.kind]??e.kind} 频道?`,danger:!0})&&n()},"aria-label":"删除频道",children:[c.jsx(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(Kq,{spec:o,value:e[o.key],onChange:d=>t({[o.key]:d})},o.key))]})}function Kq({spec:e,value:t,onChange:n}){if(e.type==="list"){const i=Array.isArray(t)?t.map(String):[];return c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:[e.label,c.jsx("textarea",{className:"nb-input font-[family-name:var(--font-mono)] text-sm",rows:2,value:i.join(", "),onChange:a=>{const l=a.target.value.split(/[,\n]/).map(o=>o.trim()).filter(Boolean);n(l.length?l:void 0)},placeholder:e.placeholder,spellCheck:!1})]})}return c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:[e.label,c.jsx("input",{className:"nb-input font-[family-name:var(--font-mono)] text-sm",type:e.type==="password"?"password":"text",value:t==null?"":String(t),onChange:i=>{const a=i.target.value;e.type==="number"?n(a.trim()===""?void 0:Number(a)):n(a===""?void 0:a)},placeholder:e.placeholder,spellCheck:!1})]})}function Nn(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,i;n<e.length;n++)(i=Nn(e[n]))!==""&&(t+=(t&&" ")+i);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Gq={value:()=>{}};function cp(){for(var e=0,t=arguments.length,n={},i;e<t;++e){if(!(i=arguments[e]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new ih(n)}function ih(e){this._=e}function Vq(e,t){return e.trim().split(/^|\s+/).map(function(n){var i="",a=n.indexOf(".");if(a>=0&&(i=n.slice(a+1),n=n.slice(0,a)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}ih.prototype=cp.prototype={constructor:ih,on:function(e,t){var n=this._,i=Vq(e+"",n),a,l=-1,o=i.length;if(arguments.length<2){for(;++l<o;)if((a=(e=i[l]).type)&&(a=Yq(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 ih(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var n=new Array(a),i=0,a,l;i<a;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],i=0,a=l.length;i<a;++i)l[i].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],a=0,l=i.length;a<l;++a)i[a].value.apply(t,n)}};function Yq(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]=Gq,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}var ub="http://www.w3.org/1999/xhtml";const HE={svg:"http://www.w3.org/2000/svg",xhtml:ub,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function up(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),HE.hasOwnProperty(t)?{space:HE[t],local:e}:e}function Qq(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ub&&t.documentElement.namespaceURI===ub?t.createElement(e):t.createElementNS(n,e)}}function Wq(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function iC(e){var t=up(e);return(t.local?Wq:Qq)(t)}function Xq(){}function Bx(e){return e==null?Xq:function(){return this.querySelector(e)}}function Zq(e){typeof e!="function"&&(e=Bx(e));for(var t=this._groups,n=t.length,i=new Array(n),a=0;a<n;++a)for(var l=t[a],o=l.length,d=i[a]=new Array(o),f,h,g=0;g<o;++g)(f=l[g])&&(h=e.call(f,f.__data__,g,l))&&("__data__"in f&&(h.__data__=f.__data__),d[g]=h);return new Ci(i,this._parents)}function Jq(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function eH(){return[]}function rC(e){return e==null?eH:function(){return this.querySelectorAll(e)}}function tH(e){return function(){return Jq(e.apply(this,arguments))}}function nH(e){typeof e=="function"?e=tH(e):e=rC(e);for(var t=this._groups,n=t.length,i=[],a=[],l=0;l<n;++l)for(var o=t[l],d=o.length,f,h=0;h<d;++h)(f=o[h])&&(i.push(e.call(f,f.__data__,h,o)),a.push(f));return new Ci(i,a)}function aC(e){return function(){return this.matches(e)}}function sC(e){return function(t){return t.matches(e)}}var iH=Array.prototype.find;function rH(e){return function(){return iH.call(this.children,e)}}function aH(){return this.firstElementChild}function sH(e){return this.select(e==null?aH:rH(typeof e=="function"?e:sC(e)))}var lH=Array.prototype.filter;function oH(){return Array.from(this.children)}function cH(e){return function(){return lH.call(this.children,e)}}function uH(e){return this.selectAll(e==null?oH:cH(typeof e=="function"?e:sC(e)))}function dH(e){typeof e!="function"&&(e=aC(e));for(var t=this._groups,n=t.length,i=new Array(n),a=0;a<n;++a)for(var l=t[a],o=l.length,d=i[a]=[],f,h=0;h<o;++h)(f=l[h])&&e.call(f,f.__data__,h,l)&&d.push(f);return new Ci(i,this._parents)}function lC(e){return new Array(e.length)}function fH(){return new Ci(this._enter||this._groups.map(lC),this._parents)}function _h(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}_h.prototype={constructor:_h,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function hH(e){return function(){return e}}function pH(e,t,n,i,a,l){for(var o=0,d,f=t.length,h=l.length;o<h;++o)(d=t[o])?(d.__data__=l[o],i[o]=d):n[o]=new _h(e,l[o]);for(;o<f;++o)(d=t[o])&&(a[o]=d)}function mH(e,t,n,i,a,l,o){var d,f,h=new Map,g=t.length,m=l.length,y=new Array(g),b;for(d=0;d<g;++d)(f=t[d])&&(y[d]=b=o.call(f,f.__data__,d,t)+"",h.has(b)?a[d]=f:h.set(b,f));for(d=0;d<m;++d)b=o.call(e,l[d],d,l)+"",(f=h.get(b))?(i[d]=f,f.__data__=l[d],h.delete(b)):n[d]=new _h(e,l[d]);for(d=0;d<g;++d)(f=t[d])&&h.get(y[d])===f&&(a[d]=f)}function gH(e){return e.__data__}function yH(e,t){if(!arguments.length)return Array.from(this,gH);var n=t?mH:pH,i=this._parents,a=this._groups;typeof e!="function"&&(e=hH(e));for(var l=a.length,o=new Array(l),d=new Array(l),f=new Array(l),h=0;h<l;++h){var g=i[h],m=a[h],y=m.length,b=bH(e.call(g,g&&g.__data__,h,i)),k=b.length,v=d[h]=new Array(k),S=o[h]=new Array(k),E=f[h]=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 bH(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function xH(){return new Ci(this._exit||this._groups.map(lC),this._parents)}function vH(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 wH(e){for(var t=e.selection?e.selection():e,n=this._groups,i=t._groups,a=n.length,l=i.length,o=Math.min(a,l),d=new Array(a),f=0;f<o;++f)for(var h=n[f],g=i[f],m=h.length,y=d[f]=new Array(m),b,k=0;k<m;++k)(b=h[k]||g[k])&&(y[k]=b);for(;f<a;++f)d[f]=n[f];return new Ci(d,this._parents)}function kH(){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 EH(e){e||(e=SH);function t(m,y){return m&&y?e(m.__data__,y.__data__):!m-!y}for(var n=this._groups,i=n.length,a=new Array(i),l=0;l<i;++l){for(var o=n[l],d=o.length,f=a[l]=new Array(d),h,g=0;g<d;++g)(h=o[g])&&(f[g]=h);f.sort(t)}return new Ci(a,this._parents).order()}function SH(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function NH(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function _H(){return Array.from(this)}function jH(){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 CH(){let e=0;for(const t of this)++e;return e}function AH(){return!this.node()}function TH(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 MH(e){return function(){this.removeAttribute(e)}}function DH(e){return function(){this.removeAttributeNS(e.space,e.local)}}function OH(e,t){return function(){this.setAttribute(e,t)}}function RH(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function LH(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function IH(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=up(e);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((t==null?n.local?DH:MH:typeof t=="function"?n.local?IH:LH:n.local?RH:OH)(n,t))}function oC(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function PH(e){return function(){this.style.removeProperty(e)}}function BH(e,t,n){return function(){this.style.setProperty(e,t,n)}}function $H(e,t,n){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,n)}}function UH(e,t,n){return arguments.length>1?this.each((t==null?PH:typeof t=="function"?$H:BH)(e,t,n??"")):Fo(this.node(),e)}function Fo(e,t){return e.style.getPropertyValue(t)||oC(e).getComputedStyle(e,null).getPropertyValue(t)}function FH(e){return function(){delete this[e]}}function qH(e,t){return function(){this[e]=t}}function HH(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function KH(e,t){return arguments.length>1?this.each((t==null?FH:typeof t=="function"?HH:qH)(e,t)):this.node()[e]}function cC(e){return e.trim().split(/^|\s+/)}function $x(e){return e.classList||new uC(e)}function uC(e){this._node=e,this._names=cC(e.getAttribute("class")||"")}uC.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 dC(e,t){for(var n=$x(e),i=-1,a=t.length;++i<a;)n.add(t[i])}function fC(e,t){for(var n=$x(e),i=-1,a=t.length;++i<a;)n.remove(t[i])}function GH(e){return function(){dC(this,e)}}function VH(e){return function(){fC(this,e)}}function YH(e,t){return function(){(t.apply(this,arguments)?dC:fC)(this,e)}}function QH(e,t){var n=cC(e+"");if(arguments.length<2){for(var i=$x(this.node()),a=-1,l=n.length;++a<l;)if(!i.contains(n[a]))return!1;return!0}return this.each((typeof t=="function"?YH:t?GH:VH)(n,t))}function WH(){this.textContent=""}function XH(e){return function(){this.textContent=e}}function ZH(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function JH(e){return arguments.length?this.each(e==null?WH:(typeof e=="function"?ZH:XH)(e)):this.node().textContent}function e7(){this.innerHTML=""}function t7(e){return function(){this.innerHTML=e}}function n7(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function i7(e){return arguments.length?this.each(e==null?e7:(typeof e=="function"?n7:t7)(e)):this.node().innerHTML}function r7(){this.nextSibling&&this.parentNode.appendChild(this)}function a7(){return this.each(r7)}function s7(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function l7(){return this.each(s7)}function o7(e){var t=typeof e=="function"?e:iC(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function c7(){return null}function u7(e,t){var n=typeof e=="function"?e:iC(e),i=t==null?c7:typeof t=="function"?t:Bx(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function d7(){var e=this.parentNode;e&&e.removeChild(this)}function f7(){return this.each(d7)}function h7(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function p7(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function m7(e){return this.select(e?p7:h7)}function g7(e){return arguments.length?this.property("__data__",e):this.node().__data__}function y7(e){return function(t){e.call(this,t,this.__data__)}}function b7(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 x7(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 v7(e,t,n){return function(){var i=this.__on,a,l=y7(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 w7(e,t,n){var i=b7(e+""),a,l=i.length,o;if(arguments.length<2){var d=this.node().__on;if(d){for(var f=0,h=d.length,g;f<h;++f)for(a=0,g=d[f];a<l;++a)if((o=i[a]).type===g.type&&o.name===g.name)return g.value}return}for(d=t?v7:x7,a=0;a<l;++a)this.each(d(i[a],t,n));return this}function hC(e,t,n){var i=oC(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 k7(e,t){return function(){return hC(this,e,t)}}function E7(e,t){return function(){return hC(this,e,t.apply(this,arguments))}}function S7(e,t){return this.each((typeof t=="function"?E7:k7)(e,t))}function*N7(){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 pC=[null];function Ci(e,t){this._groups=e,this._parents=t}function nd(){return new Ci([[document.documentElement]],pC)}function _7(){return this}Ci.prototype=nd.prototype={constructor:Ci,select:Zq,selectAll:nH,selectChild:sH,selectChildren:uH,filter:dH,data:yH,enter:fH,exit:xH,join:vH,merge:wH,selection:_7,order:kH,sort:EH,call:NH,nodes:_H,node:jH,size:CH,empty:AH,each:TH,attr:zH,style:UH,property:KH,classed:QH,text:JH,html:i7,raise:a7,lower:l7,append:o7,insert:u7,remove:f7,clone:m7,datum:g7,on:w7,dispatch:S7,[Symbol.iterator]:N7};function _i(e){return typeof e=="string"?new Ci([[document.querySelector(e)]],[document.documentElement]):new Ci([[e]],pC)}function j7(e){let t;for(;t=e.sourceEvent;)e=t;return e}function lr(e,t){if(e=j7(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 C7={passive:!1},Au={capture:!0,passive:!1};function dy(e){e.stopImmediatePropagation()}function No(e){e.preventDefault(),e.stopImmediatePropagation()}function mC(e){var t=e.document.documentElement,n=_i(e).on("dragstart.drag",No,Au);"onselectstart"in t?n.on("selectstart.drag",No,Au):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function gC(e,t){var n=e.document.documentElement,i=_i(e).on("dragstart.drag",null);t&&(i.on("click.drag",No,Au),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const $f=e=>()=>e;function db(e,{sourceEvent:t,subject:n,target:i,identifier:a,active:l,x:o,y:d,dx:f,dy:h,dispatch:g}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:d,enumerable:!0,configurable:!0},dx:{value:f,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:g}})}db.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function A7(e){return!e.ctrlKey&&!e.button}function T7(){return this.parentNode}function M7(e,t){return t??{x:e.x,y:e.y}}function D7(){return navigator.maxTouchPoints||"ontouchstart"in this}function yC(){var e=A7,t=T7,n=M7,i=D7,a={},l=cp("start","drag","end"),o=0,d,f,h,g,m=0;function y(_){_.on("mousedown.drag",b).filter(i).on("touchstart.drag",S).on("touchmove.drag",E,C7).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,Au).on("mouseup.drag",v,Au),mC(_.view),dy(_),h=!1,d=_.clientX,f=_.clientY,M("start",_))}}function k(_){if(No(_),!h){var T=_.clientX-d,M=_.clientY-f;h=T*T+M*M>m}a.mouse("drag",_)}function v(_){_i(_.view).on("mousemove.drag mouseup.drag",null),gC(_.view,h),No(_),a.mouse("end",_)}function S(_,T){if(e.call(this,_,T)){var M=_.changedTouches,R=t.call(this,_,T),O=M.length,B,U;for(B=0;B<O;++B)(U=N(this,R,_,T,M[B].identifier,M[B]))&&(dy(_),U("start",_,M[B]))}}function E(_){var T=_.changedTouches,M=T.length,R,O;for(R=0;R<M;++R)(O=a[T[R].identifier])&&(No(_),O("drag",_,T[R]))}function C(_){var T=_.changedTouches,M=T.length,R,O;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),R=0;R<M;++R)(O=a[T[R].identifier])&&(dy(_),O("end",_,T[R]))}function N(_,T,M,R,O,B){var U=l.copy(),K=lr(B||M,T),q,Y,D;if((D=n.call(_,new db("beforestart",{sourceEvent:M,target:y,identifier:O,active:o,x:K[0],y:K[1],dx:0,dy:0,dispatch:U}),R))!=null)return q=D.x-K[0]||0,Y=D.y-K[1]||0,function F(I,H,Q){var G=K,L;switch(I){case"start":a[O]=F,L=o++;break;case"end":delete a[O],--o;case"drag":K=lr(Q||H,T),L=o;break}U.call(I,_,new db(I,{sourceEvent:H,subject:D,target:y,identifier:O,active:L,x:K[0]+q,y:K[1]+Y,dx:K[0]-G[0],dy:K[1]-G[1],dispatch:U}),R)}}return y.filter=function(_){return arguments.length?(e=typeof _=="function"?_:$f(!!_),y):e},y.container=function(_){return arguments.length?(t=typeof _=="function"?_:$f(_),y):t},y.subject=function(_){return arguments.length?(n=typeof _=="function"?_:$f(_),y):n},y.touchable=function(_){return arguments.length?(i=typeof _=="function"?_:$f(!!_),y):i},y.on=function(){var _=l.on.apply(l,arguments);return _===l?y:_},y.clickDistance=function(_){return arguments.length?(m=(_=+_)*_,y):Math.sqrt(m)},y}function Ux(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function bC(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function id(){}var Tu=.7,jh=1/Tu,_o="\\s*([+-]?\\d+)\\s*",Mu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Rr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",O7=/^#([0-9a-f]{3,8})$/,R7=new RegExp(`^rgb\\(${_o},${_o},${_o}\\)$`),L7=new RegExp(`^rgb\\(${Rr},${Rr},${Rr}\\)$`),I7=new RegExp(`^rgba\\(${_o},${_o},${_o},${Mu}\\)$`),z7=new RegExp(`^rgba\\(${Rr},${Rr},${Rr},${Mu}\\)$`),P7=new RegExp(`^hsl\\(${Mu},${Rr},${Rr}\\)$`),B7=new RegExp(`^hsla\\(${Mu},${Rr},${Rr},${Mu}\\)$`),KE={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};Ux(id,gl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:GE,formatHex:GE,formatHex8:$7,formatHsl:U7,formatRgb:VE,toString:VE});function GE(){return this.rgb().formatHex()}function $7(){return this.rgb().formatHex8()}function U7(){return xC(this).formatHsl()}function VE(){return this.rgb().formatRgb()}function gl(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=O7.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?YE(t):n===3?new hi(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Uf(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Uf(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=R7.exec(e))?new hi(t[1],t[2],t[3],1):(t=L7.exec(e))?new hi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=I7.exec(e))?Uf(t[1],t[2],t[3],t[4]):(t=z7.exec(e))?Uf(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=P7.exec(e))?XE(t[1],t[2]/100,t[3]/100,1):(t=B7.exec(e))?XE(t[1],t[2]/100,t[3]/100,t[4]):KE.hasOwnProperty(e)?YE(KE[e]):e==="transparent"?new hi(NaN,NaN,NaN,0):null}function YE(e){return new hi(e>>16&255,e>>8&255,e&255,1)}function Uf(e,t,n,i){return i<=0&&(e=t=n=NaN),new hi(e,t,n,i)}function F7(e){return e instanceof id||(e=gl(e)),e?(e=e.rgb(),new hi(e.r,e.g,e.b,e.opacity)):new hi}function fb(e,t,n,i){return arguments.length===1?F7(e):new hi(e,t,n,i??1)}function hi(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}Ux(hi,fb,bC(id,{brighter(e){return e=e==null?jh:Math.pow(jh,e),new hi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Tu:Math.pow(Tu,e),new hi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new hi(cl(this.r),cl(this.g),cl(this.b),Ch(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:QE,formatHex:QE,formatHex8:q7,formatRgb:WE,toString:WE}));function QE(){return`#${Js(this.r)}${Js(this.g)}${Js(this.b)}`}function q7(){return`#${Js(this.r)}${Js(this.g)}${Js(this.b)}${Js((isNaN(this.opacity)?1:this.opacity)*255)}`}function WE(){const e=Ch(this.opacity);return`${e===1?"rgb(":"rgba("}${cl(this.r)}, ${cl(this.g)}, ${cl(this.b)}${e===1?")":`, ${e})`}`}function Ch(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function cl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Js(e){return e=cl(e),(e<16?"0":"")+e.toString(16)}function XE(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 xC(e){if(e instanceof or)return new or(e.h,e.s,e.l,e.opacity);if(e instanceof id||(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 H7(e,t,n,i){return arguments.length===1?xC(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}Ux(or,H7,bC(id,{brighter(e){return e=e==null?jh:Math.pow(jh,e),new or(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Tu:Math.pow(Tu,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 hi(fy(e>=240?e-240:e+120,a,i),fy(e,a,i),fy(e<120?e+240:e-120,a,i),this.opacity)},clamp(){return new or(ZE(this.h),Ff(this.s),Ff(this.l),Ch(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ch(this.opacity);return`${e===1?"hsl(":"hsla("}${ZE(this.h)}, ${Ff(this.s)*100}%, ${Ff(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ZE(e){return e=(e||0)%360,e<0?e+360:e}function Ff(e){return Math.max(0,Math.min(1,e||0))}function fy(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 Fx=e=>()=>e;function K7(e,t){return function(n){return e+n*t}}function G7(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 V7(e){return(e=+e)==1?vC:function(t,n){return n-t?G7(t,n,e):Fx(isNaN(t)?n:t)}}function vC(e,t){var n=t-e;return n?K7(e,n):Fx(isNaN(e)?t:e)}const Ah=(function e(t){var n=V7(t);function i(a,l){var o=n((a=fb(a)).r,(l=fb(l)).r),d=n(a.g,l.g),f=n(a.b,l.b),h=vC(a.opacity,l.opacity);return function(g){return a.r=o(g),a.g=d(g),a.b=f(g),a.opacity=h(g),a+""}}return i.gamma=e,i})(1);function Y7(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 Q7(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function W7(e,t){var n=t?t.length:0,i=e?Math.min(n,e.length):0,a=new Array(i),l=new Array(n),o;for(o=0;o<i;++o)a[o]=yu(e[o],t[o]);for(;o<n;++o)l[o]=t[o];return function(d){for(o=0;o<i;++o)l[o]=a[o](d);return l}}function X7(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 Z7(e,t){var n={},i={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=yu(e[a],t[a]):i[a]=t[a];return function(l){for(a in n)i[a]=n[a](l);return i}}var hb=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,hy=new RegExp(hb.source,"g");function J7(e){return function(){return e}}function eK(e){return function(t){return e(t)+""}}function wC(e,t){var n=hb.lastIndex=hy.lastIndex=0,i,a,l,o=-1,d=[],f=[];for(e=e+"",t=t+"";(i=hb.exec(e))&&(a=hy.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=hy.lastIndex;return n<t.length&&(l=t.slice(n),d[o]?d[o]+=l:d[++o]=l),d.length<2?f[0]?eK(f[0].x):J7(t):(t=f.length,function(h){for(var g=0,m;g<t;++g)d[(m=f[g]).i]=m.x(h);return d.join("")})}function yu(e,t){var n=typeof t,i;return t==null||n==="boolean"?Fx(t):(n==="number"?Mr:n==="string"?(i=gl(t))?(t=i,Ah):wC:t instanceof gl?Ah:t instanceof Date?X7:Q7(t)?Y7:Array.isArray(t)?W7:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Z7:Mr)(e,t)}var JE=180/Math.PI,pb={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function kC(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)*JE,skewX:Math.atan(f)*JE,scaleX:o,scaleY:d}}var qf;function tK(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?pb:kC(t.a,t.b,t.c,t.d,t.e,t.f)}function nK(e){return e==null||(qf||(qf=document.createElementNS("http://www.w3.org/2000/svg","g")),qf.setAttribute("transform",e),!(e=qf.transform.baseVal.consolidate()))?pb:(e=e.matrix,kC(e.a,e.b,e.c,e.d,e.e,e.f))}function EC(e,t,n,i){function a(h){return h.length?h.pop()+" ":""}function l(h,g,m,y,b,k){if(h!==m||g!==y){var v=b.push("translate(",null,t,null,n);k.push({i:v-4,x:Mr(h,m)},{i:v-2,x:Mr(g,y)})}else(m||y)&&b.push("translate("+m+t+y+n)}function o(h,g,m,y){h!==g?(h-g>180?g+=360:g-h>180&&(h+=360),y.push({i:m.push(a(m)+"rotate(",null,i)-2,x:Mr(h,g)})):g&&m.push(a(m)+"rotate("+g+i)}function d(h,g,m,y){h!==g?y.push({i:m.push(a(m)+"skewX(",null,i)-2,x:Mr(h,g)}):g&&m.push(a(m)+"skewX("+g+i)}function f(h,g,m,y,b,k){if(h!==m||g!==y){var v=b.push(a(b)+"scale(",null,",",null,")");k.push({i:v-4,x:Mr(h,m)},{i:v-2,x:Mr(g,y)})}else(m!==1||y!==1)&&b.push(a(b)+"scale("+m+","+y+")")}return function(h,g){var m=[],y=[];return h=e(h),g=e(g),l(h.translateX,h.translateY,g.translateX,g.translateY,m,y),o(h.rotate,g.rotate,m,y),d(h.skewX,g.skewX,m,y),f(h.scaleX,h.scaleY,g.scaleX,g.scaleY,m,y),h=g=null,function(b){for(var k=-1,v=y.length,S;++k<v;)m[(S=y[k]).i]=S.x(b);return m.join("")}}}var iK=EC(tK,"px, ","px)","deg)"),rK=EC(nK,", ",")",")"),aK=1e-12;function eS(e){return((e=Math.exp(e))+1/e)/2}function sK(e){return((e=Math.exp(e))-1/e)/2}function lK(e){return((e=Math.exp(2*e))-1)/(e+1)}const rh=(function e(t,n,i){function a(l,o){var d=l[0],f=l[1],h=l[2],g=o[0],m=o[1],y=o[2],b=g-d,k=m-f,v=b*b+k*k,S,E;if(v<aK)E=Math.log(y/h)/t,S=function(R){return[d+R*b,f+R*k,h*Math.exp(t*R*E)]};else{var C=Math.sqrt(v),N=(y*y-h*h+i*v)/(2*h*n*C),_=(y*y-h*h-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(R){var O=R*E,B=eS(T),U=h/(n*C)*(B*lK(t*O+T)-sK(T));return[d+U*b,f+U*k,h*B/eS(t*O+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 qo=0,uu=0,su=0,SC=1e3,Th,du,Mh=0,yl=0,dp=0,Du=typeof performance=="object"&&performance.now?performance:Date,NC=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function qx(){return yl||(NC(oK),yl=Du.now()+dp)}function oK(){yl=0}function Dh(){this._call=this._time=this._next=null}Dh.prototype=_C.prototype={constructor:Dh,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?qx():+n)+(t==null?0:+t),!this._next&&du!==this&&(du?du._next=this:Th=this,du=this),this._call=e,this._time=n,mb()},stop:function(){this._call&&(this._call=null,this._time=1/0,mb())}};function _C(e,t,n){var i=new Dh;return i.restart(e,t,n),i}function cK(){qx(),++qo;for(var e=Th,t;e;)(t=yl-e._time)>=0&&e._call.call(void 0,t),e=e._next;--qo}function tS(){yl=(Mh=Du.now())+dp,qo=uu=0;try{cK()}finally{qo=0,dK(),yl=0}}function uK(){var e=Du.now(),t=e-Mh;t>SC&&(dp-=t,Mh=e)}function dK(){for(var e,t=Th,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Th=n);du=e,mb(i)}function mb(e){if(!qo){uu&&(uu=clearTimeout(uu));var t=e-yl;t>24?(e<1/0&&(uu=setTimeout(tS,e-Du.now()-dp)),su&&(su=clearInterval(su))):(su||(Mh=Du.now(),su=setInterval(uK,SC)),qo=1,NC(tS))}}function nS(e,t,n){var i=new Dh;return t=t==null?0:+t,i.restart(a=>{i.stop(),e(a+t)},t,n),i}var fK=cp("start","end","cancel","interrupt"),hK=[],jC=0,iS=1,gb=2,ah=3,rS=4,yb=5,sh=6;function fp(e,t,n,i,a,l){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;pK(e,n,{name:t,index:i,group:a,on:fK,tween:hK,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:jC})}function Hx(e,t){var n=br(e,t);if(n.state>jC)throw new Error("too late; already scheduled");return n}function zr(e,t){var n=br(e,t);if(n.state>ah)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 pK(e,t,n){var i=e.__transition,a;i[t]=n,n.timer=_C(l,0,n.time);function l(h){n.state=iS,n.timer.restart(o,n.delay,n.time),n.delay<=h&&o(h-n.delay)}function o(h){var g,m,y,b;if(n.state!==iS)return f();for(g in i)if(b=i[g],b.name===n.name){if(b.state===ah)return nS(o);b.state===rS?(b.state=sh,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete i[g]):+g<t&&(b.state=sh,b.timer.stop(),b.on.call("cancel",e,e.__data__,b.index,b.group),delete i[g])}if(nS(function(){n.state===ah&&(n.state=rS,n.timer.restart(d,n.delay,n.time),d(h))}),n.state=gb,n.on.call("start",e,e.__data__,n.index,n.group),n.state===gb){for(n.state=ah,a=new Array(y=n.tween.length),g=0,m=-1;g<y;++g)(b=n.tween[g].value.call(e,e.__data__,n.index,n.group))&&(a[++m]=b);a.length=m+1}}function d(h){for(var g=h<n.duration?n.ease.call(null,h/n.duration):(n.timer.restart(f),n.state=yb,1),m=-1,y=a.length;++m<y;)a[m].call(e,g);n.state===yb&&(n.on.call("end",e,e.__data__,n.index,n.group),f())}function f(){n.state=sh,n.timer.stop(),delete i[t];for(var h in i)return;delete e.__transition}}function lh(e,t){var n=e.__transition,i,a,l=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((i=n[o]).name!==t){l=!1;continue}a=i.state>gb&&i.state<yb,i.state=sh,i.timer.stop(),i.on.call(a?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete n[o]}l&&delete e.__transition}}function mK(e){return this.each(function(){lh(this,e)})}function gK(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 yK(e,t,n){var i,a;if(typeof n!="function")throw new Error;return function(){var l=zr(this,e),o=l.tween;if(o!==i){a=(i=o).slice();for(var d={name:t,value:n},f=0,h=a.length;f<h;++f)if(a[f].name===t){a[f]=d;break}f===h&&a.push(d)}l.tween=a}}function bK(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?gK:yK)(n,e,t))}function Kx(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 CC(e,t){var n;return(typeof t=="number"?Mr:t instanceof gl?Ah:(n=gl(t))?(t=n,Ah):wC)(e,t)}function xK(e){return function(){this.removeAttribute(e)}}function vK(e){return function(){this.removeAttributeNS(e.space,e.local)}}function wK(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 kK(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 EK(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 SK(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 NK(e,t){var n=up(e),i=n==="transform"?rK:CC;return this.attrTween(e,typeof t=="function"?(n.local?SK:EK)(n,i,Kx(this,"attr."+e,t)):t==null?(n.local?vK:xK)(n):(n.local?kK:wK)(n,i,t))}function _K(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function jK(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function CK(e,t){var n,i;function a(){var l=t.apply(this,arguments);return l!==i&&(n=(i=l)&&jK(e,l)),n}return a._value=t,a}function AK(e,t){var n,i;function a(){var l=t.apply(this,arguments);return l!==i&&(n=(i=l)&&_K(e,l)),n}return a._value=t,a}function TK(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var i=up(e);return this.tween(n,(i.local?CK:AK)(i,t))}function MK(e,t){return function(){Hx(this,e).delay=+t.apply(this,arguments)}}function DK(e,t){return t=+t,function(){Hx(this,e).delay=t}}function OK(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?MK:DK)(t,e)):br(this.node(),t).delay}function RK(e,t){return function(){zr(this,e).duration=+t.apply(this,arguments)}}function LK(e,t){return t=+t,function(){zr(this,e).duration=t}}function IK(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?RK:LK)(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 PK(e){var t=this._id;return arguments.length?this.each(zK(t,e)):br(this.node(),t).ease}function BK(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;zr(this,e).ease=n}}function $K(e){if(typeof e!="function")throw new Error;return this.each(BK(this._id,e))}function UK(e){typeof e!="function"&&(e=aC(e));for(var t=this._groups,n=t.length,i=new Array(n),a=0;a<n;++a)for(var l=t[a],o=l.length,d=i[a]=[],f,h=0;h<o;++h)(f=l[h])&&e.call(f,f.__data__,h,l)&&d.push(f);return new ba(i,this._parents,this._name,this._id)}function FK(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,i=t.length,a=n.length,l=Math.min(i,a),o=new Array(i),d=0;d<l;++d)for(var f=t[d],h=n[d],g=f.length,m=o[d]=new Array(g),y,b=0;b<g;++b)(y=f[b]||h[b])&&(m[b]=y);for(;d<i;++d)o[d]=t[d];return new ba(o,this._parents,this._name,this._id)}function qK(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 HK(e,t,n){var i,a,l=qK(t)?Hx:zr;return function(){var o=l(this,e),d=o.on;d!==i&&(a=(i=d).copy()).on(t,n),o.on=a}}function KK(e,t){var n=this._id;return arguments.length<2?br(this.node(),n).on.on(e):this.each(HK(n,e,t))}function GK(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function VK(){return this.on("end.remove",GK(this._id))}function YK(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Bx(e));for(var i=this._groups,a=i.length,l=new Array(a),o=0;o<a;++o)for(var d=i[o],f=d.length,h=l[o]=new Array(f),g,m,y=0;y<f;++y)(g=d[y])&&(m=e.call(g,g.__data__,y,d))&&("__data__"in g&&(m.__data__=g.__data__),h[y]=m,fp(h[y],t,n,y,h,br(g,n)));return new ba(l,this._parents,t,n)}function QK(e){var t=this._name,n=this._id;typeof e!="function"&&(e=rC(e));for(var i=this._groups,a=i.length,l=[],o=[],d=0;d<a;++d)for(var f=i[d],h=f.length,g,m=0;m<h;++m)if(g=f[m]){for(var y=e.call(g,g.__data__,m,f),b,k=br(g,n),v=0,S=y.length;v<S;++v)(b=y[v])&&fp(b,t,n,v,y,k);l.push(y),o.push(g)}return new ba(l,o,t,n)}var WK=nd.prototype.constructor;function XK(){return new WK(this._groups,this._parents)}function ZK(e,t){var n,i,a;return function(){var l=Fo(this,e),o=(this.style.removeProperty(e),Fo(this,e));return l===o?null:l===n&&o===i?a:a=t(n=l,i=o)}}function AC(e){return function(){this.style.removeProperty(e)}}function JK(e,t,n){var i,a=n+"",l;return function(){var o=Fo(this,e);return o===a?null:o===i?l:l=t(i=o,n)}}function eG(e,t,n){var i,a,l;return function(){var o=Fo(this,e),d=n(this),f=d+"";return d==null&&(f=d=(this.style.removeProperty(e),Fo(this,e))),o===f?null:o===i&&f===a?l:(a=f,l=t(i=o,d))}}function tG(e,t){var n,i,a,l="style."+t,o="end."+l,d;return function(){var f=zr(this,e),h=f.on,g=f.value[l]==null?d||(d=AC(t)):void 0;(h!==n||a!==g)&&(i=(n=h).copy()).on(o,a=g),f.on=i}}function nG(e,t,n){var i=(e+="")=="transform"?iK:CC;return t==null?this.styleTween(e,ZK(e,i)).on("end.style."+e,AC(e)):typeof t=="function"?this.styleTween(e,eG(e,i,Kx(this,"style."+e,t))).each(tG(this._id,e)):this.styleTween(e,JK(e,i,t),n).on("end.style."+e,null)}function iG(e,t,n){return function(i){this.style.setProperty(e,t.call(this,i),n)}}function rG(e,t,n){var i,a;function l(){var o=t.apply(this,arguments);return o!==a&&(i=(a=o)&&iG(e,o,n)),i}return l._value=t,l}function aG(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,rG(e,t,n??""))}function sG(e){return function(){this.textContent=e}}function lG(e){return function(){var t=e(this);this.textContent=t??""}}function oG(e){return this.tween("text",typeof e=="function"?lG(Kx(this,"text",e)):sG(e==null?"":e+""))}function cG(e){return function(t){this.textContent=e.call(this,t)}}function uG(e){var t,n;function i(){var a=e.apply(this,arguments);return a!==n&&(t=(n=a)&&cG(a)),t}return i._value=e,i}function dG(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,uG(e))}function fG(){for(var e=this._name,t=this._id,n=TC(),i=this._groups,a=i.length,l=0;l<a;++l)for(var o=i[l],d=o.length,f,h=0;h<d;++h)if(f=o[h]){var g=br(f,t);fp(f,e,n,h,o,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new ba(i,this._parents,e,n)}function hG(){var e,t,n=this,i=n._id,a=n.size();return new Promise(function(l,o){var d={value:o},f={value:function(){--a===0&&l()}};n.each(function(){var h=zr(this,i),g=h.on;g!==e&&(t=(e=g).copy(),t._.cancel.push(d),t._.interrupt.push(d),t._.end.push(f)),h.on=t}),a===0&&l()})}var pG=0;function ba(e,t,n,i){this._groups=e,this._parents=t,this._name=n,this._id=i}function TC(){return++pG}var aa=nd.prototype;ba.prototype={constructor:ba,select:YK,selectAll:QK,selectChild:aa.selectChild,selectChildren:aa.selectChildren,filter:UK,merge:FK,selection:XK,transition:fG,call:aa.call,nodes:aa.nodes,node:aa.node,size:aa.size,empty:aa.empty,each:aa.each,on:KK,attr:NK,attrTween:TK,style:nG,styleTween:aG,text:oG,textTween:dG,remove:VK,tween:bK,delay:OK,duration:IK,ease:PK,easeVarying:$K,end:hG,[Symbol.iterator]:aa[Symbol.iterator]};function mG(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var gG={time:null,delay:0,duration:250,ease:mG};function yG(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 bG(e){var t,n;e instanceof ba?(t=e._id,e=e._name):(t=TC(),(n=gG).time=qx(),e=e==null?null:e+"");for(var i=this._groups,a=i.length,l=0;l<a;++l)for(var o=i[l],d=o.length,f,h=0;h<d;++h)(f=o[h])&&fp(f,e,t,h,o,n||yG(f,t));return new ba(i,this._parents,e,t)}nd.prototype.interrupt=mK;nd.prototype.transition=bG;const Hf=e=>()=>e;function xG(e,{sourceEvent:t,target:n,transform:i,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:a}})}function fa(e,t,n){this.k=e,this.x=t,this.y=n}fa.prototype={constructor:fa,scale:function(e){return e===1?this:new fa(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new fa(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var hp=new fa(1,0,0);MC.prototype=fa.prototype;function MC(e){for(;!e.__zoom;)if(!(e=e.parentNode))return hp;return e.__zoom}function py(e){e.stopImmediatePropagation()}function lu(e){e.preventDefault(),e.stopImmediatePropagation()}function vG(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function wG(){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 aS(){return this.__zoom||hp}function kG(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function EG(){return navigator.maxTouchPoints||"ontouchstart"in this}function SG(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 DC(){var e=vG,t=wG,n=SG,i=kG,a=EG,l=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],d=250,f=rh,h=cp("start","zoom","end"),g,m,y,b=500,k=150,v=0,S=10;function E(D){D.property("__zoom",aS).on("wheel.zoom",O,{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 Q=D.selection?D.selection():D;Q.property("__zoom",aS),D!==Q?T(D,F,I,H):Q.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 Q=this.__zoom.k,G=typeof F=="function"?F.apply(this,arguments):F;return Q*G},I,H)},E.scaleTo=function(D,F,I,H){E.transform(D,function(){var Q=t.apply(this,arguments),G=this.__zoom,L=I==null?_(Q):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),Q,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,Q){E.transform(D,function(){var G=t.apply(this,arguments),L=this.__zoom,z=H==null?_(G):typeof H=="function"?H.apply(this,arguments):H;return n(hp.translate(z[0],z[1]).scale(L.k).translate(typeof F=="function"?-F.apply(this,arguments):-F,typeof I=="function"?-I.apply(this,arguments):-I),G,o)},H,Q)};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,Q=F[1]-I[1]*D.k;return H===D.x&&Q===D.y?D:new fa(D.k,H,Q)}function _(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function 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 Q=this,G=arguments,L=M(Q,G).event(H),z=t.apply(Q,G),V=I==null?_(z):typeof I=="function"?I.apply(Q,G):I,P=Math.max(z[1][0]-z[0][0],z[1][1]-z[0][1]),le=Q.__zoom,ve=typeof F=="function"?F.apply(Q,G):F,ke=f(le.invert(V).concat(P/le.k),ve.invert(V).concat(P/ve.k));return function(Se){if(Se===1)Se=ve;else{var J=ke(Se),ue=P/J[2];Se=new fa(ue,V[0]-J[0]*ue,V[1]-J[1]*ue)}L.zoom(null,Se)}})}function M(D,F,I){return!I&&D.__zooming||new R(D,F)}function R(D,F){this.that=D,this.args=F,this.active=0,this.sourceEvent=null,this.extent=t.apply(D,F),this.taps=0}R.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,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();h.call(D,this.that,new xG(D,{sourceEvent:this.sourceEvent,target:E,transform:this.that.__zoom,dispatch:h}),F)}};function O(D,...F){if(!e.apply(this,arguments))return;var I=M(this,F).event(D),H=this.__zoom,Q=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===Q)return;I.mouse=[G,H.invert(G)],lh(this),I.start()}lu(D),I.wheel=setTimeout(L,k),I.zoom("mouse",n(N(C(H,Q),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),Q=_i(D.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",P,!0),G=lr(D,I),L=D.clientX,z=D.clientY;mC(D.view),py(D),H.mouse=[G,this.__zoom.invert(G)],lh(this),H.start();function V(le){if(lu(le),!H.moved){var ve=le.clientX-L,ke=le.clientY-z;H.moved=ve*ve+ke*ke>v}H.event(le).zoom("mouse",n(N(H.that.__zoom,H.mouse[0]=lr(le,I),H.mouse[1]),H.extent,o))}function P(le){Q.on("mousemove.zoom mouseup.zoom",null),gC(le.view,H.moved),lu(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),Q=I.invert(H),G=I.k*(D.shiftKey?.5:2),L=n(N(C(I,G),H,Q),t.apply(this,F),o);lu(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,Q=M(this,F,D.changedTouches.length===H).event(D),G,L,z,V;for(py(D),L=0;L<H;++L)z=I[L],V=lr(z,this),V=[V,this.__zoom.invert(V),z.identifier],Q.touch0?!Q.touch1&&Q.touch0[2]!==V[2]&&(Q.touch1=V,Q.taps=0):(Q.touch0=V,G=!0,Q.taps=1+!!g);g&&(g=clearTimeout(g)),G&&(Q.taps<2&&(m=V[0],g=setTimeout(function(){g=null},b)),lh(this),Q.start())}}function q(D,...F){if(this.__zooming){var I=M(this,F).event(D),H=D.changedTouches,Q=H.length,G,L,z,V;for(lu(D),G=0;G<Q;++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],ve=I.touch1[0],ke=I.touch1[1],Se=(Se=ve[0]-P[0])*Se+(Se=ve[1]-P[1])*Se,J=(J=ke[0]-le[0])*J+(J=ke[1]-le[1])*J;L=C(L,Math.sqrt(Se/J)),z=[(P[0]+ve[0])/2,(P[1]+ve[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,Q=H.length,G,L;for(py(D),y&&clearTimeout(y),y=setTimeout(function(){y=null},b),G=0;G<Q;++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:Hf(+D),E):i},E.filter=function(D){return arguments.length?(e=typeof D=="function"?D:Hf(!!D),E):e},E.touchable=function(D){return arguments.length?(a=typeof D=="function"?D:Hf(!!D),E):a},E.extent=function(D){return arguments.length?(t=typeof D=="function"?D:Hf([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),E):t},E.scaleExtent=function(D){return arguments.length?(l[0]=+D[0],l[1]=+D[1],E):[l[0],l[1]]},E.translateExtent=function(D){return arguments.length?(o[0][0]=+D[0][0],o[1][0]=+D[1][0],o[0][1]=+D[0][1],o[1][1]=+D[1][1],E):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},E.constrain=function(D){return arguments.length?(n=D,E):n},E.duration=function(D){return arguments.length?(d=+D,E):d},E.interpolate=function(D){return arguments.length?(f=D,E):f},E.on=function(){var D=h.on.apply(h,arguments);return D===h?E:D},E.clickDistance=function(D){return arguments.length?(v=(D=+D)*D,E):Math.sqrt(v)},E.tapDistance=function(D){return arguments.length?(S=+D,E):S},E}const hr={error001:(e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:i})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:i}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Ou=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],OC=["Enter"," ","Escape"],RC={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Ho;(function(e){e.Strict="strict",e.Loose="loose"})(Ho||(Ho={}));var ul;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ul||(ul={}));var Ru;(function(e){e.Partial="partial",e.Full="full"})(Ru||(Ru={}));const LC={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var os;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(os||(os={}));var Oh;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Oh||(Oh={}));var Ge;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ge||(Ge={}));const sS={[Ge.Left]:Ge.Right,[Ge.Right]:Ge.Left,[Ge.Top]:Ge.Bottom,[Ge.Bottom]:Ge.Top};function IC(e){return e===null?null:e?"valid":"invalid"}const zC=e=>"id"in e&&"source"in e&&"target"in e,NG=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Gx=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),rd=(e,t=[0,0])=>{const{width:n,height:i}=va(e),a=e.origin??t,l=n*a[0],o=i*a[1];return{x:e.position.x-l,y:e.position.y-o}},_G=(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):Gx(a)?a:t.nodeLookup.get(a.id));const d=o?Rh(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return pp(i,d)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return mp(n)},ad=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},i=!1;return e.forEach(a=>{(t.filter===void 0||t.filter(a))&&(n=pp(n,Rh(a)),i=!0)}),i?mp(n):{x:0,y:0,width:0,height:0}},Vx=(e,t,[n,i,a]=[0,0,1],l=!1,o=!1)=>{const d=(t.x-n)/a,f=(t.y-i)/a,h=t.width/a,g=t.height/a,m=[];for(const y of e.values()){const{measured:b,selectable:k=!0,hidden:v=!1}=y;if(o&&!k||v)continue;const S=b.width??y.width??y.initialWidth??0,E=b.height??y.height??y.initialHeight??0,{x:C,y:N}=y.internals.positionAbsolute,_=UC(d,f,h,g,C,N,S,E),T=S*E,M=l&&_>0;(!y.internals.handleBounds||M||_>=T||y.dragging)&&m.push(y)}return m},jG=(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 CG(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 AG({nodes:e,width:t,height:n,panZoom:i,minZoom:a,maxZoom:l},o){if(e.size===0)return!0;const d=CG(e,o),f=ad(d),h=Qx(f,t,n,(o==null?void 0:o.minZoom)??a,(o==null?void 0:o.maxZoom)??l,(o==null?void 0:o.padding)??.1);return await i.setViewport(h,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),!0}function PC({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:i=[0,0],nodeExtent:a,onError:l}){const o=n.get(e),d=o.parentId?n.get(o.parentId):void 0,{x:f,y:h}=d?d.internals.positionAbsolute:{x:0,y:0},g=o.origin??i;let m=o.extent||a;if(o.extent==="parent"&&!o.expandParent)if(!d)l==null||l("005",hr.error005());else{const b=d.measured.width,k=d.measured.height;b&&k&&(m=[[f,h],[f+b,h+k]])}else d&&xl(o.extent)&&(m=[[o.extent[0][0]+f,o.extent[0][1]+h],[o.extent[1][0]+f,o.extent[1][1]+h]]);const y=xl(m)?bl(t,m,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(l==null||l("015",hr.error015())),{position:{x:y.x-f+(o.measured.width??0)*g[0],y:y.y-h+(o.measured.height??0)*g[1]},positionAbsolute:y}}async function TG({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=jG(o,f);for(const y of f)d.has(y.id)&&!g.find(k=>k.id===y.id)&&g.push(y);if(!a)return{edges:g,nodes:o};const m=await a({nodes:o,edges:g});return typeof m=="boolean"?m?{edges:g,nodes:o}:{edges:[],nodes:[]}:m}const Ko=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),bl=(e={x:0,y:0},t,n)=>({x:Ko(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Ko(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function BC(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 lS=(e,t,n)=>e<t?Ko(Math.abs(e-t),1,t)/t:e>n?-Ko(Math.abs(e-n),1,t)/t:0,Yx=(e,t,n=15,i=40)=>{const a=lS(e.x,i,t.width-i)*n,l=lS(e.y,i,t.height-i)*n;return[a,l]},pp=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),bb=({x:e,y:t,width:n,height:i})=>({x:e,y:t,x2:e+n,y2:t+i}),mp=({x:e,y:t,x2:n,y2:i})=>({x:e,y:t,width:n-e,height:i-t}),Lu=(e,t=[0,0])=>{var a,l;const{x:n,y:i}=Gx(e)?e.internals.positionAbsolute:rd(e,t);return{x:n,y:i,width:((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0,height:((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0}},Rh=(e,t=[0,0])=>{var a,l;const{x:n,y:i}=Gx(e)?e.internals.positionAbsolute:rd(e,t);return{x:n,y:i,x2:n+(((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0),y2:i+(((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0)}},$C=(e,t)=>mp(pp(bb(e),bb(t))),UC=(e,t,n,i,a,l,o,d)=>{const f=Math.max(0,Math.min(e+n,a+o)-Math.max(e,a)),h=Math.max(0,Math.min(t+i,l+d)-Math.max(t,l));return Math.ceil(f*h)},Lh=(e,t)=>UC(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),oS=e=>cr(e.width)&&cr(e.height)&&cr(e.x)&&cr(e.y),cr=e=>!isNaN(e)&&isFinite(e),FC=(e,t)=>(n,i)=>{},sd=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),ld=({x:e,y:t},[n,i,a],l=!1,o=[1,1])=>{const d={x:(e-n)/a,y:(t-i)/a};return l?sd(d,o):d},Go=({x:e,y:t},[n,i,a])=>({x:e*a+n,y:t*a+i});function uo(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function MG(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 DG(e,t,n,i,a,l){const{x:o,y:d}=Go(e,[t,n,i]),{x:f,y:h}=Go({x:e.x+e.width,y:e.y+e.height},[t,n,i]),g=a-f,m=l-h;return{left:Math.floor(o),top:Math.floor(d),right:Math.floor(g),bottom:Math.floor(m)}}const Qx=(e,t,n,i,a,l)=>{const o=MG(l,t,n),d=(t-o.x)/e.width,f=(n-o.y)/e.height,h=Math.min(d,f),g=Ko(h,i,a),m=e.x+e.width/2,y=e.y+e.height/2,b=t/2-m*g,k=n/2-y*g,v=DG(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}},Iu=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function xl(e){return e!=null&&e!=="parent"}function va(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function qC(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 HC(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 cS(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function OG(){let e,t;return{promise:new Promise((i,a)=>{e=i,t=a}),resolve:e,reject:t}}function RG(e){return{...RC,...e||{}}}function bu(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:i,containerBounds:a}){const{x:l,y:o}=ur(e),d=ld({x:l-((a==null?void 0:a.left)??0),y:o-((a==null?void 0:a.top)??0)},i),{x:f,y:h}=n?sd(d,t):d;return{xSnapped:f,ySnapped:h,...d}}const Wx=e=>({width:e.offsetWidth,height:e.offsetHeight}),KC=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},LG=["INPUT","SELECT","TEXTAREA"];function GC(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:LG.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const VC=e=>"clientX"in e,ur=(e,t)=>{var l,o;const n=VC(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)}},uS=(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,...Wx(o)}})};function YC({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:a,sourceControlY:l,targetControlX:o,targetControlY:d}){const f=e*.125+a*.375+o*.375+n*.125,h=t*.125+l*.375+d*.375+i*.125,g=Math.abs(f-e),m=Math.abs(h-t);return[f,h,g,m]}function Kf(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function dS({pos:e,x1:t,y1:n,x2:i,y2:a,c:l}){switch(e){case Ge.Left:return[t-Kf(t-i,l),n];case Ge.Right:return[t+Kf(i-t,l),n];case Ge.Top:return[t,n-Kf(n-a,l)];case Ge.Bottom:return[t,n+Kf(a-n,l)]}}function QC({sourceX:e,sourceY:t,sourcePosition:n=Ge.Bottom,targetX:i,targetY:a,targetPosition:l=Ge.Top,curvature:o=.25}){const[d,f]=dS({pos:n,x1:e,y1:t,x2:i,y2:a,c:o}),[h,g]=dS({pos:l,x1:i,y1:a,x2:e,y2:t,c:o}),[m,y,b,k]=YC({sourceX:e,sourceY:t,targetX:i,targetY:a,sourceControlX:d,sourceControlY:f,targetControlX:h,targetControlY:g});return[`M${e},${t} C${d},${f} ${h},${g} ${i},${a}`,m,y,b,k]}function WC({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 IG({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=pp(Rh(e),Rh(t));l.x===l.x2&&(l.x2+=1),l.y===l.y2&&(l.y2+=1);const o={x:-a[0]/a[2],y:-a[1]/a[2],width:n/a[2],height:i/a[2]};return Lh(o,mp(l))>0}const PG=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,BG=(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)),$G=(e,t,n={})=>{var l;if(!e.source||!e.target)return(l=n.onError)==null||l.call(n,"006",hr.error006()),t;const i=n.getEdgeId||PG;let a;return zC(e)?a={...e}:a={...e,id:i(e)},BG(a,t)?t:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,t.concat(a))};function XC({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[a,l,o,d]=WC({sourceX:e,sourceY:t,targetX:n,targetY:i});return[`M ${e},${t}L ${n},${i}`,a,l,o,d]}const fS={[Ge.Left]:{x:-1,y:0},[Ge.Right]:{x:1,y:0},[Ge.Top]:{x:0,y:-1},[Ge.Bottom]:{x:0,y:1}},UG=({source:e,sourcePosition:t=Ge.Bottom,target:n})=>t===Ge.Left||t===Ge.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},hS=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function FG({source:e,sourcePosition:t=Ge.Bottom,target:n,targetPosition:i=Ge.Top,center:a,offset:l,stepPosition:o}){const d=fS[t],f=fS[i],h={x:e.x+d.x*l,y:e.y+d.y*l},g={x:n.x+f.x*l,y:n.y+f.y*l},m=UG({source:h,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,_]=WC({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(d[y]*f[y]===-1){y==="x"?(v=a.x??h.x+(g.x-h.x)*o,S=a.y??(h.y+g.y)/2):(v=a.x??(h.x+g.x)/2,S=a.y??h.y+(g.y-h.y)*o);const O=[{x:v,y:h.y},{x:v,y:g.y}],B=[{x:h.x,y:S},{x:g.x,y:S}];d[y]===b?k=y==="x"?O:B:k=y==="x"?B:O}else{const O=[{x:h.x,y:g.y}],B=[{x:g.x,y:h.y}];if(y==="x"?k=d.x===b?B:O:k=d.y===b?O: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]=(h[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=h[D]>g[D],H=h[D]<g[D];(d[y]===1&&(!F&&I||F&&H)||d[y]!==1&&(!F&&H||F&&I))&&(k=y==="x"?O:B)}const U={x:h.x+E.x,y:h.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:h.x+E.x,y:h.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 qG(e,t,n,i){const a=Math.min(hS(e,t)/2,hS(t,n)/2,i),{x:l,y:o}=t;if(e.x===l&&l===n.x||e.y===o&&o===n.y)return`L${l} ${o}`;if(e.y===o){const h=e.x<n.x?-1:1,g=e.y<n.y?1:-1;return`L ${l+a*h},${o}Q ${l},${o} ${l},${o+a*g}`}const d=e.x<n.x?1:-1,f=e.y<n.y?-1:1;return`L ${l},${o+a*f}Q ${l},${o} ${l+a*d},${o}`}function xb({sourceX:e,sourceY:t,sourcePosition:n=Ge.Bottom,targetX:i,targetY:a,targetPosition:l=Ge.Top,borderRadius:o=5,centerX:d,centerY:f,offset:h=20,stepPosition:g=.5}){const[m,y,b,k,v]=FG({source:{x:e,y:t},sourcePosition:n,target:{x:i,y:a},targetPosition:l,center:{x:d,y:f},offset:h,stepPosition:g});let S=`M${m[0].x} ${m[0].y}`;for(let E=1;E<m.length-1;E++)S+=qG(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 pS(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function HG(e){var m;const{sourceNode:t,targetNode:n}=e;if(!pS(t)||!pS(n))return null;const i=t.internals.handleBounds||mS(t.handles),a=n.internals.handleBounds||mS(n.handles),l=gS((i==null?void 0:i.source)??[],e.sourceHandle),o=gS(e.connectionMode===Ho.Strict?(a==null?void 0:a.target)??[]:((a==null?void 0:a.target)??[]).concat((a==null?void 0:a.source)??[]),e.targetHandle);if(!l||!o)return(m=e.onError)==null||m.call(e,"008",hr.error008(l?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const d=(l==null?void 0:l.position)||Ge.Bottom,f=(o==null?void 0:o.position)||Ge.Top,h=vl(t,l,d),g=vl(n,o,f);return{sourceX:h.x,sourceY:h.y,targetX:g.x,targetY:g.y,sourcePosition:d,targetPosition:f}}function mS(e){if(!e)return null;const t=[],n=[];for(const i of e)i.width=i.width??1,i.height=i.height??1,i.type==="source"?t.push(i):i.type==="target"&&n.push(i);return{source:t,target:n}}function vl(e,t,n=Ge.Left,i=!1){const a=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,l=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:o,height:d}=t??va(e);if(i)return{x:a+o/2,y:l+d/2};switch((t==null?void 0:t.position)??n){case Ge.Top:return{x:a+o/2,y:l};case Ge.Right:return{x:a+o,y:l+d/2};case Ge.Bottom:return{x:a+o/2,y:l+d};case Ge.Left:return{x:a,y:l+d/2}}}function gS(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function vb(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function KG(e,{id:t,defaultColor:n,defaultMarkerStart:i,defaultMarkerEnd:a}){const l=new Set;return e.reduce((o,d)=>([d.markerStart||i,d.markerEnd||a].forEach(f=>{if(f&&typeof f=="object"){const h=vb(f,t);l.has(h)||(o.push({id:h,color:f.color||n,...f}),l.add(h))}}),o),[]).sort((o,d)=>o.id.localeCompare(d.id))}const ZC=1e3,GG=10,Xx={nodeOrigin:[0,0],nodeExtent:Ou,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},VG={...Xx,checkEquality:!0};function Zx(e,t){const n={...e};for(const i in t)t[i]!==void 0&&(n[i]=t[i]);return n}function YG(e,t,n){const i=Zx(Xx,n);for(const a of e.values())if(a.parentId)ev(a,e,t,i);else{const l=rd(a,i.nodeOrigin),o=xl(a.extent)?a.extent:i.nodeExtent,d=bl(l,o,va(a));a.internals.positionAbsolute=d}}function QG(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 Jx(e){return e==="manual"}function wb(e,t,n,i={}){var g,m;const a=Zx(VG,i),l={i:0},o=new Map(t),d=a!=null&&a.elevateNodesOnSelect&&!Jx(a.zIndexMode)?ZC:0;let f=e.length>0,h=!1;t.clear(),n.clear();for(const y of e){let b=o.get(y.id);if(a.checkEquality&&y===(b==null?void 0:b.internals.userNode))t.set(y.id,b);else{const k=rd(y,a.nodeOrigin),v=xl(y.extent)?y.extent:a.nodeExtent,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:QG(y,b),z:JC(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&&ev(b,t,n,i,l),h||(h=y.selected??!1)}return{nodesInitialized:f,hasSelectedNodes:h}}function WG(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 ev(e,t,n,i,a){const{elevateNodesOnSelect:l,nodeOrigin:o,nodeExtent:d,zIndexMode:f}=Zx(Xx,i),h=e.parentId,g=t.get(h);if(!g){console.warn(`Parent node ${h} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}WG(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*GG),a&&g.internals.rootParentIndex!==void 0&&(a.i=g.internals.rootParentIndex);const m=l&&!Jx(f)?ZC:0,{x:y,y:b,z:k}=XG(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 JC(e,t,n){const i=cr(e.zIndex)?e.zIndex:0;return Jx(n)?i:i+(e.selected?t:0)}function XG(e,t,n,i,a,l){const{x:o,y:d}=t.internals.positionAbsolute,f=va(e),h=rd(e,n),g=xl(e.extent)?bl(h,e.extent,f):h;let m=bl({x:o+g.x,y:d+g.y},i,f);e.extent==="parent"&&(m=BC(m,f,t));const y=JC(e,a,l),b=t.internals.z??0;return{x:m.x,y:m.y,z:b>=y?b+1:y}}function tv(e,t,n,i=[0,0]){var o;const a=[],l=new Map;for(const d of e){const f=t.get(d.parentId);if(!f)continue;const h=((o=l.get(d.parentId))==null?void 0:o.expandedRect)??Lu(f),g=$C(h,d.rect);l.set(d.parentId,{expandedRect:g,parent:f})}return l.size>0&&l.forEach(({expandedRect:d,parent:f},h)=>{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:h,type:"position",position:{x:f.position.x-b+E,y:f.position.y-k+C}}),(N=n.get(h))==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:h,type:"dimensions",setAttributes:!0,dimensions:{width:v+(b?y[0]*b-E:0),height:S+(k?y[1]*k-C:0)}})}),a}function ZG(e,t,n,i,a,l,o){const d=i==null?void 0:i.querySelector(".xyflow__viewport");let f=!1;if(!d)return{changes:[],updatedInternals:f};const h=[],g=window.getComputedStyle(d),{m22:m}=new window.DOMMatrixReadOnly(g.transform),y=[];for(const b of e.values()){const k=t.get(b.id);if(!k)continue;if(k.hidden){t.set(k.id,{...k,internals:{...k.internals,handleBounds:void 0}}),f=!0;continue}const v=Wx(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"?_=BC(_,v,t.get(k.parentId)):N&&(_=bl(_,N,v));const T={...k,measured:v,internals:{...k.internals,positionAbsolute:_,handleBounds:{source:uS("source",b.nodeElement,C,m,k.id),target:uS("target",b.nodeElement,C,m,k.id)}}};t.set(k.id,T),k.parentId&&ev(T,t,n,{nodeOrigin:a,zIndexMode:o}),f=!0,S&&(h.push({id:k.id,type:"dimensions",dimensions:v}),k.expandParent&&k.parentId&&y.push({id:k.id,parentId:k.parentId,rect:Lu(T,a)}))}}if(y.length>0){const b=tv(y,t,n,a);h.push(...b)}return{changes:h,updatedInternals:f}}async function JG({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 yS(e,t,n,i,a,l){let o=a;const d=i.get(o)||new Map;i.set(o,d.set(n,t)),o=`${a}-${e}`;const f=i.get(o)||new Map;if(i.set(o,f.set(n,t)),l){o=`${a}-${e}-${l}`;const h=i.get(o)||new Map;i.set(o,h.set(n,t))}}function eA(e,t,n){e.clear(),t.clear();for(const i of n){const{source:a,target:l,sourceHandle:o=null,targetHandle:d=null}=i,f={edgeId:i.id,source:a,target:l,sourceHandle:o,targetHandle:d},h=`${a}-${o}--${l}-${d}`,g=`${l}-${d}--${a}-${o}`;yS("source",f,g,e,a,o),yS("target",f,h,e,l,d),t.set(i.id,i)}}function tA(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:tA(n,t):!1}function bS(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 eV(e,t,n,i){const a=new Map;for(const[l,o]of e)if((o.selected||o.id===i)&&(!o.parentId||!tA(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 my({nodeId:e,dragItems:t,nodeLookup:n,dragging:i=!0}){var o,d,f;const a=[];for(const[h,g]of t){const m=(o=n.get(h))==null?void 0:o.internals.userNode;m&&a.push({...m,position:g.position,dragging:i})}if(!e)return[a[0],a];const l=(d=n.get(e))==null?void 0:d.internals.userNode;return[l?{...l,position:((f=t.get(e))==null?void 0:f.position)||l.position,dragging:i}:a[0],a]}function tV({dragItems:e,snapGrid:t,x:n,y:i}){const a=e.values().next().value;if(!a)return null;const l={x:n-a.distance.x,y:i-a.distance.y},o=sd(l,t);return{x:o.x-l.x,y:o.y-l.y}}function nV({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:i,onDragStop:a}){let l={x:null,y:null},o=0,d=new Map,f=!1,h={x:0,y:0},g=null,m=!1,y=null,b=!1,k=!1,v=null;function S({noDragClassName:C,handleSelector:N,domNode:_,isSelectable:T,nodeId:M,nodeClickDistance:R=0}){y=_i(_);function O({x:q,y:Y}){const{nodeLookup:D,nodeExtent:F,snapGrid:I,snapToGrid:H,nodeOrigin:Q,onNodeDrag:G,onSelectionDrag:L,onError:z,updateNodePositions:V}=t();l={x:q,y:Y};let P=!1;const le=d.size>1,ve=le&&F?bb(ad(d)):null,ke=le&&H?tV({dragItems:d,snapGrid:I,x:q,y:Y}):null;for(const[Se,J]of d){if(!D.has(Se))continue;let ue={x:q-J.distance.x,y:Y-J.distance.y};H&&(ue=ke?{x:Math.round(ue.x+ke.x),y:Math.round(ue.y+ke.y)}:sd(ue,I));let Te=null;if(le&&F&&!J.extent&&ve){const{positionAbsolute:ce}=J.internals,Ce=ce.x-ve.x+F[0][0],te=ce.x+J.measured.width-ve.x2+F[1][0],pe=ce.y-ve.y+F[0][1],Fe=ce.y+J.measured.height-ve.y2+F[1][1];Te=[[Ce,pe],[te,Fe]]}const{position:Re,positionAbsolute:Oe}=PC({nodeId:Se,nextPosition:ue,nodeLookup:D,nodeExtent:Te||F,nodeOrigin:Q,onError:z});P=P||J.position.x!==Re.x||J.position.y!==Re.y,J.position=Re,J.internals.positionAbsolute=Oe}if(k=k||P,!!P&&(V(d,!0),v&&(i||G||!M&&L))){const[Se,J]=my({nodeId:M,dragItems:d,nodeLookup:D});i==null||i(v,d,Se,J),G==null||G(v,Se,J),M||L==null||L(v,J)}}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]=Yx(h,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})&&O(l)),o=requestAnimationFrame(B)}function U(q){var le;const{nodeLookup:Y,multiSelectionActive:D,nodesDraggable:F,transform:I,snapGrid:H,snapToGrid:Q,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=bu(q.sourceEvent,{transform:I,snapGrid:H,snapToGrid:Q,containerBounds:g});if(l=P,d=eV(Y,F,P,M),d.size>0&&(n||L||!M&&z)){const[ve,ke]=my({nodeId:M,dragItems:d,nodeLookup:Y});n==null||n(q.sourceEvent,d,ve,ke),L==null||L(q.sourceEvent,ve,ke),M||z==null||z(q.sourceEvent,ke)}}const K=yC().clickDistance(R).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=bu(q.sourceEvent,{transform:F,snapGrid:I,snapToGrid:H,containerBounds:g}),h=ur(q.sourceEvent,g)}).on("drag",q=>{const{autoPanOnNodeDrag:Y,transform:D,snapGrid:F,snapToGrid:I,nodeDragThreshold:H,nodeLookup:Q}=t(),G=bu(q.sourceEvent,{transform:D,snapGrid:F,snapToGrid:I,containerBounds:g});if(v=q.sourceEvent,(q.sourceEvent.type==="touchmove"&&q.sourceEvent.touches.length>1||M&&!Q.has(M))&&(b=!0),!b){if(!f&&Y&&m&&(f=!0,B()),!m){const L=ur(q.sourceEvent,g),z=L.x-h.x,V=L.y-h.y;Math.sqrt(z*z+V*V)>H&&U(q)}(l.x!==G.xSnapped||l.y!==G.ySnapped)&&d&&m&&(h=ur(q.sourceEvent,g),O(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,Q]=my({nodeId:M,dragItems:d,nodeLookup:Y,dragging:!1});a==null||a(q.sourceEvent,d,H,Q),F==null||F(q.sourceEvent,H,Q),M||I==null||I(q.sourceEvent,Q)}}}).filter(q=>{const Y=q.target;return!q.button&&(!C||!bS(Y,`.${C}`,_))&&(!N||bS(Y,N,_))});y.call(K)}function E(){y==null||y.on(".drag",null)}return{update:S,destroy:E}}function iV(e,t,n){const i=[],a={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const l of t.values())Lh(a,Lu(l))>0&&i.push(l);return i}const rV=250;function aV(e,t,n,i){var d,f;let a=[],l=1/0;const o=iV(e,n,t+rV);for(const h of o){const g=[...((d=h.internals.handleBounds)==null?void 0:d.source)??[],...((f=h.internals.handleBounds)==null?void 0:f.target)??[]];for(const m of g){if(i.nodeId===m.nodeId&&i.type===m.type&&i.id===m.id)continue;const{x:y,y:b}=vl(h,m,m.position,!0),k=Math.sqrt(Math.pow(y-e.x,2)+Math.pow(b-e.y,2));k>t||(k<l?(a=[{...m,x:y,y:b}],l=k):k===l&&a.push({...m,x:y,y:b}))}}if(!a.length)return null;if(a.length>1){const h=i.type==="source"?"target":"source";return a.find(g=>g.type===h)??a[0]}return a[0]}function nA(e,t,n,i,a,l=!1){var h,g,m;const o=i.get(e);if(!o)return null;const d=a==="strict"?(h=o.internals.handleBounds)==null?void 0:h[t]:[...((g=o.internals.handleBounds)==null?void 0:g.source)??[],...((m=o.internals.handleBounds)==null?void 0:m.target)??[]],f=(n?d==null?void 0:d.find(y=>y.id===n):d==null?void 0:d[0])??null;return f&&l?{...f,...vl(o,f,f.position,!0)}:f}function iA(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function sV(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const rA=()=>!0;function lV(e,{connectionMode:t,connectionRadius:n,handleId:i,nodeId:a,edgeUpdaterType:l,isTarget:o,domNode:d,nodeLookup:f,lib:h,autoPanOnConnect:g,flowId:m,panBy:y,cancelConnection:b,onConnectStart:k,onConnect:v,onConnectEnd:S,isValidConnection:E=rA,onReconnectEnd:C,updateConnection:N,getTransform:_,getFromHandle:T,autoPanSpeed:M,dragThreshold:R=1,handleDomNode:O}){const B=KC(e.target);let U=0,K;const{x:q,y:Y}=ur(e),D=iA(l,O),F=d==null?void 0:d.getBoundingClientRect();let I=!1;if(!F||!D)return;const H=nA(a,D,i,f,t);if(!H)return;let Q=ur(e,F),G=!1,L=null,z=!1,V=null;function P(){if(!g||!F)return;const[Re,Oe]=Yx(Q,F,M);y({x:Re,y:Oe}),U=requestAnimationFrame(P)}const le={...H,nodeId:a,type:D,position:H.position},ve=f.get(a);let Se={inProgress:!0,isValid:null,from:vl(ve,le,Ge.Left,!0),fromHandle:le,fromPosition:le.position,fromNode:ve,to:Q,toHandle:null,toPosition:sS[le.position],toNode:null,pointer:Q};function J(){I=!0,N(Se),k==null||k(e,{nodeId:a,handleId:i,handleType:D})}R===0&&J();function ue(Re){if(!I){const{x:Fe,y:ze}=ur(Re),ae=Fe-q,be=ze-Y;if(!(ae*ae+be*be>R*R))return;J()}if(!T()||!le){Te(Re);return}const Oe=_();Q=ur(Re,F),K=aV(ld(Q,Oe,!1,[1,1]),n,f,le),G||(P(),G=!0);const ce=aA(Re,{handle:K,connectionMode:t,fromNodeId:a,fromHandleId:i,fromType:o?"target":"source",isValidConnection:E,doc:B,lib:h,flowId:m,nodeLookup:f});V=ce.handleDomNode,L=ce.connection,z=sV(!!K,ce.isValid);const Ce=f.get(a),te=Ce?vl(Ce,le,Ge.Left,!0):Se.from,pe={...Se,from:te,isValid:z,to:ce.toHandle&&z?Go({x:ce.toHandle.x,y:ce.toHandle.y},Oe):Q,toHandle:ce.toHandle,toPosition:z&&ce.toHandle?ce.toHandle.position:sS[le.position],toNode:ce.toHandle?f.get(ce.toHandle.nodeId):null,pointer:Q};N(pe),Se=pe}function Te(Re){if(!("touches"in Re&&Re.touches.length>0)){if(I){(K||V)&&L&&z&&(v==null||v(L));const{inProgress:Oe,...ce}=Se,Ce={...ce,toPosition:Se.toHandle?Se.toPosition:null};S==null||S(Re,Ce),l&&(C==null||C(Re,Ce))}b(),cancelAnimationFrame(U),G=!1,z=!1,L=null,V=null,B.removeEventListener("mousemove",ue),B.removeEventListener("mouseup",Te),B.removeEventListener("touchmove",ue),B.removeEventListener("touchend",Te)}}B.addEventListener("mousemove",ue),B.addEventListener("mouseup",Te),B.addEventListener("touchmove",ue),B.addEventListener("touchend",Te)}function aA(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:a,fromType:l,doc:o,lib:d,flowId:f,isValidConnection:h=rA,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=iA(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 R={source:m?N:i,sourceHandle:m?_:a,target:m?i:N,targetHandle:m?a:_};E.connection=R;const B=T&&M&&(n===Ho.Strict?m&&C==="source"||!m&&C==="target":N!==i||_!==a);E.isValid=B&&h(R),E.toHandle=nA(N,C,_,g,n,!0)}return E}const kb={onPointerDown:lV,isValid:aA};function oV({domNode:e,panZoom:t,getTransform:n,getViewScale:i}){const a=_i(e);function l({translateExtent:d,width:f,height:h,zoomStep:g=1,pannable:m=!0,zoomable:y=!0,inversePan:b=!1}){const k=N=>{if(N.sourceEvent.type!=="wheel"||!t)return;const _=n(),T=N.sourceEvent.ctrlKey&&Iu()?10:1,M=-N.sourceEvent.deltaY*(N.sourceEvent.deltaMode===1?.05:N.sourceEvent.deltaMode?1:.002)*g,R=_[2]*Math.pow(2,M*T);t.scaleTo(R)};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 R=i()*Math.max(_[2],Math.log(_[2]))*(b?-1:1),O={x:_[0]-M[0]*R,y:_[1]-M[1]*R},B=[[0,0],[f,h]];t.setViewportConstrained({x:O.x,y:O.y,zoom:_[2]},B,d)},C=DC().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 gp=e=>({x:e.x,y:e.y,zoom:e.k}),gy=({x:e,y:t,zoom:n})=>hp.translate(e,t).scale(n),vo=(e,t)=>e.target.closest(`.${t}`),sA=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),cV=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,yy=(e,t=0,n=cV,i=()=>{})=>{const a=typeof t=="number"&&t>0;return a||i(),a?e.transition().duration(t).ease(n).on("end",i):e},lA=e=>{const t=e.ctrlKey&&Iu()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function uV({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:i,panOnScrollMode:a,panOnScrollSpeed:l,zoomOnPinch:o,onPanZoomStart:d,onPanZoom:f,onPanZoomEnd:h}){return g=>{if(vo(g,t))return g.ctrlKey&&g.preventDefault(),!1;g.preventDefault(),g.stopImmediatePropagation();const m=n.property("__zoom").k||1;if(g.ctrlKey&&o){const S=lr(g),E=lA(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;!Iu()&&g.shiftKey&&a!==ul.Vertical&&(b=g.deltaY*y,k=0),i.translateBy(n,-(b/m)*l,-(k/m)*l,{internal:!0});const v=gp(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(f==null||f(g,v),e.panScrollTimeout=setTimeout(()=>{h==null||h(g,v),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,d==null||d(g,v))}}function dV({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 fV({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return i=>{var l,o,d;if((l=i.sourceEvent)!=null&&l.internal)return;const a=gp(i.transform);e.mouseButton=((o=i.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=a,((d=i.sourceEvent)==null?void 0:d.type)==="mousedown"&&t(!0),n&&(n==null||n(i.sourceEvent,a))}}function hV({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:a}){return l=>{var o,d;e.usedRightMouseButton=!!(n&&sA(t,e.mouseButton??0)),(o=l.sourceEvent)!=null&&o.sync||i([l.transform.x,l.transform.y,l.transform.k]),a&&!((d=l.sourceEvent)!=null&&d.internal)&&(a==null||a(l.sourceEvent,gp(l.transform)))}}function pV({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&&sA(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&l(o.sourceEvent),e.usedRightMouseButton=!1,i(!1),a)){const f=gp(o.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a==null||a(o.sourceEvent,f)},n?150:0)}}}function mV({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:i,panOnScroll:a,zoomOnDoubleClick:l,userSelectionActive:o,noWheelClassName:d,noPanClassName:f,lib:h,connectionInProgress:g}){return m=>{var S;const y=e||t,b=n&&m.ctrlKey,k=m.type==="wheel";if(m.button===1&&m.type==="mousedown"&&(vo(m,`${h}-flow__node`)||vo(m,`${h}-flow__edge`)))return!0;if(!i&&!y&&!a&&!l&&!n||o||g&&!k||vo(m,d)&&k||vo(m,f)&&(!k||a&&k&&!e)||!n&&m.ctrlKey&&k)return!1;if(!n&&m.type==="touchstart"&&((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 gV({domNode:e,minZoom:t,maxZoom:n,translateExtent:i,viewport:a,onPanZoom:l,onPanZoomStart:o,onPanZoomEnd:d,onDraggingChange:f}){const h={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},g=e.getBoundingClientRect(),m=DC().scaleExtent([t,n]).translateExtent(i),y=_i(e).call(m);C({x:a.x,y:a.y,zoom:Ko(a.zoom,t,n)},[[0,0],[g.width,g.height]],i);const b=y.on("wheel.zoom"),k=y.on("dblclick.zoom");m.wheelDelta(lA);async function v(K,q){return y?new Promise(Y=>{m==null||m.interpolate((q==null?void 0:q.interpolate)==="linear"?yu:rh).transform(yy(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:Q,preventScrolling:G,zoomOnPinch:L,zoomOnScroll:z,zoomOnDoubleClick:V,zoomActivationKeyPressed:P,lib:le,onTransformChange:ve,connectionInProgress:ke,paneClickDistance:Se,selectionOnDrag:J}){D&&!h.isZoomingOrPanning&&E();const ue=F&&!P&&!D;m.clickDistance(J?1/0:!cr(Se)||Se<0?0:Se);const Te=ue?uV({zoomPanValues:h,noWheelClassName:K,d3Selection:y,d3Zoom:m,panOnScrollMode:H,panOnScrollSpeed:Q,zoomOnPinch:L,onPanZoomStart:o,onPanZoom:l,onPanZoomEnd:d}):dV({noWheelClassName:K,preventScrolling:G,d3ZoomHandler:b});y.on("wheel.zoom",Te,{passive:!1});const Re=fV({zoomPanValues:h,onDraggingChange:f,onPanZoomStart:o});m.on("start",Re);const Oe=hV({zoomPanValues:h,panOnDrag:I,onPaneContextMenu:!!Y,onPanZoom:l,onTransformChange:ve});m.on("zoom",Oe);const ce=pV({zoomPanValues:h,panOnDrag:I,panOnScroll:F,onPaneContextMenu:Y,onPanZoomEnd:d,onDraggingChange:f});m.on("end",ce);const Ce=mV({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=gy(K),F=m==null?void 0:m.constrain()(D,q,Y);return F&&await v(F),F}async function N(K,q){const Y=gy(K);return await v(Y,q),Y}function _(K){if(y){const q=gy(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?MC(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"?yu:rh).scaleTo(yy(y,q==null?void 0:q.duration,q==null?void 0:q.ease,()=>Y(!0)),K)}):!1}async function R(K,q){return y?new Promise(Y=>{m==null||m.interpolate((q==null?void 0:q.interpolate)==="linear"?yu:rh).scaleBy(yy(y,q==null?void 0:q.duration,q==null?void 0:q.ease,()=>Y(!0)),K)}):!1}function O(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:R,setScaleExtent:O,setTranslateExtent:B,syncViewport:_,setClickDistance:U}}var Vo;(function(e){e.Line="line",e.Handle="handle"})(Vo||(Vo={}));function yV({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 xS(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),i=e.includes("left"),a=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:i,affectsY:a}}function rs(e,t){return Math.max(0,t-e)}function as(e,t){return Math.max(0,e-t)}function Gf(e,t,n){return Math.max(0,t-e,e-n)}function vS(e,t){return e?!t:t}function bV(e,t,n,i,a,l,o,d){let{affectsX:f,affectsY:h}=t;const{isHorizontal:g,isVertical:m}=t,y=g&&m,{xSnapped:b,ySnapped:k}=n,{minWidth:v,maxWidth:S,minHeight:E,maxHeight:C}=i,{x:N,y:_,width:T,height:M,aspectRatio:R}=e;let O=Math.floor(g?b-e.pointerX:0),B=Math.floor(m?k-e.pointerY:0);const U=T+(f?-O:O),K=M+(h?-B:B),q=-l[0]*T,Y=-l[1]*M;let D=Gf(U,v,S),F=Gf(K,E,C);if(o){let Q=0,G=0;f&&O<0?Q=rs(N+O+q,o[0][0]):!f&&O>0&&(Q=as(N+U+q,o[1][0])),h&&B<0?G=rs(_+B+Y,o[0][1]):!h&&B>0&&(G=as(_+K+Y,o[1][1])),D=Math.max(D,Q),F=Math.max(F,G)}if(d){let Q=0,G=0;f&&O>0?Q=as(N+O,d[0][0]):!f&&O<0&&(Q=rs(N+U,d[1][0])),h&&B>0?G=as(_+B,d[0][1]):!h&&B<0&&(G=rs(_+K,d[1][1])),D=Math.max(D,Q),F=Math.max(F,G)}if(a){if(g){const Q=Gf(U/R,E,C)*R;if(D=Math.max(D,Q),o){let G=0;!f&&!h||f&&!h&&y?G=as(_+Y+U/R,o[1][1])*R:G=rs(_+Y+(f?O:-O)/R,o[0][1])*R,D=Math.max(D,G)}if(d){let G=0;!f&&!h||f&&!h&&y?G=rs(_+U/R,d[1][1])*R:G=as(_+(f?O:-O)/R,d[0][1])*R,D=Math.max(D,G)}}if(m){const Q=Gf(K*R,v,S)/R;if(F=Math.max(F,Q),o){let G=0;!f&&!h||h&&!f&&y?G=as(N+K*R+q,o[1][0])/R:G=rs(N+(h?B:-B)*R+q,o[0][0])/R,F=Math.max(F,G)}if(d){let G=0;!f&&!h||h&&!f&&y?G=rs(N+K*R,d[1][0])/R:G=as(N+(h?B:-B)*R,d[0][0])/R,F=Math.max(F,G)}}}B=B+(B<0?F:-F),O=O+(O<0?D:-D),a&&(y?U>K*R?B=(vS(f,h)?-O:O)/R:O=(vS(f,h)?-B:B)*R:g?(B=O/R,h=f):(O=B*R,f=h));const I=f?N+O:N,H=h?_+B:_;return{width:T+(f?-O:O),height:M+(h?-B:B),x:l[0]*O*(f?-1:1)+I,y:l[1]*B*(h?-1:1)+H}}const oA={width:0,height:0,x:0,y:0},xV={...oA,pointerX:0,pointerY:0,aspectRatio:1};function vV(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 wV({domNode:e,nodeId:t,getStoreItems:n,onChange:i,onEnd:a}){const l=_i(e);let o={controlDirection:xS("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function d({controlPosition:h,boundaries:g,keepAspectRatio:m,resizeDirection:y,onResizeStart:b,onResize:k,onResizeEnd:v,shouldResize:S}){let E={...oA},C={...xV};o={boundaries:g,resizeDirection:y,keepAspectRatio:m,controlDirection:xS(h)};let N,_=null,T=[],M,R,O,B=!1;const U=yC().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:Q,ySnapped:G}=bu(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:Q,pointerY:G,aspectRatio:E.width/E.height},M=void 0,R=xl(N.extent)?N.extent:void 0,N.parentId&&(N.extent==="parent"||N.expandParent)&&(M=q.get(N.parentId)),M&&N.extent==="parent"&&(R=[[0,0],[M.measured.width,M.measured.height]]),T=[],O=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=vV(z,N,z.origin??I);O?O=[[Math.min(V[0][0],O[0][0]),Math.min(V[0][1],O[0][1])],[Math.max(V[1][0],O[1][0]),Math.max(V[1][1],O[1][1])]]:O=V}b==null||b(K,{...E})}).on("drag",K=>{const{transform:q,snapGrid:Y,snapToGrid:D,nodeOrigin:F}=n(),I=bu(K.sourceEvent,{transform:q,snapGrid:Y,snapToGrid:D,containerBounds:_}),H=[];if(!N)return;const{x:Q,y:G,width:L,height:z}=E,V={},P=N.origin??F,{width:le,height:ve,x:ke,y:Se}=bV(C,o.controlDirection,I,o.boundaries,o.keepAspectRatio,P,R,O),J=le!==L,ue=ve!==z,Te=ke!==Q&&J,Re=Se!==G&&ue;if(!Te&&!Re&&!J&&!ue)return;if((Te||Re||P[0]===1||P[1]===1)&&(V.x=Te?ke:E.x,V.y=Re?Se:E.y,E.x=V.x,E.y=V.y,T.length>0)){const te=ke-Q,pe=Se-G;for(const Fe of T)Fe.position={x:Fe.position.x-te+P[0]*(le-L),y:Fe.position.y-pe+P[1]*(ve-z)},H.push(Fe)}if((J||ue)&&(V.width=J&&(!o.resizeDirection||o.resizeDirection==="horizontal")?le:E.width,V.height=ue&&(!o.resizeDirection||o.resizeDirection==="vertical")?ve:E.height,E.width=V.width,E.height=V.height),M&&N.expandParent){const te=P[0]*(V.width??0);V.x&&V.x<te&&(E.x=te,C.x=C.x-(V.x-te));const pe=P[1]*(V.height??0);V.y&&V.y<pe&&(E.y=pe,C.y=C.y-(V.y-pe))}const Oe=yV({width:E.width,prevWidth:L,height:E.height,prevHeight:z,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),ce={...E,direction:Oe};(S==null?void 0:S(K,ce))!==!1&&(B=!0,k==null||k(K,ce),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 by={exports:{}},xy={},vy={exports:{}},wy={};/**
|
|
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 wS;function kV(){if(wS)return wy;wS=1;var e=Hu();function t(m,y){return m===y&&(m!==0||1/m===1/y)||m!==m&&y!==y}var n=typeof Object.is=="function"?Object.is:t,i=e.useState,a=e.useEffect,l=e.useLayoutEffect,o=e.useDebugValue;function d(m,y){var b=y(),k=i({inst:{value:b,getSnapshot:y}}),v=k[0].inst,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 h(m,y){return y()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:d;return wy.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,wy}var kS;function EV(){return kS||(kS=1,vy.exports=kV()),vy.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 ES;function SV(){if(ES)return xy;ES=1;var e=Hu(),t=EV();function n(h,g){return h===g&&(h!==0||1/h===1/g)||h!==h&&g!==g}var i=typeof Object.is=="function"?Object.is:n,a=t.useSyncExternalStore,l=e.useRef,o=e.useEffect,d=e.useMemo,f=e.useDebugValue;return xy.useSyncExternalStoreWithSelector=function(h,g,m,y,b){var k=l(null);if(k.current===null){var v={hasValue:!1,value:null};k.current=v}else v=k.current;k=d(function(){function E(M){if(!C){if(C=!0,N=M,M=y(M),b!==void 0&&v.hasValue){var R=v.value;if(b(R,M))return _=R}return _=M}if(R=_,i(N,M))return R;var O=y(M);return b!==void 0&&b(R,O)?(N=M,R):(N=M,_=O)}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(h,k[0],k[1]);return o(function(){v.hasValue=!0,v.value=S},[S]),f(S),S},xy}var SS;function NV(){return SS||(SS=1,by.exports=SV()),by.exports}var _V=NV();const jV=qu(_V),CV={},NS=e=>{let t;const n=new Set,i=(g,m)=>{const y=typeof g=="function"?g(t):g;if(!Object.is(y,t)){const b=t;t=m??(typeof y!="object"||y===null)?y:Object.assign({},t,y),n.forEach(k=>k(t,b))}},a=()=>t,f={setState:i,getState:a,getInitialState:()=>h,subscribe:g=>(n.add(g),()=>n.delete(g)),destroy:()=>{(CV?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},h=t=e(i,a,f);return f},AV=e=>e?NS(e):NS,{useDebugValue:TV}=iD,{useSyncExternalStoreWithSelector:MV}=jV,DV=e=>e;function cA(e,t=DV,n){const i=MV(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return TV(i),i}const _S=(e,t)=>{const n=AV(e),i=(a,l=t)=>cA(n,a,l);return Object.assign(i,n),i},OV=(e,t)=>e?_S(e,t):_S;function tn(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[i,a]of e)if(!Object.is(a,t.get(i)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(t,i)||!Object.is(e[i],t[i]))return!1;return!0}const yp=j.createContext(null),RV=yp.Provider,uA=hr.error001("react");function Nt(e,t){const n=j.useContext(yp);if(n===null)throw new Error(uA);return cA(n,e,t)}function nn(){const e=j.useContext(yp);if(e===null)throw new Error(uA);return j.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const jS={display:"none"},LV={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},dA="react-flow__node-desc",fA="react-flow__edge-desc",IV="react-flow__aria-live",zV=e=>e.ariaLiveMessage,PV=e=>e.ariaLabelConfig;function BV({rfId:e}){const t=Nt(zV);return c.jsx("div",{id:`${IV}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:LV,children:t})}function $V({rfId:e,disableKeyboardA11y:t}){const n=Nt(PV);return c.jsxs(c.Fragment,{children:[c.jsx("div",{id:`${dA}-${e}`,style:jS,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),c.jsx("div",{id:`${fA}-${e}`,style:jS,children:n["edge.a11yDescription.default"]}),!t&&c.jsx(BV,{rfId:e})]})}const bp=j.forwardRef(({position:e="top-left",children:t,className:n,style:i,...a},l)=>{const o=`${e}`.split("-");return c.jsx("div",{className:Nn(["react-flow__panel",n,...o]),style:i,ref:l,...a,children:t})});bp.displayName="Panel";const CS="https://reactflow.dev?utm_source=attribution";function UV({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:c.jsx(bp,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${CS}`,children:c.jsx("a",{href:CS,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const FV=e=>{const t=[],n=[];for(const[,i]of e.nodeLookup)i.selected&&t.push(i.internals.userNode);for(const[,i]of e.edgeLookup)i.selected&&n.push(i);return{selectedNodes:t,selectedEdges:n}},Vf=e=>e.id;function qV(e,t){return tn(e.selectedNodes.map(Vf),t.selectedNodes.map(Vf))&&tn(e.selectedEdges.map(Vf),t.selectedEdges.map(Vf))}function HV({onSelectionChange:e}){const t=nn(),{selectedNodes:n,selectedEdges:i}=Nt(FV,qV);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 KV=e=>!!e.onSelectionChangeHandlers;function GV({onSelectionChange:e}){const t=Nt(KV);return e||t?c.jsx(HV,{onSelectionChange:e}):null}const hA=[0,0],VV={x:0,y:0,zoom:1},YV=["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"],AS=[...YV,"rfId"],QV=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}),TS={translateExtent:Ou,nodeOrigin:hA,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function WV(e){const{setNodes:t,setEdges:n,setMinZoom:i,setMaxZoom:a,setTranslateExtent:l,setNodeExtent:o,reset:d,setDefaultNodesAndEdges:f}=Nt(QV,tn),h=nn();j.useEffect(()=>(f(e.defaultNodes,e.defaultEdges),()=>{g.current=TS,d()}),[]);const g=j.useRef(TS);return j.useEffect(()=>{for(const m of AS){const y=e[m],b=g.current[m];y!==b&&(typeof e[m]>"u"||(m==="nodes"?t(y):m==="edges"?n(y):m==="minZoom"?i(y):m==="maxZoom"?a(y):m==="translateExtent"?l(y):m==="nodeExtent"?o(y):m==="ariaLabelConfig"?h.setState({ariaLabelConfig:RG(y)}):m==="fitView"?h.setState({fitViewQueued:y}):m==="fitViewOptions"?h.setState({fitViewOptions:y}):h.setState({[m]:y})))}g.current=e},AS.map(m=>e[m])),null}function MS(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function XV(e){var i;const[t,n]=j.useState(e==="system"?null:e);return j.useEffect(()=>{if(e!=="system"){n(e);return}const a=MS(),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=MS())!=null&&i.matches?"dark":"light"}const DS=typeof document<"u"?document:null;function zu(e=null,t={target:DS,actInsideInputWithModifier:!0}){const[n,i]=j.useState(!1),a=j.useRef(!1),l=j.useRef(new Set([])),[o,d]=j.useMemo(()=>{if(e!==null){const h=(Array.isArray(e)?e:[e]).filter(m=>typeof m=="string").map(m=>m.replace("+",`
|
|
680
|
-
`).replace(`
|
|
681
|
-
|
|
682
|
-
`,`
|
|
683
|
-
+`).split(`
|
|
684
|
-
`)),g=h.reduce((m,y)=>m.concat(...y),[]);return[h,g]}return[[],[]]},[e]);return j.useEffect(()=>{const f=(t==null?void 0:t.target)??DS,h=(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&&!h)&&GC(b))return!1;const v=RS(b.code,d);if(l.current.add(b[v]),OS(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=RS(b.code,d);OS(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 OS(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(a=>t.has(a)))}function RS(e,t){return t.includes(e)?"code":"key"}const ZV=()=>{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=Qx(t,i,a,l,o,(n==null?void 0:n.padding)??.1);return d?(await d.setViewport(f,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:i,snapGrid:a,snapToGrid:l,domNode:o}=e.getState();if(!o)return t;const{x:d,y:f}=o.getBoundingClientRect(),h={x:t.x-d,y:t.y-f},g=n.snapGrid??a,m=n.snapToGrid??l;return ld(h,i,m,g)},flowToScreenPosition:t=>{const{transform:n,domNode:i}=e.getState();if(!i)return t;const{x:a,y:l}=i.getBoundingClientRect(),o=Go(t,n);return{x:o.x+a,y:o.y+l}}}),[])};function pA(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)JV(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 JV(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 mA(e,t){return pA(e,t)}function gA(e,t){return pA(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 LS({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 IS(e){return{id:e.id,type:"remove"}}const eY=FC();function tY(e,t,n={}){return $G(e,t,{...n,onError:n.onError??eY})}const zS=e=>NG(e),nY=e=>zC(e);function yA(e){return j.forwardRef(e)}const iY=typeof window<"u"?j.useLayoutEffect:j.useEffect;function PS(e){const[t,n]=j.useState(BigInt(0)),[i]=j.useState(()=>rY(()=>n(a=>a+BigInt(1))));return iY(()=>{const a=i.get();a.length&&(e(a),i.reset())},[t]),i}function rY(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const bA=j.createContext(null);function aY({children:e}){const t=nn(),n=j.useCallback(d=>{const{nodes:f=[],setNodes:h,hasDefaultNodes:g,onNodesChange:m,nodeLookup:y,fitViewQueued:b,onNodesChangeMiddlewareMap:k}=t.getState();let v=f;for(const E of d)v=typeof E=="function"?E(v):E;let S=LS({items:v,lookup:y});for(const E of k.values())S=E(S);g&&h(v),S.length>0?m==null||m(S):b&&window.requestAnimationFrame(()=>{const{fitViewQueued:E,nodes:C,setNodes:N}=t.getState();E&&N(C)})},[]),i=PS(n),a=j.useCallback(d=>{const{edges:f=[],setEdges:h,hasDefaultEdges:g,onEdgesChange:m,edgeLookup:y}=t.getState();let b=f;for(const k of d)b=typeof k=="function"?k(b):k;g?h(b):m&&m(LS({items:b,lookup:y}))},[]),l=PS(a),o=j.useMemo(()=>({nodeQueue:i,edgeQueue:l}),[]);return c.jsx(bA.Provider,{value:o,children:e})}function sY(){const e=j.useContext(bA);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const lY=e=>!!e.panZoom;function xp(){const e=ZV(),t=nn(),n=sY(),i=Nt(lY),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=zS(m)?m:y.get(m.id),v=k.parentId?HC(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 Lu(S)},h=(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&&zS(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&&nY(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 TG({nodesToRemove:m,edgesToRemove:y,nodes:b,edges:k,onBeforeDelete:_}),R=M.length>0,O=T.length>0;if(R){const B=M.map(IS);S==null||S(M),C(B)}if(O){const B=T.map(IS);v==null||v(T),E(B)}return(O||R)&&(N==null||N({nodes:T,edges:M})),{deletedNodes:T,deletedEdges:M}},getIntersectingNodes:(m,y=!0,b)=>{const k=oS(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=Lu(S?E:C),_=Lh(N,v);return y&&_>0||_>=N.width*N.height||_>=v.width*v.height}):[]},isNodeIntersecting:(m,y,b=!0)=>{const v=oS(m)?m:f(m);if(!v)return!1;const S=Lh(v,y);return b&&S>0||S>=y.width*y.height||S>=v.width*v.height},updateNode:h,updateNodeData:(m,y,b={replace:!1})=>{h(m,k=>{const v=typeof y=="function"?y(k):y;return b.replace?{...k,data:v}:{...k,data:{...k.data,...v}}},b)},updateEdge:g,updateEdgeData:(m,y,b={replace:!1})=>{g(m,k=>{const v=typeof y=="function"?y(k):y;return b.replace?{...k,data:v}:{...k,data:{...k.data,...v}}},b)},getNodesBounds:m=>{const{nodeLookup:y,nodeOrigin:b}=t.getState();return _G(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??OG();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 BS=e=>e.selected,oY=typeof window<"u"?window:void 0;function cY({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=nn(),{deleteElements:i}=xp(),a=zu(e,{actInsideInputWithModifier:!1}),l=zu(t,{target:oY});j.useEffect(()=>{if(a){const{edges:o,nodes:d}=n.getState();i({nodes:d.filter(BS),edges:o.filter(BS)}),n.setState({nodesSelectionActive:!1})}},[a]),j.useEffect(()=>{n.setState({multiSelectionActive:l})},[l])}function uY(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=Wx(e.current);(i.height===0||i.width===0)&&((d=(o=t.getState()).onError)==null||d.call(o,"004",hr.error004())),t.setState({width:i.width||500,height:i.height||500})};if(e.current){n(),window.addEventListener("resize",n);const i=new ResizeObserver(()=>n());return i.observe(e.current),()=>{window.removeEventListener("resize",n),i&&e.current&&i.unobserve(e.current)}}},[])}const vp={position:"absolute",width:"100%",height:"100%",top:0,left:0},dY=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function fY({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=ul.Free,zoomOnDoubleClick:o=!0,panOnDrag:d=!0,defaultViewport:f,translateExtent:h,minZoom:g,maxZoom:m,zoomActivationKeyCode:y,preventScrolling:b=!0,children:k,noWheelClassName:v,noPanClassName:S,onViewportChange:E,isControlledViewport:C,paneClickDistance:N,selectionOnDrag:_}){const T=nn(),M=j.useRef(null),{userSelectionActive:R,lib:O,connectionInProgress:B}=Nt(dY,tn),U=zu(y),K=j.useRef();uY(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=gV({domNode:M.current,minZoom:g,maxZoom:m,translateExtent:h,viewport:f,onDraggingChange:I=>T.setState(H=>H.paneDragging===I?H:{paneDragging:I}),onPanZoomStart:(I,H)=>{const{onViewportChangeStart:Q,onMoveStart:G}=T.getState();G==null||G(I,H),Q==null||Q(H)},onPanZoom:(I,H)=>{const{onViewportChange:Q,onMove:G}=T.getState();G==null||G(I,H),Q==null||Q(H)},onPanZoomEnd:(I,H)=>{const{onViewportChangeEnd:Q,onMoveEnd:G}=T.getState();G==null||G(I,H),Q==null||Q(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:R,noWheelClassName:v,lib:O,onTransformChange:q,connectionInProgress:B,selectionOnDrag:_,paneClickDistance:N})},[e,t,n,i,a,l,o,d,U,b,S,R,v,O,q,B,_,N]),c.jsx("div",{className:"react-flow__renderer",ref:M,style:vp,children:k})}const hY=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function pY(){const{userSelectionActive:e,userSelectionRect:t}=Nt(hY,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 ky=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},mY=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function gY({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Ru.Full,panOnDrag:i,autoPanOnSelection:a,paneClickDistance:l,selectionOnDrag:o,onSelectionStart:d,onSelectionEnd:f,onPaneClick:h,onPaneContextMenu:g,onPaneScroll:m,onPaneMouseEnter:y,onPaneMouseMove:b,onPaneMouseLeave:k,children:v}){const S=j.useRef(0),E=nn(),{userSelectionActive:C,elementsSelectable:N,dragging:_,panBy:T,autoPanSpeed:M}=Nt(mY,tn),R=N&&(e||C),O=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=J=>{if(Y.current||q.current||E.getState().connection.inProgress){Y.current=!1,q.current=!1;return}h==null||h(J),E.getState().resetSelectedElements(),E.setState({nodesSelectionActive:!1})},H=J=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){J.preventDefault();return}g==null||g(J)},Q=m?J=>m(J):void 0,G=J=>{Y.current&&(J.stopPropagation(),Y.current=!1)},L=J=>{var Fe,ze;const{domNode:ue,transform:Te}=E.getState();if(B.current=ue==null?void 0:ue.getBoundingClientRect(),!B.current)return;const Re=J.target===O.current;if(!Re&&!!J.target.closest(".nokey")||!e||!(o&&Re||t)||J.button!==0||!J.isPrimary)return;(ze=(Fe=J.target)==null?void 0:Fe.setPointerCapture)==null||ze.call(Fe,J.pointerId),Y.current=!1;const{x:Ce,y:te}=ur(J.nativeEvent,B.current),pe=ld({x:Ce,y:te},Te);E.setState({userSelectionRect:{width:0,height:0,startX:pe.x,startY:pe.y,x:Ce,y:te}}),Re||(J.stopPropagation(),J.preventDefault())};function z(J,ue){const{userSelectionRect:Te}=E.getState();if(!Te)return;const{transform:Re,nodeLookup:Oe,edgeLookup:ce,connectionLookup:Ce,triggerNodeChanges:te,triggerEdgeChanges:pe,defaultEdgeOptions:Fe}=E.getState(),ze={x:Te.startX,y:Te.startY},{x:ae,y:be}=Go(ze,Re),ye={startX:ze.x,startY:ze.y,x:J<ae?J:ae,y:ue<be?ue:be,width:Math.abs(J-ae),height:Math.abs(ue-be)},he=U.current,Ee=K.current;U.current=new Set(Vx(Oe,ye,Re,n===Ru.Partial,!0).map(Ke=>Ke.id)),K.current=new Set;const Ne=(Fe==null?void 0:Fe.selectable)??!0;for(const Ke of U.current){const ne=Ce.get(Ke);if(ne)for(const{edgeId:de}of ne.values()){const Le=ce.get(de);Le&&(Le.selectable??Ne)&&K.current.add(de)}}if(!cS(he,U.current)){const Ke=wo(Oe,U.current,!0);te(Ke)}if(!cS(Ee,K.current)){const Ke=wo(ce,K.current);pe(Ke)}E.setState({userSelectionRect:ye,userSelectionActive:!0,nodesSelectionActive:!1})}function V(){if(!a||!B.current)return;const[J,ue]=Yx(D.current,B.current,M);T({x:J,y:ue}).then(Te=>{if(!Y.current||!Te){S.current=requestAnimationFrame(V);return}const{x:Re,y:Oe}=D.current;z(Re,Oe),S.current=requestAnimationFrame(V)})}const P=()=>{cancelAnimationFrame(S.current),S.current=0,F.current=!1};j.useEffect(()=>()=>P(),[]);const le=J=>{const{userSelectionRect:ue,transform:Te,resetSelectedElements:Re}=E.getState();if(!B.current||!ue)return;const{x:Oe,y:ce}=ur(J.nativeEvent,B.current);D.current={x:Oe,y:ce};const Ce=Go({x:ue.startX,y:ue.startY},Te);if(!Y.current){const te=t?0:l;if(Math.hypot(Oe-Ce.x,ce-Ce.y)<=te)return;Re(),d==null||d(J)}Y.current=!0,F.current||(V(),F.current=!0),z(Oe,ce)},ve=J=>{var ue,Te;if(!R){J.target===O.current&&E.getState().connection.inProgress&&(q.current=!0);return}J.button===0&&((Te=(ue=J.target)==null?void 0:ue.releasePointerCapture)==null||Te.call(ue,J.pointerId),!C&&J.target===O.current&&E.getState().userSelectionRect&&(I==null||I(J)),E.setState({userSelectionActive:!1,userSelectionRect:null}),Y.current&&(f==null||f(J),E.setState({nodesSelectionActive:U.current.size>0})),P())},ke=J=>{var ue,Te;(Te=(ue=J.target)==null?void 0:ue.releasePointerCapture)==null||Te.call(ue,J.pointerId),P()},Se=i===!0||Array.isArray(i)&&i.includes(0);return c.jsxs("div",{className:Nn(["react-flow__pane",{draggable:Se,dragging:_,selection:e}]),onClick:R?void 0:ky(I,O),onContextMenu:ky(H,O),onWheel:ky(Q,O),onPointerEnter:R?void 0:y,onPointerMove:R?le:b,onPointerUp:ve,onPointerCancel:R?ke:void 0,onPointerDownCapture:R?L:void 0,onClickCapture:R?G:void 0,onPointerLeave:k,ref:O,style:vp,children:[v,c.jsx(pY,{})]})}function Eb({id:e,store:t,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:a,unselectNodesAndEdges:l,multiSelectionActive:o,nodeLookup:d,onError:f}=t.getState(),h=d.get(e);if(!h){f==null||f("012",hr.error012(e));return}t.setState({nodesSelectionActive:!1}),h.selected?(n||h.selected&&o)&&(l({nodes:[h],edges:[]}),requestAnimationFrame(()=>{var g;return(g=i==null?void 0:i.current)==null?void 0:g.blur()})):a([e])}function xA({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:a,isSelectable:l,nodeClickDistance:o}){const d=nn(),[f,h]=j.useState(!1),g=j.useRef();return j.useEffect(()=>{g.current=nV({getStoreItems:()=>d.getState(),onNodeMouseDown:m=>{Eb({id:m,store:d,nodeRef:e})},onDragStart:()=>{h(!0)},onDragStop:()=>{h(!1)}})},[]),j.useEffect(()=>{if(!(t||!e.current||!g.current))return g.current.update({noDragClassName:n,handleSelector:i,domNode:e.current,isSelectable:l,nodeId:a,nodeClickDistance:o}),()=>{var m;(m=g.current)==null||m.destroy()}},[n,i,t,l,e,a,o]),f}const yY=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function vA(){const e=nn();return j.useCallback(n=>{const{nodeExtent:i,snapToGrid:a,snapGrid:l,nodesDraggable:o,onError:d,updateNodePositions:f,nodeLookup:h,nodeOrigin:g}=e.getState(),m=new Map,y=yY(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 h){if(!y(E))continue;let C={x:E.internals.positionAbsolute.x+v,y:E.internals.positionAbsolute.y+S};a&&(C=sd(C,l));const{position:N,positionAbsolute:_}=PC({nodeId:E.id,nextPosition:C,nodeLookup:h,nodeExtent:i,nodeOrigin:g,onError:d});E.position=N,E.internals.positionAbsolute=_,m.set(E.id,E)}f(m)},[])}const nv=j.createContext(null),bY=nv.Provider;nv.Consumer;const wA=()=>j.useContext(nv),xY=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),kA=j.createContext(null);function vY({children:e}){const t=Nt(xY,tn);return c.jsx(kA.Provider,{value:t,children:e})}function wY(){const e=j.useContext(kA);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const kY={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},EY=(e,t,n)=>i=>{const{connectionClickStartHandle:a,connectionMode:l,connection:o}=i,{fromHandle:d,toHandle:f,isValid:h}=o;if(!d&&!a)return kY;const g=(f==null?void 0:f.nodeId)===e&&(f==null?void 0:f.id)===t&&(f==null?void 0:f.type)===n;return{connectingFrom:(d==null?void 0:d.nodeId)===e&&(d==null?void 0:d.id)===t&&(d==null?void 0:d.type)===n,connectingTo:g,clickConnecting:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n,isPossibleEndHandle:l===Ho.Strict?(d==null?void 0:d.type)!==n:e!==(d==null?void 0:d.nodeId)||t!==(d==null?void 0:d.id),connectionInProcess:!!d,clickConnectionInProcess:!!a,valid:g&&h}};function SY({type:e="source",position:t=Ge.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:a=!0,isConnectableEnd:l=!0,id:o,onConnect:d,children:f,className:h,onMouseDown:g,onTouchStart:m,...y},b){var F,I;const k=o||null,v=e==="target",S=nn(),E=wA(),{connectOnClick:C,noPanClassName:N,rfId:_}=wY(),{connectingFrom:T,connectingTo:M,clickConnecting:R,isPossibleEndHandle:O,connectionInProcess:B,clickConnectionInProcess:U,valid:K}=Nt(EY(E,k,e),tn);E||(I=(F=S.getState()).onError)==null||I.call(F,"010",hr.error010());const q=H=>{const{defaultEdgeOptions:Q,onConnect:G,hasDefaultEdges:L}=S.getState(),z={...Q,...H};if(L){const{edges:V,setEdges:P,onError:le}=S.getState();P(tY(z,V,{onError:le}))}G==null||G(z),d==null||d(z)},Y=H=>{if(!E)return;const Q=VC(H.nativeEvent);if(a&&(Q&&H.button===0||!Q)){const G=S.getState();kb.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})}Q?g==null||g(H):m==null||m(H)},D=H=>{const{onClickConnectStart:Q,onClickConnectEnd:G,connectionClickStartHandle:L,connectionMode:z,isValidConnection:V,lib:P,rfId:le,nodeLookup:ve,connection:ke}=S.getState();if(!E||!L&&!a)return;if(!L){Q==null||Q(H.nativeEvent,{nodeId:E,handleId:k,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:E,type:e,id:k}});return}const Se=KC(H.target),J=n||V,{connection:ue,isValid:Te}=kb.isValid(H.nativeEvent,{handle:{nodeId:E,id:k,type:e},connectionMode:z,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:J,flowId:le,doc:Se,lib:P,nodeLookup:ve});Te&&ue&&q(ue);const Re=structuredClone(ke);delete Re.inProgress,Re.toPosition=Re.toHandle?Re.toHandle.position:null,G==null||G(H,Re),S.setState({connectionClickStartHandle:null})};return c.jsx("div",{"data-handleid":k,"data-nodeid":E,"data-handlepos":t,"data-id":`${_}-${E}-${k}-${e}`,className:Nn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",N,h,{source:!v,target:v,connectable:i,connectablestart:a,connectableend:l,clickconnecting:R,connectingfrom:T,connectingto:M,valid:K,connectionindicator:i&&(!B||O)&&(B||U?l:a)}]),onMouseDown:Y,onTouchStart:Y,onClick:C?D:void 0,ref:b,...y,children:f})}const Dr=j.memo(yA(SY));function NY({data:e,isConnectable:t,sourcePosition:n=Ge.Bottom}){return c.jsxs(c.Fragment,{children:[e==null?void 0:e.label,c.jsx(Dr,{type:"source",position:n,isConnectable:t})]})}function _Y({data:e,isConnectable:t,targetPosition:n=Ge.Top,sourcePosition:i=Ge.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 jY(){return null}function CY({data:e,isConnectable:t,targetPosition:n=Ge.Top}){return c.jsxs(c.Fragment,{children:[c.jsx(Dr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Ih={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},$S={input:NY,default:_Y,output:CY,group:jY};function AY(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 TY=e=>{const{width:t,height:n,x:i,y:a}=ad(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 MY({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=nn(),{width:a,height:l,transformString:o,userSelectionActive:d}=Nt(TY,tn),f=vA(),h=j.useRef(null);j.useEffect(()=>{var b;n||(b=h.current)==null||b.focus({preventScroll:!0})},[n]);const g=!d&&a!==null&&l!==null;if(xA({nodeRef:h,disabled:!g}),!g)return null;const m=e?b=>{const k=i.getState().nodes.filter(v=>v.selected);e(b,k)}:void 0,y=b=>{Object.prototype.hasOwnProperty.call(Ih,b.key)&&(b.preventDefault(),f({direction:Ih[b.key],factor:b.shiftKey?4:1}))};return c.jsx("div",{className:Nn(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:c.jsx("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:m,tabIndex:n?void 0:-1,onKeyDown:n?void 0:y,style:{width:a,height:l}})})}const US=typeof window<"u"?window:void 0,DY=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function EA({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:a,onPaneContextMenu:l,onPaneScroll:o,paneClickDistance:d,deleteKeyCode:f,selectionKeyCode:h,selectionOnDrag:g,selectionMode:m,onSelectionStart:y,onSelectionEnd:b,multiSelectionKeyCode:k,panActivationKeyCode:v,zoomActivationKeyCode:S,elementsSelectable:E,zoomOnScroll:C,zoomOnPinch:N,panOnScroll:_,panOnScrollSpeed:T,panOnScrollMode:M,zoomOnDoubleClick:R,panOnDrag:O,autoPanOnSelection:B,defaultViewport:U,translateExtent:K,minZoom:q,maxZoom:Y,preventScrolling:D,onSelectionContextMenu:F,noWheelClassName:I,noPanClassName:H,disableKeyboardA11y:Q,onViewportChange:G,isControlledViewport:L}){const{nodesSelectionActive:z,userSelectionActive:V}=Nt(DY,tn),P=zu(h,{target:US}),le=zu(v,{target:US}),ve=le||O,ke=le||_,Se=g&&ve!==!0,J=P||V||Se;return cY({deleteKeyCode:f,multiSelectionKeyCode:k}),c.jsx(fY,{onPaneContextMenu:l,elementsSelectable:E,zoomOnScroll:C,zoomOnPinch:N,panOnScroll:ke,panOnScrollSpeed:T,panOnScrollMode:M,zoomOnDoubleClick:R,panOnDrag:!P&&ve,defaultViewport:U,translateExtent:K,minZoom:q,maxZoom:Y,zoomActivationKeyCode:S,preventScrolling:D,noWheelClassName:I,noPanClassName:H,onViewportChange:G,isControlledViewport:L,paneClickDistance:d,selectionOnDrag:Se,children:c.jsxs(gY,{onSelectionStart:y,onSelectionEnd:b,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:a,onPaneContextMenu:l,onPaneScroll:o,panOnDrag:ve,autoPanOnSelection:B,isSelecting:!!J,selectionMode:m,selectionKeyPressed:P,paneClickDistance:d,selectionOnDrag:Se,children:[e,z&&c.jsx(MY,{onSelectionContextMenu:F,noPanClassName:H,disableKeyboardA11y:Q})]})})}EA.displayName="FlowRenderer";const OY=j.memo(EA),RY=e=>t=>e?Vx(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 LY(e){return Nt(j.useCallback(RY(e),[e]),tn)}const IY=e=>e.updateNodeInternals;function zY(){const e=Nt(IY),[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 PY({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const a=nn(),l=j.useRef(null),o=j.useRef(null),d=j.useRef(e.sourcePosition),f=j.useRef(e.targetPosition),h=j.useRef(t),g=n&&!!e.internals.handleBounds;return j.useEffect(()=>{l.current&&!e.hidden&&(!g||o.current!==l.current)&&(o.current&&(i==null||i.unobserve(o.current)),i==null||i.observe(l.current),o.current=l.current)},[g,e.hidden]),j.useEffect(()=>()=>{o.current&&(i==null||i.unobserve(o.current),o.current=null)},[]),j.useEffect(()=>{if(l.current){const m=h.current!==t,y=d.current!==e.sourcePosition,b=f.current!==e.targetPosition;(m||y||b)&&(h.current=t,d.current=e.sourcePosition,f.current=e.targetPosition,a.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:l.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),l}function BY({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:a,onContextMenu:l,onDoubleClick:o,nodesDraggable:d,elementsSelectable:f,nodesConnectable:h,nodesFocusable:g,resizeObserver:m,noDragClassName:y,noPanClassName:b,disableKeyboardA11y:k,rfId:v,nodeTypes:S,nodeClickDistance:E,onError:C}){const{node:N,internals:_,isParent:T}=Nt(J=>{const ue=J.nodeLookup.get(e),Te=J.parentLookup.has(e);return{node:ue,internals:ue.internals,isParent:Te}},tn);let M=N.type||"default",R=(S==null?void 0:S[M])||$S[M];R===void 0&&(C==null||C("003",hr.error003(M)),M="default",R=(S==null?void 0:S.default)||$S.default);const O=!!(N.draggable||d&&typeof N.draggable>"u"),B=!!(N.selectable||f&&typeof N.selectable>"u"),U=!!(N.connectable||h&&typeof N.connectable>"u"),K=!!(N.focusable||g&&typeof N.focusable>"u"),q=nn(),Y=qC(N),D=PY({node:N,nodeType:M,hasDimensions:Y,resizeObserver:m}),F=xA({nodeRef:D,disabled:N.hidden||!O,noDragClassName:y,handleSelector:N.dragHandle,nodeId:e,isSelectable:B,nodeClickDistance:E}),I=vA();if(N.hidden)return null;const H=va(N),Q=AY(N),G=B||O||t||n||i||a,L=n?J=>n(J,{..._.userNode}):void 0,z=i?J=>i(J,{..._.userNode}):void 0,V=a?J=>a(J,{..._.userNode}):void 0,P=l?J=>l(J,{..._.userNode}):void 0,le=o?J=>o(J,{..._.userNode}):void 0,ve=J=>{const{selectNodesOnDrag:ue,nodeDragThreshold:Te}=q.getState();B&&(!ue||!O||Te>0)&&Eb({id:e,store:q,nodeRef:D}),t&&t(J,{..._.userNode})},ke=J=>{if(!(GC(J.nativeEvent)||k)){if(OC.includes(J.key)&&B){const ue=J.key==="Escape";Eb({id:e,store:q,unselect:ue,nodeRef:D})}else if(O&&N.selected&&Object.prototype.hasOwnProperty.call(Ih,J.key)){J.preventDefault();const{ariaLabelConfig:ue}=q.getState();q.setState({ariaLiveMessage:ue["node.a11yDescription.ariaLiveMessage"]({direction:J.key.replace("Arrow","").toLowerCase(),x:~~_.positionAbsolute.x,y:~~_.positionAbsolute.y})}),I({direction:Ih[J.key],factor:J.shiftKey?4:1})}}},Se=()=>{var Ce;if(k||!((Ce=D.current)!=null&&Ce.matches(":focus-visible")))return;const{transform:J,width:ue,height:Te,autoPanOnNodeFocus:Re,setCenter:Oe}=q.getState();if(!Re)return;Vx(new Map([[e,N]]),{x:0,y:0,width:ue,height:Te},J,!0).length>0||Oe(N.position.x+H.width/2,N.position.y+H.height/2,{zoom:J[2]})};return c.jsx("div",{className:Nn(["react-flow__node",`react-flow__node-${M}`,{[b]:O},N.className,{selected:N.selected,selectable:B,parent:T,draggable:O,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,...Q},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:z,onMouseLeave:V,onContextMenu:P,onClick:ve,onDoubleClick:le,onKeyDown:K?ke:void 0,tabIndex:K?0:void 0,onFocus:K?Se:void 0,role:N.ariaRole??(K?"group":void 0),"aria-roledescription":"node","aria-describedby":k?void 0:`${dA}-${v}`,"aria-label":N.ariaLabel,...N.domAttributes,children:c.jsx(bY,{value:e,children:c.jsx(R,{id:e,data:N.data,type:M,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:N.selected??!1,selectable:B,draggable:O,deletable:N.deletable??!0,isConnectable:U,sourcePosition:N.sourcePosition,targetPosition:N.targetPosition,dragging:F,dragHandle:N.dragHandle,zIndex:_.z,parentId:N.parentId,...H})})})}var $Y=j.memo(BY);const UY=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function SA(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:a,onError:l}=Nt(UY,tn),o=LY(e.onlyRenderVisibleElements),d=zY();return c.jsx("div",{className:"react-flow__nodes",style:vp,children:o.map(f=>c.jsx($Y,{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))})}SA.displayName="NodeRenderer";const FY=j.memo(SA);function qY(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 HY=({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"})},KY=({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"})},FS={[Oh.Arrow]:HY,[Oh.ArrowClosed]:KY};function GY(e){const t=nn();return j.useMemo(()=>{var a,l;return Object.prototype.hasOwnProperty.call(FS,e)?FS[e]:((l=(a=t.getState()).onError)==null||l.call(a,"009",hr.error009(e)),null)},[e])}const VY=({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=GY(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},NA=({defaultColor:e,rfId:t})=>{const n=Nt(l=>l.edges),i=Nt(l=>l.defaultEdgeOptions),a=j.useMemo(()=>KG(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(VY,{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};NA.displayName="MarkerDefinitions";var YY=j.memo(NA);function _A({x:e,y:t,label:n,labelStyle:i,labelShowBg:a=!0,labelBgStyle:l,labelBgPadding:o=[2,4],labelBgBorderRadius:d=2,children:f,className:h,...g}){const[m,y]=j.useState({x:1,y:0,width:0,height:0}),b=Nn(["react-flow__edge-textwrapper",h]),k=j.useRef(null);return j.useEffect(()=>{if(k.current){const v=k.current.getBBox();y({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),n?c.jsxs("g",{transform:`translate(${e-m.width/2} ${t-m.height/2})`,className:b,visibility:m.width?"visible":"hidden",...g,children:[a&&c.jsx("rect",{width:m.width+2*o[0],x:-o[0],y:-o[1],height:m.height+2*o[1],className:"react-flow__edge-textbg",style:l,rx:d,ry:d}),c.jsx("text",{className:"react-flow__edge-text",y:m.height/2,dy:"0.3em",ref:k,style:i,children:n}),f]}):null}_A.displayName="EdgeText";const QY=j.memo(_A);function wp({path:e,labelX:t,labelY:n,label:i,labelStyle:a,labelShowBg:l,labelBgStyle:o,labelBgPadding:d,labelBgBorderRadius:f,interactionWidth:h=20,...g}){return c.jsxs(c.Fragment,{children:[c.jsx("path",{...g,d:e,fill:"none",className:Nn(["react-flow__edge-path",g.className])}),h?c.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}):null,i&&cr(t)&&cr(n)?c.jsx(QY,{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===Ge.Left||e===Ge.Right?[.5*(t+i),n]:[t,.5*(n+a)]}function jA({sourceX:e,sourceY:t,sourcePosition:n=Ge.Bottom,targetX:i,targetY:a,targetPosition:l=Ge.Top}){const[o,d]=qS({pos:n,x1:e,y1:t,x2:i,y2:a}),[f,h]=qS({pos:l,x1:i,y1:a,x2:e,y2:t}),[g,m,y,b]=YC({sourceX:e,sourceY:t,targetX:i,targetY:a,sourceControlX:o,sourceControlY:d,targetControlX:f,targetControlY:h});return[`M${e},${t} C${o},${d} ${f},${h} ${i},${a}`,g,m,y,b]}function CA(e){return j.memo(({id:t,sourceX:n,sourceY:i,targetX:a,targetY:l,sourcePosition:o,targetPosition:d,label:f,labelStyle:h,labelShowBg:g,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:b,style:k,markerEnd:v,markerStart:S,interactionWidth:E})=>{const[C,N,_]=jA({sourceX:n,sourceY:i,sourcePosition:o,targetX:a,targetY:l,targetPosition:d}),T=e.isInternal?void 0:t;return c.jsx(wp,{id:T,path:C,labelX:N,labelY:_,label:f,labelStyle:h,labelShowBg:g,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:b,style:k,markerEnd:v,markerStart:S,interactionWidth:E})})}const WY=CA({isInternal:!1}),AA=CA({isInternal:!0});WY.displayName="SimpleBezierEdge";AA.displayName="SimpleBezierEdgeInternal";function TA(e){return j.memo(({id:t,sourceX:n,sourceY:i,targetX:a,targetY:l,label:o,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:m,style:y,sourcePosition:b=Ge.Bottom,targetPosition:k=Ge.Top,markerEnd:v,markerStart:S,pathOptions:E,interactionWidth:C})=>{const[N,_,T]=xb({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(wp,{id:M,path:N,labelX:_,labelY:T,label:o,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:m,style:y,markerEnd:v,markerStart:S,interactionWidth:C})})}const MA=TA({isInternal:!1}),DA=TA({isInternal:!0});MA.displayName="SmoothStepEdge";DA.displayName="SmoothStepEdgeInternal";function OA(e){return j.memo(({id:t,...n})=>{var a;const i=e.isInternal?void 0:t;return c.jsx(MA,{...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 XY=OA({isInternal:!1}),RA=OA({isInternal:!0});XY.displayName="StepEdge";RA.displayName="StepEdgeInternal";function LA(e){return j.memo(({id:t,sourceX:n,sourceY:i,targetX:a,targetY:l,label:o,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:m,style:y,markerEnd:b,markerStart:k,interactionWidth:v})=>{const[S,E,C]=XC({sourceX:n,sourceY:i,targetX:a,targetY:l}),N=e.isInternal?void 0:t;return c.jsx(wp,{id:N,path:S,labelX:E,labelY:C,label:o,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:m,style:y,markerEnd:b,markerStart:k,interactionWidth:v})})}const ZY=LA({isInternal:!1}),IA=LA({isInternal:!0});ZY.displayName="StraightEdge";IA.displayName="StraightEdgeInternal";function zA(e){return j.memo(({id:t,sourceX:n,sourceY:i,targetX:a,targetY:l,sourcePosition:o=Ge.Bottom,targetPosition:d=Ge.Top,label:f,labelStyle:h,labelShowBg:g,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:b,style:k,markerEnd:v,markerStart:S,pathOptions:E,interactionWidth:C})=>{const[N,_,T]=QC({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(wp,{id:M,path:N,labelX:_,labelY:T,label:f,labelStyle:h,labelShowBg:g,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:b,style:k,markerEnd:v,markerStart:S,interactionWidth:C})})}const JY=zA({isInternal:!1}),PA=zA({isInternal:!0});JY.displayName="BezierEdge";PA.displayName="BezierEdgeInternal";const HS={default:PA,straight:IA,step:RA,smoothstep:DA,simplebezier:AA},KS={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},eQ=(e,t,n)=>n===Ge.Left?e-t:n===Ge.Right?e+t:e,tQ=(e,t,n)=>n===Ge.Top?e-t:n===Ge.Bottom?e+t:e,GS="react-flow__edgeupdater";function VS({position:e,centerX:t,centerY:n,radius:i=10,onMouseDown:a,onMouseEnter:l,onMouseOut:o,type:d}){return c.jsx("circle",{onMouseDown:a,onMouseEnter:l,onMouseOut:o,className:Nn([GS,`${GS}-${d}`]),cx:eQ(t,i,e),cy:tQ(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function nQ({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:i,sourceY:a,targetX:l,targetY:o,sourcePosition:d,targetPosition:f,onReconnect:h,onReconnectStart:g,onReconnectEnd:m,setReconnecting:y,setUpdateHover:b}){const k=nn(),v=(_,T)=>{if(_.button!==0)return;const{autoPanOnConnect:M,domNode:R,connectionMode:O,connectionRadius:B,lib:U,onConnectStart:K,cancelConnection:q,nodeLookup:Y,rfId:D,panBy:F,updateConnection:I}=k.getState(),H=T.type==="target",Q=(z,V)=>{y(!1),m==null||m(z,n,T.type,V)},G=z=>h==null?void 0:h(n,z),L=(z,V)=>{y(!0),g==null||g(_,n,T.type),K==null||K(z,V)};kb.onPointerDown(_.nativeEvent,{autoPanOnConnect:M,connectionMode:O,connectionRadius:B,domNode:R,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:Q,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(VS,{position:d,centerX:i,centerY:a,radius:t,onMouseDown:S,onMouseEnter:C,onMouseOut:N,type:"source"}),(e===!0||e==="target")&&c.jsx(VS,{position:f,centerX:l,centerY:o,radius:t,onMouseDown:E,onMouseEnter:C,onMouseOut:N,type:"target"})]})}function iQ({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:a,onDoubleClick:l,onContextMenu:o,onMouseEnter:d,onMouseMove:f,onMouseLeave:h,reconnectRadius:g,onReconnect:m,onReconnectStart:y,onReconnectEnd:b,rfId:k,edgeTypes:v,noPanClassName:S,onError:E,disableKeyboardA11y:C}){let N=Nt(Oe=>Oe.edgeLookup.get(e));const _=Nt(Oe=>Oe.defaultEdgeOptions);N=_?{..._,...N}:N;let T=N.type||"default",M=(v==null?void 0:v[T])||HS[T];M===void 0&&(E==null||E("011",hr.error011(T)),T="default",M=(v==null?void 0:v.default)||HS.default);const R=!!(N.focusable||t&&typeof N.focusable>"u"),O=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:Q,targetX:G,targetY:L,sourcePosition:z,targetPosition:V}=Nt(j.useCallback(Oe=>{const ce=Oe.nodeLookup.get(N.source),Ce=Oe.nodeLookup.get(N.target);if(!ce||!Ce)return KS;const te=HG({id:e,sourceNode:ce,targetNode:Ce,sourceHandle:N.sourceHandle||null,targetHandle:N.targetHandle||null,connectionMode:Oe.connectionMode,onError:E}),pe=IG({selected:N.selected,zIndex:N.zIndex,sourceNode:ce,targetNode:Ce,elevateOnSelect:Oe.elevateEdgesOnSelect,zIndexMode:Oe.zIndexMode});return{...te||KS,zIndex:pe}},[N.source,N.target,N.sourceHandle,N.targetHandle,N.selected,N.zIndex]),tn),P=j.useMemo(()=>N.markerStart?`url('#${vb(N.markerStart,k)}')`:void 0,[N.markerStart,k]),le=j.useMemo(()=>N.markerEnd?`url('#${vb(N.markerEnd,k)}')`:void 0,[N.markerEnd,k]);if(N.hidden||H===null||Q===null||G===null||L===null)return null;const ve=Oe=>{var pe;const{addSelectedEdges:ce,unselectNodesAndEdges:Ce,multiSelectionActive:te}=F.getState();B&&(F.setState({nodesSelectionActive:!1}),N.selected&&te?(Ce({nodes:[],edges:[N]}),(pe=U.current)==null||pe.blur()):ce([e])),a&&a(Oe,N)},ke=l?Oe=>{l(Oe,{...N})}:void 0,Se=o?Oe=>{o(Oe,{...N})}:void 0,J=d?Oe=>{d(Oe,{...N})}:void 0,ue=f?Oe=>{f(Oe,{...N})}:void 0,Te=h?Oe=>{h(Oe,{...N})}:void 0,Re=Oe=>{var ce;if(!C&&OC.includes(Oe.key)&&B){const{unselectNodesAndEdges:Ce,addSelectedEdges:te}=F.getState();Oe.key==="Escape"?((ce=U.current)==null||ce.blur(),Ce({edges:[N]})):te([e])}};return c.jsx("svg",{style:{zIndex:I},children:c.jsxs("g",{className:Nn(["react-flow__edge",`react-flow__edge-${T}`,N.className,S,{selected:N.selected,animated:N.animated,inactive:!B&&!a,updating:K,selectable:B}]),onClick:ve,onDoubleClick:ke,onContextMenu:Se,onMouseEnter:J,onMouseMove:ue,onMouseLeave:Te,onKeyDown:R?Re:void 0,tabIndex:R?0:void 0,role:N.ariaRole??(R?"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":R?`${fA}-${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:Q,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}),O&&c.jsx(nQ,{edge:N,isReconnectable:O,reconnectRadius:g,onReconnect:m,onReconnectStart:y,onReconnectEnd:b,sourceX:H,sourceY:Q,targetX:G,targetY:L,sourcePosition:z,targetPosition:V,setUpdateHover:q,setReconnecting:D})]})})}var rQ=j.memo(iQ);const aQ=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function BA({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:a,onReconnect:l,onEdgeContextMenu:o,onEdgeMouseEnter:d,onEdgeMouseMove:f,onEdgeMouseLeave:h,onEdgeClick:g,reconnectRadius:m,onEdgeDoubleClick:y,onReconnectStart:b,onReconnectEnd:k,disableKeyboardA11y:v}){const{edgesFocusable:S,edgesReconnectable:E,elementsSelectable:C,onError:N}=Nt(aQ,tn),_=qY(t);return c.jsxs("div",{className:"react-flow__edges",children:[c.jsx(YY,{defaultColor:e,rfId:n}),_.map(T=>c.jsx(rQ,{id:T,edgesFocusable:S,edgesReconnectable:E,elementsSelectable:C,noPanClassName:a,onReconnect:l,onContextMenu:o,onMouseEnter:d,onMouseMove:f,onMouseLeave:h,onClick:g,reconnectRadius:m,onDoubleClick:y,onReconnectStart:b,onReconnectEnd:k,rfId:n,onError:N,edgeTypes:i,disableKeyboardA11y:v},T))]})}BA.displayName="EdgeRenderer";const sQ=j.memo(BA),lQ=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function oQ({children:e}){const t=Nt(lQ);return c.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function cQ(e){const t=xp(),n=j.useRef(!1);j.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const uQ=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function dQ(e){const t=Nt(uQ),n=nn();return j.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function fQ(e){return e.connection.inProgress?{...e.connection,to:ld(e.connection.to,e.transform)}:{...e.connection}}function hQ(e){return fQ}function pQ(e){const t=hQ();return Nt(t,tn)}const mQ=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function gQ({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:a,width:l,height:o,isValid:d,inProgress:f}=Nt(mQ,tn);return!(l&&a&&f)?null:c.jsx("svg",{style:e,width:l,height:o,className:"react-flow__connectionline react-flow__container",children:c.jsx("g",{className:Nn(["react-flow__connection",IC(d)]),children:c.jsx($A,{style:t,type:n,CustomComponent:i,isValid:d})})})}const $A=({style:e,type:t=os.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:a,from:l,fromNode:o,fromHandle:d,fromPosition:f,to:h,toNode:g,toHandle:m,toPosition:y,pointer:b}=pQ();if(!a)return;if(n)return c.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:d,fromX:l.x,fromY:l.y,toX:h.x,toY:h.y,fromPosition:f,toPosition:y,connectionStatus:IC(i),toNode:g,toHandle:m,pointer:b});let k="";const v={sourceX:l.x,sourceY:l.y,sourcePosition:f,targetX:h.x,targetY:h.y,targetPosition:y};switch(t){case os.Bezier:[k]=QC(v);break;case os.SimpleBezier:[k]=jA(v);break;case os.Step:[k]=xb({...v,borderRadius:0});break;case os.SmoothStep:[k]=xb(v);break;default:[k]=XC(v)}return c.jsx("path",{d:k,fill:"none",className:"react-flow__connection-path",style:e})};$A.displayName="ConnectionLine";const yQ={};function YS(e=yQ){j.useRef(e),nn(),j.useEffect(()=>{},[e])}function bQ(){nn(),j.useRef(!1),j.useEffect(()=>{},[])}function UA({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:o,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:h,onNodeContextMenu:g,onSelectionContextMenu:m,onSelectionStart:y,onSelectionEnd:b,connectionLineType:k,connectionLineStyle:v,connectionLineComponent:S,connectionLineContainerStyle:E,selectionKeyCode:C,selectionOnDrag:N,selectionMode:_,multiSelectionKeyCode:T,panActivationKeyCode:M,zoomActivationKeyCode:R,deleteKeyCode:O,onlyRenderVisibleElements:B,elementsSelectable:U,defaultViewport:K,translateExtent:q,minZoom:Y,maxZoom:D,preventScrolling:F,defaultMarkerColor:I,zoomOnScroll:H,zoomOnPinch:Q,panOnScroll:G,panOnScrollSpeed:L,panOnScrollMode:z,zoomOnDoubleClick:V,panOnDrag:P,autoPanOnSelection:le,onPaneClick:ve,onPaneMouseEnter:ke,onPaneMouseMove:Se,onPaneMouseLeave:J,onPaneScroll:ue,onPaneContextMenu:Te,paneClickDistance:Re,nodeClickDistance:Oe,onEdgeContextMenu:ce,onEdgeMouseEnter:Ce,onEdgeMouseMove:te,onEdgeMouseLeave:pe,reconnectRadius:Fe,onReconnect:ze,onReconnectStart:ae,onReconnectEnd:be,noDragClassName:ye,noWheelClassName:he,noPanClassName:Ee,disableKeyboardA11y:Ne,nodeExtent:Ke,rfId:ne,viewport:de,onViewportChange:Le}){return YS(e),YS(t),bQ(),cQ(n),dQ(de),c.jsx(OY,{onPaneClick:ve,onPaneMouseEnter:ke,onPaneMouseMove:Se,onPaneMouseLeave:J,onPaneContextMenu:Te,onPaneScroll:ue,paneClickDistance:Re,deleteKeyCode:O,selectionKeyCode:C,selectionOnDrag:N,selectionMode:_,onSelectionStart:y,onSelectionEnd:b,multiSelectionKeyCode:T,panActivationKeyCode:M,zoomActivationKeyCode:R,elementsSelectable:U,zoomOnScroll:H,zoomOnPinch:Q,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:ye,noWheelClassName:he,noPanClassName:Ee,disableKeyboardA11y:Ne,onViewportChange:Le,isControlledViewport:!!de,children:c.jsxs(oQ,{children:[c.jsx(sQ,{edgeTypes:t,onEdgeClick:a,onEdgeDoubleClick:o,onReconnect:ze,onReconnectStart:ae,onReconnectEnd:be,onlyRenderVisibleElements:B,onEdgeContextMenu:ce,onEdgeMouseEnter:Ce,onEdgeMouseMove:te,onEdgeMouseLeave:pe,reconnectRadius:Fe,defaultMarkerColor:I,noPanClassName:Ee,disableKeyboardA11y:Ne,rfId:ne}),c.jsx(gQ,{style:v,type:k,component:S,containerStyle:E}),c.jsx("div",{className:"react-flow__edgelabel-renderer"}),c.jsx(FY,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:l,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:h,onNodeContextMenu:g,nodeClickDistance:Oe,onlyRenderVisibleElements:B,noPanClassName:Ee,noDragClassName:ye,disableKeyboardA11y:Ne,nodeExtent:Ke,rfId:ne}),c.jsx("div",{className:"react-flow__viewport-portal"})]})})}UA.displayName="GraphView";const xQ=j.memo(UA),vQ=FC(),QS=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:a,height:l,fitView:o,fitViewOptions:d,minZoom:f=.5,maxZoom:h=2,nodeOrigin:g,nodeExtent:m,zIndexMode:y="basic"}={})=>{const b=new Map,k=new Map,v=new Map,S=new Map,E=i??t??[],C=n??e??[],N=g??[0,0],_=m??Ou;eA(v,S,E);const{nodesInitialized:T}=wb(C,b,k,{nodeOrigin:N,nodeExtent:_,zIndexMode:y});let M=[0,0,1];if(o&&a&&l){const R=ad(b,{filter:K=>!!((K.width||K.initialWidth)&&(K.height||K.initialHeight))}),{x:O,y:B,zoom:U}=Qx(R,a,l,f,h,(d==null?void 0:d.padding)??.1);M=[O,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:h,translateExtent:Ou,nodeExtent:_,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ho.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:{...LC},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:vQ,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:RC,zIndexMode:y,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},wQ=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:a,height:l,fitView:o,fitViewOptions:d,minZoom:f,maxZoom:h,nodeOrigin:g,nodeExtent:m,zIndexMode:y})=>OV((b,k)=>{async function v(){const{nodeLookup:S,panZoom:E,fitViewOptions:C,fitViewResolver:N,width:_,height:T,minZoom:M,maxZoom:R}=k();E&&(await AG({nodes:S,width:_,height:T,panZoom:E,minZoom:M,maxZoom:R},C),N==null||N.resolve(!0),b({fitViewResolver:null}))}return{...QS({nodes:e,edges:t,width:a,height:l,fitView:o,fitViewOptions:d,minZoom:f,maxZoom:h,nodeOrigin:g,nodeExtent:m,defaultNodes:n,defaultEdges:i,zIndexMode:y}),setNodes:S=>{const{nodeLookup:E,parentLookup:C,nodeOrigin:N,elevateNodesOnSelect:_,fitViewQueued:T,zIndexMode:M,nodesSelectionActive:R}=k(),{nodesInitialized:O,hasSelectedNodes:B}=wb(S,E,C,{nodeOrigin:N,nodeExtent:m,elevateNodesOnSelect:_,checkEquality:!0,zIndexMode:M}),U=R&&B;T&&O?(v(),b({nodes:S,nodesInitialized:O,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:U})):b({nodes:S,nodesInitialized:O,nodesSelectionActive:U})},setEdges:S=>{const{connectionLookup:E,edgeLookup:C}=k();eA(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:R,fitViewQueued:O,zIndexMode:B}=k(),{changes:U,updatedInternals:K}=ZG(S,C,N,_,T,M,B);K&&(YG(C,N,{nodeOrigin:T,nodeExtent:M,zIndexMode:B}),O?(v(),b({fitViewQueued:!1,fitViewOptions:void 0})):b({}),(U==null?void 0:U.length)>0&&(R&&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:R,onNodesChangeMiddlewareMap:O}=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,Ge.Left,!0);R({...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=tv(C,_,B,U);N.push(...K)}for(const B of O.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=mA(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=gA(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(R=>Ys(R,!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(R=>Ys(R,!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(),R=S||N,O=E||C,B=[];for(const K of R){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 O)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((R,O)=>O.selected?[...R,Ys(O.id,!1)]:R,[]),M=S.reduce((R,O)=>O.selected?[...R,Ys(O.id,!1)]:R,[]);C(T),N(M)},setNodeExtent:S=>{const{nodes:E,nodeLookup:C,parentLookup:N,nodeOrigin:_,elevateNodesOnSelect:T,nodeExtent:M,zIndexMode:R}=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]||(wb(E,C,N,{nodeOrigin:_,nodeExtent:S,elevateNodesOnSelect:T,checkEquality:!1,zIndexMode:R}),b({nodeExtent:S}))},panBy:S=>{const{transform:E,width:C,height:N,panZoom:_,translateExtent:T}=k();return JG({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 R=typeof(C==null?void 0:C.zoom)<"u"?C.zoom:T;return await M.setViewport({x:N/2-S*R,y:_/2-E*R,zoom:R},{duration:C==null?void 0:C.duration,ease:C==null?void 0:C.ease,interpolate:C==null?void 0:C.interpolate}),!0},cancelConnection:()=>{b({connection:{...LC}})},updateConnection:S=>{b({connection:S})},reset:()=>b({...QS()})}},Object.is);function FA({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:a,initialHeight:l,initialMinZoom:o,initialMaxZoom:d,initialFitViewOptions:f,fitView:h,nodeOrigin:g,nodeExtent:m,zIndexMode:y,children:b}){const[k]=j.useState(()=>wQ({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:a,height:l,fitView:h,minZoom:o,maxZoom:d,fitViewOptions:f,nodeOrigin:g,nodeExtent:m,zIndexMode:y}));return c.jsx(RV,{value:k,children:c.jsx(aY,{children:c.jsx(vY,{children:b})})})}function kQ({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:a,width:l,height:o,fitView:d,fitViewOptions:f,minZoom:h,maxZoom:g,nodeOrigin:m,nodeExtent:y,zIndexMode:b}){return j.useContext(yp)?c.jsx(c.Fragment,{children:e}):c.jsx(FA,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:a,initialWidth:l,initialHeight:o,fitView:d,initialFitViewOptions:f,initialMinZoom:h,initialMaxZoom:g,nodeOrigin:m,nodeExtent:y,zIndexMode:b,children:e})}const EQ={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function SQ({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:a,nodeTypes:l,edgeTypes:o,onNodeClick:d,onEdgeClick:f,onInit:h,onMove:g,onMoveStart:m,onMoveEnd:y,onConnect:b,onConnectStart:k,onConnectEnd:v,onClickConnectStart:S,onClickConnectEnd:E,onNodeMouseEnter:C,onNodeMouseMove:N,onNodeMouseLeave:_,onNodeContextMenu:T,onNodeDoubleClick:M,onNodeDragStart:R,onNodeDrag:O,onNodeDragStop:B,onNodesDelete:U,onEdgesDelete:K,onDelete:q,onSelectionChange:Y,onSelectionDragStart:D,onSelectionDrag:F,onSelectionDragStop:I,onSelectionContextMenu:H,onSelectionStart:Q,onSelectionEnd:G,onBeforeDelete:L,connectionMode:z,connectionLineType:V=os.Bezier,connectionLineStyle:P,connectionLineComponent:le,connectionLineContainerStyle:ve,deleteKeyCode:ke="Backspace",selectionKeyCode:Se="Shift",selectionOnDrag:J=!1,selectionMode:ue=Ru.Full,panActivationKeyCode:Te="Space",multiSelectionKeyCode:Re=Iu()?"Meta":"Control",zoomActivationKeyCode:Oe=Iu()?"Meta":"Control",snapToGrid:ce,snapGrid:Ce,onlyRenderVisibleElements:te=!1,selectNodesOnDrag:pe,nodesDraggable:Fe,autoPanOnNodeFocus:ze,nodesConnectable:ae,nodesFocusable:be,nodeOrigin:ye=hA,edgesFocusable:he,edgesReconnectable:Ee,elementsSelectable:Ne=!0,defaultViewport:Ke=VV,minZoom:ne=.5,maxZoom:de=2,translateExtent:Le=Ou,preventScrolling:Ze=!0,nodeExtent:rt,defaultMarkerColor:At="#b1b1b7",zoomOnScroll:$n=!0,zoomOnPinch:dn=!0,panOnScroll:Mt=!1,panOnScrollSpeed:Qt=.5,panOnScrollMode:yt=ul.Free,zoomOnDoubleClick:Ti=!0,panOnDrag:Rn=!0,onPaneClick:Nl,onPaneMouseEnter:Pr,onPaneMouseMove:wa,onPaneMouseLeave:Br,onPaneScroll:Un,onPaneContextMenu:Z,paneClickDistance:ge=1,nodeClickDistance:Me=0,children:it,onReconnect:qt,onReconnectStart:Ot,onReconnectEnd:Ue,onEdgeContextMenu:Pe,onEdgeDoubleClick:et,onEdgeMouseEnter:rn,onEdgeMouseMove:Vt,onEdgeMouseLeave:Wi,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:_e,onError:Ve,style:ht,id:_t,nodeDragThreshold:sn,connectionDragThreshold:Mn,viewport:Qn,onViewportChange:Fn,width:zt,height:Wn,colorMode:Cl="light",debug:_a,onScroll:vr,ariaLabelConfig:ja,zIndexMode:Al="basic",...qn},Cs){const tr=_t||"1",Ca=XV(Cl),_n=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:_n,style:{...ht,...EQ},ref:Cs,className:Nn(["react-flow",a,Ca]),id:_t,role:"application",children:c.jsxs(kQ,{nodes:e,edges:t,width:zt,height:Wn,fitView:Sa,fitViewOptions:_s,minZoom:ne,maxZoom:de,nodeOrigin:ye,nodeExtent:rt,zIndexMode:Al,children:[c.jsx(WV,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:b,onConnectStart:k,onConnectEnd:v,onClickConnectStart:S,onClickConnectEnd:E,nodesDraggable:Fe,autoPanOnNodeFocus:ze,nodesConnectable:ae,nodesFocusable:be,edgesFocusable:he,edgesReconnectable:Ee,elementsSelectable:Ne,elevateNodesOnSelect:Ln,elevateEdgesOnSelect:Zi,minZoom:ne,maxZoom:de,nodeExtent:rt,onNodesChange:Ea,onEdgesChange:Mi,snapToGrid:ce,snapGrid:Ce,connectionMode:z,translateExtent:Le,connectOnClick:Na,defaultEdgeOptions:js,fitView:Sa,fitViewOptions:_s,onNodesDelete:U,onEdgesDelete:K,onDelete:q,onNodeDragStart:R,onNodeDrag:O,onNodeDragStop:B,onSelectionDrag:F,onSelectionDragStart:D,onSelectionDragStop:I,onMove:g,onMoveStart:m,onMoveEnd:y,noPanClassName:Xi,nodeOrigin:ye,rfId:tr,autoPanOnConnect:xr,autoPanOnNodeDrag:fn,autoPanSpeed:Ur,onError:Ve,connectionRadius:er,isValidConnection:_e,selectNodesOnDrag:pe,nodeDragThreshold:sn,connectionDragThreshold:Mn,onBeforeDelete:L,debug:_a,ariaLabelConfig:ja,zIndexMode:Al}),c.jsx(xQ,{onInit:h,onNodeClick:d,onEdgeClick:f,onNodeMouseEnter:C,onNodeMouseMove:N,onNodeMouseLeave:_,onNodeContextMenu:T,onNodeDoubleClick:M,nodeTypes:l,edgeTypes:o,connectionLineType:V,connectionLineStyle:P,connectionLineComponent:le,connectionLineContainerStyle:ve,selectionKeyCode:Se,selectionOnDrag:J,selectionMode:ue,deleteKeyCode:ke,multiSelectionKeyCode:Re,panActivationKeyCode:Te,zoomActivationKeyCode:Oe,onlyRenderVisibleElements:te,defaultViewport:Ke,translateExtent:Le,minZoom:ne,maxZoom:de,preventScrolling:Ze,zoomOnScroll:$n,zoomOnPinch:dn,zoomOnDoubleClick:Ti,panOnScroll:Mt,panOnScrollSpeed:Qt,panOnScrollMode:yt,panOnDrag:Rn,autoPanOnSelection:jl,onPaneClick:Nl,onPaneMouseEnter:Pr,onPaneMouseMove:wa,onPaneMouseLeave:Br,onPaneScroll:Un,onPaneContextMenu:Z,paneClickDistance:ge,nodeClickDistance:Me,onSelectionContextMenu:H,onSelectionStart:Q,onSelectionEnd:G,onReconnect:qt,onReconnectStart:Ot,onReconnectEnd:Ue,onEdgeContextMenu:Pe,onEdgeDoubleClick:et,onEdgeMouseEnter:rn,onEdgeMouseMove:Vt,onEdgeMouseLeave:Wi,reconnectRadius:ka,defaultMarkerColor:At,noDragClassName:an,noWheelClassName:Tn,noPanClassName:Xi,rfId:tr,disableKeyboardA11y:Ji,nodeExtent:rt,viewport:Qn,onViewportChange:Fn}),c.jsx(GV,{onSelectionChange:Y}),it,c.jsx(UV,{proOptions:$r,position:_l}),c.jsx($V,{rfId:tr,disableKeyboardA11y:Ji})]})})}var NQ=yA(SQ);function _Q(e){const[t,n]=j.useState(e),i=j.useCallback(a=>n(l=>mA(a,l)),[]);return[t,n,i]}function jQ(e){const[t,n]=j.useState(e),i=j.useCallback(a=>n(l=>gA(a,l)),[]);return[t,n,i]}function CQ({dimensions:e,lineWidth:t,variant:n,className:i}){return c.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Nn(["react-flow__background-pattern",n,i])})}function AQ({radius:e,className:t}){return c.jsx("circle",{cx:e,cy:e,r:e,className:Nn(["react-flow__background-pattern","dots",t])})}var pa;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(pa||(pa={}));const TQ={[pa.Dots]:1,[pa.Lines]:1,[pa.Cross]:6},MQ=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function qA({id:e,variant:t=pa.Dots,gap:n=20,size:i,lineWidth:a=1,offset:l=0,color:o,bgColor:d,style:f,className:h,patternClassName:g}){const m=j.useRef(null),{transform:y,patternId:b}=Nt(MQ,tn),k=i||TQ[t],v=t===pa.Dots,S=t===pa.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],R=`${b}${e||""}`;return c.jsxs("svg",{className:Nn(["react-flow__background",h]),style:{...f,...vp,"--xy-background-color-props":d,"--xy-background-pattern-color-props":o},ref:m,"data-testid":"rf__background",children:[c.jsx("pattern",{id:R,x:y[0]%C[0],y:y[1]%C[1],width:C[0],height:C[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${M[0]},-${M[1]})`,children:v?c.jsx(AQ,{radius:N/2,className:g}):c.jsx(CQ,{dimensions:T,lineWidth:a,variant:t,className:g})}),c.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${R})`})]})}qA.displayName="Background";const DQ=j.memo(qA);function OQ(){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 RQ(){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 LQ(){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 IQ(){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 zQ(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:c.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Yf({children:e,className:t,...n}){return c.jsx("button",{type:"button",className:Nn(["react-flow__controls-button",t]),...n,children:e})}const PQ=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function HA({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:a,onZoomIn:l,onZoomOut:o,onFitView:d,onInteractiveChange:f,className:h,children:g,position:m="bottom-left",orientation:y="vertical","aria-label":b}){const k=nn(),{isInteractive:v,minZoomReached:S,maxZoomReached:E,ariaLabelConfig:C}=Nt(PQ,tn),{zoomIn:N,zoomOut:_,fitView:T}=xp(),M=()=>{N(),l==null||l()},R=()=>{_(),o==null||o()},O=()=>{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(bp,{className:Nn(["react-flow__controls",U,h]),position:m,style:e,"data-testid":"rf__controls","aria-label":b??C["controls.ariaLabel"],children:[t&&c.jsxs(c.Fragment,{children:[c.jsx(Yf,{onClick:M,className:"react-flow__controls-zoomin",title:C["controls.zoomIn.ariaLabel"],"aria-label":C["controls.zoomIn.ariaLabel"],disabled:E,children:c.jsx(OQ,{})}),c.jsx(Yf,{onClick:R,className:"react-flow__controls-zoomout",title:C["controls.zoomOut.ariaLabel"],"aria-label":C["controls.zoomOut.ariaLabel"],disabled:S,children:c.jsx(RQ,{})})]}),n&&c.jsx(Yf,{className:"react-flow__controls-fitview",onClick:O,title:C["controls.fitView.ariaLabel"],"aria-label":C["controls.fitView.ariaLabel"],children:c.jsx(LQ,{})}),i&&c.jsx(Yf,{className:"react-flow__controls-interactive",onClick:B,title:C["controls.interactive.ariaLabel"],"aria-label":C["controls.interactive.ariaLabel"],children:v?c.jsx(zQ,{}):c.jsx(IQ,{})}),g]})}HA.displayName="Controls";const BQ=j.memo(HA);function $Q({id:e,x:t,y:n,width:i,height:a,style:l,color:o,strokeColor:d,strokeWidth:f,className:h,borderRadius:g,shapeRendering:m,selected:y,onClick:b}){const{background:k,backgroundColor:v}=l||{},S=o||k||v;return c.jsx("rect",{className:Nn(["react-flow__minimap-node",{selected:y},h]),x:t,y:n,rx:g,ry:g,width:i,height:a,style:{fill:S,stroke:d,strokeWidth:f},shapeRendering:m,onClick:b?E=>b(E,e):void 0})}const UQ=j.memo($Q),FQ=e=>e.nodes.map(t=>t.id),Ey=e=>e instanceof Function?e:()=>e;function qQ({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:l=UQ,onClick:o}){const d=Nt(FQ,tn),f=Ey(t),h=Ey(e),g=Ey(n),m=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return c.jsx(c.Fragment,{children:d.map(y=>c.jsx(KQ,{id:y,nodeColorFunc:f,nodeStrokeColorFunc:h,nodeClassNameFunc:g,nodeBorderRadius:i,nodeStrokeWidth:a,NodeComponent:l,onClick:o,shapeRendering:m},y))})}function HQ({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:a,nodeStrokeWidth:l,shapeRendering:o,NodeComponent:d,onClick:f}){const{node:h,x:g,y:m,width:y,height:b}=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!h||h.hidden||!qC(h)?null:c.jsx(d,{x:g,y:m,width:y,height:b,style:h.style,selected:!!h.selected,className:i(h),color:t(h),borderRadius:a,strokeColor:n(h),strokeWidth:l,shapeRendering:o,onClick:f,id:h.id})}const KQ=j.memo(HQ);var GQ=j.memo(qQ);const VQ=200,YQ=150,QQ=e=>!e.hidden,WQ=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?$C(ad(e.nodeLookup,{filter:QQ}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},XQ="react-flow__minimap-desc";function KA({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:a="",nodeBorderRadius:l=5,nodeStrokeWidth:o,nodeComponent:d,bgColor:f,maskColor:h,maskStrokeColor:g,maskStrokeWidth:m,position:y="bottom-right",onClick:b,onNodeClick:k,pannable:v=!1,zoomable:S=!1,ariaLabel:E,inversePan:C,zoomStep:N=1,offsetScale:_=5}){const T=nn(),M=j.useRef(null),{boundingRect:R,viewBB:O,rfId:B,panZoom:U,translateExtent:K,flowWidth:q,flowHeight:Y,ariaLabelConfig:D}=Nt(WQ,tn),F=(e==null?void 0:e.width)??VQ,I=(e==null?void 0:e.height)??YQ,H=R.width/F,Q=R.height/I,G=Math.max(H,Q),L=G*F,z=G*I,V=_*G,P=R.x-(L-R.width)/2-V,le=R.y-(z-R.height)/2-V,ve=L+V*2,ke=z+V*2,Se=`${XQ}-${B}`,J=j.useRef(0),ue=j.useRef();J.current=G,j.useEffect(()=>{if(M.current&&U)return ue.current=oV({domNode:M.current,panZoom:U,getTransform:()=>T.getState().transform,getViewScale:()=>J.current}),()=>{var ce;(ce=ue.current)==null||ce.destroy()}},[U]),j.useEffect(()=>{var ce;(ce=ue.current)==null||ce.update({translateExtent:K,width:q,height:Y,inversePan:C,pannable:v,zoomStep:N,zoomable:S})},[v,S,C,N,K,q,Y]);const Te=b?ce=>{var pe;const[Ce,te]=((pe=ue.current)==null?void 0:pe.pointer(ce))||[0,0];b(ce,{x:Ce,y:te})}:void 0,Re=k?j.useCallback((ce,Ce)=>{const te=T.getState().nodeLookup.get(Ce).internals.userNode;k(ce,te)},[]):void 0,Oe=E??D["minimap.ariaLabel"];return c.jsx(bp,{position:y,style:{...e,"--xy-minimap-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-color-props":typeof g=="string"?g:void 0,"--xy-minimap-mask-stroke-width-props":typeof m=="number"?m*G:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="number"?o:void 0},className:Nn(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:c.jsxs("svg",{width:F,height:I,viewBox:`${P} ${le} ${ve} ${ke}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Se,ref:M,onClick:Te,children:[Oe&&c.jsx("title",{id:Se,children:Oe}),c.jsx(GQ,{onClick:Re,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${ve+V*2}v${ke+V*2}h${-ve-V*2}z
|
|
685
|
-
M${O.x},${O.y}h${O.width}v${O.height}h${-O.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}KA.displayName="MiniMap";j.memo(KA);const ZQ=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,JQ={[Vo.Line]:"right",[Vo.Handle]:"bottom-right"};function eW({nodeId:e,position:t,variant:n=Vo.Handle,className:i,style:a=void 0,children:l,color:o,minWidth:d=10,minHeight:f=10,maxWidth:h=Number.MAX_VALUE,maxHeight:g=Number.MAX_VALUE,keepAspectRatio:m=!1,resizeDirection:y,autoScale:b=!0,shouldResize:k,onResizeStart:v,onResize:S,onResizeEnd:E}){const C=wA(),N=typeof e=="string"?e:C,_=nn(),T=j.useRef(null),M=n===Vo.Handle,R=Nt(j.useCallback(ZQ(M&&b),[M,b]),tn),O=j.useRef(null),B=t??JQ[n];j.useEffect(()=>{if(!(!T.current||!N))return O.current||(O.current=wV({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=[],Q={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,...HC({x:K.x??G.position.x,y:K.y??G.position.y},{width:z,height:V},G.parentId,D,L)}},le=tv([P],D,F,I);H.push(...le),Q.x=K.x?Math.max(L[0]*z,K.x):void 0,Q.y=K.y?Math.max(L[1]*V,K.y):void 0}if(Q.x!==void 0&&Q.y!==void 0){const L={id:N,type:"position",position:{...Q}};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])}})),O.current.update({controlPosition:B,boundaries:{minWidth:d,minHeight:f,maxWidth:h,maxHeight:g},keepAspectRatio:m,resizeDirection:y,onResizeStart:v,onResize:S,onResizeEnd:E,shouldResize:k}),()=>{var K;(K=O.current)==null||K.destroy()}},[B,d,f,h,g,m,v,S,E,k]);const U=B.split("-");return c.jsx("div",{className:Nn(["react-flow__resize-control","nodrag",...U,n,i]),ref:T,style:{...a,scale:R,...o&&{[M?"backgroundColor":"borderColor"]:o}},children:l})}j.memo(eW);function tW(e){return ft(`/api/smartarrange/${encodeURIComponent(e)}`)}async function nW(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 Sy=["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 WS(e,t){return Sy[t%Sy.length]??Sy[0]}const GA={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)"},iW=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:Ge.Left,style:fo}),c.jsx(Dr,{id:"r-t",type:"target",position:Ge.Right,style:fo}),c.jsx(Dr,{id:"t-t",type:"target",position:Ge.Top,style:fo}),c.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5 border-b border-[var(--color-border-light)]",style:{background:i.color},children:[c.jsxs("span",{className:"font-[family-name:var(--font-mono)] text-xs font-bold text-[var(--color-text)]",children:["#",i.seq]}),c.jsx("span",{className:"text-[11px] text-[var(--color-text)] truncate",children:i.taskLabel}),c.jsx("span",{className:"w-2.5 h-2.5 rounded-full inline-block shrink-0 ml-auto",style:{background:GA[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:Ge.Right,style:fo}),c.jsx(Dr,{id:"l-s",type:"source",position:Ge.Left,style:fo}),c.jsx(Dr,{id:"b-s",type:"source",position:Ge.Bottom,style:fo})]})});function rW({card:e,status:t,onClose:n}){var a;const i=Be();return j.useEffect(()=>{const l=o=>{o.key==="Escape"&&n()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[n]),c.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",onClick:n,children:c.jsxs("div",{className:"nb-card mt-12 w-full max-w-2xl bg-[var(--color-bg)]",onClick:l=>l.stopPropagation(),children:[c.jsxs("header",{className:"flex items-start justify-between gap-4 mb-4",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-2 flex-wrap",children:[c.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-xs px-2 py-0.5 bg-[var(--color-accent-purple)] border-2 border-[var(--color-text)] rounded-full",children:["#",e.seq]}),c.jsxs("span",{className:"font-[family-name:var(--font-mono)] text-xs px-2 py-0.5 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-full font-semibold",children:[i("arrange.cardTask")," T",e.taskId]}),c.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs px-2 py-0.5 border-2 border-[var(--color-text)] rounded-full font-semibold",children:[c.jsx("span",{className:"w-2.5 h-2.5 rounded-full inline-block border border-[var(--color-text)]",style:{background:GA[t]??"gray"}}),t]})]}),c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold break-words",children:e.title})]}),c.jsx("button",{onClick:n,className:"nb-btn nb-btn-mint p-2 flex-shrink-0","aria-label":i("arrange.close"),type:"button",children:c.jsx(bn,{size:14,strokeWidth:3})})]}),c.jsxs("div",{className:"flex flex-col gap-4",children:[e.at&&c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[c.jsx(YN,{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(fx,{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 aW=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})]})}),sW={card:iW,laneBox:aW},iv=260,VA=iv+36,lW=200,oW={todo:"var(--color-text-subtle)",doing:"var(--color-secondary-dark)",done:"var(--color-cta)",rework:"var(--color-secondary-dark)"};function Sb(e,t,n){return e==="doing"&&t<n?"stuck":e}function cW(e,t){const n=Math.floor(e/t),i=e%t;return{x:(n%2===0?i:t-1-i)*VA,y:n*lW}}function uW(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 dW(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 YA=158,XS=iv+60,ZS=YA+28,JS=40;function fW({cards:e,taskMeta:t,view:n,onSelect:i}){const a=j.useRef(null),[l,o]=j.useState(4),d=xp(),[f,h,g]=_Q([]),[m,y]=jQ([]),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)/VA))))});return v.observe(k),()=>v.disconnect()},[]),j.useEffect(()=>{const k=[...e].sort((M,R)=>M.seq-R.seq),v=`${n}:${l}:${k.length}`,S=b.current!==v;b.current=v;const E=new Map,C=(M,R)=>{var O;if(n==="lane"){const B=((O=t.get(M.taskId))==null?void 0:O.order)??0,U=E.get(M.taskId)??0;return E.set(M.taskId,U+1),{x:B*XS,y:U*ZS}}return cW(R,l)},N=[];if(n==="lane"){const M=new Map;for(const R of k)M.set(R.taskId,(M.get(R.taskId)??0)+1);for(const[R,O]of M){const B=t.get(R),U=(B==null?void 0:B.order)??0;N.push({id:`lane-${R}`,type:"laneBox",position:{x:U*XS-16,y:-JS},data:{label:B!=null&&B.title?`T${R} · ${B.title}`:`T${R}`,color:(B==null?void 0:B.color)??"var(--color-bg-cream)"},style:{width:iv+32,height:JS+(O-1)*ZS+YA+14},draggable:!1,selectable:!1,zIndex:0})}}const _=k.length?k[k.length-1].seq:0;h(M=>{const R=new Map(M.map(B=>[B.id,B])),O=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:Sb(B.status,B.seq,_),color:(K==null?void 0:K.color)??"var(--color-bg-cream)"},Y=String(B.seq),D=R.get(Y),F=C(B,U);return{...D&&!S?{...D,data:q}:{id:Y,type:"card",position:F,data:q},zIndex:1}});return[...N,...O]});const T=[];for(let M=1;M<k.length;M++){const R=k[M-1],O=k[M];if(!R||!O)continue;const B=n==="lane"?R.taskId===O.taskId?{sourceHandle:"b-s",targetHandle:"t-t"}:{sourceHandle:"r-s",targetHandle:"l-t"}:uW(M-1,M,l);T.push({id:`e${R.seq}-${O.seq}`,source:String(R.seq),target:String(O.seq),...B,...dW(Sb(O.status,O.seq,_))})}y(T),S&&requestAnimationFrame(()=>d.fitView({padding:.2,maxZoom:1.1,duration:300}))},[e,l,t,n,h,y,d]),c.jsx("div",{ref:a,className:"w-full h-full",children:c.jsxs(NQ,{nodes:f,edges:m,onNodesChange:g,nodeTypes:sW,onNodeClick:(k,v)=>i(Number(v.id)),fitView:!0,fitViewOptions:{padding:.2,maxZoom:1.1},proOptions:{hideAttribution:!0},minZoom:.15,children:[c.jsx(DQ,{variant:pa.Dots,gap:20,size:1.5,color:"var(--color-border-light)"}),c.jsx(BQ,{showInteractive:!1})]})})}function hW(){var U,K,q;const e=Be(),t=Ft(),{alert:n}=un(),a=(((U=Ye({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 h=a.find(Y=>Y.name===f),g=(h==null?void 0:h.pipelineStatus)==="running",m=Ye({queryKey:["smartarrange",f],queryFn:()=>tW(f),enabled:!!f,refetchInterval:3e3}),y=Et({mutationFn:()=>nW(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:()=>w2(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:()=>k2(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:WS(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,R]=j.useState(null),O=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(Fb,{size:12,strokeWidth:3}),e("arrange.stop")]}):c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 12px",fontSize:12},onClick:()=>b.mutate(),disabled:b.isPending,type:"button","aria-label":e("arrange.start"),children:[b.isPending?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(Yu,{size:12,strokeWidth:3}),e("arrange.start")]}),v&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"nb-status",style:{background:"var(--color-bg-cream)",color:"var(--color-text)"},children:v.status}),c.jsxs("span",{className:"text-sm text-[var(--color-text-muted)]",children:["round ",v.round,"/",v.maxRounds]}),v.status==="awaiting-approval"&&c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 12px",fontSize:12},onClick:()=>y.mutate(),disabled:y.isPending,type:"button","aria-label":e("arrange.approve"),children:[y.isPending?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(fh,{size:12,strokeWidth:2.5}),e("arrange.approve")]})]})]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[v&&c.jsxs("button",{className:"nb-btn",style:{padding:"6px 10px",fontSize:12},onClick:()=>C(E==="free"?"lane":"free"),type:"button","aria-label":e("arrange.view"),children:[E==="lane"?c.jsx(s3,{size:14,strokeWidth:2.5}):c.jsx(WN,{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(FA,{children:c.jsx(fW,{cards:S,taskMeta:N,view:E,onSelect:R})}),!_&&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(Zo,{size:14,strokeWidth:3,className:"rotate-180"}),e("arrange.tasks")]})]}),_&&c.jsxs("aside",{className:"w-72 shrink-0 nb-card overflow-hidden flex flex-col gap-2 min-h-0",style:{padding:12},children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold",children:e("arrange.tasks")}),c.jsx("button",{className:"nb-btn",style:{padding:"2px 6px"},onClick:()=>T(!1),type:"button","aria-label":e("arrange.collapse"),children:c.jsx(KL,{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:WS(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:oW[Y.status]??"gray"}}),c.jsxs("span",{className:"font-bold text-xs text-[var(--color-text)]",children:["T",Y.id]}),c.jsxs("span",{className:"text-[11px] ml-auto font-[family-name:var(--font-mono)] text-[var(--color-text)]",children:[Y.cardSeqs.length," ",e("arrange.cardsCount")]})]}),c.jsx("p",{className:"text-xs text-[var(--color-text)] mt-1 leading-snug",children:Y.title})]},Y.id))})})]})]}):c.jsx("section",{className:"nb-card",children:g?c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(Xe,{size:18,strokeWidth:3,className:"animate-spin"}),c.jsx("p",{className:"text-sm font-bold",children:e("arrange.starting")})]}):c.jsx("p",{className:"text-[var(--color-text-muted)] text-sm",children:e("arrange.none")})}),O&&c.jsx(rW,{card:O,status:Sb(O.status,O.seq,B),onClose:()=>R(null)})]})}function pW(){const e=Be();return c.jsxs("div",{className:"nb-card max-w-2xl mt-12",children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold mb-2",children:e("notFound.title")}),c.jsx("p",{className:"text-[var(--color-text-muted)] mb-6",children:e("notFound.body")}),c.jsx(vs,{to:"/",className:"nb-btn nb-btn-mint inline-flex",children:e("notFound.home")})]})}function mW(){return c.jsx(bI,{children:c.jsx(VO,{children:c.jsxs(Cn,{element:c.jsx(gI,{}),children:[c.jsx(Cn,{index:!0,element:c.jsx(HO,{to:"/projects",replace:!0})}),c.jsx(Cn,{path:"/projects",element:c.jsx(Ak,{})}),c.jsx(Cn,{path:"/projects/new",element:c.jsx(v2,{})}),c.jsx(Cn,{path:"/projects/:name",element:c.jsx(Ak,{})}),c.jsx(Cn,{path:"/board",element:c.jsx(n5,{})}),c.jsx(Cn,{path:"/workers",element:c.jsx(b5,{})}),c.jsx(Cn,{path:"/skills",element:c.jsx(I8,{})}),c.jsx(Cn,{path:"/prompts",element:c.jsx(F8,{})}),c.jsx(Cn,{path:"/system",element:c.jsx(V8,{})}),c.jsx(Cn,{path:"/processes",element:c.jsx(vq,{})}),c.jsx(Cn,{path:"/audit",element:c.jsx(Sq,{})}),c.jsx(Cn,{path:"/chat",element:c.jsx(LE,{})}),c.jsx(Cn,{path:"/chat/:sessionId",element:c.jsx(LE,{})}),c.jsx(Cn,{path:"/memory",element:c.jsx(jq,{})}),c.jsx(Cn,{path:"/plugins",element:c.jsx(Lq,{})}),c.jsx(Cn,{path:"/arrange",element:c.jsx(hW,{})}),c.jsx(Cn,{path:"*",element:c.jsx(pW,{})})]})})})}yI();U3();const gW=new RD({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1}}}),QA=document.getElementById("root");if(!QA)throw new Error("#root not found");cD.createRoot(QA).render(c.jsx(j.StrictMode,{children:c.jsx(P3,{children:c.jsx(LD,{client:gW,children:c.jsx(bR,{children:c.jsx(CI,{children:c.jsx(mW,{})})})})})}));
|