bugxhunter 0.9.2 → 0.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,230 +0,0 @@
1
- var Lx=Object.defineProperty;var dy=s=>{throw TypeError(s)};var Hx=(s,r,c)=>r in s?Lx(s,r,{enumerable:!0,configurable:!0,writable:!0,value:c}):s[r]=c;var jt=(s,r,c)=>Hx(s,typeof r!="symbol"?r+"":r,c),Bx=(s,r,c)=>r.has(s)||dy("Cannot "+c);var hy=(s,r,c)=>r.has(s)?dy("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(s):r.set(s,c);var my=(s,r,c)=>(Bx(s,r,"access private method"),c);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))u(f);new MutationObserver(f=>{for(const h of f)if(h.type==="childList")for(const m of h.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&u(m)}).observe(document,{childList:!0,subtree:!0});function c(f){const h={};return f.integrity&&(h.integrity=f.integrity),f.referrerPolicy&&(h.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?h.credentials="include":f.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function u(f){if(f.ep)return;f.ep=!0;const h=c(f);fetch(f.href,h)}})();function pv(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var rd={exports:{}},ir={};/**
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 py;function qx(){if(py)return ir;py=1;var s=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function c(u,f,h){var m=null;if(h!==void 0&&(m=""+h),f.key!==void 0&&(m=""+f.key),"key"in f){h={};for(var b in f)b!=="key"&&(h[b]=f[b])}else h=f;return f=h.ref,{$$typeof:s,type:u,key:m,ref:f!==void 0?f:null,props:h}}return ir.Fragment=r,ir.jsx=c,ir.jsxs=c,ir}var gy;function Yx(){return gy||(gy=1,rd.exports=qx()),rd.exports}var i=Yx(),od={exports:{}},Xe={};/**
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 yy;function Xx(){if(yy)return Xe;yy=1;var s=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),m=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),S=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),x=Symbol.for("react.view_transition"),E=Symbol.iterator;function z(T){return T===null||typeof T!="object"?null:(T=E&&T[E]||T["@@iterator"],typeof T=="function"?T:null)}var V={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},L=Object.assign,ne={};function pe(T,te,xe){this.props=T,this.context=te,this.refs=ne,this.updater=xe||V}pe.prototype.isReactComponent={},pe.prototype.setState=function(T,te){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,te,"setState")},pe.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function ce(){}ce.prototype=pe.prototype;function _(T,te,xe){this.props=T,this.context=te,this.refs=ne,this.updater=xe||V}var $=_.prototype=new ce;$.constructor=_,L($,pe.prototype),$.isPureReactComponent=!0;var H=Array.isArray;function Q(){}var W={H:null,A:null,T:null,S:null},re=Object.prototype.hasOwnProperty;function G(T,te,xe){var Se=xe.ref;return{$$typeof:s,type:T,key:te,ref:Se!==void 0?Se:null,props:xe}}function K(T,te){return G(T.type,te,T.props)}function Z(T){return typeof T=="object"&&T!==null&&T.$$typeof===s}function de(T){var te={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(xe){return te[xe]})}var oe=/\/+/g;function De(T,te){return typeof T=="object"&&T!==null&&T.key!=null?de(""+T.key):te.toString(36)}function ae(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(Q,Q):(T.status="pending",T.then(function(te){T.status==="pending"&&(T.status="fulfilled",T.value=te)},function(te){T.status==="pending"&&(T.status="rejected",T.reason=te)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function F(T,te,xe,Se,He){var Ue=typeof T;(Ue==="undefined"||Ue==="boolean")&&(T=null);var je=!1;if(T===null)je=!0;else switch(Ue){case"bigint":case"string":case"number":je=!0;break;case"object":switch(T.$$typeof){case s:case r:je=!0;break;case y:return je=T._init,F(je(T._payload),te,xe,Se,He)}}if(je)return He=He(T),je=Se===""?"."+De(T,0):Se,H(He)?(xe="",je!=null&&(xe=je.replace(oe,"$&/")+"/"),F(He,te,xe,"",function(pt){return pt})):He!=null&&(Z(He)&&(He=K(He,xe+(He.key==null||T&&T.key===He.key?"":(""+He.key).replace(oe,"$&/")+"/")+je)),te.push(He)),1;je=0;var fe=Se===""?".":Se+":";if(H(T))for(var we=0;we<T.length;we++)Se=T[we],Ue=fe+De(Se,we),je+=F(Se,te,xe,Ue,He);else if(we=z(T),typeof we=="function")for(T=we.call(T),we=0;!(Se=T.next()).done;)Se=Se.value,Ue=fe+De(Se,we++),je+=F(Se,te,xe,Ue,He);else if(Ue==="object"){if(typeof T.then=="function")return F(ae(T),te,xe,Se,He);throw te=String(T),Error("Objects are not valid as a React child (found: "+(te==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":te)+"). If you meant to render a collection of children, use an array instead.")}return je}function he(T,te,xe){if(T==null)return T;var Se=[],He=0;return F(T,Se,"","",function(Ue){return te.call(xe,Ue,He++)}),Se}function P(T){if(T._status===-1){var te=T._result,xe=te();xe.then(function(Se){(T._status===0||T._status===-1)&&(T._status=1,T._result=Se,xe.status===void 0&&(xe.status="fulfilled",xe.value=Se))},function(Se){(T._status===0||T._status===-1)&&(T._status=2,T._result=Se,xe.status===void 0&&(xe.status="rejected",xe.reason=Se))}),T._status===-1&&(T._status=0,T._result=xe)}if(T._status===1)return T._result.default;throw T._result}var _e=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var te=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T=="object"&&T!==null&&typeof T.message=="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(te))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)};function ot(T){var te=W.T,xe={};xe.types=te!==null?te.types:null,W.T=xe;try{var Se=T(),He=W.S;He!==null&&He(xe,Se),typeof Se=="object"&&Se!==null&&typeof Se.then=="function"&&Se.then(Q,_e)}catch(Ue){_e(Ue)}finally{te!==null&&xe.types!==null&&(te.types=xe.types),W.T=te}}function ht(T){var te=W.T;if(te!==null){var xe=te.types;xe===null?te.types=[T]:xe.indexOf(T)===-1&&xe.push(T)}else ot(ht.bind(null,T))}var mt={map:he,forEach:function(T,te,xe){he(T,function(){te.apply(this,arguments)},xe)},count:function(T){var te=0;return he(T,function(){te++}),te},toArray:function(T){return he(T,function(te){return te})||[]},only:function(T){if(!Z(T))throw Error("React.Children.only expected to receive a single React element child.");return T}};return Xe.Activity=v,Xe.Children=mt,Xe.Component=pe,Xe.Fragment=c,Xe.Profiler=f,Xe.PureComponent=_,Xe.StrictMode=u,Xe.Suspense=g,Xe.ViewTransition=x,Xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=W,Xe.__COMPILER_RUNTIME={__proto__:null,c:function(T){return W.H.useMemoCache(T)}},Xe.addTransitionType=ht,Xe.cache=function(T){return function(){return T.apply(null,arguments)}},Xe.cacheSignal=function(){return null},Xe.cloneElement=function(T,te,xe){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var Se=L({},T.props),He=T.key;if(te!=null)for(Ue in te.key!==void 0&&(He=""+te.key),te)!re.call(te,Ue)||Ue==="key"||Ue==="__self"||Ue==="__source"||Ue==="ref"&&te.ref===void 0||(Se[Ue]=te[Ue]);var Ue=arguments.length-2;if(Ue===1)Se.children=xe;else if(1<Ue){for(var je=Array(Ue),fe=0;fe<Ue;fe++)je[fe]=arguments[fe+2];Se.children=je}return G(T.type,He,Se)},Xe.createContext=function(T){return T={$$typeof:m,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:h,_context:T},T},Xe.createElement=function(T,te,xe){var Se,He={},Ue=null;if(te!=null)for(Se in te.key!==void 0&&(Ue=""+te.key),te)re.call(te,Se)&&Se!=="key"&&Se!=="__self"&&Se!=="__source"&&(He[Se]=te[Se]);var je=arguments.length-2;if(je===1)He.children=xe;else if(1<je){for(var fe=Array(je),we=0;we<je;we++)fe[we]=arguments[we+2];He.children=fe}if(T&&T.defaultProps)for(Se in je=T.defaultProps,je)He[Se]===void 0&&(He[Se]=je[Se]);return G(T,Ue,He)},Xe.createRef=function(){return{current:null}},Xe.forwardRef=function(T){return{$$typeof:b,render:T}},Xe.isValidElement=Z,Xe.lazy=function(T){return{$$typeof:y,_payload:{_status:-1,_result:T},_init:P}},Xe.memo=function(T,te){return{$$typeof:S,type:T,compare:te===void 0?null:te}},Xe.startTransition=ot,Xe.unstable_useCacheRefresh=function(){return W.H.useCacheRefresh()},Xe.use=function(T){return W.H.use(T)},Xe.useActionState=function(T,te,xe){return W.H.useActionState(T,te,xe)},Xe.useCallback=function(T,te){return W.H.useCallback(T,te)},Xe.useContext=function(T){return W.H.useContext(T)},Xe.useDebugValue=function(){},Xe.useDeferredValue=function(T,te){return W.H.useDeferredValue(T,te)},Xe.useEffect=function(T,te){return W.H.useEffect(T,te)},Xe.useEffectEvent=function(T){return W.H.useEffectEvent(T)},Xe.useId=function(){return W.H.useId()},Xe.useImperativeHandle=function(T,te,xe){return W.H.useImperativeHandle(T,te,xe)},Xe.useInsertionEffect=function(T,te){return W.H.useInsertionEffect(T,te)},Xe.useLayoutEffect=function(T,te){return W.H.useLayoutEffect(T,te)},Xe.useMemo=function(T,te){return W.H.useMemo(T,te)},Xe.useOptimistic=function(T,te){return W.H.useOptimistic(T,te)},Xe.useReducer=function(T,te,xe){return W.H.useReducer(T,te,xe)},Xe.useRef=function(T){return W.H.useRef(T)},Xe.useState=function(T){return W.H.useState(T)},Xe.useSyncExternalStore=function(T,te,xe){return W.H.useSyncExternalStore(T,te,xe)},Xe.useTransition=function(){return W.H.useTransition()},Xe.version="19.3.0",Xe}var vy;function qd(){return vy||(vy=1,od.exports=Xx()),od.exports}var N=qd();const Gx=pv(N);var cd={exports:{}},rr={},ud={exports:{}},fd={};/**
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 by;function $x(){return by||(by=1,(function(s){function r(ae,F){var he=ae.length;ae.push(F);e:for(;0<he;){var P=he-1>>>1,_e=ae[P];if(0<f(_e,F))ae[P]=F,ae[he]=_e,he=P;else break e}}function c(ae){return ae.length===0?null:ae[0]}function u(ae){if(ae.length===0)return null;var F=ae[0],he=ae.pop();if(he!==F){ae[0]=he;e:for(var P=0,_e=ae.length,ot=_e>>>1;P<ot;){var ht=2*(P+1)-1,mt=ae[ht],T=ht+1,te=ae[T];if(0>f(mt,he))T<_e&&0>f(te,mt)?(ae[P]=te,ae[T]=he,P=T):(ae[P]=mt,ae[ht]=he,P=ht);else if(T<_e&&0>f(te,he))ae[P]=te,ae[T]=he,P=T;else break e}}return F}function f(ae,F){var he=ae.sortIndex-F.sortIndex;return he!==0?he:ae.id-F.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;s.unstable_now=function(){return h.now()}}else{var m=Date,b=m.now();s.unstable_now=function(){return m.now()-b}}var g=[],S=[],y=1,v=null,x=3,E=!1,z=!1,V=!1,L=!1,ne=typeof setTimeout=="function"?setTimeout:null,pe=typeof clearTimeout=="function"?clearTimeout:null,ce=typeof setImmediate<"u"?setImmediate:null;function _(ae){for(var F=c(S);F!==null;){if(F.callback===null)u(S);else if(F.startTime<=ae)u(S),F.sortIndex=F.expirationTime,r(g,F);else break;F=c(S)}}function $(ae){if(V=!1,_(ae),!z)if(c(g)!==null)z=!0,H||(H=!0,Z());else{var F=c(S);F!==null&&De($,F.startTime-ae)}}var H=!1,Q=-1,W=5,re=-1;function G(){return L?!0:!(s.unstable_now()-re<W)}function K(){if(L=!1,H){var ae=s.unstable_now();re=ae;var F=!0;try{e:{z=!1,V&&(V=!1,pe(Q),Q=-1),E=!0;var he=x;try{t:{for(_(ae),v=c(g);v!==null&&!(v.expirationTime>ae&&G());){var P=v.callback;if(typeof P=="function"){v.callback=null,x=v.priorityLevel;var _e=P(v.expirationTime<=ae);if(ae=s.unstable_now(),typeof _e=="function"){v.callback=_e,_(ae),F=!0;break t}v===c(g)&&u(g),_(ae)}else u(g);v=c(g)}if(v!==null)F=!0;else{var ot=c(S);ot!==null&&De($,ot.startTime-ae),F=!1}}break e}finally{v=null,x=he,E=!1}F=void 0}}finally{F?Z():H=!1}}}var Z;if(typeof ce=="function")Z=function(){ce(K)};else if(typeof MessageChannel<"u"){var de=new MessageChannel,oe=de.port2;de.port1.onmessage=K,Z=function(){oe.postMessage(null)}}else Z=function(){ne(K,0)};function De(ae,F){Q=ne(function(){ae(s.unstable_now())},F)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(ae){ae.callback=null},s.unstable_forceFrameRate=function(ae){0>ae||125<ae?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):W=0<ae?Math.floor(1e3/ae):5},s.unstable_getCurrentPriorityLevel=function(){return x},s.unstable_next=function(ae){switch(x){case 1:case 2:case 3:var F=3;break;default:F=x}var he=x;x=F;try{return ae()}finally{x=he}},s.unstable_requestPaint=function(){L=!0},s.unstable_runWithPriority=function(ae,F){switch(ae){case 1:case 2:case 3:case 4:case 5:break;default:ae=3}var he=x;x=ae;try{return F()}finally{x=he}},s.unstable_scheduleCallback=function(ae,F,he){var P=s.unstable_now();switch(typeof he=="object"&&he!==null?(he=he.delay,he=typeof he=="number"&&0<he?P+he:P):he=P,ae){case 1:var _e=-1;break;case 2:_e=250;break;case 5:_e=1073741823;break;case 4:_e=1e4;break;default:_e=5e3}return _e=he+_e,ae={id:y++,callback:F,priorityLevel:ae,startTime:he,expirationTime:_e,sortIndex:-1},he>P?(ae.sortIndex=he,r(S,ae),c(g)===null&&ae===c(S)&&(V?(pe(Q),Q=-1):V=!0,De($,he-P))):(ae.sortIndex=_e,r(g,ae),z||E||(z=!0,H||(H=!0,Z()))),ae},s.unstable_shouldYield=G,s.unstable_wrapCallback=function(ae){var F=x;return function(){var he=x;x=F;try{return ae.apply(this,arguments)}finally{x=he}}}})(fd)),fd}var xy;function Vx(){return xy||(xy=1,ud.exports=$x()),ud.exports}var dd={exports:{}},mn={};/**
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 Sy;function Qx(){if(Sy)return mn;Sy=1;var s=qd();function r(y){var v="https://react.dev/errors/"+y;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)v+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+y+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(){}var u={d:{f:c,r:function(){throw Error(r(522))},D:c,C:c,L:c,m:c,X:c,S:c,M:c},p:0,findDOMNode:null},f=Symbol.for("react.portal"),h=Symbol.for("react.recoverable"),m=Symbol.for("react.optimistic_key");function b(y,v,x){var E=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:E==null?null:E===m?m:""+E,children:y,containerInfo:v,implementation:x}}var g=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function S(y,v){if(y==="font")return"";if(typeof v=="string")return v==="use-credentials"?v:""}return mn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,mn.browser=function(y){return{$$typeof:h,_reason:y}},mn.createPortal=function(y,v){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)throw Error(r(299));return b(y,v,null,x)},mn.flushSync=function(y){var v=g.T,x=u.p;try{if(g.T=null,u.p=2,y)return y()}finally{g.T=v,u.p=x,u.d.f()}},mn.preconnect=function(y,v){typeof y=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,u.d.C(y,v))},mn.prefetchDNS=function(y){typeof y=="string"&&u.d.D(y)},mn.preinit=function(y,v){if(typeof y=="string"&&v&&typeof v.as=="string"){var x=v.as,E=S(x,v.crossOrigin),z=typeof v.integrity=="string"?v.integrity:void 0,V=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;x==="style"?u.d.S(y,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:E,integrity:z,fetchPriority:V}):x==="script"&&u.d.X(y,{crossOrigin:E,integrity:z,fetchPriority:V,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},mn.preinitModule=function(y,v){if(typeof y=="string")if(typeof v=="object"&&v!==null){if(v.as==null||v.as==="script"){var x=S(v.as,v.crossOrigin);u.d.M(y,{crossOrigin:x,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0})}}else v==null&&u.d.M(y)},mn.preload=function(y,v){if(typeof y=="string"&&typeof v=="object"&&v!==null&&typeof v.as=="string"){var x=v.as,E=S(x,v.crossOrigin);u.d.L(y,x,{crossOrigin:E,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,type:typeof v.type=="string"?v.type:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0,referrerPolicy:typeof v.referrerPolicy=="string"?v.referrerPolicy:void 0,imageSrcSet:typeof v.imageSrcSet=="string"?v.imageSrcSet:void 0,imageSizes:typeof v.imageSizes=="string"?v.imageSizes:void 0,media:typeof v.media=="string"?v.media:void 0})}},mn.preloadModule=function(y,v){if(typeof y=="string")if(v){var x=S(v.as,v.crossOrigin);u.d.m(y,{as:typeof v.as=="string"&&v.as!=="script"?v.as:void 0,crossOrigin:x,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0})}else u.d.m(y)},mn.requestFormReset=function(y){u.d.r(y)},mn.unstable_batchedUpdates=function(y,v){return y(v)},mn.useFormState=function(y,v,x){return g.H.useFormState(y,v,x)},mn.useFormStatus=function(){return g.H.useHostTransitionStatus()},mn.version="19.3.0",mn}var wy;function Zx(){if(wy)return dd.exports;wy=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(r){console.error(r)}}return s(),dd.exports=Qx(),dd.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 Ny;function Kx(){if(Ny)return rr;Ny=1;var s=Vx(),r=qd(),c=Zx();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function h(e){for(var t=e,n=t;n&&!n.alternate;)t=n,(t.flags&4098)!==0&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function m(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function b(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(h(e)!==e)throw Error(u(188))}function S(e){var t=e.alternate;if(!t){if(t=h(e),t===null)throw Error(u(188));return t!==e?null:e}for(var n=e,a=t;;){var l=n.return;if(l===null)break;var o=l.alternate;if(o===null){if(a=l.return,a!==null){n=a;continue}break}if(l.child===o.child){for(o=l.child;o;){if(o===n)return g(l),e;if(o===a)return g(l),t;o=o.sibling}throw Error(u(188))}if(n.return!==a.return)n=l,a=o;else{for(var d=!1,p=l.child;p;){if(p===n){d=!0,n=l,a=o;break}if(p===a){d=!0,a=l,n=o;break}p=p.sibling}if(!d){for(p=o.child;p;){if(p===n){d=!0,n=o,a=l;break}if(p===a){d=!0,a=o,n=l;break}p=p.sibling}if(!d)throw Error(u(189))}}if(n.alternate!==a)throw Error(u(190))}if(n.tag!==3)throw Error(u(188));return n.stateNode.current===n?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}function v(e,t,n,a,l,o){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,a,l,o)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&v(e.child,t,n,a,l,o))return!0;e=e.sibling}return!1}function x(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function E(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function z(e){var t=[null,null],n=x(e);return n===null||V(t,e,n.child,{foundSelf:!1}),t}function V(e,t,n,a){for(;n!==null;){if(n===t)a.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(a.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&V(e,t,n.child,a))return!0;n=n.sibling}return!1}function L(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(u(559))}}var ne=null,pe=null;function ce(e,t,n){return e===n?!0:e===t?(ne=e,!0):!1}function _(e,t,n){return e===n?(pe=e,!1):e===t?(pe!==null&&(ne=e),!0):!1}function $(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function H(e,t,n){for(var a=0,l=e;l;l=n(l))a++;l=0;for(var o=t;o;o=n(o))l++;for(;0<a-l;)e=n(e),a--;for(;0<l-a;)t=n(t),l--;for(;a--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var Q=Object.assign,W=Symbol.for("react.element"),re=Symbol.for("react.transitional.element"),G=Symbol.for("react.portal"),K=Symbol.for("react.fragment"),Z=Symbol.for("react.strict_mode"),de=Symbol.for("react.profiler"),oe=Symbol.for("react.consumer"),De=Symbol.for("react.context"),ae=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),he=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),_e=Symbol.for("react.lazy"),ot=Symbol.for("react.activity"),ht=Symbol.for("react.legacy_hidden"),mt=Symbol.for("react.memo_cache_sentinel"),T=Symbol.for("react.view_transition"),te=Symbol.for("react.recoverable"),xe=Symbol.iterator;function Se(e){return e===null||typeof e!="object"?null:(e=xe&&e[xe]||e["@@iterator"],typeof e=="function"?e:null)}var He=Symbol.for("react.client.reference");function Ue(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===He?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case K:return"Fragment";case de:return"Profiler";case Z:return"StrictMode";case F:return"Suspense";case he:return"SuspenseList";case ot:return"Activity";case T:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case G:return"Portal";case De:return e.displayName||"Context";case oe:return(e._context.displayName||"Context")+".Consumer";case ae:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case P:return t=e.displayName||null,t!==null?t:Ue(e.type)||"Memo";case _e:t=e._payload,e=e._init;try{return Ue(e(t))}catch{}}return null}var je=Array.isArray,fe=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,we=c.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,pt={pending:!1,data:null,method:null,action:null},q=[],Re=-1;function Ae(e){return{current:e}}function Be(e){0>Re||(e.current=q[Re],q[Re]=null,Re--)}function Oe(e,t){Re++,q[Re]=e.current,e.current=t}var se=Ae(null),be=Ae(null),C=Ae(null),me=Ae(null);function Me(e,t){switch(Oe(C,t),Oe(be,e),Oe(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Sg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Sg(t),e=wg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Be(se),Oe(se,e)}function lt(){Be(se),Be(be),Be(C)}function gt(e){var t=e.memoizedState;t!==null&&(li._currentValue=t.memoizedState,Oe(me,e)),t=se.current;var n=wg(t,e.type);t!==n&&(Oe(be,e),Oe(se,n))}function Dt(e){be.current===e&&(Be(se),Be(be)),me.current===e&&(Be(me),li._currentValue=pt)}var Ke,ut;function Fe(e){if(Ke===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ke=t&&t[1]||"",ut=-1<n.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+Ke+e+ut}var yn=!1;function Fn(e,t){if(!e||yn)return"";yn=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var J=function(){throw Error()};if(Object.defineProperty(J.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(J,[])}catch(ye){var D=ye}Reflect.construct(e,[],J)}else{try{J.call()}catch(ye){D=ye}J=!1;try{var B=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),J=!0,new e}finally{J&&(B!==void 0?Object.defineProperty(e.prototype,"props",B):delete e.prototype.props)}}}else{try{throw Error()}catch(ye){D=ye}(J=e())&&typeof J.catch=="function"&&J.catch(function(){})}}catch(ye){if(ye&&D&&typeof ye.stack=="string")return[ye.stack,D.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var l=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");l&&l.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=a.DetermineComponentFrameRoot(),d=o[0],p=o[1];if(d&&p){var j=d.split(`
44
- `),R=p.split(`
45
- `);for(l=a=0;a<j.length&&!j[a].includes("DetermineComponentFrameRoot");)a++;for(;l<R.length&&!R[l].includes("DetermineComponentFrameRoot");)l++;if(a===j.length||l===R.length)for(a=j.length-1,l=R.length-1;1<=a&&0<=l&&j[a]!==R[l];)l--;for(;1<=a&&0<=l;a--,l--)if(j[a]!==R[l]){if(a!==1||l!==1)do if(a--,l--,0>l||j[a]!==R[l]){var Y=`
46
- `+j[a].replace(" at new "," at ");return e.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",e.displayName)),Y}while(1<=a&&0<=l);break}}}finally{yn=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Fe(n):""}function La(e,t){switch(e.tag){case 26:case 27:case 5:return Fe(e.type);case 16:return Fe("Lazy");case 13:return e.child!==t&&t!==null?Fe("Suspense Fallback"):Fe("Suspense");case 19:return Fe("SuspenseList");case 0:case 15:return Fn(e.type,!1);case 11:return Fn(e.type.render,!1);case 1:return Fn(e.type,!0);case 31:return Fe("Activity");case 30:return Fe("ViewTransition");default:return""}}function $t(e){try{var t="",n=null;do t+=La(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
47
- Error generating stack: `+a.message+`
48
- `+a.stack}}var Ut=Object.prototype.hasOwnProperty,Yt=s.unstable_scheduleCallback,X=s.unstable_cancelCallback,ge=s.unstable_shouldYield,Ne=s.unstable_requestPaint,Ee=s.unstable_now,Ge=s.unstable_getCurrentPriorityLevel,Pe=s.unstable_ImmediatePriority,st=s.unstable_UserBlockingPriority,vn=s.unstable_NormalPriority,tn=s.unstable_LowPriority,ua=s.unstable_IdlePriority,sl=s.log,xs=s.unstable_setDisableYieldValue,Un=null,Rt=null;function Lt(e){if(typeof sl=="function"&&xs(e),Rt&&typeof Rt.setStrictMode=="function")try{Rt.setStrictMode(Un,e)}catch{}}var Mt=Math.clz32?Math.clz32:ee,il=Math.log,k=Math.LN2;function ee(e){return e>>>=0,e===0?32:31-(il(e)/k|0)|0}var ve=256,Te=262144,Ze=4194304;function Ie(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function bn(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var l=0,o=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var p=a&134217727;return p!==0?(a=p&~o,a!==0?l=Ie(a):(d&=p,d!==0?l=Ie(d):n||(n=p&~e,n!==0&&(l=Ie(n))))):(p=a&~o,p!==0?l=Ie(p):d!==0?l=Ie(d):n||(n=a&~e,n!==0&&(l=Ie(n)))),l===0?0:t!==0&&t!==l&&(t&o)===0&&(o=l&-l,n=t&-t,o>=n||o===32&&(n&4194048)!==0)?t:l}function Et(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function nn(e,t){(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var a=31-Mt(n),l=1<<a;t|=e[a],n&=~l}return t}function wa(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 wt(){var e=Ze;return Ze<<=1,(Ze&62914560)===0&&(Ze=4194304),e}function An(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Pn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ss(e,t,n,a,l,o){var d=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var p=e.entanglements,j=e.expirationTimes,R=e.hiddenUpdates;for(n=d&~n;0<n;){var Y=31-Mt(n),J=1<<Y;p[Y]=0,j[Y]=-1;var D=R[Y];if(D!==null)for(R[Y]=null,Y=0;Y<D.length;Y++){var B=D[Y];B!==null&&(B.lane&=-536870913)}n&=~J}a!==0&&fa(e,a,0),o!==0&&l===0&&e.tag!==0&&(e.suspendedLanes|=o&~(d&~t))}function fa(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-Mt(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function Ha(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-Mt(n),l=1<<a;l&t|e[a]&t&&(e[a]|=t),n&=~l}}function Gl(e,t){var n=t&-t;return n=(n&42)!==0?1:rl(n),(n&(e.suspendedLanes|t))!==0?0:n}function rl(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ol(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function cl(){var e=we.p;return e!==0?e:(e=window.event,e===void 0?32:sy(e.type))}function Dr(e,t){var n=we.p;try{return we.p=e,t()}finally{we.p=n}}var an=Math.random().toString(36).slice(2),Vt="__reactFiber$"+an,Pt="__reactProps$"+an,_n="__reactContainer$"+an,Or="__reactEvents$"+an,ws="__reactListeners$"+an,Rr="__reactHandles$"+an,Mr="__reactResources$"+an,ul="__reactMarker$"+an,$l="__reactLoad$"+an;function Ba(e){delete e[Vt],delete e[Pt],delete e[ws],delete e[Rr]}function da(e){var t;if(t=e[Vt])return t;for(var n=e.parentNode;n;){if(t=n[_n]||n[Vt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Bg(e);e!==null;){if(n=e[Vt])return n;e=Bg(e)}return t}e=n,n=e.parentNode}return null}function ha(e){if(e=e[Vt]||e[_n]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Wn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function ea(e){var t=e[Mr];return t||(t=e[Mr]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function yt(e){e[ul]=!0}function zr(e){e[$l]=void 0}var Vl=new Set,Ur={};function Na(e,t){Ln(e,t),Ln(e+"Capture",t)}function Ln(e,t){for(Ur[e]=t,e=0;e<t.length;e++)Vl.add(t[e])}var Lr=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]*$"),yi={},Hr={};function Br(e){return Ut.call(Hr,e)?!0:Ut.call(yi,e)?!1:Lr.test(e)?Hr[e]=!0:(yi[e]=!0,!1)}var it=!1;function qr(){var e=it;return it=!1,e}function Ql(e,t,n){if(Br(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,n)}}function qa(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,n)}}function Hn(e,t,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,a)}}function le(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function w(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function M(e,t,n){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var l=a.get,o=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(d){n=""+d,o.call(this,d)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(d){n=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ie(e){if(!e._valueTracker){var t=w(e)?"checked":"value";e._valueTracker=M(e,t,""+e[t])}}function ue(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=w(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}var Le=/[\n"\\]/g;function qe(e){return e.replace(Le,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function We(e,t,n,a,l,o,d,p){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+le(t)):e.value!==""+le(t)&&(e.value=""+le(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?d==="number"&&e.value==t?xn(e,le(e.value)):xn(e,le(t)):n!=null?xn(e,le(n)):a!=null&&e.removeAttribute("value"),l==null&&o!=null&&(e.defaultChecked=!!o),l!=null&&(e.checked=l&&typeof l!="function"&&typeof l!="symbol"),p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.name=""+le(p):e.removeAttribute("name")}function _t(e,t,n,a,l,o,d,p){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||n!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){ie(e);return}n=n!=null?""+le(n):"",t=t!=null?""+le(t):n,p||t===e.value||(e.value=t),e.defaultValue=t}a=a??l,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=p?e.checked:!!a,e.defaultChecked=!!a,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),ie(e)}function xn(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function Qt(e,t,n,a){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&a&&(e[n].defaultSelected=!0)}else{for(n=""+le(n),t=null,l=0;l<e.length;l++){if(e[l].value===n){e[l].selected=!0,a&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function Ya(e,t,n){if(t!=null&&(t=""+le(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+le(n):""}function Ns(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(u(92));if(je(a)){if(1<a.length)throw Error(u(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=le(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),ie(e)}function Ht(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Yr=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 hh(e,t,n){var a=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,n):typeof n!="number"||n===0||Yr.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function mh(e,t,n){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="",it=!0);for(var l in t)a=t[l],t.hasOwnProperty(l)&&n[l]!==a&&(hh(e,l,a),it=!0)}else for(var o in t)t.hasOwnProperty(o)&&hh(e,o,t[o])}function Bc(e){if(e.indexOf("-")===-1)return!1;switch(e){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 i0=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"],["maskType","mask-type"],["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"]]),r0=/^[\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 Xr(e){return r0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ja(){}var qc=null;function Yc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var js=null,Ts=null;function ph(e){var t=ha(e);if(t&&(e=t.stateNode)){var n=e[Pt]||null;e:switch(e=t.stateNode,t.type){case"input":if(We(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+qe(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var l=a[Pt]||null;if(!l)throw Error(u(90));We(a,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&ue(a)}break e;case"textarea":Ya(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Qt(e,!!n.multiple,t,!1)}}}var Xc=!1;function gh(e,t,n){if(Xc)return e(t,n);Xc=!0;try{var a=e(t);return a}finally{if(Xc=!1,(js!==null||Ts!==null)&&(Go(),js&&(t=js,e=Ts,Ts=js=null,ph(t),e)))for(t=0;t<e.length;t++)ph(e[t])}}function vi(e,t){var n=e.stateNode;if(n===null)return null;var a=n[Pt]||null;if(a===null)return null;n=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(u(231,t,typeof n));return n}var Xa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Gc=!1;if(Xa)try{var bi={};Object.defineProperty(bi,"passive",{get:function(){Gc=!0}}),window.addEventListener("test",bi,bi),window.removeEventListener("test",bi,bi)}catch{Gc=!1}var fl=null,$c=null,Gr=null;function yh(){if(Gr)return Gr;var e,t=$c,n=t.length,a,l="value"in fl?fl.value:fl.textContent,o=l.length;for(e=0;e<n&&t[e]===l[e];e++);var d=n-e;for(a=1;a<=d&&t[n-a]===l[o-a];a++);return Gr=l.slice(e,1<a?1-a:void 0)}function $r(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Vr(){return!0}function vh(){return!1}function Nn(e){function t(n,a,l,o,d){this._reactName=n,this._targetInst=l,this.type=a,this.nativeEvent=o,this.target=d,this.currentTarget=null;for(var p in e)e.hasOwnProperty(p)&&(n=e[p],this[p]=n?n(o):o[p]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Vr:vh,this.isPropagationStopped=vh,this}return Q(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Vr)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Vr)},persist:function(){},isPersistent:Vr}),t}var dl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qr=Nn(dl),xi=Q({},dl,{view:0,detail:0}),o0=Nn(xi),Vc,Qc,Si,Zr=Q({},xi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kc,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Si&&(Si&&e.type==="mousemove"?(Vc=e.screenX-Si.screenX,Qc=e.screenY-Si.screenY):Qc=Vc=0,Si=e),Vc)},movementY:function(e){return"movementY"in e?e.movementY:Qc}}),bh=Nn(Zr),c0=Q({},Zr,{dataTransfer:0}),u0=Nn(c0),f0=Q({},xi,{relatedTarget:0}),Zc=Nn(f0),d0=Q({},dl,{animationName:0,elapsedTime:0,pseudoElement:0}),h0=Nn(d0),m0=Q({},dl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),p0=Nn(m0),g0=Q({},dl,{data:0}),xh=Nn(g0),y0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},v0={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"},b0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function x0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=b0[e])?!!t[e]:!1}function Kc(){return x0}var S0=Q({},xi,{key:function(e){if(e.key){var t=y0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=$r(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?v0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kc,charCode:function(e){return e.type==="keypress"?$r(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?$r(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),w0=Nn(S0),N0=Q({},Zr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sh=Nn(N0),j0=Q({},dl,{submitter:0}),T0=Nn(j0),E0=Q({},xi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kc}),k0=Nn(E0),A0=Q({},dl,{propertyName:0,elapsedTime:0,pseudoElement:0}),_0=Nn(A0),C0=Q({},Zr,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),D0=Nn(C0),O0=Q({},dl,{newState:0,oldState:0,source:0}),R0=Nn(O0),M0=[9,13,27,32],Ic=Xa&&"CompositionEvent"in window,wi=null;Xa&&"documentMode"in document&&(wi=document.documentMode);var z0=Xa&&"TextEvent"in window&&!wi,wh=Xa&&(!Ic||wi&&8<wi&&11>=wi),Nh=" ",jh=!1;function Th(e,t){switch(e){case"keyup":return M0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Eh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Es=!1;function U0(e,t){switch(e){case"compositionend":return Eh(t);case"keypress":return t.which!==32?null:(jh=!0,Nh);case"textInput":return e=t.data,e===Nh&&jh?null:e;default:return null}}function L0(e,t){if(Es)return e==="compositionend"||!Ic&&Th(e,t)?(e=yh(),Gr=$c=fl=null,Es=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return wh&&t.locale!=="ko"?null:t.data;default:return null}}var H0={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 kh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!H0[e.type]:t==="textarea"}function Ah(e,t,n,a){js?Ts?Ts.push(a):Ts=[a]:js=a,t=Io(t,"onChange"),0<t.length&&(n=new Qr("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var Ni=null,ji=null;function B0(e){pg(e,0)}function Kr(e){var t=Wn(e);if(ue(t))return e}function _h(e,t){if(e==="change")return t}var Ch=!1;if(Xa){var Jc;if(Xa){var Fc="oninput"in document;if(!Fc){var Dh=document.createElement("div");Dh.setAttribute("oninput","return;"),Fc=typeof Dh.oninput=="function"}Jc=Fc}else Jc=!1;Ch=Jc&&(!document.documentMode||9<document.documentMode)}function Oh(){Ni&&(Ni.detachEvent("onpropertychange",Rh),ji=Ni=null)}function Rh(e){if(e.propertyName==="value"&&Kr(ji)){var t=[];Ah(t,ji,e,Yc(e)),gh(B0,t)}}function q0(e,t,n){e==="focusin"?(Oh(),Ni=t,ji=n,Ni.attachEvent("onpropertychange",Rh)):e==="focusout"&&Oh()}function Y0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Kr(ji)}function X0(e,t){if(e==="click")return Kr(t)}function G0(e,t){if(e==="input"||e==="change")return Kr(t)}function $0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Bn=typeof Object.is=="function"?Object.is:$0;function Ti(e,t){if(Bn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var l=n[a];if(!Ut.call(t,l)||!Bn(e[l],t[l]))return!1}return!0}function Pc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Mh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function zh(e,t){var n=Mh(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Mh(n)}}function Uh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Uh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Lh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Pc(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Pc(e.document)}return t}function Wc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var V0=Xa&&"documentMode"in document&&11>=document.documentMode,ks=null,eu=null,Ei=null,tu=!1;function Hh(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;tu||ks==null||ks!==Pc(a)||(a=ks,"selectionStart"in a&&Wc(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Ei&&Ti(Ei,a)||(Ei=a,a=Io(eu,"onSelect"),0<a.length&&(t=new Qr("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=ks)))}function Zl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var As={animationend:Zl("Animation","AnimationEnd"),animationiteration:Zl("Animation","AnimationIteration"),animationstart:Zl("Animation","AnimationStart"),transitionrun:Zl("Transition","TransitionRun"),transitionstart:Zl("Transition","TransitionStart"),transitioncancel:Zl("Transition","TransitionCancel"),transitionend:Zl("Transition","TransitionEnd")},nu={},Bh={};Xa&&(Bh=document.createElement("div").style,"AnimationEvent"in window||(delete As.animationend.animation,delete As.animationiteration.animation,delete As.animationstart.animation),"TransitionEvent"in window||delete As.transitionend.transition);function Kl(e){if(nu[e])return nu[e];if(!As[e])return e;var t=As[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Bh)return nu[e]=t[n];return e}var qh=Kl("animationend"),Yh=Kl("animationiteration"),Xh=Kl("animationstart"),Q0=Kl("transitionrun"),Z0=Kl("transitionstart"),K0=Kl("transitioncancel"),Gh=Kl("transitionend"),$h=new Map,au="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");au.push("scrollEnd");function ma(e,t){$h.set(e,t),Na(t,[e])}var I0=0;function Ga(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=va.identifierPrefix;var n=I0++;return e="_"+e+"t_"+n.toString(32)+"_",t.autoName=e}function Vh(e){if(e==null||typeof e=="string")return e;var t=null,n=Ks;if(n!==null)for(var a=0;a<n.length;a++){var l=e[n[a]];if(l!=null){if(l==="none")return"none";t=t==null?l:t+(" "+l)}}return t??e.default}function $a(e,t){return e=Vh(e),t=Vh(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var Ir=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},ta=[],_s=0,lu=0;function Jr(){for(var e=_s,t=lu=_s=0;t<e;){var n=ta[t];ta[t++]=null;var a=ta[t];ta[t++]=null;var l=ta[t];ta[t++]=null;var o=ta[t];if(ta[t++]=null,a!==null&&l!==null){var d=a.pending;d===null?l.next=l:(l.next=d.next,d.next=l),a.pending=l}o!==0&&Qh(n,l,o)}}function Fr(e,t,n,a){ta[_s++]=e,ta[_s++]=t,ta[_s++]=n,ta[_s++]=a,lu|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function su(e,t,n,a){return Fr(e,t,n,a),Pr(e)}function Il(e,t){return Fr(e,null,null,t),Pr(e)}function Qh(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var l=!1,o=e.return;o!==null;)o.childLanes|=n,a=o.alternate,a!==null&&(a.childLanes|=n),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(l=!0)),e=o,o=o.return;return e.tag===3?(o=e.stateNode,l&&t!==null&&(l=31-Mt(n),e=o.hiddenUpdates,a=e[l],a===null?e[l]=[t]:a.push(t),t.lane=n|536870912),o):null}function Pr(e){if(50<Ki)throw Ki=0,Xo=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Cs={};function J0(e,t,n,a){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Cn(e,t,n,a){return new J0(e,t,n,a)}function iu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Va(e,t){var n=e.alternate;return n===null?(n=Cn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Zh(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Wr(e,t,n,a,l,o){var d=0;if(a=e,typeof a=="function")iu(a)&&(d=1);else if(typeof a=="string")d=jx(e,n,se.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(a){case ot:return e=Cn(31,n,t,l),e.elementType=ot,e.lanes=o,e;case K:return Jl(n.children,l,o,t);case Z:d=8,l|=24;break;case de:return e=Cn(12,n,t,l|2),e.elementType=de,e.lanes=o,e;case F:return e=Cn(13,n,t,l),e.elementType=F,e.lanes=o,e;case he:return e=Cn(19,n,t,l),e.elementType=he,e.lanes=o,e;case ht:case T:return e=l|32,e=Cn(30,n,t,e),e.elementType=T,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case De:d=10;break e;case oe:d=9;break e;case ae:d=11;break e;case P:d=14;break e;case _e:d=16,a=null;break e}d=29,n=Error(u(130,e===null?"null":typeof e,"")),a=null}return t=Cn(d,n,t,l),t.elementType=e,t.type=a,t.lanes=o,t}function Jl(e,t,n,a){return e=Cn(7,e,a,t),e.lanes=n,e}function ru(e,t,n){return e=Cn(6,e,null,t),e.lanes=n,e}function Kh(e){var t=Cn(18,null,null,0);return t.stateNode=e,t}function ou(e,t,n){return t=Cn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ih=new WeakMap;function na(e,t){if(typeof e=="object"&&e!==null){var n=Ih.get(e);return n!==void 0?n:(t={value:e,source:t,stack:$t(t)},Ih.set(e,t),t)}return{value:e,source:t,stack:$t(t)}}var Ds=[],Os=0,eo=null,ki=0,aa=[],la=0,hl=null,Ta=1,Ea="";function Qa(e,t){Ds[Os++]=ki,Ds[Os++]=eo,eo=e,ki=t}function Jh(e,t,n){aa[la++]=Ta,aa[la++]=Ea,aa[la++]=hl,hl=e;var a=Ta;e=Ea;var l=32-Mt(a)-1;a&=~(1<<l),n+=1;var o=32-Mt(t)+l;if(30<o){var d=l-l%5;o=(a&(1<<d)-1).toString(32),a>>=d,l-=d,Ta=1<<32-Mt(t)+l|n<<l|a,Ea=o+e}else Ta=1<<o|n<<l|a,Ea=e}function to(e){e.return!==null&&(Qa(e,1),Jh(e,1,0))}function cu(e){for(;e===eo;)eo=Ds[--Os],Ds[Os]=null,ki=Ds[--Os],Ds[Os]=null;for(;e===hl;)hl=aa[--la],aa[la]=null,Ea=aa[--la],aa[la]=null,Ta=aa[--la],aa[la]=null}function Fh(e,t){aa[la++]=Ta,aa[la++]=Ea,aa[la++]=hl,Ta=t.id,Ea=t.overflow,hl=e}var ln=null,kt=null,Je=!1,ml=null,sa=!1,uu=Error(u(519));function pl(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ai(na(t,e)),uu}function Ph(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[Vt]=e,t[Pt]=a,n){case"dialog":tt("cancel",t),tt("close",t);break;case"iframe":case"object":case"embed":tt("load",t);break;case"video":case"audio":for(n=0;n<Ji.length;n++)tt(Ji[n],t);break;case"source":tt("error",t);break;case"img":case"image":case"link":tt("error",t),tt("load",t);break;case"details":tt("toggle",t);break;case"input":tt("invalid",t),_t(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":tt("invalid",t);break;case"textarea":tt("invalid",t),Ns(t,a.value,a.defaultValue,a.children)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||bg(t.textContent,n)?(a.popover!=null&&(tt("beforetoggle",t),tt("toggle",t)),a.onScroll!=null&&tt("scroll",t),a.onScrollEnd!=null&&tt("scrollend",t),a.onClick!=null&&(t.onclick=ja),t=!0):t=!1,t||pl(e,!0)}function no(e){for(ln=e.return;ln;)switch(ln.tag){case 5:case 31:case 13:sa=!1;return;case 27:case 3:sa=!0;return;default:ln=ln.return}}function Rs(e){if(e!==ln)return!1;if(!Je)return no(e),Je=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Yf(e.type,e.memoizedProps)),n=!n),n&&kt&&pl(e),no(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));kt=Hg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));kt=Hg(e)}else t===27?(t=kt,Dl(e.type)?(e=Jf,Jf=null,kt=e):kt=t):kt=ln?ra(e.stateNode.nextSibling):null;return!0}function Fl(){kt=ln=null,Je=!1}function fu(){var e=ml;return e!==null&&(Rn===null?Rn=e:Rn.push.apply(Rn,e),ml=null),e}function Ai(e){ml===null?ml=[e]:ml.push(e)}var du=Ae(null),Pl=null,Za=null;function gl(e,t,n){Oe(du,t._currentValue),t._currentValue=n}function Ka(e){e._currentValue=du.current,Be(du)}function ao(e,t,n){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===n)break;e=e.return}}function hu(e,t,n,a){var l=e.child;for(l!==null&&(l.return=e);l!==null;){var o=l.dependencies;if(o!==null){var d=l.child;o=o.firstContext;e:for(;o!==null;){var p=o;o=l;for(var j=0;j<t.length;j++)if(p.context===t[j]){o.lanes|=n,p=o.alternate,p!==null&&(p.lanes|=n),ao(o.return,n,e),a||(d=null);break e}o=p.next}}else if(l.tag===18){if(d=l.return,d===null)throw Error(u(341));d.lanes|=n,o=d.alternate,o!==null&&(o.lanes|=n),ao(d,n,e),d=null}else l.tag===13&&l.memoizedState!==null&&l.memoizedState.dehydrated===null?(l.lanes|=n,d=l.alternate,d!==null&&(d.lanes|=n),ao(l.return,n,e),d=l.child,d=d!==null?d.sibling:null):d=l.child;if(d!==null)d.return=l;else for(d=l;d!==null;){if(d===e){d=null;break}if(l=d.sibling,l!==null){l.return=d.return,d=l;break}d=d.return}l=d}}function Wl(e,t,n,a){e=null;for(var l=t,o=!1;l!==null;){if(!o){if((l.flags&524288)!==0)o=!0;else if((l.flags&262144)!==0)break}if(l.tag===10){var d=l.alternate;if(d===null)throw Error(u(387));if(d=d.memoizedProps,d!==null){var p=l.type;Bn(l.pendingProps.value,d.value)||(e!==null?e.push(p):e=[p])}}else if(l===me.current){if(d=l.alternate,d===null)throw Error(u(387));d.memoizedState.memoizedState!==l.memoizedState.memoizedState&&(e!==null?e.push(li):e=[li])}l=l.return}return e!==null&&hu(t,e,n,a),t.flags|=262144,e!==null}function lo(e){for(e=e.firstContext;e!==null;){if(!Bn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function es(e){Pl=e,Za=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function cn(e){return Wh(Pl,e)}function so(e,t){return Pl===null&&es(e),Wh(e,t)}function Wh(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Za===null){if(e===null)throw Error(u(308));Za=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Za=Za.next=t;return n}var F0=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},P0=s.unstable_scheduleCallback,W0=s.unstable_NormalPriority,Zt={$$typeof:De,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function mu(){return{controller:new F0,data:new Map,refCount:0}}function _i(e){e.refCount--,e.refCount===0&&P0(W0,function(){e.controller.abort()})}function em(e,t){if((e.pendingLanes&4194048)!==0){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var a=t[e];n.indexOf(a)===-1&&n.push(a)}}}var Ci=null;function eb(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Di=null,pu=0,ts=0,Ms=null;function tb(e,t){if(Di===null){var n=Di=[];pu=0,ts=Of(),Ms={status:"pending",value:void 0,then:function(a){n.push(a)}}}return pu++,t.then(tm,tm),t}function tm(){if(--pu===0&&(Ci=null,Di!==null)){Ms!==null&&(Ms.status="fulfilled");var e=Di;Di=null,ts=0,Ms=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function nb(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(l){n.push(l)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var l=0;l<n.length;l++)(0,n[l])(t)},function(l){for(a.status="rejected",a.reason=l,l=0;l<n.length;l++)(0,n[l])(void 0)}),a}var nm=fe.S;fe.S=function(e,t){if(Kp=Ee(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&tb(e,t),Ci!==null)for(var n=Ps;n!==null;)em(n,Ci),n=n.next;if(n=e.types,n!==null){for(var a=Ps;a!==null;)em(a,n),a=a.next;if(ts!==0){a=Ci,a===null&&(a=Ci=[]);for(var l=0;l<n.length;l++){var o=n[l];a.indexOf(o)===-1&&a.push(o)}}}nm!==null&&nm(e,t)};var ns=Ae(null);function gu(){var e=ns.current;return e!==null?e:Tt.pooledCache}function io(e,t){t===null?Oe(ns,ns.current):Oe(ns,t.pool)}function am(){var e=gu();return e===null?null:{parent:Zt._currentValue,pool:e}}var zs=Error(u(460)),yu=Error(u(474)),ro=Error(u(542)),oo={then:function(){}};function lm(e){return e=e.status,e==="fulfilled"||e==="rejected"}function sm(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(ja,ja),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,rm(e),e===void 0&&!("reason"in t)?Error(u(600)):e;default:if(typeof t.status=="string")t.then(ja,ja);else{if(e=Tt,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var l=t;l.status="fulfilled",l.value=a}},function(a){if(t.status==="pending"){var l=t;l.status="rejected",l.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,rm(e),e}throw ls=t,zs}}function as(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(ls=n,zs):n}}var ls=null;function im(){if(ls===null)throw Error(u(459));var e=ls;return ls=null,e}function rm(e){if(e===zs||e===ro)throw Error(u(483))}var Us=null,Oi=0;function co(e){var t=Oi;return Oi+=1,Us===null&&(Us=[]),sm(Us,e,t)}function yl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function uo(e,t){throw t.$$typeof===W?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function om(e){function t(O,A){if(e){var U=O.deletions;U===null?(O.deletions=[A],O.flags|=16):U.push(A)}}function n(O,A){if(!e)return null;for(;A!==null;)t(O,A),A=A.sibling;return null}function a(O){for(var A=new Map;O!==null;)O.key===null?A.set(O.index,O):A.set(O.key,O),O=O.sibling;return A}function l(O,A){return O=Va(O,A),O.index=0,O.sibling=null,O}function o(O,A,U){return O.index=U,e?(U=O.alternate,U!==null?(U=U.index,U<A?(O.flags|=2,A):U):(O.flags|=134217730,A)):(O.flags|=1048576,A)}function d(O){return e&&O.alternate===null&&(O.flags|=134217730),O}function p(O,A,U,I){return A===null||A.tag!==6?(A=ru(U,O.mode,I),A.return=O,A):(A=l(A,U),A.return=O,A)}function j(O,A,U,I){var ke=U.type;return ke===K?(O=Y(O,A,U.props.children,I,U.key),yl(O,U),O):A!==null&&(A.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===_e&&as(ke)===A.type)?(A=l(A,U.props),yl(A,U),A.return=O,A):(A=Wr(U.type,U.key,U.props,null,O.mode,I),yl(A,U),A.return=O,A)}function R(O,A,U,I){return A===null||A.tag!==4||A.stateNode.containerInfo!==U.containerInfo||A.stateNode.implementation!==U.implementation?(A=ou(U,O.mode,I),A.return=O,A):(A=l(A,U.children||[]),A.return=O,A)}function Y(O,A,U,I,ke){return A===null||A.tag!==7?(A=Jl(U,O.mode,I,ke),A.return=O,A):(A=l(A,U),A.return=O,A)}function J(O,A,U){if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return A=ru(""+A,O.mode,U),A.return=O,A;if(typeof A=="object"&&A!==null){switch(A.$$typeof){case re:return U=Wr(A.type,A.key,A.props,null,O.mode,U),yl(U,A),U.return=O,U;case G:return A=ou(A,O.mode,U),A.return=O,A;case _e:return A=as(A),J(O,A,U)}if(je(A)||Se(A))return A=Jl(A,O.mode,U,null),A.return=O,A;if(typeof A.then=="function")return J(O,co(A),U);if(A.$$typeof===De)return J(O,so(O,A),U);uo(O,A)}return null}function D(O,A,U,I){var ke=A!==null?A.key:null;if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return ke!==null?null:p(O,A,""+U,I);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case re:return U.key===ke?j(O,A,U,I):null;case G:return U.key===ke?R(O,A,U,I):null;case _e:return U=as(U),D(O,A,U,I)}if(je(U)||Se(U))return ke!==null?null:Y(O,A,U,I,null);if(typeof U.then=="function")return D(O,A,co(U),I);if(U.$$typeof===De)return D(O,A,so(O,U),I);uo(O,U)}return null}function B(O,A,U,I,ke){if(typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint")return O=O.get(U)||null,p(A,O,""+I,ke);if(typeof I=="object"&&I!==null){switch(I.$$typeof){case re:return O=O.get(I.key===null?U:I.key)||null,j(A,O,I,ke);case G:return O=O.get(I.key===null?U:I.key)||null,R(A,O,I,ke);case _e:return I=as(I),B(O,A,U,I,ke)}if(je(I)||Se(I))return O=O.get(U)||null,Y(A,O,I,ke,null);if(typeof I.then=="function")return B(O,A,U,co(I),ke);if(I.$$typeof===De)return B(O,A,U,so(A,I),ke);uo(A,I)}return null}function ye(O,A,U,I){for(var ke=null,at=null,ze=A,Ye=A=0,Jt=null;ze!==null&&Ye<U.length;Ye++){ze.index>Ye?(Jt=ze,ze=null):Jt=ze.sibling;var rt=D(O,ze,U[Ye],I);if(rt===null){ze===null&&(ze=Jt);break}e&&ze&&rt.alternate===null&&t(O,ze),A=o(rt,A,Ye),at===null?ke=rt:at.sibling=rt,at=rt,ze=Jt}if(Ye===U.length)return n(O,ze),Je&&Qa(O,Ye),ke;if(ze===null){for(;Ye<U.length;Ye++)ze=J(O,U[Ye],I),ze!==null&&(A=o(ze,A,Ye),at===null?ke=ze:at.sibling=ze,at=ze);return Je&&Qa(O,Ye),ke}for(ze=a(ze);Ye<U.length;Ye++)Jt=B(ze,O,Ye,U[Ye],I),Jt!==null&&(e&&(rt=Jt.alternate,rt!==null&&ze.delete(rt.key===null?Ye:rt.key)),A=o(Jt,A,Ye),at===null?ke=Jt:at.sibling=Jt,at=Jt);return e&&ze.forEach(function(Ul){return t(O,Ul)}),Je&&Qa(O,Ye),ke}function Ce(O,A,U,I){if(U==null)throw Error(u(151));for(var ke=null,at=null,ze=A,Ye=A=0,Jt=null,rt=U.next();ze!==null&&!rt.done;Ye++,rt=U.next()){ze.index>Ye?(Jt=ze,ze=null):Jt=ze.sibling;var Ul=D(O,ze,rt.value,I);if(Ul===null){ze===null&&(ze=Jt);break}e&&ze&&Ul.alternate===null&&t(O,ze),A=o(Ul,A,Ye),at===null?ke=Ul:at.sibling=Ul,at=Ul,ze=Jt}if(rt.done)return n(O,ze),Je&&Qa(O,Ye),ke;if(ze===null){for(;!rt.done;Ye++,rt=U.next())rt=J(O,rt.value,I),rt!==null&&(A=o(rt,A,Ye),at===null?ke=rt:at.sibling=rt,at=rt);return Je&&Qa(O,Ye),ke}for(ze=a(ze);!rt.done;Ye++,rt=U.next())rt=B(ze,O,Ye,rt.value,I),rt!==null&&(e&&(Jt=rt.alternate,Jt!==null&&ze.delete(Jt.key===null?Ye:Jt.key)),A=o(rt,A,Ye),at===null?ke=rt:at.sibling=rt,at=rt);return e&&ze.forEach(function(Ux){return t(O,Ux)}),Je&&Qa(O,Ye),ke}function Ve(O,A,U,I){if(typeof U=="object"&&U!==null&&U.type===K&&U.key===null&&U.props.ref===void 0&&(U=U.props.children),typeof U=="object"&&U!==null){switch(U.$$typeof){case re:e:{for(var ke=U.key;A!==null;){if(A.key===ke){if(ke=U.type,ke===K){if(A.tag===7){n(O,A.sibling),I=l(A,U.props.children),yl(I,U),I.return=O,O=I;break e}}else if(A.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===_e&&as(ke)===A.type){n(O,A.sibling),I=l(A,U.props),yl(I,U),I.return=O,O=I;break e}n(O,A);break}else t(O,A);A=A.sibling}U.type===K?(I=Jl(U.props.children,O.mode,I,U.key),yl(I,U),I.return=O,O=I):(I=Wr(U.type,U.key,U.props,null,O.mode,I),yl(I,U),I.return=O,O=I)}return d(O);case G:e:{for(ke=U.key;A!==null;){if(A.key===ke)if(A.tag===4&&A.stateNode.containerInfo===U.containerInfo&&A.stateNode.implementation===U.implementation){n(O,A.sibling),I=l(A,U.children||[]),I.return=O,O=I;break e}else{n(O,A);break}else t(O,A);A=A.sibling}I=ou(U,O.mode,I),I.return=O,O=I}return d(O);case _e:return U=as(U),Ve(O,A,U,I)}if(je(U))return ye(O,A,U,I);if(Se(U)){if(ke=Se(U),typeof ke!="function")throw Error(u(150));return U=ke.call(U),Ce(O,A,U,I)}if(typeof U.then=="function")return Ve(O,A,co(U),I);if(U.$$typeof===De)return Ve(O,A,so(O,U),I);uo(O,U)}return typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint"?(U=""+U,A!==null&&A.tag===6?(n(O,A.sibling),I=l(A,U),I.return=O,O=I):(n(O,A),I=ru(U,O.mode,I),I.return=O,O=I),d(O)):n(O,A)}return function(O,A,U,I){try{Oi=0;var ke=Ve(O,A,U,I);return Us=null,ke}catch(ze){if(ze===zs||ze===ro)throw ze;var at=Cn(29,ze,null,O.mode);return at.lanes=I,at.return=O,at}finally{}}}var ss=om(!0),cm=om(!1),vl=!1;function vu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function bu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function bl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function xl(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(ft&2)!==0){var l=a.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),a.pending=t,t=Pr(e),Qh(e,null,n),t}return Fr(e,a,t,n),Pr(e)}function Ri(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Ha(e,n)}}function xu(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var l=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var d={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};o===null?l=o=d:o=o.next=d,n=n.next}while(n!==null);o===null?l=o=t:o=o.next=t}else l=o=t;n={baseState:a.baseState,firstBaseUpdate:l,lastBaseUpdate:o,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Su=!1;function Mi(){if(Su){var e=Ms;if(e!==null)throw e}}function zi(e,t,n,a){Su=!1;var l=e.updateQueue;vl=!1;var o=l.firstBaseUpdate,d=l.lastBaseUpdate,p=l.shared.pending;if(p!==null){l.shared.pending=null;var j=p,R=j.next;j.next=null,d===null?o=R:d.next=R,d=j;var Y=e.alternate;Y!==null&&(Y=Y.updateQueue,p=Y.lastBaseUpdate,p!==d&&(p===null?Y.firstBaseUpdate=R:p.next=R,Y.lastBaseUpdate=j))}if(o!==null){var J=l.baseState;d=0,Y=R=j=null,p=o;do{var D=p.lane&-536870913,B=D!==p.lane;if(B?(nt&D)===D:(a&D)===D){D!==0&&D===ts&&(Su=!0),Y!==null&&(Y=Y.next={lane:0,tag:p.tag,payload:p.payload,callback:null,next:null});e:{var ye=e,Ce=p;D=t;var Ve=n;switch(Ce.tag){case 1:if(ye=Ce.payload,typeof ye=="function"){J=ye.call(Ve,J,D);break e}J=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=Ce.payload,D=typeof ye=="function"?ye.call(Ve,J,D):ye,D==null)break e;J=Q({},J,D);break e;case 2:vl=!0}}D=p.callback,D!==null&&(e.flags|=64,B&&(e.flags|=8192),B=l.callbacks,B===null?l.callbacks=[D]:B.push(D))}else B={lane:D,tag:p.tag,payload:p.payload,callback:p.callback,next:null},Y===null?(R=Y=B,j=J):Y=Y.next=B,d|=D;if(p=p.next,p===null){if(p=l.shared.pending,p===null)break;B=p,p=B.next,B.next=null,l.lastBaseUpdate=B,l.shared.pending=null}}while(!0);Y===null&&(j=J),l.baseState=j,l.firstBaseUpdate=R,l.lastBaseUpdate=Y,o===null&&(l.shared.lanes=0),kl|=d,e.lanes=d,e.memoizedState=J}}function um(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function fm(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)um(n[e],t)}var Sl=Ae(null),fo=Ae(0);function dm(e,t){e=Wa,Oe(fo,e),Oe(Sl,t),Wa=e|t.baseLanes}function wu(){Oe(fo,Wa),Oe(Sl,Sl.current)}function Nu(){Wa=fo.current,Be(Sl),Be(fo)}var un=Ae(null),Sn=null;function wl(e){var t=e.alternate;Oe(fn,fn.current&1),Oe(un,e),Sn===null&&(t===null||Sl.current!==null||t.memoizedState!==null)&&(Sn=e)}function ju(e){Oe(fn,fn.current),Oe(un,e),Sn===null&&(Sn=e)}function hm(e){e.tag===22?(Oe(fn,fn.current),Oe(un,e),Sn===null&&(Sn=e)):Nl()}function Nl(){Oe(fn,fn.current),Oe(un,un.current)}function qn(e){Be(un),Sn===e&&(Sn=null),Be(fn)}var fn=Ae(0);function Ui(e,t){Oe(un,un.current),Oe(fn,t)}function Tu(e){Be(fn),Be(un),Sn===e&&(Sn=null)}function ho(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Kf(n)||If(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ia=0,$e=null,Nt=null,Kt=null,mo=!1,Ls=!1,is=!1,po=0,Li=0,Hs=null,ab=0;function Bt(){throw Error(u(321))}function Eu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Bn(e[n],t[n]))return!1;return!0}function ku(e,t,n,a,l,o){return Ia=o,$e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,fe.H=e===null||e.memoizedState===null?Jm:Fm,is=!1,o=n(a,l),is=!1,Ls&&(o=pm(t,n,a,l)),mm(e),o}function mm(e){fe.H=wo;var t=Nt!==null&&Nt.next!==null;if(Ia=0,Kt=Nt=$e=null,mo=!1,Li=0,Hs=null,t)throw Error(u(300));e===null||It||(e=e.dependencies,e!==null&&lo(e)&&(It=!0))}function pm(e,t,n,a){$e=e;var l=0;do{if(Ls&&(Hs=null),Li=0,Ls=!1,25<=l)throw Error(u(301));if(l+=1,Kt=Nt=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}fe.H=fb,o=t(n,a)}while(Ls);return o}function lb(){var e=fe.H,t=e.useState()[0];return t=typeof t.then=="function"?Hi(t):t,e=e.useState()[0],(Nt!==null?Nt.memoizedState:null)!==e&&($e.flags|=1024),t}function Au(){var e=po!==0;return po=0,e}function _u(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Cu(e){if(mo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}mo=!1}Ia=0,Kt=Nt=$e=null,Ls=!1,Li=po=0,Hs=null}function jn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kt===null?$e.memoizedState=Kt=e:Kt=Kt.next=e,Kt}function Xt(){if(Nt===null){var e=$e.alternate;e=e!==null?e.memoizedState:null}else e=Nt.next;var t=Kt===null?$e.memoizedState:Kt.next;if(t!==null)Kt=t,Nt=e;else{if(e===null)throw $e.alternate===null?Error(u(467)):Error(u(310));Nt=e,e={memoizedState:Nt.memoizedState,baseState:Nt.baseState,baseQueue:Nt.baseQueue,queue:Nt.queue,next:null},Kt===null?$e.memoizedState=Kt=e:Kt=Kt.next=e}return Kt}function go(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Hi(e){var t=Li;return Li+=1,Hs===null&&(Hs=[]),e=sm(Hs,e,t),t=$e,(Kt===null?t.memoizedState:Kt.next)===null&&(t=t.alternate,fe.H=t===null||t.memoizedState===null?Jm:Fm),e}function yo(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Hi(e);if(e.$$typeof===te)return;if(e.$$typeof===De)return cn(e)}throw Error(u(438,String(e)))}function Du(e){var t=null,n=$e.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=$e.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(l){return l.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=go(),$e.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),a=0;a<e;a++)n[a]=mt;return t.index++,n}function Ja(e,t){return typeof t=="function"?t(e):t}function vo(e){var t=Xt();return Ou(t,Nt,e)}function Ou(e,t,n){var a=e.queue;if(a===null)throw Error(u(311));a.lastRenderedReducer=n;var l=e.baseQueue,o=a.pending;if(o!==null){if(l!==null){var d=l.next;l.next=o.next,o.next=d}t.baseQueue=l=o,a.pending=null}if(o=e.baseState,l===null)e.memoizedState=o;else{t=l.next;var p=d=null,j=null,R=t,Y=!1;do{var J=R.lane&-536870913;if(J!==R.lane?(nt&J)===J:(Ia&J)===J){var D=R.revertLane;if(D===0)j!==null&&(j=j.next={lane:0,revertLane:0,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null}),J===ts&&(Y=!0);else if((Ia&D)===D){R=R.next,D===ts&&(Y=!0);continue}else J={lane:0,revertLane:R.revertLane,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},j===null?(p=j=J,d=o):j=j.next=J,$e.lanes|=D,kl|=D;J=R.action,is&&n(o,J),o=R.hasEagerState?R.eagerState:n(o,J)}else D={lane:J,revertLane:R.revertLane,gesture:R.gesture,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},j===null?(p=j=D,d=o):j=j.next=D,$e.lanes|=J,kl|=J;R=R.next}while(R!==null&&R!==t);if(j===null?d=o:j.next=p,!Bn(o,e.memoizedState)&&(It=!0,Y&&(n=Ms,n!==null)))throw n;e.memoizedState=o,e.baseState=d,e.baseQueue=j,a.lastRenderedState=o}return l===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Ru(e){var t=Xt(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var a=n.dispatch,l=n.pending,o=t.memoizedState;if(l!==null){n.pending=null;var d=l=l.next;do o=e(o,d.action),d=d.next;while(d!==l);Bn(o,t.memoizedState)||(It=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,a]}function gm(e,t,n){var a=$e,l=Xt(),o=Je;if(o){if(n===void 0)throw Error(u(407));n=n()}else n=t();var d=!Bn((Nt||l).memoizedState,n);if(d&&(l.memoizedState=n,It=!0),l=l.queue,Uu(bm.bind(null,a,l,e),[e]),e=l.getSnapshot!==t||d||Kt!==null&&(Kt.memoizedState.tag&1)!==0,Bs(e?9:8,{destroy:void 0},vm.bind(null,a,l,n,t),null),e){if(a.flags|=2048,Tt===null)throw Error(u(349));o||(Ia&127)!==0||ym(a,t,n)}return n}function ym(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=$e.updateQueue,t===null?(t=go(),$e.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function vm(e,t,n,a){t.value=n,t.getSnapshot=a,xm(t)&&Sm(e)}function bm(e,t,n){return n(function(){xm(t)&&Sm(e)})}function xm(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Bn(e,n)}catch{return!0}}function Sm(e){var t=Il(e,2);t!==null&&Mn(t,e,2)}function Mu(e){var t=jn();if(typeof e=="function"){var n=e;if(e=n(),is){Lt(!0);try{n()}finally{Lt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ja,lastRenderedState:e},t}function wm(e,t,n,a){return e.baseState=n,Ou(e,Nt,typeof a=="function"?a:Ja)}function sb(e,t,n,a,l){if(So(e))throw Error(u(485));if(e=t.action,e!==null){var o={payload:l,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){o.listeners.push(d)}};fe.T!==null?n(!0):o.isTransition=!1,a(o),n=t.pending,n===null?(o.next=t.pending=o,Nm(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Nm(e,t){var n=t.action,a=t.payload,l=e.state;if(t.isTransition){var o=fe.T,d={};d.types=o!==null?o.types:null,fe.T=d;try{var p=n(l,a),j=fe.S;j!==null&&j(d,p),jm(e,t,p)}catch(R){zu(e,t,R)}finally{o!==null&&d.types!==null&&(o.types=d.types),fe.T=o}}else try{o=n(l,a),jm(e,t,o)}catch(R){zu(e,t,R)}}function jm(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){Tm(e,t,a)},function(a){return zu(e,t,a)}):Tm(e,t,n)}function Tm(e,t,n){t.status="fulfilled",t.value=n,Em(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Nm(e,n)))}function zu(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,Em(t),t=t.next;while(t!==a)}e.action=null}function Em(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function km(e,t){return t}function Am(e,t){if(Je){var n=Tt.formState;if(n!==null){e:{var a=$e;if(Je){if(kt){t:{for(var l=kt,o=sa;l.nodeType!==8;){if(!o){l=null;break t}if(l=ra(l.nextSibling),l===null){l=null;break t}}o=l.data,l=o==="F!"||o==="F"?l:null}if(l){kt=ra(l.nextSibling),a=l.data==="F!";break e}}pl(a)}a=!1}a&&(t=n[0])}}return n=jn(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:km,lastRenderedState:t},n.queue=a,n=Zm.bind(null,$e,a),a.dispatch=n,a=Mu(!1),o=Yu.bind(null,$e,!1,a.queue),a=jn(),l={state:t,dispatch:null,action:e,pending:null},a.queue=l,n=sb.bind(null,$e,l,o,n),l.dispatch=n,a.memoizedState=e,[t,n,!1]}function _m(e){var t=Xt();return Cm(t,Nt,e)}function Cm(e,t,n){if(t=Ou(e,t,km)[0],e=vo(Ja)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Hi(t)}catch(d){throw d===zs?ro:d}else a=t;t=Xt();var l=t.queue,o=l.dispatch;return n!==t.memoizedState&&($e.flags|=2048,Bs(9,{destroy:void 0},ib.bind(null,l,n),null)),[a,o,e]}function ib(e,t){e.action=t}function Dm(e){var t=Xt(),n=Nt;if(n!==null)return Cm(t,n,e);Xt(),t=t.memoizedState,n=Xt();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function Bs(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=$e.updateQueue,t===null&&(t=go(),$e.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function Om(){return Xt().memoizedState}function bo(e,t,n,a){var l=jn();$e.flags|=e,l.memoizedState=Bs(1|t,{destroy:void 0},n,a===void 0?null:a)}function xo(e,t,n,a){var l=Xt();a=a===void 0?null:a;var o=l.memoizedState.inst;Nt!==null&&a!==null&&Eu(a,Nt.memoizedState.deps)?l.memoizedState=Bs(t,o,n,a):($e.flags|=e,l.memoizedState=Bs(1|t,o,n,a))}function Rm(e,t){bo(8390656,8,e,t)}function Uu(e,t){xo(2048,8,e,t)}function rb(e){$e.flags|=4;var t=$e.updateQueue;if(t===null)t=go(),$e.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Mm(e){var t=Xt().memoizedState;return rb({ref:t,nextImpl:e}),function(){if((ft&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function zm(e,t){return xo(4,2,e,t)}function Um(e,t){return xo(4,4,e,t)}function Lm(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Hm(e,t,n){n=n!=null?n.concat([e]):null,xo(4,4,Lm.bind(null,t,e),n)}function Lu(){}function Bm(e,t){var n=Xt();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&Eu(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function qm(e,t){var n=Xt();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&Eu(t,a[1]))return a[0];if(a=e(),is){Lt(!0);try{e()}finally{Lt(!1)}}return n.memoizedState=[a,t],a}function Hu(e,t,n){return n===void 0||(Ia&1073741824)!==0&&(nt&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Jp(),$e.lanes|=e,kl|=e,n)}function Ym(e,t,n,a){return Bn(n,t)?n:Sl.current!==null?(e=Hu(e,n,a),Bn(e,t)||(It=!0),e):(Ia&106)===0||(Ia&1073741824)!==0&&(nt&261930)===0?(It=!0,e.memoizedState=n):(e=Jp(),$e.lanes|=e,kl|=e,t)}function Xm(e,t,n,a,l){var o=we.p;we.p=o!==0&&8>o?o:8;var d=fe.T,p={};p.types=d!==null?d.types:null,fe.T=p,Yu(e,!1,t,n);try{var j=l(),R=fe.S;if(R!==null&&R(p,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var Y=nb(j,a);Bi(e,t,Y,$n(e))}else Bi(e,t,a,$n(e))}catch(J){Bi(e,t,{then:function(){},status:"rejected",reason:J},$n())}finally{we.p=o,d!==null&&p.types!==null&&(d.types=p.types),fe.T=d}}function ob(){}function Bu(e,t,n,a){if(e.tag!==5)throw Error(u(476));var l=Gm(e).queue;Xm(e,l,t,pt,n===null?ob:function(){return $m(e),n(a)})}function Gm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:pt,baseState:pt,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ja,lastRenderedState:pt},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ja,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function $m(e){var t=Gm(e);t.next===null&&(t=e.alternate.memoizedState),Bi(e,t.next.queue,{},$n())}function qu(){return cn(li)}function Vm(){return Xt().memoizedState}function Qm(){return Xt().memoizedState}function cb(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=$n();e=bl(n);var a=xl(t,e,n);a!==null&&(Mn(a,t,n),Ri(a,t,n)),t={cache:mu()},e.payload=t;return}t=t.return}}function ub(e,t,n){var a=$n();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},So(e)?Km(t,n):(n=su(e,t,n,a),n!==null&&(Mn(n,e,a),Im(n,t,a)))}function Zm(e,t,n){var a=$n();Bi(e,t,n,a)}function Bi(e,t,n,a){var l={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(So(e))Km(t,l);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var d=t.lastRenderedState,p=o(d,n);if(l.hasEagerState=!0,l.eagerState=p,Bn(p,d))return Fr(e,t,l,0),Tt===null&&Jr(),!1}catch{}finally{}if(n=su(e,t,l,a),n!==null)return Mn(n,e,a),Im(n,t,a),!0}return!1}function Yu(e,t,n,a){if(a={lane:2,revertLane:Of(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},So(e)){if(t)throw Error(u(479))}else t=su(e,n,a,2),t!==null&&Mn(t,e,2)}function So(e){var t=e.alternate;return e===$e||t!==null&&t===$e}function Km(e,t){Ls=mo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Im(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Ha(e,n)}}var wo={readContext:cn,use:yo,useCallback:Bt,useContext:Bt,useEffect:Bt,useImperativeHandle:Bt,useLayoutEffect:Bt,useInsertionEffect:Bt,useMemo:Bt,useReducer:Bt,useRef:Bt,useState:Bt,useDebugValue:Bt,useDeferredValue:Bt,useTransition:Bt,useSyncExternalStore:Bt,useId:Bt,useHostTransitionStatus:Bt,useFormState:Bt,useActionState:Bt,useOptimistic:Bt,useMemoCache:Bt,useCacheRefresh:Bt,useEffectEvent:Bt},Jm={readContext:cn,use:yo,useCallback:function(e,t){return jn().memoizedState=[e,t===void 0?null:t],e},useContext:cn,useEffect:Rm,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,bo(4194308,4,Lm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return bo(4194308,4,e,t)},useInsertionEffect:function(e,t){bo(4,2,e,t)},useMemo:function(e,t){var n=jn();t=t===void 0?null:t;var a=e();if(is){Lt(!0);try{e()}finally{Lt(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=jn();if(n!==void 0){var l=n(t);if(is){Lt(!0);try{n(t)}finally{Lt(!1)}}}else l=t;return a.memoizedState=a.baseState=l,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:l},a.queue=e,e=e.dispatch=ub.bind(null,$e,e),[a.memoizedState,e]},useRef:function(e){var t=jn();return e={current:e},t.memoizedState=e},useState:function(e){e=Mu(e);var t=e.queue,n=Zm.bind(null,$e,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Lu,useDeferredValue:function(e,t){var n=jn();return Hu(n,e,t)},useTransition:function(){var e=Mu(!1);return e=Xm.bind(null,$e,e.queue,!0,!1),jn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=$e,l=jn();if(Je){if(n===void 0)throw Error(u(407));n=n()}else{if(n=t(),Tt===null)throw Error(u(349));(nt&127)!==0||ym(a,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,Rm(bm.bind(null,a,o,e),[e]),a.flags|=2048,Bs(9,{destroy:void 0},vm.bind(null,a,o,n,t),null),n},useId:function(){var e=jn(),t=Tt.identifierPrefix;if(Je){var n=Ea,a=Ta;n=(a&~(1<<32-Mt(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=po++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=ab++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:qu,useFormState:Am,useActionState:Am,useOptimistic:function(e){var t=jn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Yu.bind(null,$e,!0,n),n.dispatch=t,[e,t]},useMemoCache:Du,useCacheRefresh:function(){return jn().memoizedState=cb.bind(null,$e)},useEffectEvent:function(e){var t=jn(),n={impl:e};return t.memoizedState=n,function(){if((ft&2)!==0)throw Error(u(440));return n.impl.apply(void 0,arguments)}}},Fm={readContext:cn,use:yo,useCallback:Bm,useContext:cn,useEffect:Uu,useImperativeHandle:Hm,useInsertionEffect:zm,useLayoutEffect:Um,useMemo:qm,useReducer:vo,useRef:Om,useState:function(){return vo(Ja)},useDebugValue:Lu,useDeferredValue:function(e,t){var n=Xt();return Ym(n,Nt.memoizedState,e,t)},useTransition:function(){var e=vo(Ja)[0],t=Xt().memoizedState;return[typeof e=="boolean"?e:Hi(e),t]},useSyncExternalStore:gm,useId:Vm,useHostTransitionStatus:qu,useFormState:_m,useActionState:_m,useOptimistic:function(e,t){var n=Xt();return wm(n,Nt,e,t)},useMemoCache:Du,useCacheRefresh:Qm,useEffectEvent:Mm},fb={readContext:cn,use:yo,useCallback:Bm,useContext:cn,useEffect:Uu,useImperativeHandle:Hm,useInsertionEffect:zm,useLayoutEffect:Um,useMemo:qm,useReducer:Ru,useRef:Om,useState:function(){return Ru(Ja)},useDebugValue:Lu,useDeferredValue:function(e,t){var n=Xt();return Nt===null?Hu(n,e,t):Ym(n,Nt.memoizedState,e,t)},useTransition:function(){var e=Ru(Ja)[0],t=Xt().memoizedState;return[typeof e=="boolean"?e:Hi(e),t]},useSyncExternalStore:gm,useId:Vm,useHostTransitionStatus:qu,useFormState:Dm,useActionState:Dm,useOptimistic:function(e,t){var n=Xt();return Nt!==null?wm(n,Nt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Du,useCacheRefresh:Qm,useEffectEvent:Mm};function Xu(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:Q({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Gu={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=$n(),l=bl(a);l.payload=t,n!=null&&(l.callback=n),t=xl(e,l,a),t!==null&&(Mn(t,e,a),Ri(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=$n(),l=bl(a);l.tag=1,l.payload=t,n!=null&&(l.callback=n),t=xl(e,l,a),t!==null&&(Mn(t,e,a),Ri(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=$n(),a=bl(n);a.tag=2,t!=null&&(a.callback=t),t=xl(e,a,n),t!==null&&(Mn(t,e,n),Ri(t,e,n))}};function Pm(e,t,n,a,l,o,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,o,d):t.prototype&&t.prototype.isPureReactComponent?!Ti(n,a)||!Ti(l,o):!0}function Wm(e,t,n,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,a),t.state!==e&&Gu.enqueueReplaceState(t,t.state,null)}function rs(e,t){var n=t;if("ref"in t){n={};for(var a in t)a!=="ref"&&(n[a]=t[a])}if(e=e.defaultProps){n===t&&(n=Q({},n));for(var l in e)n[l]===void 0&&(n[l]=e[l])}return n}function ep(e){Ir(e)}function tp(e){console.error(e)}function np(e){Ir(e)}function No(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function ap(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(l){setTimeout(function(){throw l})}}function $u(e,t,n){return n=bl(n),n.tag=3,n.payload={element:null},n.callback=function(){No(e,t)},n}function lp(e){return e=bl(e),e.tag=3,e}function sp(e,t,n,a){var l=n.type.getDerivedStateFromError;if(typeof l=="function"){var o=a.value;e.payload=function(){return l(o)},e.callback=function(){ap(t,n,a)}}var d=n.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){ap(t,n,a),typeof l!="function"&&(Al===null?Al=new Set([this]):Al.add(this));var p=a.stack;this.componentDidCatch(a.value,{componentStack:p!==null?p:""})})}function db(e,t,n,a,l){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&Wl(t,n,l,!0),n=un.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Sn===null?$o():n.alternate===null&&qt===0&&(qt=3),n.flags&=-257,n.flags|=65536,n.lanes=l,a===oo?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),_f(e,a,l)),!1;case 22:return n.flags|=65536,a===oo?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([a]):n.add(a)),_f(e,a,l)),!1}throw Error(u(435,n.tag))}return _f(e,a,l),$o(),!1}if(Je)return t=un.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=l,a!==uu&&(e=Error(u(422),{cause:a}),Ai(na(e,n)))):(a!==uu&&(t=Error(u(423),{cause:a}),Ai(na(t,n))),e=e.current.alternate,e.flags|=65536,l&=-l,e.lanes|=l,a=na(a,n),l=$u(e.stateNode,a,l),xu(e,l),qt!==4&&(qt=2)),!1;var o=Error(u(520),{cause:a});if(o=na(o,n),Zi===null?Zi=[o]:Zi.push(o),qt!==4&&(qt=2),t===null)return!0;a=na(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=l&-l,n.lanes|=e,e=$u(n.stateNode,a,e),xu(n,e),!1;case 1:if(t=n.type,o=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(Al===null||!Al.has(o))))return n.flags|=65536,l&=-l,n.lanes|=l,l=lp(l),sp(l,e,n,a),xu(n,l),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Vu=Error(u(461)),It=!1;function Wt(e,t,n,a){t.child=e===null?cm(t,null,n,a):ss(t,e.child,n,a)}function ip(e,t,n,a,l){n=n.render;var o=t.ref;if("ref"in a){var d={};for(var p in a)p!=="ref"&&(d[p]=a[p])}else d=a;return es(t),a=ku(e,t,n,d,o,l),p=Au(),e!==null&&!It?(_u(e,t,l),Fa(e,t,l)):(Je&&p&&to(t),t.flags|=1,Wt(e,t,a,l),t.child)}function rp(e,t,n,a,l){if(e===null){var o=n.type;return typeof o=="function"&&!iu(o)&&o.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=o,op(e,t,o,a,l)):(e=Wr(n.type,null,a,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!Wu(e,l)){var d=o.memoizedProps;if(n=n.compare,n=n!==null?n:Ti,n(d,a)&&e.ref===t.ref)return Fa(e,t,l)}return t.flags|=1,e=Va(o,a),e.ref=t.ref,e.return=t,t.child=e}function op(e,t,n,a,l){if(e!==null){var o=e.memoizedProps;if(Ti(o,a)&&e.ref===t.ref)if(It=!1,t.pendingProps=a=o,Wu(e,l))(e.flags&131072)!==0&&(It=!0);else return t.lanes=e.lanes,Fa(e,t,l)}return Qu(e,t,n,a,l)}function cp(e,t,n,a){var l=a.children,o=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(o=o!==null?o.baseLanes|n:n,e!==null){for(a=t.child=e.child,l=0;a!==null;)l=l|a.lanes|a.childLanes,a=a.sibling;a=l&~o}else a=0,t.child=null;return up(e,t,o,n,a)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&io(t,o!==null?o.cachePool:null),o!==null?dm(t,o):wu(),hm(t);else return a=t.lanes=536870912,up(e,t,o!==null?o.baseLanes|n:n,n,a)}else o!==null?(io(t,o.cachePool),dm(t,o),Nl(),t.memoizedState=null):(e!==null&&io(t,null),wu(),Nl());return Wt(e,t,l,n),t.child}function qi(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function up(e,t,n,a,l){var o=gu();return o=o===null?null:{parent:Zt._currentValue,pool:o},t.memoizedState={baseLanes:n,cachePool:o},e!==null&&io(t,null),wu(),hm(t),e!==null&&Wl(e,t,a,!0),t.childLanes=l,null}function jo(e,t){return t=To({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function fp(e,t,n){return ss(t,e.child,null,n),e=jo(t,t.pendingProps),e.flags|=2,qn(t),t.memoizedState=null,e}function hb(e,t,n){var a=t.pendingProps,l=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Je){if(a.mode==="hidden")return e=jo(t,a),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},qi(null,e);if(ju(t),(e=kt)?(e=Lg(e,sa),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:hl!==null?{id:Ta,overflow:Ea}:null,retryLane:536870912,hydrationErrors:null},n=Kh(e),n.return=t,t.child=n,ln=t,kt=null)):e=null,e===null)throw pl(t);return t.lanes=536870912,null}return jo(t,a)}var o=e.memoizedState;if(o!==null){var d=o.dehydrated;if(ju(t),l)if(t.flags&256)t.flags&=-257,t=fp(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(It||Wl(e,t,n,!1),l=(n&e.childLanes)!==0,It||l){if(Sl.current===null){if(a=Tt,a!==null&&(d=Gl(a,n),d!==0&&d!==o.retryLane))throw o.retryLane=d,Il(e,d),Mn(a,e,d),Vu;$o()}t=fp(e,t,n)}else e=o.treeContext,kt=ra(d.nextSibling),ln=t,Je=!0,ml=null,sa=!1,e!==null&&Fh(t,e),t=jo(t,a),t.flags|=134221824;return t}return e=Va(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function qs(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(u(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Qu(e,t,n,a,l){return es(t),n=ku(e,t,n,a,void 0,l),a=Au(),e!==null&&!It?(_u(e,t,l),Fa(e,t,l)):(Je&&a&&to(t),t.flags|=1,Wt(e,t,n,l),t.child)}function dp(e,t,n,a,l,o){return es(t),t.updateQueue=null,n=pm(t,a,n,l),mm(e),a=Au(),e!==null&&!It?(_u(e,t,o),Fa(e,t,o)):(Je&&a&&to(t),t.flags|=1,Wt(e,t,n,o),t.child)}function hp(e,t,n,a,l){if(es(t),t.stateNode===null){var o=Cs,d=n.contextType;typeof d=="object"&&d!==null&&(o=cn(d)),o=new n(a,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Gu,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=a,o.state=t.memoizedState,o.refs={},vu(t),d=n.contextType,o.context=typeof d=="object"&&d!==null?cn(d):Cs,o.state=t.memoizedState,d=n.getDerivedStateFromProps,typeof d=="function"&&(Xu(t,n,d,a),o.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(d=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),d!==o.state&&Gu.enqueueReplaceState(o,o.state,null),zi(t,a,o,l),Mi(),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){o=t.stateNode;var p=t.memoizedProps,j=rs(n,p);o.props=j;var R=o.context,Y=n.contextType;d=Cs,typeof Y=="object"&&Y!==null&&(d=cn(Y));var J=n.getDerivedStateFromProps;Y=typeof J=="function"||typeof o.getSnapshotBeforeUpdate=="function",p=t.pendingProps!==p,Y||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(p||R!==d)&&Wm(t,o,a,d),vl=!1;var D=t.memoizedState;o.state=D,zi(t,a,o,l),Mi(),R=t.memoizedState,p||D!==R||vl?(typeof J=="function"&&(Xu(t,n,J,a),R=t.memoizedState),(j=vl||Pm(t,n,j,a,D,R,d))?(Y||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=R),o.props=a,o.state=R,o.context=d,a=j):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{o=t.stateNode,bu(e,t),d=t.memoizedProps,Y=rs(n,d),o.props=Y,J=t.pendingProps,D=o.context,R=n.contextType,j=Cs,typeof R=="object"&&R!==null&&(j=cn(R)),p=n.getDerivedStateFromProps,(R=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(d!==J||D!==j)&&Wm(t,o,a,j),vl=!1,D=t.memoizedState,o.state=D,zi(t,a,o,l),Mi();var B=t.memoizedState;d!==J||D!==B||vl||e!==null&&e.dependencies!==null&&lo(e.dependencies)?(typeof p=="function"&&(Xu(t,n,p,a),B=t.memoizedState),(Y=vl||Pm(t,n,Y,a,D,B,j)||e!==null&&e.dependencies!==null&&lo(e.dependencies))?(R||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(a,B,j),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(a,B,j)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||d===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=B),o.props=a,o.state=B,o.context=j,a=Y):(typeof o.componentDidUpdate!="function"||d===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),a=!1)}return o=a,qs(e,t),a=(t.flags&128)!==0,o||a?(o=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:o.render(),t.flags|=1,e!==null&&a?(t.child=ss(t,e.child,null,l),t.child=ss(t,null,n,l)):Wt(e,t,n,l),t.memoizedState=o.state,e=t.child):e=Fa(e,t,l),e}function mp(e,t,n,a){return Fl(),t.flags|=256,Wt(e,t,n,a),t.child}var Zu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ku(e){return{baseLanes:e,cachePool:am()}}function Iu(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Gn),e}function pp(e,t,n){var a=t.pendingProps,l=!1,o=(t.flags&128)!==0,d;if((d=o)||(d=e!==null&&e.memoizedState===null?!1:(fn.current&2)!==0),d&&(l=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(Je){if(l?wl(t):Nl(),(e=kt)?(e=Lg(e,sa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:hl!==null?{id:Ta,overflow:Ea}:null,retryLane:536870912,hydrationErrors:null},n=Kh(e),n.return=t,t.child=n,ln=t,kt=null)):e=null,e===null)throw pl(t);return If(e)?t.lanes=32:t.lanes=536870912,null}return o=a.children,a=a.fallback,l?(Nl(),l=t.mode,o=To({mode:"hidden",children:o},l),a=Jl(a,l,n,null),o.return=t,a.return=t,o.sibling=a,t.child=o,a=t.child,a.memoizedState=Ku(n),a.childLanes=Iu(e,d,n),t.memoizedState=Zu,qi(null,a)):(wl(t),Ju(t,o))}var p=e.memoizedState;if(p!==null){var j=p.dehydrated;if(j!==null)return mb(e,t,o,d,a,j,p,n)}return l?(Nl(),l=a.fallback,o=t.mode,p=e.child,j=p.sibling,a=Va(p,{mode:"hidden",children:a.children}),a.subtreeFlags=p.subtreeFlags&1206910976,j!==null?l=Va(j,l):(l=Jl(l,o,n,null),l.flags|=2),l.return=t,a.return=t,a.sibling=l,t.child=a,qi(null,a),a=t.child,l=e.child.memoizedState,l===null?l=Ku(n):(o=l.cachePool,o!==null?(p=Zt._currentValue,o=o.parent!==p?{parent:p,pool:p}:o):o=am(),l={baseLanes:l.baseLanes|n,cachePool:o}),a.memoizedState=l,a.childLanes=Iu(e,d,n),t.memoizedState=Zu,qi(e.child,a)):(wl(t),n=e.child,e=n.sibling,n=Va(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=n,t.memoizedState=null,n)}function Ju(e,t){return t=To({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function To(e,t){return e=Cn(22,e,null,t),e.lanes=0,e}function Eo(e,t,n){return ss(t,e.child,null,n),e=Ju(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function mb(e,t,n,a,l,o,d,p){if(n)return t.flags&256?(wl(t),t.flags&=-257,Eo(e,t,p)):t.memoizedState!==null?(Nl(),t.child=e.child,t.flags|=128,null):(Nl(),o=l.fallback,d=t.mode,l=To({mode:"visible",children:l.children},d),o=Jl(o,d,p,null),o.flags|=2,l.return=t,o.return=t,l.sibling=o,t.child=l,ss(t,e.child,null,p),l=t.child,l.memoizedState=Ku(p),l.childLanes=Iu(e,a,p),t.memoizedState=Zu,qi(null,l));if(wl(t),If(o)){if(a=o.nextSibling&&o.nextSibling.dataset,a)var j=a.dgst;return a=j,a!==""&&(l=Error(u(419)),l.stack="",l.digest=a,Ai({value:l,source:null,stack:null})),Eo(e,t,p)}if(It||Wl(e,t,p,!1),a=(p&e.childLanes)!==0,It||a){if(Sl.current!==null)return Eo(e,t,p);if(a=Tt,a!==null&&(l=Gl(a,p),l!==0&&l!==d.retryLane))throw d.retryLane=l,Il(e,l),Mn(a,e,l),Vu;return Kf(o)||$o(),Eo(e,t,p)}return Kf(o)?(t.flags|=192,t.child=e.child,null):(e=d.treeContext,kt=ra(o.nextSibling),ln=t,Je=!0,ml=null,sa=!1,e!==null&&Fh(t,e),t=Ju(t,l.children),t.flags|=134221824,t)}function gp(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),ao(e.return,t,n)}function yp(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&ho(n)===null&&(t=e),e=e.sibling}return t}function ko(e,t,n,a,l,o){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:l,treeForkCount:o}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=a,d.tail=n,d.tailMode=l,d.treeForkCount=o)}function Fu(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function Pu(e,t,n){var a=t.pendingProps,l=a.revealOrder,o=a.tail;a=a.children;var d=fn.current;if(t.flags&128)return Ui(t,d),null;var p=(d&2)!==0;if(p?(d=d&1|2,t.flags|=128):d&=1,Ui(t,d),l==="backwards"&&e!==null?(Fu(e),Wt(e,t,a,n),Fu(e)):Wt(e,t,a,n),a=Je?ki:0,!p&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&gp(e,n,t);else if(e.tag===19)gp(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(l){case"backwards":n=yp(t.child),n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null,Fu(t)),ko(t,!0,l,null,o,a);break;case"unstable_legacy-backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&ho(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}ko(t,!0,n,null,o,a);break;case"together":ko(t,!1,null,null,void 0,a);break;case"independent":t.memoizedState=null;break;default:n=yp(t.child),n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),ko(t,!1,l,n,o,a)}return t.child}function vp(e,t,n){var a=t.pendingProps;return gl(t,t.type,a.value),Wt(e,t,a.children,n),t.child}function Fa(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),kl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Wl(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,n=Va(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Va(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Wu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&lo(e)))}function pb(e,t,n){switch(t.tag){case 3:Me(t,t.stateNode.containerInfo),gl(t,Zt,e.memoizedState.cache),Fl();break;case 27:case 5:gt(t);break;case 4:Me(t,t.stateNode.containerInfo);break;case 10:gl(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ju(t),null;break;case 13:var a=t.memoizedState;if(a!==null){if(a.dehydrated!==null)return wl(t),t.flags|=128,null;a=Wl(e,t,n,!1);var l=t.child.childLanes;return a||(n&l)!==0?pp(e,t,n):(wl(t),e=Fa(e,t,n),e!==null?e.sibling:null)}wl(t);break;case 19:if(t.flags&128)return Pu(e,t,n);if(l=(e.flags&128)!==0,a=(n&t.childLanes)!==0,a||(Wl(e,t,n,!1),a=(n&t.childLanes)!==0),l){if(a)return Pu(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),Ui(t,fn.current),a)break;return null;case 22:return t.lanes=0,cp(e,t,n,t.pendingProps);case 24:gl(t,Zt,e.memoizedState.cache)}return Fa(e,t,n)}function bp(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)It=!0;else{if(!Wu(e,n)&&(t.flags&128)===0)return It=!1,pb(e,t,n);It=(e.flags&131072)!==0}else It=!1,Je&&(t.flags&1048576)!==0&&Jh(t,ki,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=as(t.elementType),t.type=e,typeof e=="function")iu(e)?(a=rs(e,a),t.tag=1,t=hp(null,t,e,a,n)):(t.tag=0,t=Qu(null,t,e,a,n));else{if(e!=null){var l=e.$$typeof;if(l===ae){t.tag=11,t=ip(null,t,e,a,n);break e}else if(l===P){t.tag=14,t=rp(null,t,e,a,n);break e}else if(l===De){t.tag=10,t.type=e,t=vp(null,t,n);break e}}throw t=Ue(e)||e,Error(u(306,t,""))}}return t;case 0:return Qu(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,l=rs(a,t.pendingProps),hp(e,t,a,l,n);case 3:e:{if(Me(t,t.stateNode.containerInfo),e===null)throw Error(u(387));a=t.pendingProps;var o=t.memoizedState;l=o.element,bu(e,t),zi(t,a,null,n);var d=t.memoizedState;if(a=d.cache,gl(t,Zt,a),a!==o.cache&&hu(t,[Zt],n,!0),Mi(),a=d.element,o.isDehydrated)if(o={element:a,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=mp(e,t,a,n);break e}else if(a!==l){l=na(Error(u(424)),t),Ai(l),t=mp(e,t,a,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(kt=ra(e.firstChild),ln=t,Je=!0,ml=null,sa=!0,n=cm(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(Fl(),a===l){t=Fa(e,t,n);break e}Wt(e,t,a,n)}t=t.child}return t;case 26:return qs(e,t),e===null?(n=$g(t.type,null,t.pendingProps,null))?t.memoizedState=n:Je||(t.stateNode=Ng(t.type,t.pendingProps,C.current,t)):t.memoizedState=$g(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return gt(t),e===null&&Je&&(a=t.stateNode=qg(t.type,t.pendingProps,C.current),ln=t,sa=!0,l=kt,Dl(t.type)?(Jf=l,kt=ra(a.firstChild)):kt=l),Wt(e,t,t.pendingProps.children,n),qs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Je&&((l=a=kt)&&(a=cx(a,t.type,t.pendingProps,sa),a!==null?(t.stateNode=a,ln=t,kt=ra(a.firstChild),sa=!1,l=!0):l=!1),l||pl(t)),gt(t),l=t.type,o=t.pendingProps,d=e!==null?e.memoizedProps:null,a=o.children,Yf(l,o)?a=null:d!==null&&Yf(l,d)&&(t.flags|=32),t.memoizedState!==null&&(l=ku(e,t,lb,null,null,n),li._currentValue=l),qs(e,t),Wt(e,t,a,n),t.child;case 6:return e===null&&Je&&((e=n=kt)&&(n=ux(n,t.pendingProps,sa),n!==null?(t.stateNode=n,ln=t,kt=null,e=!0):e=!1),e||pl(t)),null;case 13:return pp(e,t,n);case 4:return Me(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=ss(t,null,a,n):Wt(e,t,a,n),t.child;case 11:return ip(e,t,t.type,t.pendingProps,n);case 7:return a=t.pendingProps,qs(e,t),Wt(e,t,a,n),t.child;case 8:return Wt(e,t,t.pendingProps.children,n),t.child;case 12:return Wt(e,t,t.pendingProps.children,n),t.child;case 10:return vp(e,t,n);case 9:return l=t.type._context,a=t.pendingProps.children,es(t),l=cn(l),a=a(l),t.flags|=1,Wt(e,t,a,n),t.child;case 14:return rp(e,t,t.type,t.pendingProps,n);case 15:return op(e,t,t.type,t.pendingProps,n);case 19:return Pu(e,t,n);case 31:return hb(e,t,n);case 22:return cp(e,t,n,t.pendingProps);case 24:return es(t),a=cn(Zt),e===null?(l=gu(),l===null&&(l=Tt,o=mu(),l.pooledCache=o,o.refCount++,o!==null&&(l.pooledCacheLanes|=n),l=o),t.memoizedState={parent:a,cache:l},vu(t),gl(t,Zt,l)):((e.lanes&n)!==0&&(bu(e,t),zi(t,null,null,n),Mi()),l=e.memoizedState,o=t.memoizedState,l.parent!==a?(l={parent:a,cache:a},t.memoizedState=l,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=l),gl(t,Zt,a)):(a=o.cache,gl(t,Zt,a),a!==l.cache&&hu(t,[Zt],n,!0))),Wt(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),a=t.pendingProps,a.name!=null&&a.name!=="auto"?t.flags|=e===null?18882560:18874368:Je&&to(t),e!==null&&e.memoizedProps.name!==a.name?t.flags|=4194816:qs(e,t),Wt(e,t,a.children,n),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function Pa(e){e.flags|=4}function ef(e,t,n,a,l){var o;if((o=(e.mode&32)!==0)&&(o=n===null?Kg(t,a):Kg(t,a)&&(a.src!==n.src||a.srcSet!==n.srcSet)),o){if(e.flags|=16777216,(l&335544128)===l)if(e.stateNode.complete)e.flags|=8192;else if(eg())e.flags|=8192;else throw ls=oo,yu}else e.flags&=-16777217}function xp(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ig(t))if(eg())e.flags|=8192;else throw ls=oo,yu}function Ao(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?wt():536870912,e.lanes|=t,Vs|=t)}function Yi(e,t){if(!Je)switch(e.tailMode){case"visible":break;case"collapsed":for(var n=e.tail,a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function At(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,a|=l.subtreeFlags&1206910976,a|=l.flags&1206910976,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,a|=l.subtreeFlags,a|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function gb(e,t,n){var a=t.pendingProps;switch(cu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return At(t),null;case 1:return At(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Ka(Zt),lt(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Rs(t)?Pa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,fu())),At(t),null;case 26:var l=t.type,o=t.memoizedState;return e===null?(Pa(t),o!==null?(At(t),xp(t,o)):(At(t),ef(t,l,null,a,n))):o?o!==e.memoizedState?(Pa(t),At(t),xp(t,o)):(At(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&Pa(t),At(t),ef(t,l,e,a,n)),null;case 27:if(Dt(t),n=C.current,l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Pa(t);else{if(!a){if(t.stateNode===null)throw Error(u(166));return At(t),t.subtreeFlags&=-33554433,null}e=se.current,Rs(t)?Ph(t):(e=qg(l,a,n),t.stateNode=e,Pa(t))}return At(t),t.subtreeFlags&=-33554433,null;case 5:if(Dt(t),l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Pa(t);else{if(!a){if(t.stateNode===null)throw Error(u(166));return At(t),t.subtreeFlags&=-33554433,null}if(o=se.current,Rs(t))Ph(t);else{var d=Pi(C.current);switch(o){case 1:o=d.createElementNS("http://www.w3.org/2000/svg",l);break;case 2:o=d.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;default:switch(l){case"svg":o=d.createElementNS("http://www.w3.org/2000/svg",l);break;case"math":o=d.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;case"script":o=d.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof a.is=="string"?d.createElement("select",{is:a.is}):d.createElement("select"),a.multiple?o.multiple=!0:a.size&&(o.size=a.size);break;default:o=typeof a.is=="string"?d.createElement(l,{is:a.is}):d.createElement(l)}}o[Vt]=t,o[Pt]=a;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)o.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=o;e:switch(hn(o,l,a),l){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&Pa(t)}}return At(t),t.subtreeFlags&=-33554433,ef(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&Pa(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(u(166));if(e=C.current,Rs(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,l=ln,l!==null)switch(l.tag){case 27:case 5:a=l.memoizedProps}e[Vt]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||bg(e.nodeValue,n)),e||pl(t,!0)}else e=Pi(e).createTextNode(a),e[Vt]=t,t.stateNode=e}return At(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Rs(t),n!==null){if(e===null){if(!a)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[Vt]=t}else Fl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;At(t),e=!1}else n=fu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(qn(t),t):(qn(t),null);if((t.flags&128)!==0)throw Error(u(558))}return At(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(l=Rs(t),a!==null&&a.dehydrated!==null){if(e===null){if(!l)throw Error(u(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(u(317));l[Vt]=t}else Fl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;At(t),l=!1}else l=fu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),l=!0;if(!l)return t.flags&256?(qn(t),t):(qn(t),null)}return qn(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,l=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(l=a.alternate.memoizedState.cachePool.pool),o=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(o=a.memoizedState.cachePool.pool),o!==l&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ao(t,t.updateQueue),At(t),null);case 4:return lt(),e===null&&Uf(t.stateNode.containerInfo),t.flags|=67108864,At(t),null;case 10:return Ka(t.type),At(t),null;case 19:if(Tu(t),a=t.memoizedState,a===null)return At(t),null;if(l=(t.flags&128)!==0,o=a.rendering,o===null)if(l)Yi(a,!1);else{if(qt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=ho(e),o!==null){for(t.flags|=128,Yi(a,!1),e=o.updateQueue,t.updateQueue=e,Ao(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Zh(n,e),n=n.sibling;return Ui(t,fn.current&1|2),Je&&Qa(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&Ee()>qo&&(t.flags|=128,l=!0,Yi(a,!1),t.lanes=4194304)}else{if(!l)if(e=ho(o),e!==null){if(t.flags|=128,l=!0,e=e.updateQueue,t.updateQueue=e,Ao(t,e),Yi(a,!0),a.tail===null&&a.tailMode!=="collapsed"&&a.tailMode!=="visible"&&!o.alternate&&!Je)return At(t),null}else 2*Ee()-a.renderingStartTime>qo&&n!==536870912&&(t.flags|=128,l=!0,Yi(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(e=a.last,e!==null?e.sibling=o:t.child=o,a.last=o)}if(a.tail!==null){e=a.tail;e:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break e}n=n.sibling}n=!0}return a.rendering=e,a.tail=e.sibling,a.renderingStartTime=Ee(),e.sibling=null,o=fn.current,o=l?o&1|2:o&1,a.tailMode==="visible"||a.tailMode==="collapsed"||!n||Je?Ui(t,o):(n=o,Oe(un,t),Oe(fn,n),Sn===null&&(Sn=t)),Je&&Qa(t,a.treeForkCount),e}return At(t),null;case 22:case 23:return qn(t),Nu(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&(At(t),t.subtreeFlags&6&&(t.flags|=8192)):At(t),n=t.updateQueue,n!==null&&Ao(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&Be(ns),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ka(Zt),At(t),null;case 25:return null;case 30:return t.flags|=33554432,At(t),null}throw Error(u(156,t.tag))}function yb(e,t){switch(cu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ka(Zt),lt(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Dt(t),null;case 31:if(t.memoizedState!==null){if(qn(t),t.alternate===null)throw Error(u(340));Fl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(qn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));Fl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Tu(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return lt(),null;case 10:return Ka(t.type),null;case 22:case 23:return qn(t),Nu(),e!==null&&Be(ns),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ka(Zt),null;case 25:return null;default:return null}}function Sp(e,t){switch(cu(t),t.tag){case 3:Ka(Zt),lt();break;case 26:case 27:case 5:Dt(t);break;case 4:lt();break;case 31:t.memoizedState!==null&&qn(t);break;case 13:qn(t);break;case 19:Tu(t);break;case 10:Ka(t.type);break;case 22:case 23:qn(t),Nu(),e!==null&&Be(ns);break;case 24:Ka(Zt)}}function Xi(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var l=a.next;n=l;do{if((n.tag&e)===e){a=void 0;var o=n.create,d=n.inst;a=o(),d.destroy=a}n=n.next}while(n!==l)}}catch(p){bt(t,t.return,p)}}function jl(e,t,n){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var o=l.next;a=o;do{if((a.tag&e)===e){var d=a.inst,p=d.destroy;if(p!==void 0){d.destroy=void 0,l=t;var j=n,R=p;try{R()}catch(Y){bt(l,j,Y)}}}a=a.next}while(a!==o)}}catch(Y){bt(t,t.return,Y)}}function wp(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{fm(t,n)}catch(a){bt(e,e.return,a)}}}function Np(e,t,n){n.props=rs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){bt(e,t,a)}}function ka(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:var l=e.stateNode,o=Ga(e.memoizedProps,l);(l.ref===null||l.ref.name!==o)&&(l.ref=Cg(o)),a=l.ref;break;case 7:if(e.stateNode===null){var d=new Vn(e);v(e.child,!1,rx,d,void 0,void 0),e.stateNode=d}a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(p){bt(e,t,p)}}function dn(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(l){bt(e,t,l)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(l){bt(e,t,l)}else n.current=null}function _o(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)Ug(e.stateNode,t[n])}function jp(e){for(var t=e.return;t!==null&&(nf(t)&&Ug(e.stateNode,t.stateNode),!tf(t));)t=t.return}function Gi(e){for(var t=e.return;t!==null&&(nf(t)&&ox(e.stateNode,t.stateNode),!tf(t));)t=t.return}function tf(e){return e.tag===5||e.tag===3||e.tag===27}function nf(e){return e&&e.tag===7&&e.stateNode!==null}function af(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(l){bt(e,e.return,l)}}function lf(e,t,n){try{var a=e.stateNode;Gb(a,e.type,n,t),a[Pt]=t}catch(l){bt(e,e.return,l)}}function Tp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Dl(e.type)||e.tag===4}function sf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Tp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Dl(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function rf(e,t,n,a){var l=e.tag;if(l===5||l===6)l=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(l,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(l),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ja)),_o(e,a),it=!0;else if(l!==4&&(l===27&&(_o(e,a),a=null,Dl(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(rf(e,t,n,a),e=e.sibling;e!==null;)rf(e,t,n,a),e=e.sibling}function Co(e,t,n,a){var l=e.tag;if(l===5||l===6)l=e.stateNode,t?n.insertBefore(l,t):n.appendChild(l),_o(e,a),it=!0;else if(l!==4&&(l===27&&(_o(e,a),a=null,Dl(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Co(e,t,n,a),e=e.sibling;e!==null;)Co(e,t,n,a),e=e.sibling}function Ep(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,l=t.attributes;l.length;)t.removeAttributeNode(l[0]);hn(t,a,n),t[Vt]=e,t[Pt]=n}catch(o){bt(e,e.return,o)}}var Do=!1,Yn=null;function kp(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Do=!0)}var Aa=null;function Ap(){var e=Aa;return Aa=null,e}var Dn=0;function Ys(e,t,n,a,l){return Dn=0,_p(e.child,t,n,a,l)}function _p(e,t,n,a,l){for(var o=!1;e!==null;){if(e.tag===5){var d=e.stateNode;if(a!==null){var p=$f(d);a.push(p),p.view&&(o=!0)}else o||$f(d).view&&(o=!0);Do=!0,Ag(d,Dn===0?t:t+"_"+Dn,n),Dn++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&l||_p(e.child,t,n,a,l)&&(o=!0));e=e.sibling}return o}function _a(e,t){for(;e!==null;)e.tag===5?_g(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||_a(e.child,t)),e=e.sibling}function Oo(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Oo(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(u(544));var n=t.name;t=$a(t.default,t.share),t!=="none"&&(Ys(e,n,t,null,!1)||_a(e.child,!1))}e=e.sibling}}function of(e,t){if(e.tag===30){var n=e.stateNode,a=e.memoizedProps,l=Ga(a,n),o=$a(a.default,n.paired?a.share:a.enter);o!=="none"?Ys(e,l,o,null,!1)?(Oo(e),n.paired||t||Is(e,a.onEnter)):_a(e.child,!1):Oo(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)of(e,t),e=e.sibling;else Oo(e)}function cf(e){if(Yn!==null&&Yn.size!==0){var t=Yn;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var n=e.memoizedProps,a=n.name;if(a!=null&&a!=="auto"){var l=t.get(a);if(l!==void 0){var o=$a(n.default,n.share);if(o!=="none"&&(Ys(e,a,o,null,!1)?(o=e.stateNode,l.paired=o,o.paired=l,Is(e,n.onShare)):_a(e.child,!1)),t.delete(a),t.size===0)break}}}cf(e)}e=e.sibling}}}function uf(e){if(e.tag===30){var t=e.memoizedProps,n=Ga(t,e.stateNode),a=Yn!==null?Yn.get(n):void 0,l=$a(t.default,a!==void 0?t.share:t.exit);l!=="none"&&(Ys(e,n,l,null,!1)?a!==void 0?(l=e.stateNode,a.paired=l,l.paired=a,Yn.delete(n),Is(e,t.onShare)):Is(e,t.onExit):_a(e.child,!1)),Yn!==null&&cf(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)uf(e),e=e.sibling;else Yn!==null&&cf(e)}function Cp(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=Ga(t,e.stateNode);t=$a(t.default,t.update),e.flags&=-5,t!=="none"&&Ys(e,n,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&Cp(e);e=e.sibling}}function ff(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,_a(e.child,!1))}ff(e)}e=e.sibling}}function Ro(e){if(e.tag===30)e.stateNode.paired=null,_a(e.child,!1),ff(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Ro(e),e=e.sibling;else ff(e)}function Dp(e){for(e=e.child;e!==null;)e.tag===30?_a(e.child,!1):(e.subtreeFlags&33554432)!==0&&Dp(e),e=e.sibling}function df(e,t,n,a,l,o,d){for(var p=!1;t!==null;){if(t.tag===5){var j=t.stateNode;if(o!==null&&Dn<o.length){var R=o[Dn],Y=$f(j);(R.view||Y.view)&&(p=!0);var J;if(J=(e.flags&4)===0)if(Y.clip)J=!0;else{J=R.rect;var D=Y.rect;J=J.y!==D.y||J.x!==D.x||J.height!==D.height||J.width!==D.width}J&&(e.flags|=4),Y.abs?Y=!R.abs:(R=R.rect,Y=Y.rect,Y=R.height!==Y.height||R.width!==Y.width),Y&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&Ag(j,Dn===0?n:n+"_"+Dn,l),p&&(e.flags&4)!==0||(Aa===null&&(Aa=[]),Aa.push(j,Dn===0?a:a+"_"+Dn,t.memoizedProps)),Dn++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&d?e.flags|=t.flags&32:df(e,t.child,n,a,l,o,d)&&(p=!0));t=t.sibling}return p}function Op(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,a=e.stateNode,l=Ga(n,a),o=$a(n.default,n.update),d;d=e.memoizedState,e.memoizedState=null,a=e;var p=e.child;Dn=0,l=df(a,p,l,l,o,d,!1),(e.flags&4)!==0&&l&&Is(e,n.onUpdate)}else(e.subtreeFlags&33554432)!==0&&Op(e);e=e.sibling}}var sn=!1,dt=!1,Ca=!1,hf=!1,Rp=typeof WeakSet=="function"?WeakSet:Set,rn=null,Da=!1,$i=!1,Mo=!1,mf=!1;function vb(e,t,n){if(e=e.containerInfo,Bf=si,e=Lh(e),Wc(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var o=l.anchorOffset,d=l.focusNode;l=l.focusOffset;try{a.nodeType,d.nodeType}catch{a=null;break e}var p=0,j=-1,R=-1,Y=0,J=0,D=e,B=null;t:for(;;){for(var ye;D!==a||o!==0&&D.nodeType!==3||(j=p+o),D!==d||l!==0&&D.nodeType!==3||(R=p+l),D.nodeType===3&&(p+=D.nodeValue.length),(ye=D.firstChild)!==null;)B=D,D=ye;for(;;){if(D===e)break t;if(B===a&&++Y===o&&(j=p),B===d&&++J===l&&(R=p),(ye=D.nextSibling)!==null)break;D=B,B=D.parentNode}D=ye}a=j===-1||R===-1?null:{start:j,end:R}}else a=null}a=a||{start:0,end:0}}else a=null;for(qf={focusedElem:e,selectionRange:a},si=!1,n=(n&335544064)===n,rn=t,t=n?9270:1024;rn!==null;){if(e=rn,n&&(a=e.deletions,a!==null))for(o=0;o<a.length;o++)n&&uf(a[o]);if(e.alternate===null&&(e.flags&2)!==0)n&&kp(e),zo(n);else{if(e.tag===22){if(a=e.alternate,e.memoizedState!==null){a!==null&&a.memoizedState===null&&n&&uf(a),zo(n);continue}else if(a!==null&&a.memoizedState!==null){n&&kp(e),zo(n);continue}}a=e.child,(e.subtreeFlags&t)!==0&&a!==null?(a.return=e,rn=a):(n&&Cp(e),zo(n))}}Yn=null}function zo(e){for(;rn!==null;){var t=rn,n=e,a=t.alternate,l=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((l&1024)!==0&&a!==null){n=void 0,l=a.memoizedProps,a=a.memoizedState;var o=t.stateNode;try{var d=rs(t.type,l);n=o.getSnapshotBeforeUpdate(d,a),o.__reactInternalSnapshotBeforeUpdate=n}catch(p){bt(t,t.return,p)}}break;case 3:if((l&1024)!==0){if(a=t.stateNode.containerInfo,n=a.nodeType,n===9)Zf(a);else if(n===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Zf(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&a!==null&&(n=Ga(a.memoizedProps,a.stateNode),l=t.memoizedProps,l=$a(l.default,l.update),l!=="none"&&Ys(a,n,l,a.memoizedState=[],!0));break;default:if((l&1024)!==0)throw Error(u(163))}if(a=t.sibling,a!==null){a.return=t.return,rn=a;break}rn=t.return}}function Mp(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:Oa(e,n),a&4&&Xi(5,n);break;case 1:if(Oa(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(d){bt(n,n.return,d)}else{var l=rs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(l,t,e.__reactInternalSnapshotBeforeUpdate)}catch(d){bt(n,n.return,d)}}a&64&&wp(n),a&512&&ka(n,n.return);break;case 3:if(Oa(e,n),a&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{fm(e,t)}catch(d){bt(n,n.return,d)}}break;case 27:t===null&&a&4&&Ep(n);case 26:case 5:Oa(e,n),t===null&&a&4&&af(n),a&512&&ka(n,n.return);break;case 12:Oa(e,n);break;case 31:Oa(e,n),a&4&&Hp(e,n);break;case 13:Oa(e,n),a&4&&Bp(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Cb.bind(null,n),fx(e,n))));break;case 22:if(a=n.memoizedState!==null||sn,!a){var o=t!==null&&t.memoizedState!==null||dt;t=sn,l=dt,sn=a,(dt=o)&&!l?(a=2,(n.subtreeFlags&8772)!==0&&(a|=1),ya(e,n,a)):Oa(e,n),sn=t,dt=l}break;case 30:Oa(e,n),a&512&&ka(n,n.return);break;case 7:a&512&&ka(n,n.return);default:Oa(e,n)}}function pf(e,t){for(e=e.child;e!==null;)zp(e,t),e=e.sibling}function zp(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var a=n.style;typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"}else{var l=e.stateNode,o=e.memoizedProps.style,d=o!=null&&o.hasOwnProperty("display")?o.display:null;l.style.display=d==null||typeof d=="boolean"?"":(""+d).trim()}}catch(j){bt(e,e.return,j)}gf(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,it=!0}catch(j){bt(e,e.return,j)}break;case 18:try{var p=e.stateNode;t?kg(p,!0):kg(e.stateNode,!1)}catch(j){bt(e,e.return,j)}break;case 22:case 23:e.memoizedState===null&&pf(e,t);break;default:pf(e,t)}}function gf(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var n=e,a=t;switch(n.tag){case 4:zp(n,a);break e;case 22:n.memoizedState===null&&gf(n,a);break e;default:gf(n,a)}}e=e.sibling}}function Up(e){var t=e.alternate;t!==null&&(e.alternate=null,Up(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ba(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Ot=null,On=!1;function pa(e,t,n){for(n=n.child;n!==null;)Lp(e,t,n),n=n.sibling}function Lp(e,t,n){if(Rt&&typeof Rt.onCommitFiberUnmount=="function")try{Rt.onCommitFiberUnmount(Un,n)}catch{}switch(n.tag){case 26:dt||dn(n,t),pa(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!dt&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:dt||dn(n,t),Gi(n);var a=Ot,l=On;Dl(n.type)&&(Ot=n.stateNode,On=!1),pa(e,t,n),Yg(n.stateNode,n.type,n.memoizedProps),Ot=a,On=l;break;case 5:dt||dn(n,t),Gi(n);case 6:if(n.tag===6&&Gi(n),a=Ot,l=On,Ot=null,pa(e,t,n),Ot=a,On=l,Ot!==null)if(On)try{(Ot.nodeType===9?Ot.body:Ot.nodeName==="HTML"?Ot.ownerDocument.body:Ot).removeChild(n.stateNode),it=!0}catch(o){bt(n,t,o)}else try{Ot.removeChild(n.stateNode),it=!0}catch(o){bt(n,t,o)}break;case 18:Ot!==null&&(On?(e=Ot,Eg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ii(e)):Eg(Ot,n.stateNode));break;case 4:a=Ot,l=On,Ot=n.stateNode.containerInfo,On=!0,pa(e,t,n),Ot=a,On=l;break;case 0:case 11:case 14:case 15:jl(2,n,t),dt||jl(4,n,t),pa(e,t,n);break;case 1:dt||(dn(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&Np(n,t,a)),pa(e,t,n);break;case 21:pa(e,t,n);break;case 22:dt=(a=dt)||n.memoizedState!==null,pa(e,t,n),dt=a;break;case 30:dn(n,t),pa(e,t,n);break;case 7:dt||dn(n,t),pa(e,t,n);break;default:pa(e,t,n)}}function Hp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ii(e)}catch(n){bt(t,t.return,n)}}}function Bp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ii(e)}catch(n){bt(t,t.return,n)}}function bb(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Rp),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Rp),t;default:throw Error(u(435,e.tag))}}function Uo(e,t){var n=bb(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var l=Db.bind(null,e,a);a.then(l,l)}})}function Tn(e,t,n){var a=t.deletions;if(a!==null)for(var l=0;l<a.length;l++){var o=a[l],d=e,p=t,j=p;e:for(;j!==null;){switch(j.tag){case 27:if(Dl(j.type)){Ot=j.stateNode,On=!1;break e}break;case 5:Ot=j.stateNode,On=!1;break e;case 3:case 4:Ot=j.stateNode.containerInfo,On=!0;break e}j=j.return}if(Ot===null)throw Error(u(160));Lp(d,p,o),Ot=null,On=!1,d=o.alternate,d!==null&&(d.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)qp(t,e,n),t=t.sibling}var ga=null;function qp(e,t,n){var a=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(l&4&&(a=e.updateQueue,a=a!==null?a.events:null,a!==null))for(var o=0;o<a.length;o++){var d=a[o];d.ref.impl=d.nextImpl}Tn(t,e,n),En(e),l&4&&(jl(3,e,e.return),Xi(3,e),jl(5,e,e.return));break;case 1:Tn(t,e,n),En(e),l&512&&(dt||a===null||dn(a,a.return)),l&64&&sn&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=ga,Tn(t,e,n),En(e),l&512&&(dt||a===null||dn(a,a.return)),l&4)if(l=a!==null?a.memoizedState:null,n=e.memoizedState,a===null)if(n===null)if(e.stateNode===null)if(sn)e.stateNode=Ng(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,n=e.memoizedProps,l=o.ownerDocument||o;t:switch(t){case"title":a=l.getElementsByTagName("title")[0],(!a||a[ul]||a[Vt]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=l.createElement(t),l.head.insertBefore(a,l.querySelector("head > title"))),hn(a,t,n),a[Vt]=e,yt(a),t=a;break e;case"link":if(o=Zg("link","href",l).get(t+(n.href||""))){for(d=0;d<o.length;d++)if(a=o[d],a.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&a.getAttribute("rel")===(n.rel==null?null:n.rel)&&a.getAttribute("title")===(n.title==null?null:n.title)&&a.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(d,1);break t}}a=l.createElement(t),hn(a,t,n),l.head.appendChild(a);break;case"meta":if(o=Zg("meta","content",l).get(t+(n.content||""))){for(d=0;d<o.length;d++)if(a=o[d],a.getAttribute("content")===(n.content==null?null:""+n.content)&&a.getAttribute("name")===(n.name==null?null:n.name)&&a.getAttribute("property")===(n.property==null?null:n.property)&&a.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&a.getAttribute("charset")===(n.charSet==null?null:n.charSet)){o.splice(d,1);break t}}a=l.createElement(t),hn(a,t,n),l.head.appendChild(a);break;default:throw Error(u(468,t))}a[Vt]=e,yt(a),t=a}e.stateNode=t}else sn||ed(o,e.type,e.stateNode);else e.stateNode=Qg(o,n,e.memoizedProps);else l!==n?(l===null?(t=a.stateNode,t===null||dt||t.parentNode.removeChild(t)):l.count--,n===null?sn||ed(o,e.type,e.stateNode):Qg(o,n,e.memoizedProps)):n===null&&e.stateNode!==null&&lf(e,e.memoizedProps,a.memoizedProps);break;case 27:Tn(t,e,n),En(e),l&512&&(dt||a===null||dn(a,a.return)),a!==null&&l&4&&lf(e,e.memoizedProps,a.memoizedProps);break;case 5:if(o=Ca,Ca=!1,Tn(t,e,n),Ca=o,En(e),l&512&&(dt||a===null||dn(a,a.return)),e.flags&32){t=e.stateNode;try{Ht(t,""),it=!0}catch(Y){bt(e,e.return,Y)}}l&4&&e.stateNode!=null&&(t=e.memoizedProps,lf(e,t,a!==null?a.memoizedProps:t)),l&1024&&(hf=!0);break;case 6:if(Tn(t,e,n),En(e),l&4){if(e.stateNode===null)throw Error(u(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,it=!0}catch(Y){bt(e,e.return,Y)}}break;case 3:if(it=!1,Fo=null,o=ga,ga=Wi(t.containerInfo),Tn(t,e,n),ga=o,En(e),l&4&&a!==null&&a.memoizedState.isDehydrated)try{ii(t.containerInfo)}catch(Y){bt(e,e.return,Y)}hf&&(hf=!1,Yp(e)),it=!1;break;case 4:l=Ca,Ca=sn,a=qr(),o=ga,ga=Wi(e.stateNode.containerInfo),Tn(t,e,n),En(e),ga=o,it&&$i&&(Mo=!0),it=a,Ca=l;break;case 12:Tn(t,e,n),En(e);break;case 31:Tn(t,e,n),En(e),l&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Uo(e,t)));break;case 13:Tn(t,e,n),En(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Bo=Ee()),l&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Uo(e,t)));break;case 22:o=e.memoizedState!==null,d=a!==null&&a.memoizedState!==null;var p=sn,j=dt,R=Ca;sn=p||o,Ca=R||o,dt=j||d,Tn(t,e,n),dt=j,Ca=R,sn=p,En(e),l&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||a===null||d||sn||dt||(t=d||dt,n=sn,a=dt,sn=o||sn,dt=t,Tl(e,2),sn=n,dt=a),!o&&Ca||pf(e,o)),l&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Uo(e,n))));break;case 19:Tn(t,e,n),En(e),l&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Uo(e,t)));break;case 30:l&512&&(dt||a===null||dn(a,a.return)),l=qr(),o=$i,d=(n&335544064)===n,p=e.memoizedProps,$i=d&&$a(p.default,p.update)!=="none",Tn(t,e,n),En(e),d&&a!==null&&it&&(e.flags|=4),$i=o,it=l;break;case 21:break;case 7:l&512&&(dt||a===null||dn(a,a.return)),a&&a.stateNode!==null&&(a.stateNode._fragmentFiber=e);default:Tn(t,e,n),En(e)}}function En(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(Tp(a)){n=a;break}a=a.return}a=null;for(var l=e.return;l!==null;){if(nf(l)){var o=l.stateNode;a===null?a=[o]:a.push(o)}if(tf(l))break;l=l.return}var d=a;if(n==null)throw Error(u(160));switch(n.tag){case 27:var p=n.stateNode,j=sf(e);Co(e,j,p,d);break;case 5:var R=n.stateNode;n.flags&32&&(Ht(R,""),n.flags&=-33);var Y=sf(e);Co(e,Y,R,d);break;case 3:case 4:var J=n.stateNode.containerInfo,D=sf(e);rf(e,D,J,d);break;default:throw Error(u(161))}}catch(B){bt(e,e.return,B)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Yp(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Yp(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,si=!0,t.reset(),si=!1),e=e.sibling}}function Xs(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Xp(t,e),t=t.sibling;else Op(t)}function Xp(e,t){var n=e.alternate;if(n===null)of(e,!1);else switch(e.tag){case 3:if(mf=Da=!1,Ap(),Xs(t,e),!Da&&!Mo){if(e=Aa,e!==null)for(var a=0;a<e.length;a+=3){n=e[a];var l=e[a+1];_g(n,e[a+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+l+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),mf=!0}Aa=null;break;case 5:Xs(t,e);break;case 4:a=Da,Da=!1,Xs(t,e),Da&&(Mo=!0),Da=a;break;case 22:e.memoizedState===null&&(n.memoizedState!==null?of(e,!1):Xs(t,e));break;case 30:a=Da,l=Ap(),Da=!1,Xs(t,e),Da&&(e.flags|=4);var o=e.memoizedProps,d=e.stateNode;t=Ga(o,d),d=Ga(n.memoizedProps,d);var p=$a(o.default,o.update);p==="none"?t=!1:(o=n.memoizedState,n.memoizedState=null,n=e.child,Dn=0,t=df(e,n,t,d,p,o,!0),Dn!==(o===null?0:o.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(Is(e,e.memoizedProps.onUpdate),Aa=l):l!==null&&(l.push.apply(l,Aa),Aa=l),Da=(e.flags&32)!==0?!0:a;break;default:Xs(t,e)}}function Oa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Mp(e,t.alternate,t),t=t.sibling}function Tl(e,t){for(e=e.child;e!==null;){var n=e,a=t;switch(n.tag){case 0:case 11:case 14:case 15:jl(4,n,n.return),Tl(n,a);break;case 1:dn(n,n.return);var l=n.stateNode;typeof l.componentWillUnmount=="function"&&Np(n,n.return,l),Tl(n,a);break;case 27:(a&2)!==0&&Yg(n.stateNode,n.type,n.memoizedProps);case 5:dn(n,n.return),n.tag!==5&&n.tag!==27||Gi(n),Tl(n,a);break;case 6:Gi(n);break;case 26:dn(n,n.return),l=n.stateNode,n.memoizedState!==null||l===null||dt||l.parentNode.removeChild(l),Tl(n,a);break;case 22:n.memoizedState===null&&Tl(n,a);break;case 30:dn(n,n.return),Tl(n,a);break;case 7:dn(n,n.return);default:Tl(n,a)}e=e.sibling}}function ya(e,t,n){for(n=(t.subtreeFlags&8772)!==0?n:n&-2,t=t.child;t!==null;){var a=t.alternate,l=e,o=t,d=o.flags,p=(n&1)!==0;switch(o.tag){case 0:case 11:case 15:ya(l,o,n),Xi(4,o);break;case 1:if(ya(l,o,n),a=o,l=a.stateNode,typeof l.componentDidMount=="function")try{l.componentDidMount()}catch(Y){bt(a,a.return,Y)}if(a=o,l=a.updateQueue,l!==null){var j=a.stateNode;try{var R=l.shared.hiddenCallbacks;if(R!==null)for(l.shared.hiddenCallbacks=null,l=0;l<R.length;l++)um(R[l],j)}catch(Y){bt(a,a.return,Y)}}p&&d&64&&wp(o),ka(o,o.return);break;case 27:(n&2)!==0&&Ep(o);case 5:o.tag!==5&&o.tag!==27||jp(o),ya(l,o,n),p&&a===null&&d&4&&af(o),ka(o,o.return);break;case 6:jp(o);break;case 26:j=o.stateNode,o.memoizedState!==null||j===null||sn||ed(Wi(j.ownerDocument),o.type,j),ya(l,o,n),p&&a===null&&d&4&&af(o),ka(o,o.return);break;case 12:ya(l,o,n);break;case 31:ya(l,o,n),p&&d&4&&Hp(l,o);break;case 13:ya(l,o,n),p&&d&4&&Bp(l,o);break;case 22:o.memoizedState===null&&ya(l,o,n),ka(o,o.return);break;case 30:ya(l,o,n),ka(o,o.return);break;case 7:ka(o,o.return);default:ya(l,o,n)}t=t.sibling}}function yf(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&_i(n))}function vf(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&_i(e))}function ia(e,t,n,a){var l=(n&335544064)===n;if(t.subtreeFlags&(l?10262:10256))for(t=t.child;t!==null;)Gp(e,t,n,a),t=t.sibling;else l&&Dp(t)}function Gp(e,t,n,a){var l=(n&335544064)===n;l&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Ro(t);var o=t.flags;switch(t.tag){case 0:case 11:case 15:ia(e,t,n,a),o&2048&&Xi(9,t);break;case 1:ia(e,t,n,a);break;case 3:ia(e,t,n,a),l&&mf&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),o&2048&&(o=null,t.alternate!==null&&(o=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==o&&(t.refCount++,o!=null&&_i(o)));break;case 12:if(o&2048){ia(e,t,n,a),o=t.stateNode;try{var d=t.memoizedProps,p=d.id,j=d.onPostCommit;typeof j=="function"&&j(p,t.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(R){bt(t,t.return,R)}}else ia(e,t,n,a);break;case 31:ia(e,t,n,a);break;case 13:ia(e,t,n,a);break;case 23:break;case 22:d=t.stateNode,p=t.alternate,t.memoizedState!==null?(l&&p!==null&&p.memoizedState===null&&Ro(p),d._visibility&2?ia(e,t,n,a):Vi(e,t)):(l&&p!==null&&p.memoizedState!==null&&Ro(t),d._visibility&2?ia(e,t,n,a):(d._visibility|=2,Gs(e,t,n,a,(t.subtreeFlags&10256)!==0||!1))),o&2048&&yf(p,t);break;case 24:ia(e,t,n,a),o&2048&&vf(t.alternate,t);break;case 30:l&&(o=t.alternate,o!==null&&(_a(o.child,!0),_a(t.child,!0))),ia(e,t,n,a);break;default:ia(e,t,n,a)}}function Gs(e,t,n,a,l){for(l=l&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var o=e,d=t,p=n,j=a,R=d.flags;switch(d.tag){case 0:case 11:case 15:Gs(o,d,p,j,l),Xi(8,d);break;case 23:break;case 22:var Y=d.stateNode;d.memoizedState!==null?Y._visibility&2?Gs(o,d,p,j,l):Vi(o,d):(Y._visibility|=2,Gs(o,d,p,j,l)),l&&R&2048&&yf(d.alternate,d);break;case 24:Gs(o,d,p,j,l),l&&R&2048&&vf(d.alternate,d);break;default:Gs(o,d,p,j,l)}t=t.sibling}}function Vi(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,l=a.flags;switch(a.tag){case 22:Vi(n,a),l&2048&&yf(a.alternate,a);break;case 24:Vi(n,a),l&2048&&vf(a.alternate,a);break;default:Vi(n,a)}t=t.sibling}}var os=8192;function cs(e,t,n){if(e.subtreeFlags&os)for(e=e.child;e!==null;)$p(e,t,n),e=e.sibling}function $p(e,t,n){switch(e.tag){case 26:cs(e,t,n),e.flags&os&&(e.memoizedState!==null?Tx(n,ga,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&Fg(n,e)));break;case 5:cs(e,t,n),e.flags&os&&(e=e.stateNode,(t&335544128)===t&&Fg(n,e));break;case 3:case 4:var a=ga;ga=Wi(e.stateNode.containerInfo),cs(e,t,n),ga=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=os,os=16777216,cs(e,t,n),os=a):cs(e,t,n));break;case 30:if((e.flags&os)!==0&&(a=e.memoizedProps.name,a!=null&&a!=="auto")){var l=e.stateNode;l.paired=null,Yn===null&&(Yn=new Map),Yn.set(a,l)}cs(e,t,n);break;default:cs(e,t,n)}}function Vp(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Qi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];rn=a,Zp(a,e)}Vp(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Qp(e),e=e.sibling}function Qp(e){switch(e.tag){case 0:case 11:case 15:Qi(e),e.flags&2048&&jl(9,e,e.return);break;case 3:Qi(e);break;case 12:Qi(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Lo(e)):Qi(e);break;default:Qi(e)}}function Lo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];rn=a,Zp(a,e)}Vp(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:jl(8,t,t.return),Lo(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Lo(t));break;default:Lo(t)}e=e.sibling}}function Zp(e,t){for(;rn!==null;){var n=rn;switch(n.tag){case 0:case 11:case 15:jl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var a=n.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:_i(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,rn=a;else e:for(n=e;rn!==null;){a=rn;var l=a.sibling,o=a.return;if(Up(a),a===n){rn=null;break e}if(l!==null){l.return=o,rn=l;break e}rn=o}}}var xb={getCacheForType:function(e){var t=cn(Zt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return cn(Zt).controller.signal}},Sb=typeof WeakMap=="function"?WeakMap:Map,ft=0,Tt=null,et=null,nt=0,vt=0,Xn=null,El=!1,$s=!1,bf=!1,Wa=0,qt=0,kl=0,us=0,Ho=0,Gn=0,Vs=0,Zi=null,Rn=null,xf=!1,Bo=0,Kp=0,qo=1/0,Yo=null,Al=null,zt=0,va=null,fs=null,Ra=0,Sf=0,wf=null,Ip=null,Qs=null,Zs=null,Ks=null,Ki=0,Xo=null;function $n(){return(ft&2)!==0&&nt!==0?nt&-nt:fe.T!==null?Of():cl()}function Jp(){if(Gn===0)if((nt&536870912)===0||Je){var e=Te;Te<<=1,(Te&3932160)===0&&(Te=262144),Gn=e}else Gn=536870912;return e=un.current,e!==null&&(e.flags|=32),Gn}function Is(e,t){if(t!=null){var n=e.stateNode,a=n.ref;a===null&&(a=n.ref=Cg(Ga(e.memoizedProps,n))),Zs===null&&(Zs=[]),Zs.push(t.bind(null,a))}}function Mn(e,t,n){(e===Tt&&(vt===2||vt===9)||e.cancelPendingCommit!==null)&&(Js(e,0),_l(e,nt,Gn,!1)),Pn(e,n),((ft&2)===0||e!==Tt)&&(e===Tt&&((ft&2)===0&&(us|=n),qt===4&&_l(e,nt,Gn,!1)),Ma(e))}function Fp(e,t,n){if((ft&6)!==0)throw Error(u(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Et(e,t),l=a?jb(e,t):jf(e,t,!0),o=a;do{if(l===0){$s&&!a&&_l(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!wb(n)){l=jf(e,t,!1),o=!1;continue}if(l===2){if(o=t,e.errorRecoveryDisabledLanes&o)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){t=d;e:{var p=e;l=Zi;var j=p.current.memoizedState.isDehydrated;if(j&&(Js(p,d).flags|=256),d=jf(p,d,!1),d!==2&&d!==6){if(bf&&!j){p.errorRecoveryDisabledLanes|=o,us|=o,l=4;break e}o=Rn,Rn=l,o!==null&&(Rn===null?Rn=o:Rn.push.apply(Rn,o))}l=d}if(o=!1,l!==2)continue}}if(l===1){Js(e,0),_l(e,t,0,!0);break}e:{switch(a=e,o=l,o){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:_l(a,t,Gn,!El);break e;case 2:Rn=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(l=Bo+300-Ee(),10<l)){if(_l(a,t,Gn,!El),bn(a,0,!0)!==0)break e;Ra=t,a.timeoutHandle=Gf(Pp.bind(null,a,n,Rn,Yo,xf,t,Gn,us,Vs,El,o,"Throttled",-0,0),l);break e}Pp(a,n,Rn,Yo,xf,t,Gn,us,Vs,El,o,null,-0,0)}}break}while(!0);Ma(e)}function Pp(e,t,n,a,l,o,d,p,j,R,Y,J,D,B){e.timeoutHandle=-1;var ye=t.subtreeFlags,Ce=(o&335544064)===o;if(J=null,(Ce||ye&8192||(ye&16785408)===16785408)&&(J={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ja},Yn=null,$p(t,o,J),Ce&&(ye=J,Ce=e.containerInfo,Ce=(Ce.nodeType===9?Ce:Ce.ownerDocument).__reactViewTransition,Ce!=null&&(ye.count++,ye.waitingForViewTransition=!0,ye=nr.bind(ye),Ce.finished.then(ye,ye))),ye=(o&62914560)===o?Bo-Ee():(o&4194048)===o?Kp-Ee():0,ye=Ex(J,ye),ye!==null)){Ra=o,e.cancelPendingCommit=ye(ig.bind(null,e,t,o,n,a,l,d,p,j,R,Y,J,null,D,B)),_l(e,o,d,!R);return}ig(e,t,o,n,a,l,d,p,j,R,Y,J)}function wb(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var l=n[a],o=l.getSnapshot;l=l.value;try{if(!Bn(o(),l))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function _l(e,t,n,a){t=nn(e,t),t&=~Ho,t&=~us,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var l=t;0<l;){var o=31-Mt(l),d=1<<o;a[o]=-1,l&=~d}n!==0&&fa(e,n,t)}function Go(){return(ft&6)===0?(Ii(0),!1):!0}function Nf(){if(et!==null){if(vt===0)var e=et.return;else e=et,Za=Pl=null,Cu(e),Us=null,Oi=0,e=et;for(;e!==null;)Sp(e.alternate,e),e=e.return;et=null}}function Js(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Qb(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ra=0,Nf(),Tt=e,et=n=Va(e.current,null),nt=t,vt=0,Xn=null,El=!1,$s=Et(e,t),bf=!1,Vs=Gn=Ho=us=kl=qt=0,Rn=Zi=null,xf=!1,Wa=nn(e,t),Jr(),n}function Wp(e,t){$e=null,fe.H=wo,t===zs||t===ro?(t=im(),vt=3):t===yu?(t=im(),vt=4):vt=t===Vu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Xn=t,et===null&&(qt=1,No(e,na(t,e.current)))}function eg(){var e=un.current;return e===null?!0:(nt&4194048)===nt?Sn===null:(nt&62914560)===nt||(nt&536870912)!==0?e===Sn:!1}function tg(){var e=fe.H;return fe.H=wo,e===null?wo:e}function ng(){var e=fe.A;return fe.A=xb,e}function $o(){qt=4,El||(nt&4194048)!==nt&&un.current!==null||($s=!0),(kl&134217727)===0&&(us&134217727)===0||Tt===null||_l(Tt,nt,Gn,!1)}function jf(e,t,n){var a=ft;ft|=2;var l=tg(),o=ng();(Tt!==e||nt!==t)&&(Yo=null,Js(e,t)),t=!1;var d=qt;e:do try{if(vt!==0&&et!==null){var p=et,j=Xn;switch(vt){case 8:Nf(),d=6;break e;case 3:case 2:case 9:case 6:un.current===null&&(t=!0);var R=vt;if(vt=0,Xn=null,Fs(e,p,j,R),n&&$s){d=0;break e}break;default:R=vt,vt=0,Xn=null,Fs(e,p,j,R)}}Nb(),d=qt;break}catch(Y){Wp(e,Y)}while(!0);return t&&e.shellSuspendCounter++,Za=Pl=null,ft=a,fe.H=l,fe.A=o,et===null&&(Tt=null,nt=0,Jr()),d}function Nb(){for(;et!==null;)ag(et)}function jb(e,t){var n=ft;ft|=2;var a=tg(),l=ng();Tt!==e||nt!==t?(Yo=null,qo=Ee()+500,Js(e,t)):$s=Et(e,t);e:do try{if(vt!==0&&et!==null){t=et;var o=Xn;t:switch(vt){case 1:vt=0,Xn=null,Fs(e,t,o,1);break;case 2:case 9:if(lm(o)){vt=0,Xn=null,lg(t);break}t=function(){vt!==2&&vt!==9||Tt!==e||(vt=7),Ma(e)},o.then(t,t);break e;case 3:vt=7;break e;case 4:vt=5;break e;case 7:lm(o)?(vt=0,Xn=null,lg(t)):(vt=0,Xn=null,Fs(e,t,o,7));break;case 5:var d=null;switch(et.tag){case 26:d=et.memoizedState;case 5:case 27:var p=et;if(d?Ig(d):p.stateNode.complete){vt=0,Xn=null;var j=p.sibling;if(j!==null)et=j;else{var R=p.return;R!==null?(et=R,Vo(R)):et=null}break t}}vt=0,Xn=null,Fs(e,t,o,5);break;case 6:vt=0,Xn=null,Fs(e,t,o,6);break;case 8:Nf(),qt=6;break e;default:throw Error(u(462))}}Tb();break}catch(Y){Wp(e,Y)}while(!0);return Za=Pl=null,fe.H=a,fe.A=l,ft=n,et!==null?0:(Tt=null,nt=0,Jr(),qt)}function Tb(){for(;et!==null&&!ge();)ag(et)}function ag(e){var t=bp(e.alternate,e,Wa);e.memoizedProps=e.pendingProps,t===null?Vo(e):et=t}function lg(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=dp(n,t,t.pendingProps,t.type,void 0,nt);break;case 11:t=dp(n,t,t.pendingProps,t.type.render,t.ref,nt);break;case 5:Cu(t);var a=t;a===ln&&(Je?(no(a),a.tag===5&&a.stateNode!=null&&(kt=a.stateNode)):(no(a),Je=!0));default:Sp(n,t),t=et=Zh(t,Wa),t=bp(n,t,Wa)}e.memoizedProps=e.pendingProps,t===null?Vo(e):et=t}function Fs(e,t,n,a){Za=Pl=null,Cu(t),Us=null,Oi=0;var l=t.return;try{if(db(e,l,t,n,nt)){qt=1,No(e,na(n,e.current)),et=null;return}}catch(o){if(l!==null)throw et=l,o;qt=1,No(e,na(n,e.current)),et=null;return}t.flags&32768?(Je||a===1?e=!0:$s||(nt&536870912)!==0?e=!1:(El=e=!0,(a===2||a===9||a===3||a===6)&&(a=un.current,a!==null&&a.tag===13&&(a.flags|=16384))),sg(t,e)):Vo(t)}function Vo(e){var t=e;do{if((t.flags&32768)!==0){sg(t,El);return}e=t.return;var n=gb(t.alternate,t,Wa);if(n!==null){et=n;return}if(t=t.sibling,t!==null){et=t;return}et=t=e}while(t!==null);qt===0&&(qt=5)}function sg(e,t){do{var n=yb(e.alternate,e);if(n!==null){n.flags&=32767,et=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){et=e;return}et=e=n}while(e!==null);qt=6,et=null}function ig(e,t,n,a,l,o,d,p,j,R,Y,J){e.cancelPendingCommit=null;do Qo();while(zt!==0);if((ft&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));e===Tt&&(et=Tt=null,nt=0),fs=t,va=e,Ra=n,wf=l,Ip=a,Eb(e,t,n,d,p,j,J)}}function Eb(e,t,n,a,l,o,d){var p=t.lanes|t.childLanes;if(Sf=p,p|=lu,Ss(e,n,p,a,l,o),Zs=null,(n&335544064)===n?(Ks=eb(e),a=10262):(Ks=null,a=10256),(t.subtreeFlags&a)!==0||(t.flags&a)!==0?(e.callbackNode=null,e.callbackPriority=0,Ob(vn,function(){return Af(),null})):(e.callbackNode=null,e.callbackPriority=0),Do=!1,a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=fe.T,fe.T=null,l=we.p,we.p=2,o=ft,ft|=4;try{vb(e,t,n)}finally{ft=o,we.p=l,fe.T=a}}zt=1,Do?Qs=Pb(d,e.containerInfo,Ks,Tf,Ef,Ab,kf,Af,kb):(Tf(),Ef(),kf())}function kb(e){if(zt!==0){var t=va.onRecoverableError;t(e,{componentStack:null})}}function Ab(){zt===3&&(zt=0,Xp(fs,va),zt=4)}function Tf(){if(zt===1){zt=0;var e=va,t=fs,n=Ra,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=fe.T,fe.T=null;var l=we.p;we.p=2;var o=ft;ft|=4;try{$i=Mo=!1,qp(t,e,n),n=qf;var d=Lh(e.containerInfo),p=n.focusedElem,j=n.selectionRange;if(d!==p&&p&&p.ownerDocument&&Uh(p.ownerDocument.documentElement,p)){if(j!==null&&Wc(p)){var R=j.start,Y=j.end;if(Y===void 0&&(Y=R),"selectionStart"in p)p.selectionStart=R,p.selectionEnd=Math.min(Y,p.value.length);else{var J=p.ownerDocument||document,D=J&&J.defaultView||window;if(D.getSelection){var B=D.getSelection(),ye=p.textContent.length,Ce=Math.min(j.start,ye),Ve=j.end===void 0?Ce:Math.min(j.end,ye);!B.extend&&Ce>Ve&&(d=Ve,Ve=Ce,Ce=d);var O=zh(p,Ce),A=zh(p,Ve);if(O&&A&&(B.rangeCount!==1||B.anchorNode!==O.node||B.anchorOffset!==O.offset||B.focusNode!==A.node||B.focusOffset!==A.offset)){var U=J.createRange();U.setStart(O.node,O.offset),B.removeAllRanges(),Ce>Ve?(B.addRange(U),B.extend(A.node,A.offset)):(U.setEnd(A.node,A.offset),B.addRange(U))}}}}for(J=[],B=p;B=B.parentNode;)B.nodeType===1&&J.push({element:B,left:B.scrollLeft,top:B.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<J.length;p++){var I=J[p];I.element.scrollLeft=I.left,I.element.scrollTop=I.top}}si=!!Bf,qf=Bf=null}finally{ft=o,we.p=l,fe.T=a}}e.current=t,zt=2}}function Ef(){if(zt===2){zt=0;var e=va,t=fs,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=fe.T,fe.T=null;var a=we.p;we.p=2;var l=ft;ft|=4;try{Mp(e,t.alternate,t)}finally{ft=l,we.p=a,fe.T=n}}zt=3}}function kf(){if(zt===4||zt===3){zt=0;var e=Qs;Qs=null,Ne();var t=va,n=fs,a=Ra,l=Ip,o=(a&335544064)===a?10262:10256;if((n.subtreeFlags&o)!==0||(n.flags&o)!==0?zt=5:(zt=0,fs=va=null,rg(t,t.pendingLanes)),o=t.pendingLanes,o===0&&(Al=null),ol(a),n=n.stateNode,Rt&&typeof Rt.onCommitFiberRoot=="function")try{Rt.onCommitFiberRoot(Un,n,void 0,(n.current.flags&128)===128)}catch{}if(l!==null){n=fe.T,o=we.p,we.p=2,fe.T=null;try{for(var d=t.onRecoverableError,p=0;p<l.length;p++){var j=l[p];d(j.value,{componentStack:j.stack})}}finally{fe.T=n,we.p=o}}if(l=Zs,d=Ks,Ks=null,l!==null&&(Zs=null,d===null&&(d=[]),e!==null))for(j=0;j<l.length;j++)n=(0,l[j])(d),n!==void 0&&e.finished.finally(n);(Ra&3)!==0&&Qo(),Ma(t),o=t.pendingLanes,(a&261930)!==0&&(o&42)!==0?t===Xo?Ki++:(Ki=0,Xo=t):(Ki=0,Xo=null),Ii(0)}}function rg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,_i(t)))}function Qo(){return Qs!==null&&(Qs.skipTransition(),Qs=null),Tf(),Ef(),kf(),Af()}function Af(){if(zt!==5)return!1;var e=va,t=Sf;Sf=0;var n=ol(Ra),a=fe.T,l=we.p;try{we.p=32>n?32:n,fe.T=null,n=wf,wf=null;var o=va,d=Ra;if(zt=0,fs=va=null,Ra=0,(ft&6)!==0)throw Error(u(331));var p=ft;if(ft|=4,Qp(o.current),Gp(o,o.current,d,n),ft=p,Ii(0,!1),Rt&&typeof Rt.onPostCommitFiberRoot=="function")try{Rt.onPostCommitFiberRoot(Un,o)}catch{}return!0}finally{we.p=l,fe.T=a,rg(e,t)}}function og(e,t,n){t=na(n,t),t=$u(e.stateNode,t,2),e=xl(e,t,2),e!==null&&(Pn(e,2),Ma(e))}function bt(e,t,n){if(e.tag===3)og(e,e,n);else for(;t!==null;){if(t.tag===3){og(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Al===null||!Al.has(a))){e=na(n,e),n=lp(2),a=xl(t,n,2),a!==null&&(sp(n,a,t,e),Pn(a,2),Ma(a));break}}t=t.return}}function _f(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new Sb;var l=new Set;a.set(t,l)}else l=a.get(t),l===void 0&&(l=new Set,a.set(t,l));l.has(n)||(bf=!0,l.add(n),e=_b.bind(null,e,t,n),t.then(e,e))}function _b(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Tt===e&&(nt&n)===n&&((qt===4||qt===3&&(nt&62914560)===nt&&300>Ee()-Bo)&&(ft&2)===0?Js(e,0):Ho|=n,Vs===nt&&(Vs=0)),Ma(e)}function cg(e,t){t===0&&(t=wt()),e=Il(e,t),e!==null&&(Pn(e,t),Ma(e))}function Cb(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),cg(e,n)}function Db(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(u(314))}a!==null&&a.delete(t),cg(e,n)}function Ob(e,t){return Yt(e,t)}var Ps=null,Ws=null,Cf=!1,Zo=!1,Df=!1,Cl=0;function Ma(e){e!==Ws&&e.next===null&&(Ws===null?Ps=Ws=e:Ws=Ws.next=e),Zo=!0,Cf||(Cf=!0,Mb())}function Ii(e,t){if(!Df&&Zo){Df=!0;do for(var n=!1,a=Ps;a!==null;){if(e!==0){var l=a.pendingLanes;if(l===0)var o=0;else{var d=a.suspendedLanes,p=a.pingedLanes;o=(1<<31-Mt(42|e)+1)-1,o&=l&~(d&~p),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(n=!0,hg(a,o))}else o=nt,o=bn(a,a===Tt?o:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(o&3)===0||Et(a,o)||(n=!0,hg(a,o));a=a.next}while(n);Df=!1}}function Rb(){ug()}function ug(){Zo=Cf=!1;var e=0;Cl!==0&&Vb()&&(e=Cl);for(var t=Ee(),n=null,a=Ps;a!==null;){var l=a.next,o=fg(a,t);o===0?(a.next=null,n===null?Ps=l:n.next=l,l===null&&(Ws=n)):(n=a,(e!==0||(o&3)!==0)&&(Zo=!0)),a=l}zt!==0&&zt!==5||Ii(e),Cl!==0&&(Cl=0)}function fg(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,l=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var d=31-Mt(o),p=1<<d,j=l[d];j===-1?((p&n)===0||(p&a)!==0)&&(l[d]=wa(p,t)):j<=t&&(e.expiredLanes|=p),o&=~p}if(t=Tt,n=nt,n=bn(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(vt===2||vt===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&X(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Et(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&X(a),ol(n)){case 2:case 8:n=st;break;case 32:n=vn;break;case 268435456:n=ua;break;default:n=vn}return a=dg.bind(null,e),n=Yt(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&X(a),e.callbackPriority=2,e.callbackNode=null,2}function dg(e,t){if(zt!==0&&zt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Qo()&&e.callbackNode!==n)return null;var a=nt;return a=bn(e,e===Tt?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Fp(e,a,t),fg(e,Ee()),e.callbackNode!=null&&e.callbackNode===n?dg.bind(null,e):null)}function hg(e,t){if(Qo())return null;Fp(e,t,!0)}function Mb(){Zb(function(){(ft&6)!==0?Yt(Pe,Rb):ug()})}function Of(){if(Cl===0){var e=ts;e===0&&(e=ve,ve<<=1,(ve&261888)===0&&(ve=256)),Cl=e}return Cl}function mg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Xr(e)}function zb(e,t,n,a,l){if(t==="submit"&&n&&n.stateNode===l){var o=mg((l[Pt]||null).action),d=a.submitter;d&&(t=(t=d[Pt]||null)?mg(t.formAction):d.getAttribute("formAction"),t!==null&&(o=t,d=null));var p=new Qr("action","action",null,a,l);e.push({event:p,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Cl!==0){var j=new FormData(l,d);Bu(n,{pending:!0,data:j,method:l.method,action:o},null,j)}}else typeof o=="function"&&(p.preventDefault(),j=new FormData(l,d),Bu(n,{pending:!0,data:j,method:l.method,action:o},o,j))},currentTarget:l}]})}}for(var Rf=0;Rf<au.length;Rf++){var Mf=au[Rf],Ub=Mf.toLowerCase(),Lb=Mf[0].toUpperCase()+Mf.slice(1);ma(Ub,"on"+Lb)}ma(qh,"onAnimationEnd"),ma(Yh,"onAnimationIteration"),ma(Xh,"onAnimationStart"),ma("dblclick","onDoubleClick"),ma("focusin","onFocus"),ma("focusout","onBlur"),ma(Q0,"onTransitionRun"),ma(Z0,"onTransitionStart"),ma(K0,"onTransitionCancel"),ma(Gh,"onTransitionEnd"),Ln("onMouseEnter",["mouseout","mouseover"]),Ln("onMouseLeave",["mouseout","mouseover"]),Ln("onPointerEnter",["pointerout","pointerover"]),Ln("onPointerLeave",["pointerout","pointerover"]),Na("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Na("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Na("onBeforeInput",["compositionend","keypress","textInput","paste"]),Na("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Na("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Na("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ji="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(" "),Hb=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ji));function pg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],l=a.event;a=a.listeners;e:{var o=void 0;if(t)for(var d=a.length-1;0<=d;d--){var p=a[d],j=p.instance,R=p.currentTarget;if(p=p.listener,j!==o&&l.isPropagationStopped())break e;o=p,l.currentTarget=R;try{o(l)}catch(Y){Ir(Y)}l.currentTarget=null,o=j}else for(d=0;d<a.length;d++){if(p=a[d],j=p.instance,R=p.currentTarget,p=p.listener,j!==o&&l.isPropagationStopped())break e;o=p,l.currentTarget=R;try{o(l)}catch(Y){Ir(Y)}l.currentTarget=null,o=j}}}}function tt(e,t){var n=t[Or];n===void 0&&(n=t[Or]=new Set);var a=e+"__bubble";n.has(a)||(gg(t,e,2,!1),n.add(a))}function zf(e,t,n){var a=0;t&&(a|=4),gg(n,e,a,t)}var Ko="_reactListening"+Math.random().toString(36).slice(2);function Uf(e){if(!e[Ko]){e[Ko]=!0,Vl.forEach(function(n){n!=="selectionchange"&&(Hb.has(n)||zf(n,!1,e),zf(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ko]||(t[Ko]=!0,zf("selectionchange",!1,t))}}function gg(e,t,n,a){switch(sy(t)){case 2:var l=Cx;break;case 8:l=Dx;break;default:l=nd}n=l.bind(null,t,n,e),l=void 0,!Gc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),a?l!==void 0?e.addEventListener(t,n,{capture:!0,passive:l}):e.addEventListener(t,n,!0):l!==void 0?e.addEventListener(t,n,{passive:l}):e.addEventListener(t,n,!1)}function Lf(e,t,n,a,l){var o=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var d=a.tag;if(d===3||d===4){var p=a.stateNode.containerInfo;if(p===l)break;if(d===4)for(d=a.return;d!==null;){var j=d.tag;if((j===3||j===4)&&d.stateNode.containerInfo===l)return;d=d.return}for(;p!==null;){if(d=da(p),d===null)return;if(j=d.tag,j===5||j===6||j===26||j===27){a=o=d;continue e}p=p.parentNode}}a=a.return}gh(function(){var R=o,Y=Yc(n),J=[];e:{var D=$h.get(e);if(D!==void 0){var B=Qr,ye=e;switch(e){case"keypress":if($r(n)===0)break e;case"keydown":case"keyup":B=w0;break;case"focusin":ye="focus",B=Zc;break;case"focusout":ye="blur",B=Zc;break;case"beforeblur":case"afterblur":B=Zc;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":B=bh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":B=u0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":B=k0;break;case qh:case Yh:case Xh:B=h0;break;case Gh:B=_0;break;case"scroll":case"scrollend":B=o0;break;case"wheel":B=D0;break;case"copy":case"cut":case"paste":B=p0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":B=Sh;break;case"submit":B=T0;break;case"toggle":case"beforetoggle":B=R0}var Ce=(t&4)!==0,Ve=!Ce&&(e==="scroll"||e==="scrollend"),O=Ce?D!==null?D+"Capture":null:D;Ce=[];for(var A=R,U;A!==null;){var I=A;if(U=I.stateNode,I=I.tag,I!==5&&I!==26&&I!==27||U===null||O===null||(I=vi(A,O),I!=null&&Ce.push(Fi(A,I,U))),Ve)break;A=A.return}0<Ce.length&&(D=new B(D,ye,null,n,Y),J.push({event:D,listeners:Ce}))}}if((t&7)===0){e:{if(B=e==="mouseover"||e==="pointerover",D=e==="mouseout"||e==="pointerout",B&&n!==qc&&(ye=n.relatedTarget||n.fromElement)&&(da(ye)||ye[_n]))break e;(D||B)&&(ye=Y.window===Y?Y:(B=Y.ownerDocument)?B.defaultView||B.parentWindow:window,D?(B=n.relatedTarget||n.toElement,D=R,B=B?da(B):null,B!==null&&(Ve=h(B),Ce=B.tag,B!==Ve||Ce!==5&&Ce!==27&&Ce!==6)&&(B=null)):(D=null,B=R),D!==B&&(Ce=bh,I="onMouseLeave",O="onMouseEnter",A="mouse",(e==="pointerout"||e==="pointerover")&&(Ce=Sh,I="onPointerLeave",O="onPointerEnter",A="pointer"),Ve=D==null?ye:Wn(D),U=B==null?ye:Wn(B),ye=new Ce(I,A+"leave",D,n,Y),ye.target=Ve,ye.relatedTarget=U,I=null,da(Y)===R&&(Ce=new Ce(O,A+"enter",B,n,Y),Ce.target=U,Ce.relatedTarget=Ve,I=Ce),Ve=I,Ce=D&&B?H(D,B,Bb):null,D!==null&&yg(J,ye,D,Ce,!1),B!==null&&Ve!==null&&yg(J,Ve,B,Ce,!0)))}e:{if(D=R?Wn(R):window,B=D.nodeName&&D.nodeName.toLowerCase(),B==="select"||B==="input"&&D.type==="file")var ke=_h;else if(kh(D))if(Ch)ke=G0;else{ke=Y0;var at=q0}else B=D.nodeName,!B||B.toLowerCase()!=="input"||D.type!=="checkbox"&&D.type!=="radio"?R&&Bc(R.elementType)&&(ke=_h):ke=X0;if(ke&&(ke=ke(e,R))){Ah(J,ke,n,Y);break e}at&&at(e,D,R)}switch(at=R?Wn(R):window,e){case"focusin":(kh(at)||at.contentEditable==="true")&&(ks=at,eu=R,Ei=null);break;case"focusout":Ei=eu=ks=null;break;case"mousedown":tu=!0;break;case"contextmenu":case"mouseup":case"dragend":tu=!1,Hh(J,n,Y);break;case"selectionchange":if(V0)break;case"keydown":case"keyup":Hh(J,n,Y)}var ze;if(Ic)e:{switch(e){case"compositionstart":var Ye="onCompositionStart";break e;case"compositionend":Ye="onCompositionEnd";break e;case"compositionupdate":Ye="onCompositionUpdate";break e}Ye=void 0}else Es?Th(e,n)&&(Ye="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Ye="onCompositionStart");Ye&&(wh&&n.locale!=="ko"&&(Es||Ye!=="onCompositionStart"?Ye==="onCompositionEnd"&&Es&&(ze=yh()):(fl=Y,$c="value"in fl?fl.value:fl.textContent,Es=!0)),at=Io(R,Ye),0<at.length&&(Ye=new xh(Ye,e,null,n,Y),J.push({event:Ye,listeners:at}),ze?Ye.data=ze:(ze=Eh(n),ze!==null&&(Ye.data=ze)))),(ze=z0?U0(e,n):L0(e,n))&&(Ye=Io(R,"onBeforeInput"),0<Ye.length&&(at=new xh("onBeforeInput","beforeinput",null,n,Y),J.push({event:at,listeners:Ye}),at.data=ze)),zb(J,e,R,n,Y)}pg(J,t)})}function Fi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Io(e,t){for(var n=t+"Capture",a=[];e!==null;){var l=e,o=l.stateNode;if(l=l.tag,l!==5&&l!==26&&l!==27||o===null||(l=vi(e,n),l!=null&&a.unshift(Fi(e,l,o)),l=vi(e,t),l!=null&&a.push(Fi(e,l,o))),e.tag===3)return a;e=e.return}return[]}function Bb(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function yg(e,t,n,a,l){for(var o=t._reactName,d=[];n!==null&&n!==a;){var p=n,j=p.alternate,R=p.stateNode;if(p=p.tag,j!==null&&j===a)break;p!==5&&p!==26&&p!==27||R===null||(j=R,l?(R=vi(n,o),R!=null&&d.unshift(Fi(n,R,j))):l||(R=vi(n,o),R!=null&&d.push(Fi(n,R,j)))),n=n.return}d.length!==0&&e.push({event:t,listeners:d})}var qb=/\r\n?/g,Yb=/\u0000|\uFFFD/g;function vg(e){return(typeof e=="string"?e:""+e).replace(qb,`
49
- `).replace(Yb,"")}function bg(e,t){return t=vg(t),vg(e)===t}function xt(e,t,n,a,l,o){switch(n){case"children":if(typeof a=="string")t==="body"||t==="textarea"&&a===""||Ht(e,a);else if(typeof a=="number"||typeof a=="bigint")t!=="body"&&Ht(e,""+a);else return;break;case"className":qa(e,"class",a);break;case"tabIndex":qa(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":qa(e,n,a);break;case"style":mh(e,a,o);return;case"data":if(t!=="object"){qa(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Xr(a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(n,"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 o=="function"&&(n==="formAction"?(t!=="input"&&xt(e,t,"name",l.name,l,null),xt(e,t,"formEncType",l.formEncType,l,null),xt(e,t,"formMethod",l.formMethod,l,null),xt(e,t,"formTarget",l.formTarget,l,null)):(xt(e,t,"encType",l.encType,l,null),xt(e,t,"method",l.method,l,null),xt(e,t,"target",l.target,l,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Xr(a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=ja);return;case"onScroll":a!=null&&tt("scroll",e);return;case"onScrollEnd":a!=null&&tt("scrollend",e);return;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(u(61));if(n=a.__html,n!=null){if(l.children!=null)throw Error(u(60));(o!=null?o.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}n=Xr(a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":a===!0?e.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(n,a):e.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(n):e.setAttribute(n,a);break;case"popover":tt("beforetoggle",e),tt("toggle",e),Ql(e,"popover",a);break;case"xlinkActuate":Hn(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Hn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Hn(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Hn(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Hn(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Hn(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Hn(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Hn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Hn(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Ql(e,"is",a);break;case"innerText":case"textContent":return;default:if(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")n=i0.get(n)||n,Ql(e,n,a);else return}it=!0}function Hf(e,t,n,a,l,o){switch(n){case"style":mh(e,a,o);return;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(u(61));if(n=a.__html,n!=null){if(l.children!=null)throw Error(u(60));(o!=null?o.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"children":if(typeof a=="string")Ht(e,a);else if(typeof a=="number"||typeof a=="bigint")Ht(e,""+a);else return;break;case"onScroll":a!=null&&tt("scroll",e);return;case"onScrollEnd":a!=null&&tt("scrollend",e);return;case"onClick":a!=null&&(e.onclick=ja);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Ur.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(l=n.endsWith("Capture"),o=n.slice(2,l?n.length-7:void 0),t=e[Pt]||null,t=t!=null?t[n]:null,typeof t=="function"&&e.removeEventListener(o,t,l),typeof a=="function")){typeof t!="function"&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,a,l);break e}it=!0,n in e?e[n]=a:a===!0?e.setAttribute(n,""):Ql(e,n,a)}return}it=!0}function hn(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":tt("error",e),tt("load",e);var a=!1,l=!1,o;for(o in n)if(n.hasOwnProperty(o)){var d=n[o];if(d!=null)switch(o){case"src":a=!0;break;case"srcSet":l=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:xt(e,t,o,d,n,null)}}l&&xt(e,t,"srcSet",n.srcSet,n,null),a&&xt(e,t,"src",n.src,n,null);return;case"input":tt("invalid",e);var p=o=d=l=null,j=null,R=null;for(a in n)if(n.hasOwnProperty(a)){var Y=n[a];if(Y!=null)switch(a){case"name":l=Y;break;case"type":d=Y;break;case"checked":j=Y;break;case"defaultChecked":R=Y;break;case"value":o=Y;break;case"defaultValue":p=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(u(137,t));break;default:xt(e,t,a,Y,n,null)}}_t(e,o,p,j,R,d,l,!1);return;case"select":tt("invalid",e),a=d=o=null;for(l in n)if(n.hasOwnProperty(l)&&(p=n[l],p!=null))switch(l){case"value":o=p;break;case"defaultValue":d=p;break;case"multiple":a=p;default:xt(e,t,l,p,n,null)}t=o,n=d,e.multiple=!!a,t!=null?Qt(e,!!a,t,!1):n!=null&&Qt(e,!!a,n,!0);return;case"textarea":tt("invalid",e),o=l=a=null;for(d in n)if(n.hasOwnProperty(d)&&(p=n[d],p!=null))switch(d){case"value":a=p;break;case"defaultValue":l=p;break;case"children":o=p;break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(u(91));break;default:xt(e,t,d,p,n,null)}Ns(e,a,l,o);return;case"option":for(j in n)if(n.hasOwnProperty(j)&&(a=n[j],a!=null))switch(j){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:xt(e,t,j,a,n,null)}return;case"dialog":tt("beforetoggle",e),tt("toggle",e),tt("cancel",e),tt("close",e);break;case"iframe":case"object":tt("load",e);break;case"video":case"audio":for(a=0;a<Ji.length;a++)tt(Ji[a],e);break;case"image":tt("error",e),tt("load",e);break;case"details":tt("toggle",e);break;case"embed":case"source":case"link":tt("error",e),tt("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(R in n)if(n.hasOwnProperty(R)&&(a=n[R],a!=null))switch(R){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:xt(e,t,R,a,n,null)}return;default:if(Bc(t)){for(Y in n)n.hasOwnProperty(Y)&&(a=n[Y],a!==void 0&&Hf(e,t,Y,a,n,void 0));return}}for(p in n)n.hasOwnProperty(p)&&(a=n[p],a!=null&&xt(e,t,p,a,n,null))}var Xb={};function Gb(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var l=null,o=null,d=null,p=null,j=null,R=null,Y=null;for(B in n){var J=n[B];if(n.hasOwnProperty(B)&&J!=null)switch(B){case"checked":break;case"value":break;case"defaultValue":j=J;default:a.hasOwnProperty(B)||xt(e,t,B,null,a,J)}}for(var D in a){var B=a[D];if(J=n[D],a.hasOwnProperty(D)&&(B!=null||J!=null))switch(D){case"type":B!==J&&(it=!0),o=B;break;case"name":B!==J&&(it=!0),l=B;break;case"checked":B!==J&&(it=!0),R=B;break;case"defaultChecked":B!==J&&(it=!0),Y=B;break;case"value":B!==J&&(it=!0),d=B;break;case"defaultValue":B!==J&&(it=!0),p=B;break;case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(u(137,t));break;default:B!==J&&xt(e,t,D,B,a,J)}}We(e,d,p,j,R,Y,o,l);return;case"select":B=d=p=D=null;for(o in n)if(j=n[o],n.hasOwnProperty(o)&&j!=null)switch(o){case"value":break;case"multiple":B=j;default:a.hasOwnProperty(o)||xt(e,t,o,null,a,j)}for(l in a)if(o=a[l],j=n[l],a.hasOwnProperty(l)&&(o!=null||j!=null))switch(l){case"value":o!==j&&(it=!0),D=o;break;case"defaultValue":o!==j&&(it=!0),p=o;break;case"multiple":o!==j&&(it=!0),d=o;default:o!==j&&xt(e,t,l,o,a,j)}t=p,n=d,a=B,D!=null?Qt(e,!!n,D,!1):!!a!=!!n&&(t!=null?Qt(e,!!n,t,!0):Qt(e,!!n,n?[]:"",!1));return;case"textarea":B=D=null;for(p in n)if(l=n[p],n.hasOwnProperty(p)&&l!=null&&!a.hasOwnProperty(p))switch(p){case"value":break;case"children":break;default:xt(e,t,p,null,a,l)}for(d in a)if(l=a[d],o=n[d],a.hasOwnProperty(d)&&(l!=null||o!=null))switch(d){case"value":l!==o&&(it=!0),D=l;break;case"defaultValue":l!==o&&(it=!0),B=l;break;case"children":break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(u(91));break;default:l!==o&&xt(e,t,d,l,a,o)}Ya(e,D,B);return;case"option":for(var ye in n)if(D=n[ye],n.hasOwnProperty(ye)&&D!=null&&!a.hasOwnProperty(ye))switch(ye){case"selected":e.selected=!1;break;default:xt(e,t,ye,null,a,D)}for(j in a)if(D=a[j],B=n[j],a.hasOwnProperty(j)&&D!==B&&(D!=null||B!=null))switch(j){case"selected":D!==B&&(it=!0),e.selected=D&&typeof D!="function"&&typeof D!="symbol";break;default:xt(e,t,j,D,a,B)}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 Ce in n)D=n[Ce],n.hasOwnProperty(Ce)&&D!=null&&!a.hasOwnProperty(Ce)&&xt(e,t,Ce,null,a,D);for(R in a)if(D=a[R],B=n[R],a.hasOwnProperty(R)&&D!==B&&(D!=null||B!=null))switch(R){case"children":case"dangerouslySetInnerHTML":if(D!=null)throw Error(u(137,t));break;default:xt(e,t,R,D,a,B)}return;default:if(Bc(t)){for(var Ve in n)D=n[Ve],n.hasOwnProperty(Ve)&&D!==void 0&&!a.hasOwnProperty(Ve)&&Hf(e,t,Ve,void 0,a,D);for(Y in a)D=a[Y],B=n[Y],!a.hasOwnProperty(Y)||D===B||D===void 0&&B===void 0||Hf(e,t,Y,D,a,B);return}}for(var O in n)D=n[O],n.hasOwnProperty(O)&&D!=null&&!a.hasOwnProperty(O)&&xt(e,t,O,null,a,D);for(J in a)D=a[J],B=n[J],!a.hasOwnProperty(J)||D===B||D==null&&B==null||xt(e,t,J,D,a,B)}function xg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function $b(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var l=n[a],o=l.transferSize,d=l.initiatorType,p=l.duration;if(o&&p&&xg(d)){for(d=0,p=l.responseEnd,a+=1;a<n.length;a++){var j=n[a],R=j.startTime;if(R>p)break;var Y=j.transferSize,J=j.initiatorType;Y&&xg(J)&&(j=j.responseEnd,d+=Y*(j<p?1:(p-R)/(j-R)))}if(--a,t+=8*(o+d)/(l.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Bf=null,qf=null;function Pi(e){return e.nodeType===9?e:e.ownerDocument}function Sg(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function wg(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Ng(e,t,n,a){return n=Pi(n).createElement(e),n[Vt]=a,n[Pt]=t,hn(n,e,t),yt(n),n}function Yf(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Xf=null;function Vb(){var e=window.event;return e&&e.type==="popstate"?e===Xf?!1:(Xf=e,!0):(Xf=null,!1)}var Gf=typeof setTimeout=="function"?setTimeout:void 0,Qb=typeof clearTimeout=="function"?clearTimeout:void 0,jg=typeof Promise=="function"?Promise:void 0,Tg=typeof requestAnimationFrame=="function"?requestAnimationFrame:Gf,Zb=typeof queueMicrotask=="function"?queueMicrotask:typeof jg<"u"?function(e){return jg.resolve(null).then(e).catch(Kb)}:Gf;function Kb(e){setTimeout(function(){throw e})}function Dl(e){return e==="head"}function Eg(e,t){var n=t,a=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"||n==="/&"){if(a===0){e.removeChild(l),ii(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")Ff(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Ff(n);for(var o=n.firstChild;o;){var d=o.nextSibling,p=o.nodeName;o[ul]||p==="SCRIPT"||p==="STYLE"||p==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=d}}else n==="body"&&Ff(e.ownerDocument.body);n=l}while(n);ii(t)}function kg(e,t){var n=e;e=0;do{var a=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=a}while(n)}function Ag(e,t,n){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display==="inline"){if(t=e.getClientRects(),t.length===1)var a=1;else for(var l=a=0;l<t.length;l++){var o=t[l];0<o.width&&0<o.height&&a++}a===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+n.paddingTop,e.marginBottom="-"+n.paddingBottom)}}function _g(e,t){e=e.style,t=t.style;var n=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=n==null||typeof n=="boolean"?"":(""+n).trim(),n=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=n==null||typeof n=="boolean"?"":(""+n).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(n=t.display,e.display=n==null||typeof n=="boolean"?"":n,n=t.margin,n!=null?e.margin=n:(n=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=n==null||typeof n=="boolean"?"":n,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function Ib(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function $f(e){var t=e.getBoundingClientRect(),n=getComputedStyle(e);return Ib(t,n,e)}function Jb(e){return e.documentElement.clientHeight}function Fb(e){this.addEventListener("load",e),this.addEventListener("error",e)}function Pb(e,t,n,a,l,o,d,p,j){var R=t.nodeType===9?t:t.ownerDocument;try{var Y=R.startViewTransition({update:function(){var D=R.defaultView,B=D.navigation&&D.navigation.transition,ye=R.fonts.status;a();var Ce=[];if(ye==="loaded"&&(Jb(R),R.fonts.status==="loading"&&Ce.push(R.fonts.ready)),ye=Ce.length,e!==null)for(var Ve=e.suspenseyImages,O=0,A=0;A<Ve.length;A++){var U=Ve[A];if(!U.complete){var I=U.getBoundingClientRect();if(0<I.bottom&&0<I.right&&I.top<D.innerHeight&&I.left<D.innerWidth){if(O+=Jg(U),O>Po){Ce.length=ye;break}U=new Promise(Fb.bind(U)),Ce.push(U)}}}if(0<Ce.length)return D=Promise.race([Promise.all(Ce),new Promise(function(ke){return setTimeout(ke,500)})]).then(l,l),(B?Promise.allSettled([B.finished,D]):D).then(o,o);if(l(),B)return B.finished.then(o,o);o()},types:n});R.__reactViewTransition=Y;var J=[];return Y.ready.then(function(){for(var D=R.documentElement.getAnimations({subtree:!0}),B=0;B<D.length;B++){var ye=D[B],Ce=ye.effect,Ve=Ce.pseudoElement;if(Ve!=null&&Ve.startsWith("::view-transition")){J.push(ye),ye=Ce.getKeyframes();for(var O=Ve=void 0,A=!0,U=0;U<ye.length;U++){var I=ye[U],ke=I.width;if(Ve===void 0)Ve=ke;else if(Ve!==ke){A=!1;break}if(ke=I.height,O===void 0)O=ke;else if(O!==ke){A=!1;break}delete I.width,delete I.height,I.transform==="none"&&delete I.transform}A&&Ve!==void 0&&O!==void 0&&(Ce.setKeyframes(ye),A=getComputedStyle(Ce.target,Ce.pseudoElement),A.width!==Ve||A.height!==O)&&(A=ye[0],A.width=Ve,A.height=O,A=ye[ye.length-1],A.width=Ve,A.height=O,Ce.setKeyframes(ye))}}d()},function(D){R.__reactViewTransition===Y&&(R.__reactViewTransition=null);try{if(typeof D=="object"&&D!==null)switch(D.name){case"InvalidStateError":(D.message==="View transition was skipped because document visibility state is hidden."||D.message==="Skipping view transition because document visibility state has become hidden."||D.message==="Skipping view transition because viewport size changed."||D.message==="Transition was aborted because of invalid state")&&(D=null)}D!==null&&j(D)}finally{a(),l(),d()}}),Y.finished.finally(function(){for(var D=0;D<J.length;D++)J[D].cancel();R.__reactViewTransition===Y&&(R.__reactViewTransition=null),p()}),Y}catch{return a(),l(),d(),null}}function ds(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}ds.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:Q({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},ds.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),a=[],l=0;l<n.length;l++){var o=n[l].effect;o!==null&&o.target===e&&o.pseudoElement===t&&a.push(n[l])}return a},ds.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Cg(e){return{name:e,group:new ds("group",e),imagePair:new ds("image-pair",e),old:new ds("old",e),new:new ds("new",e)}}function Vn(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Vn.prototype.addEventListener=function(e,t,n){var a=null,l=null;if(!(n!=null&&typeof n!="boolean"&&(a=n.signal||null,a!==null&&a.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var o=this._eventListeners;if(Og(o,e,t,n)===-1){var d=this,p=t;n!=null&&typeof n!="boolean"&&n.once===!0&&(p=function(j){d.removeEventListener(e,t,n),typeof t=="function"?t.call(this,j):t.handleEvent(j)}),a!==null&&(l=d.removeEventListener.bind(d,e,t,n),a.addEventListener("abort",l,{once:!0}),l=a.removeEventListener.bind(a,"abort",l)),a=ei(n),o.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:p,cleanup:l}),v(this._fragmentFiber.child,!1,Wb,e,p,a)}this._eventListeners=o}};function Wb(e,t,n,a){return L(e).addEventListener(t,n,a),!1}Vn.prototype.removeEventListener=function(e,t,n){var a=this._eventListeners;if(a!==null&&(t=Og(a,e,t,n),t!==-1)){var l=a[t];n=l.attachedListener;var o=l.cleanup;l=ei(l.optionsOrUseCapture),v(this._fragmentFiber.child,!1,ex,e,n,l),a.splice(t,1),o!==null&&o()}};function ex(e,t,n,a){return L(e).removeEventListener(t,n,a),!1}function ei(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Dg(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function Og(e,t,n,a){if(e.length===0)return-1;a=Dg(a);for(var l=0;l<e.length;l++){var o=e[l];if(o.type===t&&o.listener===n&&Dg(o.optionsOrUseCapture)===a)return l}return-1}Vn.prototype.dispatchEvent=function(e){var t=x(this._fragmentFiber);if(t===null)return!0;t=L(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var a=t.nodeType===9?t.createComment(""):document.createTextNode("");if(n)for(var l=0;l<n.length;l++){var o=n[l];a.addEventListener(o.type,o.attachedListener,ei(o.optionsOrUseCapture))}if(t.appendChild(a),e=a.dispatchEvent(e),n)for(l=0;l<n.length;l++)o=n[l],a.removeEventListener(o.type,o.attachedListener,ei(o.optionsOrUseCapture));return t.removeChild(a),e}return t.dispatchEvent(e)},Vn.prototype.focus=function(e){v(this._fragmentFiber.child,!0,Rg,e,void 0,void 0)};function Rg(e,t){return e.tag===6?!1:(e=L(e),dx(e,t))}Vn.prototype.focusLast=function(e){var t=[];v(this._fragmentFiber.child,!0,Vf,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Rg(t[n],e);n--);};function Vf(e,t){return t.push(e),!1}Vn.prototype.blur=function(){var e=x(this._fragmentFiber);e!==null&&(e=L(e),e=Pi(e).activeElement,e!==null&&v(this._fragmentFiber.child,!1,tx,e,void 0,void 0))};function tx(e,t){return e.tag===6?!1:(e=L(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Vn.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),v(this._fragmentFiber.child,!1,nx,e,void 0,void 0)};function nx(e,t){return e.tag===6||(e=L(e),t.observe(e)),!1}Vn.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),v(this._fragmentFiber.child,!1,ax,e,void 0,void 0);for(var n=t=0;n<ba.length;n++){var a=ba[n];a.fragmentInstance===this&&a.observer===e?e.unobserve(a.instance):ba[t++]=a}ba.length=t}};function ax(e,t){return e.tag===6||(e=L(e),t.unobserve(e)),!1}var ba=[],Qf=!1;function lx(e,t,n){ba.push({fragmentInstance:e,observer:t,instance:n}),Qf||(Qf=!0,hx(function(){Qf=!1;var a=ba;ba=[];for(var l=0;l<a.length;l++){var o=a[l];o.observer.unobserve(o.instance)}}))}Vn.prototype.getClientRects=function(){var e=[];return v(this._fragmentFiber.child,!1,sx,e,void 0,void 0),e};function sx(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=L(e),t.push.apply(t,e.getClientRects());return!1}Vn.prototype.getRootNode=function(e){var t=x(this._fragmentFiber);return t===null?this:L(t).getRootNode(e)},Vn.prototype.compareDocumentPosition=function(e){var t=x(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];v(this._fragmentFiber.child,!1,Vf,n,void 0,void 0);var a=L(t);if(n.length===0){if(n=a,E(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var l=a=n.compareDocumentPosition(e);return n===e?l=Node.DOCUMENT_POSITION_CONTAINS:a&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=z(t)[1],n===null?l=Node.DOCUMENT_POSITION_PRECEDING:(e=L(n).compareDocumentPosition(e),l=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),l|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=L(n[0]),l=L(n[n.length-1]);var o=E(this._fragmentFiber)?t.parentElement:a;if(o==null)return Node.DOCUMENT_POSITION_DISCONNECTED;a=o.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,o=o.compareDocumentPosition(l)&Node.DOCUMENT_POSITION_CONTAINED_BY;var d=t.compareDocumentPosition(e),p=l.compareDocumentPosition(e),j=d&Node.DOCUMENT_POSITION_CONTAINED_BY||p&Node.DOCUMENT_POSITION_CONTAINED_BY;return p=a&&o&&d&Node.DOCUMENT_POSITION_FOLLOWING&&p&Node.DOCUMENT_POSITION_PRECEDING,t=a&&t===e||o&&l===e||j||p?Node.DOCUMENT_POSITION_CONTAINED_BY:!a&&t===e||!o&&l===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:d,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||ix(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function ix(e,t,n,a,l){var o=da(l);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!o)e:{for(;o!==null;){if(o.tag===7&&(o===t||o.alternate===t)){n=!0;break e}o=o.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(o===null)return o=l.ownerDocument,l===o||l===o.documentElement||l===o.body;e:{for(o=t,t=x(t);o!==null;){if(!(o.tag!==5&&o.tag!==3&&o.tag!==27||o!==t&&o.alternate!==t)){o=!0;break e}o=o.return}o=!1}return o}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!o)&&!(t=o===n)&&(t=H(n,o,$),t===null?t=!1:(v(t,!0,ce,o,n),o=ne,ne=null,t=o!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!o)&&!(t=o===a)&&(t=H(a,o,$),t===null?t=!1:(v(t,!0,_,o,a),o=ne,pe=ne=null,t=o!==null)),t):!1}function Mg(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Vn.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(u(566));var t=[];v(this._fragmentFiber.child,!1,Vf,t,void 0,void 0);var n=e!==!1;if(t.length===0){var a=z(this._fragmentFiber);if(a=n?a[1]||a[0]||x(this._fragmentFiber):a[0]||a[1],a===null)return;if(a.tag===6){e=L(a),Mg(e,n);return}if(a=L(a),a.nodeType!==9){if(a.nodeType===11){n="host"in a?a.host:null,n!==null&&n.scrollIntoView(e);return}a.scrollIntoView(e)}}for(a=n?t.length-1:0;a!==(n?-1:t.length);){var l=t[a];l.tag===6?(l=L(l),Mg(l,n)):L(l).scrollIntoView(e),a+=n?-1:1}};function rx(e,t){return e=L(e),zg(e,t),!1}function zg(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function Ug(e,t){var n=t._eventListeners;if(n!==null)for(var a=0;a<n.length;a++){var l=n[a];e.addEventListener(l.type,l.attachedListener,ei(l.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(o){for(var d=0,p=0;p<ba.length;p++){var j=ba[p];(j.fragmentInstance!==t||j.observer!==o||j.instance!==e)&&(ba[d++]=j)}ba.length=d,o.observe(e)}),zg(e,t))}function ox(e,t){var n=t._eventListeners;if(n!==null)for(var a=0;a<n.length;a++){var l=n[a];e.removeEventListener(l.type,l.attachedListener,ei(l.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(o){typeof o.rootMargin=="string"?lx(t,o,e):o.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function Zf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Zf(n),Ba(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function cx(e,t,n,a){for(;e.nodeType===1;){var l=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[ul])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(o=e.getAttribute("rel"),o==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(o!==l.rel||e.getAttribute("href")!==(l.href==null||l.href===""?null:l.href)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin)||e.getAttribute("title")!==(l.title==null?null:l.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(o=e.getAttribute("src"),(o!==(l.src==null?null:l.src)||e.getAttribute("type")!==(l.type==null?null:l.type)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var o=l.name==null?null:""+l.name;if(l.type==="hidden"&&e.getAttribute("name")===o)return e}else return e;if(e=ra(e.nextSibling),e===null)break}return null}function ux(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=ra(e.nextSibling),e===null))return null;return e}function Lg(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ra(e.nextSibling),e===null))return null;return e}function Kf(e){return e.data==="$?"||e.data==="$~"}function If(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function fx(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var a=function(){t(),n.removeEventListener("DOMContentLoaded",a)};n.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function ra(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Jf=null;function Hg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return ra(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Bg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function dx(e,t){function n(){a=!0}if(e.ownerDocument.activeElement===e)return!0;var a=!1;try{e.ownerDocument.addEventListener("focus",n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",n,!0)}return a}function hx(e){Tg(function(){Tg(function(t){return e(t)})})}function qg(e,t,n){switch(t=Pi(n),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}function Yg(e,t,n){for(var a in n){var l=n[a];n.hasOwnProperty(a)&&l!=null&&xt(e,t,a,null,Xb,l)}n.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===ja&&(e.onclick=null),Ba(e)}function Ff(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ba(e)}var oa=new Map,Xg=new Set;function Wi(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var el=we.d;we.d={f:mx,r:px,D:gx,C:yx,L:vx,m:bx,X:Sx,S:xx,M:wx};function mx(){var e=el.f(),t=Go();return e||t}function px(e){var t=ha(e);t!==null&&t.tag===5&&t.type==="form"?$m(t):el.r(e)}var ti=typeof document>"u"?null:document;function Gg(e,t,n){var a=ti;if(a&&typeof t=="string"&&t){var l=qe(t);l='link[rel="'+e+'"][href="'+l+'"]',typeof n=="string"&&(l+='[crossorigin="'+n+'"]'),Xg.has(l)||(Xg.add(l),e={rel:e,crossOrigin:n,href:t},a.querySelector(l)===null&&(t=a.createElement("link"),hn(t,"link",e),yt(t),a.head.appendChild(t)))}}function gx(e){el.D(e),Gg("dns-prefetch",e,null)}function yx(e,t){el.C(e,t),Gg("preconnect",e,t)}function vx(e,t,n){el.L(e,t,n);var a=ti;if(a&&e&&t){var l='link[rel="preload"][as="'+qe(t)+'"]';t==="image"&&n&&n.imageSrcSet?(l+='[imagesrcset="'+qe(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(l+='[imagesizes="'+qe(n.imageSizes)+'"]')):l+='[href="'+qe(e)+'"]';var o=l;switch(t){case"style":o=ni(e);break;case"script":o=ai(e)}if(!(oa.has(o)||(e=Q({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),oa.set(o,e),a.querySelector(l)!==null||t==="style"&&a.querySelector(er(o))||t==="script"&&a.querySelector(tr(o))))){var d=a.createElement("link");hn(d,"link",e),t==="style"&&(d[$l]=!0,d.onload=d.onerror=function(){zr(d)}),yt(d),a.head.appendChild(d)}}}function bx(e,t){el.m(e,t);var n=ti;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",l='link[rel="modulepreload"][as="'+qe(a)+'"][href="'+qe(e)+'"]',o=l;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=ai(e)}if(!oa.has(o)&&(e=Q({rel:"modulepreload",href:e},t),oa.set(o,e),n.querySelector(l)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(tr(o)))return}a=n.createElement("link"),hn(a,"link",e),yt(a),n.head.appendChild(a)}}}function xx(e,t,n){el.S(e,t,n);var a=ti;if(a&&e){var l=ea(a).hoistableStyles,o=ni(e);t=t||"default";var d=l.get(o);if(!d){var p={loading:0,preload:null};if(d=a.querySelector(er(o)))p.loading=5;else{e=Q({rel:"stylesheet",href:e,"data-precedence":t},n),(n=oa.get(o))&&Pf(e,n);var j=d=a.createElement("link");yt(j),hn(j,"link",e),j._p=new Promise(function(R,Y){j.onload=R,j.onerror=Y}),j.addEventListener("load",function(){p.loading|=1}),j.addEventListener("error",function(){p.loading|=2}),p.loading|=4,Jo(d,t,a)}d={type:"stylesheet",instance:d,count:1,state:p},l.set(o,d)}}}function Sx(e,t){el.X(e,t);var n=ti;if(n&&e){var a=ea(n).hoistableScripts,l=ai(e),o=a.get(l);o||(o=n.querySelector(tr(l)),o||(e=Q({src:e,async:!0},t),(t=oa.get(l))&&Wf(e,t),o=n.createElement("script"),yt(o),hn(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},a.set(l,o))}}function wx(e,t){el.M(e,t);var n=ti;if(n&&e){var a=ea(n).hoistableScripts,l=ai(e),o=a.get(l);o||(o=n.querySelector(tr(l)),o||(e=Q({src:e,async:!0,type:"module"},t),(t=oa.get(l))&&Wf(e,t),o=n.createElement("script"),yt(o),hn(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},a.set(l,o))}}function $g(e,t,n,a){var l=(l=C.current)?Wi(l):null;if(!l)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(n=ni(n.href),t=ea(l).hoistableStyles,a=t.get(n),a||(a={type:"style",instance:null,count:0,state:null},t.set(n,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=ni(n.href);var o=ea(l).hoistableStyles,d=o.get(e);if(d||(l=l.ownerDocument||l,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,d),(o=l.querySelector(er(e)))?o._p||(d.instance=o,d.state.loading=5):(o=oa.get(e),o||(o={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},oa.set(e,o)),Nx(l,e,o,d.state))),t&&a===null)throw Error(u(528,""));return d}if(t&&a!==null)throw Error(u(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(n=ai(n),t=ea(l).hoistableScripts,a=t.get(n),a||(a={type:"script",instance:null,count:0,state:null},t.set(n,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function ni(e){return'href="'+qe(e)+'"'}function er(e){return'link[rel="stylesheet"]['+e+"]"}function Vg(e){return Q({},e,{"data-precedence":e.precedence,precedence:null})}function Nx(e,t,n,a){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[$l]!==!0){a.loading=1;return}}else t=e.createElement("link"),t[$l]=!0,t.onload=t.onerror=zr.bind(null,t),hn(t,"link",n),yt(t),e.head.appendChild(t);a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2})}function ai(e){return'[src="'+qe(e)+'"]'}function tr(e){return"script[async]"+e}function Qg(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+qe(n.href)+'"]');if(a)return t.instance=a,yt(a),a;var l=Q({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),yt(a),hn(a,"style",l),Jo(a,n.precedence,e),t.instance=a;case"stylesheet":l=ni(n.href);var o=e.querySelector(er(l));if(o)return t.state.loading|=4,t.instance=o,yt(o),o;a=Vg(n),(l=oa.get(l))&&Pf(a,l),o=(e.ownerDocument||e).createElement("link"),yt(o);var d=o;return d._p=new Promise(function(p,j){d.onload=p,d.onerror=j}),hn(o,"link",a),t.state.loading|=4,Jo(o,n.precedence,e),t.instance=o;case"script":return o=ai(n.src),(l=e.querySelector(tr(o)))?(t.instance=l,yt(l),l):(a=n,(l=oa.get(o))&&(a=Q({},n),Wf(a,l)),e=e.ownerDocument||e,l=e.createElement("script"),yt(l),hn(l,"link",a),e.head.appendChild(l),t.instance=l);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Jo(a,n.precedence,e));return t.instance}function Jo(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),l=a.length?a[a.length-1]:null,o=l,d=0;d<a.length;d++){var p=a[d];if(p.dataset.precedence===t)o=p;else if(o!==l)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Pf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Wf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Fo=null;function Zg(e,t,n){if(Fo===null){var a=new Map,l=Fo=new Map;l.set(n,a)}else l=Fo,a=l.get(n),a||(a=new Map,l.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),l=0;l<n.length;l++){var o=n[l];if(!(o[ul]||o[Vt]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var d=o.getAttribute(t)||"";d=e+d;var p=a.get(d);p?p.push(o):a.set(d,[o])}}return a}function ed(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function jx(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Kg(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function Ig(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Jg(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Fg(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=Jg(t),e.suspenseyImages.push(t)),e=kx.bind(e),t.decode().then(e,e))}function Tx(e,t,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var l=ni(a.href),o=t.querySelector(er(l));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=nr.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=o,yt(o);return}o=t.ownerDocument||t,a=Vg(a),(l=oa.get(l))&&Pf(a,l),o=o.createElement("link"),yt(o);var d=o;d._p=new Promise(function(p,j){d.onload=p,d.onerror=j}),hn(o,"link",a),n.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=nr.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Po=0;function Ex(e,t){return e.stylesheets&&e.count===0&&ec(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&ec(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&Po===0&&(Po=62500*$b());var l=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ec(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>Po?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(l)}}:null}function Pg(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ec(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nr(){this.count--,Pg(this)}function kx(){this.imgCount--,Pg(this)}var Wo=null;function ec(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Wo=new Map,t.forEach(Ax,e),Wo=null,nr.call(e))}function Ax(e,t){if(!(t.state.loading&4)){var n=Wo.get(e);if(n)var a=n.get(null);else{n=new Map,Wo.set(e,n);for(var l=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<l.length;o++){var d=l[o];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(n.set(d.dataset.precedence,d),a=d)}a&&n.set(null,a)}l=t.instance,d=l.getAttribute("data-precedence"),o=n.get(d)||a,o===a&&n.set(null,l),n.set(d,l),this.count++,a=nr.bind(this),l.addEventListener("load",a),l.addEventListener("error",a),o?o.parentNode.insertBefore(l,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(l,e.firstChild)),t.state.loading|=4}}var li={$$typeof:De,Provider:null,Consumer:null,_currentValue:pt,_currentValue2:pt,_threadCount:0};function _x(e,t,n,a,l,o,d,p,j){this.tag=1,this.containerInfo=e,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=An(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=An(0),this.hiddenUpdates=An(null),this.identifierPrefix=a,this.onUncaughtError=l,this.onCaughtError=o,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=j,this.transitionTypes=null,this.incompleteTransitions=new Map}function Wg(e,t,n,a,l,o,d,p,j,R,Y,J){return e=new _x(e,t,n,d,j,R,Y,J,p),t=1,o===!0&&(t|=24),o=Cn(3,null,null,t),e.current=o,o.stateNode=e,t=mu(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:a,isDehydrated:n,cache:t},vu(o),e}function ey(e){return e?(e=Cs,e):Cs}function ty(e,t,n,a,l,o){l=ey(l),a.context===null?a.context=l:a.pendingContext=l,a=bl(t),a.payload={element:n},o=o===void 0?null:o,o!==null&&(a.callback=o),n=xl(e,a,t),n!==null&&(Mn(n,e,t),Ri(n,e,t))}function ny(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function td(e,t){ny(e,t),(e=e.alternate)&&ny(e,t)}function ay(e){if(e.tag===13||e.tag===31){var t=Il(e,67108864);t!==null&&Mn(t,e,67108864),td(e,67108864)}}function ly(e){if(e.tag===13||e.tag===31){var t=$n();t=rl(t);var n=Il(e,t);n!==null&&Mn(n,e,t),td(e,t)}}var si=!0;function Cx(e,t,n,a){var l=fe.T;fe.T=null;var o=we.p;try{we.p=2,nd(e,t,n,a)}finally{we.p=o,fe.T=l}}function Dx(e,t,n,a){var l=fe.T;fe.T=null;var o=we.p;try{we.p=8,nd(e,t,n,a)}finally{we.p=o,fe.T=l}}function nd(e,t,n,a){if(si){var l=ad(a);if(l===null)Lf(e,t,a,tc,n),iy(e,a);else if(Rx(l,e,t,n,a))a.stopPropagation();else if(iy(e,a),t&4&&-1<Ox.indexOf(e)){for(;l!==null;){var o=ha(l);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var d=Ie(o.pendingLanes);if(d!==0){var p=o;for(p.pendingLanes|=2,p.entangledLanes|=2;d;){var j=1<<31-Mt(d);p.entanglements[1]|=j,d&=~j}Ma(o),(ft&6)===0&&(qo=Ee()+500,Ii(0))}}break;case 31:case 13:p=Il(o,2),p!==null&&Mn(p,o,2),Go(),td(o,2)}if(o=ad(a),o===null&&Lf(e,t,a,tc,n),o===l)break;l=o}l!==null&&a.stopPropagation()}else Lf(e,t,a,null,n)}}function ad(e){return e=Yc(e),ld(e)}var tc=null;function ld(e){if(tc=null,e=da(e),e!==null){var t=h(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=m(t),e!==null)return e;e=null}else if(n===31){if(e=b(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return tc=e,null}function sy(e){switch(e){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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ge()){case Pe:return 2;case st:return 8;case vn:case tn:return 32;case ua:return 268435456;default:return 32}default:return 32}}var sd=!1,Ol=null,Rl=null,Ml=null,ar=new Map,lr=new Map,zl=[],Ox="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 iy(e,t){switch(e){case"focusin":case"focusout":Ol=null;break;case"dragenter":case"dragleave":Rl=null;break;case"mouseover":case"mouseout":Ml=null;break;case"pointerover":case"pointerout":ar.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":lr.delete(t.pointerId)}}function sr(e,t,n,a,l,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:o,targetContainers:[l]},t!==null&&(t=ha(t),t!==null&&ay(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function Rx(e,t,n,a,l){switch(t){case"focusin":return Ol=sr(Ol,e,t,n,a,l),!0;case"dragenter":return Rl=sr(Rl,e,t,n,a,l),!0;case"mouseover":return Ml=sr(Ml,e,t,n,a,l),!0;case"pointerover":var o=l.pointerId;return ar.set(o,sr(ar.get(o)||null,e,t,n,a,l)),!0;case"gotpointercapture":return o=l.pointerId,lr.set(o,sr(lr.get(o)||null,e,t,n,a,l)),!0}return!1}function ry(e){var t=da(e.target);if(t!==null){var n=h(t);if(n!==null){if(t=n.tag,t===13){if(t=m(n),t!==null){e.blockedOn=t,Dr(e.priority,function(){ly(n)});return}}else if(t===31){if(t=b(n),t!==null){e.blockedOn=t,Dr(e.priority,function(){ly(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function nc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=ad(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);qc=a,n.target.dispatchEvent(a),qc=null}else return t=ha(n),t!==null&&ay(t),e.blockedOn=n,!1;t.shift()}return!0}function oy(e,t,n){nc(e)&&n.delete(t)}function Mx(){sd=!1,Ol!==null&&nc(Ol)&&(Ol=null),Rl!==null&&nc(Rl)&&(Rl=null),Ml!==null&&nc(Ml)&&(Ml=null),ar.forEach(oy),lr.forEach(oy)}function ac(e,t){e.blockedOn===t&&(e.blockedOn=null,sd||(sd=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,Mx)))}var lc=null;function cy(e){lc!==e&&(lc=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){lc===e&&(lc=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],l=e[t+2];if(typeof a!="function"){if(ld(a||n)===null)continue;break}var o=ha(n);o!==null&&(e.splice(t,3),t-=3,Bu(o,{pending:!0,data:l,method:n.method,action:a},a,l))}}))}function ii(e){function t(j){return ac(j,e)}Ol!==null&&ac(Ol,e),Rl!==null&&ac(Rl,e),Ml!==null&&ac(Ml,e),ar.forEach(t),lr.forEach(t);for(var n=0;n<zl.length;n++){var a=zl[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<zl.length&&(n=zl[0],n.blockedOn===null);)ry(n),n.blockedOn===null&&zl.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var l=n[a],o=n[a+1],d=l[Pt]||null;if(typeof o=="function")d||cy(n);else if(d){var p=null;if(o&&o.hasAttribute("formAction")){if(l=o,d=o[Pt]||null)p=d.formAction;else if(ld(l)!==null)continue}else p=d.action;typeof p=="function"?n[a+1]=p:(n.splice(a,3),a-=3),cy(n)}}}function uy(){function e(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(d){return l=d})},focusReset:"manual",scroll:"manual"})}function t(){l!==null&&(l(),l=null),a||setTimeout(n,20)}function n(){if(!a&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,l=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),l!==null&&(l(),l=null)}}}function id(e){this._internalRoot=e}sc.prototype.render=id.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var n=t.current,a=$n();ty(n,a,e,t,null,null)},sc.prototype.unmount=id.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ty(e.current,2,null,e,null,null),Go(),t[_n]=null}};function sc(e){this._internalRoot=e}sc.prototype.unstable_scheduleHydration=function(e){if(e){var t=cl();e={blockedOn:null,target:e,priority:t};for(var n=0;n<zl.length&&t!==0&&t<zl[n].priority;n++);zl.splice(n,0,e),n===0&&ry(e)}};var fy=r.version;if(fy!=="19.3.0")throw Error(u(527,fy,"19.3.0"));we.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=S(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var zx={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:fe,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ic=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ic.isDisabled&&ic.supportsFiber)try{Un=ic.inject(zx),Rt=ic}catch{}}return rr.createRoot=function(e,t){if(!f(e))throw Error(u(299));var n=!1,a="",l=ep,o=tp,d=np;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(l=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=Wg(e,1,!1,null,null,n,a,null,l,o,d,uy),e[_n]=t.current,Uf(e),new id(t)},rr.hydrateRoot=function(e,t,n){if(!f(e))throw Error(u(299));var a=!1,l="",o=ep,d=tp,p=np,j=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onUncaughtError!==void 0&&(o=n.onUncaughtError),n.onCaughtError!==void 0&&(d=n.onCaughtError),n.onRecoverableError!==void 0&&(p=n.onRecoverableError),n.formState!==void 0&&(j=n.formState)),t=Wg(e,1,!0,t,n??null,a,l,j,o,d,p,uy),t.context=ey(null),n=t.current,a=$n(),a=rl(a),l=bl(a),l.callback=null,xl(n,l,a),n=a,t.current.lanes=n,Pn(t,n),Ma(t),e[_n]=t.current,Uf(e),new sc(t)},rr.version="19.3.0",rr}var jy;function Ix(){if(jy)return cd.exports;jy=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(r){console.error(r)}}return s(),cd.exports=Kx(),cd.exports}var Jx=Ix();const Fx=pv(Jx);async function Px(){const s=await fetch("/api/models");if(!s.ok)throw new Error(await Rc(s)||`Failed to load models (${s.status})`);return(await s.json()).data}async function Wx(){const s=await fetch("/api/kb");return s.ok?(await s.json()).docs:[]}async function e1(s,r){const c=await fetch("/api/kb",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s,text:r})});if(!c.ok)throw new Error(await Rc(c)||`Failed to add document (${c.status})`);return(await c.json()).docs}async function t1(s){const r=await fetch(`/api/kb/${s}`,{method:"DELETE"});return r.ok?(await r.json()).docs:[]}async function Yd(s,r){var S,y,v,x,E,z,V;if(s.stream===!1)return n1(s,r);const c=Date.now(),u=await fetch("/api/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...s,stream:!0}),signal:r.signal});if(!u.ok||!u.body){r.onError(await Rc(u)||`Chat request failed (${u.status})`);return}const f=u.body.getReader(),h=new TextDecoder;let m="";const b={};let g=null;for(;;){const{value:L,done:ne}=await f.read();if(ne)break;m+=h.decode(L,{stream:!0});let pe;for(;(pe=m.indexOf(`
50
- `))!==-1;){const ce=m.slice(0,pe).replace(/\r$/,"");if(m=m.slice(pe+1),!ce.startsWith("data:"))continue;const _=ce.slice(5).trim();if(_==="[DONE]"){Ty(b,r),r.onDone(g);return}let $;try{$=JSON.parse(_)}catch{continue}if($.error){r.onError($.error.message??"stream error");return}if($.scx_sources){(S=r.onSources)==null||S.call(r,$.scx_sources);continue}const H=(y=$.choices)==null?void 0:y[0],Q=H==null?void 0:H.delta;if(Q!=null&&Q.content&&r.onDelta(Q.content),Q!=null&&Q.tool_calls)for(const W of Q.tool_calls){const re=W.index??0;b[re]??(b[re]={id:W.id??`call_${re}`,type:"function",function:{name:"",arguments:""}}),W.id&&(b[re].id=W.id),(v=W.function)!=null&&v.name&&(b[re].function.name+=W.function.name),(x=W.function)!=null&&x.arguments&&(b[re].function.arguments+=W.function.arguments)}H!=null&&H.finish_reason&&(g=H.finish_reason),$.usage&&((z=r.onUsage)==null||z.call(r,{prompt:$.usage.prompt_tokens,completion:$.usage.completion_tokens,reasoning:(E=$.usage.completion_tokens_details)==null?void 0:E.reasoning_tokens}))}}if(Ty(b,r),!g&&!((V=r.signal)!=null&&V.aborted)){const L=Math.round((Date.now()-c)/6e4);r.onError(`The connection closed before the model finished${L?` (after about ${L} min)`:""}. Long answers can hit a provider's time limit: try again, a faster model, or a smaller request.`);return}r.onDone(g)}async function n1(s,r){var m,b,g,S,y,v;const c=await fetch("/api/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...s,stream:!1}),signal:r.signal});if(!c.ok){r.onError(await Rc(c)||`Chat request failed (${c.status})`);return}const u=await c.json();u.scx_sources&&((m=r.onSources)==null||m.call(r,u.scx_sources));const f=(b=u.choices)==null?void 0:b[0],h=f==null?void 0:f.message;h!=null&&h.content&&r.onDelta(h.content),(g=h==null?void 0:h.tool_calls)!=null&&g.length&&((S=r.onToolCalls)==null||S.call(r,h.tool_calls)),u.usage&&((v=r.onUsage)==null||v.call(r,{prompt:u.usage.prompt_tokens,completion:u.usage.completion_tokens,reasoning:(y=u.usage.completion_tokens_details)==null?void 0:y.reasoning_tokens})),r.onDone((f==null?void 0:f.finish_reason)??null)}function Ty(s,r){const c=Object.values(s).filter(u=>u.function.name);c.length&&r.onToolCalls&&r.onToolCalls(c)}async function Rc(s){var r;try{const c=await s.json();return((r=c==null?void 0:c.error)==null?void 0:r.message)??""}catch{return""}}async function a1(s){const r=await fetch(`/api/agent/sessions?directory=${encodeURIComponent(s)}`);if(!r.ok)throw new Error(await Jn(r)||`Could not list sessions (${r.status})`);return(await r.json()).sessions}async function l1(s,r){const c=await fetch(`/api/agent/session/${encodeURIComponent(s)}/messages?directory=${encodeURIComponent(r)}`);if(!c.ok)throw new Error(await Jn(c)||`Could not load session (${c.status})`);return c.json()}async function s1(s,r){const c=await fetch(`/api/agent/session/${encodeURIComponent(s)}?directory=${encodeURIComponent(r)}`,{method:"DELETE"});if(!c.ok)throw new Error(await Jn(c)||`Could not delete session (${c.status})`)}async function i1(s){const r=await fetch(`/api/agent/commands?directory=${encodeURIComponent(s)}`);return r.ok?(await r.json()).commands:[]}async function r1(s){const r=await fetch("/api/agent/command",{method:"POST",headers:ys(),body:JSON.stringify(s)});if(!r.ok)throw new Error(await Jn(r)||`Command failed (${r.status})`)}async function o1(s,r,c){const u=await fetch("/api/agent/compact",{method:"POST",headers:ys(),body:JSON.stringify({sessionID:s,directory:r,model:c})});if(!u.ok)throw new Error(await Jn(u)||`Compact failed (${u.status})`)}async function c1(){const s=await fetch("/api/agent/status");if(!s.ok)throw new Error(await Jn(s)||`Agent server not ready (${s.status})`);return s.json()}async function gv(s){const r=await fetch(`/api/agent/directory?directory=${encodeURIComponent(s)}`);if(!r.ok)throw new Error(await Jn(r)||`Folder not found (${r.status})`);return(await r.json()).directory}async function u1(s,r){const c=await fetch(`/api/agent/pending?sessionID=${encodeURIComponent(s)}&directory=${encodeURIComponent(r)}`);return c.ok?c.json():{permissions:[],questions:[]}}async function f1(s){const r=await fetch("/api/agent/session",{method:"POST",headers:ys(),body:JSON.stringify({directory:s})});if(!r.ok)throw new Error(await Jn(r)||`Could not create session (${r.status})`);return r.json()}async function d1(s){const r=await fetch("/api/agent/prompt",{method:"POST",headers:ys(),body:JSON.stringify(s)});if(!r.ok)throw new Error(await Jn(r)||`Prompt failed (${r.status})`)}async function h1(s){const r=await fetch("/api/agent/permission",{method:"POST",headers:ys(),body:JSON.stringify(s)});if(!r.ok)throw new Error(await Jn(r)||`Permission reply failed (${r.status})`)}async function m1(s){const r=await fetch("/api/agent/question",{method:"POST",headers:ys(),body:JSON.stringify(s)});if(!r.ok)throw new Error(await Jn(r)||`Answer failed (${r.status})`)}async function p1(s,r){await fetch("/api/agent/abort",{method:"POST",headers:ys(),body:JSON.stringify({sessionID:s,directory:r})})}async function g1(s,r){const c=await fetch(`/api/agent/diff?sessionID=${encodeURIComponent(s)}&directory=${encodeURIComponent(r)}`);return c.ok?(await c.json()).diff:null}async function y1(s,r,c,u,f){let h=1e3,m=!1;for(;!u.aborted;){try{await v1(s,r,c,u,()=>{h=1e3,m&&(f==null||f()),m=!0})}catch(b){if(u.aborted)return;if(b.fatal)throw b}if(u.aborted)return;await new Promise(b=>setTimeout(b,h)),h=Math.min(h*2,1e4)}}async function v1(s,r,c,u,f){const h=await fetch(`/api/agent/events?sessionID=${encodeURIComponent(s)}&directory=${encodeURIComponent(r)}`,{signal:u});if(!h.ok||!h.body)throw Object.assign(new Error(await Jn(h)||`Event stream failed (${h.status})`),{fatal:!0});f();const m=h.body.getReader(),b=new TextDecoder;let g="";for(;;){const{value:S,done:y}=await m.read();if(y)break;g+=b.decode(S,{stream:!0});let v;for(;(v=g.indexOf(`
51
- `))!==-1;){const x=g.slice(0,v).replace(/\r$/,"");if(g=g.slice(v+1),!!x.startsWith("data:"))try{c(JSON.parse(x.slice(5).trim()))}catch{}}}}const ys=()=>({"Content-Type":"application/json"});async function Jn(s){var r,c;try{return((c=(r=await s.json())==null?void 0:r.error)==null?void 0:c.message)??""}catch{return""}}async function Er(s,r){if(!s.ok)throw new Error(await Jn(s)||`${r} failed (${s.status})`);return s.json()}const b1=()=>fetch("/api/workspaces").then(s=>Er(s,"Listing workspaces")),x1=s=>fetch("/api/workspaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s})}).then(r=>Er(r,"Creating the workspace")),S1=s=>fetch(`/api/workspaces?directory=${encodeURIComponent(s)}`,{method:"DELETE"}).then(r=>Er(r,"Deleting the workspace")),w1=(s,r)=>fetch(`/api/agent/files?directory=${encodeURIComponent(s)}&path=${encodeURIComponent(r)}`).then(c=>Er(c,"Listing files")),N1=(s,r,c)=>fetch(`/api/agent/upload?directory=${encodeURIComponent(s)}&path=${encodeURIComponent(r)}&name=${encodeURIComponent(c.name)}`,{method:"POST",headers:{"Content-Type":"application/octet-stream"},body:c}).then(u=>Er(u,`Uploading ${c.name}`)),j1=(s,r)=>`/api/agent/file?directory=${encodeURIComponent(s)}&path=${encodeURIComponent(r)}`;let T1=0;const Ed=()=>`tool_${Date.now().toString(36)}_${(T1++).toString(36)}`,E1=s=>s.map(r=>r.id?r:{...r,id:Ed()}),k1=s=>s.map(({id:r,...c})=>c);function yv({cursor:s=!1}){return i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"prompt",children:">_"}),i.jsxs("span",{className:"word",children:["Bug",i.jsx("span",{className:"x",children:"X"}),"Hunter",s&&i.jsx("span",{className:"cursor big","aria-hidden":!0})]})]})}function A1({size:s=20,tagline:r=!0}){return i.jsxs("div",{className:"brand","aria-label":"BugXHunter",children:[i.jsx("span",{className:"logo",style:{fontSize:s},children:i.jsx(yv,{})}),r&&i.jsxs("span",{className:"brand-sub",children:["Open-source AI security testing ",i.jsxs("span",{className:"brand-ver",title:"BugXHunter release v0.9.2",children:["v","0.9.2"]})]})]})}function Xd(){return typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition)}function vv(s){const r=window.SpeechRecognition||window.webkitSpeechRecognition;if(!r)return{stop:()=>{},promise:Promise.resolve("")};const c=new r;c.lang=navigator.language||"en-US",c.interimResults=!0,c.continuous=!1;let u="";const f=new Promise(h=>{var m;c.onresult=b=>{var S;let g="";for(let y=b.resultIndex;y<b.results.length;y++){const v=b.results[y][0].transcript;b.results[y].isFinal?u+=v:g+=v}(S=s.onPartial)==null||S.call(s,u+g)},c.onend=()=>{var b;(b=s.onEnd)==null||b.call(s),h(u.trim())},c.onerror=()=>h(u.trim()),(m=s.onStart)==null||m.call(s),c.start()});return{stop:()=>c.stop(),promise:f}}let gc=null;function _1(s){if(typeof window>"u"||!window.speechSynthesis)return;const r=s.replace(/[*_`#>]/g,"").replace(/\[(\d+)\]/g,"").trim();r&&(window.speechSynthesis.cancel(),gc=new SpeechSynthesisUtterance(r),gc.rate=1.05,window.speechSynthesis.speak(gc))}function C1(){typeof window<"u"&&window.speechSynthesis&&window.speechSynthesis.cancel(),gc=null}function kr({title:s,tooltip:r,children:c}){return i.jsxs("header",{className:"term-bar",children:[i.jsx("span",{className:"dot r","aria-hidden":!0}),i.jsx("span",{className:"dot y","aria-hidden":!0}),i.jsx("span",{className:"dot g","aria-hidden":!0}),i.jsx("span",{className:"term-title",title:r??s,children:s}),c&&i.jsx("div",{className:"head-actions",children:c})]})}const D1={p:"$ ",out:"[*] ",ok:"[+] "};function bv({lines:s}){const r=N.useMemo(()=>{var h;return typeof window<"u"&&!!((h=window.matchMedia)!=null&&h.call(window,"(prefers-reduced-motion: reduce)").matches)},[]),[c,u]=N.useState(()=>r?{line:s.length,chars:0,started:!0}:{line:0,chars:0,started:!1});N.useEffect(()=>{if(c.line>=s.length)return;const h=s[c.line],m=c.chars<h.text.length,b=c.started?m?h.pace??22:260:400,g=setTimeout(()=>{u(m?{line:c.line,chars:c.chars+1,started:!0}:{line:c.line+1,chars:0,started:!0})},b);return()=>clearTimeout(g)},[c,s]);const f=c.line>=s.length;return i.jsxs("div",{className:"boot",children:[s.map((h,m)=>{if(m>c.line)return i.jsx("div",{className:"line","aria-hidden":!0},m);const b=m<c.line,g=b?h.text:h.text.slice(0,c.chars);return i.jsxs("div",{className:"line",children:[i.jsx("span",{className:h.kind,children:D1[h.kind]}),g,b&&h.ok?i.jsxs("span",{className:"ok",children:[" ",h.ok]}):null,m===c.line&&c.started&&i.jsx("span",{className:"cursor"})]},m)}),f&&i.jsxs("div",{className:"line",children:[i.jsx("span",{className:"p",children:"$ "}),i.jsx("span",{className:"cursor"})]})]})}async function kn(s,r){var u,f;const c=await fetch(s,{headers:{"Content-Type":"application/json"},...r});if(!c.ok){let h=`${c.status}`;try{h=((f=(u=await c.json())==null?void 0:u.error)==null?void 0:f.message)??h}catch{}throw new Error(h)}return c.json()}const Xl=s=>({method:"POST",body:s===void 0?void 0:JSON.stringify(s)}),O1=()=>kn("/api/vault"),R1=(s,r)=>kn("/api/vault/init",Xl({doc:s,dek:r})),xv=s=>kn("/api/vault/unseal",Xl({dek:s})),M1=()=>kn("/api/vault/seal",Xl()),z1=(s,r)=>kn(`/api/vault/items/${encodeURIComponent(s)}`,{method:"PUT",body:JSON.stringify({value:r})}),U1=s=>kn(`/api/vault/items/${encodeURIComponent(s)}`,{method:"DELETE"}),Ey=(s,r)=>kn("/api/vault/methods",Xl({method:s,dek:r})),L1=s=>kn(`/api/vault/methods/${encodeURIComponent(s)}`,{method:"DELETE"}),H1=s=>kn("/api/vault",{method:"DELETE",body:JSON.stringify({dek:s})}),B1=()=>kn("/api/auth/me"),hd=()=>kn("/api/auth/methods"),q1=()=>kn("/api/auth/challenge",Xl()),Y1=s=>kn("/api/auth/passkey",Xl(s)),X1=s=>kn("/api/auth/recover",Xl({dek:s})),G1=()=>kn("/api/auth/logout",Xl()),$1=6e5,Gd="bugxhunter-vault-prf-v1",V1="bugxhunter-vault-kek-v1",Q1="bugxhunter-vault-ok",di=new TextEncoder,Yl=crypto.subtle,gn={enc:s=>btoa(String.fromCharCode(...s instanceof Uint8Array?s:new Uint8Array(s))),dec:s=>Uint8Array.from(atob(s),r=>r.charCodeAt(0))},za={enc:s=>gn.enc(s).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),dec:s=>gn.dec(s.replace(/-/g,"+").replace(/_/g,"/")+"=".repeat((4-s.length%4)%4))},Ua=s=>crypto.getRandomValues(new Uint8Array(s)),al=s=>s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength);async function Sv(s,r){const c=await Yl.importKey("raw",di.encode(s),"PBKDF2",!1,["deriveBits"]),u=await Yl.deriveBits({name:"PBKDF2",hash:r.hash,salt:al(gn.dec(r.salt)),iterations:r.iterations},c,256);return new Uint8Array(u)}async function wv(s,r,c){if(s.length!==32)throw new Error("PRF output must be 32 bytes");let u;if(r.passphrase){if(!c)throw new Error("This passkey was enrolled with a passphrase; enter it as well.");const m=await Sv(c,r.passphrase);u=new Uint8Array(64),u.set(s,0),u.set(m,32),m.fill(0)}else u=new Uint8Array(s);const f=await Yl.importKey("raw",al(u),"HKDF",!1,["deriveKey"]),h=await Yl.deriveKey({name:"HKDF",hash:"SHA-256",salt:al(gn.dec(r.hkdfSalt)),info:di.encode(V1)},f,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"]);return u.fill(0),h}async function Mc(s,r){const c=await Sv(s,r),u=await Yl.importKey("raw",al(c),"AES-GCM",!1,["encrypt","decrypt"]);return c.fill(0),u}async function Sr(s,r,c){const u=Ua(12),f=await Yl.encrypt({name:"AES-GCM",iv:al(u),additionalData:di.encode(c)},s,al(r));return{iv:gn.enc(u),ct:gn.enc(f)}}async function $d(s,r,c){const u=await Yl.decrypt({name:"AES-GCM",iv:al(gn.dec(r.iv)),additionalData:di.encode(c)},s,al(gn.dec(r.ct)));return new Uint8Array(u)}const kd="ABCDEFGHJKLMNPQRSTUVWXYZ23456789";function Z1(){const s=Ua(16);let r=0,c=0,u="";for(const f of s)for(c=c<<8|f,r+=8;r>=5;)u+=kd[c>>>r-5&31],r-=5;return r>0&&(u+=kd[c<<5-r&31]),u.match(/.{1,5}/g).join("-")}const Vd=s=>s.toUpperCase().replace(/[^A-Z2-9]/g,"");function Ad(s){const r=Vd(s);return r.length===26&&[...r].every(c=>kd.includes(c))}const Qd=s=>`${s}-${za.enc(Ua(6))}`,Nv=()=>({name:"PBKDF2",hash:"SHA-256",iterations:$1,salt:gn.enc(Ua(16))});async function jv(s,r,c){const u={type:"passkey",id:Qd("pk"),label:c,credentialId:r.credentialId,transports:r.transports,publicKey:r.publicKey,alg:r.alg,signCount:0,prfSalt:Gd,hkdfSalt:gn.enc(Ua(16)),wrapped:{iv:"",ct:""},createdAt:new Date().toISOString()};return u.wrapped=await Sr(await wv(r.prf,u),s,u.id),u}async function Zd(s,r){const c={type:"password",id:Qd("pw"),label:"Backup passphrase",kdf:Nv(),wrapped:{iv:"",ct:""},createdAt:new Date().toISOString()};return c.wrapped=await Sr(await Mc(r,c.kdf),s,c.id),c}async function K1(s){const r=Ua(32),c=await Yl.importKey("raw",al(r),"AES-GCM",!1,["encrypt"]),u=new Date().toISOString(),f=[await jv(r,s,s.label)];s.passphrase&&f.push(await Zd(r,s.passphrase));const h=Z1(),m={type:"recovery",id:Qd("rc"),label:"Recovery code",kdf:Nv(),wrapped:{iv:"",ct:""},createdAt:u};m.wrapped=await Sr(await Mc(Vd(h),m.kdf),r,m.id),f.push(m);const b={};for(const[y,v]of Object.entries(s.items))v&&(b[y]=await Sr(c,di.encode(v),y));const g={version:1,createdAt:u,methods:f,verifier:await Sr(c,di.encode(Q1),"verifier"),items:b},S=gn.enc(r);return r.fill(0),{doc:g,dek:S,recoveryCode:h}}async function Tv(s,r,c){const u=await wv(r,s,c);return gn.enc(await $d(u,s.wrapped,s.id))}async function Ev(s,r){const c=await Mc(r,s.kdf);return gn.enc(await $d(c,s.wrapped,s.id))}async function kv(s,r){const c=await Mc(Vd(r),s.kdf);return gn.enc(await $d(c,s.wrapped,s.id))}class nl extends Error{constructor(r){super(r),this.name="PrfUnsupportedError"}}class Kd extends Error{constructor(){super("Passkey prompt cancelled or timed out."),this.name="PasskeyCancelledError"}}const hi=()=>typeof window<"u"&&!!window.PublicKeyCredential&&!!navigator.credentials,I1=new TextEncoder;function bc(){const s=location.hostname;if(/^\d{1,3}(\.\d{1,3}){3}$/.test(s)||s.startsWith("["))throw new nl(`Passkeys can't be bound to an IP address (${s}). Open the app via http://localhost:${location.port||80} or a hostname.`);return s}function Av(s){const r=s;return(r==null?void 0:r.name)==="NotAllowedError"?new Kd:(r==null?void 0:r.name)==="OperationError"?new nl("Another passkey request is pending in this tab. Close any stray OS dialog or reload, then try again."):(r==null?void 0:r.name)==="SecurityError"?new nl(`The browser refused the passkey request (SecurityError: ${r.message}). Passkeys need https or localhost, and a relying-party name equal to the page's host (${location.hostname}).`):(r==null?void 0:r.name)==="NotSupportedError"||(r==null?void 0:r.name)==="ConstraintError"?new nl(`The authenticator can't do this (${r.name}: ${r.message}).`):r instanceof Error?new Error(`${r.name??"Error"}: ${r.message}`):new Error(String(s))}const _v=s=>({prf:{eval:{first:I1.encode(s)}}});async function Cv(s,r){var S,y,v,x;if(!hi())throw new nl("This browser has no passkey support.");let c;try{c=await navigator.credentials.create({publicKey:{rp:{id:bc(),name:"BugXHunter"},user:{id:Ua(16),name:s,displayName:"BugXHunter vault"},challenge:Ua(32),pubKeyCredParams:[{type:"public-key",alg:-7},{type:"public-key",alg:-8},{type:"public-key",alg:-257}],authenticatorSelection:{residentKey:"preferred",userVerification:"required"},timeout:12e4,extensions:_v(r)}})}catch(E){throw Av(E)}if(!c)throw new Kd;const u=c.getClientExtensionResults();if(!((S=u.prf)!=null&&S.enabled))throw new nl("This passkey can't derive keys (no PRF support). Use a platform passkey (Windows Hello, Touch ID, Android) or a recent security key, in Chrome, Edge or Safari 18+.");const f=c.response,h=(y=f.getPublicKey)==null?void 0:y.call(f);if(!h)throw new nl("This browser doesn't expose the passkey's public key (needed for sign-in). Use Chrome, Edge or Safari.");const m=((v=f.getTransports)==null?void 0:v.call(f))??void 0,b=za.enc(new Uint8Array(c.rawId)),g=(x=u.prf.results)!=null&&x.first?new Uint8Array(u.prf.results.first):(await Id({challenge:za.enc(Ua(32)),rpId:bc(),allowCredentials:[{id:b,transports:m}]},r)).prf;return{credentialId:b,transports:m,prf:g,publicKey:gn.enc(h),alg:f.getPublicKeyAlgorithm()}}async function Id(s,r){var m,b;if(!hi())throw new nl("This browser has no passkey support.");const c=bc();s.rpId&&s.rpId!==c&&console.warn(`[vault] server suggested rpId ${s.rpId}; using the page's host ${c}`);let u;try{u=await navigator.credentials.get({publicKey:{rpId:c,challenge:za.dec(s.challenge),allowCredentials:s.allowCredentials.map(g=>({type:"public-key",id:za.dec(g.id),transports:g.transports})),userVerification:"required",timeout:12e4,extensions:_v(r)}})}catch(g){throw Av(g)}if(!u)throw new Kd;const f=u.response,h=u.getClientExtensionResults();return{assertion:{credentialId:za.enc(new Uint8Array(u.rawId)),clientDataJSON:za.enc(new Uint8Array(f.clientDataJSON)),authenticatorData:za.enc(new Uint8Array(f.authenticatorData)),signature:za.enc(new Uint8Array(f.signature))},prf:(b=(m=h.prf)==null?void 0:m.results)!=null&&b.first?new Uint8Array(h.prf.results.first):void 0}}async function J1(s,r,c){const{prf:u}=await Id({challenge:za.enc(Ua(32)),rpId:bc(),allowCredentials:[{id:s,transports:r}]},c);if(!u)throw new nl("The authenticator returned no PRF output. Use a passkey that supports PRF, or your recovery code.");return u}let Jd=null;const xc=s=>{Jd=s},Fd=()=>{Jd=null},F1=()=>Jd,_d="or:unauthorized";async function P1(){Fd(),await G1().catch(()=>{}),window.location.reload()}function W1({children:s}){const[r,c]=N.useState("checking");return N.useEffect(()=>{B1().then(f=>c(f.required?f.authenticated?"signed-in":"signed-out":"open")).catch(()=>c("open"));const u=()=>c("signed-out");return window.addEventListener(_d,u),()=>window.removeEventListener(_d,u)},[]),r==="checking"?null:r==="signed-out"?i.jsx(eS,{onSuccess:()=>c("signed-in")}):i.jsx(i.Fragment,{children:s})}function eS({onSuccess:s}){const[r,c]=N.useState("passkey"),[u,f]=N.useState(""),[h,m]=N.useState(""),[b,g]=N.useState(""),[S,y]=N.useState(!1),[v,x]=N.useState(!1),[E,z]=N.useState(!1),[V,L]=N.useState(null),[ne,pe]=N.useState(null);N.useEffect(()=>{hd().then(({methods:H})=>{y(H.some(Q=>Q.type==="passkey"&&!!Q.passphrase)),x(H.some(Q=>Q.type==="password"))}).catch(()=>{})},[]);async function ce(){var H;z(!0),L(null),pe(null);try{const Q=await q1();if("open"in Q)return s();const{methods:W}=await hd(),re=W.filter(oe=>oe.type==="passkey"),G=((H=re[0])==null?void 0:H.prfSalt)??"bugxhunter-vault-prf-v1",{assertion:K,prf:Z}=await Id(Q,G);await Y1(K);const de=re.find(oe=>oe.credentialId===K.credentialId);if(de&&Z)try{const oe=await Tv(de,Z,de.passphrase?u:void 0);await xv(oe),xc(oe)}catch{pe(de.passphrase?"Signed in; the vault stays locked (passphrase?) — unlock it from the sidebar.":"Signed in, but the vault didn't unlock — unlock it from the sidebar.")}s()}catch(Q){L(Q.message),z(!1)}}async function _(H){z(!0),L(null);try{const{methods:Q}=await hd();let W;try{if(H==="password"){const re=Q.find(G=>G.type==="password");if(!re)throw new Error("no method");W=await Ev(re,h)}else{const re=Q.find(G=>G.type==="recovery");if(!re)throw new Error("no method");W=await kv(re,b)}}catch{throw new Error(H==="password"?"Wrong backup passphrase.":"That recovery code doesn't open the vault.")}await X1(W),xc(W),s()}catch(Q){L(Q.message),z(!1)}}const $=()=>{r==="passkey"?ce():r==="password"?_("password"):r==="recovery"&&_("recovery")};return i.jsx("div",{className:"login-page grid-bg",children:i.jsxs("form",{className:"login-card",onSubmit:H=>{H.preventDefault(),$()},children:[i.jsx(kr,{title:"bugxhunter@redteam: ~/login"}),i.jsxs("div",{className:"login-body",children:[i.jsx("span",{className:"logo login-mark",style:{fontSize:34},"aria-label":"BugXHunter",children:i.jsx(yv,{cursor:!0})}),i.jsx("div",{className:"login-tag",children:"Open-source AI security testing"}),r==="passkey"&&i.jsxs(i.Fragment,{children:[S&&i.jsxs(i.Fragment,{children:[i.jsxs("label",{htmlFor:"pp",children:["vault passphrase ",i.jsx("span",{className:"muted",children:"(this passkey was enrolled with one)"})]}),i.jsx("input",{id:"pp",type:"password",autoFocus:!0,autoComplete:"current-password",value:u,onChange:H=>f(H.target.value)})]}),!hi()&&i.jsx("div",{className:"form-status error",children:"This browser has no passkey support. Use Chrome, Edge or Safari, or a backup."}),i.jsx("div",{className:"perm-actions center",children:i.jsx("button",{className:"btn primary wide",type:"submit",autoFocus:!S,disabled:E||!hi(),children:E?"waiting for the passkey…":"./sign_in --passkey →"})}),i.jsxs("div",{className:"login-links",children:[v&&i.jsx("button",{type:"button",className:"link-btn",disabled:E,onClick:()=>{c("password"),L(null)},children:"use the backup passphrase"}),i.jsx("button",{type:"button",className:"link-btn",disabled:E,onClick:()=>{c("recovery"),L(null)},children:"use the recovery code"})]})]}),r==="password"&&i.jsxs(i.Fragment,{children:[i.jsx("label",{htmlFor:"bp",children:"backup passphrase"}),i.jsx("input",{id:"bp",type:"password",autoFocus:!0,autoComplete:"current-password",value:h,onChange:H=>m(H.target.value)}),i.jsx("div",{className:"perm-actions center",children:i.jsx("button",{className:"btn primary wide",type:"submit",disabled:E||!h,children:E?"checking…":"./sign_in --passphrase →"})}),i.jsxs("div",{className:"login-links",children:[i.jsx("button",{type:"button",className:"link-btn",disabled:E,onClick:()=>{c("passkey"),L(null)},children:"back to the passkey"}),i.jsx("button",{type:"button",className:"link-btn",disabled:E,onClick:()=>{c("recovery"),L(null)},children:"use the recovery code"})]})]}),r==="recovery"&&i.jsxs(i.Fragment,{children:[i.jsx("label",{htmlFor:"rc",children:"recovery code"}),i.jsx("input",{id:"rc",type:"text",className:"mono",autoFocus:!0,autoComplete:"off",spellCheck:!1,placeholder:"XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-X",value:b,onChange:H=>g(H.target.value)}),i.jsx("div",{className:"perm-actions center",children:i.jsx("button",{className:"btn primary wide",type:"submit",disabled:E||!Ad(b),children:E?"checking…":"./sign_in --recovery →"})}),i.jsx("p",{className:"hint",style:{margin:0},children:"This signs you in and unlocks the vault. Enrol a new passkey right after, from the keys dialog."}),i.jsxs("div",{className:"login-links",children:[i.jsx("button",{type:"button",className:"link-btn",disabled:E,onClick:()=>{c("passkey"),L(null)},children:"back to the passkey"}),i.jsx("button",{type:"button",className:"link-btn",disabled:E,onClick:()=>{c("lost"),L(null)},children:"lost that too?"})]})]}),r==="lost"&&i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"hint",style:{margin:0},children:"Without the passkey, the backup passphrase or the recovery code the vault's secrets can't be recovered — by design, and by anyone. Someone with access to the server's files can reset it, which deletes the vault and reopens the app for a fresh setup:"}),i.jsx("pre",{className:"tool-output",style:{borderTop:"1px solid var(--border)"},children:`npm run vault:reset
52
- # Docker:
53
- docker compose exec runner rm /data/vault.json`}),i.jsx("p",{className:"hint",style:{margin:0},children:"Nothing on the network can do this, which is what keeps the lock meaningful."}),i.jsx("button",{type:"button",className:"link-btn",onClick:()=>{c("passkey"),L(null)},children:"back"})]}),ne&&i.jsx("div",{className:"form-status success",children:ne}),V&&i.jsx("div",{className:"form-status error",children:V})]})]})})}function pi({title:s,onClose:r,children:c}){return N.useEffect(()=>{if(!r)return;const u=f=>f.key==="Escape"&&r();return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[r]),i.jsx("div",{className:"overlay vault-dialog",onClick:r,children:i.jsxs("div",{className:"modal",role:"dialog","aria-label":s,onClick:u=>u.stopPropagation(),children:[i.jsxs("div",{className:"modal-head",children:[i.jsxs("span",{className:"modal-title",children:[i.jsx("span",{className:"dot y","aria-hidden":!0}),s]}),r&&i.jsx("button",{className:"icon-btn close-x",onClick:r,"aria-label":"Close",title:"Close (Esc)",children:"✕"})]}),i.jsx("div",{className:"modal-body",children:c})]})})}const wr=10,Sc=()=>`BugXHunter vault (${location.hostname})`,md="__custom__",oi=[{name:"SCX_API",short:"SCX.ai — the default provider",label:"SCX.ai model key — the default provider"},{name:"NVIDIA_API_KEY",short:"NVIDIA NIM — build.nvidia.com models",label:"NVIDIA NIM key — build.nvidia.com models incl. Nemotron, DeepSeek, GLM-5.3 (optional)"},{name:"OPENROUTER_API_KEY",short:"OpenRouter — one key, its whole catalogue",label:"OpenRouter key — unlocks its model catalogue (optional)"}],tS={SCX_API:"sk-scx-…",NVIDIA_API_KEY:"nvapi-…",OPENROUTER_API_KEY:"sk-or-…"};function nS(){const[s,r]=N.useState(null),[c,u]=N.useState(null),[f,h]=N.useState(Date.now()),m=N.useCallback(()=>O1().then(r).catch(()=>{}),[]);N.useEffect(()=>{m();const y=setInterval(()=>{m(),h(Date.now())},3e4);return()=>clearInterval(y)},[m]);const b=()=>{u(null),m()},g=N.useCallback(()=>{Fd(),M1().then(r).catch(()=>{})},[]);if(N.useEffect(()=>{const y=v=>{(v.ctrlKey||v.metaKey)&&v.shiftKey&&v.key.toLowerCase()==="l"&&(v.preventDefault(),g())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[g]),!s)return null;const S=s.initialised?s.unsealed?i.jsxs(i.Fragment,{children:[i.jsxs("span",{className:"vault-state open",title:s.idleMinutes?`Auto-locks after ${s.idleMinutes} min without activity`:"Auto-lock off",children:["vault open",s.sealsAt?` · locks in ${iS(s.sealsAt-f)}`:""]}),i.jsx("button",{className:"icon-btn vault-btn",onClick:()=>u("manage"),title:"Keys in the vault","aria-label":"Keys in the vault",children:i.jsx(lS,{})}),i.jsx("button",{className:"icon-btn vault-btn",onClick:g,title:"Lock the vault (Ctrl+Shift+L)","aria-label":"Lock the vault (Ctrl+Shift+L)",children:i.jsx(sS,{})})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"vault-state sealed",children:"vault locked"}),i.jsx("button",{className:"icon-btn vault-btn primary",onClick:()=>u("unlock"),title:"Unlock the vault","aria-label":"Unlock the vault",children:i.jsx(aS,{})})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"vault-state none",title:s.keySource==="none"?"No model key yet":s.keySource==="file"?"Model key comes from a key file":`Model key comes from ${s.keySource==="env"?".env":"OpenCode's auth.json"}, in the clear`,children:s.keySource==="none"?"no vault, no model key":"vault not set up"}),i.jsx("button",{className:"btn primary sm",onClick:()=>u("setup"),children:"set_up"})]});return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"vault-row",children:S}),c==="setup"&&i.jsx(rS,{onClose:b}),c==="unlock"&&i.jsx(oS,{status:s,onClose:b}),c==="manage"&&i.jsx(cS,{status:s,onChange:r,onClose:b})]})}const aS=()=>i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("circle",{cx:"12",cy:"16",r:"1"}),i.jsx("rect",{width:"18",height:"12",x:"3",y:"10",rx:"2"}),i.jsx("path",{d:"M7 10V7a5 5 0 0 1 9.33-2.5"})]}),lS=()=>i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M12.4 2.7a2.5 2.5 0 0 1 3.4 0l5.5 5.5a2.5 2.5 0 0 1 0 3.4l-3.7 3.7a2.5 2.5 0 0 1-3.4 0L8.7 9.8a2.5 2.5 0 0 1 0-3.4z"}),i.jsx("path",{d:"m14 7 3 3"}),i.jsx("path",{d:"m9.4 10.6-6.814 6.814A2 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-.814"})]}),sS=()=>i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M12 13v3"}),i.jsx("path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 01-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 011-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 011.52 0C14.51 3.81 17 5 19 5a1 1 0 011 1z"}),i.jsx("circle",{cx:"12",cy:"11",r:"2"})]});function iS(s){const r=Math.max(0,Math.round(s/6e4));return r>=60?`${Math.floor(r/60)}h ${String(r%60).padStart(2,"0")}m`:`${r}m`}const pd=["passkey","key","backups"];function rS({onClose:s}){const[r,c]=N.useState("passkey"),[u,f]=N.useState(null),[h,m]=N.useState("SCX_API"),[b,g]=N.useState(""),[S,y]=N.useState(""),[v,x]=N.useState(""),[E,z]=N.useState(null),[V,L]=N.useState(!1),[ne,pe]=N.useState(!1),[ce,_]=N.useState(!1),[$,H]=N.useState(null);async function Q(){_(!0),H(null);try{f(await Cv(Sc(),Gd)),c("key")}catch(K){H(K.message)}finally{_(!1)}}async function W(){if(u){_(!0),H(null);try{z(await K1({...u,label:Sc(),items:b.trim()?{[h]:b.trim()}:{}})),c("backups")}catch(K){H(K.message)}finally{_(!1)}}}async function re(){if(E){_(!0),H(null);try{let K=E.doc;S&&(K={...K,methods:[...K.methods,await Zd(gn.dec(E.dek),S)]}),await R1(K,E.dek),xc(E.dek),s()}catch(K){H(K.message),_(!1)}}}const G=!S||S.length>=wr&&S===v;return i.jsxs(pi,{title:"vault --init",onClose:r==="backups"?void 0:s,children:[i.jsx("div",{className:"steps",children:pd.map(K=>i.jsx("span",{className:K===r?"on":pd.indexOf(K)<pd.indexOf(r)?"done":"",children:K},K))}),r==="passkey"&&i.jsxs(i.Fragment,{children:[i.jsx("p",{children:"Your model keys will be sealed at rest, and this passkey will unlock them and sign you in — one touch. The authenticator (Windows Hello, Touch ID, Android, or a security key) derives a secret that never leaves it. Works in Chrome, Edge and Safari 18+; Firefox can't do this yet."}),!hi()&&i.jsx("div",{className:"form-status error",children:"This browser has no passkey support."}),i.jsx("div",{className:"perm-actions center",children:i.jsx("button",{className:"btn primary wide",disabled:ce||!hi(),onClick:Q,children:ce?"waiting for the authenticator…":"create passkey →"})})]}),r==="key"&&i.jsxs(i.Fragment,{children:[i.jsxs("p",{children:["Passkey enrolled. Add a model key now, or later from the keys dialog (where you can add the other provider too). It goes straight into the sealed vault; ",i.jsx("code",{className:"mono",children:".env"})," can then drop the key."]}),i.jsx("label",{htmlFor:"v-provider",children:"Provider"}),i.jsx("select",{id:"v-provider",className:"mono",value:h,onChange:K=>m(K.target.value),children:oi.map(K=>i.jsx("option",{value:K.name,children:K.short},K.name))}),i.jsxs("label",{htmlFor:"v-key",children:[h," (optional)"]}),i.jsx("input",{id:"v-key",type:"password",autoFocus:!0,autoComplete:"off",placeholder:tS[h]??"",value:b,onChange:K=>g(K.target.value)}),i.jsx("div",{className:"perm-actions center",children:i.jsx("button",{className:"btn primary wide",disabled:ce,onClick:W,children:ce?"sealing…":"next →"})})]}),r==="backups"&&E&&i.jsxs(i.Fragment,{children:[i.jsxs("p",{children:["Backups, for when the passkey isn't at hand. This recovery code is shown ",i.jsx("b",{children:"once"})," and stored nowhere — keep it offline, like a password-manager note or paper."]}),i.jsxs("button",{type:"button",className:"recovery-code"+(ne?" copied":""),"aria-label":"Recovery code — click to copy",title:"Click to copy",onClick:()=>{var K;(K=navigator.clipboard)==null||K.writeText(E.recoveryCode).then(()=>{pe(!0),setTimeout(()=>pe(!1),2e3)}).catch(()=>{})},children:[i.jsx("span",{className:"code",children:E.recoveryCode}),i.jsx("span",{className:"copy-hint",children:ne?"✓ copied":"click to copy"})]}),i.jsxs("label",{className:"check",children:[i.jsx("input",{type:"checkbox",checked:V,onChange:K=>L(K.target.checked)})," I have stored this code somewhere safe."]}),i.jsxs("label",{htmlFor:"v-pass",children:["Backup passphrase (optional, at least ",wr," characters)"]}),i.jsx("input",{id:"v-pass",type:"password",autoComplete:"new-password",value:S,onChange:K=>y(K.target.value)}),S&&i.jsxs(i.Fragment,{children:[i.jsx("label",{htmlFor:"v-pass2",children:"Again"}),i.jsx("input",{id:"v-pass2",type:"password",autoComplete:"new-password",value:v,onChange:K=>x(K.target.value)}),v&&S!==v&&i.jsx("div",{className:"form-status error",children:"The passphrases differ."})]}),i.jsx("div",{className:"perm-actions center",children:i.jsx("button",{className:"btn primary wide",disabled:!V||!G||ce,onClick:re,children:ce?"creating…":"create vault →"})})]}),$&&i.jsx("div",{className:"form-status error",children:$})]})}function oS({status:s,onClose:r}){const[c,u]=N.useState("passkey"),[f,h]=N.useState(""),[m,b]=N.useState(""),[g,S]=N.useState(!1),[y,v]=N.useState(null),x=s.methods.find(_=>_.type==="passkey"),E=s.methods.find(_=>_.type==="password"),z=s.methods.find(_=>_.type==="recovery"),V=!!(x!=null&&x.passphrase);async function L(_,$){S(!0),v(null);try{let H;try{H=await _()}catch(Q){throw Q instanceof Error&&/Passkey|authenticator|pending|origin/i.test(Q.message)?Q:new Error($)}await xv(H),xc(H),r()}catch(H){v(H.message),S(!1)}}const ne=()=>x&&L(async()=>{const _=await J1(x.credentialId,x.transports,x.prfSalt);return Tv(x,_,V?f:void 0)},V?"Wrong passphrase, or a different passkey than the one enrolled.":"A different passkey than the one enrolled."),pe=()=>E&&L(()=>Ev(E,f),"Wrong backup passphrase."),ce=()=>z&&L(()=>kv(z,m),"That recovery code doesn't open the vault.");return i.jsxs(pi,{title:"vault --unlock",onClose:r,children:[c==="passkey"&&i.jsxs(i.Fragment,{children:[i.jsx("p",{children:V?"This passkey was enrolled with a passphrase: enter it, then confirm with the passkey.":"One touch: confirm with your passkey."}),V&&i.jsxs(i.Fragment,{children:[i.jsx("label",{htmlFor:"v-unlock-pass",children:"Passphrase"}),i.jsx("input",{id:"v-unlock-pass",type:"password",autoFocus:!0,autoComplete:"current-password",value:f,onChange:_=>h(_.target.value),onKeyDown:_=>{_.key==="Enter"&&f&&ne()}})]}),i.jsx("div",{className:"perm-actions center",children:i.jsx("button",{className:"btn primary wide",autoFocus:!V,disabled:g||!x||V&&!f,onClick:ne,children:g?"waiting for the authenticator…":"unlock with passkey →"})}),i.jsxs("div",{className:"login-links",children:[E&&i.jsx("button",{className:"link-btn",disabled:g,onClick:()=>{u("password"),v(null)},children:"use the backup passphrase"}),z&&i.jsx("button",{className:"link-btn",disabled:g,onClick:()=>{u("recovery"),v(null)},children:"use the recovery code"})]})]}),c==="password"&&i.jsxs(i.Fragment,{children:[i.jsx("label",{htmlFor:"v-unlock-pw",children:"Backup passphrase"}),i.jsx("input",{id:"v-unlock-pw",type:"password",autoFocus:!0,autoComplete:"current-password",value:f,onChange:_=>h(_.target.value),onKeyDown:_=>{_.key==="Enter"&&f&&pe()}}),i.jsx("div",{className:"perm-actions center",children:i.jsx("button",{className:"btn primary wide",disabled:g||!f,onClick:pe,children:g?"unlocking…":"unlock →"})}),i.jsxs("div",{className:"login-links",children:[i.jsx("button",{className:"link-btn",disabled:g,onClick:()=>{u("passkey"),v(null)},children:"use the passkey instead"}),z&&i.jsx("button",{className:"link-btn",disabled:g,onClick:()=>{u("recovery"),v(null)},children:"use the recovery code"})]})]}),c==="recovery"&&i.jsxs(i.Fragment,{children:[i.jsx("p",{children:"Enter the recovery code shown when the vault was created."}),i.jsx("label",{htmlFor:"v-code",children:"Recovery code"}),i.jsx("input",{id:"v-code",type:"text",className:"mono",autoFocus:!0,autoComplete:"off",spellCheck:!1,placeholder:"XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-X",value:m,onChange:_=>b(_.target.value),onKeyDown:_=>{_.key==="Enter"&&Ad(m)&&ce()}}),i.jsx("div",{className:"perm-actions center",children:i.jsx("button",{className:"btn primary wide",disabled:g||!Ad(m),onClick:ce,children:g?"unlocking…":"unlock →"})}),i.jsxs("div",{className:"login-links",children:[i.jsx("button",{className:"link-btn",disabled:g,onClick:()=>{u("passkey"),v(null)},children:"use the passkey instead"}),E&&i.jsx("button",{className:"link-btn",disabled:g,onClick:()=>{u("password"),v(null)},children:"use the backup passphrase"})]})]}),y&&i.jsx("div",{className:"form-status error",children:y})]})}function cS({status:s,onChange:r,onClose:c}){const[u,f]=N.useState("SCX_API"),[h,m]=N.useState(""),[b,g]=N.useState(""),[S,y]=N.useState(!1),[v,x]=N.useState(""),[E,z]=N.useState(!1),[V,L]=N.useState(null),ne=F1(),pe=s.methods.filter(Z=>Z.type==="passkey"),ce=s.methods.find(Z=>Z.type==="password");async function _(Z){z(!0),L(null);try{const de=await Z();de&&r(de)}catch(de){L(de.message)}finally{z(!1)}}const $=()=>{if(!ne)throw new Error("Unlock the vault in this tab first (the change must wrap the current key).");return gn.dec(ne)},H=()=>_(async()=>{const Z=await z1(u.trim().toUpperCase(),h);return m(""),Z}),Q=Z=>_(()=>U1(Z)),W=Z=>_(()=>L1(Z)),re=()=>_(async()=>{const Z=$(),de=await jv(Z,await Cv(Sc(),Gd),Sc());return Ey(de,ne)}),G=()=>_(async()=>{const Z=$(),de=await Ey(await Zd(Z,b),ne);return y(!1),g(""),de}),K=()=>_(async()=>{$();const Z=await H1(ne);return Fd(),c(),Z});return i.jsxs(pi,{title:"vault --keys",onClose:c,children:[i.jsx("p",{children:"Secrets sealed in the vault. Values are never shown again; replace one by saving it under the same name."}),i.jsxs("div",{className:"vault-items",children:[oi.map(Z=>{const de=s.items.includes(Z.name);return i.jsxs("div",{className:"vault-item",children:[i.jsx("span",{className:de?"ok":"missing","aria-hidden":!0,children:de?"✓":"○"}),i.jsxs("span",{className:"name",children:[Z.name,i.jsxs("span",{className:"desc",children:[" — ",Z.label]})]}),de?i.jsx("button",{className:"btn danger",disabled:E,onClick:()=>Q(Z.name),title:"Remove",children:"✕"}):i.jsx("button",{className:"btn sm",disabled:E,onClick:()=>{f(Z.name),setTimeout(()=>{var oe;return(oe=document.getElementById("v-value"))==null?void 0:oe.focus()},0)},children:"add"})]},Z.name)}),s.items.filter(Z=>!oi.some(de=>de.name===Z)).map(Z=>i.jsxs("div",{className:"vault-item",children:[i.jsx("span",{className:"ok","aria-hidden":!0,children:"✓"}),i.jsx("span",{className:"name",children:Z}),i.jsx("button",{className:"btn danger",disabled:E,onClick:()=>Q(Z),title:"Remove",children:"✕"})]},Z))]}),i.jsx("label",{htmlFor:"v-name",children:"Key"}),i.jsxs("select",{id:"v-name",className:"mono",value:oi.some(Z=>Z.name===u)?u:md,onChange:Z=>f(Z.target.value===md?"":Z.target.value),children:[oi.map(Z=>i.jsxs("option",{value:Z.name,children:[Z.name,s.items.includes(Z.name)?" (replace)":""]},Z.name)),i.jsx("option",{value:md,children:"custom…"})]}),!oi.some(Z=>Z.name===u)&&i.jsx("input",{type:"text",className:"mono",placeholder:"NAME_IN_UPPER_SNAKE_CASE","aria-label":"Custom key name",value:u,onChange:Z=>f(Z.target.value),spellCheck:!1,autoFocus:!0}),i.jsx("label",{htmlFor:"v-value",children:"Value"}),i.jsx("input",{id:"v-value",type:"password",autoComplete:"off",value:h,onChange:Z=>m(Z.target.value),onKeyDown:Z=>{Z.key==="Enter"&&h&&H()}}),i.jsxs("div",{className:"perm-actions",children:[i.jsx("button",{className:"btn primary sm",disabled:E||!h||!u.trim(),onClick:H,children:E?"sealing…":"save"}),i.jsx("span",{className:"hint",style:{margin:0},children:s.idleMinutes?`Auto-locks after ${s.idleMinutes} min idle.`:"Auto-lock is off."})]}),i.jsx("div",{className:"section-title",children:"passkeys"}),i.jsx("p",{children:"Each passkey unlocks the vault and signs you in with one touch. Keep two, on different devices, so losing one is not an emergency."}),i.jsx("div",{className:"vault-items",children:pe.map(Z=>i.jsxs("div",{className:"vault-item",children:[i.jsx("span",{className:Z.canLogin?"ok":"warn","aria-hidden":!0,children:Z.canLogin?"✓":"!"}),i.jsxs("span",{className:"name",children:[Z.label,Z.passphrase?" — needs its passphrase (older enrolment)":"",Z.canLogin?"":" — unlock only, can't sign in; add a new passkey"]}),i.jsx("button",{className:"btn danger",disabled:E||pe.length<=1,onClick:()=>W(Z.id),title:pe.length<=1?"Add another passkey first":"Remove",children:"✕"})]},Z.id))}),i.jsx("div",{className:"perm-actions",children:i.jsx("button",{className:"btn sm",disabled:E||!ne,onClick:re,title:ne?"":"Unlock the vault in this tab first",children:E?"waiting for the authenticator…":"+ add passkey"})}),i.jsx("div",{className:"section-title",children:"backups"}),i.jsx("p",{children:"The recovery code from setup always works. A backup passphrase is optional: a way in on a device without the passkey."}),i.jsxs("div",{className:"vault-items",children:[i.jsxs("div",{className:"vault-item",children:[i.jsx("span",{className:"ok","aria-hidden":!0,children:"✓"}),i.jsx("span",{className:"name",children:"Recovery code"})]}),ce&&i.jsxs("div",{className:"vault-item",children:[i.jsx("span",{className:"ok","aria-hidden":!0,children:"✓"}),i.jsx("span",{className:"name",children:"Backup passphrase"}),i.jsx("button",{className:"btn danger",disabled:E,onClick:()=>W(ce.id),title:"Remove",children:"✕"})]})]}),S?i.jsxs(i.Fragment,{children:[i.jsxs("label",{htmlFor:"v-newpass",children:[ce?"New backup passphrase":"Backup passphrase"," (at least ",wr," characters)"]}),i.jsx("input",{id:"v-newpass",type:"password",autoFocus:!0,autoComplete:"new-password",value:b,onChange:Z=>g(Z.target.value),onKeyDown:Z=>{Z.key==="Enter"&&b.length>=wr&&G()}}),i.jsxs("div",{className:"perm-actions",children:[i.jsx("button",{className:"btn primary sm",disabled:E||b.length<wr,onClick:G,children:E?"sealing…":"save"}),i.jsx("button",{className:"btn sm",disabled:E,onClick:()=>y(!1),children:"cancel"})]})]}):i.jsx("div",{className:"perm-actions",children:i.jsx("button",{className:"btn sm",disabled:E||!ne,onClick:()=>y(!0),title:ne?"":"Unlock the vault in this tab first",children:ce?"replace backup passphrase":"+ set a backup passphrase"})}),i.jsx("div",{className:"section-title",children:"danger zone"}),i.jsxs("p",{children:["Delete the vault to start over with new factors. Its secrets are gone; the app reopens without sign-in until a new vault exists. Lost every factor instead? Run ",i.jsx("code",{className:"mono",children:"npm run vault:reset"})," on the server."]}),i.jsxs("div",{className:"perm-actions",children:[i.jsx("input",{type:"text",className:"mono",placeholder:"type DELETE",value:v,onChange:Z=>x(Z.target.value),style:{width:160}}),i.jsx("button",{className:"btn danger-outline sm",disabled:E||v!=="DELETE"||!ne,onClick:K,children:"delete vault"})]}),V&&i.jsx("div",{className:"form-status error",children:V})]})}function Gt({size:s=14,children:r,className:c}){return i.jsx("svg",{className:c,width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:r})}const Pd=s=>i.jsxs(Gt,{...s,children:[i.jsx("path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}),i.jsx("path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}),i.jsx("path",{d:"M10 9H8"}),i.jsx("path",{d:"M16 13H8"}),i.jsx("path",{d:"M16 17H8"})]}),uS=s=>i.jsxs(Gt,{...s,children:[i.jsx("path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34"}),i.jsx("path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}),i.jsx("path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z"})]}),fS=s=>i.jsxs(Gt,{...s,children:[i.jsx("path",{d:"M12 19h8"}),i.jsx("path",{d:"m4 17 6-6-6-6"})]}),ky=s=>i.jsxs(Gt,{...s,children:[i.jsx("path",{d:"m21 21-4.34-4.34"}),i.jsx("circle",{cx:"11",cy:"11",r:"8"})]}),dS=s=>i.jsxs(Gt,{...s,children:[i.jsx("path",{d:"M10.7 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 2v4.1"}),i.jsx("path",{d:"m21 21-1.9-1.9"}),i.jsx("circle",{cx:"17",cy:"17",r:"3"})]}),hS=s=>i.jsxs(Gt,{...s,children:[i.jsx("path",{d:"M3 5h.01"}),i.jsx("path",{d:"M3 12h.01"}),i.jsx("path",{d:"M3 19h.01"}),i.jsx("path",{d:"M8 5h13"}),i.jsx("path",{d:"M8 12h13"}),i.jsx("path",{d:"M8 19h13"})]}),mS=s=>i.jsxs(Gt,{...s,children:[i.jsx("circle",{cx:"12",cy:"12",r:"10"}),i.jsx("path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"}),i.jsx("path",{d:"M2 12h20"})]}),pS=s=>i.jsxs(Gt,{...s,children:[i.jsx("path",{d:"M13 5h8"}),i.jsx("path",{d:"M13 12h8"}),i.jsx("path",{d:"M13 19h8"}),i.jsx("path",{d:"m3 17 2 2 4-4"}),i.jsx("path",{d:"m3 7 2 2 4-4"})]}),gS=s=>i.jsxs(Gt,{...s,children:[i.jsx("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"}),i.jsx("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),i.jsx("path",{d:"M12 17h.01"})]}),yS=s=>i.jsx(Gt,{...s,children:i.jsx("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"})}),vS=s=>i.jsxs(Gt,{...s,children:[i.jsx("line",{x1:"6",x2:"6",y1:"3",y2:"15"}),i.jsx("circle",{cx:"18",cy:"6",r:"3"}),i.jsx("circle",{cx:"6",cy:"18",r:"3"}),i.jsx("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),Dv=s=>i.jsxs(Gt,{...s,children:[i.jsx("path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"}),i.jsx("path",{d:"M9 18c-4.51 2-5-2-7-2"})]}),bS=s=>i.jsxs(Gt,{...s,children:[i.jsx("path",{d:"M20 5a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2V3a1 1 0 0 1 1-1h2.172a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 13.828 4H20Z"}),i.jsx("path",{d:"M3 8.268a2 2 0 0 0-1 1.738V19a2 2 0 0 0 2 2h11a2 2 0 0 0 1.732-1"})]}),Wd=s=>i.jsx(Gt,{...s,children:i.jsx("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"})}),xS=s=>i.jsxs(Gt,{...s,children:[i.jsx("path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}),i.jsx("path",{d:"M14 2v5a1 1 0 0 0 1 1h5"})]}),SS=s=>i.jsxs(Gt,{...s,children:[i.jsx("path",{d:"M12 3v12"}),i.jsx("path",{d:"m17 8-5-5-5 5"}),i.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"})]}),wS=s=>i.jsxs(Gt,{...s,children:[i.jsx("path",{d:"M12 15V3"}),i.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),i.jsx("path",{d:"m7 10 5 5 5-5"})]}),NS=s=>i.jsxs(Gt,{...s,children:[i.jsx("path",{d:"M10 11v6"}),i.jsx("path",{d:"M14 11v6"}),i.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}),i.jsx("path",{d:"M3 6h18"}),i.jsx("path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]}),jS=s=>i.jsxs(Gt,{...s,children:[i.jsx("path",{d:"M5 12h14"}),i.jsx("path",{d:"M12 5v14"})]}),TS=s=>i.jsxs(Gt,{...s,children:[i.jsx("path",{d:"M14 9 9 4 4 9"}),i.jsx("path",{d:"M20 20h-7a4 4 0 0 1-4-4V4"})]}),zc=s=>i.jsx(Gt,{...s,children:i.jsx("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"})});function ES({tool:s,size:r=14}){switch(s){case"read":return i.jsx(Pd,{size:r});case"write":case"edit":case"patch":case"apply_patch":return i.jsx(uS,{size:r});case"bash":return i.jsx(fS,{size:r});case"grep":return i.jsx(ky,{size:r});case"glob":case"list":return i.jsx(dS,{size:r});case"webfetch":return i.jsx(mS,{size:r});case"websearch":return i.jsx(ky,{size:r});case"todowrite":case"todoread":return i.jsx(pS,{size:r});case"task":return i.jsx(hS,{size:r});case"question":return i.jsx(gS,{size:r});default:return i.jsx(yS,{size:r})}}async function vs(s,r){var u,f;const c=await fetch(s,{headers:{"Content-Type":"application/json"},...r});if(!c.ok){let h=`${c.status}`;try{h=((f=(u=await c.json())==null?void 0:u.error)==null?void 0:f.message)??h}catch{}throw new Error(h)}return c.json()}const kS=()=>vs("/api/github"),AS=()=>vs("/api/github/repos").then(s=>s.repos),_S=s=>vs(`/api/github/branches?repo=${encodeURIComponent(s)}`).then(r=>r.branches),CS=s=>vs("/api/github/clone",{method:"POST",body:JSON.stringify(s)}),DS=()=>vs("/api/github/connect/start",{method:"POST"}),OS=s=>vs("/api/github/connect/poll",{method:"POST",body:JSON.stringify({id:s})}),RS=()=>vs("/api/github/connect",{method:"DELETE"});function wc(s){if(!s)return"";const r=Math.max(0,(Date.now()-new Date(s).getTime())/1e3);return r<3600?`${Math.max(1,Math.round(r/60))} min ago`:r<86400?`${Math.round(r/3600)} h ago`:r<86400*30?`${Math.round(r/86400)} d ago`:r<86400*365?`${Math.round(r/(86400*30))} mo ago`:`${Math.round(r/(86400*365))} y ago`}function MS({onOpen:s,onClose:r}){const[c,u]=N.useState(null),[f,h]=N.useState(null),[m,b]=N.useState(null),[g,S]=N.useState(""),[y,v]=N.useState(null),[x,E]=N.useState(null),[z,V]=N.useState(""),[L,ne]=N.useState(null),[pe,ce]=N.useState(null),[_,$]=N.useState(null),[H,Q]=N.useState(!1),W=N.useCallback(()=>kS().then(P=>{u(P),h(null)}).catch(P=>h(P.message)),[]);N.useEffect(()=>{W()},[W]);const re=!!(c!=null&&c.connected&&!c.sealed&&!c.error),G=N.useCallback(()=>{ne("repos"),AS().then(b).catch(P=>ce(P.message)).finally(()=>ne(P=>P==="repos"?null:P))},[]);N.useEffect(()=>{re&&G()},[re,G]),N.useEffect(()=>{if(!re)return;const P=()=>G();return window.addEventListener("focus",P),()=>window.removeEventListener("focus",P)},[re,G]);const K=N.useRef(null),Z=()=>{K.current&&(window.clearTimeout(K.current),K.current=null)};N.useEffect(()=>Z,[]);async function de(){ne("connect"),ce(null);try{const P=await DS();$(P);try{await navigator.clipboard.writeText(P.userCode),Q(!0)}catch{Q(!1)}const _e=async()=>{try{const ot=await OS(P.id);if(ot.status==="pending"){K.current=window.setTimeout(_e,P.interval*1e3);return}if($(null),ne(null),ot.status==="connected"){await W();return}ce(ot.status==="denied"?"The sign-in was cancelled on GitHub.":"The code expired. Start again.")}catch(ot){$(null),ne(null),ce(ot.message)}};K.current=window.setTimeout(_e,P.interval*1e3)}catch(P){ne(null),ce(P.message)}}function oe(){Z(),$(null),ne(null)}async function De(){ce(null);try{await RS(),b(null),v(null),await W()}catch(P){ce(P.message)}}function ae(P){v(P),V(P.defaultBranch),E(null),ce(null),ne("branches"),_S(P.fullName).then(_e=>{E(_e),!_e.some(ot=>ot.name===P.defaultBranch)&&_e[0]&&V(_e[0].name)}).catch(_e=>ce(_e.message)).finally(()=>ne(_e=>_e==="branches"?null:_e))}async function F(){if(y){ne("clone"),ce(null);try{const P=await CS({repo:y.fullName,branch:z});s(P.directory),r()}catch(P){ce(P.message)}finally{ne(null)}}}const he=N.useMemo(()=>{const P=g.trim().toLowerCase();return(m??[]).filter(_e=>!P||_e.fullName.toLowerCase().includes(P)||(_e.description??"").toLowerCase().includes(P))},[m,g]);return i.jsxs(pi,{title:"github --clone",onClose:r,children:[f&&i.jsx("div",{className:"hint danger",children:f}),c&&!c.connected&&!_&&i.jsxs(i.Fragment,{children:[i.jsxs("p",{children:["Clone a repository into the workspace so the agent can review it. ",i.jsx("b",{children:"Read-only"}),": the app can only read code, it reaches only the repositories you install it on, and nothing in the sandbox can push."]}),i.jsx("div",{className:"perm-actions center",children:i.jsxs("button",{className:"btn primary wide",disabled:L!==null,onClick:de,children:[i.jsx(Dv,{size:15})," ",L==="connect"?"contacting GitHub…":"Connect GitHub"]})}),c.storage==="memory"&&i.jsx("div",{className:"hint",style:{textAlign:"center"},children:"No vault yet, so the sign-in is kept until the runner restarts. Set up the vault to keep it."})]}),_&&i.jsxs(i.Fragment,{children:[i.jsxs("p",{children:["Enter this code on GitHub to connect. ",H?"It is on your clipboard.":"Click it to copy."]}),i.jsx("button",{className:"recovery-code gh-code",onClick:()=>navigator.clipboard.writeText(_.userCode).then(()=>Q(!0)).catch(()=>{}),title:"Copy",children:_.userCode}),i.jsx("div",{className:"perm-actions center",children:i.jsx("a",{className:"btn primary wide",href:_.verificationUri,target:"_blank",rel:"noreferrer",children:"Open github.com/login/device ↗"})}),i.jsxs("div",{className:"hint",style:{textAlign:"center"},children:["Waiting for your approval… this finishes by itself. ",i.jsx("button",{className:"link-btn",onClick:oe,children:"cancel"})]})]}),(c==null?void 0:c.sealed)&&i.jsx("p",{children:"Your GitHub sign-in is in the vault, which is locked. Unlock it (the lock icon below) and reopen this dialog."}),(c==null?void 0:c.error)&&i.jsx("div",{className:"hint danger",children:c.error}),re&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"gh-head",children:[i.jsxs("span",{children:["connected as ",i.jsx("b",{children:c.login}),c.storage==="memory"?" · until restart (no vault yet)":""," · ",i.jsx("button",{className:"link-btn",onClick:De,children:"disconnect"})]}),i.jsx("a",{href:c.installUrl,target:"_blank",rel:"noreferrer",children:"choose repositories on GitHub ↗"})]}),c.clones.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"section-title",children:"in the workspace"}),i.jsx("div",{className:"vault-items",children:c.clones.map(P=>i.jsxs("div",{className:"vault-item",children:[i.jsx("span",{className:"ok","aria-hidden":!0,children:"✓"}),i.jsxs("span",{className:"name",title:P.directory,children:[P.fullName,i.jsxs("span",{className:"desc",children:[" — ",P.branch??"detached"]})]}),i.jsx("button",{className:"btn sm",onClick:()=>{s(P.directory),r()},children:"open"})]},P.directory))})]}),m&&m.length===0?i.jsxs("div",{className:"gh-callout",children:[i.jsx("b",{children:"One more step."})," Signing in says who you are; which repositories BugXHunter may read is chosen separately, on GitHub's install screen. An organisation's owner may have to approve it. This list refreshes when you come back.",i.jsx("div",{className:"perm-actions center",children:i.jsx("a",{className:"btn primary wide",href:c.installUrl,target:"_blank",rel:"noreferrer",children:"Choose repositories on GitHub ↗"})})]}):i.jsxs(i.Fragment,{children:[i.jsx("input",{type:"text",className:"mono",placeholder:"filter repositories…",value:g,onChange:P=>S(P.target.value),spellCheck:!1,autoFocus:!0}),i.jsxs("div",{className:"gh-list",role:"listbox","aria-label":"Repositories",children:[L==="repos"&&!m&&i.jsx("div",{className:"hint",children:"loading…"}),m&&m.length>0&&he.length===0&&i.jsx("div",{className:"hint",children:"Nothing matches."}),he.map(P=>i.jsxs("button",{className:`gh-repo${(y==null?void 0:y.fullName)===P.fullName?" selected":""}`,role:"option","aria-selected":(y==null?void 0:y.fullName)===P.fullName,onClick:()=>ae(P),children:[i.jsxs("span",{className:"gh-name",children:[P.fullName,P.private&&i.jsx("span",{className:"badge",children:"private"}),P.archived&&i.jsx("span",{className:"badge",children:"archived"}),P.directory&&i.jsx("span",{className:"badge on",children:"in workspace"})]}),P.description&&i.jsx("span",{className:"gh-desc",children:P.description}),i.jsxs("span",{className:"gh-meta",children:[i.jsx(vS,{size:11})," ",P.defaultBranch,P.pushedAt?` · pushed ${wc(P.pushedAt)}`:""]})]},P.fullName))]})]}),y&&i.jsxs("div",{className:"gh-clone",children:[i.jsx("label",{htmlFor:"gh-branch",children:"Branch"}),i.jsx("select",{id:"gh-branch",className:"mono",value:z,onChange:P=>V(P.target.value),disabled:!x,children:(x??[{name:z,isDefault:!0}]).map(P=>i.jsxs("option",{value:P.name,children:[P.name,P.isDefault?" (default)":""]},P.name))}),i.jsx("button",{className:"btn primary sm",disabled:L!==null||!z,onClick:F,children:L==="clone"?y.directory?"updating…":"cloning…":y.directory?"update & open":"clone & open"})]}),y&&i.jsxs("div",{className:"hint",children:["Lands in ",i.jsxs("span",{className:"mono",children:[c.cloneRoot,"/",y.fullName]}),". An existing clone is fast-forwarded, never reset; the agent's local edits stay."]})]}),pe&&i.jsx("div",{className:"hint danger",children:pe})]})}function zS({current:s,onOpen:r,onDeleted:c,onClose:u}){const[f,h]=N.useState(""),[m,b]=N.useState(null),[g,S]=N.useState(""),[y,v]=N.useState(null),[x,E]=N.useState(""),[z,V]=N.useState(!1),[L,ne]=N.useState(null),pe=N.useCallback(()=>b1().then(H=>{h(H.root),b(H.workspaces)}).catch(H=>ne(H.message)),[]);N.useEffect(()=>{pe()},[pe]);async function ce(H){V(!0),ne(null);try{await H()}catch(Q){ne(Q.message)}finally{V(!1)}}const _=()=>ce(async()=>{const H=await x1(g.trim());S(""),r(H.directory),u()}),$=H=>ce(async()=>{await S1(H.directory),c(H.directory),v(null),E(""),await pe()});return i.jsxs(pi,{title:"workspace --list",onClose:u,children:[i.jsxs("p",{children:["Each workspace is a folder the agent works in",f?i.jsxs(i.Fragment,{children:[" under ",i.jsx("span",{className:"mono",children:f})]}):null,". Repositories cloned from GitHub appear here too."]}),i.jsxs("div",{className:"ws-new",children:[i.jsx("input",{type:"text",className:"mono",placeholder:"new-workspace-name","aria-label":"New workspace name",value:g,spellCheck:!1,onChange:H=>S(H.target.value),onKeyDown:H=>{H.key==="Enter"&&g.trim()&&_()}}),i.jsxs("button",{className:"btn primary sm",disabled:z||!g.trim(),onClick:_,children:[i.jsx(jS,{size:13})," create"]})]}),i.jsxs("div",{className:"gh-list",role:"list",children:[!m&&!L&&i.jsx("div",{className:"hint",children:"loading…"}),m&&m.length===0&&i.jsx("div",{className:"hint",children:"No workspaces yet. Create one above, or clone a repository from GitHub."}),m==null?void 0:m.map(H=>{const Q=H.directory===s;return i.jsxs("div",{className:`ws-row${Q?" current":""}`,role:"listitem",children:[i.jsxs("button",{className:"ws-open",onClick:()=>{r(H.directory),u()},disabled:Q,title:Q?"This is the open project":`Open ${H.directory}`,children:[i.jsx(Wd,{size:14}),i.jsxs("span",{className:"gh-name",children:[H.name,Q&&i.jsx("span",{className:"badge on",children:"open"}),!H.git&&i.jsx("span",{className:"badge",children:"no git"})]}),i.jsx("span",{className:"gh-meta",children:H.modified?`changed ${wc(H.modified)}`:""})]}),i.jsx("button",{className:"icon-btn ws-del",disabled:z||Q,onClick:()=>{v(H),E("")},title:Q?"Open another project before deleting this one":`Delete ${H.name}`,"aria-label":`Delete ${H.name}`,children:i.jsx(NS,{size:14})})]},H.directory)})]}),y&&i.jsxs("div",{className:"ws-confirm",children:[i.jsxs("p",{children:[i.jsxs("b",{children:["Delete ",y.name,"?"]})," Everything in ",i.jsx("span",{className:"mono",children:y.directory})," is removed, including work the agent has not pushed anywhere. Type the name to confirm."]}),i.jsxs("div",{className:"ws-new",children:[i.jsx("input",{type:"text",className:"mono",autoFocus:!0,placeholder:y.name,"aria-label":"Type the workspace name to confirm",value:x,spellCheck:!1,onChange:H=>E(H.target.value),onKeyDown:H=>{H.key==="Enter"&&x===y.name&&$(y)}}),i.jsx("button",{className:"btn danger-outline sm",disabled:z||x!==y.name,onClick:()=>$(y),children:z?"deleting…":"delete"}),i.jsx("button",{className:"btn sm",disabled:z,onClick:()=>v(null),children:"cancel"})]})]}),L&&i.jsx("div",{className:"hint danger",children:L})]})}function jr(s){return s>=1024*1024?(s/1024/1024).toFixed(1)+" MB":s>=1024?Math.round(s/1024)+" KB":s+" B"}function Nc(s){return s>=1e6?(s/1e6).toFixed(s%1e6?1:0)+"M":s>=1e3?Math.round(s/1e3)+"k":String(s)}const Ay=s=>(s<1e4?(s/1e3).toFixed(1):Math.round(s/1e3))+"s";function Ov(s,r,c){const u=[];s.ttft!==void 0&&u.push(`${Ay(s.ttft)} to first token`);const f=c?s.total:s.total-(s.ttft??0);return r&&f>50&&u.push(`${Math.round(r/(f/1e3))} tok/s`),u.push(`${Ay(s.total)} total`),u.join(" · ")}function US({directory:s,onClose:r}){const[c,u]=N.useState(""),[f,h]=N.useState(null),[m,b]=N.useState(null),[g,S]=N.useState([]),[y,v]=N.useState(null),[x,E]=N.useState(!1),z=N.useRef(null),V=N.useCallback(_=>{v(null),w1(s,_).then($=>{h($),u($.path)}).catch($=>v($.message))},[s]);N.useEffect(()=>{V("")},[V]);async function L(_){const $=Array.from(_);if(!$.length)return;v(null);const H=[];for(let Q=0;Q<$.length;Q++){const W=$[Q];b(`uploading ${Q+1} of ${$.length}: ${W.name}`);try{const re=await N1(s,c,W);H.push(re.name===W.name?`${re.path} (${jr(re.bytes)})`:`${W.name} → ${re.path}, as a file of that name exists`)}catch(re){H.push(`${W.name}: ${re.message}`)}}b(null),S(H),V(c)}const ne=_=>{_.preventDefault(),E(!1),_.dataTransfer.files.length&&L(_.dataTransfer.files)},pe=c?c.split("/"):[],ce=s.split(/[\\/]/).filter(Boolean).pop()??s;return i.jsxs(pi,{title:"files --browse",onClose:r,children:[i.jsxs("div",{className:"files-head",children:[i.jsxs("nav",{className:"files-crumbs mono","aria-label":"Folder",children:[i.jsx("button",{className:"link-btn",onClick:()=>V(""),title:s,children:ce}),pe.map((_,$)=>i.jsxs("span",{children:[i.jsx("span",{className:"sep",children:"/"}),i.jsx("button",{className:"link-btn",onClick:()=>V(pe.slice(0,$+1).join("/")),children:_})]},$))]}),i.jsxs("button",{className:"btn primary sm",disabled:!!m,onClick:()=>{var _;return(_=z.current)==null?void 0:_.click()},children:[i.jsx(SS,{size:13})," upload"]}),i.jsx("input",{ref:z,type:"file",multiple:!0,hidden:!0,onChange:_=>{_.target.files&&L(_.target.files),_.target.value=""}})]}),i.jsxs("div",{className:`gh-list files-list${x?" dragging":""}`,role:"list",onDragOver:_=>{_.preventDefault(),E(!0)},onDragLeave:()=>E(!1),onDrop:ne,children:[!f&&!y&&i.jsx("div",{className:"hint",children:"loading…"}),c&&i.jsxs("button",{className:"file-row",onClick:()=>V(pe.slice(0,-1).join("/")),children:[i.jsx(TS,{size:14}),i.jsx("span",{className:"file-name",children:".."})]}),f&&f.entries.length===0&&i.jsx("div",{className:"hint",children:"Empty. Drop files here, or use upload."}),f==null?void 0:f.entries.map(_=>{const $=c?`${c}/${_.name}`:_.name;return _.type==="dir"?i.jsxs("button",{className:"file-row",onClick:()=>V($),children:[i.jsx(Wd,{size:14}),i.jsxs("span",{className:"file-name",children:[_.name,"/"]}),i.jsx("span",{className:"gh-meta",children:_.modified?wc(_.modified):""})]},_.name):i.jsxs("a",{className:"file-row",href:j1(s,$),download:_.name,title:`Download ${$}`,children:[i.jsx(xS,{size:14}),i.jsx("span",{className:"file-name",children:_.name}),i.jsxs("span",{className:"gh-meta",children:[jr(_.size),_.modified?` · ${wc(_.modified)}`:""]}),i.jsx(wS,{size:13,className:"file-dl"})]},_.name)}),(f==null?void 0:f.truncated)&&i.jsx("div",{className:"hint",children:"Showing the first 2000 entries."})]}),i.jsx("div",{className:"hint",children:m??"Click a file to download it. Drop files on the list to upload them into this folder; nothing is overwritten."}),g.length>0&&i.jsx("ul",{className:"files-notes",children:g.map((_,$)=>i.jsx("li",{className:"mono",children:_},$))}),y&&i.jsx("div",{className:"hint danger",children:y})]})}const LS=/(embed|rerank|retriev|guard|safety|detector|deplot|calibration|reward|whisper|\bstt\b|\btts\b|parse|ocr|opir)/i;function jc(s){return s.output_modalities.includes("text")?!LS.test(`${s.id} ${s.name}`):!1}function HS(s,r){const c=r.trim().toLowerCase();return!c||`${s.name} ${s.id}`.toLowerCase().includes(c)}const BS=`To draw a diagram, put a drawgen spec (YAML) in a fenced block tagged drawio; the app renders it as an editable draw.io diagram. One diagram per block. Format:
54
-
55
- \`\`\`drawio
56
- title: Order flow # required
57
- layout: auto # let the app place nodes; omit x/y on nodes
58
- direction: right # right (default) or down
59
- nodes: # id, label, kind are required; sub is an optional second line
60
- - {id: user, label: Shopper, kind: actor}
61
- - {id: api, label: Orders API, kind: service, sub: "Node 22"}
62
- - {id: db, label: Postgres, kind: datastore}
63
- edges: # from, to required; label optional; style optional
64
- - {from: user, to: api, label: HTTPS}
65
- - {from: api, to: db, label: SQL, style: data}
66
- legend: true
67
- \`\`\`
68
-
69
- kind (colour means type only, the label carries the meaning): actor, external, service, ai, worker, datastore, queue, ui, gov, security, decision, step, terminal, note.
70
- edge style: sync (default), async, data, ai, weak. Edge keys: from, to, label, style, both, curved.
71
- Zones need manual layout (x, y, w, h on zones and x, y on every node), so prefer layout: auto without zones.
72
- Keep labels short (two or three words), at most about 15 nodes, ids lowercase without spaces. Draw at most one edge between any two nodes: combine what flows between them into one label (e.g. "GET /user, /download, /run"). Quote any label that contains : ? # { } [ ] or a comma, e.g. label: "GET /user?id=". Put explanations in prose outside the block, not in the diagram.
73
- For an attack path use kind: actor for the attacker, step for each stage, and put the technique or CWE in sub. Use decision for branches.`,Cd=[{id:"code-review",label:"Code reviewer",system:"You are a senior application security engineer reviewing code. For each finding give: severity (Critical/High/Medium/Low), the vulnerable line(s), why it is exploitable, the CWE ID, and a corrected snippet. If the code is safe, say so; do not invent issues.",starters:[`Review this code for security vulnerabilities:
74
-
75
- `,`Is this SQL query safe from injection?
76
-
77
- `,`What are the security risks in this auth middleware?
78
-
79
- `]},{id:"threat-model",label:"Threat modeller",system:"You are a threat-modelling specialist using STRIDE. For the system described, list assets, trust boundaries and entry points, then a table of threats: threat, STRIDE category, likelihood, impact, mitigation. Prioritise the top risks and keep it practical.",starters:["Threat-model a password-reset flow that emails a link with a token.","Threat-model a mobile app that calls a REST API with JWTs.","What are the top risks of exposing an internal admin panel behind SSO?"]},{id:"diagram",label:"Diagram & screenshot reviewer",system:"You review architecture diagrams, network diagrams and UI screenshots for security issues. Read every label carefully. For each issue give: where it appears, why it matters, severity, and the fix. Look for exposed ports, plaintext protocols, hardcoded secrets, missing auth or MFA, public storage, outdated software and missing logging. Only report what is visible and flag any assumptions.",starters:["Review the attached diagram for security issues.","What would an attacker target first in this screenshot?","Check this login page screenshot for security and phishing red flags."]},{id:"draw",label:"Diagram drawer",system:`You explain systems, code and security findings with diagrams. Read what you are given, then draw it: data flows, request paths, trust relationships or attack paths. Draw only what the material shows and say what you assumed. After the diagram, add two to four sentences on what it shows and the main security points.
80
-
81
- `+BS,starters:[`Draw the request flow of this code, from the user to every data store:
82
-
83
- `,`Draw the attack path for these findings, from initial access to impact:
84
-
85
- `,`Draw this system's components and data flows, marking which links are unencrypted:
86
-
87
- `]},{id:"phishing",label:"Phishing analyst",system:"You analyse suspicious emails, messages and URLs. Give a verdict (phishing / suspicious / likely legitimate) with a confidence level, list the red flags (sender, links, urgency, attachments, headers), and the recommended action for the user and for the SOC. Never visit links; reason from the text provided.",starters:[`Is this email phishing?
88
-
89
- `,`Analyse these email headers for spoofing:
90
-
91
- `,"Write a 5-point phishing awareness checklist for staff."]},{id:"logs",label:"Log triage (SOC)",system:"You are a SOC analyst triaging logs. Identify suspicious events, group them into likely attack stages with MITRE ATT&CK technique IDs where clear, rate severity, and give next investigative steps and containment actions. Separate evidence from inference.",starters:[`Triage these auth logs for brute force or credential stuffing:
92
-
93
- `,`Do these web server logs show SQL injection attempts?
94
-
95
- `,"Write a Sigma rule to detect password spraying against Entra ID."]},{id:"explainer",label:"Vulnerability explainer",system:"You teach application security to developers. Explain the vulnerability class clearly, show a minimal vulnerable example and the fixed version, describe the real-world impact, and list prevention controls. Keep it educational and defensive.",starters:["Explain SSRF with a vulnerable example and the fix.","Explain IDOR and how to test for it in an API.","What is prototype pollution in JavaScript?"]}],qS=["Explain SSRF with a vulnerable example and the fix.","Threat-model a password-reset flow that emails a link with a token.",`Is this email phishing?
96
-
97
- `,`Review this code for security vulnerabilities:
98
-
99
- `];function Rv(s){return Cd.find(r=>r.system===s.trim())}const YS={type:"function",function:{name:"get_weather",description:"Get the current weather for a city",parameters:{type:"object",properties:{city:{type:"string",description:"City name"}},required:["city"]}}};function XS({onCollapse:s,sessions:r,mode:c,setMode:u,runner:f,status:h,statusError:m,onOpenDirectory:b,onForgetDirectory:g,config:S,setConfig:y,models:v,modelError:x,activeModel:E,onReset:z,saved:V}){var se,be;const L=(C,me)=>y(Me=>({...Me,[C]:me})),[ne,pe]=N.useState(!1);N.useEffect(()=>{const C=()=>fetch("/api/auth/me").then(Me=>Me.json()).then(Me=>pe(!!Me.required)).catch(()=>{});C();const me=setInterval(C,3e4);return()=>clearInterval(me)},[]);const[ce,_]=N.useState([]),[$,H]=N.useState(""),[Q,W]=N.useState(""),[re,G]=N.useState(!1),[K,Z]=N.useState(null),[de,oe]=N.useState(null);N.useEffect(()=>{Wx().then(_).catch(()=>{})},[]);async function De(){if(Q.trim()){G(!0),Z(null);try{const C=await e1($.trim()||`Document ${ce.length+1}`,Q);_(C),H(""),W(""),S.useKnowledge||L("useKnowledge",!0)}catch(C){Z(String(C.message??C))}finally{G(!1)}}}async function ae(C){_(await t1(C))}const F=(E==null?void 0:E.supported_features)??[],he=F.includes("tools"),P=F.includes("json_mode"),_e=F.includes("reasoning"),[ot,ht]=N.useState(""),[mt,T]=N.useState(!1),te=v.filter(C=>C.output_modalities.includes("text")),xe=te.filter(C=>mt||jc(C)||C.id===S.model),Se=te.filter(C=>!jc(C)).length,He=xe.filter(C=>HS(C,ot)||C.id===S.model),Ue=["scx","nvidia","openrouter"].map(C=>[C,He.filter(me=>(me.provider??"scx")===C)]).filter(([,C])=>C.length>0),je=Rv(S.system),fe=v.some(C=>C.provider==="nvidia"),[we,pt]=N.useState([]);N.useEffect(()=>{fe&&fetch("/api/models/nvidia-health").then(C=>C.ok?C.json():null).then(C=>pt(Array.isArray(C==null?void 0:C.retired)?C.retired:[])).catch(()=>{})},[fe,v]);function q(C,me){y(Me=>{const lt=Me.tools.slice();return lt[C]={...lt[C],function:{...lt[C].function,...me}},{...Me,tools:lt}})}function Re(C,me){try{const Me=JSON.parse(me);q(C,{parameters:Me})}catch{}}function Ae(C){if(!C)return null;const me=C.function??C;return me!=null&&me.name?{type:"function",id:Ed(),function:{name:me.name,description:me.description,parameters:me.parameters??me.schema}}:null}async function Be(){oe(null);try{const C=await fetch("/example-tools.json",{cache:"no-store"});if(!C.ok)throw new Error(`No example-tools.json yet (${C.status}) — add web/public/example-tools.json first.`);const me=await C.json(),Me=(Array.isArray(me)?me:me.tools??[]).map(Ae).filter(Boolean);if(!Me.length)throw new Error("File had no valid tools.");let lt=0;y(gt=>{const Dt=new Set(gt.tools.map(ut=>ut.function.name)),Ke=Me.filter(ut=>!Dt.has(ut.function.name));return lt=Ke.length,{...gt,tools:[...gt.tools,...Ke]}}),oe(lt?`Loaded ${lt} tool${lt>1?"s":""}.`:"Already loaded.")}catch(C){oe(String(C.message??C))}}function Oe(){const C=new Blob([JSON.stringify(S,null,2)],{type:"application/json"}),me=URL.createObjectURL(C),Me=document.createElement("a");Me.href=me,Me.download=`${S.name.replace(/\s+/g,"-").toLowerCase()||"bot"}.json`,Me.click(),URL.revokeObjectURL(me)}return i.jsxs("aside",{className:"sidebar",children:[i.jsxs("div",{className:"sidebar-head",children:[i.jsxs("div",{className:"sidebar-top",children:[i.jsx(A1,{}),i.jsx("button",{className:"sidebar-toggle",onClick:s,title:"Hide sidebar (Ctrl+B)","aria-label":"Hide sidebar",children:"«"})]}),i.jsx("div",{className:"mode-switch",children:["runner","playground"].map(C=>i.jsx("button",{className:"seg"+(c===C?" on":""),onClick:()=>u(C),children:C==="runner"?"Runner":"Playground"},C))})]}),c==="runner"?i.jsx(GS,{runner:f,status:h,statusError:m,onOpen:b,onForget:g,sessions:r}):i.jsxs("div",{className:"sidebar-body",children:[i.jsx("p",{className:"hint",style:{marginTop:0},children:"Chat with any SCX model directly — no agent, no file access. Useful for comparing models and prompts."}),i.jsx("div",{className:"section-title",children:"Identity"}),i.jsxs("div",{className:"field",children:[i.jsx("label",{children:"Bot name"}),i.jsx("input",{type:"text",value:S.name,onChange:C=>L("name",C.target.value)})]}),i.jsxs("div",{className:"field",children:[i.jsx("label",{children:"Model"}),i.jsx("input",{type:"search",placeholder:`Search ${xe.length} models…`,value:ot,onChange:C=>ht(C.target.value),style:{marginBottom:6},"aria-label":"Search models"}),i.jsx("select",{value:S.model,onChange:C=>L("model",C.target.value),children:Ue.map(([C,me])=>i.jsx("optgroup",{label:C==="openrouter"?"OpenRouter":C==="nvidia"?"NVIDIA NIM":"SCX.ai",children:me.map(Me=>i.jsxs("option",{value:Me.id,children:[Me.name,Me.context_length?` · ${Math.round(Me.context_length/1e3)}k ctx`:""]},Me.id))},C))}),Se>0&&i.jsxs("label",{className:"hint",style:{display:"flex",gap:6,alignItems:"center",cursor:"pointer"},children:[i.jsx("input",{type:"checkbox",checked:mt,onChange:C=>T(C.target.checked)}),"Show non-chat models (",Se," hidden: embeddings, guards, speech…)"]}),we.length>0&&i.jsxs("div",{className:"hint",title:we.join(", "),children:[we.length," retired NVIDIA model",we.length===1?"":"s"," hidden (no longer served)"]}),x&&i.jsx("div",{className:"hint",style:{color:"var(--danger)"},children:x}),(E==null?void 0:E.description)&&i.jsx("div",{className:"hint",children:E.description}),i.jsxs("div",{className:"cap-badges",children:[i.jsx("span",{className:"badge"+(he?" on":""),children:"tools"}),i.jsx("span",{className:"badge"+(P?" on":""),children:"json"}),i.jsx("span",{className:"badge"+(_e?" on":""),children:"reasoning"}),i.jsx("span",{className:"badge"+((se=E==null?void 0:E.input_modalities)!=null&&se.includes("image")?" on":""),children:"vision"}),(be=E==null?void 0:E.datacenters)==null?void 0:be.map(C=>i.jsx("span",{className:"badge",children:C.country_code},C.country_code))]})]}),i.jsxs("div",{className:"field",children:[i.jsx("label",{children:"Security preset"}),i.jsxs("select",{value:(je==null?void 0:je.id)??"custom",onChange:C=>{const me=Cd.find(Me=>Me.id===C.target.value);me&&L("system",me.system)},children:[i.jsx("option",{value:"custom",children:"Custom (your own system prompt)"}),Cd.map(C=>i.jsx("option",{value:C.id,children:C.label},C.id))]})]}),i.jsxs("div",{className:"field",children:[i.jsx("label",{children:"System prompt"}),i.jsx("textarea",{value:S.system,onChange:C=>L("system",C.target.value),placeholder:"Describe the bot's personality, role, and rules…",style:{minHeight:110}})]}),i.jsx("div",{className:"section-title",children:"Generation"}),i.jsxs("div",{className:"field",children:[i.jsx("label",{children:"Temperature"}),i.jsxs("div",{className:"range-row",children:[i.jsx("input",{type:"range",min:0,max:2,step:.05,value:S.temperature,onChange:C=>L("temperature",Number(C.target.value))}),i.jsx("span",{className:"range-val",children:S.temperature.toFixed(2)})]})]}),i.jsxs("div",{className:"field",children:[i.jsx("label",{children:"Top P"}),i.jsxs("div",{className:"range-row",children:[i.jsx("input",{type:"range",min:0,max:1,step:.05,value:S.topP,onChange:C=>L("topP",Number(C.target.value))}),i.jsx("span",{className:"range-val",children:S.topP.toFixed(2)})]})]}),i.jsxs("div",{className:"field",children:[i.jsx("label",{children:"Max output tokens"}),i.jsxs("div",{className:"range-row",children:[i.jsx("input",{type:"range",min:64,max:(E==null?void 0:E.max_output_length)??4096,step:64,value:Math.min(S.maxTokens,(E==null?void 0:E.max_output_length)??4096),onChange:C=>L("maxTokens",Number(C.target.value))}),i.jsx("span",{className:"range-val",children:S.maxTokens})]})]}),i.jsx(rc,{label:"Stream responses",sub:"Token-by-token output via SSE",checked:S.stream,onChange:C=>L("stream",C)}),i.jsx(rc,{label:"JSON mode",sub:P?"Force valid JSON output":"Not supported by this model",checked:S.jsonMode&&P,disabled:!P,onChange:C=>L("jsonMode",C)}),i.jsxs("div",{className:"section-title",children:["Tools ",he?"":"(model has no tool support)"]}),S.tools.map((C,me)=>i.jsxs("div",{className:"tool-card",children:[i.jsxs("div",{className:"tc-head",children:[i.jsx("input",{type:"text",value:C.function.name,placeholder:"function_name",onChange:Me=>q(me,{name:Me.target.value})}),i.jsx("button",{className:"btn danger",onClick:()=>y(Me=>({...Me,tools:Me.tools.filter((lt,gt)=>gt!==me)})),children:"✕"})]}),i.jsx("input",{type:"text",value:C.function.description??"",placeholder:"description",style:{marginBottom:8},onChange:Me=>q(me,{description:Me.target.value})}),i.jsx("textarea",{defaultValue:JSON.stringify(C.function.parameters??{},null,2),onChange:Me=>Re(me,Me.target.value),spellCheck:!1}),i.jsx("div",{className:"hint",children:"JSON Schema for the function parameters."})]},C.id??me)),i.jsxs("div",{className:"btn-row",children:[i.jsx("button",{className:"btn block ghost mini",disabled:!he,onClick:()=>y(C=>({...C,tools:[...C.tools,{...structuredClone(YS),id:Ed()}]})),children:"+ Add tool"}),i.jsx("button",{className:"btn block ghost mini",onClick:Be,title:"Import tools from web/public/example-tools.json",children:"↓ Load example tools"})]}),de&&i.jsx("div",{className:"hint",style:{color:de.startsWith("Loaded")?"var(--accent-2)":"var(--muted-2)"},children:de}),i.jsx("div",{className:"section-title",children:"Knowledge (RAG)"}),i.jsx(rc,{label:"Ground answers in knowledge",sub:ce.length?`Retrieve from ${ce.length} doc${ce.length>1?"s":""} via embeddings`:"Add a document to enable",checked:S.useKnowledge&&ce.length>0,disabled:ce.length===0,onChange:C=>L("useKnowledge",C)}),ce.map(C=>i.jsxs("div",{className:"tool-card",style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:[i.jsxs("div",{style:{minWidth:0},children:[i.jsx("div",{style:{fontSize:13,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:C.name}),i.jsxs("div",{className:"hint",style:{margin:0},children:[C.chunks," chunks · ",C.chars.toLocaleString()," chars"]})]}),i.jsx("button",{className:"btn danger",onClick:()=>ae(C.id),children:"✕"})]},C.id)),i.jsxs("div",{className:"field",style:{marginTop:10},children:[i.jsx("input",{type:"text",placeholder:"Document name (optional)",value:$,onChange:C=>H(C.target.value),style:{marginBottom:8}}),i.jsx("textarea",{placeholder:"Paste text to give your bot a knowledge base…",value:Q,onChange:C=>W(C.target.value),style:{minHeight:80}}),K&&i.jsx("div",{className:"hint",style:{color:"var(--danger)"},children:K}),i.jsx("button",{className:"btn block ghost mini",style:{marginTop:8},disabled:re||!Q.trim(),onClick:De,children:re?"Embedding…":"+ Add to knowledge base"})]}),i.jsx("div",{className:"section-title",children:"Voice"}),i.jsx(rc,{label:"Speak replies aloud",sub:"Browser text-to-speech",checked:S.speak,onChange:C=>L("speak",C)}),i.jsxs("div",{className:"hint",children:[Xd()?"Mic dictation available in the composer.":"Voice input not supported in this browser."," ","SCX-native audio (scx-tts/scx-stt) is gated on this tier."]}),i.jsx("div",{className:"section-title",children:"Saved chats"}),i.jsxs("label",{className:"hint",style:{display:"flex",gap:6,alignItems:"center",cursor:"pointer"},children:[i.jsx("input",{type:"checkbox",checked:S.saveSessions,onChange:C=>L("saveSessions",C.target.checked)}),"Save chats on this runner, encrypted with your vault"]}),i.jsxs("div",{className:"btn-row",children:[i.jsx("button",{className:"btn block ghost",onClick:z,children:"+ New chat"}),i.jsx("button",{className:"btn block ghost",onClick:Oe,title:"Download the bot settings as JSON",children:"Export settings"})]}),V.status&&i.jsx("div",{className:"hint",style:{color:V.status.ok?"var(--muted)":"var(--amber)"},children:V.status.text}),i.jsx($S,{saved:V})]}),i.jsxs("div",{className:"sidebar-foot",children:[i.jsx(nS,{}),ne&&i.jsx("button",{className:"btn ghost sm block",onClick:P1,children:"Sign out"}),i.jsxs("a",{className:"powered-by",href:"https://www.anthropic.com/claude/mythos",target:"_blank",rel:"noopener noreferrer","aria-label":"Reviewed by Claude Mythos 5.1",children:[i.jsx("span",{className:"powered-by-lead",children:"Reviewed by"}),i.jsx("img",{className:"powered-by-logo",src:"/claude-logo-ivory.svg",alt:"Claude",width:"83",height:"18"}),i.jsx("span",{className:"powered-by-model",children:"Mythos 5.1"})]})]})]})}function GS({runner:s,status:r,statusError:c,onOpen:u,onForget:f,sessions:h}){const[m,b]=N.useState(s.directory),[g,S]=N.useState(null),[y,v]=N.useState(!1),[x,E]=N.useState(!1),[z,V]=N.useState(!1),[L,ne]=N.useState(!1);N.useEffect(()=>b(s.directory),[s.directory]);async function pe($=m){if($.trim()){v(!0),S(null);try{u(await gv($))}catch(H){S(String(H.message??H))}finally{v(!1)}}}const ce=s.recent.filter($=>$!==s.directory),_=(r==null?void 0:r.models.filter($=>$.id.startsWith("scx/")).length)??0;return i.jsxs("div",{className:"sidebar-body",children:[i.jsx("div",{className:"section-title",children:"Project"}),i.jsxs("div",{className:"field",children:[i.jsxs("form",{className:"dir-row",onSubmit:$=>{$.preventDefault(),pe()},children:[i.jsx("input",{type:"text",className:"mono",value:m,onChange:$=>b($.target.value),placeholder:"C:\\code\\my-project",spellCheck:!1}),i.jsx("button",{className:"btn sm",type:"submit",disabled:y||!m.trim()||m===s.directory,children:"Open"})]}),g&&i.jsx("div",{className:"hint danger",children:g}),i.jsx("div",{className:"hint",children:"The agent reads, edits and runs commands in this folder. Switching folders starts a new session."}),i.jsxs("div",{className:"project-actions",children:[i.jsxs("button",{className:"btn sm gh-open",onClick:()=>V(!0),title:"Create, open or delete workspaces",children:[i.jsx(bS,{size:13})," workspaces"]}),i.jsxs("button",{className:"btn sm gh-open",onClick:()=>ne(!0),disabled:!s.directory,title:"Browse, upload and download this project's files",children:[i.jsx(Wd,{size:13})," files"]}),i.jsxs("button",{className:"btn sm gh-open",onClick:()=>E(!0),title:"Clone a repository into the workspace (read-only)",children:[i.jsx(Dv,{size:13})," clone from GitHub"]})]}),x&&i.jsx(MS,{onOpen:$=>pe($),onClose:()=>E(!1)}),z&&i.jsx(zS,{current:s.directory,onOpen:$=>pe($),onDeleted:f,onClose:()=>V(!1)}),L&&s.directory&&i.jsx(US,{directory:s.directory,onClose:()=>ne(!1)})]}),ce.length>0&&i.jsxs("div",{className:"field",children:[i.jsx("label",{children:"Recent"}),i.jsx("div",{className:"recent-list",children:ce.map($=>i.jsxs("button",{className:"recent-item",onClick:()=>pe($),title:$,children:[i.jsx("span",{className:"recent-name",children:$.split(/[\\/]/).filter(Boolean).pop()}),i.jsx("span",{className:"recent-path mono",children:$})]},$))})]}),s.directory&&i.jsx(VS,{directory:s.directory,nav:h}),i.jsx("div",{className:"section-title",children:"Agents"}),i.jsxs("div",{className:"agent-info",children:[i.jsxs("div",{className:"ai-row",children:[i.jsx("span",{className:"ai-name",children:"build"}),i.jsx("span",{className:"hint",children:"edits & runs"})]}),i.jsx("div",{className:"hint ai-desc",children:"Every file edit and shell command waits for your approval."}),i.jsxs("div",{className:"ai-row",children:[i.jsx("span",{className:"ai-name",children:"plan"}),i.jsx("span",{className:"hint",children:"read-only"})]}),i.jsx("div",{className:"hint ai-desc",children:"Explores and reasons without changing anything."})]}),i.jsx("div",{className:"section-title",children:"Engine"}),c?i.jsx("div",{className:"hint danger",children:c}):i.jsxs("div",{className:"engine",children:[i.jsxs("div",{children:[i.jsx("span",{className:"muted",children:"Agent"}),i.jsx("span",{children:"OpenCode"})]}),i.jsxs("div",{children:[i.jsx("span",{className:"muted",children:"Provider"}),i.jsxs("span",{children:["SCX.ai · ",_," models"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"muted",children:"Default"}),i.jsx("span",{className:"mono",children:(r==null?void 0:r.defaultModel)??"…"})]})]})]})}function $S({saved:s}){const[r,c]=N.useState(null),[u,f]=N.useState(!1);N.useEffect(()=>{if(!r)return;const b=setTimeout(()=>c(null),3e3);return()=>clearTimeout(b)},[r]);const h=s.list??[];if(s.list&&!h.length)return i.jsx("div",{className:"hint",children:"No saved chats yet."});const m=u?h:h.slice(0,8);return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"session-list",children:m.map(b=>i.jsxs("div",{className:"session-item"+(b.id===s.activeId?" on":""),children:[i.jsxs("button",{className:"session-open",onClick:()=>s.onOpen(b.id),title:b.title,children:[i.jsx("span",{className:"session-title",children:b.title||"Untitled chat"}),i.jsx("span",{className:"session-meta",children:Mv(Date.parse(b.updatedAt))})]}),i.jsx("button",{className:"session-del"+(r===b.id?" confirm":""),onClick:()=>{if(r!==b.id)return c(b.id);c(null),s.onDelete(b.id)},title:r===b.id?"Click again to delete":"Delete chat","aria-label":r===b.id?"Confirm delete":"Delete chat",children:r===b.id?"Delete?":"✕"})]},b.id))}),h.length>8&&i.jsx("button",{className:"btn ghost sm block",onClick:()=>f(b=>!b),children:u?"Show fewer":`Show all ${h.length}`})]})}function VS({directory:s,nav:r}){const[c,u]=N.useState(null),[f,h]=N.useState(null),[m,b]=N.useState(null),[g,S]=N.useState(!1);N.useEffect(()=>{let x=!0;return a1(s).then(E=>{x&&(u(E),h(null))}).catch(E=>x&&h(String(E.message??E))),()=>{x=!1}},[s,r.version,r.active]),N.useEffect(()=>{if(!m)return;const x=setTimeout(()=>b(null),3e3);return()=>clearTimeout(x)},[m]);async function y(x){if(m!==x){b(x);return}b(null);try{await s1(x,s),r.active===x&&r.open(null),u(E=>(E==null?void 0:E.filter(z=>z.id!==x))??null)}catch(E){h(String(E.message??E))}}const v=g?c??[]:(c??[]).slice(0,8);return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"section-title",children:"Sessions"}),i.jsx("button",{className:"btn ghost sm block new-session",onClick:()=>r.open(null),children:"+ New session"}),f&&i.jsx("div",{className:"hint danger",children:f}),c&&c.length===0&&i.jsx("div",{className:"hint",children:"No past sessions in this folder yet."}),i.jsx("div",{className:"session-list",children:v.map(x=>i.jsxs("div",{className:"session-item"+(x.id===r.active?" on":""),children:[i.jsxs("button",{className:"session-open",onClick:()=>r.open(x.id),title:x.title,children:[i.jsx("span",{className:"session-title",children:x.title||"Untitled session"}),i.jsxs("span",{className:"session-meta",children:[Mv(x.updated),x.files>0&&i.jsxs(i.Fragment,{children:[" · ",i.jsxs("span",{className:"adds",children:["+",x.additions]})," ",i.jsxs("span",{className:"dels",children:["−",x.deletions]})]})]})]}),i.jsx("button",{className:"session-del"+(m===x.id?" confirm":""),onClick:()=>y(x.id),title:m===x.id?"Click again to delete":"Delete session","aria-label":m===x.id?"Confirm delete":"Delete session",children:m===x.id?"Delete?":"✕"})]},x.id))}),c&&c.length>8&&i.jsx("button",{className:"btn ghost sm block",onClick:()=>S(x=>!x),children:g?"Show fewer":`Show all ${c.length}`})]})}function Mv(s){if(!s)return"";const r=Math.max(0,(Date.now()-s)/1e3);return r<60?"just now":r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:r<7*86400?`${Math.floor(r/86400)}d ago`:new Date(s).toLocaleDateString()}function rc({label:s,sub:r,checked:c,onChange:u,disabled:f}){return i.jsxs("div",{className:"toggle",children:[i.jsxs("div",{className:"tg-label",children:[s,r&&i.jsx("small",{children:r})]}),i.jsxs("label",{className:"switch"+(f?" disabled":""),children:[i.jsx("input",{type:"checkbox",checked:c,disabled:f,onChange:h=>u(h.target.checked)}),i.jsx("span",{})]})]})}const QS=5*1024*1024,gd=4,ZS=3*1024*1024-2048,_y=3,eh="image/*,.drawio,.xml,.svg";function KS(s){return new Promise((r,c)=>{const u=new FileReader;u.onload=()=>r(String(u.result)),u.onerror=()=>c(u.error),u.readAsDataURL(s)})}const IS=s=>/\.drawio(\.(svg|xml))?$/i.test(s)||/\.xml$/i.test(s);async function JS(s){if(/\.drawio\.png$/i.test(s.name))return!1;if(IS(s.name))return!0;if(s.type==="image/svg+xml"||/\.svg$/i.test(s.name)){const r=await s.slice(0,4096).text();return/content="[^"]*(mxfile|mxGraphModel)/.test(r)||/&lt;mxfile/.test(r)}return!1}async function FS(s){var u;const r=await fetch("/api/render/outline",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:await s.text()})}),c=await r.json().catch(()=>({}));if(!r.ok)throw new Error(((u=c==null?void 0:c.error)==null?void 0:u.message)||`Reading ${s.name} failed (${r.status})`);return{name:s.name,text:c.outline,pages:c.pages}}function th(){const[s,r]=N.useState([]),[c,u]=N.useState([]),[f,h]=N.useState(0),[m,b]=N.useState(null);async function g(v){b(null);const x=Array.from(v),E=[],z=[];for(const V of x)await JS(V)?z.push(V):V.type.startsWith("image/")?V.size>QS?b(`${V.name} is over 5 MB.`):E.push({name:V.name||"pasted-image.png",url:await KS(V)}):b(`${V.name}: attach images or draw.io files (.drawio, .drawio.svg).`);r(V=>{const L=[...V,...E];return L.length>gd&&b(`Up to ${gd} images per message.`),L.slice(0,gd)});for(const V of z){if(V.size>ZS){b(`${V.name} is over 3 MB.`);continue}h(L=>L+1);try{const L=await FS(V);u(ne=>ne.length>=_y?(b(`Up to ${_y} diagrams per message.`),ne):[...ne,L])}catch(L){b(String(L.message??L))}finally{h(L=>L-1)}}}function S(v){const x=Array.from(v.clipboardData.files);x.length&&(v.preventDefault(),g(x))}function y(v){v.dataTransfer.files.length&&(v.preventDefault(),g(v.dataTransfer.files))}return{images:s,docs:c,reading:f>0,attachError:m,addImages:g,onPaste:S,onDrop:y,remove:v=>r(x=>x.filter((E,z)=>z!==v)),removeDoc:v=>u(x=>x.filter((E,z)=>z!==v)),clear:()=>{r([]),u([]),b(null)}}}function nh({images:s,docs:r=[],onRemove:c,onRemoveDoc:u,reading:f}){return!s.length&&!r.length&&!f?null:i.jsxs("div",{className:"attach-row",children:[s.map((h,m)=>i.jsxs("span",{className:"attach-chip",title:h.name,children:[i.jsx("img",{src:h.url,alt:""}),i.jsx("span",{className:"attach-name",children:h.name}),i.jsx("button",{className:"attach-x",onClick:()=>c(m),"aria-label":`Remove ${h.name}`,children:"✕"})]},`i${m}`)),r.map((h,m)=>i.jsxs("span",{className:"attach-chip doc",title:`${h.name}: read as an exact outline (${h.text.length.toLocaleString()} characters${h.pages&&h.pages.length>1?`, ${h.pages.length} pages`:""})`,children:[i.jsx("span",{className:"attach-doc-icon","aria-hidden":!0,children:"◇"}),i.jsx("span",{className:"attach-name",children:h.name}),u&&i.jsx("button",{className:"attach-x",onClick:()=>u(m),"aria-label":`Remove ${h.name}`,children:"✕"})]},`d${m}`)),f&&i.jsx("span",{className:"attach-chip doc",children:i.jsx("span",{className:"attach-name",children:"reading diagram…"})})]})}function ah(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var bs=ah();function zv(s){bs=s}var ms={exec:()=>null};function ri(s){let r=[];return c=>{let u=Math.max(0,Math.min(3,c-1)),f=r[u];return f||(f=s(u),r[u]=f),f}}function Qe(s,r=""){let c=typeof s=="string"?s:s.source,u={replace:(f,h)=>{let m=typeof h=="string"?h:h.source;return m=m.replace(pn.caret,"$1"),c=c.replace(f,m),u},getRegex:()=>new RegExp(c,r)};return u}var PS=((s="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+s)}catch{return!1}})(),pn={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:s=>new RegExp(`^( {0,3}${s})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:ri(s=>new RegExp(`^ {0,${s}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:ri(s=>new RegExp(`^ {0,${s}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:ri(s=>new RegExp(`^ {0,${s}}(?:\`\`\`|~~~)`)),headingBeginRegex:ri(s=>new RegExp(`^ {0,${s}}#`)),htmlBeginRegex:ri(s=>new RegExp(`^ {0,${s}}(?:</?(?:${_r})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:ri(s=>new RegExp(`^ {0,${s}}>`))},WS=/^(?:[ \t]*(?:\n|$))+/,ew=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,tw=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ar=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,nw=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,lh=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Uv=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Lv=Qe(Uv).replace(/bull/g,lh).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),aw=Qe(Uv).replace(/bull/g,lh).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),sh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,lw=/^[^\n]+/,ih=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,sw=Qe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ih).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),iw=Qe(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,lh).getRegex(),_r="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",rh=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,rw=Qe("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",rh).replace("tag",_r).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Hv=s=>Qe(sh).replace("hr",Ar).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",s).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_r).getRegex(),ow=Hv(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),cw=Hv(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),uw=Qe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",cw).getRegex(),oh={blockquote:uw,code:ew,def:sw,fences:tw,heading:nw,hr:Ar,html:rw,lheading:Lv,list:iw,newline:WS,paragraph:ow,table:ms,text:lw},Cy=Qe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ar).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_r).getRegex(),fw={...oh,lheading:aw,table:Cy,paragraph:Qe(sh).replace("hr",Ar).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Cy).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_r).getRegex()},dw={...oh,html:Qe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",rh).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ms,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Qe(sh).replace("hr",Ar).replace("heading",` *#{1,6} *[^
100
- ]`).replace("lheading",Lv).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},hw=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,mw=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Bv=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,pw=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ll=/[\p{P}\p{S}]/u,gi=/[\s\p{P}\p{S}]/u,Cr=/[^\s\p{P}\p{S}]/u,gw=Qe(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,gi).getRegex(),yw=/[\p{Pi}\p{Ps}"']/u,qv=/(?!~)[\p{P}\p{S}]/u,vw=/(?!~)[\s\p{P}\p{S}]/u,bw=/(?:[^\s\p{P}\p{S}]|~)/u,xw=Qe(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",PS?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Yv=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Sw=Qe(Yv,"u").replace(/punct/g,ll).getRegex(),ww=Qe(Yv,"u").replace(/punct/g,qv).getRegex(),Nw=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,jw=Qe(Nw,"u").replace(/openQuote/g,yw).replace(/punct/g,ll).getRegex(),Xv="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Tw=Qe(Xv,"gu").replace(/notPunctSpace/g,Cr).replace(/punctSpace/g,gi).replace(/punct/g,ll).getRegex(),Ew=Qe(Xv,"gu").replace(/notPunctSpace/g,bw).replace(/punctSpace/g,vw).replace(/punct/g,qv).getRegex(),kw="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",Aw=Qe(kw,"gu").replace(/notPunctSpace/g,Cr).replace(/punctSpace/g,gi).replace(/punct/g,ll).getRegex(),_w=Qe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Cr).replace(/punctSpace/g,gi).replace(/punct/g,ll).getRegex(),Cw="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",Dw=Qe(Cw,"gu").replace(/notPunctSpace/g,Cr).replace(/punctSpace/g,gi).replace(/punct/g,ll).getRegex(),Ow=Qe(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ll).getRegex(),Rw="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Mw=Qe(Rw,"gu").replace(/notPunctSpace/g,Cr).replace(/punctSpace/g,gi).replace(/punct/g,ll).getRegex(),zw=Qe(/\\(punct)/,"gu").replace(/punct/g,ll).getRegex(),Uw=Qe(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Lw=Qe(rh).replace("(?:-->|$)","-->").getRegex(),Hw=Qe("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Lw).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Gv=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Tc=Qe(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",Gv).getRegex(),Bw=Qe(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",Tc).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),qw=Qe(/^!?\[(label)\]\[(ref)\]/).replace("label",Tc).replace("ref",ih).getRegex(),Yw=Qe(/^!?\[(ref)\](?:\[\])?/).replace("ref",ih).getRegex(),Dy=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Xw=Qe(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",Gv).getRegex(),Gw=Qe("reflink|nolink(?!\\()","g").replace("reflink",Qe(/^!?\[(label)\]\[(ref)\]/).replace("label",Xw).replace("ref",Dy).getRegex()).replace("nolink",Qe(/^!?\[(ref)\](?:\[\])?/).replace("ref",Dy).getRegex()).getRegex(),Oy=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,$w=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,Vw=Qe(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,$w).getRegex(),ch={_backpedal:ms,anyPunctuation:zw,autolink:Uw,blockSkip:xw,br:Bv,code:mw,del:ms,delLDelim:ms,delRDelim:ms,emStrongLDelim:Sw,emStrongRDelimAst:Tw,emStrongRDelimUnd:_w,escape:hw,link:Bw,nolink:Yw,punctuation:gw,reflink:qw,reflinkSearch:Gw,tag:Hw,text:pw,url:ms},Qw={...ch,emStrongLDelim:jw,emStrongRDelimAst:Aw,emStrongRDelimUnd:Dw,link:Qe(/^!?\[(label)\]\((.*?)\)/).replace("label",Tc).getRegex(),reflink:Qe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Tc).getRegex()},Dd={...ch,emStrongRDelimAst:Ew,emStrongLDelim:ww,delLDelim:Ow,delRDelim:Mw,url:Qe(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",Vw).replace("protocol",Oy).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Qe(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",Oy).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},Zw={...Dd,br:Qe(Bv).replace("{2,}","*").getRegex(),text:Qe(Dd.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},oc={normal:oh,gfm:fw,pedantic:dw},or={normal:ch,gfm:Dd,breaks:Zw,pedantic:Qw},Kw={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ry=s=>Kw[s];function Zn(s,r){if(r){if(pn.escapeTest.test(s))return s.replace(pn.escapeReplace,Ry)}else if(pn.escapeTestNoEncode.test(s))return s.replace(pn.escapeReplaceNoEncode,Ry);return s}function Iw(s){return s.replace(pn.numericCharacterReference,(r,c,u)=>{let f=c===void 0?Number.parseInt(u,16):Number.parseInt(c,10);return f===0||f>1114111||f>=55296&&f<=57343?"�":String.fromCodePoint(f)})}function My(s){try{s=encodeURI(s).replace(pn.percentDecode,"%")}catch{return null}return s}function zy(s,r){var h;let c=s.replace(pn.findPipe,(m,b,g)=>{let S=!1,y=b;for(;--y>=0&&g[y]==="\\";)S=!S;return S?"|":" |"}),u=c.split(pn.splitPipe),f=0;if(u[0].trim()||u.shift(),u.length>0&&!((h=u.at(-1))!=null&&h.trim())&&u.pop(),r)if(u.length>r)u.splice(r);else for(;u.length<r;)u.push("");for(;f<u.length;f++)u[f]=u[f].trim().replace(pn.slashPipe,"|");return u}function Ll(s,r,c){let u=s.length;if(u===0)return"";let f=0;for(;f<u&&s.charAt(u-f-1)===r;)f++;return s.slice(0,u-f)}function Uy(s){let r=s.split(`
101
- `),c=r.length-1;for(;c>=0&&pn.blankLine.test(r[c]);)c--;return r.length-c<=2?s:r.slice(0,c+1).join(`
102
- `)}function Ec(s){return s.trim().toLowerCase().toUpperCase().toLowerCase()}function Ly(s,r){if(s.indexOf(r[0])===-1&&s.indexOf(r[1])===-1)return-1;let c=0;for(let u=0;u<s.length;u++)if(s[u]==="\\")u++;else if(s[u]===r[0])c++;else if(s[u]===r[1]&&(c--,c<0))return u;return c>0?-2:-1}function Hy(s,r=0){let c=r,u="";for(let f of s)if(f===" "){let h=4-c%4;u+=" ".repeat(h),c+=h}else u+=f,c++;return u}function By(s,r,c,u,f){let h=r.href,m=r.title||null,b=s[1].replace(f.other.outputLinkReplace,"$1"),g=s[0].charAt(0)==="!";u.state.inLink=!0;let S=u.state.linkEmitted,y=u.state.inRawBlock;u.state.linkEmitted=!1;let v=u.inlineTokens(b),x=u.state.linkEmitted;if(u.state.linkEmitted=S,u.state.inLink=!1,!g){if(x){u.state.inRawBlock=y;return}u.state.linkEmitted=!0}return{type:g?"image":"link",raw:c,href:h,title:m,text:b,tokens:v}}function Jw(s,r,c){let u=s.match(c.other.indentCodeCompensation);if(u===null)return r;let f=u[1];return r.split(`
103
- `).map(h=>{let m=h.match(c.other.beginningSpace);if(m===null)return h;let[b]=m;return h.slice(Math.min(b.length,f.length))}).join(`
104
- `)}function qy(s,r,c,u){if(!r.includes("<"))return!1;for(let f=0;f<r.length;f++){if(r[f]==="\\"){f++;continue}if(r[f]==="`"){let b=u.inline.code.exec(r.slice(f));if(b){f+=b[0].length-1;continue}}if(r[f]!=="<")continue;let h=s.slice(c+f),m=u.inline.tag.exec(h)||u.inline.autolink.exec(h);if(m){if(m[0].length>r.length-f)return!0;f+=m[0].length-1}}return!1}var kc=class{constructor(s){jt(this,"options");jt(this,"rules");jt(this,"lexer");this.options=s||bs}space(s){let r=this.rules.block.newline.exec(s);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(s){let r=this.rules.block.code.exec(s);if(r){let c=this.options.pedantic?r[0]:Uy(r[0]),u=c.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:c,codeBlockStyle:"indented",text:u}}}fences(s){let r=this.rules.block.fences.exec(s);if(r){let c=r[0],u=Jw(c,r[3]||"",this.rules);return{type:"code",raw:c,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:u}}}heading(s){let r=this.rules.block.heading.exec(s);if(r){let c=r[2].trim();if(this.rules.other.endingHash.test(c)){let u=Ll(c,"#");(this.options.pedantic||!u||this.rules.other.endingSpaceTabChar.test(u))&&(c=u.trim())}return{type:"heading",raw:Ll(r[0],`
105
- `),depth:r[1].length,text:c,tokens:this.lexer.inline(c)}}}hr(s){let r=this.rules.block.hr.exec(s);if(r)return{type:"hr",raw:Ll(r[0],`
106
- `)}}blockquote(s){let r=this.rules.block.blockquote.exec(s);if(r){let c=Ll(r[0],`
107
- `).split(`
108
- `),u="",f="",h=[];for(;c.length>0;){let m=!1,b=[],g;for(g=0;g<c.length;g++)if(this.rules.other.blockquoteStart.test(c[g]))b.push(c[g]),m=!0;else if(!m)b.push(c[g]);else break;c=c.slice(g);let S=b.join(`
109
- `),y=S.replace(this.rules.other.blockquoteSetextReplace,`
110
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");u=u?`${u}
111
- ${S}`:S,f=f?`${f}
112
- ${y}`:y;let v=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(y,h,!0),this.lexer.state.top=v,c.length===0)break;let x=h.at(-1);if((x==null?void 0:x.type)==="code")break;if((x==null?void 0:x.type)==="blockquote"){let E=x,z=c.join(`
113
- `),V=E.raw+`
114
- `+z.replace(this.rules.other.blockquoteSetextReplace2,""),L=this.blockquote(V);h[h.length-1]=L;let ne=V.substring(L.raw.length).replace(/^\n/,""),pe=ne?ne.split(`
115
- `).length:0,ce=pe?c.slice(0,-pe):c;ce.length>0&&(u=`${u}
116
- ${ce.join(`
117
- `)}`),f=f.substring(0,f.length-E.text.length)+L.text;break}else if((x==null?void 0:x.type)==="list"){let E=x,z=E.raw+`
118
- `+c.join(`
119
- `),V=this.list(z);h[h.length-1]=V,u=u.substring(0,u.length-x.raw.length)+V.raw,f=f.substring(0,f.length-E.raw.length)+V.raw,c=z.substring(h.at(-1).raw.length).split(`
120
- `);continue}}return{type:"blockquote",raw:u,tokens:h,text:f}}}list(s){let r=this.rules.block.list.exec(s);if(r){let c=r[1].trim(),u=c.length>1,f={type:"list",raw:"",ordered:u,start:u?+c.slice(0,-1):"",loose:!1,items:[]};c=u?`\\d{1,9}\\${c.slice(-1)}`:`\\${c}`,this.options.pedantic&&(c=u?c:"[*+-]");let h=this.rules.other.listItemRegex(c),m=!1;for(;s;){let g=!1,S="",y="";if(!(r=h.exec(s))||this.rules.block.hr.test(s))break;S=r[0],s=s.substring(S.length);let v=r[2].split(`
121
- `,1)[0],x=r[1].length,E=this.options.pedantic?Hy(v,x):v.replace(this.rules.other.leadingSpaceTab,ne=>Hy(ne,x)),z=s.split(`
122
- `,1)[0],V=!E.trim(),L=0;if(this.options.pedantic?(L=2,y=E.trimStart()):V?L=x+1:(L=E.search(this.rules.other.nonSpaceChar),L=L>4?1:L,y=E.slice(L),L+=x),V&&this.rules.other.blankLine.test(z)&&(S+=z+`
123
- `,s=s.substring(z.length+1),g=!0),!g){let ne=this.rules.other.nextBulletRegex(L),pe=this.rules.other.hrRegex(L),ce=this.rules.other.fencesBeginRegex(L),_=this.rules.other.headingBeginRegex(L),$=this.rules.other.htmlBeginRegex(L),H=this.rules.other.blockquoteBeginRegex(L);for(;s;){let Q=s.split(`
124
- `,1)[0],W;if(z=Q,this.options.pedantic?(z=z.replace(this.rules.other.listReplaceNesting," "),W=z):W=z.replace(this.rules.other.leadingSpaceTab,re=>re.replace(this.rules.other.tabCharGlobal," ")),ce.test(z)||_.test(z)||$.test(z)||H.test(z)||ne.test(z)||pe.test(z))break;if(W.search(this.rules.other.nonSpaceChar)>=L||!z.trim())y+=`
125
- `+W.slice(L);else{if(V||E.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||ce.test(E)||_.test(E)||pe.test(E))break;y+=`
126
- `+z}V=!z.trim(),S+=Q+`
127
- `,s=s.substring(Q.length+1),E=W.slice(L)}}f.loose||(m?f.loose=!0:this.rules.other.doubleBlankLine.test(S)&&(m=!0)),f.items.push({type:"list_item",raw:S,task:!!this.options.gfm&&this.rules.other.listIsTask.test(y),loose:!1,text:y,tokens:[]}),f.raw+=S}let b=f.items.at(-1);if(b)b.raw=b.raw.trimEnd(),b.text=b.text.trimEnd();else return;f.raw=f.raw.trimEnd();for(let g of f.items)if(this.lexer.state.top=!1,g.tokens=this.lexer.blockTokens(g.text,[]),!f.loose){let S=g.tokens.filter(v=>v.type==="space"),y=S.length>0&&S.some(v=>this.rules.other.anyLine.test(v.raw));f.loose=y}for(let g of f.items){let S=g.tokens[0];if(g.task&&((S==null?void 0:S.type)==="text"||(S==null?void 0:S.type)==="paragraph")){g.text=g.text.replace(this.rules.other.listReplaceTask,""),S.raw=S.raw.replace(this.rules.other.listReplaceTask,""),S.text=S.text.replace(this.rules.other.listReplaceTask,"");for(let v=this.lexer.inlineQueue.length-1;v>=0;v--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[v].src)){this.lexer.inlineQueue[v].src=this.lexer.inlineQueue[v].src.replace(this.rules.other.listReplaceTask,"");break}let y=this.rules.other.listTaskCheckbox.exec(g.raw);if(y){let v={type:"checkbox",raw:y[0]+" ",checked:y[0]!=="[ ]"};g.checked=v.checked,f.loose?g.tokens[0]&&["paragraph","text"].includes(g.tokens[0].type)&&"tokens"in g.tokens[0]&&g.tokens[0].tokens?(g.tokens[0].raw=v.raw+g.tokens[0].raw,g.tokens[0].text=v.raw+g.tokens[0].text,g.tokens[0].tokens.unshift(v)):g.tokens.unshift({type:"paragraph",raw:v.raw,text:v.raw,tokens:[v]}):g.tokens.unshift(v)}}else g.task&&(g.task=!1)}if(f.loose)for(let g of f.items){g.loose=!0;for(let S of g.tokens)S.type==="text"&&(S.type="paragraph")}return f}}html(s){let r=this.rules.block.html.exec(s);if(r){let c=Uy(r[0]);return{type:"html",block:!0,raw:c,pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:c}}}def(s){let r=this.rules.block.def.exec(s);if(r){if(!this.rules.other.startAngleBracket.test(r[2])&&Ly(r[2],"()")!==-1)return;let c=Ec(r[1]).replace(this.rules.other.multipleSpaceGlobal," "),u=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",f=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:c,raw:Ll(r[0],`
128
- `),href:u,title:f}}}table(s){var m;let r=this.rules.block.table.exec(s);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let c=zy(r[1]),u=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),f=(m=r[3])!=null&&m.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
129
- `):[],h={type:"table",raw:Ll(r[0],`
130
- `),header:[],align:[],rows:[]};if(c.length===u.length){for(let b of u)this.rules.other.tableAlignRight.test(b)?h.align.push("right"):this.rules.other.tableAlignCenter.test(b)?h.align.push("center"):this.rules.other.tableAlignLeft.test(b)?h.align.push("left"):h.align.push(null);for(let b=0;b<c.length;b++)h.header.push({text:c[b],tokens:this.lexer.inline(c[b]),header:!0,align:h.align[b]});for(let b of f)h.rows.push(zy(b,h.header.length).map((g,S)=>({text:g,tokens:this.lexer.inline(g),header:!1,align:h.align[S]})));return h}}lheading(s){let r=this.rules.block.lheading.exec(s);if(r){let c=r[1].trim();return{type:"heading",raw:Ll(r[0],`
131
- `),depth:r[2].charAt(0)==="="?1:2,text:c,tokens:this.lexer.inline(c)}}}paragraph(s){let r=this.rules.block.paragraph.exec(s);if(r){let c=r[1].charAt(r[1].length-1)===`
132
- `?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:c,tokens:this.lexer.inline(c)}}}text(s){let r=this.rules.block.text.exec(s);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(s){let r=this.rules.inline.escape.exec(s);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(s){let r=this.rules.inline.tag.exec(s);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(s){if(this.lexer.state.linkParenPossible===!1)return;let r=this.rules.inline.link.exec(s);if(r){let c=r[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&qy(s,r[1],c,this.rules))return;let u=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(u)){if(!this.rules.other.endAngleBracket.test(u))return;let m=Ll(u.slice(0,-1),"\\");if((u.length-m.length)%2===0)return}else{let m=Ly(r[2],"()");if(m===-2)return;if(m>-1){let b=(r[0].indexOf("!")===0?5:4)+r[1].length+m;r[2]=r[2].substring(0,m),r[0]=r[0].substring(0,b).trim(),r[3]=""}}let f=r[2],h="";if(this.options.pedantic){let m=this.rules.other.pedanticHrefTitle.exec(f);m&&(f=m[1],h=m[3])}else h=r[3]?r[3].slice(1,-1):"";return f=f.trim(),this.rules.other.startAngleBracket.test(f)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(u)?f=f.slice(1):f=f.slice(1,-1)),By(r,{href:f&&f.replace(this.rules.inline.anyPunctuation,"$1"),title:h&&h.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(s,r){let c;if((c=this.rules.inline.reflink.exec(s))||(c=this.rules.inline.nolink.exec(s))){let u=c[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&qy(s,c[1],u,this.rules))return;let f=(c[2]||c[1]).replace(this.rules.other.multipleSpaceGlobal," "),h=r[Ec(f)];if(!h){let m=c[0].charAt(0);return{type:"text",raw:m,text:m}}return By(c,h,c[0],this.lexer,this.rules)}}emStrong(s,r,c=""){let u=this.rules.inline.emStrongLDelim.exec(s);if(!(!u||!u[1]&&!u[2]&&!u[3]&&!u[4]||u[4]&&c.match(this.rules.other.unicodeAlphaNumeric))&&(!(u[1]||u[3])||!c||this.rules.inline.punctuation.exec(c))){let f=[...u[0]].length-1,h,m,b=f,g=0,S=u[0][0],y=c===S,v=S==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(v.lastIndex=0,r=r.slice(-1*s.length+f);(u=v.exec(r))!==null;){if(h=u[1]||u[2]||u[3]||u[4]||u[5]||u[6],!h)continue;if(m=[...h].length,u[3]||u[4]){b+=m;continue}else if(u[5]||u[6]){if(f%3&&!((f+m)%3)){g+=m;continue}if(y)break}if(b-=m,b>0)continue;m=Math.min(m,m+b+g);let x=[...u[0]][0].length,E=s.slice(0,f+u.index+x+m);if(Math.min(f,m)%2){let V=E.slice(1,-1);return{type:"em",raw:E,text:V,tokens:this.lexer.inlineTokens(V)}}let z=E.slice(2,-2);return{type:"strong",raw:E,text:z,tokens:this.lexer.inlineTokens(z)}}}}codespan(s){let r=this.rules.inline.code.exec(s);if(r){let c=r[2].replace(this.rules.other.newLineCharGlobal," "),u=this.rules.other.nonSpaceChar.test(c),f=this.rules.other.startingSpaceChar.test(c)&&this.rules.other.endingSpaceChar.test(c);return u&&f&&(c=c.substring(1,c.length-1)),{type:"codespan",raw:r[0],text:c}}}br(s){let r=this.rules.inline.br.exec(s);if(r)return{type:"br",raw:r[0]}}del(s,r,c=""){let u=this.rules.inline.delLDelim.exec(s);if(u&&(!u[1]||!c||this.rules.inline.punctuation.exec(c))){let f=[...u[0]].length-1,h,m,b=f,g=this.rules.inline.delRDelim;for(g.lastIndex=0,r=r.slice(-1*s.length+f);(u=g.exec(r))!==null;){if(h=u[1]||u[2]||u[3]||u[4]||u[5]||u[6],!h||(m=[...h].length,m!==f))continue;if(u[3]||u[4]){b+=m;continue}if(b-=m,b>0)continue;m=Math.min(m,m+b);let S=[...u[0]][0].length,y=s.slice(0,f+u.index+S+m),v=y.slice(f,-f);return{type:"del",raw:y,text:v,tokens:this.lexer.inlineTokens(v)}}}}autolink(s){let r=this.rules.inline.autolink.exec(s);if(r){let c,u;return r[2]==="@"?(c=r[1],u="mailto:"+c):(c=r[1],u=c),{type:"link",raw:r[0],text:c,href:u,autolink:!0,tokens:[{type:"text",raw:c,text:c}]}}}url(s){var c;let r;if(r=this.rules.inline.url.exec(s)){let u,f;if(r[2]==="@")u=r[0],f="mailto:"+u;else{let h;do h=r[0],r[0]=((c=this.rules.inline._backpedal.exec(r[0]))==null?void 0:c[0])??"";while(h!==r[0]);u=r[0],r[1]==="www."?f="http://"+r[0]:f=r[0]}return{type:"link",raw:r[0],text:u,href:f,autolink:!0,tokens:[{type:"text",raw:u,text:u}]}}}inlineText(s){let r=this.rules.inline.text.exec(s);if(r){let c=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:c?r[0]:Iw(r[0]),escaped:c}}}},Oc,$v,ps,xa=(ps=class{constructor(r){hy(this,Oc);jt(this,"tokens");jt(this,"options");jt(this,"state");jt(this,"inlineQueue");jt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=r||bs,this.options.tokenizer=this.options.tokenizer||new kc,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let c={other:pn,block:oc.normal,inline:or.normal};this.options.pedantic?(c.block=oc.pedantic,c.inline=or.pedantic):this.options.gfm&&(c.block=oc.gfm,this.options.breaks?c.inline=or.breaks:c.inline=or.gfm),this.tokenizer.rules=c}static get rules(){return{block:oc,inline:or}}static lex(r,c){return new ps(c).lex(r)}static lexInline(r,c){return new ps(c).inlineTokens(r)}lex(r){r=r.replace(pn.carriageReturn,`
133
- `),this.blockTokens(r,this.tokens);for(let c=0;c<this.inlineQueue.length;c++){let u=this.inlineQueue[c];this.inlineTokens(u.src,u.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(r,c=[],u=!1){var h,m,b;this.tokenizer.lexer=this,this.options.pedantic&&(r=r.replace(pn.tabCharGlobal," ").replace(pn.spaceLine,""));let f=1/0;for(;r;){if(r.length<f)f=r.length;else{this.infiniteLoopError(r.charCodeAt(0));break}let g;if((m=(h=this.options.extensions)==null?void 0:h.block)!=null&&m.some(y=>(g=y.call({lexer:this},r,c))?(r=r.substring(g.raw.length),c.push(g),!0):!1))continue;if(g=this.tokenizer.space(r)){r=r.substring(g.raw.length);let y=c.at(-1);g.raw.length===1&&y!==void 0?y.raw+=`
134
- `:c.push(g);continue}if(g=this.tokenizer.code(r)){r=r.substring(g.raw.length);let y=c.at(-1);(y==null?void 0:y.type)==="paragraph"||(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
135
- `)?"":`
136
- `)+g.raw,y.text+=`
137
- `+g.text,this.inlineQueue.at(-1).src=y.text):c.push(g);continue}if(g=this.tokenizer.fences(r)){r=r.substring(g.raw.length),c.push(g);continue}if(g=this.tokenizer.heading(r)){r=r.substring(g.raw.length),c.push(g);continue}if(g=this.tokenizer.hr(r)){r=r.substring(g.raw.length),c.push(g);continue}if(g=this.tokenizer.blockquote(r)){r=r.substring(g.raw.length),c.push(g);continue}if(g=this.tokenizer.list(r)){r=r.substring(g.raw.length),c.push(g);continue}if(g=this.tokenizer.html(r)){r=r.substring(g.raw.length),c.push(g);continue}if(g=this.tokenizer.def(r)){r=r.substring(g.raw.length);let y=c.at(-1);(y==null?void 0:y.type)==="paragraph"||(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
138
- `)?"":`
139
- `)+g.raw,y.text+=`
140
- `+g.raw,this.inlineQueue.at(-1).src=y.text):this.tokens.links[g.tag]||(this.tokens.links[g.tag]={href:g.href,title:g.title},c.push(g));continue}if(g=this.tokenizer.table(r)){r=r.substring(g.raw.length),c.push(g);continue}if(g=this.tokenizer.lheading(r)){r=r.substring(g.raw.length),c.push(g);continue}let S=r;if((b=this.options.extensions)!=null&&b.startBlock){let y=1/0,v=r.slice(1),x;this.options.extensions.startBlock.forEach(E=>{x=E.call({lexer:this},v),typeof x=="number"&&x>=0&&(y=Math.min(y,x))}),y<1/0&&y>=0&&(S=r.substring(0,y+1))}if(this.state.top&&(g=this.tokenizer.paragraph(S))){let y=c.at(-1);u&&(y==null?void 0:y.type)==="paragraph"?(y.raw+=(y.raw.endsWith(`
141
- `)?"":`
142
- `)+g.raw,y.text+=`
143
- `+g.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=y.text):c.push(g),u=S.length!==r.length,r=r.substring(g.raw.length);continue}if(g=this.tokenizer.text(r)){r=r.substring(g.raw.length);let y=c.at(-1);(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
144
- `)?"":`
145
- `)+g.raw,y.text+=`
146
- `+g.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=y.text):c.push(g);continue}if(r){this.infiniteLoopError(r.charCodeAt(0));break}}return this.state.top=!0,c}inline(r,c=[]){return this.inlineQueue.push({src:r,tokens:c}),c}linkInText(r){if(!r.includes("["))return!1;let c=this.tokenizer.rules.inline.link;for(let u of r.matchAll(this.tokenizer.rules.inline.blockSkip))if(c.test(u[0])&&r.charAt(u.index-1)!=="!")return!0;for(let u of r.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let f=u[0],h=f.lastIndexOf("[");if(!(f.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,Ec(f.slice(h+1,-1))))&&!(h>1&&this.linkInText(f.slice(1,h-1))))return!0}return!1}inlineTokens(r,c=[]){this.tokenizer.lexer=this;let u=this.state.linkParenPossible;this.state.linkParenPossible=u&&r.includes(")");try{return my(this,Oc,$v).call(this,r,c)}finally{this.state.linkParenPossible=u}}infiniteLoopError(r){let c="Infinite loop on byte: "+r;if(this.options.silent)console.error(c);else throw new Error(c)}},Oc=new WeakSet,$v=function(r,c){var b,g,S,y,v;let u=r;if(this.tokens.links&&r.includes("[")){let x=this.tokenizer.rules.inline.reflinkSearch,E=z=>{let V=z.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,Ec(z.slice(V+1,-1))))return z;if(V>1&&z.charAt(0)!=="!"){let L=z.slice(1,V-1);if(this.linkInText(L))return"["+L.replace(x,E)+"]["+"a".repeat(z.length-V-2)+"]"}return"["+"a".repeat(z.length-2)+"]"};u=u.replace(x,E)}u=u.replace(this.tokenizer.rules.inline.anyPunctuation,x=>"+".repeat(x.length)),u=u.replace(this.tokenizer.rules.inline.blockSkip,(x,E,z)=>{let V=z?z.length:0;return x.slice(0,V)+"["+"a".repeat(x.length-V-2)+"]"}),u=((g=(b=this.options.hooks)==null?void 0:b.emStrongMask)==null?void 0:g.call({lexer:this},u))??u;let f=!1,h="",m=1/0;for(;r;){if(r.length<m)m=r.length;else{this.infiniteLoopError(r.charCodeAt(0));break}f||(h=""),f=!1;let x;if((y=(S=this.options.extensions)==null?void 0:S.inline)!=null&&y.some(z=>(x=z.call({lexer:this},r,c))?(r=r.substring(x.raw.length),c.push(x),!0):!1))continue;if(x=this.tokenizer.escape(r)){r=r.substring(x.raw.length),c.push(x);continue}if(x=this.tokenizer.tag(r)){r=r.substring(x.raw.length),c.push(x);continue}if(x=this.tokenizer.link(r)){r=r.substring(x.raw.length),c.push(x);continue}if(x=this.tokenizer.reflink(r,this.tokens.links)){r=r.substring(x.raw.length);let z=c.at(-1);x.type==="text"&&(z==null?void 0:z.type)==="text"?(z.raw+=x.raw,z.text+=x.text):c.push(x);continue}if(x=this.tokenizer.emStrong(r,u,h)){r=r.substring(x.raw.length),c.push(x);continue}if(x=this.tokenizer.codespan(r)){r=r.substring(x.raw.length),c.push(x);continue}if(x=this.tokenizer.br(r)){r=r.substring(x.raw.length),c.push(x);continue}if(x=this.tokenizer.del(r,u,h)){r=r.substring(x.raw.length),c.push(x);continue}if(x=this.tokenizer.autolink(r)){r=r.substring(x.raw.length),c.push(x);continue}if(!this.state.inLink&&(x=this.tokenizer.url(r))){r=r.substring(x.raw.length),c.push(x);continue}let E=r;if((v=this.options.extensions)!=null&&v.startInline){let z=1/0,V=r.slice(1),L;this.options.extensions.startInline.forEach(ne=>{L=ne.call({lexer:this},V),typeof L=="number"&&L>=0&&(z=Math.min(z,L))}),z<1/0&&z>=0&&(E=r.substring(0,z+1))}if(x=this.tokenizer.inlineText(E)){r=r.substring(x.raw.length),x.raw.slice(-1)!=="_"&&(h=x.raw.slice(-1)),f=!0;let z=c.at(-1);(z==null?void 0:z.type)==="text"?(z.raw+=x.raw,z.text+=x.text):c.push(x);continue}if(r){this.infiniteLoopError(r.charCodeAt(0));break}}return c},ps),Ac=class{constructor(s){jt(this,"options");jt(this,"parser");this.options=s||bs}space(s){return""}code({text:s,lang:r,escaped:c}){var h;let u=(h=(r||"").match(pn.notSpaceStart))==null?void 0:h[0],f=s?s.replace(pn.endingNewline,"")+`
147
- `:"";return u?'<pre><code class="language-'+Zn(u)+'">'+(c?f:Zn(f,!0))+`</code></pre>
148
- `:"<pre><code>"+(c?f:Zn(f,!0))+`</code></pre>
149
- `}blockquote({tokens:s}){return`<blockquote>
150
- ${this.parser.parse(s)}</blockquote>
151
- `}html({text:s}){return s}def(s){return""}heading({tokens:s,depth:r}){return`<h${r}>${this.parser.parseInline(s)}</h${r}>
152
- `}hr(s){return`<hr>
153
- `}list(s){let r=s.ordered,c=s.start,u="";for(let m=0;m<s.items.length;m++){let b=s.items[m];u+=this.listitem(b)}let f=r?"ol":"ul",h=r&&c!==1?' start="'+c+'"':"";return"<"+f+h+`>
154
- `+u+"</"+f+`>
155
- `}listitem(s){return`<li>${this.parser.parse(s.tokens)}</li>
156
- `}checkbox({checked:s}){return"<input "+(s?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:s}){return`<p>${this.parser.parseInline(s)}</p>
157
- `}table(s){let r="",c="";for(let f=0;f<s.header.length;f++)c+=this.tablecell(s.header[f]);r+=this.tablerow({text:c});let u="";for(let f=0;f<s.rows.length;f++){let h=s.rows[f];c="";for(let m=0;m<h.length;m++)c+=this.tablecell(h[m]);u+=this.tablerow({text:c})}return u&&(u=`<tbody>${u}</tbody>`),`<table>
158
- <thead>
159
- `+r+`</thead>
160
- `+u+`</table>
161
- `}tablerow({text:s}){return`<tr>
162
- ${s}</tr>
163
- `}tablecell(s){let r=this.parser.parseInline(s.tokens),c=s.header?"th":"td";return(s.align?`<${c} align="${s.align}">`:`<${c}>`)+r+`</${c}>
164
- `}strong({tokens:s}){return`<strong>${this.parser.parseInline(s)}</strong>`}em({tokens:s}){return`<em>${this.parser.parseInline(s)}</em>`}codespan({text:s}){return`<code>${Zn(s,!0)}</code>`}br(s){return"<br>"}del({tokens:s}){return`<del>${this.parser.parseInline(s)}</del>`}link({href:s,title:r,text:c,tokens:u,autolink:f}){let h=f?Zn(c,!0):this.parser.parseInline(u),m=My(s);if(m===null)return h;s=Zn(m,f);let b='<a href="'+s+'"';return r&&(b+=' title="'+Zn(r)+'"'),b+=">"+h+"</a>",b}image({href:s,title:r,text:c,tokens:u}){u&&(c=this.parser.parseInline(u,this.parser.textRenderer));let f=My(s);if(f===null)return Zn(c);s=f;let h=`<img src="${Zn(s)}" alt="${Zn(c)}"`;return r&&(h+=` title="${Zn(r)}"`),h+=">",h}text(s){return"tokens"in s&&s.tokens?this.parser.parseInline(s.tokens):"escaped"in s&&s.escaped?s.text:Zn(s.text)}},uh=class{strong({text:s}){return s}em({text:s}){return s}codespan({text:s}){return s}del({text:s}){return s}html({text:s}){return s}text({text:s}){return s}link({text:s}){return""+s}image({text:s}){return""+s}br(){return""}checkbox({raw:s}){return s}},Sa=class Od{constructor(r){jt(this,"options");jt(this,"renderer");jt(this,"textRenderer");this.options=r||bs,this.options.renderer=this.options.renderer||new Ac,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new uh}static parse(r,c){return new Od(c).parse(r)}static parseInline(r,c){return new Od(c).parseInline(r)}parse(r){var u,f;this.renderer.parser=this;let c="";for(let h=0;h<r.length;h++){let m=r[h];if((f=(u=this.options.extensions)==null?void 0:u.renderers)!=null&&f[m.type]){let g=m,S=this.options.extensions.renderers[g.type].call({parser:this},g);if(S!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(g.type)){c+=S||"";continue}}let b=m;switch(b.type){case"space":{c+=this.renderer.space(b);break}case"hr":{c+=this.renderer.hr(b);break}case"heading":{c+=this.renderer.heading(b);break}case"code":{c+=this.renderer.code(b);break}case"table":{c+=this.renderer.table(b);break}case"blockquote":{c+=this.renderer.blockquote(b);break}case"list":{c+=this.renderer.list(b);break}case"checkbox":{c+=this.renderer.checkbox(b);break}case"html":{c+=this.renderer.html(b);break}case"def":{c+=this.renderer.def(b);break}case"paragraph":{c+=this.renderer.paragraph(b);break}case"text":{c+=this.renderer.text(b);break}default:{let g='Token with "'+b.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return c}parseInline(r,c=this.renderer){var f,h;this.renderer.parser=this;let u="";for(let m=0;m<r.length;m++){let b=r[m];if((h=(f=this.options.extensions)==null?void 0:f.renderers)!=null&&h[b.type]){let S=this.options.extensions.renderers[b.type].call({parser:this},b);if(S!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(b.type)){u+=S||"";continue}}let g=b;switch(g.type){case"escape":{u+=c.text(g);break}case"html":{u+=c.html(g);break}case"link":{u+=c.link(g);break}case"image":{u+=c.image(g);break}case"checkbox":{u+=c.checkbox(g);break}case"strong":{u+=c.strong(g);break}case"em":{u+=c.em(g);break}case"codespan":{u+=c.codespan(g);break}case"br":{u+=c.br(g);break}case"del":{u+=c.del(g);break}case"text":{u+=c.text(g);break}default:{let S='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(S),"";throw new Error(S)}}}return u}},pc,gr=(pc=class{constructor(s){jt(this,"options");jt(this,"block");this.options=s||bs}preprocess(s){return s}postprocess(s){return s}processAllTokens(s){return s}emStrongMask(s){return s}provideLexer(s=this.block){return s?xa.lex:xa.lexInline}provideParser(s=this.block){return s?Sa.parse:Sa.parseInline}},jt(pc,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),jt(pc,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),pc),Fw=class{constructor(...s){jt(this,"defaults",ah());jt(this,"options",this.setOptions);jt(this,"parse",this.parseMarkdown(!0));jt(this,"parseInline",this.parseMarkdown(!1));jt(this,"Parser",Sa);jt(this,"Renderer",Ac);jt(this,"TextRenderer",uh);jt(this,"Lexer",xa);jt(this,"Tokenizer",kc);jt(this,"Hooks",gr);this.use(...s)}walkTokens(s,r){var u,f;let c=[];for(let h of s)switch(c=c.concat(r.call(this,h)),h.type){case"table":{let m=h;for(let b of m.header)c=c.concat(this.walkTokens(b.tokens,r));for(let b of m.rows)for(let g of b)c=c.concat(this.walkTokens(g.tokens,r));break}case"list":{let m=h;c=c.concat(this.walkTokens(m.items,r));break}default:{let m=h;(f=(u=this.defaults.extensions)==null?void 0:u.childTokens)!=null&&f[m.type]?this.defaults.extensions.childTokens[m.type].forEach(b=>{let g=m[b].flat(1/0);c=c.concat(this.walkTokens(g,r))}):m.tokens&&(c=c.concat(this.walkTokens(m.tokens,r)))}}return c}use(...s){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return s.forEach(c=>{let u={...c};if(u.async=this.defaults.async||u.async||!1,c.extensions&&(c.extensions.forEach(f=>{if(!f.name)throw new Error("extension name required");if("renderer"in f){let h=r.renderers[f.name];h?r.renderers[f.name]=function(...m){let b=f.renderer.apply(this,m);return b===!1&&(b=h.apply(this,m)),b}:r.renderers[f.name]=f.renderer}if("tokenizer"in f){if(!f.level||f.level!=="block"&&f.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let h=r[f.level];h?h.unshift(f.tokenizer):r[f.level]=[f.tokenizer],f.start&&(f.level==="block"?r.startBlock?r.startBlock.push(f.start):r.startBlock=[f.start]:f.level==="inline"&&(r.startInline?r.startInline.push(f.start):r.startInline=[f.start]))}"childTokens"in f&&f.childTokens&&(r.childTokens[f.name]=f.childTokens)}),u.extensions=r),c.renderer){let f=this.defaults.renderer||new Ac(this.defaults);for(let h in c.renderer){if(!(h in f))throw new Error(`renderer '${h}' does not exist`);if(["options","parser"].includes(h))continue;let m=h,b=c.renderer[m],g=f[m];f[m]=(...S)=>{let y=b.apply(f,S);return y===!1&&(y=g.apply(f,S)),y||""}}u.renderer=f}if(c.tokenizer){let f=this.defaults.tokenizer||new kc(this.defaults);for(let h in c.tokenizer){if(!(h in f))throw new Error(`tokenizer '${h}' does not exist`);if(["options","rules","lexer"].includes(h))continue;let m=h,b=c.tokenizer[m],g=f[m];f[m]=(...S)=>{let y=b.apply(f,S);return y===!1&&(y=g.apply(f,S)),y}}u.tokenizer=f}if(c.hooks){let f=this.defaults.hooks||new gr;for(let h in c.hooks){if(!(h in f))throw new Error(`hook '${h}' does not exist`);if(["options","block"].includes(h))continue;let m=h,b=c.hooks[m],g=f[m];gr.passThroughHooks.has(h)?f[m]=S=>{if(this.defaults.async&&gr.passThroughHooksRespectAsync.has(h))return(async()=>{let v=await b.call(f,S);return g.call(f,v)})();let y=b.call(f,S);return g.call(f,y)}:f[m]=(...S)=>{if(this.defaults.async)return(async()=>{let v=await b.apply(f,S);return v===!1&&(v=await g.apply(f,S)),v})();let y=b.apply(f,S);return y===!1&&(y=g.apply(f,S)),y}}u.hooks=f}if(c.walkTokens){let f=this.defaults.walkTokens,h=c.walkTokens;u.walkTokens=function(m){let b=[];return b.push(h.call(this,m)),f&&(b=b.concat(f.call(this,m))),b}}this.defaults={...this.defaults,...u}}),this}setOptions(s){return this.defaults={...this.defaults,...s},this}lexer(s,r){return xa.lex(s,r??this.defaults)}parser(s,r){return Sa.parse(s,r??this.defaults)}parseMarkdown(s){return(r,c)=>{let u={...c},f={...this.defaults,...u},h=this.onError(!!f.silent,!!f.async);if(this.defaults.async===!0&&u.async===!1)return h(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return h(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return h(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(f.hooks&&(f.hooks.options=f,f.hooks.block=s),f.async)return(async()=>{let m=f.hooks?await f.hooks.preprocess(r):r,b=await(f.hooks?await f.hooks.provideLexer(s):s?xa.lex:xa.lexInline)(m,f),g=f.hooks?await f.hooks.processAllTokens(b):b;f.walkTokens&&await Promise.all(this.walkTokens(g,f.walkTokens));let S=await(f.hooks?await f.hooks.provideParser(s):s?Sa.parse:Sa.parseInline)(g,f);return f.hooks?await f.hooks.postprocess(S):S})().catch(h);try{f.hooks&&(r=f.hooks.preprocess(r));let m=(f.hooks?f.hooks.provideLexer(s):s?xa.lex:xa.lexInline)(r,f);f.hooks&&(m=f.hooks.processAllTokens(m)),f.walkTokens&&this.walkTokens(m,f.walkTokens);let b=(f.hooks?f.hooks.provideParser(s):s?Sa.parse:Sa.parseInline)(m,f);return f.hooks&&(b=f.hooks.postprocess(b)),b}catch(m){return h(m)}}}onError(s,r){return c=>{if(c.message+=`
165
- Please report this to https://github.com/markedjs/marked.`,s){let u="<p>An error occurred:</p><pre>"+Zn(c.message+"",!0)+"</pre>";return r?Promise.resolve(u):u}if(r)return Promise.reject(c);throw c}}},gs=new Fw;function St(s,r){return gs.parse(s,r)}St.options=St.setOptions=function(s){return gs.setOptions(s),St.defaults=gs.defaults,zv(St.defaults),St};St.getDefaults=ah;St.defaults=bs;function Pw(...s){return gs.use(...s),St.defaults=gs.defaults,zv(St.defaults),St}St.use=Pw;St.walkTokens=function(s,r){return gs.walkTokens(s,r)};St.parseInline=gs.parseInline;St.Parser=Sa;St.parser=Sa.parse;St.Renderer=Ac;St.TextRenderer=uh;St.Lexer=xa;St.lexer=xa.lex;St.Tokenizer=kc;St.Hooks=gr;St.parse=St;St.options;St.setOptions;St.walkTokens;St.parseInline;Sa.parse;xa.lex;/*! @license DOMPurify 3.4.16 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.16/LICENSE */function Yy(s,r){(r==null||r>s.length)&&(r=s.length);for(var c=0,u=Array(r);c<r;c++)u[c]=s[c];return u}function Ww(s){if(Array.isArray(s))return s}function eN(s,r){var c=s==null?null:typeof Symbol<"u"&&s[Symbol.iterator]||s["@@iterator"];if(c!=null){var u,f,h,m,b=[],g=!0,S=!1;try{if(h=(c=c.call(s)).next,r!==0)for(;!(g=(u=h.call(c)).done)&&(b.push(u.value),b.length!==r);g=!0);}catch(y){S=!0,f=y}finally{try{if(!g&&c.return!=null&&(m=c.return(),Object(m)!==m))return}finally{if(S)throw f}}return b}}function tN(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
166
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */function nN(s,r){return Ww(s)||eN(s,r)||aN(s,r)||tN()}function aN(s,r){if(s){if(typeof s=="string")return Yy(s,r);var c={}.toString.call(s).slice(8,-1);return c==="Object"&&s.constructor&&(c=s.constructor.name),c==="Map"||c==="Set"?Array.from(s):c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?Yy(s,r):void 0}}const Vv=Object.entries,Xy=Object.setPrototypeOf,lN=Object.isFrozen,sN=Object.getPrototypeOf,iN=Object.getOwnPropertyDescriptor;let en=Object.freeze,on=Object.seal,ci=Object.create,Qv=typeof Reflect<"u"&&Reflect,Rd=Qv.apply,Md=Qv.construct;en||(en=function(r){return r});on||(on=function(r){return r});Rd||(Rd=function(r,c){for(var u=arguments.length,f=new Array(u>2?u-2:0),h=2;h<u;h++)f[h-2]=arguments[h];return r.apply(c,f)});Md||(Md=function(r){for(var c=arguments.length,u=new Array(c>1?c-1:0),f=1;f<c;f++)u[f-1]=arguments[f];return new r(...u)});const hs=Ft(Array.prototype.forEach),rN=Ft(Array.prototype.lastIndexOf),Gy=Ft(Array.prototype.pop),cr=Ft(Array.prototype.push),oN=Ft(Array.prototype.splice),fi=Array.isArray,yr=Ft(String.prototype.toLowerCase),yd=Ft(String.prototype.toString),$y=Ft(String.prototype.match),ur=Ft(String.prototype.replace),Vy=Ft(String.prototype.indexOf),cN=Ft(String.prototype.trim),uN=Ft(Number.prototype.toString),fN=Ft(Boolean.prototype.toString),Qy=typeof BigInt>"u"?null:Ft(BigInt.prototype.toString),Zy=typeof Symbol>"u"?null:Ft(Symbol.prototype.toString),zn=Ft(Object.prototype.hasOwnProperty),fr=Ft(Object.prototype.toString),wn=Ft(RegExp.prototype.test),Hl=dN(TypeError);function Ft(s){return function(r){r instanceof RegExp&&(r.lastIndex=0);for(var c=arguments.length,u=new Array(c>1?c-1:0),f=1;f<c;f++)u[f-1]=arguments[f];return Rd(s,r,u)}}function dN(s){return function(){for(var r=arguments.length,c=new Array(r),u=0;u<r;u++)c[u]=arguments[u];return Md(s,c)}}function ct(s,r){let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:yr;if(Xy&&Xy(s,null),!fi(r))return s;let u=r.length;for(;u--;){let f=r[u];if(typeof f=="string"){const h=c(f);h!==f&&(lN(r)||(r[u]=h),f=h)}s[f]=!0}return s}function hN(s){for(let r=0;r<s.length;r++)zn(s,r)||(s[r]=null);return s}function Kn(s){const r=ci(null);for(const u of Vv(s)){var c=nN(u,2);const f=c[0],h=c[1];zn(s,f)&&(fi(h)?r[f]=hN(h):h&&typeof h=="object"&&h.constructor===Object?r[f]=Kn(h):r[f]=h)}return r}function mN(s){switch(typeof s){case"string":return s;case"number":return uN(s);case"boolean":return fN(s);case"bigint":return Qy?Qy(s):"0";case"symbol":return Zy?Zy(s):"Symbol()";case"undefined":return fr(s);case"function":case"object":{if(s===null)return fr(s);const r=s,c=ca(r,"toString");if(typeof c=="function"){const u=c(r);return typeof u=="string"?u:fr(u)}return fr(s)}default:return fr(s)}}function ca(s,r){for(;s!==null;){const u=iN(s,r);if(u){if(u.get)return Ft(u.get);if(typeof u.value=="function")return Ft(u.value)}s=sN(s)}function c(){return null}return c}function pN(s){try{return wn(s,""),!0}catch{return!1}}const Ky=en(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),vd=en(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),bd=en(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),gN=en(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),xd=en(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),yN=en(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Iy=en(["#text"]),Jy=en(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Sd=en(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Fy=en(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),cc=en(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),vN=on(/{{[\w\W]*|^[\w\W]*}}/g),bN=on(/<%[\w\W]*|^[\w\W]*%>/g),xN=on(/\${[\w\W]*/g),SN=on(/^data-[\-\w.\u00B7-\uFFFF]+$/),wN=on(/^aria-[\-\w]+$/),Py=on(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),NN=on(/^(?:\w+script|data):/i),jN=on(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),TN=on(/^html$/i),EN=on(/^[a-z][.\w]*(-[.\w]+)+$/i),Wy=on(/<[/\w!]/g),ev=on(/<[/\w]/g),kN=on(/<\/no(script|embed|frames)/i),AN=on(/\/>/i),Qn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Zv=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],_N=en(ct({},Zv)),CN=(function(){const s={};return hs(Zv,r=>{s[r]=on(new RegExp("</"+r+"(?=[\\t\\n\\f\\r />])","i"))}),en(s)})(),DN=function(){return typeof window>"u"?null:window},ON=function(r,c){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let u=null;const f="data-tt-policy-suffix";c&&c.hasAttribute(f)&&(u=c.getAttribute(f));const h="dompurify"+(u?"#"+u:"");try{return r.createPolicy(h,{createHTML(m){return m},createScriptURL(m){return m}})}catch{return console.warn("TrustedTypes policy "+h+" could not be created."),null}},tv=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Bl=function(r,c,u,f){return zn(r,c)&&fi(r[c])?ct(f.base?Kn(f.base):{},r[c],f.transform):u},wd=function(r,c,u){const f=zn(r,c)?r[c]:void 0;return f&&typeof f=="object"?Kn(f):u()};function Kv(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:DN();const r=le=>Kv(le);if(r.version="3.4.16",r.removed=[],!s||!s.document||s.document.nodeType!==Qn.document||!s.Element)return r.isSupported=!1,r;let c=s.document;const u=c,f=u.currentScript;s.DocumentFragment;const h=s.HTMLTemplateElement,m=s.Node,b=s.Element,g=s.NodeFilter;s.NamedNodeMap===void 0&&(s.NamedNodeMap||s.MozNamedAttrMap),s.HTMLFormElement;const S=s.DOMParser,y=s.trustedTypes,v=b.prototype,x=ca(v,"cloneNode"),E=ca(v,"remove"),z=ca(v,"removeAttributeNode"),V=ca(v,"nextSibling"),L=ca(v,"childNodes"),ne=ca(v,"parentNode"),pe=ca(v,"shadowRoot"),ce=ca(v,"attributes"),_=m&&m.prototype?ca(m.prototype,"nodeType"):null,$=m&&m.prototype?ca(m.prototype,"nodeName"):null,H=m&&m.prototype?ca(m.prototype,"ownerDocument"):null,Q=function(w){return _?_(w):w.nodeType},W=function(w){return $?$(w):w.nodeName};if(typeof h=="function"){const le=c.createElement("template");le.content&&le.content.ownerDocument&&(c=le.content.ownerDocument)}let re,G="",K,Z=!1,de=0;const oe=function(){if(de>0)throw Hl('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},De=function(w){oe(),de++;try{return re.createHTML(w)}finally{de--}},ae=function(w){oe(),de++;try{return re.createScriptURL(w)}finally{de--}},F=function(){return Z||(K=ON(y,f),Z=!0),K},he=c,P=he.implementation,_e=he.createNodeIterator,ot=he.createDocumentFragment,ht=he.getElementsByTagName,mt=u.importNode;let T=tv();r.isSupported=typeof Vv=="function"&&typeof ne=="function"&&P&&P.createHTMLDocument!==void 0;const te=vN,xe=bN,Se=xN,He=SN,Ue=wN,je=NN,fe=jN,we=EN;let pt=Py,q=null;const Re=ct({},[...Ky,...vd,...bd,...xd,...Iy]);let Ae=null;const Be=ct({},[...Jy,...Sd,...Fy,...cc]);let Oe=Object.seal(ci(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),se=null,be=null;const C=Object.seal(ci(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let me=!0,Me=!0,lt=!1,gt=!0,Dt=!1,Ke=!0,ut=!1,Fe=!1,yn=null,Fn=null,La=!1,$t=!1,Ut=!1,Yt=!1,X=!0,ge=!1;const Ne="user-content-";let Ee=!0,Ge=!1,Pe={},st=null;const vn=ct({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let tn=null;const ua=ct({},["audio","video","img","source","image","track"]);let sl=null;const xs=ct({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Un="http://www.w3.org/1998/Math/MathML",Rt="http://www.w3.org/2000/svg",Lt="http://www.w3.org/1999/xhtml";let Mt=Lt,il=!1,k=null;const ee=ct({},[Un,Rt,Lt],yd),ve=en(["mi","mo","mn","ms","mtext"]);let Te=ct({},ve);const Ze=en(["annotation-xml"]);let Ie=ct({},Ze);const bn=ct({},["title","style","font","a","script"]);let Et=null;const nn=["application/xhtml+xml","text/html"],wa="text/html";let wt=null,An=null;const Pn=c.createElement("form"),Ss=function(w){return w instanceof RegExp||w instanceof Function},fa=function(){let w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(An&&An===w)return;(!w||typeof w!="object")&&(w={}),w=Kn(w),Et=nn.indexOf(w.PARSER_MEDIA_TYPE)===-1?wa:w.PARSER_MEDIA_TYPE,wt=Et==="application/xhtml+xml"?yd:yr,q=Bl(w,"ALLOWED_TAGS",Re,{transform:wt}),Ae=Bl(w,"ALLOWED_ATTR",Be,{transform:wt}),k=Bl(w,"ALLOWED_NAMESPACES",ee,{transform:yd}),sl=Bl(w,"ADD_URI_SAFE_ATTR",xs,{transform:wt,base:xs}),tn=Bl(w,"ADD_DATA_URI_TAGS",ua,{transform:wt,base:ua}),st=Bl(w,"FORBID_CONTENTS",vn,{transform:wt}),se=Bl(w,"FORBID_TAGS",Kn({}),{transform:wt}),be=Bl(w,"FORBID_ATTR",Kn({}),{transform:wt}),Pe=zn(w,"USE_PROFILES")?w.USE_PROFILES&&typeof w.USE_PROFILES=="object"?Kn(w.USE_PROFILES):w.USE_PROFILES:!1,me=w.ALLOW_ARIA_ATTR!==!1,Me=w.ALLOW_DATA_ATTR!==!1,lt=w.ALLOW_UNKNOWN_PROTOCOLS||!1,gt=w.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Dt=w.SAFE_FOR_TEMPLATES||!1,Ke=w.SAFE_FOR_XML!==!1,ut=w.WHOLE_DOCUMENT||!1,$t=w.RETURN_DOM||!1,Ut=w.RETURN_DOM_FRAGMENT||!1,Yt=w.RETURN_TRUSTED_TYPE||!1,La=w.FORCE_BODY||!1,X=w.SANITIZE_DOM!==!1,ge=w.SANITIZE_NAMED_PROPS||!1,Ee=w.KEEP_CONTENT!==!1,Ge=w.IN_PLACE||!1,pt=pN(w.ALLOWED_URI_REGEXP)?w.ALLOWED_URI_REGEXP:Py,Mt=typeof w.NAMESPACE=="string"?w.NAMESPACE:Lt,Te=wd(w,"MATHML_TEXT_INTEGRATION_POINTS",()=>ct({},ve)),Ie=wd(w,"HTML_INTEGRATION_POINTS",()=>ct({},Ze));const M=wd(w,"CUSTOM_ELEMENT_HANDLING",()=>ci(null));if(Oe=ci(null),zn(M,"tagNameCheck")&&Ss(M.tagNameCheck)&&(Oe.tagNameCheck=M.tagNameCheck),zn(M,"attributeNameCheck")&&Ss(M.attributeNameCheck)&&(Oe.attributeNameCheck=M.attributeNameCheck),zn(M,"allowCustomizedBuiltInElements")&&typeof M.allowCustomizedBuiltInElements=="boolean"&&(Oe.allowCustomizedBuiltInElements=M.allowCustomizedBuiltInElements),on(Oe),Dt&&(Me=!1),Ut&&($t=!0),Pe&&(q=ct({},Iy),Ae=ci(null),Pe.html===!0&&(ct(q,Ky),ct(Ae,Jy)),Pe.svg===!0&&(ct(q,vd),ct(Ae,Sd),ct(Ae,cc)),Pe.svgFilters===!0&&(ct(q,bd),ct(Ae,Sd),ct(Ae,cc)),Pe.mathMl===!0&&(ct(q,xd),ct(Ae,Fy),ct(Ae,cc))),C.tagCheck=null,C.attributeCheck=null,zn(w,"ADD_TAGS")&&(typeof w.ADD_TAGS=="function"?C.tagCheck=w.ADD_TAGS:fi(w.ADD_TAGS)&&(q===Re&&(q=Kn(q)),ct(q,w.ADD_TAGS,wt))),zn(w,"ADD_ATTR")&&(typeof w.ADD_ATTR=="function"?C.attributeCheck=w.ADD_ATTR:fi(w.ADD_ATTR)&&(Ae===Be&&(Ae=Kn(Ae)),ct(Ae,w.ADD_ATTR,wt))),zn(w,"ADD_FORBID_CONTENTS")&&fi(w.ADD_FORBID_CONTENTS)&&(st===vn&&(st=Kn(st)),ct(st,w.ADD_FORBID_CONTENTS,wt)),Ee&&(q["#text"]=!0),ut&&ct(q,["html","head","body"]),q.table&&(ct(q,["tbody"]),delete se.tbody),w.TRUSTED_TYPES_POLICY){if(typeof w.TRUSTED_TYPES_POLICY.createHTML!="function")throw Hl('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof w.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Hl('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const ie=re;re=w.TRUSTED_TYPES_POLICY;try{G=De("")}catch(ue){throw re=ie,ue}}else w.TRUSTED_TYPES_POLICY===null?(re=void 0,G=""):(re===void 0&&(re=F()),re&&typeof G=="string"&&(G=De("")));en&&en(w),An=w},Ha=ct({},[...vd,...bd,...gN]),Gl=ct({},[...xd,...yN]),rl=function(w,M,ie){return M.namespaceURI===Lt?w==="svg":M.namespaceURI===Un?w==="svg"&&(ie==="annotation-xml"||Te[ie]):!!Ha[w]},ol=function(w,M,ie){return M.namespaceURI===Lt?w==="math":M.namespaceURI===Rt?w==="math"&&Ie[ie]:!!Gl[w]},cl=function(w,M,ie){return M.namespaceURI===Rt&&!Ie[ie]||M.namespaceURI===Un&&!Te[ie]?!1:!Gl[w]&&(bn[w]||!Ha[w])},Dr=function(w){let M=ne(w);(!M||!M.tagName)&&(M={namespaceURI:Mt,tagName:"template"});const ie=yr(w.tagName),ue=yr(M.tagName);return k[w.namespaceURI]?w.namespaceURI===Rt?rl(ie,M,ue):w.namespaceURI===Un?ol(ie,M,ue):w.namespaceURI===Lt?cl(ie,M,ue):!!(Et==="application/xhtml+xml"&&k[w.namespaceURI]):!1},an=function(w){cr(r.removed,{element:w});try{ne(w).removeChild(w)}catch{if(E(w),!ne(w))throw Hl("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Vt=function(w,M,ie){try{z(w,M)}catch{try{w.removeAttribute(ie)}catch{}}},Pt=function(w){ws(w);const M=L(w);if(M){const ue=[];hs(M,Le=>{cr(ue,Le)}),hs(ue,Le=>{try{E(Le)}catch{}})}const ie=ce(w);if(ie)for(let ue=ie.length-1;ue>=0;--ue){const Le=ie[ue],qe=Le&&Le.name;typeof qe=="string"&&Vt(w,Le,qe)}},_n=function(w,M,ie){if(!ie)try{ie=M.getAttributeNode(w)}catch{ie=null}cr(r.removed,{attribute:ie||null,from:M});try{ie?z(M,ie):M.removeAttribute(w)}catch{try{M.removeAttribute(w)}catch{}}if(w==="is")if($t||Ut)try{an(M)}catch{}else try{M.setAttribute(w,"")}catch{}},Or=function(w){const M=ce(w);if(M)for(let ie=M.length-1;ie>=0;--ie){const ue=M[ie],Le=ue&&ue.name;typeof Le!="string"||Ae[wt(Le)]||Vt(w,ue,Le)}},ws=function(w){const M=[w];for(;M.length>0;){const ie=M.pop();Q(ie)===Qn.element&&Or(ie);const ue=L(ie);if(ue)for(let Le=ue.length-1;Le>=0;--Le)M.push(ue[Le])}},Rr=function(w,M){return Ke?w==="patchsrc"?!0:w==="for"&&M!=="label"&&M!=="output":!1},Mr=function(w){if(!Ke)return;const M=[w];for(;M.length>0;){const ie=M.pop(),ue=Q(ie);if(ue===Qn.processingInstruction||ue===Qn.comment&&wn(ev,ie.data)){try{E(ie)}catch{}continue}if(ue===Qn.element){const qe=ie,We=wt(W(ie));try{qe.hasAttribute&&qe.hasAttribute("patchsrc")&&qe.removeAttribute("patchsrc"),qe.hasAttribute&&qe.hasAttribute("for")&&Rr("for",We)&&qe.removeAttribute("for")}catch{}}const Le=L(ie);if(Le)for(let qe=Le.length-1;qe>=0;--qe)M.push(Le[qe])}},ul=function(w){let M=null,ie=null;if(La)w="<remove></remove>"+w;else{const qe=$y(w,/^[\r\n\t ]+/);ie=qe&&qe[0]}Et==="application/xhtml+xml"&&Mt===Lt&&(w='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+w+"</body></html>");const ue=re?De(w):w;if(Mt===Lt)try{M=new S().parseFromString(ue,Et)}catch{}if(!M||!M.documentElement){M=P.createDocument(Mt,"template",null);try{M.documentElement.innerHTML=il?G:ue}catch{}}const Le=M.body||M.documentElement;return w&&ie&&Le.insertBefore(c.createTextNode(ie),Le.childNodes[0]||null),Mt===Lt?ht.call(M,ut?"html":"body")[0]:ut?M.documentElement:Le},$l=function(w){const M=H?H(w):w.ownerDocument;return _e.call(M||w,w,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},Ba=function(w){return w=ur(w,te," "),w=ur(w,xe," "),w=ur(w,Se," "),w},da=function(w){var M;w.normalize();const ie=H?H(w):w.ownerDocument,ue=_e.call(ie||w,w,g.SHOW_TEXT|g.SHOW_COMMENT|g.SHOW_CDATA_SECTION|g.SHOW_PROCESSING_INSTRUCTION,null);let Le=ue.nextNode();for(;Le;)Le.data=Ba(Le.data),Le=ue.nextNode();const qe=(M=w.querySelectorAll)===null||M===void 0?void 0:M.call(w,"template");qe&&hs(qe,We=>{Wn(We.content)&&da(We.content)})},ha=function(w){const M=$?$(w):null;return typeof M!="string"||wt(M)!=="form"?!1:typeof w.nodeName!="string"||typeof w.textContent!="string"||typeof w.removeChild!="function"||w.attributes!==ce(w)||typeof w.removeAttribute!="function"||typeof w.removeAttributeNode!="function"||typeof w.getAttributeNode!="function"||typeof w.setAttribute!="function"||typeof w.namespaceURI!="string"||typeof w.insertBefore!="function"||typeof w.hasChildNodes!="function"||w.nodeType!==_(w)||w.childNodes!==L(w)},Wn=function(w){if(!_||typeof w!="object"||w===null)return!1;try{return _(w)===Qn.documentFragment}catch{return!1}},ea=function(w){if(!_||typeof w!="object"||w===null)return!1;try{return typeof _(w)=="number"}catch{return!1}};function yt(le,w,M){le.length!==0&&hs(le,ie=>{ie.call(r,w,M,An)})}const zr=function(w,M){return!!(Ke&&w.hasChildNodes()&&!ea(w.firstElementChild)&&wn(Wy,w.textContent)&&wn(Wy,w.innerHTML)||Ke&&w.namespaceURI===Lt&&_N[M]&&(ea(w.firstElementChild)||typeof w.textContent=="string"&&wn(CN[M],w.textContent))||w.nodeType===Qn.processingInstruction||Ke&&w.nodeType===Qn.comment&&wn(ev,w.data))},Vl=function(w,M){if(w instanceof RegExp)return wn(w,M);if(w instanceof Function){for(var ie=arguments.length,ue=new Array(ie>2?ie-2:0),Le=2;Le<ie;Le++)ue[Le-2]=arguments[Le];return!!w(M,...ue)}return!1},Ur=function(w,M,ie){if(!se[M]&&Br(M)&&Vl(Oe.tagNameCheck,M))return!1;if(Ee&&!st[M]){const ue=ne(w),Le=L(w);if(Le&&ue){const qe=Le.length;for(let We=qe-1;We>=0;--We){const _t=w===ie?x(Le[We],!0):Le[We];ue.insertBefore(_t,V(w))}}}return an(w),!0},Na=function(w,M,ie,ue){return w.length===0?M:M===ie||M===ue?Kn(M):M},Ln=function(w,M){return w===M||ne(w)!==null?!1:(Ge&&ws(w),!0)},Lr=function(w,M){if(yt(T.beforeSanitizeElements,w,null),Ln(w,M))return!0;if(ha(w))return an(w),!0;const ie=wt(W(w));if(q=Na(T.uponSanitizeElement,q,Re,yn),yt(T.uponSanitizeElement,w,{tagName:ie,allowedTags:q}),Ln(w,M))return!0;if(zr(w,ie))return an(w),!0;if(se[ie]||!(C.tagCheck instanceof Function&&C.tagCheck(ie))&&!q[ie]){const ue=Ur(w,ie,M);return ue===!1&&(yt(T.afterSanitizeElements,w,null),Ln(w,M))?!0:ue}if(Q(w)===Qn.element&&!Dr(w)||(ie==="noscript"||ie==="noembed"||ie==="noframes")&&wn(kN,w.innerHTML))return an(w),!0;if(Dt&&w.nodeType===Qn.text){const ue=Ba(w.textContent);w.textContent!==ue&&(cr(r.removed,{element:w.cloneNode()}),w.textContent=ue)}return yt(T.afterSanitizeElements,w,null),Ln(w,M)},yi=function(w,M,ie){if(be[M]||Rr(M,w)||X&&(M==="id"||M==="name")&&(ie in c||ie in Pn))return!1;const ue=Ae[M]||C.attributeCheck instanceof Function&&C.attributeCheck(M,w);return Me&&wn(He,M)||me&&wn(Ue,M)?!0:ue?sl[M]||wn(pt,ur(ie,fe,""))||(M==="src"||M==="xlink:href"||M==="href")&&w!=="script"&&Vy(ie,"data:")===0&&tn[w]||lt&&!wn(je,ur(ie,fe,""))?!0:!ie:Br(w)&&Vl(Oe.tagNameCheck,w)&&Vl(Oe.attributeNameCheck,M,w)||M==="is"&&Oe.allowCustomizedBuiltInElements&&Vl(Oe.tagNameCheck,ie)},Hr=ct({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Br=function(w){return!Hr[yr(w)]&&wn(we,w)},it=function(w,M,ie,ue){if(re&&typeof y=="object"&&typeof y.getAttributeType=="function"&&!ie)switch(y.getAttributeType(w,M)){case"TrustedHTML":return De(ue);case"TrustedScriptURL":return ae(ue)}return ue},qr=function(w,M,ie,ue){try{return ie?w.setAttributeNS(ie,M,ue):w.setAttribute(M,ue),ha(w)?(an(w),!1):!0}catch{return _n(M,w),!1}},Ql=function(w,M){if(yt(T.beforeSanitizeAttributes,w,null),Ln(w,M))return;const ie=w.attributes;if(!ie||ha(w))return;Ae=Na(T.uponSanitizeAttribute,Ae,Be,Fn);const ue={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ae,forceKeepAttr:void 0};let Le=ie.length;const qe=wt(w.nodeName);for(;Le--;){const We=ie[Le],_t=We.name,xn=We.namespaceURI,Qt=We.value,Ya=wt(_t),Ns=Qt;let Ht=_t==="value"?Ns:cN(Ns),Yr=!1;if(ue.attrName=Ya,ue.attrValue=Ht,ue.keepAttr=!0,ue.forceKeepAttr=void 0,yt(T.uponSanitizeAttribute,w,ue),Ht=ue.attrValue,ge&&(Ya==="id"||Ya==="name")&&Vy(Ht,Ne)!==0&&(_n(_t,w,We),Ht=Ne+Ht,Yr=!0),Ke&&wn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ht)){_n(_t,w,We);continue}if(Ya==="attributename"&&$y(Ht,"href")){_n(_t,w,We);continue}if(!ue.forceKeepAttr){if(!ue.keepAttr){_n(_t,w,We);continue}if(!gt&&wn(AN,Ht)){_n(_t,w,We);continue}if(Dt&&(Ht=Ba(Ht)),!yi(qe,Ya,Ht)){_n(_t,w,We);continue}Ht=it(qe,Ya,xn,Ht),Ht!==Ns&&qr(w,_t,xn,Ht)&&Yr&&Gy(r.removed)}}yt(T.afterSanitizeAttributes,w,null),Ln(w,M)},qa=function(w){let M=null;const ie=$l(w);for(yt(T.beforeSanitizeShadowDOM,w,null);M=ie.nextNode();)if(yt(T.uponSanitizeShadowNode,M,null),Lr(M,w),Ql(M,w),Wn(M.content)&&qa(M.content),Q(M)===Qn.element){const ue=pe(M);Wn(ue)&&(Hn(ue),qa(ue))}yt(T.afterSanitizeShadowDOM,w,null)},Hn=function(w){const M=[{node:w,shadow:null}];for(;M.length>0;){const ie=M.pop();if(ie.shadow){qa(ie.shadow);continue}const ue=ie.node,Le=Q(ue)===Qn.element,qe=L(ue);if(qe)for(let We=qe.length-1;We>=0;--We)M.push({node:qe[We],shadow:null});if(Le){const We=$?$(ue):null;if(typeof We=="string"&&wt(We)==="template"){const _t=ue.content;Wn(_t)&&M.push({node:_t,shadow:null})}}if(Le){const We=pe(ue);Wn(We)&&M.push({node:null,shadow:We},{node:We,shadow:null})}}};return r.sanitize=function(le){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},M=null,ie=null,ue=null,Le=null;if(il=!le,il&&(le="<!-->"),typeof le!="string"&&!ea(le)&&(le=mN(le),typeof le!="string"))throw Hl("dirty is not a string, aborting");if(!r.isSupported)return le;Fe?(q=yn,Ae=Fn):fa(w),(T.uponSanitizeElement.length>0||T.uponSanitizeAttribute.length>0)&&(q=Kn(q)),T.uponSanitizeAttribute.length>0&&(Ae=Kn(Ae)),r.removed=[];const qe=Ge&&typeof le!="string"&&ea(le);if(qe){Mr(le);const xn=W(le);if(typeof xn=="string"){const Qt=wt(xn);if(!q[Qt]||se[Qt])throw Pt(le),Hl("root node is forbidden and cannot be sanitized in-place")}if(ha(le))throw Pt(le),Hl("root node is clobbered and cannot be sanitized in-place");try{Hn(le)}catch(Qt){throw Pt(le),Qt}}else if(ea(le))M=ul("<!---->"),ie=M.ownerDocument.importNode(le,!0),ie.nodeType===Qn.element&&ie.nodeName==="BODY"||ie.nodeName==="HTML"?M=ie:M.appendChild(ie),Hn(M);else{if(!$t&&!Dt&&!ut&&le.indexOf("<")===-1)return re&&Yt?De(le):le;if(M=ul(le),!M)return $t?null:Yt?G:""}M&&La&&an(M.firstChild);const We=qe?le:M;try{const xn=$l(We);for(;ue=xn.nextNode();)Lr(ue,We),Ql(ue,We),Wn(ue.content)&&qa(ue.content)}catch(xn){throw qe&&(Pt(le),hs(r.removed,Qt=>{Qt.element&&ws(Qt.element)})),xn}if(qe){let xn=!1;if(hs(r.removed,Qt=>{Qt.element&&(Qt.element===le&&(xn=!0),ws(Qt.element))}),xn)throw Hl("a node selected for removal could not be safely returned; refusing to sanitize in place");return Dt&&da(le),le}if($t){if(Dt&&da(M),Ut)for(Le=ot.call(M.ownerDocument);M.firstChild;)Le.appendChild(M.firstChild);else Le=M;return(Ae.shadowroot||Ae.shadowrootmode)&&(Le=mt.call(u,Le,!0)),Le}let _t=ut?M.outerHTML:M.innerHTML;return ut&&q["!doctype"]&&M.ownerDocument&&M.ownerDocument.doctype&&M.ownerDocument.doctype.name&&wn(TN,M.ownerDocument.doctype.name)&&(_t="<!DOCTYPE "+M.ownerDocument.doctype.name+`>
167
- `+_t),Dt&&(_t=Ba(_t)),re&&Yt?De(_t):_t},r.setConfig=function(){let le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};fa(le),Fe=!0,yn=q,Fn=Ae},r.clearConfig=function(){An=null,Fe=!1,yn=null,Fn=null,re=K,G=""},r.isValidAttribute=function(le,w,M){An||fa({});const ie=wt(le),ue=wt(w);return yi(ie,ue,M)},r.addHook=function(le,w){typeof w=="function"&&zn(T,le)&&cr(T[le],w)},r.removeHook=function(le,w){if(zn(T,le)){if(w!==void 0){const M=rN(T[le],w);return M===-1?void 0:oN(T[le],M,1)[0]}return Gy(T[le])}},r.removeHooks=function(le){zn(T,le)&&(T[le]=[])},r.removeAllHooks=function(){T=tv()},r}var Iv=Kv();let fh=[],Uc="";function RN(s,r=[]){Uc=s,fh=[s,...r].filter(Boolean)}const MN=()=>fh,zN=()=>Uc,UN=s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),LN=s=>s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");function HN(s,r=Uc){return`/api/agent/file?directory=${encodeURIComponent(r)}&path=${encodeURIComponent(s)}`}function BN(s){if(!s.length)return null;const r=s.map(c=>UN(c.replace(/[\\/]+$/,"")).replace(/\\\\|\//g,"[\\\\/]")).join("|");return new RegExp(`(?:${r})(?:[\\\\/][^\\s"'<>\`()\\[\\]{}|]*?)+?\\.[A-Za-z0-9]{1,8}(?=[\\s"'<>\`()\\[\\]{}|.,;:!?]|$)`,"g")}function qN(s,r=fh,c=Uc){const u=BN(r);if(!u)return s;let f=0;return s.split(/(<[^>]+>)/).map(h=>h.startsWith("<")?(/^<a[\s>]/i.test(h)?f++:/^<\/a>/i.test(h)&&(f=Math.max(0,f-1)),h):f||!h?h:h.replace(u,m=>`<a class="file-link" href="${HN(YN(m),c)}" download title="Download ${LN(m)}">${m}</a>`)).join("")}function YN(s){return s.replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}St.setOptions({gfm:!0,breaks:!1});const XN=[];Iv.addHook("afterSanitizeAttributes",s=>{s.tagName==="A"&&(s.setAttribute("target","_blank"),s.setAttribute("rel","noopener noreferrer"))});function _c({text:s,className:r="",files:c=!1}){const u=c?MN():XN,f=c?zN():"",h=N.useMemo(()=>{const m=Iv.sanitize(St.parse(s,{async:!1}));return c?qN(m,u,f):m},[s,c,u,f]);return i.jsx("div",{className:"md "+r,dangerouslySetInnerHTML:{__html:h}})}const GN=/^ {0,3}(`{3,}|~{3,})[ \t]*(?:drawio|drawgen)\b[^\n]*$/i;function $N(s){const r=s.split(`
168
- `),c=[];let u=[];const f=()=>{u.join(`
169
- `).trim()&&c.push({type:"md",text:u.join(`
170
- `)}),u=[]};for(let h=0;h<r.length;h++){const m=r[h].match(GN);if(!m){u.push(r[h]);continue}const b=m[1],g=new RegExp(`^ {0,3}${b[0]==="`"?"`":"~"}{${b.length},}[ \\t]*$`),S=[];let y=h+1;for(;y<r.length&&!g.test(r[y]);)S.push(r[y++]);f(),c.push({type:"drawio",spec:S.join(`
171
- `),closed:y<r.length}),h=y}return f(),c}function VN(s,r){return["The diagram renderer reported these problems with your drawio spec:",...(s?s.split(`
172
- `).filter(Boolean):r.map(u=>`${u.severity} ${u.code} ${u.cell}: ${u.message}`)).slice(0,30).map(u=>`- ${u}`),"","Reply with the corrected spec in a single ```drawio block."].join(`
173
- `)}const QN=s=>s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,48)||"diagram",dr=new Map;let ZN=null;const Jv=()=>ZN??(ZN=fetch("/api/render/status").then(s=>s.json()).then(s=>!!(s!=null&&s.ok)).catch(()=>!1));function Fv(s){const r=typeof s=="string"?s:JSON.stringify(s);let c=dr.get(r);return c||(c=fetch("/api/render/drawio",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({spec:s})}).then(async u=>{var h;const f=await u.json().catch(()=>({}));return u.ok?{ok:!0,r:f}:{ok:!1,error:((h=f==null?void 0:f.error)==null?void 0:h.message)||`Rendering failed (${u.status})`}}).catch(u=>({ok:!1,error:String((u==null?void 0:u.message)??u)})),dr.set(r,c),dr.size>60&&dr.delete(dr.keys().next().value)),c}function nv(s,r,c){const u=URL.createObjectURL(new Blob([r],{type:c}));Object.assign(document.createElement("a"),{href:u,download:s}).click(),setTimeout(()=>URL.revokeObjectURL(u),1e3)}function KN({text:s,streaming:r,onFix:c}){const u=N.useMemo(()=>$N(s),[s]);return u.length===1&&u[0].type==="md"?i.jsx(_c,{text:s}):i.jsx(i.Fragment,{children:u.map((f,h)=>f.type==="md"?i.jsx(_c,{text:f.text},h):i.jsx(IN,{spec:f.spec,pending:!f.closed&&r,onFix:c},h))})}function IN({spec:s,pending:r,onFix:c}){const[u,f]=N.useState(null),[h,m]=N.useState(null),[b,g]=N.useState(!1);N.useEffect(()=>{Jv().then(f)},[]),N.useEffect(()=>{if(r||!u||!s.trim())return;let E=!0;return m(null),Fv(s).then(z=>E&&m(z)),()=>{E=!1}},[s,r,u]);const S=N.useMemo(()=>h!=null&&h.ok?URL.createObjectURL(new Blob([h.r.svg],{type:"image/svg+xml"})):null,[h]);N.useEffect(()=>()=>{S&&URL.revokeObjectURL(S)},[S]);const y=i.jsx("pre",{className:"diagram-spec",children:i.jsx("code",{children:s})});if(r)return i.jsxs("div",{className:"diagram-card",children:[i.jsxs("div",{className:"diagram-head",children:[i.jsx("span",{className:"diagram-tag",children:"drawio"})," drawing…"]}),y]});if(u===!1)return i.jsxs("div",{className:"diagram-card",children:[i.jsxs("div",{className:"diagram-head",children:[i.jsx("span",{className:"diagram-tag",children:"drawio"})," Diagram rendering needs the render service (Docker setup)."]}),y]});if(!h)return i.jsx("div",{className:"diagram-card",children:i.jsxs("div",{className:"diagram-head",children:[i.jsx("span",{className:"diagram-tag",children:"drawio"})," rendering…"]})});const v=h.ok?h.r.check.issues:[],x=h.ok?QN(h.r.title):"diagram";return i.jsxs("div",{className:"diagram-card",children:[i.jsxs("div",{className:"diagram-head",children:[i.jsx("span",{className:"diagram-tag",children:"drawio"}),i.jsx("span",{className:"diagram-title",children:h.ok?h.r.title:"Diagram spec has problems"}),h.ok&&(v.length?i.jsxs("span",{className:"diagram-warn",title:v.map(E=>`${E.severity} ${E.code} ${E.cell}: ${E.message}`).join(`
174
- `),children:[v.length," layout issue",v.length===1?"":"s"]}):i.jsx("span",{className:"diagram-ok",children:"checked"})),i.jsx("span",{className:"spacer"}),h.ok&&i.jsx("button",{className:"btn ghost sm",onClick:()=>nv(`${x}.drawio.svg`,h.r.svg,"image/svg+xml"),title:"An SVG with the diagram embedded: opens for editing in draw.io and its VS Code extension",children:".drawio.svg"}),h.ok&&i.jsx("button",{className:"btn ghost sm",onClick:()=>nv(`${x}.drawio`,h.r.xml,"application/xml"),children:".drawio"}),i.jsx("button",{className:"btn ghost sm",onClick:()=>g(E=>!E),children:b?"hide spec":"spec"}),c&&(!h.ok||v.length>0)&&i.jsx("button",{className:"btn sm",onClick:()=>c(VN(h.ok?null:h.error,v)),title:"Send the problems back to the model",children:"ask model to fix"})]}),h.ok?i.jsx("img",{className:"diagram-img",src:S,alt:h.r.title}):i.jsx("pre",{className:"diagram-error",children:h.error}),b&&y]})}function JN({config:s,activeModel:r,messages:c,busy:u,error:f,onSend:h,onStop:m,onReset:b,onToolResult:g,onCompare:S,onCanvas:y}){var ae;const[v,x]=N.useState(""),E=th(),z=E.images,[V,L]=N.useState(!1),ne=N.useRef(null),pe=N.useRef(null),ce=N.useRef(null),_=N.useRef(null),$=((ae=r==null?void 0:r.input_modalities)==null?void 0:ae.includes("image"))??!1,H=z.length>0&&!$;N.useEffect(()=>{const F=ce.current;F&&(F.style.height="auto",F.style.height=Math.min(F.scrollHeight,260)+"px")},[v]);function Q(F){var P;F.target.closest("button, select, input, textarea, a")||(P=ce.current)==null||P.focus()}function W(){var he;if(V){(he=ne.current)==null||he.stop();return}const F=vv({onStart:()=>L(!0),onEnd:()=>{L(!1),ne.current=null},onPartial:P=>x(P)});ne.current=F}N.useEffect(()=>{var F;(F=pe.current)==null||F.scrollTo({top:pe.current.scrollHeight,behavior:"smooth"})},[c]);function re(){!v.trim()&&!z.length&&!E.docs.length||u||H||E.reading||(h(v,z.length?z:void 0,E.docs.length?E.docs:void 0),x(""),E.clear())}function G(F){F.key==="Enter"&&!F.shiftKey&&(F.preventDefault(),re())}const K=c.filter(F=>F.role!=="system"),Z=(r==null?void 0:r.name)??s.model,de=Rv(s.system),oe=(de==null?void 0:de.starters)??qS;function De(F){x(F),requestAnimationFrame(()=>{const he=ce.current;he&&(he.focus(),he.setSelectionRange(F.length,F.length))})}return i.jsxs("main",{className:"main",children:[i.jsxs(kr,{title:`bugxhunter@playground: ~/${Z}`,children:[i.jsxs("span",{className:"status-pill"+(u?" live":""),children:[i.jsx("span",{className:"dot"}),u?s.stream?"streaming":"thinking":"ready"]}),i.jsx("button",{className:"btn ghost sm",onClick:y,disabled:u,title:"Threat-model canvas: map a system from a diagram and track its findings",children:"canvas"}),i.jsx("button",{className:"btn ghost sm",onClick:S,disabled:u,title:"Ask 2–3 models the same question side by side",children:"compare"}),i.jsx("button",{className:"btn ghost sm",onClick:b,disabled:u,children:"clear"})]}),i.jsx("div",{className:"transcript grid-bg",ref:pe,children:i.jsxs("div",{className:"transcript-inner",children:[K.length===0&&i.jsxs("div",{className:"empty-state",children:[i.jsx(bv,{lines:[{kind:"p",text:`./bxh --playground --model ${Z}`,pace:26},{kind:"out",text:"Direct model access: no agent, no file system."},{kind:"out",text:de?`Preset: ${de.label}.${$?" Attach, paste or drop an image to review.":""}`:"Pick a security preset or tune the prompt on the left.",pace:18},{kind:"ok",text:"Model ready ",ok:"OK"}]},Z),i.jsx("div",{className:"suggestions",children:oe.map(F=>i.jsx("button",{className:"chip",onClick:()=>De(F),title:"Puts this in the message box",children:F.trim()},F))})]}),K.map((F,he)=>i.jsx(FN,{msg:F,streaming:u&&he===K.length-1,onToolResult:g,onFix:u?void 0:P=>h(P)},he)),f&&i.jsx("div",{className:"error-banner",children:f})]})}),i.jsxs("div",{className:"composer",children:[i.jsxs("div",{className:"composer-box",onClick:Q,onDragOver:F=>F.preventDefault(),onDrop:E.onDrop,children:[i.jsx(nh,{images:z,docs:E.docs,reading:E.reading,onRemove:E.remove,onRemoveDoc:E.removeDoc}),i.jsx("textarea",{ref:ce,value:v,onChange:F=>x(F.target.value),onKeyDown:G,onPaste:E.onPaste,rows:3,placeholder:V?"Listening…":$?`Message ${Z}… (attach, paste or drop an image or a .drawio file to review)`:`Message ${Z}… (attach or drop a .drawio file to review a diagram)`}),i.jsxs("div",{className:"composer-bar",children:[i.jsx("input",{ref:_,type:"file",accept:eh,multiple:!0,hidden:!0,onChange:F=>{F.target.files&&E.addImages(F.target.files),F.target.value=""}}),i.jsx("button",{className:"icon-btn attach-btn",onClick:()=>{var F;return(F=_.current)==null?void 0:F.click()},disabled:u,title:$?"Attach images or draw.io diagrams (or paste / drop them)":"Attach draw.io diagrams (images need a vision model)","aria-label":"Attach images or diagrams",children:i.jsx(zc,{})}),!H&&!E.attachError&&E.docs.length>0&&s.maxTokens<12e3&&i.jsxs("span",{className:"hint",style:{margin:"0 8px"},title:"Reasoning models think before they answer; a short limit can end the reply before any text",children:["Diagram reviews can need 10–16k output tokens; Max tokens is ",s.maxTokens.toLocaleString(),"."]}),(H||E.attachError)&&i.jsx("span",{className:"hint",style:{color:"var(--amber)",margin:"0 8px"},children:H?`${Z} can't see images — pick a vision model (e.g. Nemotron 3.5 Super VL)`:E.attachError}),i.jsx("div",{className:"spacer"}),Xd()&&i.jsx("button",{className:"send-btn mic"+(V?" stop":""),onClick:W,title:V?"Stop dictation":"Dictate",children:V?"●":"🎤"}),u?i.jsx("button",{className:"send-btn stop",onClick:m,title:"Stop",children:"■"}):i.jsx("button",{className:"send-btn",onClick:re,disabled:!v.trim()&&!z.length||H,title:"Send",children:"↑"})]})]}),i.jsx("div",{className:"composer-hint",children:"Enter to send · Shift+Enter for a new line"})]})]})}function FN({msg:s,streaming:r,onToolResult:c,onFix:u}){var m,b,g,S,y;const f=s.role==="user";return s.role==="tool"?i.jsxs("div",{className:"msg assistant",children:[i.jsx("div",{className:"avatar fn","aria-hidden":!0,children:"fn"}),i.jsx("div",{className:"msg-body",children:i.jsxs("div",{className:"tool-call",children:[i.jsx("span",{className:"tc-name",children:"tool result"}),i.jsx("pre",{children:s.content})]})})]}):f?i.jsx("div",{className:"msg user",children:i.jsxs("div",{className:"bubble user-bubble",children:[s.content,(m=s.images)!=null&&m.length?i.jsx("div",{className:"bubble-images",children:s.images.map((v,x)=>i.jsx("img",{src:v.url,alt:v.name,title:v.name},x))}):null,(b=s.docs)!=null&&b.length?i.jsx("div",{className:"attach-row bubble-docs",children:s.docs.map((v,x)=>i.jsxs("span",{className:"attach-chip doc",title:`Sent as an exact outline (${v.text.length.toLocaleString()} characters)`,children:[i.jsx("span",{className:"attach-doc-icon","aria-hidden":!0,children:"◇"}),i.jsx("span",{className:"attach-name",children:v.name})]},x))}):null]})}):i.jsxs("div",{className:"msg assistant",children:[i.jsx("div",{className:"avatar","aria-hidden":!0,children:"▶"}),i.jsxs("div",{className:"msg-body",children:[i.jsxs("div",{children:[s.content?i.jsx(KN,{text:s.content,streaming:r,onFix:u}):null,r&&!s.tool_calls&&i.jsx("span",{className:"cursor"}),(g=s.tool_calls)==null?void 0:g.map(v=>i.jsx(PN,{call:v,onResult:c},v.id))]}),s.sources&&s.sources.length>0&&i.jsxs("div",{className:"sources",children:[i.jsx("span",{className:"sources-label",children:"grounded in"}),s.sources.map((v,x)=>i.jsx("span",{className:"badge on",title:`similarity ${v.score}`,children:v.doc},x))]}),(s.usage||s.timing)&&i.jsxs("div",{className:"msg-meta",children:[s.timing&&Ov(s.timing,(S=s.usage)==null?void 0:S.completion,(y=s.usage)==null?void 0:y.reasoning),s.timing&&s.usage&&" · ",s.usage&&i.jsxs(i.Fragment,{children:[s.usage.prompt??0," in · ",s.usage.completion??0," out",s.usage.reasoning?` · ${s.usage.reasoning} reasoning`:""," tokens"]})]})]})]})}function PN({call:s,onResult:r}){const[c,u]=N.useState(""),[f,h]=N.useState(!1);let m=s.function.arguments;try{m=JSON.stringify(JSON.parse(s.function.arguments),null,2)}catch{}return i.jsxs("div",{className:"tool-call",children:[i.jsxs("span",{className:"tc-name",children:[s.function.name,"()"]}),i.jsx("pre",{children:m}),f?i.jsx("div",{className:"tc-result mini",style:{color:"var(--muted)"},children:"↳ result submitted"}):i.jsxs("div",{className:"tc-result",children:[i.jsx("textarea",{placeholder:"Return a tool result (JSON or text), then continue…",value:c,onChange:b=>u(b.target.value),style:{minHeight:50,fontSize:12}}),i.jsx("button",{className:"btn mini",style:{marginTop:6},disabled:!c.trim(),onClick:()=>{r(s,c),h(!0)},children:"Submit result & continue"})]})]})}function WN(s,r){if(!(r!=null&&r.length))return s;const c=r.map(u=>`Attached draw.io diagram "${u.name}", exported as an outline: its zones, the boxes inside each zone (legend colour meanings in [brackets]) and the arrows with their labels. Every label is exact.
175
-
176
- <diagram file="${u.name.replace(/"/g,"'")}">
177
- ${u.text.trimEnd()}
178
- </diagram>`);return[(s==null?void 0:s.trim())||"Review this diagram for security issues.",...c].join(`
179
-
180
- `)}function dh(s,r,c){const u=WN(s,c);return r!=null&&r.length?[{type:"text",text:(u==null?void 0:u.trim())||"Describe this image."},...r.map(f=>({type:"image_url",image_url:{url:f.url}}))]:u}const ej=3,tj={scx:"SCX.ai",nvidia:"NVIDIA NIM",openrouter:"OpenRouter"},hr=s=>({model:s,text:"",busy:!1,error:null});function av(s,r){var f;const c=s.find(h=>h.id===r[0]),u=s.filter(h=>!r.includes(h.id));return(f=u.find(h=>(h.provider??"scx")!==((c==null?void 0:c.provider)??"scx"))??u[0])==null?void 0:f.id}function nj({config:s,models:r,onExit:c}){const u=r.filter(jc),[f,h]=N.useState(()=>[s.model,av(u,[s.model])].filter(_=>!!_).map(hr)),[m,b]=N.useState(""),[g,S]=N.useState(null),y=th(),v=N.useRef(null),x=N.useRef([]),E=f.some(_=>_.busy),z=(_,$)=>h(H=>H.map((Q,W)=>W===_?{...Q,...$}:Q));function V(){x.current.forEach(_=>_.abort()),x.current=[]}function L(){if(!m.trim()&&!y.images.length&&!y.docs.length||E||y.reading)return;V();const _=y.images,$=[...s.system.trim()?[{role:"system",content:s.system}]:[],{role:"user",content:dh(m,_,y.docs)}],H=[_.length?`${_.length} image${_.length>1?"s":""}`:"",...y.docs.map(Q=>Q.name)].filter(Boolean);S((m.trim()||(y.docs.length?"Review this diagram for security issues.":"Describe this image."))+(H.length?` [+${H.join(", ")}]`:"")),x.current=f.map(()=>new AbortController),f.forEach((Q,W)=>{var Z,de;const re=r.find(oe=>oe.id===Q.model);if(_.length&&!((Z=re==null?void 0:re.input_modalities)!=null&&Z.includes("image"))){h(oe=>oe.map((De,ae)=>ae===W?{...hr(De.model),skipped:"This model can't see images, so it was skipped."}:De));return}h(oe=>oe.map((De,ae)=>ae===W?{...hr(De.model),busy:!0}:De));const G=performance.now();let K;Yd({model:Q.model,messages:$,temperature:s.temperature,top_p:s.topP,max_tokens:s.maxTokens,response_format:s.jsonMode?{type:"json_object"}:void 0,stream:s.stream},{signal:(de=x.current[W])==null?void 0:de.signal,onDelta:oe=>{K??(K=performance.now()-G),h(De=>De.map((ae,F)=>F===W?{...ae,text:ae.text+oe}:ae))},onUsage:oe=>z(W,{usage:oe}),onError:oe=>z(W,{error:oe}),onDone:()=>z(W,{timing:{ttft:K,total:performance.now()-G}})}).catch(oe=>{(oe==null?void 0:oe.name)!=="AbortError"&&z(W,{error:String((oe==null?void 0:oe.message)??oe)})}).finally(()=>z(W,{busy:!1}))}),b(""),y.clear()}function ne(_){_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),L())}const pe=["scx","nvidia","openrouter"].map(_=>[_,u.filter($=>($.provider??"scx")===_)]).filter(([,_])=>_.length>0),ce=f.some(_=>{var $,H;return(H=($=r.find(Q=>Q.id===_.model))==null?void 0:$.input_modalities)==null?void 0:H.includes("image")});return i.jsxs("main",{className:"main",children:[i.jsxs(kr,{title:`bugxhunter@playground: ~/compare (${f.length} models)`,children:[i.jsxs("span",{className:"status-pill"+(E?" live":""),children:[i.jsx("span",{className:"dot"}),E?"running":"ready"]}),f.length<ej&&i.jsx("button",{className:"btn ghost sm",disabled:E,onClick:()=>h(_=>[..._,hr(av(u,_.map($=>$.model))??s.model)]),children:"+ model"}),i.jsx("button",{className:"btn ghost sm",onClick:()=>{V(),c()},children:"back to chat"})]}),i.jsxs("div",{className:"transcript grid-bg",children:[g&&i.jsxs("div",{className:"compare-prompt mono",children:["$ ",g]}),i.jsx("div",{className:"compare-grid",style:{"--cols":f.length},children:f.map((_,$)=>{var H,Q;return i.jsxs("section",{className:"compare-col",children:[i.jsxs("div",{className:"compare-head",children:[i.jsxs("select",{value:_.model,disabled:E,onChange:W=>z($,{...hr(W.target.value)}),"aria-label":`Model ${$+1}`,children:[!u.some(W=>W.id===_.model)&&i.jsx("option",{value:_.model,children:_.model}),pe.map(([W,re])=>i.jsx("optgroup",{label:tj[W],children:re.map(G=>{var K;return i.jsxs("option",{value:G.id,children:[G.name,(K=G.input_modalities)!=null&&K.includes("image")?" · vision":""]},G.id)})},W))]}),f.length>1&&i.jsx("button",{className:"attach-x",disabled:E,onClick:()=>h(W=>W.filter((re,G)=>G!==$)),"aria-label":"Remove this model",children:"✕"})]}),i.jsxs("div",{className:"compare-body",children:[_.skipped&&i.jsx("div",{className:"hint",style:{color:"var(--amber)"},children:_.skipped}),_.error&&i.jsx("div",{className:"error-banner",children:_.error}),_.text&&i.jsx(_c,{text:_.text}),_.busy&&i.jsx("span",{className:"cursor"}),!_.text&&!_.busy&&!_.skipped&&!_.error&&i.jsx("p",{className:"muted mono",style:{margin:0},children:g?"No answer.":"Waiting for a prompt…"})]}),(_.timing||_.usage)&&i.jsxs("div",{className:"msg-meta",children:[_.timing&&Ov(_.timing,(H=_.usage)==null?void 0:H.completion,(Q=_.usage)==null?void 0:Q.reasoning),_.usage&&`${_.timing?" · ":""}${_.usage.prompt??0} in · ${_.usage.completion??0} out tokens`]})]},$)})})]}),i.jsxs("div",{className:"composer",children:[i.jsxs("div",{className:"composer-box",onDragOver:_=>_.preventDefault(),onDrop:y.onDrop,children:[i.jsx(nh,{images:y.images,docs:y.docs,reading:y.reading,onRemove:y.remove,onRemoveDoc:y.removeDoc}),i.jsx("textarea",{value:m,onChange:_=>b(_.target.value),onKeyDown:ne,onPaste:y.onPaste,rows:3,placeholder:`Ask all ${f.length} models the same thing…${ce?" (images go to the vision models)":""}`}),i.jsxs("div",{className:"composer-bar",children:[i.jsx("input",{ref:v,type:"file",accept:eh,multiple:!0,hidden:!0,onChange:_=>{_.target.files&&y.addImages(_.target.files),_.target.value=""}}),i.jsx("button",{className:"icon-btn attach-btn",onClick:()=>{var _;return(_=v.current)==null?void 0:_.click()},disabled:E,title:"Attach images (or paste / drop them)","aria-label":"Attach images",children:i.jsx(zc,{})}),y.attachError&&i.jsx("span",{className:"hint",style:{color:"var(--amber)",margin:"0 8px"},children:y.attachError}),i.jsx("div",{className:"spacer"}),E?i.jsx("button",{className:"send-btn stop",onClick:V,title:"Stop all",children:"■"}):i.jsx("button",{className:"send-btn",onClick:L,disabled:!m.trim()&&!y.images.length&&!y.docs.length||y.reading,title:"Run on all models",children:"↑"})]})]}),i.jsx("div",{className:"composer-hint",children:"Enter to run on every model · uses the sidebar's system prompt and settings · single turn"})]})]})}const mi=["data","management","attestation","identity","control","blocked"],Tr={data:"Data",management:"Management",attestation:"Attestation / evidence",identity:"Identity / credential",control:"Control / config",blocked:"Blocked"},aj=["actor","service","datastore","external"],Pv=["critical","high","medium","low"],Cc={critical:0,high:1,medium:2,low:3},uc=()=>({title:"Untitled threat model",nodes:[],edges:[]}),Ct=(s,r="")=>typeof s=="string"?s.trim():r,vr=s=>s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,40)||"node";function lj(s){const r=Ct(s).toLowerCase();return aj.includes(r)?r:/user|client|admin|customer|attacker|person|internet/.test(r)?"actor":/db|database|store|bucket|storage|cache|queue|file|repo|config|secret/.test(r)?"datastore":/third|external|saas|vendor|partner/.test(r)?"external":"service"}function sj(s,r){const c=Ct(s).toLowerCase();return mi.includes(c)?c:c?/block|denied|disabled|cut/.test(c)?"blocked":/attest|evidence|spdm|measure/.test(c)?"attestation":/ident|credential|cert|svid|token|key|auth/.test(c)?"identity":/manag|admin|mgmt|bmc|redfish|ssh|console/.test(c)?"management":/control|config|crd|gitops|policy|deploy|boot|admission/.test(c)?"control":"data":/\bblocked\b/i.test(r)?"blocked":"data"}function lv(s,r){return(Array.isArray(s)?s:[]).flatMap((c,u)=>{if(!c||typeof c!="object")return[];const f=c,h=Ct(f.title)||Ct(f.issue)||Ct(f.name);if(!h)return[];const m=Ct(f.status).toLowerCase();return[{id:`${r}-f${u+1}`,title:h,severity:ij(f.severity),fix:Ct(f.fix)||Ct(f.mitigation)||void 0,ref:Ct(f.ref)||Ct(f.cwe)||void 0,status:m==="fixed"||m==="verified"?m:"open"}]})}function ij(s){const r=Ct(s).toLowerCase();return Pv.includes(r)?r:r.startsWith("crit")||r==="p1"?"critical":r.startsWith("hi")||r==="p2"?"high":r.startsWith("lo")||r==="p4"||r==="p5"||r.startsWith("info")?"low":"medium"}function rj(s){const r=s.match(/```(?:json)?\s*([\s\S]*?)```/i),c=r?r[1]:s,u=c.indexOf("{"),f=c.lastIndexOf("}");if(u<0||f<=u)throw new Error("No JSON object in the model's reply.");return JSON.parse(c.slice(u,f+1))}function mr(s){if(!s||typeof s!="object")throw new Error("Threat model must be a JSON object.");const r=s,c=new Set,u=b=>{let g=b;for(let S=2;c.has(g);S++)g=`${b}-${S}`;return c.add(g),g},f=new Map,h=(Array.isArray(r.nodes)?r.nodes:[]).flatMap((b,g)=>{if(!b||typeof b!="object")return[];const S=b,y=Ct(S.label)||Ct(S.name)||`Component ${g+1}`,v=Ct(S.id)||vr(y),x=u(vr(v));f.has(v)||f.set(v,x),f.has(y)||f.set(y,x);const E=lv(S.findings,x);return[{id:x,label:y,kind:lj(S.kind??S.type),details:(Array.isArray(S.details)?S.details:[]).map(z=>Ct(z)).filter(Boolean).slice(0,8),inScope:S.inScope!==!1,tested:S.tested===!0,findings:E,x:typeof S.x=="number"?S.x:void 0,y:typeof S.y=="number"?S.y:void 0}]}),m=(Array.isArray(r.edges)?r.edges:[]).flatMap((b,g)=>{if(!b||typeof b!="object")return[];const S=b,y=f.get(Ct(S.from))??f.get(vr(Ct(S.from))),v=f.get(Ct(S.to))??f.get(vr(Ct(S.to)));if(!y||!v||y===v)return[];let x=Ct(S.label);const E=/\s*\(implied\)\s*$/i.test(x);E&&(x=x.replace(/\s*\(implied\)\s*$/i,""));const z=`e${g+1}`;return[{id:z,from:y,to:v,label:x||Ct(S.protocol)||void 0,kind:sj(S.kind??S.type,x),encrypted:typeof S.encrypted=="boolean"?S.encrypted:void 0,implied:S.implied===!0||E||void 0,protocol:Ct(S.protocol)||void 0,auth:Ct(S.auth)||Ct(S.authentication)||void 0,findings:lv(S.findings,z)}]});return{title:Ct(r.title)||"Untitled threat model",nodes:h,edges:m}}const In=200,tl=86,oj=120,cj=40,zd=In+oj,Nr=tl+cj,sv=6,fc={actor:0,external:1,service:2,datastore:3},Nd=s=>s.x!==void 0&&s.y!==void 0;function ql(s){const r=s.nodes.filter(b=>!Nd(b));if(!r.length)return s;if(r.length===s.nodes.length)return{...s,nodes:fj(s.nodes,s.edges)};const c=s.nodes.filter(Nd),u=Math.min(...c.map(b=>b.x)),f=Math.max(...c.map(b=>b.y))+Nr;let h=0;const m=s.nodes.map(b=>{if(Nd(b))return b;const g=h++;return{...b,x:u+g%4*zd,y:f+Math.floor(g/4)*Nr}});return{...s,nodes:m}}function uj(s){return ql({...s,nodes:s.nodes.map(({x:r,y:c,...u})=>u)})}function fj(s,r){var re;const c=new Map(s.map((G,K)=>[G.id,K])),u=new Map(s.map(G=>[G.id,new Set])),f=new Map(s.map(G=>[G.id,new Set]));for(const G of r)G.from===G.to||!u.has(G.from)||!u.has(G.to)||(u.get(G.from).add(G.to),f.get(G.to).add(G.from));const h=s.filter(G=>u.get(G.id).size||f.get(G.id).size),m=s.filter(G=>!u.get(G.id).size&&!f.get(G.id).size),b=[...h].sort((G,K)=>(f.get(G.id).size?1:0)-(f.get(K.id).size?1:0)||fc[G.kind]-fc[K.kind]||c.get(G.id)-c.get(K.id)),g=new Map(h.map(G=>[G.id,[]])),S=new Map(h.map(G=>[G.id,[]])),y=new Map,v=G=>{y.set(G,1);for(const K of u.get(G))y.get(K)!==1&&(g.get(G).push(K),S.get(K).push(G),y.has(K)||v(K));y.set(G,2)};for(const G of b)y.has(G.id)||v(G.id);const x=[],E=new Map(h.map(G=>[G.id,S.get(G.id).length])),z=h.filter(G=>!E.get(G.id)).map(G=>G.id);for(;z.length;){const G=z.shift();x.push(G);for(const K of g.get(G))E.set(K,E.get(K)-1),E.get(K)||z.push(K)}const V=new Map;for(const G of x)V.set(G,Math.max(0,...S.get(G).map(K=>V.get(K)+1)));for(const G of[...x].reverse()){const K=s[c.get(G)];S.get(G).length||!g.get(G).length||K.kind==="actor"||V.set(G,Math.max(0,Math.min(...g.get(G).map(Z=>V.get(Z)))-1))}const L=[];for(const G of x)(L[re=V.get(G)]??(L[re]=[])).push(G);const ne=L.filter(Boolean),pe=new Map;ne.forEach(G=>G.forEach((K,Z)=>pe.set(K,Z-(G.length-1)/2)));for(let G=0;G<8;G++){const K=G%2===0;for(const Z of K?ne:[...ne].reverse()){const de=V.get(Z[0]),oe=new Map(Z.map(De=>{const ae=[...f.get(De),...u.get(De)].filter(F=>V.has(F)&&(K?V.get(F)<de:V.get(F)>de));return[De,ae.length?ae.reduce((F,he)=>F+pe.get(he),0)/ae.length:pe.get(De)]}));Z.sort((De,ae)=>oe.get(De)-oe.get(ae)),Z.forEach((De,ae)=>pe.set(De,ae-(Z.length-1)/2))}}const _=Math.min(sv,Math.max(0,...ne.map(G=>G.length))),$=new Map;let H=0;for(const G of ne){const K=Math.ceil(G.length/sv),Z=Math.ceil(G.length/K);G.forEach((de,oe)=>{const De=Math.floor(oe/Z),ae=Math.min(Z,G.length-De*Z);$.set(de,{x:40+(H+De)*zd,y:40+((_-ae)/2+oe%Z)*Nr})}),H+=K}const Q=ne.length?40+(_+.5)*Nr:40,W=Math.max(4,H);return[...m].sort((G,K)=>fc[G.kind]-fc[K.kind]||c.get(G.id)-c.get(K.id)).forEach((G,K)=>$.set(G.id,{x:40+K%W*zd,y:Q+Math.floor(K/W)*Nr})),s.map(G=>({...G,...$.get(G.id)}))}function iv(s){let r=null;for(const c of s.findings)c.status==="open"&&(!r||Cc[c.severity]<Cc[r])&&(r=c.severity);return r}function dj(s){const r={critical:0,high:0,medium:0,low:0};let c=0;for(const h of[...s.nodes.flatMap(m=>m.findings),...s.edges.flatMap(m=>m.findings??[])])h.status==="open"?r[h.severity]++:c++;const u=Object.fromEntries(mi.map(h=>[h,0]));for(const h of s.edges)u[h.kind??"data"]++;const f=s.nodes.filter(h=>h.inScope);return{components:s.nodes.length,inScope:f.length,tested:f.filter(h=>h.tested).length,open:r,fixed:c,plaintextFlows:s.edges.filter(h=>h.encrypted===!1).length,flows:s.edges.length,impliedFlows:s.edges.filter(h=>h.implied).length,blockedFlows:u.blocked,byKind:u}}function hj(s){const r=new Map(s.nodes.map(h=>[h.id,h.label])),c=[...s.nodes.flatMap(h=>h.findings.map(m=>({where:h.label,f:m}))),...s.edges.flatMap(h=>(h.findings??[]).map(m=>({where:`${r.get(h.from)??h.from} → ${r.get(h.to)??h.to} (${Tr[h.kind??"data"].toLowerCase()} flow)`,f:m})))].sort((h,m)=>Cc[h.f.severity]-Cc[m.f.severity]),u=(h="")=>h.replace(/\|/g,"\\|").replace(/\n/g," ");return[`# ${u(s.title)}`,"","| Severity | Component or flow | Finding | Fix | Ref | Status |","|---|---|---|---|---|---|",...c.map(({where:h,f:m})=>`| ${m.severity} | ${u(h)} | ${u(m.title)} | ${u(m.fix)} | ${u(m.ref)} | ${m.status} |`)].join(`
181
- `)+`
182
- `}function mj(s){const r=ql(s),c=new Map(r.nodes.map((b,g)=>[b.id,`n${g}-${vr(b.id)}`])),u=(b,g)=>b.length>g?b.slice(0,g-1)+"…":b,f=b=>{if(!b.inScope)return"out of scope";const g=Pv.map(S=>[S,b.findings.filter(y=>y.status==="open"&&y.severity===S).length]).filter(([,S])=>S>0);return g.length?g.map(([S,y])=>`${y} ${S}`).join(" · "):"no open findings"},h=Math.min(...r.nodes.map(b=>b.x??0)),m=Math.min(...r.nodes.map(b=>b.y??0));return{title:u(s.title||"Threat model",80),nodes:r.nodes.map(b=>({id:c.get(b.id),label:u(b.label,40),kind:b.kind,sub:f(b),x:Math.round((b.x??0)-h+40),y:Math.round((b.y??0)-m+90),w:In,h:tl})),edges:r.edges.filter(b=>c.has(b.from)&&c.has(b.to)).map(b=>{const g=b.kind??"data",S=b.encrypted===!1&&!/plain/i.test(b.label??""),y=S?"async":g==="blocked"?"weak":g==="management"||g==="control"?"sync":g==="attestation"||g==="identity"?"ai":"data",v=[g==="data"?"":`${g}:`,b.label,S?"(plaintext)":"",b.implied?"(implied)":""].filter(Boolean).join(" ");return{from:c.get(b.from),to:c.get(b.to),style:y,...v?{label:u(v,48)}:{}}}),legend:{edges:[]}}}function pj(s,r,c){const u=Math.max(s,r?65536:8192);return c&&c>0?Math.min(u,Math.max(c,1024)):u}let pr;function gj(){if(pr!==void 0)return pr;try{pr=typeof document<"u"?document.createElement("canvas").getContext("2d"):null}catch{pr=null}return pr}function Ud(s,r){var h;const c=gj();if(c)return c.font=r,c.measureText(s).width;const u=Number(((h=/(\d+(?:\.\d+)?)px/.exec(r))==null?void 0:h[1])??12),f=/mono/i.test(r)||/\b[6-9]00\b|bold/.test(r)?.6:.56;return s.length*u*f}function dc(s,r,c){if(r<=0)return"";if(Ud(s,c)<=r)return s;const u=Array.from(s);let f=0,h=u.length;for(;f<h;){const m=Math.ceil((f+h)/2);Ud(u.slice(0,m).join("").trimEnd()+"…",c)<=r?f=m:h=m-1}return f?u.slice(0,f).join("").trimEnd()+"…":"…"}const yj="700 14px Inter, system-ui, sans-serif",vj="10px JetBrains Mono, monospace",bj="11px Inter, system-ui, sans-serif",rv="11px JetBrains Mono, monospace",xj=`You are a security architect building a threat model of a system the user owns or is authorised to assess.
183
- From the diagram, screenshot or description you are given, map the system and its weaknesses.
184
-
185
- Reply with ONE JSON object and nothing else, in exactly this shape:
186
- {
187
- "title": "short name of the system",
188
- "nodes": [
189
- {
190
- "id": "short-kebab-id",
191
- "label": "Component name as shown",
192
- "kind": "actor" | "service" | "datastore" | "external",
193
- "details": ["facts read off the source: versions, ports, settings"],
194
- "findings": [
195
- { "title": "the weakness, one line", "severity": "critical" | "high" | "medium" | "low", "fix": "the remediation, one line", "ref": "CWE-xxx if clear" }
196
- ]
197
- }
198
- ],
199
- "edges": [
200
- {
201
- "from": "node-id", "to": "node-id", "label": "what flows, short",
202
- "kind": "data" | "management" | "attestation" | "identity" | "control" | "blocked",
203
- "encrypted": true | false, "protocol": "e.g. Redfish/HTTPS", "auth": "e.g. mTLS",
204
- "implied": true,
205
- "findings": [ { "title": "...", "severity": "...", "fix": "...", "ref": "..." } ]
206
- }
207
- ]
208
- }
209
-
210
- Rules:
211
- - actor = people or the internet; service = servers, apps, APIs; datastore = databases, buckets, files, config, secrets stores; external = third-party systems.
212
- - Attach each finding to the component it affects. Notes that apply to a component (e.g. "MFA not required for /admin") go on that component.
213
- - Only report what the source shows or states. Do not invent components or weaknesses. If something is unclear, leave it out.
214
- - Flow kind: data = application or tenant data; management = admin and out-of-band access (BMC, SSH, consoles); attestation = evidence and measurements (SPDM, quotes); identity = credentials, certificates, keys, workload identities; control = configuration, policy, deployment, boot images; blocked = a path the source shows as disabled or cut.
215
- - Mark a flow "encrypted": false only when the source shows plaintext (HTTP, "plaintext", no TLS); omit "encrypted" when unknown. Classical or weak crypto is not plaintext: record it as a finding instead. Omit "protocol" and "auth" when the source doesn't say.
216
- - Set "implied": true only for a flow the source does not draw but its labels clearly imply, and only when the user asks for implied flows. Otherwise omit it.
217
- - A weakness of the connection itself (a classical signature on evidence, missing authentication, a protocol downgrade) goes in that flow's "findings"; a weakness of a component goes on the component.
218
- - Notes, legends and markers (a red X, a "blocked" note) are not components: turn a blocked path into a flow with kind "blocked".
219
- - The stated threat model or attacker (e.g. "tenant with root on the host") is context, not a finding: put it in that component's details. A control the source shows in place is not a finding either, unless something about it is weak or unverified.
220
- - Keep every string short. No markdown, no commentary outside the JSON.`;function Sj(s,r){const c=r?"the attached diagram or screenshot":"the system described below",u=s.trim()?`
221
-
222
- Context from the user:
223
- ${s.trim()}`:"";return`Build the threat model JSON for ${c}.${u}`}const br=()=>crypto.randomUUID().toLowerCase(),Lc=s=>`/api/playground/sessions/${s}`;async function Hc(s,r){var u,f;if(s.ok)return s.json();let c="";try{c=((f=(u=await s.json())==null?void 0:u.error)==null?void 0:f.message)??""}catch{}throw new Error(c||`${r} failed (${s.status})`)}const yc=s=>fetch(Lc(s)).then(r=>Hc(r,"Listing saved sessions")).then(r=>r.sessions),Ld=(s,r)=>fetch(`${Lc(s)}/${r}`).then(c=>Hc(c,"Opening the session")),vc=(s,r,c,u)=>fetch(`${Lc(s)}/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:c,body:u})}).then(f=>Hc(f,"Saving")),Wv=(s,r)=>fetch(`${Lc(s)}/${r}`,{method:"DELETE"}).then(c=>Hc(c,"Deleting")),ov="or_threat_model",wj=1200,e0="or_canvas_panel",t0=340,n0=260,a0=640;function Nj(){try{const s=JSON.parse(localStorage.getItem(e0)??"null");if(s&&typeof s.width=="number")return{width:Math.min(a0,Math.max(n0,s.width)),collapsed:s.collapsed===!0}}catch{}return{width:t0,collapsed:!1}}const cv={actor:"#00e5ff",service:"#8fa8ff",datastore:"#ffb300",external:"#b4bcc6"},xr={critical:"#ff3c3c",high:"#ff7a45",medium:"#ffb300",low:"#6e7681"},Hd=["critical","high","medium","low"],jj=["actor","service","datastore","external"],ui={data:"#9aa4b2",management:"#c792ea",attestation:"#e3b341",identity:"#3fb950",control:"#58a6ff",blocked:"#5c6370"},Bd="#ff3c3c";function Tj(s,r){const c=(s.x??0)+In/2,u=(s.y??0)+tl/2,f=(r.x??0)+In/2,h=(r.y??0)+tl/2;if(Math.abs(f-c)>In){const v=f>c?1:-1,x=c+v*In/2,E=f-v*(In/2+2),z=Math.max(40,Math.abs(E-x)/2)*v;return{d:`M${x},${u} C${x+z},${u} ${E-z},${h} ${E},${h}`,ax:x,ay:u,ex:E,ey:h}}const m=f-c,b=h-u,g=Math.min(Math.abs(In/2/(m||1e-6)),Math.abs(tl/2/(b||1e-6)),1),S=f-m*g,y=h-b*g;return{d:`M${c},${u} L${S},${y}`,ax:c,ay:u,ex:S,ey:y}}function Ej(s){const r=s.encrypted===!1,c=r?Bd:ui[s.kind??"data"],u=s.kind==="blocked"?"2 5":r?"7 5":s.implied?"4 4":void 0;return{plain:r,color:c,dash:u,opacity:s.implied?.6:1,marker:r?"tm-arrow-plain":`tm-arrow-${s.kind??"data"}`}}const kj=(s,r)=>s.length>r?s.slice(0,r-1)+"…":s;function hc(s,r,c){const u=URL.createObjectURL(new Blob([r],{type:c})),f=document.createElement("a");f.href=u,f.download=s,f.click(),URL.revokeObjectURL(u)}function Aj({config:s,models:r,onExit:c}){var Lt,Mt,il;const[u,f]=N.useState(uc),[h,m]=N.useState(br),[b,g]=N.useState(null),[S,y]=N.useState([]),[v,x]=N.useState(null),[E,z]=N.useState(!1),V=N.useRef(""),[L,ne]=N.useState(null),[pe,ce]=N.useState(null),[_,$]=N.useState(Nj);N.useEffect(()=>{try{localStorage.setItem(e0,JSON.stringify(_))}catch{}},[_]);const H=N.useRef(null);function Q(k){var Ie;k.preventDefault();const ee=k.currentTarget;ee.setPointerCapture(k.pointerId),document.body.classList.add("resizing");const ve=((Ie=H.current)==null?void 0:Ie.getBoundingClientRect().right)??window.innerWidth,Te=bn=>$(Et=>({...Et,width:Math.round(Math.min(a0,Math.max(n0,ve-bn.clientX)))})),Ze=()=>{ee.removeEventListener("pointermove",Te),ee.removeEventListener("pointerup",Ze),document.body.classList.remove("resizing")};ee.addEventListener("pointermove",Te),ee.addEventListener("pointerup",Ze)}const[W,re]=N.useState(""),[G,K]=N.useState(!1),[Z,de]=N.useState(null),oe=th(),De=N.useRef(null),ae=N.useRef(null),F=N.useRef(null),he=N.useRef(null),P=()=>yc("canvas").then(y).catch(k=>x({ok:!1,text:String(k.message??k)}));function _e(k,ee,ve){f(k),m(ee),ne(null),ce(null),$t(null),V.current=ve?JSON.stringify(k):""}N.useEffect(()=>{let k=!0;return(async()=>{try{let ee=null;try{ee=localStorage.getItem(ov)}catch{}if(ee){const Te=ql(mr(JSON.parse(ee)));Te.nodes.length&&await vc("canvas",br(),Te.title,Te);try{localStorage.removeItem(ov)}catch{}}const ve=await yc("canvas");if(!k)return;if(y(ve),ve[0]){const Te=await Ld("canvas",ve[0].id);k&&_e(ql(mr(Te.body)),ve[0].id,!0)}}catch(ee){k&&x({ok:!1,text:`Saved canvases unavailable: ${String(ee.message??ee)}`})}finally{k&&z(!0)}})(),()=>{k=!1}},[]),N.useEffect(()=>{if(!E||!u.nodes.length)return;const k=JSON.stringify(u);if(k===V.current)return;const ee=setTimeout(()=>{vc("canvas",h,u.title,u).then(()=>(V.current=k,x({ok:!0,text:"Saved, encrypted with your vault"}),yc("canvas").then(y))).catch(ve=>x({ok:!1,text:`Not saved: ${String(ve.message??ve)}`}))},wj);return()=>clearTimeout(ee)},[u,h,E]);async function ot(k){try{const ee=await Ld("canvas",k);g(null),_e(ql(mr(ee.body)),k,!0)}catch(ee){x({ok:!1,text:String(ee.message??ee)})}}async function ht(k){try{await Wv("canvas",k),k===h&&_e(uc(),br(),!1),await P()}catch(ee){x({ok:!1,text:String(ee.message??ee)})}}const mt=r.filter(jc),T=mt.filter(k=>{var ee;return(ee=k.input_modalities)==null?void 0:ee.includes("image")}),te=oe.images.length>0,xe=te?T:mt,[Se,He]=N.useState(s.model),Ue=xe.some(k=>k.id===Se)?Se:((Lt=xe[0])==null?void 0:Lt.id)??"",je=dj(u),fe=u.nodes.find(k=>k.id===L)??null,we=u.edges.find(k=>k.id===pe)??null;function pt(k){u.nodes.length&&JSON.stringify(u)!==V.current&&vc("canvas",h,u.title,u).catch(()=>{}),g({model:u,id:h}),_e(k,br(),!1)}const q=(k,ee)=>f(ve=>({...ve,nodes:ve.nodes.map(Te=>Te.id===k?{...Te,...ee}:Te)})),Re=(k,ee,ve)=>f(Te=>({...Te,nodes:Te.nodes.map(Ze=>Ze.id===k?{...Ze,findings:Ze.findings.map(Ie=>Ie.id===ee?{...Ie,...ve}:Ie)}:Ze)}));function Ae(){const k=`component-${Date.now().toString(36)}`;f(ee=>ql({...ee,nodes:[...ee.nodes,{id:k,label:"New component",kind:"service",details:[],inScope:!0,tested:!1,findings:[]}]})),ne(k)}function Be(k){f(ee=>({...ee,nodes:ee.nodes.filter(ve=>ve.id!==k),edges:ee.edges.filter(ve=>ve.from!==k&&ve.to!==k)})),ne(null)}const Oe=(k,ee)=>f(ve=>({...ve,edges:ve.edges.map(Te=>Te.id===k?{...Te,...ee}:Te)})),se=(k,ee,ve)=>f(Te=>({...Te,edges:Te.edges.map(Ze=>Ze.id===k?{...Ze,findings:Ze.findings.map(Ie=>Ie.id===ee?{...Ie,...ve}:Ie)}:Ze)}));function be(k,ee,ve){const Te=`e-${Date.now().toString(36)}`;f(Ze=>({...Ze,edges:[...Ze.edges,{id:Te,from:k,to:ee,kind:ve,findings:[]}]})),ne(null),ce(Te)}function C(k){f(ee=>({...ee,edges:ee.edges.filter(ve=>ve.id!==k)})),ce(null)}function me(k,ee){k.stopPropagation(),ne(null),ce(ee)}function Me(){var ve;if(G||!W.trim()&&!oe.images.length&&!oe.docs.length||oe.reading||!Ue)return;K(!0),de(null);const k=new AbortController;he.current=k;let ee="";Yd({model:Ue,messages:[{role:"system",content:xj},{role:"user",content:dh(Sj(W,oe.images.length>0||oe.docs.length>0),oe.images,oe.docs)}],temperature:.2,max_tokens:pj(s.maxTokens,oe.docs.length>0,(ve=mt.find(Te=>Te.id===Ue))==null?void 0:ve.max_output_length),stream:!0},{signal:k.signal,onDelta:Te=>{ee+=Te},onError:Te=>de(Te),onDone:Te=>{if(!ee.trim()){de(Te==="length"?"The model used its whole output limit thinking and wrote no threat model. Try again, raise Max tokens, or pick a faster model.":"The model returned no answer. Try again or pick another model.");return}try{const Ze=ql(mr(rj(ee)));if(!Ze.nodes.length)throw new Error("The model returned no components.");pt(Ze),re(""),oe.clear()}catch(Ze){de(Te==="length"?"The model ran out of output tokens before finishing the threat model. Raise Max tokens or ask for fewer components.":`Couldn't read the model's threat model: ${Ze.message}`)}}}).catch(Te=>{(Te==null?void 0:Te.name)!=="AbortError"&&de(String((Te==null?void 0:Te.message)??Te))}).finally(()=>{K(!1),he.current=null})}async function lt(k){try{pt(ql(mr(JSON.parse(await k.text()))))}catch(ee){de(`Import failed: ${ee.message}`)}}const gt=u.title.replace(/[^a-z0-9]+/gi,"-").toLowerCase().replace(/^-|-$/g,"")||"threat-model",[Dt,Ke]=N.useState(!1),[ut,Fe]=N.useState(!1);N.useEffect(()=>{Jv().then(Ke)},[]);async function yn(){Fe(!0);const k=await Fv(mj(u));Fe(!1),k.ok?hc(`${gt}.drawio.svg`,k.r.svg,"image/svg+xml"):x({ok:!1,text:`draw.io export failed: ${k.error}`})}function Fn(){const k=F.current;if(!k)return;const ee=k.cloneNode(!0);ee.setAttribute("xmlns","http://www.w3.org/2000/svg"),ee.removeAttribute("class"),ee.removeAttribute("style"),ee.setAttribute("viewBox",`${Ut.x} ${Ut.y} ${Ut.w} ${Ut.h}`),ee.setAttribute("width",String(Math.round(Ut.w))),ee.setAttribute("height",String(Math.round(Ut.h))),hc(`${gt}.svg`,new XMLSerializer().serializeToString(ee),"image/svg+xml")}const[La,$t]=N.useState(null),Ut=N.useMemo(()=>{if(!u.nodes.length)return{x:0,y:0,w:900,h:520};const k=u.nodes.map(Ze=>Ze.x??0),ee=u.nodes.map(Ze=>Ze.y??0),ve=Math.min(...k)-40,Te=Math.min(...ee)-40;return{x:ve,y:Te,w:Math.max(900,Math.max(...k)+In+40-ve),h:Math.max(520,Math.max(...ee)+tl+40-Te)}},[u.nodes]),Yt=La??Ut,X=Math.round(Ut.w/Yt.w*100),ge=N.useRef(Ut);ge.current=Ut;function Ne(k,ee,ve){$t(Te=>{const Ze=ge.current,Ie=Te??Ze,bn=Math.min(Ze.w*4,Math.max(Ze.w/4,Ie.w/k)),Et=Ie.w/bn,nn=ee??Ie.x+Ie.w/2,wa=ve??Ie.y+Ie.h/2;return{x:nn-(nn-Ie.x)/Et,y:wa-(wa-Ie.y)/Et,w:bn,h:Ie.h/Et}})}function Ee(k,ee){const ve=new DOMPoint(k,ee).matrixTransform(F.current.getScreenCTM().inverse());return{x:ve.x,y:ve.y}}const Ge=u.nodes.length>0;N.useEffect(()=>{const k=F.current;if(!k)return;const ee=ve=>{ve.preventDefault();const Te=Ee(ve.clientX,ve.clientY);Ne(ve.deltaY<0?1.15:1/1.15,Te.x,Te.y)};return k.addEventListener("wheel",ee,{passive:!1}),()=>k.removeEventListener("wheel",ee)},[Ge]);const Pe=N.useRef(null),st=N.useRef(null),[vn,tn]=N.useState(!1);function ua(k,ee){var Te;k.stopPropagation(),$t(Yt);const ve=Ee(k.clientX,k.clientY);Pe.current={id:ee.id,dx:ve.x-(ee.x??0),dy:ve.y-(ee.y??0)},(Te=F.current)==null||Te.setPointerCapture(k.pointerId),ne(ee.id),ce(null)}function sl(k){var ve;const ee=F.current.getBoundingClientRect();st.current={cx:k.clientX,cy:k.clientY,start:Yt,scale:Math.max(Yt.w/ee.width,Yt.h/ee.height)},(ve=F.current)==null||ve.setPointerCapture(k.pointerId),tn(!0)}function xs(k){const ee=Pe.current;if(ee){const Te=Ee(k.clientX,k.clientY);q(ee.id,{x:Math.round(Te.x-ee.dx),y:Math.round(Te.y-ee.dy)});return}const ve=st.current;ve&&$t({...ve.start,x:ve.start.x-(k.clientX-ve.cx)*ve.scale,y:ve.start.y-(k.clientY-ve.cy)*ve.scale})}function Un(){Pe.current=null,st.current=null,tn(!1)}const Rt=new Map(u.nodes.map(k=>[k.id,k]));return i.jsxs("main",{className:"main",children:[i.jsxs(kr,{title:`bugxhunter@playground: ~/canvas: ${kj(u.title,40)}`,children:[i.jsxs("span",{className:"status-pill",children:[i.jsx("span",{className:"dot"}),je.components," components · ",je.tested,"/",je.inScope," tested · ",je.open.critical+je.open.high," crit/high open"]}),i.jsx("button",{className:"btn ghost sm",onClick:Ae,children:"+ component"}),i.jsx("button",{className:"btn ghost sm",disabled:!u.nodes.length,title:"Lay the canvas out again, left to right along its flows (undo puts it back)",onClick:()=>{g({model:u,id:h}),f(uj(u)),$t(null)},children:"tidy"}),i.jsx("button",{className:"btn ghost sm",onClick:()=>{var k;return(k=ae.current)==null?void 0:k.click()},children:"import"}),i.jsx("button",{className:"btn ghost sm",disabled:!u.nodes.length,onClick:()=>hc(`${gt}.json`,JSON.stringify(u,null,2),"application/json"),children:"json"}),i.jsx("button",{className:"btn ghost sm",disabled:!u.nodes.length,onClick:()=>hc(`${gt}-findings.md`,hj(u),"text/markdown"),children:"findings.md"}),i.jsx("button",{className:"btn ghost sm",disabled:!u.nodes.length,onClick:Fn,children:"svg"}),Dt&&i.jsx("button",{className:"btn ghost sm",disabled:!u.nodes.length||ut,onClick:yn,title:"An editable diagram: opens in draw.io and its VS Code extension",children:ut?"draw.io…":"draw.io"}),b&&i.jsx("button",{className:"btn ghost sm",onClick:()=>{_e(b.model,b.id,!1),g(null)},children:"undo"}),i.jsx("button",{className:"btn ghost sm",disabled:!u.nodes.length,onClick:()=>pt(uc()),children:"clear"}),i.jsx("button",{className:"btn ghost sm",onClick:()=>{var k;(k=he.current)==null||k.abort(),c()},children:"back to chat"}),i.jsx("input",{ref:ae,type:"file",accept:"application/json,.json",hidden:!0,onChange:k=>{var ve;const ee=(ve=k.target.files)==null?void 0:ve[0];ee&&lt(ee),k.target.value=""}})]}),i.jsxs("div",{className:"canvas-wrap",ref:H,children:[i.jsxs("div",{className:"canvas-stage grid-bg",onPointerDown:()=>{ne(null),ce(null)},children:[Ge&&i.jsxs("div",{className:"canvas-zoom",onPointerDown:k=>k.stopPropagation(),children:[i.jsx("button",{onClick:()=>Ne(1/1.25),title:"Zoom out","aria-label":"Zoom out",children:"−"}),i.jsxs("span",{title:"Zoom (100% = fit)",children:[X,"%"]}),i.jsx("button",{onClick:()=>Ne(1.25),title:"Zoom in","aria-label":"Zoom in",children:"+"}),i.jsx("button",{onClick:()=>$t(null),title:"Fit the whole model",children:"fit"})]}),u.nodes.length?i.jsxs("svg",{ref:F,className:"canvas-svg",viewBox:`${Yt.x} ${Yt.y} ${Yt.w} ${Yt.h}`,preserveAspectRatio:"xMidYMin meet",onPointerMove:xs,onPointerUp:Un,onPointerCancel:Un,style:{cursor:vn?"grabbing":void 0},children:[i.jsxs("defs",{children:[[...mi.map(k=>[`tm-arrow-${k}`,ui[k]]),["tm-arrow-plain",Bd],["tm-arrow-sel","#ffffff"]].map(([k,ee])=>i.jsx("marker",{id:k,viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:i.jsx("path",{d:"M0,0 L10,5 L0,10 z",fill:ee})},k)),i.jsx("clipPath",{id:"tm-card-clip",children:i.jsx("rect",{width:In,height:tl,rx:10})})]}),i.jsx("rect",{x:"-100000",y:"-100000",width:"200000",height:"200000",fill:"#0a0e14",style:{cursor:vn?"grabbing":"grab"},onPointerDown:sl}),u.edges.map(k=>{var ol;const ee=Rt.get(k.from),ve=Rt.get(k.to);if(!ee||!ve)return null;const{d:Te,ax:Ze,ay:Ie,ex:bn,ey:Et}=Tj(ee,ve),nn=Ej(k),wa=pe===k.id,wt=(Ze+bn)/2,An=(Ie+Et)/2,Pn=[k.label,nn.plain&&!/plain/i.test(k.label??"")?"(plaintext)":"",k.implied?"(implied)":""].filter(Boolean).join(" "),Ss=Math.min(240,Math.max(70,Math.hypot(bn-Ze,Et-Ie)-24)),fa=Pn?dc(Pn,Ss,rv):"",Ha=fa?Ud(fa,rv)+10:0,Gl=iv(k),rl=((ol=k.findings)==null?void 0:ol.filter(cl=>cl.status==="open").length)??0;return i.jsxs("g",{opacity:nn.opacity,style:{cursor:"pointer"},onPointerDown:cl=>me(cl,k.id),children:[i.jsx("title",{children:`${Tr[k.kind??"data"]} flow${k.implied?" (implied)":""}${Pn?`: ${Pn}`:""}`}),i.jsx("path",{d:Te,fill:"none",stroke:"transparent",strokeWidth:14}),i.jsx("path",{d:Te,fill:"none",stroke:wa?"#ffffff":nn.color,strokeWidth:wa?3:2,strokeDasharray:nn.dash,markerEnd:`url(#${wa?"tm-arrow-sel":nn.marker})`}),k.kind==="blocked"&&i.jsxs("g",{transform:`translate(${wt},${An})`,children:[i.jsx("circle",{r:8,fill:"#0a0e14",stroke:ui.blocked,strokeWidth:2}),i.jsx("line",{x1:-5,y1:5,x2:5,y2:-5,stroke:ui.blocked,strokeWidth:2})]}),fa&&i.jsxs("g",{transform:`translate(${wt},${An-(k.kind==="blocked"?18:10)})`,children:[i.jsx("rect",{x:-Ha/2,y:-9,width:Ha,height:15,rx:4,fill:"#0a0e14",opacity:.85}),i.jsx("text",{y:2,fill:nn.plain?"#ff8080":nn.color,fontSize:11,fontFamily:"JetBrains Mono, monospace",textAnchor:"middle",children:fa})]}),rl>0&&i.jsxs("g",{transform:`translate(${wt+Ha/2+4},${An-20})`,children:[i.jsx("rect",{width:20,height:16,rx:8,fill:xr[Gl??"low"]}),i.jsx("text",{x:10,y:12,fill:"#0a0e14",fontSize:10,fontWeight:700,textAnchor:"middle",fontFamily:"Inter, system-ui, sans-serif",children:rl})]})]},k.id)}),u.nodes.map(k=>{const ee=iv(k),ve=k.findings.filter(Et=>Et.status==="open").length,Te=k.x??0,Ze=k.y??0,Ie=In-16-12,bn=`${k.kind.toUpperCase()}${k.inScope?"":" · OUT OF SCOPE"}${k.tested?" · TESTED ✓":""}`;return i.jsxs("g",{transform:`translate(${Te},${Ze})`,opacity:k.inScope?1:.45,style:{cursor:"grab"},onPointerDown:Et=>ua(Et,k),children:[i.jsx("title",{children:[k.label,...k.details].join(`
224
- `)}),i.jsx("rect",{width:In,height:tl,rx:10,fill:"#161b22",stroke:L===k.id?"#ffffff":cv[k.kind],strokeWidth:L===k.id?2.5:1.5,strokeDasharray:k.inScope?void 0:"5 4"}),i.jsxs("g",{clipPath:"url(#tm-card-clip)",children:[ee&&i.jsx("rect",{width:6,height:tl,fill:xr[ee]}),i.jsx("text",{x:16,y:22,fill:"#e6edf3",fontSize:14,fontWeight:700,fontFamily:"Inter, system-ui, sans-serif",children:dc(k.label,Ie-(ve>0?30:0),yj)}),i.jsx("text",{x:16,y:40,fill:cv[k.kind],fontSize:10,fontFamily:"JetBrains Mono, monospace",children:dc(bn,Ie,vj)}),k.details.slice(0,2).map((Et,nn)=>i.jsx("text",{x:16,y:58+nn*14,fill:"#8b949e",fontSize:11,fontFamily:"Inter, system-ui, sans-serif",children:dc(Et,Ie,bj)},nn))]}),ve>0&&i.jsxs("g",{transform:`translate(${In-30},8)`,children:[i.jsx("rect",{width:22,height:18,rx:9,fill:xr[ee??"low"]}),i.jsx("text",{x:11,y:13,fill:"#0a0e14",fontSize:11,fontWeight:700,textAnchor:"middle",fontFamily:"Inter, system-ui, sans-serif",children:ve})]})]},k.id)})]}):i.jsx("div",{className:"empty-state center",children:i.jsxs("p",{className:"muted mono",children:["No threat model yet. Attach an architecture diagram or describe the system below, then ",i.jsx("b",{children:"build"}),". Or add components by hand, or import a saved model."]})}),_.collapsed&&i.jsx("button",{className:"sidebar-toggle floating canvas-panel-show",onPointerDown:k=>k.stopPropagation(),onClick:()=>$(k=>({...k,collapsed:!1})),title:"Show panel","aria-label":"Show panel",children:"«"})]}),!_.collapsed&&i.jsx("div",{className:"splitter canvas-splitter",role:"separator","aria-orientation":"vertical","aria-label":"Resize panel",title:"Drag to resize · double-click to reset",onPointerDown:Q,onDoubleClick:()=>$(k=>({...k,width:t0}))}),i.jsxs("aside",{className:"canvas-panel",hidden:_.collapsed,style:{width:_.width},children:[i.jsxs("div",{className:"canvas-panel-head",children:[i.jsx("span",{className:"section-title",children:fe?"Component":we?"Flow":"Canvas"}),i.jsx("button",{className:"sidebar-toggle",onClick:()=>$(k=>({...k,collapsed:!0})),title:"Hide panel","aria-label":"Hide panel",children:"»"})]}),fe?i.jsx(Cj,{node:fe,others:u.nodes.filter(k=>k.id!==fe.id),onChange:k=>q(fe.id,k),onFinding:(k,ee)=>Re(fe.id,k,ee),onAddFinding:k=>q(fe.id,{findings:[...fe.findings,k]}),onRemoveFinding:k=>q(fe.id,{findings:fe.findings.filter(ee=>ee.id!==k)}),onAddFlow:(k,ee)=>be(fe.id,k,ee),onDelete:()=>Be(fe.id)}):we?i.jsx(Dj,{edge:we,fromLabel:((Mt=Rt.get(we.from))==null?void 0:Mt.label)??we.from,toLabel:((il=Rt.get(we.to))==null?void 0:il.label)??we.to,onChange:k=>Oe(we.id,k),onFinding:(k,ee)=>se(we.id,k,ee),onAddFinding:k=>Oe(we.id,{findings:[...we.findings,k]}),onRemoveFinding:k=>Oe(we.id,{findings:we.findings.filter(ee=>ee.id!==k)}),onDelete:()=>C(we.id)}):i.jsxs("div",{className:"canvas-summary",children:[i.jsx("label",{children:"Title"}),i.jsx("input",{type:"text",value:u.title,onChange:k=>f(ee=>({...ee,title:k.target.value}))}),i.jsx("div",{className:"section-title",children:"Summary"}),i.jsxs("ul",{className:"canvas-stats",children:[i.jsxs("li",{children:[je.components," components, ",je.inScope," in scope"]}),i.jsxs("li",{children:["Coverage: ",je.tested,"/",je.inScope," tested"]}),Hd.map(k=>i.jsxs("li",{children:[i.jsx("span",{className:"sev-dot",style:{background:xr[k]}}),je.open[k]," ",k," open"]},k)),i.jsxs("li",{children:[je.fixed," fixed or verified"]}),i.jsxs("li",{children:[je.flows," flow",je.flows===1?"":"s",": ",je.plaintextFlows," plaintext, ",je.impliedFlows," implied, ",je.blockedFlows," blocked"]})]}),i.jsx("div",{className:"section-title",children:"Flows"}),i.jsxs("ul",{className:"canvas-legend",children:[mi.map(k=>i.jsxs("li",{children:[i.jsx("svg",{width:"34",height:"10","aria-hidden":!0,children:i.jsx("line",{x1:"1",y1:"5",x2:"33",y2:"5",stroke:ui[k],strokeWidth:"2",strokeDasharray:k==="blocked"?"2 5":void 0})}),Tr[k]," ",i.jsxs("span",{className:"muted",children:["(",je.byKind[k],")"]})]},k)),i.jsxs("li",{children:[i.jsx("svg",{width:"34",height:"10","aria-hidden":!0,children:i.jsx("line",{x1:"1",y1:"5",x2:"33",y2:"5",stroke:Bd,strokeWidth:"2",strokeDasharray:"7 5"})}),"Plaintext (any type)"]}),i.jsxs("li",{children:[i.jsx("svg",{width:"34",height:"10","aria-hidden":!0,children:i.jsx("line",{x1:"1",y1:"5",x2:"33",y2:"5",stroke:ui.data,strokeWidth:"2",strokeDasharray:"4 4",opacity:"0.6"})}),"Implied: not drawn in the source"]})]}),i.jsx("p",{className:"hint",children:"Click a component or a flow to edit it and track its findings. Drag components to rearrange."}),i.jsx("div",{className:"section-title",children:"Saved canvases"}),v&&i.jsx("div",{className:"hint",style:{color:v.ok?"var(--muted)":"var(--amber)"},children:v.text}),i.jsx("button",{className:"btn ghost sm block",onClick:()=>pt(uc()),disabled:!u.nodes.length,children:"+ New canvas"}),i.jsx(_j,{list:S,activeId:h,onOpen:k=>void ot(k),onDelete:k=>void ht(k)})]})]})]}),i.jsxs("div",{className:"composer",children:[i.jsxs("div",{className:"composer-box",onDragOver:k=>k.preventDefault(),onDrop:oe.onDrop,children:[i.jsx(nh,{images:oe.images,docs:oe.docs,reading:oe.reading,onRemove:oe.remove,onRemoveDoc:oe.removeDoc}),i.jsx("textarea",{value:W,onChange:k=>re(k.target.value),onPaste:oe.onPaste,rows:2,placeholder:"Attach an architecture diagram, or describe the system (components, data stores, flows)…"}),i.jsxs("div",{className:"composer-bar",children:[i.jsx("input",{ref:De,type:"file",accept:eh,multiple:!0,hidden:!0,onChange:k=>{k.target.files&&oe.addImages(k.target.files),k.target.value=""}}),i.jsx("button",{className:"icon-btn attach-btn",onClick:()=>{var k;return(k=De.current)==null?void 0:k.click()},disabled:G,title:"Attach a diagram (or paste / drop it)","aria-label":"Attach a diagram",children:i.jsx(zc,{})}),i.jsxs("select",{className:"canvas-builder",value:Ue,onChange:k=>He(k.target.value),disabled:G,"aria-label":"Model that builds the threat model",children:[!xe.length&&i.jsx("option",{value:"",children:te?"No vision model available":"No models"}),xe.map(k=>{var ee;return i.jsxs("option",{value:k.id,children:[k.name,(ee=k.input_modalities)!=null&&ee.includes("image")?" · vision":""]},k.id)})]}),(Z||oe.attachError)&&i.jsx("span",{className:"hint",style:{color:"var(--amber)",margin:"0 8px"},children:Z??oe.attachError}),i.jsx("div",{className:"spacer"}),G?i.jsx("button",{className:"send-btn stop",onClick:()=>{var k;return(k=he.current)==null?void 0:k.abort()},title:"Stop",children:"■"}):i.jsx("button",{className:"btn primary sm",onClick:Me,disabled:!W.trim()&&!oe.images.length&&!oe.docs.length||oe.reading||!Ue,children:u.nodes.length?"rebuild":"build"})]})]}),i.jsx("div",{className:"composer-hint",children:G?"Building the threat model… (reasoning models can take several minutes on a big diagram)":"Each build starts a new saved canvas; undo brings the previous one back. Saved on the runner, encrypted with your vault."})]})]})}function _j({list:s,activeId:r,onOpen:c,onDelete:u}){const[f,h]=N.useState(null);return N.useEffect(()=>{if(!f)return;const m=setTimeout(()=>h(null),3e3);return()=>clearTimeout(m)},[f]),s.length?i.jsx("div",{className:"session-list",children:s.map(m=>i.jsxs("div",{className:"session-item"+(m.id===r?" on":""),children:[i.jsxs("button",{className:"session-open",onClick:()=>c(m.id),title:m.title,children:[i.jsx("span",{className:"session-title",children:m.title||"Untitled threat model"}),i.jsx("span",{className:"session-meta",children:new Date(m.updatedAt).toLocaleString()})]}),i.jsx("button",{className:"session-del"+(f===m.id?" confirm":""),onClick:()=>{if(f!==m.id)return h(m.id);h(null),u(m.id)},title:f===m.id?"Click again to delete":"Delete canvas","aria-label":f===m.id?"Confirm delete":"Delete canvas",children:f===m.id?"Delete?":"✕"})]},m.id))}):i.jsx("div",{className:"hint",children:"No saved canvases yet. Build one and it saves itself."})}function l0({ownerId:s,findings:r,onFinding:c,onAddFinding:u,onRemoveFinding:f}){const[h,m]=N.useState(""),[b,g]=N.useState("medium");return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"section-title",children:["Findings (",r.length,")"]}),r.map(S=>i.jsxs("div",{className:"canvas-finding",children:[i.jsxs("div",{className:"cf-head",children:[i.jsx("span",{className:"sev-pill",style:{background:xr[S.severity]},children:S.severity}),i.jsx("span",{className:"cf-title",children:S.title}),i.jsx("button",{className:"attach-x",onClick:()=>f(S.id),"aria-label":"Remove finding",children:"✕"})]}),S.fix&&i.jsxs("div",{className:"cf-fix",children:["Fix: ",S.fix]}),S.ref&&i.jsx("div",{className:"cf-ref",children:S.ref}),i.jsxs("div",{className:"cf-controls",children:[i.jsx("select",{value:S.severity,onChange:y=>c(S.id,{severity:y.target.value}),"aria-label":"Severity",children:Hd.map(y=>i.jsx("option",{value:y,children:y},y))}),i.jsxs("select",{value:S.status,onChange:y=>c(S.id,{status:y.target.value}),"aria-label":"Status",children:[i.jsx("option",{value:"open",children:"open"}),i.jsx("option",{value:"fixed",children:"fixed"}),i.jsx("option",{value:"verified",children:"verified (retested)"})]})]})]},S.id)),i.jsxs("div",{className:"cf-add",children:[i.jsx("input",{type:"text",placeholder:"Add a finding…",value:h,onChange:S=>m(S.target.value)}),i.jsx("select",{value:b,onChange:S=>g(S.target.value),children:Hd.map(S=>i.jsx("option",{value:S,children:S},S))}),i.jsx("button",{className:"btn mini",disabled:!h.trim(),onClick:()=>{u({id:`${s}-f${Date.now().toString(36)}`,title:h.trim(),severity:b,status:"open"}),m("")},children:"add"})]})]})}function Cj({node:s,others:r,onChange:c,onFinding:u,onAddFinding:f,onRemoveFinding:h,onAddFlow:m,onDelete:b}){const[g,S]=N.useState(""),[y,v]=N.useState("data");return i.jsxs("div",{className:"canvas-inspector",children:[i.jsx("label",{children:"Component"}),i.jsx("input",{type:"text",value:s.label,onChange:x=>c({label:x.target.value})}),i.jsx("label",{children:"Kind"}),i.jsx("select",{value:s.kind,onChange:x=>c({kind:x.target.value}),children:jj.map(x=>i.jsx("option",{value:x,children:x},x))}),i.jsxs("label",{className:"check",children:[i.jsx("input",{type:"checkbox",checked:s.inScope,onChange:x=>c({inScope:x.target.checked})})," In scope"]}),i.jsxs("label",{className:"check",children:[i.jsx("input",{type:"checkbox",checked:s.tested,onChange:x=>c({tested:x.target.checked})})," Tested"]}),s.details.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"section-title",children:"Details"}),i.jsx("ul",{className:"canvas-details",children:s.details.map((x,E)=>i.jsx("li",{children:x},E))})]}),i.jsx(l0,{ownerId:s.id,findings:s.findings,onFinding:u,onAddFinding:f,onRemoveFinding:h}),r.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"section-title",children:"Add a flow from here"}),i.jsxs("div",{className:"cf-add",children:[i.jsxs("select",{value:g,onChange:x=>S(x.target.value),"aria-label":"Flow goes to",children:[i.jsx("option",{value:"",children:"to…"}),r.map(x=>i.jsx("option",{value:x.id,children:x.label},x.id))]}),i.jsx("select",{value:y,onChange:x=>v(x.target.value),"aria-label":"Flow type",children:mi.map(x=>i.jsx("option",{value:x,children:Tr[x]},x))}),i.jsx("button",{className:"btn mini",disabled:!g,onClick:()=>{m(g,y),S("")},children:"add"})]})]}),i.jsx("button",{className:"btn danger-outline sm",style:{marginTop:14},onClick:b,children:"delete component"})]})}function Dj({edge:s,fromLabel:r,toLabel:c,onChange:u,onFinding:f,onAddFinding:h,onRemoveFinding:m,onDelete:b}){const g=s.encrypted===!0?"yes":s.encrypted===!1?"no":"unknown";return i.jsxs("div",{className:"canvas-inspector",children:[i.jsx("label",{children:"Flow"}),i.jsxs("div",{className:"cf-route",title:`${r} → ${c}`,children:[r," ",i.jsx("span",{className:"muted",children:"→"})," ",c]}),i.jsx("label",{children:"Label"}),i.jsx("input",{type:"text",value:s.label??"",placeholder:"what it carries",onChange:S=>u({label:S.target.value||void 0})}),i.jsx("label",{children:"Type"}),i.jsx("select",{value:s.kind??"data",onChange:S=>u({kind:S.target.value}),children:mi.map(S=>i.jsx("option",{value:S,children:Tr[S]},S))}),i.jsx("label",{children:"Encrypted"}),i.jsxs("select",{value:g,onChange:S=>u({encrypted:S.target.value==="yes"?!0:S.target.value==="no"?!1:void 0}),children:[i.jsx("option",{value:"unknown",children:"not stated"}),i.jsx("option",{value:"yes",children:"yes"}),i.jsx("option",{value:"no",children:"no (plaintext)"})]}),i.jsx("label",{children:"Protocol"}),i.jsx("input",{type:"text",value:s.protocol??"",placeholder:"not stated",onChange:S=>u({protocol:S.target.value||void 0})}),i.jsx("label",{children:"Authentication"}),i.jsx("input",{type:"text",value:s.auth??"",placeholder:"not stated",onChange:S=>u({auth:S.target.value||void 0})}),i.jsxs("label",{className:"check",title:"Not drawn in the source, but implied by its labels",children:[i.jsx("input",{type:"checkbox",checked:s.implied===!0,onChange:S=>u({implied:S.target.checked||void 0})})," Implied (not drawn in the source)"]}),i.jsx(l0,{ownerId:s.id,findings:s.findings??[],onFinding:f,onAddFinding:h,onRemoveFinding:m}),i.jsx("button",{className:"btn danger-outline sm",style:{marginTop:14},onClick:b,children:"delete flow"})]})}const Dc=[{name:"new",description:"Start a new session",hint:""},{name:"compact",description:"Summarise the conversation to free up context",hint:""},{name:"model",description:"Switch model, e.g. /model kimi",hint:"<name>"},{name:"plan",description:"Switch to the read-only plan agent",hint:""},{name:"build",description:"Switch to the build agent",hint:""},{name:"help",description:"List available commands",hint:""}],Oj=25*1024*1024,uv=30*1024*1024,s0="or_cmd_history";function Rj(){try{const s=localStorage.getItem(s0);if(s)return JSON.parse(s)}catch{}return[]}function Mj({agent:s,setAgent:r,model:c,setModel:u,models:f,commands:h,busy:m,onSend:b,onStop:g,draft:S,onDraftUsed:y}){var pt;const[v,x]=N.useState(""),[E,z]=N.useState([]),[V,L]=N.useState(null),[ne,pe]=N.useState(!1),[ce,_]=N.useState(0),$=N.useRef(null),H=N.useRef(null),[Q,W]=N.useState(!1),re=N.useRef(null);function G(){var Ae,Be;if(Q){(Ae=re.current)==null||Ae.stop();return}const q=v.trim(),Re=vv({onStart:()=>W(!0),onEnd:()=>{W(!1),re.current=null},onPartial:Oe=>x(q?q+" "+Oe:Oe)});re.current=Re,(Be=$.current)==null||Be.focus()}const[K,Z]=N.useState(Rj),de=N.useRef(-1),oe=N.useRef("");function De(q){q.trim()&&Z(Re=>{const Ae=(Re[Re.length-1]===q?Re:[...Re,q]).slice(-200);try{localStorage.setItem(s0,JSON.stringify(Ae))}catch{}return Ae})}function ae(){requestAnimationFrame(()=>{const q=$.current;q&&(q.selectionStart=q.selectionEnd=q.value.length)})}const F=()=>{const q=$.current;return!q||!q.value.slice(0,q.selectionStart??0).includes(`
225
- `)},he=()=>{const q=$.current;return!q||!q.value.slice(q.selectionEnd??0).includes(`
226
- `)};function P(q){if(!K.length)return!1;if(de.current===-1){if(q===1)return!1;oe.current=v,de.current=K.length-1}else{const Re=de.current+q;if(Re<0)return!0;if(Re>=K.length)return de.current=-1,x(oe.current),ae(),!0;de.current=Re}return x(K[de.current]),ae(),!0}N.useEffect(()=>{var q;S!==null&&(x(S),y(),(q=$.current)==null||q.focus())},[S,y]),N.useEffect(()=>{const q=$.current;q&&(q.style.height="auto",q.style.height=Math.min(q.scrollHeight,260)+"px")},[v]);function _e(q){var Ae;q.target.closest("button, select, input, textarea, a")||(Ae=$.current)==null||Ae.focus()}const ot=N.useMemo(()=>{const q=new Set(Dc.map(Re=>Re.name));return[...Dc,...h.filter(Re=>!q.has(Re.name))]},[h]),ht=(pt=/^\/(\S*)$/.exec(v))==null?void 0:pt[1],mt=ht!==void 0?ot.filter(q=>q.name.startsWith(ht.toLowerCase())):[],T=mt.length>0;N.useEffect(()=>_(0),[ht]);function te(q){var Re;q.hint?(x(`/${q.name} `),(Re=$.current)==null||Re.focus()):He(`/${q.name}`)}async function xe(q){L(null);const Re=[];let Ae=E.reduce((Be,Oe)=>Be+Oe.size,0);for(const Be of Array.from(q)){if(Be.size>Oj){L(`${Be.name} is over 25 MB.`);continue}if(Ae+Be.size>uv){L(`Attachments are limited to ${jr(uv)} per message; ${Be.name} doesn't fit.`);continue}Ae+=Be.size;const Oe=await zj(Be);Re.push({name:Be.name||`pasted-${Date.now()}.${(Be.type.split("/")[1]||"bin").replace(/\W/g,"")}`,mime:Be.type||"application/octet-stream",size:Be.size,data:Oe.slice(Oe.indexOf(",")+1),preview:Be.type.startsWith("image/")?Oe:void 0})}z(Be=>[...Be,...Re])}function Se(q){const Re=Array.from(q.clipboardData.files);Re.length&&(q.preventDefault(),xe(Re))}function He(q=v){!q.trim()&&!E.length||(De(q),de.current=-1,b(q,E),x(""),z([]),L(null))}function Ue(q){if(T){if(q.key==="ArrowDown"){q.preventDefault(),_(Re=>(Re+1)%mt.length);return}if(q.key==="ArrowUp"){q.preventDefault(),_(Re=>(Re-1+mt.length)%mt.length);return}if(q.key==="Tab"||q.key==="Enter"&&!q.shiftKey){q.preventDefault(),te(mt[ce]);return}if(q.key==="Escape"){q.preventDefault(),x("");return}}if(q.key==="ArrowUp"&&F()&&P(-1)){q.preventDefault();return}if(q.key==="ArrowDown"&&de.current!==-1&&he()&&P(1)){q.preventDefault();return}q.key==="Enter"&&!q.shiftKey&&(q.preventDefault(),He())}const je=f.find(q=>q.id===c),fe=N.useMemo(()=>{const q=new Map;for(const Re of f)q.set(Re.provider,[...q.get(Re.provider)??[],Re]);return[...q.entries()]},[f]),we=E.some(q=>q.mime.startsWith("image/"));return i.jsxs("div",{className:"composer-wrap",children:[T&&i.jsx("div",{className:"slash-menu",role:"listbox",children:mt.map((q,Re)=>i.jsxs("button",{role:"option","aria-selected":Re===ce,className:"slash-item"+(Re===ce?" on":""),onMouseEnter:()=>_(Re),onMouseDown:Ae=>{Ae.preventDefault(),te(q)},children:[i.jsxs("span",{className:"slash-name mono",children:["/",q.name,q.hint?i.jsxs("span",{className:"slash-hint",children:[" ",q.hint]}):null]}),i.jsx("span",{className:"slash-desc",children:q.description})]},q.name))}),i.jsxs("div",{className:"composer-box"+(ne?" dragging":""),onClick:_e,onDragOver:q=>{q.dataTransfer.types.includes("Files")&&(q.preventDefault(),pe(!0))},onDragLeave:()=>pe(!1),onDrop:q=>{q.preventDefault(),pe(!1),q.dataTransfer.files.length&&xe(q.dataTransfer.files)},children:[E.length>0&&i.jsx("div",{className:"attach-row",children:E.map((q,Re)=>i.jsxs("span",{className:"attach-chip",title:`${q.name} · ${jr(q.size)}`,children:[q.preview?i.jsx("img",{src:q.preview,alt:""}):i.jsx("span",{className:"attach-icon",children:i.jsx(Pd,{})}),i.jsx("span",{className:"attach-name",children:q.name}),i.jsx("button",{className:"attach-x",onClick:()=>z(Ae=>Ae.filter((Be,Oe)=>Oe!==Re)),"aria-label":`Remove ${q.name}`,children:"✕"})]},Re))}),i.jsx("textarea",{ref:$,value:v,onChange:q=>{x(q.target.value),de.current=-1},onKeyDown:Ue,onPaste:Se,rows:3,placeholder:Q?"Listening…":s==="build"?"Ask BugXHunter to change something… (/ for commands)":"Ask BugXHunter to plan or explain… (/ for commands)"}),i.jsxs("div",{className:"composer-bar",children:[i.jsx("button",{className:"icon-btn attach-btn",onClick:()=>{var q;return(q=H.current)==null?void 0:q.click()},title:"Attach files (or paste / drop them)","aria-label":"Attach files",children:i.jsx(zc,{size:20})}),i.jsx("input",{ref:H,type:"file",multiple:!0,hidden:!0,onChange:q=>{q.target.files&&xe(q.target.files),q.target.value=""}}),i.jsx("div",{className:"agent-switch",role:"tablist",children:["build","plan"].map(q=>i.jsx("button",{className:"seg"+(s===q?" on":""),onClick:()=>r(q),disabled:m,children:q},q))}),i.jsxs("select",{className:"model-select",value:c,onChange:q=>u(q.target.value),disabled:m,title:"Model",children:[!je&&i.jsx("option",{value:c,children:c}),fe.map(([q,Re])=>i.jsx("optgroup",{label:q,children:Re.map(Ae=>i.jsxs("option",{value:Ae.id,children:[Ae.name,Ae.images?" · sees images":"",Ae.output?` · ${Nc(Ae.output)} out`:""]},Ae.id))},q))]}),i.jsx("div",{className:"spacer"}),Xd()&&i.jsx("button",{className:"send-btn mic"+(Q?" stop":""),onClick:G,disabled:m,title:Q?"Stop dictation":"Dictate","aria-label":Q?"Stop dictation":"Dictate",children:Q?"●":"🎤"}),m?i.jsx("button",{className:"send-btn stop",onClick:g,title:"Stop",children:"■"}):i.jsx("button",{className:"send-btn",onClick:()=>He(),disabled:!v.trim()&&!E.length,title:"Send (Enter)",children:"↑"})]})]}),i.jsx("div",{className:"composer-hint",children:V?i.jsx("span",{className:"danger",children:V}):we&&je&&!je.images?i.jsxs("span",{className:"warn",children:[je.name," can't see images — it gets the saved file only. Pick a model marked “sees images” to let it look."]}):"Enter to send · Shift+Enter new line · / commands · paste or drop files"})]})}function zj(s){return new Promise((r,c)=>{const u=new FileReader;u.onload=()=>r(String(u.result)),u.onerror=()=>c(u.error),u.readAsDataURL(s)})}const Uj={completed:"✓",in_progress:"◐",pending:"○",cancelled:"✕"};function Lj({todos:s}){const[r,c]=N.useState(!0);if(!s.length)return null;const u=s.filter(h=>h.status==="completed").length,f=s.find(h=>h.status==="in_progress");return i.jsxs("div",{className:"todo-panel",children:[i.jsxs("button",{className:"todo-head",onClick:()=>c(h=>!h),"aria-expanded":r,children:[i.jsx("span",{className:"chev"+(r?" open":""),children:"›"}),i.jsx("span",{className:"todo-title",children:"Tasks"}),i.jsxs("span",{className:"todo-count",children:[u,"/",s.length]}),i.jsx("span",{className:"todo-bar",children:i.jsx("span",{style:{width:`${u/s.length*100}%`}})}),!r&&f&&i.jsx("span",{className:"todo-current",children:f.content})]}),r&&i.jsx("ul",{className:"todo-list",children:s.map((h,m)=>i.jsxs("li",{className:"todo s-"+h.status,children:[i.jsx("span",{className:"todo-icon","aria-hidden":!0,children:Uj[h.status]??"○"}),i.jsx("span",{className:"todo-text",children:h.content}),h.priority==="high"&&h.status!=="completed"&&i.jsx("span",{className:"todo-prio",children:"high"})]},m))})]})}function Hj(s){var u,f;const r=[];let c=!1;for(const h of s.split(`
227
- `)){const m=h.replace(/\r$/,"");if(m.startsWith("@@")){r.push(null),c=!0;continue}!c||m.startsWith("\\")||(m.startsWith("+")?r.push({kind:"add",text:m.slice(1)}):m.startsWith("-")?r.push({kind:"del",text:m.slice(1)}):r.push({kind:"same",text:m.slice(1)}))}return r[0]===null&&r.shift(),r.length&&((u=r[r.length-1])==null?void 0:u.kind)==="same"&&((f=r[r.length-1])==null?void 0:f.text)===""&&r.pop(),r}function Bj(s,r){const c=s?s.split(`
228
- `):[],u=r?r.split(`
229
- `):[];if(c.length*u.length>4e6)return[...c.map(y=>({kind:"del",text:y})),...u.map(y=>({kind:"add",text:y}))];const f=c.length,h=u.length,m=Array.from({length:f+1},()=>new Uint32Array(h+1));for(let y=f-1;y>=0;y--)for(let v=h-1;v>=0;v--)m[y][v]=c[y]===u[v]?m[y+1][v+1]+1:Math.max(m[y+1][v],m[y][v+1]);const b=[];let g=0,S=0;for(;g<f&&S<h;)c[g]===u[S]?(b.push({kind:"same",text:c[g]}),g++,S++):m[g+1][S]>=m[g][S+1]?b.push({kind:"del",text:c[g++]}):b.push({kind:"add",text:u[S++]});for(;g<f;)b.push({kind:"del",text:c[g++]});for(;S<h;)b.push({kind:"add",text:u[S++]});return b}function qj(s,r=3){const c=new Array(s.length).fill(!1);s.forEach((h,m)=>{if(h.kind!=="same")for(let b=Math.max(0,m-r);b<=Math.min(s.length-1,m+r);b++)c[b]=!0});const u=[];let f=!1;return s.forEach((h,m)=>{c[m]?(u.push(h),f=!1):f||(u.push(null),f=!0)}),u}function Yj({diff:s,onClose:r}){return N.useEffect(()=>{const c=u=>u.key==="Escape"&&r();return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[r]),i.jsx("div",{className:"overlay",onClick:r,children:i.jsxs("div",{className:"modal",onClick:c=>c.stopPropagation(),children:[i.jsxs("div",{className:"modal-head",children:[i.jsxs("span",{className:"modal-title",children:[i.jsx("span",{className:"dot r","aria-hidden":!0}),"git diff --session"]}),i.jsx("button",{className:"icon-btn close-x",onClick:r,"aria-label":"Close",title:"Close (Esc)",children:"✕"})]}),i.jsx("div",{className:"modal-body",children:typeof s=="string"?i.jsx("pre",{className:"diff-raw",children:s}):s.length===0?i.jsxs("p",{className:"muted",children:["No changes recorded. OpenCode tracks changes only in git repositories — run ",i.jsx("code",{className:"mono",children:"git init"})," in the project folder to see them here."]}):s.map((c,u)=>i.jsx(Xj,{f:c},`${c.turn??0}-${c.file}-${u}`))})]})})}function Xj({f:s}){const[r,c]=N.useState(!0),u=N.useMemo(()=>s.patch!==void 0?Hj(s.patch):qj(Bj(s.before??"",s.after??"")),[s.patch,s.before,s.after]);return i.jsxs("div",{className:"file-diff",children:[i.jsxs("button",{className:"file-diff-head",onClick:()=>c(f=>!f),children:[i.jsx("span",{className:"chev"+(r?" open":""),children:"›"}),i.jsx("span",{className:"mono",children:s.file}),s.turn?i.jsxs("span",{className:"muted turn",children:["prompt ",s.turn]}):null,i.jsxs("span",{className:"adds",children:["+",s.additions??0]}),i.jsxs("span",{className:"dels",children:["−",s.deletions??0]})]}),r&&i.jsx("pre",{className:"diff-lines",children:u.map((f,h)=>f===null?i.jsx("div",{className:"dl gap",children:"⋯"},h):i.jsxs("div",{className:"dl "+f.kind,children:[f.kind==="add"?"+ ":f.kind==="del"?"- ":" ",f.text]},h))})]})}function Gj({req:s,onAnswer:r,onDismiss:c}){const[u,f]=N.useState(()=>s.questions.map(()=>[])),[h,m]=N.useState(()=>s.questions.map(()=>""));function b(y,v,x){f(E=>E.map((z,V)=>V!==y?z:x?z.includes(v)?z.filter(L=>L!==v):[...z,v]:z[0]===v?[]:[v])),x||m(E=>E.map((z,V)=>V===y?"":z))}const g=s.questions.map((y,v)=>{const x=h[v].trim();return!y.multiple&&x?[x]:x?[...u[v],x]:u[v]}),S=g.every(y=>y.length>0);return i.jsxs("div",{className:"question-card",children:[i.jsxs("div",{className:"perm-title",children:["The agent has a question",s.subagent&&i.jsxs("span",{className:"perm-sub",children:["subagent · ",s.subagent]})]}),s.questions.map((y,v)=>i.jsxs("div",{className:"q-block",children:[y.header&&i.jsx("span",{className:"q-header",children:y.header}),i.jsx("div",{className:"q-text",children:y.question}),y.multiple&&i.jsx("div",{className:"hint",style:{marginTop:0},children:"Choose any that apply."}),i.jsx("div",{className:"q-options",role:y.multiple?"group":"radiogroup",children:y.options.map(x=>{const E=u[v].includes(x.label);return i.jsxs("button",{className:"q-option"+(E?" on":""),role:y.multiple?"checkbox":"radio","aria-checked":E,onClick:()=>b(v,x.label,y.multiple),children:[i.jsx("span",{className:"q-mark"+(y.multiple?" box":""),"aria-hidden":!0,children:E?"✓":""}),i.jsx("span",{className:"q-label",children:x.label}),x.description&&i.jsx("span",{className:"q-desc",children:x.description})]},x.label)})}),y.custom!==!1&&i.jsx("input",{type:"text",className:"q-custom",placeholder:"Or type your own answer…",value:h[v],onChange:x=>{const E=x.target.value;m(z=>z.map((V,L)=>L===v?E:V)),!y.multiple&&E.trim()&&f(z=>z.map((V,L)=>L===v?[]:V))},onKeyDown:x=>{x.key==="Enter"&&S&&r(g)}})]},v)),i.jsxs("div",{className:"perm-actions",children:[i.jsx("button",{className:"btn primary sm",disabled:!S,onClick:()=>r(g),children:"Send answer"}),i.jsx("button",{className:"btn sm",onClick:c,children:"Dismiss"})]})]})}const $j={build:"Edits files and runs commands. You approve each change.",plan:"Read-only. Explores the code and writes a plan."};function Vj(s,r){return[{kind:"p",text:`./bxh --project ${s} --agent ${r}`,pace:26},{kind:"out",text:"Loading project context..."},{kind:"out",text:$j[r],pace:18},{kind:"ok",text:"Agent ready ",ok:"OK"}]}const Qj=["Summarise the architecture of this project.","Find and explain the main entry points.","/init"],Zj=80;function Kj({status:s,statusError:r,directory:c,model:u,setModel:f,resume:h,onActiveSession:m,onSessionsChanged:b}){const[g,S]=N.useState("build"),[y,v]=N.useState(null),[x,E]=N.useState([]),[z,V]=N.useState([]),[L,ne]=N.useState([]),[pe,ce]=N.useState([]),[_,$]=N.useState(!1),[H,Q]=N.useState(!1),[W,re]=N.useState(null),[G,K]=N.useState(null),[Z,de]=N.useState(null),[oe,De]=N.useState([]),[ae,F]=N.useState(null),[he,P]=N.useState(!0),[_e,ot]=N.useState([]),ht=N.useRef([]),mt=N.useRef(0),T=N.useRef(!1),te=N.useRef(()=>{}),xe=N.useRef({}),Se=N.useRef(""),He=N.useRef(0),Ue=N.useRef(null),je=N.useRef(null),fe=N.useRef(!0);N.useEffect(()=>{i1(c).then(De).catch(()=>{}),RN(c,["/workspace"])},[c]);function we(){const X=je.current;if(!X)return;const ge=X.scrollHeight-X.scrollTop-X.clientHeight<Zj;fe.current=ge,P(ge)}function pt(X=!0){const ge=je.current;ge&&(fe.current=!0,P(!0),ge.scrollTo({top:ge.scrollHeight,behavior:X?"smooth":"auto"}))}N.useEffect(()=>{var X;fe.current&&((X=je.current)==null||X.scrollTo({top:je.current.scrollHeight}))},[x,z,L]);const q=N.useCallback((X,ge,Ne)=>{E(Ee=>{const Ge=Ee.slice();let Pe=Ge.findIndex(vn=>vn.id===X);Pe===-1&&(Ge.push({id:X,role:"assistant",parts:[]}),Pe=Ge.length-1);const st={...Ge[Pe],parts:Ge[Pe].parts.slice()};return Ne&&(st.subagent=Ne),ge(st),Ge[Pe]=st,Ge})},[]),Re=N.useCallback(X=>{switch(X.kind){case"message":xe.current[X.messageID]=X.role,X.role==="assistant"&&q(X.messageID,ge=>{ge.tokens=X.tokens,ge.cost=X.cost,ge.model=X.model},X.subagent);break;case"text":case"reasoning":{const ge=xe.current[X.messageID];if(ge==="user"||!ge&&X.text.trim()===Se.current.trim())break;const Ne=X.partID??`${X.kind}-${X.messageID}`;q(X.messageID,Ee=>{const Ge=Ee.parts.findIndex(st=>st.type===X.kind&&"id"in st&&st.id===Ne),Pe={type:X.kind,id:Ne,text:X.text};Ge===-1?Ee.parts.push(Pe):Ee.parts[Ge]=Pe},X.subagent);break}case"tool":q(X.messageID,ge=>{const Ne=ge.parts.findIndex(Ge=>Ge.type==="tool"&&Ge.callID===X.callID),Ee={type:"tool",callID:X.callID,tool:X.tool,status:X.status,title:X.title,input:X.input,output:X.output,error:X.error};Ne===-1?ge.parts.push(Ee):ge.parts[Ne]={...ge.parts[Ne],...Ee}},X.subagent);break;case"todo":ce(X.todos);break;case"session":b();break;case"permission":V(ge=>ge.some(Ne=>Ne.permissionID===X.permissionID)?ge:[...ge,X]);break;case"permission-replied":V(ge=>ge.filter(Ne=>Ne.permissionID!==X.permissionID));break;case"question":ne(ge=>ge.some(Ne=>Ne.requestID===X.requestID)?ge:[...ge,{requestID:X.requestID,questions:X.questions,subagent:X.subagent}]);break;case"question-closed":ne(ge=>ge.filter(Ne=>Ne.requestID!==X.requestID));break;case"idle":E(ge=>ge.map(Ij)),b(),te.current();break;case"error":re(X.message),te.current();break}},[q,b]);function Ae(){var X;(X=Ue.current)==null||X.abort(),Ue.current=null,v(null),E([]),V([]),ne([]),ce([]),re(null),K(null),$(!1),ht.current=[],C(),T.current=!1,xe.current={},fe.current=!0,P(!0)}function Be(X){var Ne;(Ne=Ue.current)==null||Ne.abort();const ge=new AbortController;Ue.current=ge,y1(X,c,Re,ge.signal,()=>Oe(X,ge)).catch(Ee=>{(Ee==null?void 0:Ee.name)!=="AbortError"&&re(String((Ee==null?void 0:Ee.message)??Ee))}),Oe(X,ge)}function Oe(X,ge){u1(X,c).then(({permissions:Ne,questions:Ee})=>{ge.signal.aborted||(Ne.length&&(V(Ge=>{const Pe=new Set(Ge.map(st=>st.permissionID));return[...Ge,...Ne.filter(st=>!Pe.has(st.permissionID))]}),$(!0)),Ee.length&&(ne(Ge=>{const Pe=new Set(Ge.map(st=>st.requestID));return[...Ge,...Ee.filter(st=>!Pe.has(st.requestID)).map(st=>({requestID:st.requestID,questions:st.questions,subagent:st.subagent}))]}),$(!0)))}).catch(()=>{})}async function se(){if(y)return y;const X=await f1(c);return v(X.id),m(X.id),Be(X.id),X.id}function be(){Ae(),m(null)}N.useEffect(()=>{if(!h)return;if(!h.id){be();return}const X=h.id;Ae(),Q(!0),l1(X,c).then(({messages:ge,todos:Ne})=>{for(const Ee of ge)xe.current[Ee.id]=Ee.role;E(ge.map(Jj)),ce(Ne??[]),v(X),m(X),Be(X),requestAnimationFrame(()=>pt(!1))}).catch(ge=>re(String(ge.message??ge))).finally(()=>Q(!1))},[h==null?void 0:h.n]);const C=()=>ot([...ht.current]);function me(X,ge=[]){if(!(!X.trim()&&!ge.length)){if(T.current){ht.current.push({id:mt.current++,text:X,files:ge}),C(),pt();return}Ke(X,ge)}}function Me(X){ht.current=ht.current.filter(ge=>ge.id!==X),C()}function lt(){if(T.current)return;const X=ht.current.shift();C(),X&&Ke(X.text,X.files)}const gt=N.useRef(!1);function Dt(){T.current=!1,$(!1),!gt.current&&(gt.current=!0,requestAnimationFrame(()=>{gt.current=!1,lt()}))}te.current=Dt;async function Ke(X,ge=[]){const Ne=X.trim();re(null),K(null),pt();const Ee=/^\/(\S+)(?:\s+([\s\S]*))?$/.exec(Ne);if(Ee&&!ge.length){await ut(Ee[1].toLowerCase(),(Ee[2]??"").trim()),T.current||lt();return}try{T.current=!0;const Ge=await se();Se.current=Ne;const Pe=`local-${He.current++}`,st=ge.map((tn,ua)=>({type:"file",id:`${Pe}-f${ua}`,filename:tn.name,mime:tn.mime,url:tn.preview,size:tn.size}));E(tn=>[...tn,{id:Pe,role:"user",parts:[...Ne?[{type:"text",id:Pe,text:Ne}]:[],...st]}]),$(!0);const vn=s==null?void 0:s.models.find(tn=>tn.id===u);await d1({sessionID:Ge,text:Ne,agent:g,model:u,directory:c,files:ge.map(({name:tn,mime:ua,data:sl})=>({name:tn,mime:ua,data:sl})),inlineImages:!!(vn!=null&&vn.images)})}catch(Ge){re(String(Ge.message??Ge)),Dt()}}async function ut(X,ge){switch(X){case"new":be();return;case"plan":case"build":S(X),K(`Switched to the ${X} agent.`);return;case"help":{const Ne=[...Dc,...oe.filter(Ee=>!Dc.some(Ge=>Ge.name===Ee.name))];K(Ne.map(Ee=>`/${Ee.name}${Ee.hint?" "+Ee.hint:""} — ${Ee.description}`).join(`
230
- `));return}case"model":{const Ne=ge.toLowerCase(),Ee=(s==null?void 0:s.models)??[],Ge=Ne&&(Ee.find(Pe=>Pe.id.toLowerCase()===Ne||Pe.name.toLowerCase()===Ne)??Ee.find(Pe=>Pe.id.toLowerCase().includes(Ne)||Pe.name.toLowerCase().includes(Ne)));if(!Ge){re(Ne?`No model matches “${ge}”.`:"Usage: /model <name>, e.g. /model kimi");return}f(Ge.id),K(`Model: ${Ge.name}`);return}case"compact":if(!y){re("Nothing to compact yet.");return}try{T.current=!0,$(!0),await o1(y,c,u),K("Compacting the conversation…")}catch(Ne){re(String(Ne.message??Ne)),Dt()}return}if(!oe.some(Ne=>Ne.name===X)){re(`Unknown command /${X}. Type / to see the list.`);return}try{const Ne=await se(),Ee=`local-${He.current++}`,Ge=`/${X}${ge?" "+ge:""}`;Se.current=Ge,E(Pe=>[...Pe,{id:Ee,role:"user",parts:[{type:"text",id:Ee,text:Ge}]}]),T.current=!0,$(!0),await r1({sessionID:Ne,command:X,arguments:ge,agent:g,model:u,directory:c})}catch(Ne){re(String(Ne.message??Ne)),Dt()}}async function Fe(X,ge){V(Ne=>Ne.filter(Ee=>Ee.permissionID!==X.permissionID));try{await h1({sessionID:X.sessionID,permissionID:X.permissionID,response:ge,directory:c})}catch(Ne){re(String(Ne.message??Ne))}}async function yn(X,ge){ne(Ne=>Ne.filter(Ee=>Ee.requestID!==X.requestID));try{await m1(ge?{requestID:X.requestID,answers:ge,directory:c}:{requestID:X.requestID,reject:!0,directory:c})}catch(Ne){re(String(Ne.message??Ne))}}async function Fn(){ht.current=[],C(),T.current=!1,$(!1),y&&await p1(y,c).catch(()=>{})}async function La(){if(!y)return;const X=await g1(y,c);de(Array.isArray(X)||typeof X=="string"?X:X?JSON.stringify(X,null,2):[])}N.useEffect(()=>()=>{var X;return(X=Ue.current)==null?void 0:X.abort()},[]);const $t=c.split(/[\\/]/).filter(Boolean).pop()??c,Ut=N.useMemo(()=>x.reduce((X,ge)=>{var Ne,Ee;return X+(((Ne=ge.tokens)==null?void 0:Ne.input)??0)+(((Ee=ge.tokens)==null?void 0:Ee.output)??0)},0),[x]),Yt=z.length>0||L.length>0;return i.jsxs("main",{className:"main",children:[i.jsxs(kr,{title:`bugxhunter@redteam: ~/${$t}`,tooltip:c,children:[i.jsxs("span",{className:"status-pill"+(_?" live":""),children:[i.jsx("span",{className:"dot"}),_?Yt?"waiting for you":"running":y?"idle":"ready"]}),Ut>0&&i.jsxs("span",{className:"token-pill",children:[Nc(Ut)," tokens"]}),i.jsx("button",{className:"btn ghost sm",onClick:La,disabled:!y,children:"changes"}),i.jsx("button",{className:"btn ghost sm",onClick:be,disabled:_,children:"new_session"})]}),i.jsxs("div",{className:"transcript-wrap",children:[i.jsx("div",{className:"transcript grid-bg",ref:je,onScroll:we,children:i.jsxs("div",{className:"transcript-inner",children:[H&&i.jsx("p",{className:"muted center mono",children:"Loading session…"}),!H&&x.length===0&&i.jsxs("div",{className:"empty-state",children:[i.jsx(bv,{lines:Vj($t,g)},`${$t}:${g}`),i.jsx("div",{className:"suggestions",children:Qj.map(X=>i.jsx("button",{className:"chip",onClick:()=>X.startsWith("/")?me(X):F(X),children:X==="/init"?"/init — create AGENTS.md, the project's memory for future sessions":X},X))}),r&&i.jsx("div",{className:"error-banner",children:r})]}),x.map(X=>i.jsx(Fj,{msg:X},X.id)),z.map(X=>i.jsxs("div",{className:"perm-card",children:[i.jsxs("div",{className:"perm-title",children:["Approval needed",X.subagent&&i.jsxs("span",{className:"perm-sub",children:["subagent · ",X.subagent]})]}),i.jsxs("div",{className:"perm-body",children:[i.jsx("span",{className:"perm-type",children:X.permType??"action"})," ",X.title??(Array.isArray(X.pattern)?X.pattern.join(", "):X.pattern)??""]}),i.jsxs("div",{className:"perm-actions",children:[i.jsx("button",{className:"btn primary sm",onClick:()=>Fe(X,"once"),children:"Approve"}),i.jsx("button",{className:"btn sm",onClick:()=>Fe(X,"always"),children:"Always allow"}),i.jsx("button",{className:"btn sm danger-outline",onClick:()=>Fe(X,"reject"),children:"Reject"})]})]},X.permissionID)),L.map(X=>i.jsx(Gj,{req:X,onAnswer:ge=>yn(X,ge),onDismiss:()=>yn(X,null)},X.requestID)),_&&!Yt&&i.jsxs("div",{className:"working",children:[i.jsx("span",{}),i.jsx("span",{}),i.jsx("span",{})]}),_e.map(X=>i.jsx("div",{className:"msg user",children:i.jsxs("div",{className:"user-col",children:[i.jsx("div",{className:"bubble user-bubble queued-bubble",children:X.text||`(${X.files.length} file${X.files.length>1?"s":""})`}),i.jsxs("div",{className:"queued-label",children:["queued · ",i.jsx("button",{className:"link-btn",onClick:()=>Me(X.id),children:"cancel"})]})]})},X.id)),G&&i.jsx("div",{className:"notice",children:G}),W&&i.jsx("div",{className:"error-banner",children:W})]})}),!he&&i.jsx("button",{className:"jump-btn",onClick:()=>pt(),"aria-label":"Scroll to latest",children:"↓ latest"})]}),i.jsxs("div",{className:"composer",children:[i.jsx(Lj,{todos:pe}),i.jsx(Mj,{agent:g,setAgent:S,model:u,setModel:f,models:(s==null?void 0:s.models)??[],commands:oe,busy:_,onSend:me,onStop:Fn,draft:ae,onDraftUsed:N.useCallback(()=>F(null),[])})]}),Z!==null&&i.jsx(Yj,{diff:Z,onClose:()=>de(null)})]})}function Ij(s){return s.parts.some(r=>r.type==="tool"&&(r.status==="running"||r.status==="pending"))?{...s,parts:s.parts.map(r=>r.type==="tool"&&(r.status==="running"||r.status==="pending")?{...r,status:"interrupted"}:r)}:s}function Jj(s){return{id:s.id,role:s.role,parts:s.parts,tokens:s.tokens,cost:s.cost,model:s.model,error:s.error,subagent:s.subagent}}function Fj({msg:s}){if(s.role==="user"){const r=s.parts.map(u=>u.type==="text"?u.text:"").join(""),c=s.parts.filter(u=>u.type==="file");return i.jsx("div",{className:"msg user",children:i.jsxs("div",{className:"user-col",children:[c.length>0&&i.jsx("div",{className:"attach-row right",children:c.map(u=>i.jsxs("span",{className:"attach-chip",title:u.filename,children:[u.url?i.jsx("img",{src:u.url,alt:""}):i.jsx("span",{className:"attach-icon",children:i.jsx(Pd,{})}),i.jsx("span",{className:"attach-name",children:u.filename}),u.size?i.jsx("span",{className:"attach-size",children:jr(u.size)}):null]},u.id))}),r&&i.jsx("div",{className:"bubble user-bubble",children:r})]})})}return!s.parts.length&&!s.error?null:i.jsxs("div",{className:"msg assistant"+(s.subagent?" subagent":""),children:[i.jsx("div",{className:"avatar","aria-hidden":!0,children:s.subagent?"↳":"▶"}),i.jsxs("div",{className:"msg-body",children:[s.subagent&&i.jsxs("div",{className:"subagent-tag",title:s.subagent,children:["subagent · ",s.subagent]}),s.parts.map((r,c)=>r.type==="tool"?i.jsx(Wj,{t:r},r.callID):r.type==="reasoning"?i.jsx(Pj,{text:r.text},r.id):r.type==="text"?i.jsx(_c,{text:r.text,files:!0},r.id):i.jsx("span",{},r.id??c)),s.error&&i.jsx("div",{className:"error-banner",children:s.error}),s.tokens&&(s.tokens.output??0)>0&&i.jsxs("div",{className:"msg-meta",children:[s.model&&i.jsx("span",{children:s.model}),i.jsxs("span",{children:[Nc(s.tokens.input??0)," in · ",Nc(s.tokens.output??0)," out"]}),s.cost?i.jsxs("span",{children:["$",s.cost.toFixed(4)]}):null]})]})]})}function Pj({text:s}){const[r,c]=N.useState(!1);return i.jsxs("div",{className:"reasoning",children:[i.jsxs("button",{className:"reasoning-toggle",onClick:()=>c(u=>!u),children:[i.jsx("span",{className:"chev"+(r?" open":""),children:"›"})," Thinking"]}),r&&i.jsx("div",{className:"reasoning-body",children:s})]})}function Wj({t:s}){const[r,c]=N.useState(!1),u=s.title||(s.input?String(Object.values(s.input)[0]??""):""),f=!!(s.output||s.error);return i.jsxs("div",{className:"tool s-"+s.status,children:[i.jsxs("button",{className:"tool-head",onClick:()=>f&&c(h=>!h),disabled:!f,children:[i.jsx("span",{className:"tool-icon",children:i.jsx(ES,{tool:s.tool})}),i.jsx("span",{className:"tool-name",children:s.tool}),i.jsx("span",{className:"tool-summary",children:u.slice(0,120)}),i.jsx("span",{className:"tool-state",children:s.status==="running"||s.status==="pending"?i.jsx("span",{className:"spin"}):s.status==="error"?"failed":s.status==="interrupted"?"interrupted":""}),f&&i.jsx("span",{className:"chev"+(r?" open":""),children:"›"})]}),r&&f&&i.jsx("pre",{className:"tool-output",children:s.error?"error: "+s.error:s.output})]})}const fv="or_playground_config",jd="or_runner",dv="or_mode",hv="or_layout",mv=320,eT=240,tT=560,nT={name:"Assistant",model:"GLM-5.3",system:"You are a helpful, concise assistant.",temperature:.7,maxTokens:4096,topP:1,jsonMode:!1,stream:!0,tools:[],useKnowledge:!1,speak:!1,saveSessions:!0};function mc(s,r){try{const c=localStorage.getItem(s);if(c)return{...r,...JSON.parse(c)}}catch{}return r}function Td(s,r){try{localStorage.setItem(s,JSON.stringify(r))}catch{}}function aT(){const[s,r]=N.useState(()=>{try{return localStorage.getItem(dv)||"runner"}catch{return"runner"}}),[c,u]=N.useState(null),[f,h]=N.useState(null),[m,b]=N.useState(()=>mc(jd,{directory:"",model:"",recent:[]}));N.useEffect(()=>{c1().then(async se=>{u(se);const be=mc(jd,{directory:"",model:"",recent:[]}).directory,C=be?await gv(be).catch(()=>se.directory):se.directory;b(me=>({...me,directory:C,model:se.models.some(Me=>Me.id===me.model)?me.model:se.defaultModel}))}).catch(se=>h(String(se.message??se)))},[]),N.useEffect(()=>Td(jd,m),[m]),N.useEffect(()=>{try{localStorage.setItem(dv,s)}catch{}},[s]);const[g,S]=N.useState(null),[y,v]=N.useState(null),[x,E]=N.useState(0),z=se=>{r("runner"),v(be=>({id:se,n:((be==null?void 0:be.n)??0)+1}))},V=N.useCallback(()=>E(se=>se+1),[]),[L,ne]=N.useState(()=>mc(hv,{width:mv,collapsed:!1}));N.useEffect(()=>Td(hv,L),[L]);const pe=()=>ne(se=>({...se,collapsed:!se.collapsed}));N.useEffect(()=>{const se=be=>{(be.ctrlKey||be.metaKey)&&be.key.toLowerCase()==="b"&&(be.preventDefault(),pe())};return window.addEventListener("keydown",se),()=>window.removeEventListener("keydown",se)},[]);function ce(se){se.preventDefault();const be=se.currentTarget;be.setPointerCapture(se.pointerId),document.body.classList.add("resizing");const C=Me=>ne(lt=>({...lt,width:Math.round(Math.min(tT,Math.max(eT,Me.clientX)))})),me=()=>{be.removeEventListener("pointermove",C),be.removeEventListener("pointerup",me),document.body.classList.remove("resizing")};be.addEventListener("pointermove",C),be.addEventListener("pointerup",me)}function _(se){S(null),v(null),b(be=>({...be,directory:se,recent:[se,...be.recent.filter(C=>C!==se)].slice(0,8)}))}function $(se){b(be=>({...be,recent:be.recent.filter(C=>C!==se)}))}const[H,Q]=N.useState(()=>{const se=mc(fv,nT);return{...se,tools:E1(se.tools??[])}}),[W,re]=N.useState([]),[G,K]=N.useState(null),[Z,de]=N.useState([]),[oe,De]=N.useState(!1),[ae,F]=N.useState(null),[he,P]=N.useState("chat"),_e=N.useRef(null);N.useEffect(()=>{Px().then(se=>{re(se),Q(be=>{var C;return se.some(me=>me.id===be.model)?be:{...be,model:((C=se[0])==null?void 0:C.id)??be.model}})}).catch(se=>K(String(se.message??se)))},[]),N.useEffect(()=>Td(fv,H),[H]);const ot=N.useMemo(()=>W.find(se=>se.id===H.model),[W,H.model]),[ht,mt]=N.useState(null),[T,te]=N.useState(null),[xe,Se]=N.useState(null),He=N.useRef(null),Ue=N.useRef(null),je=N.useCallback(()=>{yc("chat").then(se=>te(se)).catch(se=>Se({ok:!1,text:String(se.message??se)}))},[]);N.useEffect(()=>{s==="playground"&&je()},[s,je]),N.useEffect(()=>{var me,Me,lt;if(oe||!H.saveSessions||Z===He.current)return;const se=Z.find(gt=>gt.role==="user");if(!se)return;He.current=Z;const be=Ue.current??br();Ue.current=be,mt(be);const C=(((me=se.content)==null?void 0:me.trim())||((Me=se.docs)!=null&&Me.length?`Diagram review: ${se.docs[0].name}`:(lt=se.images)!=null&&lt.length?"Image review":"Chat")).replace(/\s+/g," ").slice(0,80);vc("chat",be,C,{v:1,model:H.model,system:H.system,messages:Z}).then(()=>{Se({ok:!0,text:"Saved, encrypted with your vault"}),je()}).catch(gt=>Se({ok:!1,text:`Not saved: ${String(gt.message??gt)}`}))},[oe,Z,H.saveSessions,H.model,H.system,je]);async function fe(se){var be;if(!oe)try{const C=await Ld("chat",se),me=Array.isArray((be=C.body)==null?void 0:be.messages)?C.body.messages:[];He.current=me,Ue.current=se,mt(se),de(me),F(null),P("chat"),Q(Me=>({...Me,...C.body.model&&W.some(lt=>lt.id===C.body.model)?{model:C.body.model}:{},...typeof C.body.system=="string"?{system:C.body.system}:{}}))}catch(C){Se({ok:!1,text:String(C.message??C)})}}async function we(se){try{await Wv("chat",se),Ue.current===se&&Oe(),je()}catch(be){Se({ok:!1,text:String(be.message??be)})}}function pt(se){var C;const be=[];H.system.trim()&&be.push({role:"system",content:H.system});for(const me of se)me.role==="assistant"&&((C=me.tool_calls)!=null&&C.length)?be.push({role:"assistant",content:me.content??"",tool_calls:me.tool_calls}):me.role==="tool"?be.push({role:"tool",content:me.content,tool_call_id:me.tool_call_id}):be.push({role:me.role,content:me.role==="user"?dh(me.content,me.images,me.docs):me.content});return be}async function q(se){De(!0),F(null);const be=new AbortController;_e.current=be;const C=se.length;de([...se,{role:"assistant",content:""}]);const me=H.tools.length?k1(H.tools):void 0;let Me="";const lt=performance.now();let gt;const Dt=()=>de(Ke=>{const ut=[...Ke],Fe=ut[C];return Fe&&(ut[C]={...Fe,timing:{ttft:gt,total:performance.now()-lt}}),ut});await Yd({model:H.model,messages:pt(se),temperature:H.temperature,top_p:H.topP,max_tokens:H.maxTokens,tools:me,response_format:H.jsonMode?{type:"json_object"}:void 0,rag:H.useKnowledge,stream:H.stream},{signal:be.signal,onDelta:Ke=>{gt??(gt=performance.now()-lt),Me+=Ke,de(ut=>{const Fe=[...ut],yn=Fe[C];return Fe[C]={...yn,content:(yn.content??"")+Ke},Fe})},onToolCalls:Ke=>de(ut=>{const Fe=[...ut];return Fe[C]={...Fe[C],tool_calls:Ke},Fe}),onSources:Ke=>de(ut=>{const Fe=[...ut];return Fe[C]={...Fe[C],sources:Ke},Fe}),onUsage:Ke=>de(ut=>{const Fe=[...ut];return Fe[C]={...Fe[C],usage:Ke},Fe}),onError:Ke=>F(Ke),onDone:()=>{Dt(),H.speak&&Me.trim()&&_1(Me)}}).catch(Ke=>{(Ke==null?void 0:Ke.name)!=="AbortError"&&F(String((Ke==null?void 0:Ke.message)??Ke))}),De(!1),_e.current=null}function Re(se,be,C){if(!se.trim()&&!(be!=null&&be.length)&&!(C!=null&&C.length)||oe)return;const me=[...Z,{role:"user",content:se,...be!=null&&be.length?{images:be}:{},...C!=null&&C.length?{docs:C}:{}}];de(me),q(me)}function Ae(se,be){const C=[...Z,{role:"tool",tool_call_id:se.id,content:be}];de(C),q(C)}function Be(){var se;(se=_e.current)==null||se.abort(),C1(),De(!1)}function Oe(){Be(),de([]),F(null),Ue.current=null,mt(null),He.current=null}return i.jsxs("div",{className:"app"+(L.collapsed?" collapsed":""),style:{"--sidebar-w":`${L.width}px`},children:[L.collapsed&&i.jsx("button",{className:"sidebar-toggle floating",onClick:pe,title:"Show sidebar (Ctrl+B)","aria-label":"Show sidebar",children:"»"}),i.jsx(XS,{onCollapse:pe,sessions:{active:g,version:x,open:z},mode:s,setMode:r,runner:m,status:c,statusError:f,onOpenDirectory:_,onForgetDirectory:$,config:H,setConfig:Q,models:W,modelError:G,activeModel:ot,onReset:Oe,saved:{list:T,activeId:ht,status:xe,onOpen:se=>void fe(se),onDelete:se=>void we(se)}}),i.jsx("div",{className:"splitter",role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize · double-click to reset",onPointerDown:ce,onDoubleClick:()=>ne(se=>({...se,width:mv}))}),s==="runner"?m.directory?i.jsx(Kj,{status:c,statusError:f,directory:m.directory,model:m.model||(c==null?void 0:c.defaultModel)||"",setModel:se=>b(be=>({...be,model:se})),resume:y,onActiveSession:S,onSessionsChanged:V},m.directory):i.jsx("main",{className:"main",children:i.jsx("div",{className:"transcript grid-bg",children:i.jsx("div",{className:"empty-state center",children:f?i.jsx("div",{className:"error-banner",children:f}):i.jsx("p",{className:"muted mono",children:"Starting OpenCode…"})})})}):he==="compare"?i.jsx(nj,{config:H,models:W,onExit:()=>P("chat")}):he==="canvas"?i.jsx(Aj,{config:H,models:W,onExit:()=>P("chat")}):i.jsx(JN,{config:H,activeModel:ot,messages:Z,busy:oe,error:ae,onSend:Re,onStop:Be,onReset:Oe,onToolResult:Ae,onCompare:()=>P("compare"),onCanvas:()=>P("canvas")})]})}const lT=window.fetch.bind(window);window.fetch=async(s,r)=>{const c=await lT(s,r),u=typeof s=="string"?s:s instanceof URL?s.pathname:s.url;return c.status===401&&u.startsWith("/api/")&&!u.startsWith("/api/auth/")&&c.headers.get("WWW-Authenticate")==="BXH-Passkey"&&window.dispatchEvent(new Event(_d)),c};Fx.createRoot(document.getElementById("root")).render(i.jsx(Gx.StrictMode,{children:i.jsx(W1,{children:i.jsx(aT,{})})}));