bugxhunter 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +23 -0
- package/README.md +97 -0
- package/docker-compose.yml +20 -0
- package/package.json +4 -1
- package/server/dist/bedrock.js +288 -0
- package/server/dist/index.js +15 -5
- package/server/dist/opencode.js +4 -3
- package/server/dist/providers.js +136 -9
- package/server/dist/recon.js +1 -1
- package/server/dist/scx.js +24 -15
- package/server/dist/vault.js +7 -0
- package/web/dist/assets/index-BSAL7ncz.js +303 -0
- package/web/dist/index.html +1 -1
- package/web/dist/assets/index-CBhVvqRv.js +0 -299
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
var rS=Object.defineProperty;var Ny=l=>{throw TypeError(l)};var cS=(l,o,c)=>o in l?rS(l,o,{enumerable:!0,configurable:!0,writable:!0,value:c}):l[o]=c;var kt=(l,o,c)=>cS(l,typeof o!="symbol"?o+"":o,c),uS=(l,o,c)=>o.has(l)||Ny("Cannot "+c);var Ey=(l,o,c)=>o.has(l)?Ny("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(l):o.set(l,c);var Cy=(l,o,c)=>(uS(l,o,"access private method"),c);(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))u(d);new MutationObserver(d=>{for(const h of d)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(d){const h={};return d.integrity&&(h.integrity=d.integrity),d.referrerPolicy&&(h.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?h.credentials="include":d.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function u(d){if(d.ep)return;d.ep=!0;const h=c(d);fetch(d.href,h)}})();function _v(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var vf={exports:{}},go={};/**
|
|
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 My;function dS(){if(My)return go;My=1;var l=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function c(u,d,h){var m=null;if(h!==void 0&&(m=""+h),d.key!==void 0&&(m=""+d.key),"key"in d){h={};for(var b in d)b!=="key"&&(h[b]=d[b])}else h=d;return d=h.ref,{$$typeof:l,type:u,key:m,ref:d!==void 0?d:null,props:h}}return go.Fragment=o,go.jsx=c,go.jsxs=c,go}var _y;function fS(){return _y||(_y=1,vf.exports=dS()),vf.exports}var i=fS(),bf={exports:{}},Ve={};/**
|
|
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 Ry;function hS(){if(Ry)return Ve;Ry=1;var l=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),m=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),S=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),x=Symbol.for("react.view_transition"),k=Symbol.iterator;function O(j){return j===null||typeof j!="object"?null:(j=k&&j[k]||j["@@iterator"],typeof j=="function"?j:null)}var Y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},B=Object.assign,te={};function re(j,ne,Te){this.props=j,this.context=ne,this.refs=te,this.updater=Te||Y}re.prototype.isReactComponent={},re.prototype.setState=function(j,ne){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,ne,"setState")},re.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function fe(){}fe.prototype=re.prototype;function E(j,ne,Te){this.props=j,this.context=ne,this.refs=te,this.updater=Te||Y}var G=E.prototype=new fe;G.constructor=E,B(G,re.prototype),G.isPureReactComponent=!0;var U=Array.isArray;function V(){}var J={H:null,A:null,T:null,S:null},oe=Object.prototype.hasOwnProperty;function X(j,ne,Te){var ye=Te.ref;return{$$typeof:l,type:j,key:ne,ref:ye!==void 0?ye:null,props:Te}}function K(j,ne){return X(j.type,ne,j.props)}function Q(j){return typeof j=="object"&&j!==null&&j.$$typeof===l}function me(j){var ne={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(Te){return ne[Te]})}var ce=/\/+/g;function Ce(j,ne){return typeof j=="object"&&j!==null&&j.key!=null?me(""+j.key):ne.toString(36)}function ae(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(V,V):(j.status="pending",j.then(function(ne){j.status==="pending"&&(j.status="fulfilled",j.value=ne)},function(ne){j.status==="pending"&&(j.status="rejected",j.reason=ne)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function W(j,ne,Te,ye,Ie){var Oe=typeof j;(Oe==="undefined"||Oe==="boolean")&&(j=null);var Ne=!1;if(j===null)Ne=!0;else switch(Oe){case"bigint":case"string":case"number":Ne=!0;break;case"object":switch(j.$$typeof){case l:case o:Ne=!0;break;case g:return Ne=j._init,W(Ne(j._payload),ne,Te,ye,Ie)}}if(Ne)return Ie=Ie(j),Ne=ye===""?"."+Ce(j,0):ye,U(Ie)?(Te="",Ne!=null&&(Te=Ne.replace(ce,"$&/")+"/"),W(Ie,ne,Te,"",function(gt){return gt})):Ie!=null&&(Q(Ie)&&(Ie=K(Ie,Te+(Ie.key==null||j&&j.key===Ie.key?"":(""+Ie.key).replace(ce,"$&/")+"/")+Ne)),ne.push(Ie)),1;Ne=0;var he=ye===""?".":ye+":";if(U(j))for(var be=0;be<j.length;be++)ye=j[be],Oe=he+Ce(ye,be),Ne+=W(ye,ne,Te,Oe,Ie);else if(be=O(j),typeof be=="function")for(j=be.call(j),be=0;!(ye=j.next()).done;)ye=ye.value,Oe=he+Ce(ye,be++),Ne+=W(ye,ne,Te,Oe,Ie);else if(Oe==="object"){if(typeof j.then=="function")return W(ae(j),ne,Te,ye,Ie);throw ne=String(j),Error("Objects are not valid as a React child (found: "+(ne==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":ne)+"). If you meant to render a collection of children, use an array instead.")}return Ne}function pe(j,ne,Te){if(j==null)return j;var ye=[],Ie=0;return W(j,ye,"","",function(Oe){return ne.call(Te,Oe,Ie++)}),ye}function F(j){if(j._status===-1){var ne=j._result,Te=ne();Te.then(function(ye){(j._status===0||j._status===-1)&&(j._status=1,j._result=ye,Te.status===void 0&&(Te.status="fulfilled",Te.value=ye))},function(ye){(j._status===0||j._status===-1)&&(j._status=2,j._result=ye,Te.status===void 0&&(Te.status="rejected",Te.reason=ye))}),j._status===-1&&(j._status=0,j._result=Te)}if(j._status===1)return j._result.default;throw j._result}var we=typeof reportError=="function"?reportError:function(j){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ne=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j=="object"&&j!==null&&typeof j.message=="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(ne))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",j);return}console.error(j)};function nt(j){var ne=J.T,Te={};Te.types=ne!==null?ne.types:null,J.T=Te;try{var ye=j(),Ie=J.S;Ie!==null&&Ie(Te,ye),typeof ye=="object"&&ye!==null&&typeof ye.then=="function"&&ye.then(V,we)}catch(Oe){we(Oe)}finally{ne!==null&&Te.types!==null&&(ne.types=Te.types),J.T=ne}}function Lt(j){var ne=J.T;if(ne!==null){var Te=ne.types;Te===null?ne.types=[j]:Te.indexOf(j)===-1&&Te.push(j)}else nt(Lt.bind(null,j))}var mt={map:pe,forEach:function(j,ne,Te){pe(j,function(){ne.apply(this,arguments)},Te)},count:function(j){var ne=0;return pe(j,function(){ne++}),ne},toArray:function(j){return pe(j,function(ne){return ne})||[]},only:function(j){if(!Q(j))throw Error("React.Children.only expected to receive a single React element child.");return j}};return Ve.Activity=v,Ve.Children=mt,Ve.Component=re,Ve.Fragment=c,Ve.Profiler=d,Ve.PureComponent=E,Ve.StrictMode=u,Ve.Suspense=y,Ve.ViewTransition=x,Ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=J,Ve.__COMPILER_RUNTIME={__proto__:null,c:function(j){return J.H.useMemoCache(j)}},Ve.addTransitionType=Lt,Ve.cache=function(j){return function(){return j.apply(null,arguments)}},Ve.cacheSignal=function(){return null},Ve.cloneElement=function(j,ne,Te){if(j==null)throw Error("The argument must be a React element, but you passed "+j+".");var ye=B({},j.props),Ie=j.key;if(ne!=null)for(Oe in ne.key!==void 0&&(Ie=""+ne.key),ne)!oe.call(ne,Oe)||Oe==="key"||Oe==="__self"||Oe==="__source"||Oe==="ref"&&ne.ref===void 0||(ye[Oe]=ne[Oe]);var Oe=arguments.length-2;if(Oe===1)ye.children=Te;else if(1<Oe){for(var Ne=Array(Oe),he=0;he<Oe;he++)Ne[he]=arguments[he+2];ye.children=Ne}return X(j.type,Ie,ye)},Ve.createContext=function(j){return j={$$typeof:m,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:h,_context:j},j},Ve.createElement=function(j,ne,Te){var ye,Ie={},Oe=null;if(ne!=null)for(ye in ne.key!==void 0&&(Oe=""+ne.key),ne)oe.call(ne,ye)&&ye!=="key"&&ye!=="__self"&&ye!=="__source"&&(Ie[ye]=ne[ye]);var Ne=arguments.length-2;if(Ne===1)Ie.children=Te;else if(1<Ne){for(var he=Array(Ne),be=0;be<Ne;be++)he[be]=arguments[be+2];Ie.children=he}if(j&&j.defaultProps)for(ye in Ne=j.defaultProps,Ne)Ie[ye]===void 0&&(Ie[ye]=Ne[ye]);return X(j,Oe,Ie)},Ve.createRef=function(){return{current:null}},Ve.forwardRef=function(j){return{$$typeof:b,render:j}},Ve.isValidElement=Q,Ve.lazy=function(j){return{$$typeof:g,_payload:{_status:-1,_result:j},_init:F}},Ve.memo=function(j,ne){return{$$typeof:S,type:j,compare:ne===void 0?null:ne}},Ve.startTransition=nt,Ve.unstable_useCacheRefresh=function(){return J.H.useCacheRefresh()},Ve.use=function(j){return J.H.use(j)},Ve.useActionState=function(j,ne,Te){return J.H.useActionState(j,ne,Te)},Ve.useCallback=function(j,ne){return J.H.useCallback(j,ne)},Ve.useContext=function(j){return J.H.useContext(j)},Ve.useDebugValue=function(){},Ve.useDeferredValue=function(j,ne){return J.H.useDeferredValue(j,ne)},Ve.useEffect=function(j,ne){return J.H.useEffect(j,ne)},Ve.useEffectEvent=function(j){return J.H.useEffectEvent(j)},Ve.useId=function(){return J.H.useId()},Ve.useImperativeHandle=function(j,ne,Te){return J.H.useImperativeHandle(j,ne,Te)},Ve.useInsertionEffect=function(j,ne){return J.H.useInsertionEffect(j,ne)},Ve.useLayoutEffect=function(j,ne){return J.H.useLayoutEffect(j,ne)},Ve.useMemo=function(j,ne){return J.H.useMemo(j,ne)},Ve.useOptimistic=function(j,ne){return J.H.useOptimistic(j,ne)},Ve.useReducer=function(j,ne,Te){return J.H.useReducer(j,ne,Te)},Ve.useRef=function(j){return J.H.useRef(j)},Ve.useState=function(j){return J.H.useState(j)},Ve.useSyncExternalStore=function(j,ne,Te){return J.H.useSyncExternalStore(j,ne,Te)},Ve.useTransition=function(){return J.H.useTransition()},Ve.version="19.3.0",Ve}var Oy;function Wf(){return Oy||(Oy=1,bf.exports=hS()),bf.exports}var A=Wf();const mS=_v(A);var xf={exports:{}},yo={},Sf={exports:{}},wf={};/**
|
|
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 Dy;function pS(){return Dy||(Dy=1,(function(l){function o(ae,W){var pe=ae.length;ae.push(W);e:for(;0<pe;){var F=pe-1>>>1,we=ae[F];if(0<d(we,W))ae[F]=W,ae[pe]=we,pe=F;else break e}}function c(ae){return ae.length===0?null:ae[0]}function u(ae){if(ae.length===0)return null;var W=ae[0],pe=ae.pop();if(pe!==W){ae[0]=pe;e:for(var F=0,we=ae.length,nt=we>>>1;F<nt;){var Lt=2*(F+1)-1,mt=ae[Lt],j=Lt+1,ne=ae[j];if(0>d(mt,pe))j<we&&0>d(ne,mt)?(ae[F]=ne,ae[j]=pe,F=j):(ae[F]=mt,ae[Lt]=pe,F=Lt);else if(j<we&&0>d(ne,pe))ae[F]=ne,ae[j]=pe,F=j;else break e}}return W}function d(ae,W){var pe=ae.sortIndex-W.sortIndex;return pe!==0?pe:ae.id-W.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;l.unstable_now=function(){return h.now()}}else{var m=Date,b=m.now();l.unstable_now=function(){return m.now()-b}}var y=[],S=[],g=1,v=null,x=3,k=!1,O=!1,Y=!1,B=!1,te=typeof setTimeout=="function"?setTimeout:null,re=typeof clearTimeout=="function"?clearTimeout:null,fe=typeof setImmediate<"u"?setImmediate:null;function E(ae){for(var W=c(S);W!==null;){if(W.callback===null)u(S);else if(W.startTime<=ae)u(S),W.sortIndex=W.expirationTime,o(y,W);else break;W=c(S)}}function G(ae){if(Y=!1,E(ae),!O)if(c(y)!==null)O=!0,U||(U=!0,Q());else{var W=c(S);W!==null&&Ce(G,W.startTime-ae)}}var U=!1,V=-1,J=5,oe=-1;function X(){return B?!0:!(l.unstable_now()-oe<J)}function K(){if(B=!1,U){var ae=l.unstable_now();oe=ae;var W=!0;try{e:{O=!1,Y&&(Y=!1,re(V),V=-1),k=!0;var pe=x;try{t:{for(E(ae),v=c(y);v!==null&&!(v.expirationTime>ae&&X());){var F=v.callback;if(typeof F=="function"){v.callback=null,x=v.priorityLevel;var we=F(v.expirationTime<=ae);if(ae=l.unstable_now(),typeof we=="function"){v.callback=we,E(ae),W=!0;break t}v===c(y)&&u(y),E(ae)}else u(y);v=c(y)}if(v!==null)W=!0;else{var nt=c(S);nt!==null&&Ce(G,nt.startTime-ae),W=!1}}break e}finally{v=null,x=pe,k=!1}W=void 0}}finally{W?Q():U=!1}}}var Q;if(typeof fe=="function")Q=function(){fe(K)};else if(typeof MessageChannel<"u"){var me=new MessageChannel,ce=me.port2;me.port1.onmessage=K,Q=function(){ce.postMessage(null)}}else Q=function(){te(K,0)};function Ce(ae,W){V=te(function(){ae(l.unstable_now())},W)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(ae){ae.callback=null},l.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"):J=0<ae?Math.floor(1e3/ae):5},l.unstable_getCurrentPriorityLevel=function(){return x},l.unstable_next=function(ae){switch(x){case 1:case 2:case 3:var W=3;break;default:W=x}var pe=x;x=W;try{return ae()}finally{x=pe}},l.unstable_requestPaint=function(){B=!0},l.unstable_runWithPriority=function(ae,W){switch(ae){case 1:case 2:case 3:case 4:case 5:break;default:ae=3}var pe=x;x=ae;try{return W()}finally{x=pe}},l.unstable_scheduleCallback=function(ae,W,pe){var F=l.unstable_now();switch(typeof pe=="object"&&pe!==null?(pe=pe.delay,pe=typeof pe=="number"&&0<pe?F+pe:F):pe=F,ae){case 1:var we=-1;break;case 2:we=250;break;case 5:we=1073741823;break;case 4:we=1e4;break;default:we=5e3}return we=pe+we,ae={id:g++,callback:W,priorityLevel:ae,startTime:pe,expirationTime:we,sortIndex:-1},pe>F?(ae.sortIndex=pe,o(S,ae),c(y)===null&&ae===c(S)&&(Y?(re(V),V=-1):Y=!0,Ce(G,pe-F))):(ae.sortIndex=we,o(y,ae),O||k||(O=!0,U||(U=!0,Q()))),ae},l.unstable_shouldYield=X,l.unstable_wrapCallback=function(ae){var W=x;return function(){var pe=x;x=W;try{return ae.apply(this,arguments)}finally{x=pe}}}})(wf)),wf}var Ly;function gS(){return Ly||(Ly=1,Sf.exports=pS()),Sf.exports}var Af={exports:{}},pn={};/**
|
|
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 zy;function yS(){if(zy)return pn;zy=1;var l=Wf();function o(g){var v="https://react.dev/errors/"+g;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 #"+g+"; 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(o(522))},D:c,C:c,L:c,m:c,X:c,S:c,M:c},p:0,findDOMNode:null},d=Symbol.for("react.portal"),h=Symbol.for("react.recoverable"),m=Symbol.for("react.optimistic_key");function b(g,v,x){var k=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:k==null?null:k===m?m:""+k,children:g,containerInfo:v,implementation:x}}var y=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function S(g,v){if(g==="font")return"";if(typeof v=="string")return v==="use-credentials"?v:""}return pn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,pn.browser=function(g){return{$$typeof:h,_reason:g}},pn.createPortal=function(g,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(o(299));return b(g,v,null,x)},pn.flushSync=function(g){var v=y.T,x=u.p;try{if(y.T=null,u.p=2,g)return g()}finally{y.T=v,u.p=x,u.d.f()}},pn.preconnect=function(g,v){typeof g=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,u.d.C(g,v))},pn.prefetchDNS=function(g){typeof g=="string"&&u.d.D(g)},pn.preinit=function(g,v){if(typeof g=="string"&&v&&typeof v.as=="string"){var x=v.as,k=S(x,v.crossOrigin),O=typeof v.integrity=="string"?v.integrity:void 0,Y=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;x==="style"?u.d.S(g,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:k,integrity:O,fetchPriority:Y}):x==="script"&&u.d.X(g,{crossOrigin:k,integrity:O,fetchPriority:Y,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},pn.preinitModule=function(g,v){if(typeof g=="string")if(typeof v=="object"&&v!==null){if(v.as==null||v.as==="script"){var x=S(v.as,v.crossOrigin);u.d.M(g,{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(g)},pn.preload=function(g,v){if(typeof g=="string"&&typeof v=="object"&&v!==null&&typeof v.as=="string"){var x=v.as,k=S(x,v.crossOrigin);u.d.L(g,x,{crossOrigin:k,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})}},pn.preloadModule=function(g,v){if(typeof g=="string")if(v){var x=S(v.as,v.crossOrigin);u.d.m(g,{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(g)},pn.requestFormReset=function(g){u.d.r(g)},pn.unstable_batchedUpdates=function(g,v){return g(v)},pn.useFormState=function(g,v,x){return y.H.useFormState(g,v,x)},pn.useFormStatus=function(){return y.H.useHostTransitionStatus()},pn.version="19.3.0",pn}var Uy;function vS(){if(Uy)return Af.exports;Uy=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(o){console.error(o)}}return l(),Af.exports=yS(),Af.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 Hy;function bS(){if(Hy)return yo;Hy=1;var l=gS(),o=Wf(),c=vS();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 d(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 y(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 s=n.return;if(s===null)break;var r=s.alternate;if(r===null){if(a=s.return,a!==null){n=a;continue}break}if(s.child===r.child){for(r=s.child;r;){if(r===n)return y(s),e;if(r===a)return y(s),t;r=r.sibling}throw Error(u(188))}if(n.return!==a.return)n=s,a=r;else{for(var f=!1,p=s.child;p;){if(p===n){f=!0,n=s,a=r;break}if(p===a){f=!0,a=s,n=r;break}p=p.sibling}if(!f){for(p=r.child;p;){if(p===n){f=!0,n=r,a=s;break}if(p===a){f=!0,a=r,n=s;break}p=p.sibling}if(!f)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 g(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=g(e),t!==null)return t;e=e.sibling}return null}function v(e,t,n,a,s,r){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,a,s,r)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&v(e.child,t,n,a,s,r))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 k(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 O(e){var t=[null,null],n=x(e);return n===null||Y(t,e,n.child,{foundSelf:!1}),t}function Y(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)&&Y(e,t,n.child,a))return!0;n=n.sibling}return!1}function B(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 te=null,re=null;function fe(e,t,n){return e===n?!0:e===t?(te=e,!0):!1}function E(e,t,n){return e===n?(re=e,!1):e===t?(re!==null&&(te=e),!0):!1}function G(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 U(e,t,n){for(var a=0,s=e;s;s=n(s))a++;s=0;for(var r=t;r;r=n(r))s++;for(;0<a-s;)e=n(e),a--;for(;0<s-a;)t=n(t),s--;for(;a--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var V=Object.assign,J=Symbol.for("react.element"),oe=Symbol.for("react.transitional.element"),X=Symbol.for("react.portal"),K=Symbol.for("react.fragment"),Q=Symbol.for("react.strict_mode"),me=Symbol.for("react.profiler"),ce=Symbol.for("react.consumer"),Ce=Symbol.for("react.context"),ae=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),pe=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),we=Symbol.for("react.lazy"),nt=Symbol.for("react.activity"),Lt=Symbol.for("react.legacy_hidden"),mt=Symbol.for("react.memo_cache_sentinel"),j=Symbol.for("react.view_transition"),ne=Symbol.for("react.recoverable"),Te=Symbol.iterator;function ye(e){return e===null||typeof e!="object"?null:(e=Te&&e[Te]||e["@@iterator"],typeof e=="function"?e:null)}var Ie=Symbol.for("react.client.reference");function Oe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ie?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case K:return"Fragment";case me:return"Profiler";case Q:return"StrictMode";case W:return"Suspense";case pe:return"SuspenseList";case nt:return"Activity";case j:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case X:return"Portal";case Ce:return e.displayName||"Context";case ce: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 F:return t=e.displayName||null,t!==null?t:Oe(e.type)||"Memo";case we:t=e._payload,e=e._init;try{return Oe(e(t))}catch{}}return null}var Ne=Array.isArray,he=o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,be=c.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,gt={pending:!1,data:null,method:null,action:null},H=[],Me=-1;function ke(e){return{current:e}}function Be(e){0>Me||(e.current=H[Me],H[Me]=null,Me--)}function _e(e,t){Me++,H[Me]=e.current,e.current=t}var le=ke(null),Se=ke(null),xe=ke(null),Xe=ke(null);function $(e,t){switch(_e(xe,t),_e(Se,e),_e(le,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?zg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=zg(t),e=Ug(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Be(le),_e(le,e)}function De(){Be(le),Be(Se),Be(xe)}function Le(e){var t=e.memoizedState;t!==null&&(ui._currentValue=t.memoizedState,_e(Xe,e)),t=le.current;var n=Ug(t,e.type);t!==n&&(_e(Se,e),_e(le,n))}function dt(e){Se.current===e&&(Be(le),Be(Se)),Xe.current===e&&(Be(Xe),ui._currentValue=gt)}var Ze,ft;function Ke(e){if(Ze===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ze=t&&t[1]||"",ft=-1<n.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Ze+e+ft}var $t=!1;function Fn(e,t){if(!e||$t)return"";$t=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var P=function(){throw Error()};if(Object.defineProperty(P.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(P,[])}catch(ge){var M=ge}Reflect.construct(e,[],P)}else{try{P.call()}catch(ge){M=ge}P=!1;try{var I=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),P=!0,new e}finally{P&&(I!==void 0?Object.defineProperty(e.prototype,"props",I):delete e.prototype.props)}}}else{try{throw Error()}catch(ge){M=ge}(P=e())&&typeof P.catch=="function"&&P.catch(function(){})}}catch(ge){if(ge&&M&&typeof ge.stack=="string")return[ge.stack,M.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=a.DetermineComponentFrameRoot(),f=r[0],p=r[1];if(f&&p){var T=f.split(`
|
|
44
|
-
`),R=p.split(`
|
|
45
|
-
`);for(s=a=0;a<T.length&&!T[a].includes("DetermineComponentFrameRoot");)a++;for(;s<R.length&&!R[s].includes("DetermineComponentFrameRoot");)s++;if(a===T.length||s===R.length)for(a=T.length-1,s=R.length-1;1<=a&&0<=s&&T[a]!==R[s];)s--;for(;1<=a&&0<=s;a--,s--)if(T[a]!==R[s]){if(a!==1||s!==1)do if(a--,s--,0>s||T[a]!==R[s]){var q=`
|
|
46
|
-
`+T[a].replace(" at new "," at ");return e.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",e.displayName)),q}while(1<=a&&0<=s);break}}}finally{$t=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Ke(n):""}function Ta(e,t){switch(e.tag){case 26:case 27:case 5:return Ke(e.type);case 16:return Ke("Lazy");case 13:return e.child!==t&&t!==null?Ke("Suspense Fallback"):Ke("Suspense");case 19:return Ke("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 Ke("Activity");case 30:return Ke("ViewTransition");default:return""}}function Xt(e){try{var t="",n=null;do t+=Ta(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
|
|
47
|
-
Error generating stack: `+a.message+`
|
|
48
|
-
`+a.stack}}var Rt=Object.prototype.hasOwnProperty,Bt=l.unstable_scheduleCallback,ka=l.unstable_cancelCallback,ua=l.unstable_shouldYield,da=l.unstable_requestPaint,Ot=l.unstable_now,ja=l.unstable_getCurrentPriorityLevel,cn=l.unstable_ImmediatePriority,vn=l.unstable_UserBlockingPriority,Un=l.unstable_NormalPriority,z=l.unstable_LowPriority,de=l.unstable_IdlePriority,Ae=l.log,Ue=l.unstable_setDisableYieldValue,Ye=null,qe=null;function Qe(e){if(typeof Ae=="function"&&Ue(e),qe&&typeof qe.setStrictMode=="function")try{qe.setStrictMode(Ye,e)}catch{}}var yt=Math.clz32?Math.clz32:ee,Jt=Math.log,N=Math.LN2;function ee(e){return e>>>=0,e===0?32:31-(Jt(e)/N|0)|0}var ve=256,je=262144,We=4194304;function et(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 s=0,r=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var p=a&134217727;return p!==0?(a=p&~r,a!==0?s=et(a):(f&=p,f!==0?s=et(f):n||(n=p&~e,n!==0&&(s=et(n))))):(p=a&~r,p!==0?s=et(p):f!==0?s=et(f):n||(n=a&~e,n!==0&&(s=et(n)))),s===0?0:t!==0&&t!==s&&(t&r)===0&&(r=s&-s,n=t&-t,r>=n||r===32&&(n&4194048)!==0)?t:s}function Nt(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-yt(n),s=1<<a;t|=e[a],n&=~s}return t}function Na(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 At(){var e=We;return We<<=1,(We&62914560)===0&&(We=4194304),e}function En(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Jn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ns(e,t,n,a,s,r){var f=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,T=e.expirationTimes,R=e.hiddenUpdates;for(n=f&~n;0<n;){var q=31-yt(n),P=1<<q;p[q]=0,T[q]=-1;var M=R[q];if(M!==null)for(R[q]=null,q=0;q<M.length;q++){var I=M[q];I!==null&&(I.lane&=-536870913)}n&=~P}a!==0&&fa(e,a,0),r!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=r&~(f&~t))}function fa(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-yt(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function Ga(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-yt(n),s=1<<a;s&t|e[a]&t&&(e[a]|=t),n&=~s}}function Kl(e,t){var n=t&-t;return n=(n&42)!==0?1:dl(n),(n&(e.suspendedLanes|t))!==0?0:n}function dl(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 fl(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function hl(){var e=be.p;return e!==0?e:(e=window.event,e===void 0?32:xy(e.type))}function $o(e,t){var n=be.p;try{return be.p=e,t()}finally{be.p=n}}var an=Math.random().toString(36).slice(2),Yt="__reactFiber$"+an,Wt="__reactProps$"+an,Cn="__reactContainer$"+an,Xo="__reactEvents$"+an,Es="__reactListeners$"+an,Yo="__reactHandles$"+an,Vo="__reactResources$"+an,ml="__reactMarker$"+an,Zl="__reactLoad$"+an;function $a(e){delete e[Yt],delete e[Wt],delete e[Es],delete e[Yo]}function ha(e){var t;if(t=e[Yt])return t;for(var n=e.parentNode;n;){if(t=n[Cn]||n[Yt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ey(e);e!==null;){if(n=e[Yt])return n;e=ey(e)}return t}e=n,n=e.parentNode}return null}function ma(e){if(e=e[Yt]||e[Cn]){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[Vo];return t||(t=e[Vo]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function vt(e){e[ml]=!0}function Qo(e){e[Zl]=void 0}var Pl=new Set,Ko={};function Ea(e,t){Hn(e,t),Hn(e+"Capture",t)}function Hn(e,t){for(Ko[e]=t,e=0;e<t.length;e++)Pl.add(t[e])}var Zo=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]*$"),ji={},Po={};function Fo(e){return Rt.call(Po,e)?!0:Rt.call(ji,e)?!1:Zo.test(e)?Po[e]=!0:(ji[e]=!0,!1)}var rt=!1;function Jo(){var e=rt;return rt=!1,e}function Fl(e,t,n){if(Fo(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 Xa(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 In(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 se(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 D(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 s=a.get,r=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(f){n=""+f,r.call(this,f)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(f){n=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ie(e){if(!e._valueTracker){var t=w(e)?"checked":"value";e._valueTracker=D(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 He=/[\n"\\]/g;function Ge(e){return e.replace(He,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function at(e,t,n,a,s,r,f,p){e.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.type=f:e.removeAttribute("type"),t!=null?f==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+se(t)):e.value!==""+se(t)&&(e.value=""+se(t)):f!=="submit"&&f!=="reset"||e.removeAttribute("value"),t!=null?f==="number"&&e.value==t?xn(e,se(e.value)):xn(e,se(t)):n!=null?xn(e,se(n)):a!=null&&e.removeAttribute("value"),s==null&&r!=null&&(e.defaultChecked=!!r),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.name=""+se(p):e.removeAttribute("name")}function Mt(e,t,n,a,s,r,f,p){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.type=r),t!=null||n!=null){if(!(r!=="submit"&&r!=="reset"||t!=null)){ie(e);return}n=n!=null?""+se(n):"",t=t!=null?""+se(t):n,p||t===e.value||(e.value=t),e.defaultValue=t}a=a??s,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=p?e.checked:!!a,e.defaultChecked=!!a,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.name=f),ie(e)}function xn(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function Vt(e,t,n,a){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&a&&(e[n].defaultSelected=!0)}else{for(n=""+se(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,a&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Ya(e,t,n){if(t!=null&&(t=""+se(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+se(n):""}function Cs(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(u(92));if(Ne(a)){if(1<a.length)throw Error(u(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=se(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),ie(e)}function Ut(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Wo=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 Eh(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||Wo.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Ch(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]="",rt=!0);for(var s in t)a=t[s],t.hasOwnProperty(s)&&n[s]!==a&&(Eh(e,s,a),rt=!0)}else for(var r in t)t.hasOwnProperty(r)&&Eh(e,r,t[r])}function Pc(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 _0=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 er(e){return R0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ca(){}var Fc=null;function Jc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ms=null,_s=null;function Mh(e){var t=ma(e);if(t&&(e=t.stateNode)){var n=e[Wt]||null;e:switch(e=t.stateNode,t.type){case"input":if(at(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="'+Ge(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var s=a[Wt]||null;if(!s)throw Error(u(90));at(a,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.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&&Vt(e,!!n.multiple,t,!1)}}}var Wc=!1;function _h(e,t,n){if(Wc)return e(t,n);Wc=!0;try{var a=e(t);return a}finally{if(Wc=!1,(Ms!==null||_s!==null)&&(ec(),Ms&&(t=Ms,e=_s,_s=Ms=null,Mh(t),e)))for(t=0;t<e.length;t++)Mh(e[t])}}function Ni(e,t){var n=e.stateNode;if(n===null)return null;var a=n[Wt]||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 Va=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),eu=!1;if(Va)try{var Ei={};Object.defineProperty(Ei,"passive",{get:function(){eu=!0}}),window.addEventListener("test",Ei,Ei),window.removeEventListener("test",Ei,Ei)}catch{eu=!1}var pl=null,tu=null,tr=null;function Rh(){if(tr)return tr;var e,t=tu,n=t.length,a,s="value"in pl?pl.value:pl.textContent,r=s.length;for(e=0;e<n&&t[e]===s[e];e++);var f=n-e;for(a=1;a<=f&&t[n-a]===s[r-a];a++);return tr=s.slice(e,1<a?1-a:void 0)}function nr(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 ar(){return!0}function Oh(){return!1}function An(e){function t(n,a,s,r,f){this._reactName=n,this._targetInst=s,this.type=a,this.nativeEvent=r,this.target=f,this.currentTarget=null;for(var p in e)e.hasOwnProperty(p)&&(n=e[p],this[p]=n?n(r):r[p]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?ar:Oh,this.isPropagationStopped=Oh,this}return V(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=ar)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ar)},persist:function(){},isPersistent:ar}),t}var gl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lr=An(gl),Ci=V({},gl,{view:0,detail:0}),O0=An(Ci),nu,au,Mi,sr=V({},Ci,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:su,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!==Mi&&(Mi&&e.type==="mousemove"?(nu=e.screenX-Mi.screenX,au=e.screenY-Mi.screenY):au=nu=0,Mi=e),nu)},movementY:function(e){return"movementY"in e?e.movementY:au}}),Dh=An(sr),D0=V({},sr,{dataTransfer:0}),L0=An(D0),z0=V({},Ci,{relatedTarget:0}),lu=An(z0),U0=V({},gl,{animationName:0,elapsedTime:0,pseudoElement:0}),H0=An(U0),I0=V({},gl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),B0=An(I0),q0=V({},gl,{data:0}),Lh=An(q0),G0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$0={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"},X0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Y0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=X0[e])?!!t[e]:!1}function su(){return Y0}var V0=V({},Ci,{key:function(e){if(e.key){var t=G0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=nr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?$0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:su,charCode:function(e){return e.type==="keypress"?nr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?nr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Q0=An(V0),K0=V({},sr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zh=An(K0),Z0=V({},gl,{submitter:0}),P0=An(Z0),F0=V({},Ci,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:su}),J0=An(F0),W0=V({},gl,{propertyName:0,elapsedTime:0,pseudoElement:0}),eb=An(W0),tb=V({},sr,{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}),nb=An(tb),ab=V({},gl,{newState:0,oldState:0,source:0}),lb=An(ab),sb=[9,13,27,32],iu=Va&&"CompositionEvent"in window,_i=null;Va&&"documentMode"in document&&(_i=document.documentMode);var ib=Va&&"TextEvent"in window&&!_i,Uh=Va&&(!iu||_i&&8<_i&&11>=_i),Hh=" ",Ih=!1;function Bh(e,t){switch(e){case"keyup":return sb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Rs=!1;function ob(e,t){switch(e){case"compositionend":return qh(t);case"keypress":return t.which!==32?null:(Ih=!0,Hh);case"textInput":return e=t.data,e===Hh&&Ih?null:e;default:return null}}function rb(e,t){if(Rs)return e==="compositionend"||!iu&&Bh(e,t)?(e=Rh(),tr=tu=pl=null,Rs=!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 Uh&&t.locale!=="ko"?null:t.data;default:return null}}var cb={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 Gh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!cb[e.type]:t==="textarea"}function $h(e,t,n,a){Ms?_s?_s.push(a):_s=[a]:Ms=a,t=ic(t,"onChange"),0<t.length&&(n=new lr("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var Ri=null,Oi=null;function ub(e){Mg(e,0)}function ir(e){var t=Wn(e);if(ue(t))return e}function Xh(e,t){if(e==="change")return t}var Yh=!1;if(Va){var ou;if(Va){var ru="oninput"in document;if(!ru){var Vh=document.createElement("div");Vh.setAttribute("oninput","return;"),ru=typeof Vh.oninput=="function"}ou=ru}else ou=!1;Yh=ou&&(!document.documentMode||9<document.documentMode)}function Qh(){Ri&&(Ri.detachEvent("onpropertychange",Kh),Oi=Ri=null)}function Kh(e){if(e.propertyName==="value"&&ir(Oi)){var t=[];$h(t,Oi,e,Jc(e)),_h(ub,t)}}function db(e,t,n){e==="focusin"?(Qh(),Ri=t,Oi=n,Ri.attachEvent("onpropertychange",Kh)):e==="focusout"&&Qh()}function fb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ir(Oi)}function hb(e,t){if(e==="click")return ir(t)}function mb(e,t){if(e==="input"||e==="change")return ir(t)}function pb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Bn=typeof Object.is=="function"?Object.is:pb;function Di(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 s=n[a];if(!Rt.call(t,s)||!Bn(e[s],t[s]))return!1}return!0}function cu(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 Zh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ph(e,t){var n=Zh(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=Zh(n)}}function Fh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Fh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=cu(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=cu(e.document)}return t}function uu(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 gb=Va&&"documentMode"in document&&11>=document.documentMode,Os=null,du=null,Li=null,fu=!1;function Wh(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;fu||Os==null||Os!==cu(a)||(a=Os,"selectionStart"in a&&uu(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}),Li&&Di(Li,a)||(Li=a,a=ic(du,"onSelect"),0<a.length&&(t=new lr("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=Os)))}function Jl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ds={animationend:Jl("Animation","AnimationEnd"),animationiteration:Jl("Animation","AnimationIteration"),animationstart:Jl("Animation","AnimationStart"),transitionrun:Jl("Transition","TransitionRun"),transitionstart:Jl("Transition","TransitionStart"),transitioncancel:Jl("Transition","TransitionCancel"),transitionend:Jl("Transition","TransitionEnd")},hu={},em={};Va&&(em=document.createElement("div").style,"AnimationEvent"in window||(delete Ds.animationend.animation,delete Ds.animationiteration.animation,delete Ds.animationstart.animation),"TransitionEvent"in window||delete Ds.transitionend.transition);function Wl(e){if(hu[e])return hu[e];if(!Ds[e])return e;var t=Ds[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in em)return hu[e]=t[n];return e}var tm=Wl("animationend"),nm=Wl("animationiteration"),am=Wl("animationstart"),yb=Wl("transitionrun"),vb=Wl("transitionstart"),bb=Wl("transitioncancel"),lm=Wl("transitionend"),sm=new Map,mu="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(" ");mu.push("scrollEnd");function pa(e,t){sm.set(e,t),Ea(t,[e])}var xb=0;function Qa(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=ba.identifierPrefix;var n=xb++;return e="_"+e+"t_"+n.toString(32)+"_",t.autoName=e}function im(e){if(e==null||typeof e=="string")return e;var t=null,n=ei;if(n!==null)for(var a=0;a<n.length;a++){var s=e[n[a]];if(s!=null){if(s==="none")return"none";t=t==null?s:t+(" "+s)}}return t??e.default}function Ka(e,t){return e=im(e),t=im(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var or=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=[],Ls=0,pu=0;function rr(){for(var e=Ls,t=pu=Ls=0;t<e;){var n=ta[t];ta[t++]=null;var a=ta[t];ta[t++]=null;var s=ta[t];ta[t++]=null;var r=ta[t];if(ta[t++]=null,a!==null&&s!==null){var f=a.pending;f===null?s.next=s:(s.next=f.next,f.next=s),a.pending=s}r!==0&&om(n,s,r)}}function cr(e,t,n,a){ta[Ls++]=e,ta[Ls++]=t,ta[Ls++]=n,ta[Ls++]=a,pu|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function gu(e,t,n,a){return cr(e,t,n,a),ur(e)}function es(e,t){return cr(e,null,null,t),ur(e)}function om(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var s=!1,r=e.return;r!==null;)r.childLanes|=n,a=r.alternate,a!==null&&(a.childLanes|=n),r.tag===22&&(e=r.stateNode,e===null||e._visibility&1||(s=!0)),e=r,r=r.return;return e.tag===3?(r=e.stateNode,s&&t!==null&&(s=31-yt(n),e=r.hiddenUpdates,a=e[s],a===null?e[s]=[t]:a.push(t),t.lane=n|536870912),r):null}function ur(e){if(50<ao)throw ao=0,Wr=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var zs={};function Sb(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 Mn(e,t,n,a){return new Sb(e,t,n,a)}function yu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Za(e,t){var n=e.alternate;return n===null?(n=Mn(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 rm(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 dr(e,t,n,a,s,r){var f=0;if(a=e,typeof a=="function")yu(a)&&(f=1);else if(typeof a=="string")f=Zx(e,n,le.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(a){case nt:return e=Mn(31,n,t,s),e.elementType=nt,e.lanes=r,e;case K:return ts(n.children,s,r,t);case Q:f=8,s|=24;break;case me:return e=Mn(12,n,t,s|2),e.elementType=me,e.lanes=r,e;case W:return e=Mn(13,n,t,s),e.elementType=W,e.lanes=r,e;case pe:return e=Mn(19,n,t,s),e.elementType=pe,e.lanes=r,e;case Lt:case j:return e=s|32,e=Mn(30,n,t,e),e.elementType=j,e.lanes=r,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case Ce:f=10;break e;case ce:f=9;break e;case ae:f=11;break e;case F:f=14;break e;case we:f=16,a=null;break e}f=29,n=Error(u(130,e===null?"null":typeof e,"")),a=null}return t=Mn(f,n,t,s),t.elementType=e,t.type=a,t.lanes=r,t}function ts(e,t,n,a){return e=Mn(7,e,a,t),e.lanes=n,e}function vu(e,t,n){return e=Mn(6,e,null,t),e.lanes=n,e}function cm(e){var t=Mn(18,null,null,0);return t.stateNode=e,t}function bu(e,t,n){return t=Mn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var um=new WeakMap;function na(e,t){if(typeof e=="object"&&e!==null){var n=um.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Xt(t)},um.set(e,t),t)}return{value:e,source:t,stack:Xt(t)}}var Us=[],Hs=0,fr=null,zi=0,aa=[],la=0,yl=null,Ma=1,_a="";function Pa(e,t){Us[Hs++]=zi,Us[Hs++]=fr,fr=e,zi=t}function dm(e,t,n){aa[la++]=Ma,aa[la++]=_a,aa[la++]=yl,yl=e;var a=Ma;e=_a;var s=32-yt(a)-1;a&=~(1<<s),n+=1;var r=32-yt(t)+s;if(30<r){var f=s-s%5;r=(a&(1<<f)-1).toString(32),a>>=f,s-=f,Ma=1<<32-yt(t)+s|n<<s|a,_a=r+e}else Ma=1<<r|n<<s|a,_a=e}function hr(e){e.return!==null&&(Pa(e,1),dm(e,1,0))}function xu(e){for(;e===fr;)fr=Us[--Hs],Us[Hs]=null,zi=Us[--Hs],Us[Hs]=null;for(;e===yl;)yl=aa[--la],aa[la]=null,_a=aa[--la],aa[la]=null,Ma=aa[--la],aa[la]=null}function fm(e,t){aa[la++]=Ma,aa[la++]=_a,aa[la++]=yl,Ma=t.id,_a=t.overflow,yl=e}var ln=null,Et=null,tt=!1,vl=null,sa=!1,Su=Error(u(519));function bl(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ui(na(t,e)),Su}function hm(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[Yt]=e,t[Wt]=a,n){case"dialog":st("cancel",t),st("close",t);break;case"iframe":case"object":case"embed":st("load",t);break;case"video":case"audio":for(n=0;n<so.length;n++)st(so[n],t);break;case"source":st("error",t);break;case"img":case"image":case"link":st("error",t),st("load",t);break;case"details":st("toggle",t);break;case"input":st("invalid",t),Mt(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":st("invalid",t);break;case"textarea":st("invalid",t),Cs(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||Dg(t.textContent,n)?(a.popover!=null&&(st("beforetoggle",t),st("toggle",t)),a.onScroll!=null&&st("scroll",t),a.onScrollEnd!=null&&st("scrollend",t),a.onClick!=null&&(t.onclick=Ca),t=!0):t=!1,t||bl(e,!0)}function mr(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 Is(e){if(e!==ln)return!1;if(!tt)return mr(e),tt=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Fd(e.type,e.memoizedProps)),n=!n),n&&Et&&bl(e),mr(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Et=Wg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Et=Wg(e)}else t===27?(t=Et,Ll(e.type)?(e=of,of=null,Et=e):Et=t):Et=ln?oa(e.stateNode.nextSibling):null;return!0}function ns(){Et=ln=null,tt=!1}function wu(){var e=vl;return e!==null&&(On===null?On=e:On.push.apply(On,e),vl=null),e}function Ui(e){vl===null?vl=[e]:vl.push(e)}var Au=ke(null),as=null,Fa=null;function xl(e,t,n){_e(Au,t._currentValue),t._currentValue=n}function Ja(e){e._currentValue=Au.current,Be(Au)}function pr(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 Tu(e,t,n,a){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var r=s.dependencies;if(r!==null){var f=s.child;r=r.firstContext;e:for(;r!==null;){var p=r;r=s;for(var T=0;T<t.length;T++)if(p.context===t[T]){r.lanes|=n,p=r.alternate,p!==null&&(p.lanes|=n),pr(r.return,n,e),a||(f=null);break e}r=p.next}}else if(s.tag===18){if(f=s.return,f===null)throw Error(u(341));f.lanes|=n,r=f.alternate,r!==null&&(r.lanes|=n),pr(f,n,e),f=null}else s.tag===13&&s.memoizedState!==null&&s.memoizedState.dehydrated===null?(s.lanes|=n,f=s.alternate,f!==null&&(f.lanes|=n),pr(s.return,n,e),f=s.child,f=f!==null?f.sibling:null):f=s.child;if(f!==null)f.return=s;else for(f=s;f!==null;){if(f===e){f=null;break}if(s=f.sibling,s!==null){s.return=f.return,f=s;break}f=f.return}s=f}}function ls(e,t,n,a){e=null;for(var s=t,r=!1;s!==null;){if(!r){if((s.flags&524288)!==0)r=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var f=s.alternate;if(f===null)throw Error(u(387));if(f=f.memoizedProps,f!==null){var p=s.type;Bn(s.pendingProps.value,f.value)||(e!==null?e.push(p):e=[p])}}else if(s===Xe.current){if(f=s.alternate,f===null)throw Error(u(387));f.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(ui):e=[ui])}s=s.return}return e!==null&&Tu(t,e,n,a),t.flags|=262144,e!==null}function gr(e){for(e=e.firstContext;e!==null;){if(!Bn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ss(e){as=e,Fa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function un(e){return mm(as,e)}function yr(e,t){return as===null&&ss(e),mm(e,t)}function mm(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Fa===null){if(e===null)throw Error(u(308));Fa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Fa=Fa.next=t;return n}var wb=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()})}},Ab=l.unstable_scheduleCallback,Tb=l.unstable_NormalPriority,Qt={$$typeof:Ce,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ku(){return{controller:new wb,data:new Map,refCount:0}}function Hi(e){e.refCount--,e.refCount===0&&Ab(Tb,function(){e.controller.abort()})}function pm(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 Ii=null;function kb(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Bi=null,ju=0,is=0,Bs=null;function jb(e,t){if(Bi===null){var n=Bi=[];ju=0,is=Gd(),Bs={status:"pending",value:void 0,then:function(a){n.push(a)}}}return ju++,t.then(gm,gm),t}function gm(){if(--ju===0&&(Ii=null,Bi!==null)){Bs!==null&&(Bs.status="fulfilled");var e=Bi;Bi=null,is=0,Bs=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(s){n.push(s)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var s=0;s<n.length;s++)(0,n[s])(t)},function(s){for(a.status="rejected",a.reason=s,s=0;s<n.length;s++)(0,n[s])(void 0)}),a}var ym=he.S;he.S=function(e,t){if(cg=Ot(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&jb(e,t),Ii!==null)for(var n=li;n!==null;)pm(n,Ii),n=n.next;if(n=e.types,n!==null){for(var a=li;a!==null;)pm(a,n),a=a.next;if(is!==0){a=Ii,a===null&&(a=Ii=[]);for(var s=0;s<n.length;s++){var r=n[s];a.indexOf(r)===-1&&a.push(r)}}}ym!==null&&ym(e,t)};var os=ke(null);function Nu(){var e=os.current;return e!==null?e:jt.pooledCache}function vr(e,t){t===null?_e(os,os.current):_e(os,t.pool)}function vm(){var e=Nu();return e===null?null:{parent:Qt._currentValue,pool:e}}var qs=Error(u(460)),Eu=Error(u(474)),br=Error(u(542)),xr={then:function(){}};function bm(e){return e=e.status,e==="fulfilled"||e==="rejected"}function xm(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Ca,Ca),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,wm(e),e===void 0&&!("reason"in t)?Error(u(600)):e;default:if(typeof t.status=="string")t.then(Ca,Ca);else{if(e=jt,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=a}},function(a){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,wm(e),e}throw cs=t,qs}}function rs(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(cs=n,qs):n}}var cs=null;function Sm(){if(cs===null)throw Error(u(459));var e=cs;return cs=null,e}function wm(e){if(e===qs||e===br)throw Error(u(483))}var Gs=null,qi=0;function Sr(e){var t=qi;return qi+=1,Gs===null&&(Gs=[]),xm(Gs,e,t)}function Sl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function wr(e,t){throw t.$$typeof===J?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Am(e){function t(_,C){if(e){var L=_.deletions;L===null?(_.deletions=[C],_.flags|=16):L.push(C)}}function n(_,C){if(!e)return null;for(;C!==null;)t(_,C),C=C.sibling;return null}function a(_){for(var C=new Map;_!==null;)_.key===null?C.set(_.index,_):C.set(_.key,_),_=_.sibling;return C}function s(_,C){return _=Za(_,C),_.index=0,_.sibling=null,_}function r(_,C,L){return _.index=L,e?(L=_.alternate,L!==null?(L=L.index,L<C?(_.flags|=2,C):L):(_.flags|=134217730,C)):(_.flags|=1048576,C)}function f(_){return e&&_.alternate===null&&(_.flags|=134217730),_}function p(_,C,L,Z){return C===null||C.tag!==6?(C=vu(L,_.mode,Z),C.return=_,C):(C=s(C,L),C.return=_,C)}function T(_,C,L,Z){var Ee=L.type;return Ee===K?(_=q(_,C,L.props.children,Z,L.key),Sl(_,L),_):C!==null&&(C.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===we&&rs(Ee)===C.type)?(C=s(C,L.props),Sl(C,L),C.return=_,C):(C=dr(L.type,L.key,L.props,null,_.mode,Z),Sl(C,L),C.return=_,C)}function R(_,C,L,Z){return C===null||C.tag!==4||C.stateNode.containerInfo!==L.containerInfo||C.stateNode.implementation!==L.implementation?(C=bu(L,_.mode,Z),C.return=_,C):(C=s(C,L.children||[]),C.return=_,C)}function q(_,C,L,Z,Ee){return C===null||C.tag!==7?(C=ts(L,_.mode,Z,Ee),C.return=_,C):(C=s(C,L),C.return=_,C)}function P(_,C,L){if(typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint")return C=vu(""+C,_.mode,L),C.return=_,C;if(typeof C=="object"&&C!==null){switch(C.$$typeof){case oe:return L=dr(C.type,C.key,C.props,null,_.mode,L),Sl(L,C),L.return=_,L;case X:return C=bu(C,_.mode,L),C.return=_,C;case we:return C=rs(C),P(_,C,L)}if(Ne(C)||ye(C))return C=ts(C,_.mode,L,null),C.return=_,C;if(typeof C.then=="function")return P(_,Sr(C),L);if(C.$$typeof===Ce)return P(_,yr(_,C),L);wr(_,C)}return null}function M(_,C,L,Z){var Ee=C!==null?C.key:null;if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return Ee!==null?null:p(_,C,""+L,Z);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case oe:return L.key===Ee?T(_,C,L,Z):null;case X:return L.key===Ee?R(_,C,L,Z):null;case we:return L=rs(L),M(_,C,L,Z)}if(Ne(L)||ye(L))return Ee!==null?null:q(_,C,L,Z,null);if(typeof L.then=="function")return M(_,C,Sr(L),Z);if(L.$$typeof===Ce)return M(_,C,yr(_,L),Z);wr(_,L)}return null}function I(_,C,L,Z,Ee){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return _=_.get(L)||null,p(C,_,""+Z,Ee);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case oe:return _=_.get(Z.key===null?L:Z.key)||null,T(C,_,Z,Ee);case X:return _=_.get(Z.key===null?L:Z.key)||null,R(C,_,Z,Ee);case we:return Z=rs(Z),I(_,C,L,Z,Ee)}if(Ne(Z)||ye(Z))return _=_.get(L)||null,q(C,_,Z,Ee,null);if(typeof Z.then=="function")return I(_,C,L,Sr(Z),Ee);if(Z.$$typeof===Ce)return I(_,C,L,yr(C,Z),Ee);wr(C,Z)}return null}function ge(_,C,L,Z){for(var Ee=null,ot=null,ze=C,$e=C=0,Pt=null;ze!==null&&$e<L.length;$e++){ze.index>$e?(Pt=ze,ze=null):Pt=ze.sibling;var ct=M(_,ze,L[$e],Z);if(ct===null){ze===null&&(ze=Pt);break}e&&ze&&ct.alternate===null&&t(_,ze),C=r(ct,C,$e),ot===null?Ee=ct:ot.sibling=ct,ot=ct,ze=Pt}if($e===L.length)return n(_,ze),tt&&Pa(_,$e),Ee;if(ze===null){for(;$e<L.length;$e++)ze=P(_,L[$e],Z),ze!==null&&(C=r(ze,C,$e),ot===null?Ee=ze:ot.sibling=ze,ot=ze);return tt&&Pa(_,$e),Ee}for(ze=a(ze);$e<L.length;$e++)Pt=I(ze,_,$e,L[$e],Z),Pt!==null&&(e&&(ct=Pt.alternate,ct!==null&&ze.delete(ct.key===null?$e:ct.key)),C=r(Pt,C,$e),ot===null?Ee=Pt:ot.sibling=Pt,ot=Pt);return e&&ze.forEach(function(Bl){return t(_,Bl)}),tt&&Pa(_,$e),Ee}function Re(_,C,L,Z){if(L==null)throw Error(u(151));for(var Ee=null,ot=null,ze=C,$e=C=0,Pt=null,ct=L.next();ze!==null&&!ct.done;$e++,ct=L.next()){ze.index>$e?(Pt=ze,ze=null):Pt=ze.sibling;var Bl=M(_,ze,ct.value,Z);if(Bl===null){ze===null&&(ze=Pt);break}e&&ze&&Bl.alternate===null&&t(_,ze),C=r(Bl,C,$e),ot===null?Ee=Bl:ot.sibling=Bl,ot=Bl,ze=Pt}if(ct.done)return n(_,ze),tt&&Pa(_,$e),Ee;if(ze===null){for(;!ct.done;$e++,ct=L.next())ct=P(_,ct.value,Z),ct!==null&&(C=r(ct,C,$e),ot===null?Ee=ct:ot.sibling=ct,ot=ct);return tt&&Pa(_,$e),Ee}for(ze=a(ze);!ct.done;$e++,ct=L.next())ct=I(ze,_,$e,ct.value,Z),ct!==null&&(e&&(Pt=ct.alternate,Pt!==null&&ze.delete(Pt.key===null?$e:Pt.key)),C=r(ct,C,$e),ot===null?Ee=ct:ot.sibling=ct,ot=ct);return e&&ze.forEach(function(oS){return t(_,oS)}),tt&&Pa(_,$e),Ee}function Fe(_,C,L,Z){if(typeof L=="object"&&L!==null&&L.type===K&&L.key===null&&L.props.ref===void 0&&(L=L.props.children),typeof L=="object"&&L!==null){switch(L.$$typeof){case oe:e:{for(var Ee=L.key;C!==null;){if(C.key===Ee){if(Ee=L.type,Ee===K){if(C.tag===7){n(_,C.sibling),Z=s(C,L.props.children),Sl(Z,L),Z.return=_,_=Z;break e}}else if(C.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===we&&rs(Ee)===C.type){n(_,C.sibling),Z=s(C,L.props),Sl(Z,L),Z.return=_,_=Z;break e}n(_,C);break}else t(_,C);C=C.sibling}L.type===K?(Z=ts(L.props.children,_.mode,Z,L.key),Sl(Z,L),Z.return=_,_=Z):(Z=dr(L.type,L.key,L.props,null,_.mode,Z),Sl(Z,L),Z.return=_,_=Z)}return f(_);case X:e:{for(Ee=L.key;C!==null;){if(C.key===Ee)if(C.tag===4&&C.stateNode.containerInfo===L.containerInfo&&C.stateNode.implementation===L.implementation){n(_,C.sibling),Z=s(C,L.children||[]),Z.return=_,_=Z;break e}else{n(_,C);break}else t(_,C);C=C.sibling}Z=bu(L,_.mode,Z),Z.return=_,_=Z}return f(_);case we:return L=rs(L),Fe(_,C,L,Z)}if(Ne(L))return ge(_,C,L,Z);if(ye(L)){if(Ee=ye(L),typeof Ee!="function")throw Error(u(150));return L=Ee.call(L),Re(_,C,L,Z)}if(typeof L.then=="function")return Fe(_,C,Sr(L),Z);if(L.$$typeof===Ce)return Fe(_,C,yr(_,L),Z);wr(_,L)}return typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint"?(L=""+L,C!==null&&C.tag===6?(n(_,C.sibling),Z=s(C,L),Z.return=_,_=Z):(n(_,C),Z=vu(L,_.mode,Z),Z.return=_,_=Z),f(_)):n(_,C)}return function(_,C,L,Z){try{qi=0;var Ee=Fe(_,C,L,Z);return Gs=null,Ee}catch(ze){if(ze===qs||ze===br)throw ze;var ot=Mn(29,ze,null,_.mode);return ot.lanes=Z,ot.return=_,ot}finally{}}}var us=Am(!0),Tm=Am(!1),wl=!1;function Cu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Mu(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 Al(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Tl(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(ht&2)!==0){var s=a.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),a.pending=t,t=ur(e),om(e,null,n),t}return cr(e,a,t,n),ur(e)}function Gi(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,Ga(e,n)}}function _u(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var s=null,r=null;if(n=n.firstBaseUpdate,n!==null){do{var f={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};r===null?s=r=f:r=r.next=f,n=n.next}while(n!==null);r===null?s=r=t:r=r.next=t}else s=r=t;n={baseState:a.baseState,firstBaseUpdate:s,lastBaseUpdate:r,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 Ru=!1;function $i(){if(Ru){var e=Bs;if(e!==null)throw e}}function Xi(e,t,n,a){Ru=!1;var s=e.updateQueue;wl=!1;var r=s.firstBaseUpdate,f=s.lastBaseUpdate,p=s.shared.pending;if(p!==null){s.shared.pending=null;var T=p,R=T.next;T.next=null,f===null?r=R:f.next=R,f=T;var q=e.alternate;q!==null&&(q=q.updateQueue,p=q.lastBaseUpdate,p!==f&&(p===null?q.firstBaseUpdate=R:p.next=R,q.lastBaseUpdate=T))}if(r!==null){var P=s.baseState;f=0,q=R=T=null,p=r;do{var M=p.lane&-536870913,I=M!==p.lane;if(I?(it&M)===M:(a&M)===M){M!==0&&M===is&&(Ru=!0),q!==null&&(q=q.next={lane:0,tag:p.tag,payload:p.payload,callback:null,next:null});e:{var ge=e,Re=p;M=t;var Fe=n;switch(Re.tag){case 1:if(ge=Re.payload,typeof ge=="function"){P=ge.call(Fe,P,M);break e}P=ge;break e;case 3:ge.flags=ge.flags&-65537|128;case 0:if(ge=Re.payload,M=typeof ge=="function"?ge.call(Fe,P,M):ge,M==null)break e;P=V({},P,M);break e;case 2:wl=!0}}M=p.callback,M!==null&&(e.flags|=64,I&&(e.flags|=8192),I=s.callbacks,I===null?s.callbacks=[M]:I.push(M))}else I={lane:M,tag:p.tag,payload:p.payload,callback:p.callback,next:null},q===null?(R=q=I,T=P):q=q.next=I,f|=M;if(p=p.next,p===null){if(p=s.shared.pending,p===null)break;I=p,p=I.next,I.next=null,s.lastBaseUpdate=I,s.shared.pending=null}}while(!0);q===null&&(T=P),s.baseState=T,s.firstBaseUpdate=R,s.lastBaseUpdate=q,r===null&&(s.shared.lanes=0),_l|=f,e.lanes=f,e.memoizedState=P}}function km(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function jm(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)km(n[e],t)}var kl=ke(null),Ar=ke(0);function Nm(e,t){e=al,_e(Ar,e),_e(kl,t),al=e|t.baseLanes}function Ou(){_e(Ar,al),_e(kl,kl.current)}function Du(){al=Ar.current,Be(kl),Be(Ar)}var dn=ke(null),Sn=null;function jl(e){var t=e.alternate;_e(fn,fn.current&1),_e(dn,e),Sn===null&&(t===null||kl.current!==null||t.memoizedState!==null)&&(Sn=e)}function Lu(e){_e(fn,fn.current),_e(dn,e),Sn===null&&(Sn=e)}function Em(e){e.tag===22?(_e(fn,fn.current),_e(dn,e),Sn===null&&(Sn=e)):Nl()}function Nl(){_e(fn,fn.current),_e(dn,dn.current)}function qn(e){Be(dn),Sn===e&&(Sn=null),Be(fn)}var fn=ke(0);function Yi(e,t){_e(dn,dn.current),_e(fn,t)}function zu(e){Be(fn),Be(dn),Sn===e&&(Sn=null)}function Tr(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||lf(n)||sf(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 Wa=0,Pe=null,Tt=null,Kt=null,kr=!1,$s=!1,ds=!1,jr=0,Vi=0,Xs=null,Eb=0;function Ht(){throw Error(u(321))}function Uu(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 Hu(e,t,n,a,s,r){return Wa=r,Pe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,he.H=e===null||e.memoizedState===null?dp:fp,ds=!1,r=n(a,s),ds=!1,$s&&(r=Mm(t,n,a,s)),Cm(e),r}function Cm(e){he.H=Or;var t=Tt!==null&&Tt.next!==null;if(Wa=0,Kt=Tt=Pe=null,kr=!1,Vi=0,Xs=null,t)throw Error(u(300));e===null||Zt||(e=e.dependencies,e!==null&&gr(e)&&(Zt=!0))}function Mm(e,t,n,a){Pe=e;var s=0;do{if($s&&(Xs=null),Vi=0,$s=!1,25<=s)throw Error(u(301));if(s+=1,Kt=Tt=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}he.H=zb,r=t(n,a)}while($s);return r}function Cb(){var e=he.H,t=e.useState()[0];return t=typeof t.then=="function"?Qi(t):t,e=e.useState()[0],(Tt!==null?Tt.memoizedState:null)!==e&&(Pe.flags|=1024),t}function Iu(){var e=jr!==0;return jr=0,e}function Bu(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function qu(e){if(kr){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}kr=!1}Wa=0,Kt=Tt=Pe=null,$s=!1,Vi=jr=0,Xs=null}function Tn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kt===null?Pe.memoizedState=Kt=e:Kt=Kt.next=e,Kt}function qt(){if(Tt===null){var e=Pe.alternate;e=e!==null?e.memoizedState:null}else e=Tt.next;var t=Kt===null?Pe.memoizedState:Kt.next;if(t!==null)Kt=t,Tt=e;else{if(e===null)throw Pe.alternate===null?Error(u(467)):Error(u(310));Tt=e,e={memoizedState:Tt.memoizedState,baseState:Tt.baseState,baseQueue:Tt.baseQueue,queue:Tt.queue,next:null},Kt===null?Pe.memoizedState=Kt=e:Kt=Kt.next=e}return Kt}function Nr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Qi(e){var t=Vi;return Vi+=1,Xs===null&&(Xs=[]),e=xm(Xs,e,t),t=Pe,(Kt===null?t.memoizedState:Kt.next)===null&&(t=t.alternate,he.H=t===null||t.memoizedState===null?dp:fp),e}function Er(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Qi(e);if(e.$$typeof===ne)return;if(e.$$typeof===Ce)return un(e)}throw Error(u(438,String(e)))}function Gu(e){var t=null,n=Pe.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=Pe.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Nr(),Pe.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 el(e,t){return typeof t=="function"?t(e):t}function Cr(e){var t=qt();return $u(t,Tt,e)}function $u(e,t,n){var a=e.queue;if(a===null)throw Error(u(311));a.lastRenderedReducer=n;var s=e.baseQueue,r=a.pending;if(r!==null){if(s!==null){var f=s.next;s.next=r.next,r.next=f}t.baseQueue=s=r,a.pending=null}if(r=e.baseState,s===null)e.memoizedState=r;else{t=s.next;var p=f=null,T=null,R=t,q=!1;do{var P=R.lane&-536870913;if(P!==R.lane?(it&P)===P:(Wa&P)===P){var M=R.revertLane;if(M===0)T!==null&&(T=T.next={lane:0,revertLane:0,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null}),P===is&&(q=!0);else if((Wa&M)===M){R=R.next,M===is&&(q=!0);continue}else P={lane:0,revertLane:R.revertLane,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},T===null?(p=T=P,f=r):T=T.next=P,Pe.lanes|=M,_l|=M;P=R.action,ds&&n(r,P),r=R.hasEagerState?R.eagerState:n(r,P)}else M={lane:P,revertLane:R.revertLane,gesture:R.gesture,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},T===null?(p=T=M,f=r):T=T.next=M,Pe.lanes|=P,_l|=P;R=R.next}while(R!==null&&R!==t);if(T===null?f=r:T.next=p,!Bn(r,e.memoizedState)&&(Zt=!0,q&&(n=Bs,n!==null)))throw n;e.memoizedState=r,e.baseState=f,e.baseQueue=T,a.lastRenderedState=r}return s===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Xu(e){var t=qt(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var a=n.dispatch,s=n.pending,r=t.memoizedState;if(s!==null){n.pending=null;var f=s=s.next;do r=e(r,f.action),f=f.next;while(f!==s);Bn(r,t.memoizedState)||(Zt=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),n.lastRenderedState=r}return[r,a]}function _m(e,t,n){var a=Pe,s=qt(),r=tt;if(r){if(n===void 0)throw Error(u(407));n=n()}else n=t();var f=!Bn((Tt||s).memoizedState,n);if(f&&(s.memoizedState=n,Zt=!0),s=s.queue,Qu(Dm.bind(null,a,s,e),[e]),e=s.getSnapshot!==t||f||Kt!==null&&(Kt.memoizedState.tag&1)!==0,Ys(e?9:8,{destroy:void 0},Om.bind(null,a,s,n,t),null),e){if(a.flags|=2048,jt===null)throw Error(u(349));r||(Wa&127)!==0||Rm(a,t,n)}return n}function Rm(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Pe.updateQueue,t===null?(t=Nr(),Pe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Om(e,t,n,a){t.value=n,t.getSnapshot=a,Lm(t)&&zm(e)}function Dm(e,t,n){return n(function(){Lm(t)&&zm(e)})}function Lm(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Bn(e,n)}catch{return!0}}function zm(e){var t=es(e,2);t!==null&&Dn(t,e,2)}function Yu(e){var t=Tn();if(typeof e=="function"){var n=e;if(e=n(),ds){Qe(!0);try{n()}finally{Qe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:el,lastRenderedState:e},t}function Um(e,t,n,a){return e.baseState=n,$u(e,Tt,typeof a=="function"?a:el)}function Mb(e,t,n,a,s){if(Rr(e))throw Error(u(485));if(e=t.action,e!==null){var r={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(f){r.listeners.push(f)}};he.T!==null?n(!0):r.isTransition=!1,a(r),n=t.pending,n===null?(r.next=t.pending=r,Hm(t,r)):(r.next=n.next,t.pending=n.next=r)}}function Hm(e,t){var n=t.action,a=t.payload,s=e.state;if(t.isTransition){var r=he.T,f={};f.types=r!==null?r.types:null,he.T=f;try{var p=n(s,a),T=he.S;T!==null&&T(f,p),Im(e,t,p)}catch(R){Vu(e,t,R)}finally{r!==null&&f.types!==null&&(r.types=f.types),he.T=r}}else try{r=n(s,a),Im(e,t,r)}catch(R){Vu(e,t,R)}}function Im(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){Bm(e,t,a)},function(a){return Vu(e,t,a)}):Bm(e,t,n)}function Bm(e,t,n){t.status="fulfilled",t.value=n,qm(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Hm(e,n)))}function Vu(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,qm(t),t=t.next;while(t!==a)}e.action=null}function qm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Gm(e,t){return t}function $m(e,t){if(tt){var n=jt.formState;if(n!==null){e:{var a=Pe;if(tt){if(Et){t:{for(var s=Et,r=sa;s.nodeType!==8;){if(!r){s=null;break t}if(s=oa(s.nextSibling),s===null){s=null;break t}}r=s.data,s=r==="F!"||r==="F"?s:null}if(s){Et=oa(s.nextSibling),a=s.data==="F!";break e}}bl(a)}a=!1}a&&(t=n[0])}}return n=Tn(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gm,lastRenderedState:t},n.queue=a,n=rp.bind(null,Pe,a),a.dispatch=n,a=Yu(!1),r=Ju.bind(null,Pe,!1,a.queue),a=Tn(),s={state:t,dispatch:null,action:e,pending:null},a.queue=s,n=Mb.bind(null,Pe,s,r,n),s.dispatch=n,a.memoizedState=e,[t,n,!1]}function Xm(e){var t=qt();return Ym(t,Tt,e)}function Ym(e,t,n){if(t=$u(e,t,Gm)[0],e=Cr(el)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Qi(t)}catch(f){throw f===qs?br:f}else a=t;t=qt();var s=t.queue,r=s.dispatch;return n!==t.memoizedState&&(Pe.flags|=2048,Ys(9,{destroy:void 0},_b.bind(null,s,n),null)),[a,r,e]}function _b(e,t){e.action=t}function Vm(e){var t=qt(),n=Tt;if(n!==null)return Ym(t,n,e);qt(),t=t.memoizedState,n=qt();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function Ys(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=Pe.updateQueue,t===null&&(t=Nr(),Pe.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 Qm(){return qt().memoizedState}function Mr(e,t,n,a){var s=Tn();Pe.flags|=e,s.memoizedState=Ys(1|t,{destroy:void 0},n,a===void 0?null:a)}function _r(e,t,n,a){var s=qt();a=a===void 0?null:a;var r=s.memoizedState.inst;Tt!==null&&a!==null&&Uu(a,Tt.memoizedState.deps)?s.memoizedState=Ys(t,r,n,a):(Pe.flags|=e,s.memoizedState=Ys(1|t,r,n,a))}function Km(e,t){Mr(8390656,8,e,t)}function Qu(e,t){_r(2048,8,e,t)}function Rb(e){Pe.flags|=4;var t=Pe.updateQueue;if(t===null)t=Nr(),Pe.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Zm(e){var t=qt().memoizedState;return Rb({ref:t,nextImpl:e}),function(){if((ht&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function Pm(e,t){return _r(4,2,e,t)}function Fm(e,t){return _r(4,4,e,t)}function Jm(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 Wm(e,t,n){n=n!=null?n.concat([e]):null,_r(4,4,Jm.bind(null,t,e),n)}function Ku(){}function ep(e,t){var n=qt();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&Uu(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function tp(e,t){var n=qt();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&Uu(t,a[1]))return a[0];if(a=e(),ds){Qe(!0);try{e()}finally{Qe(!1)}}return n.memoizedState=[a,t],a}function Zu(e,t,n){return n===void 0||(Wa&1073741824)!==0&&(it&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=dg(),Pe.lanes|=e,_l|=e,n)}function np(e,t,n,a){return Bn(n,t)?n:kl.current!==null?(e=Zu(e,n,a),Bn(e,t)||(Zt=!0),e):(Wa&106)===0||(Wa&1073741824)!==0&&(it&261930)===0?(Zt=!0,e.memoizedState=n):(e=dg(),Pe.lanes|=e,_l|=e,t)}function ap(e,t,n,a,s){var r=be.p;be.p=r!==0&&8>r?r:8;var f=he.T,p={};p.types=f!==null?f.types:null,he.T=p,Ju(e,!1,t,n);try{var T=s(),R=he.S;if(R!==null&&R(p,T),T!==null&&typeof T=="object"&&typeof T.then=="function"){var q=Nb(T,a);Ki(e,t,q,Yn(e))}else Ki(e,t,a,Yn(e))}catch(P){Ki(e,t,{then:function(){},status:"rejected",reason:P},Yn())}finally{be.p=r,f!==null&&p.types!==null&&(f.types=p.types),he.T=f}}function Ob(){}function Pu(e,t,n,a){if(e.tag!==5)throw Error(u(476));var s=lp(e).queue;ap(e,s,t,gt,n===null?Ob:function(){return sp(e),n(a)})}function lp(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:gt,baseState:gt,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:el,lastRenderedState:gt},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:el,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function sp(e){var t=lp(e);t.next===null&&(t=e.alternate.memoizedState),Ki(e,t.next.queue,{},Yn())}function Fu(){return un(ui)}function ip(){return qt().memoizedState}function op(){return qt().memoizedState}function Db(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Yn();e=Al(n);var a=Tl(t,e,n);a!==null&&(Dn(a,t,n),Gi(a,t,n)),t={cache:ku()},e.payload=t;return}t=t.return}}function Lb(e,t,n){var a=Yn();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Rr(e)?cp(t,n):(n=gu(e,t,n,a),n!==null&&(Dn(n,e,a),up(n,t,a)))}function rp(e,t,n){var a=Yn();Ki(e,t,n,a)}function Ki(e,t,n,a){var s={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Rr(e))cp(t,s);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var f=t.lastRenderedState,p=r(f,n);if(s.hasEagerState=!0,s.eagerState=p,Bn(p,f))return cr(e,t,s,0),jt===null&&rr(),!1}catch{}finally{}if(n=gu(e,t,s,a),n!==null)return Dn(n,e,a),up(n,t,a),!0}return!1}function Ju(e,t,n,a){if(a={lane:2,revertLane:Gd(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Rr(e)){if(t)throw Error(u(479))}else t=gu(e,n,a,2),t!==null&&Dn(t,e,2)}function Rr(e){var t=e.alternate;return e===Pe||t!==null&&t===Pe}function cp(e,t){$s=kr=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function up(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Ga(e,n)}}var Or={readContext:un,use:Er,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useLayoutEffect:Ht,useInsertionEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useSyncExternalStore:Ht,useId:Ht,useHostTransitionStatus:Ht,useFormState:Ht,useActionState:Ht,useOptimistic:Ht,useMemoCache:Ht,useCacheRefresh:Ht,useEffectEvent:Ht},dp={readContext:un,use:Er,useCallback:function(e,t){return Tn().memoizedState=[e,t===void 0?null:t],e},useContext:un,useEffect:Km,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Mr(4194308,4,Jm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Mr(4194308,4,e,t)},useInsertionEffect:function(e,t){Mr(4,2,e,t)},useMemo:function(e,t){var n=Tn();t=t===void 0?null:t;var a=e();if(ds){Qe(!0);try{e()}finally{Qe(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=Tn();if(n!==void 0){var s=n(t);if(ds){Qe(!0);try{n(t)}finally{Qe(!1)}}}else s=t;return a.memoizedState=a.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},a.queue=e,e=e.dispatch=Lb.bind(null,Pe,e),[a.memoizedState,e]},useRef:function(e){var t=Tn();return e={current:e},t.memoizedState=e},useState:function(e){e=Yu(e);var t=e.queue,n=rp.bind(null,Pe,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ku,useDeferredValue:function(e,t){var n=Tn();return Zu(n,e,t)},useTransition:function(){var e=Yu(!1);return e=ap.bind(null,Pe,e.queue,!0,!1),Tn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=Pe,s=Tn();if(tt){if(n===void 0)throw Error(u(407));n=n()}else{if(n=t(),jt===null)throw Error(u(349));(it&127)!==0||Rm(a,t,n)}s.memoizedState=n;var r={value:n,getSnapshot:t};return s.queue=r,Km(Dm.bind(null,a,r,e),[e]),a.flags|=2048,Ys(9,{destroy:void 0},Om.bind(null,a,r,n,t),null),n},useId:function(){var e=Tn(),t=jt.identifierPrefix;if(tt){var n=_a,a=Ma;n=(a&~(1<<32-yt(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=jr++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Eb++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Fu,useFormState:$m,useActionState:$m,useOptimistic:function(e){var t=Tn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ju.bind(null,Pe,!0,n),n.dispatch=t,[e,t]},useMemoCache:Gu,useCacheRefresh:function(){return Tn().memoizedState=Db.bind(null,Pe)},useEffectEvent:function(e){var t=Tn(),n={impl:e};return t.memoizedState=n,function(){if((ht&2)!==0)throw Error(u(440));return n.impl.apply(void 0,arguments)}}},fp={readContext:un,use:Er,useCallback:ep,useContext:un,useEffect:Qu,useImperativeHandle:Wm,useInsertionEffect:Pm,useLayoutEffect:Fm,useMemo:tp,useReducer:Cr,useRef:Qm,useState:function(){return Cr(el)},useDebugValue:Ku,useDeferredValue:function(e,t){var n=qt();return np(n,Tt.memoizedState,e,t)},useTransition:function(){var e=Cr(el)[0],t=qt().memoizedState;return[typeof e=="boolean"?e:Qi(e),t]},useSyncExternalStore:_m,useId:ip,useHostTransitionStatus:Fu,useFormState:Xm,useActionState:Xm,useOptimistic:function(e,t){var n=qt();return Um(n,Tt,e,t)},useMemoCache:Gu,useCacheRefresh:op,useEffectEvent:Zm},zb={readContext:un,use:Er,useCallback:ep,useContext:un,useEffect:Qu,useImperativeHandle:Wm,useInsertionEffect:Pm,useLayoutEffect:Fm,useMemo:tp,useReducer:Xu,useRef:Qm,useState:function(){return Xu(el)},useDebugValue:Ku,useDeferredValue:function(e,t){var n=qt();return Tt===null?Zu(n,e,t):np(n,Tt.memoizedState,e,t)},useTransition:function(){var e=Xu(el)[0],t=qt().memoizedState;return[typeof e=="boolean"?e:Qi(e),t]},useSyncExternalStore:_m,useId:ip,useHostTransitionStatus:Fu,useFormState:Vm,useActionState:Vm,useOptimistic:function(e,t){var n=qt();return Tt!==null?Um(n,Tt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Gu,useCacheRefresh:op,useEffectEvent:Zm};function Wu(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:V({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ed={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=Yn(),s=Al(a);s.payload=t,n!=null&&(s.callback=n),t=Tl(e,s,a),t!==null&&(Dn(t,e,a),Gi(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=Yn(),s=Al(a);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=Tl(e,s,a),t!==null&&(Dn(t,e,a),Gi(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Yn(),a=Al(n);a.tag=2,t!=null&&(a.callback=t),t=Tl(e,a,n),t!==null&&(Dn(t,e,n),Gi(t,e,n))}};function hp(e,t,n,a,s,r,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,r,f):t.prototype&&t.prototype.isPureReactComponent?!Di(n,a)||!Di(s,r):!0}function mp(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&&ed.enqueueReplaceState(t,t.state,null)}function fs(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=V({},n));for(var s in e)n[s]===void 0&&(n[s]=e[s])}return n}function pp(e){or(e)}function gp(e){console.error(e)}function yp(e){or(e)}function Dr(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function vp(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function td(e,t,n){return n=Al(n),n.tag=3,n.payload={element:null},n.callback=function(){Dr(e,t)},n}function bp(e){return e=Al(e),e.tag=3,e}function xp(e,t,n,a){var s=n.type.getDerivedStateFromError;if(typeof s=="function"){var r=a.value;e.payload=function(){return s(r)},e.callback=function(){vp(t,n,a)}}var f=n.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(e.callback=function(){vp(t,n,a),typeof s!="function"&&(Rl===null?Rl=new Set([this]):Rl.add(this));var p=a.stack;this.componentDidCatch(a.value,{componentStack:p!==null?p:""})})}function Ub(e,t,n,a,s){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&ls(t,n,s,!0),n=dn.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Sn===null?tc():n.alternate===null&&It===0&&(It=3),n.flags&=-257,n.flags|=65536,n.lanes=s,a===xr?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),Id(e,a,s)),!1;case 22:return n.flags|=65536,a===xr?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)),Id(e,a,s)),!1}throw Error(u(435,n.tag))}return Id(e,a,s),tc(),!1}if(tt)return t=dn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,a!==Su&&(e=Error(u(422),{cause:a}),Ui(na(e,n)))):(a!==Su&&(t=Error(u(423),{cause:a}),Ui(na(t,n))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,a=na(a,n),s=td(e.stateNode,a,s),_u(e,s),It!==4&&(It=2)),!1;var r=Error(u(520),{cause:a});if(r=na(r,n),no===null?no=[r]:no.push(r),It!==4&&(It=2),t===null)return!0;a=na(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=s&-s,n.lanes|=e,e=td(n.stateNode,a,e),_u(n,e),!1;case 1:if(t=n.type,r=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||r!==null&&typeof r.componentDidCatch=="function"&&(Rl===null||!Rl.has(r))))return n.flags|=65536,s&=-s,n.lanes|=s,s=bp(s),xp(s,e,n,a),_u(n,s),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var nd=Error(u(461)),Zt=!1;function en(e,t,n,a){t.child=e===null?Tm(t,null,n,a):us(t,e.child,n,a)}function Sp(e,t,n,a,s){n=n.render;var r=t.ref;if("ref"in a){var f={};for(var p in a)p!=="ref"&&(f[p]=a[p])}else f=a;return ss(t),a=Hu(e,t,n,f,r,s),p=Iu(),e!==null&&!Zt?(Bu(e,t,s),tl(e,t,s)):(tt&&p&&hr(t),t.flags|=1,en(e,t,a,s),t.child)}function wp(e,t,n,a,s){if(e===null){var r=n.type;return typeof r=="function"&&!yu(r)&&r.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=r,Ap(e,t,r,a,s)):(e=dr(n.type,null,a,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!ud(e,s)){var f=r.memoizedProps;if(n=n.compare,n=n!==null?n:Di,n(f,a)&&e.ref===t.ref)return tl(e,t,s)}return t.flags|=1,e=Za(r,a),e.ref=t.ref,e.return=t,t.child=e}function Ap(e,t,n,a,s){if(e!==null){var r=e.memoizedProps;if(Di(r,a)&&e.ref===t.ref)if(Zt=!1,t.pendingProps=a=r,ud(e,s))(e.flags&131072)!==0&&(Zt=!0);else return t.lanes=e.lanes,tl(e,t,s)}return ad(e,t,n,a,s)}function Tp(e,t,n,a){var s=a.children,r=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(r=r!==null?r.baseLanes|n:n,e!==null){for(a=t.child=e.child,s=0;a!==null;)s=s|a.lanes|a.childLanes,a=a.sibling;a=s&~r}else a=0,t.child=null;return kp(e,t,r,n,a)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&vr(t,r!==null?r.cachePool:null),r!==null?Nm(t,r):Ou(),Em(t);else return a=t.lanes=536870912,kp(e,t,r!==null?r.baseLanes|n:n,n,a)}else r!==null?(vr(t,r.cachePool),Nm(t,r),Nl(),t.memoizedState=null):(e!==null&&vr(t,null),Ou(),Nl());return en(e,t,s,n),t.child}function Zi(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function kp(e,t,n,a,s){var r=Nu();return r=r===null?null:{parent:Qt._currentValue,pool:r},t.memoizedState={baseLanes:n,cachePool:r},e!==null&&vr(t,null),Ou(),Em(t),e!==null&&ls(e,t,a,!0),t.childLanes=s,null}function Lr(e,t){return t=zr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function jp(e,t,n){return us(t,e.child,null,n),e=Lr(t,t.pendingProps),e.flags|=2,qn(t),t.memoizedState=null,e}function Hb(e,t,n){var a=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(tt){if(a.mode==="hidden")return e=Lr(t,a),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Zi(null,e);if(Lu(t),(e=Et)?(e=Jg(e,sa),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:yl!==null?{id:Ma,overflow:_a}:null,retryLane:536870912,hydrationErrors:null},n=cm(e),n.return=t,t.child=n,ln=t,Et=null)):e=null,e===null)throw bl(t);return t.lanes=536870912,null}return Lr(t,a)}var r=e.memoizedState;if(r!==null){var f=r.dehydrated;if(Lu(t),s)if(t.flags&256)t.flags&=-257,t=jp(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(Zt||ls(e,t,n,!1),s=(n&e.childLanes)!==0,Zt||s){if(kl.current===null){if(a=jt,a!==null&&(f=Kl(a,n),f!==0&&f!==r.retryLane))throw r.retryLane=f,es(e,f),Dn(a,e,f),nd;tc()}t=jp(e,t,n)}else e=r.treeContext,Et=oa(f.nextSibling),ln=t,tt=!0,vl=null,sa=!1,e!==null&&fm(t,e),t=Lr(t,a),t.flags|=134221824;return t}return e=Za(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Vs(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 ad(e,t,n,a,s){return ss(t),n=Hu(e,t,n,a,void 0,s),a=Iu(),e!==null&&!Zt?(Bu(e,t,s),tl(e,t,s)):(tt&&a&&hr(t),t.flags|=1,en(e,t,n,s),t.child)}function Np(e,t,n,a,s,r){return ss(t),t.updateQueue=null,n=Mm(t,a,n,s),Cm(e),a=Iu(),e!==null&&!Zt?(Bu(e,t,r),tl(e,t,r)):(tt&&a&&hr(t),t.flags|=1,en(e,t,n,r),t.child)}function Ep(e,t,n,a,s){if(ss(t),t.stateNode===null){var r=zs,f=n.contextType;typeof f=="object"&&f!==null&&(r=un(f)),r=new n(a,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=ed,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=a,r.state=t.memoizedState,r.refs={},Cu(t),f=n.contextType,r.context=typeof f=="object"&&f!==null?un(f):zs,r.state=t.memoizedState,f=n.getDerivedStateFromProps,typeof f=="function"&&(Wu(t,n,f,a),r.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(f=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),f!==r.state&&ed.enqueueReplaceState(r,r.state,null),Xi(t,a,r,s),$i(),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){r=t.stateNode;var p=t.memoizedProps,T=fs(n,p);r.props=T;var R=r.context,q=n.contextType;f=zs,typeof q=="object"&&q!==null&&(f=un(q));var P=n.getDerivedStateFromProps;q=typeof P=="function"||typeof r.getSnapshotBeforeUpdate=="function",p=t.pendingProps!==p,q||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(p||R!==f)&&mp(t,r,a,f),wl=!1;var M=t.memoizedState;r.state=M,Xi(t,a,r,s),$i(),R=t.memoizedState,p||M!==R||wl?(typeof P=="function"&&(Wu(t,n,P,a),R=t.memoizedState),(T=wl||hp(t,n,T,a,M,R,f))?(q||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(t.flags|=4194308)):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=R),r.props=a,r.state=R,r.context=f,a=T):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{r=t.stateNode,Mu(e,t),f=t.memoizedProps,q=fs(n,f),r.props=q,P=t.pendingProps,M=r.context,R=n.contextType,T=zs,typeof R=="object"&&R!==null&&(T=un(R)),p=n.getDerivedStateFromProps,(R=typeof p=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(f!==P||M!==T)&&mp(t,r,a,T),wl=!1,M=t.memoizedState,r.state=M,Xi(t,a,r,s),$i();var I=t.memoizedState;f!==P||M!==I||wl||e!==null&&e.dependencies!==null&&gr(e.dependencies)?(typeof p=="function"&&(Wu(t,n,p,a),I=t.memoizedState),(q=wl||hp(t,n,q,a,M,I,T)||e!==null&&e.dependencies!==null&&gr(e.dependencies))?(R||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(a,I,T),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(a,I,T)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||f===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=I),r.props=a,r.state=I,r.context=T,a=q):(typeof r.componentDidUpdate!="function"||f===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),a=!1)}return r=a,Vs(e,t),a=(t.flags&128)!==0,r||a?(r=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:r.render(),t.flags|=1,e!==null&&a?(t.child=us(t,e.child,null,s),t.child=us(t,null,n,s)):en(e,t,n,s),t.memoizedState=r.state,e=t.child):e=tl(e,t,s),e}function Cp(e,t,n,a){return ns(),t.flags|=256,en(e,t,n,a),t.child}var ld={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function sd(e){return{baseLanes:e,cachePool:vm()}}function id(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Xn),e}function Mp(e,t,n){var a=t.pendingProps,s=!1,r=(t.flags&128)!==0,f;if((f=r)||(f=e!==null&&e.memoizedState===null?!1:(fn.current&2)!==0),f&&(s=!0,t.flags&=-129),f=(t.flags&32)!==0,t.flags&=-33,e===null){if(tt){if(s?jl(t):Nl(),(e=Et)?(e=Jg(e,sa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:yl!==null?{id:Ma,overflow:_a}:null,retryLane:536870912,hydrationErrors:null},n=cm(e),n.return=t,t.child=n,ln=t,Et=null)):e=null,e===null)throw bl(t);return sf(e)?t.lanes=32:t.lanes=536870912,null}return r=a.children,a=a.fallback,s?(Nl(),s=t.mode,r=zr({mode:"hidden",children:r},s),a=ts(a,s,n,null),r.return=t,a.return=t,r.sibling=a,t.child=r,a=t.child,a.memoizedState=sd(n),a.childLanes=id(e,f,n),t.memoizedState=ld,Zi(null,a)):(jl(t),od(t,r))}var p=e.memoizedState;if(p!==null){var T=p.dehydrated;if(T!==null)return Ib(e,t,r,f,a,T,p,n)}return s?(Nl(),s=a.fallback,r=t.mode,p=e.child,T=p.sibling,a=Za(p,{mode:"hidden",children:a.children}),a.subtreeFlags=p.subtreeFlags&1206910976,T!==null?s=Za(T,s):(s=ts(s,r,n,null),s.flags|=2),s.return=t,a.return=t,a.sibling=s,t.child=a,Zi(null,a),a=t.child,s=e.child.memoizedState,s===null?s=sd(n):(r=s.cachePool,r!==null?(p=Qt._currentValue,r=r.parent!==p?{parent:p,pool:p}:r):r=vm(),s={baseLanes:s.baseLanes|n,cachePool:r}),a.memoizedState=s,a.childLanes=id(e,f,n),t.memoizedState=ld,Zi(e.child,a)):(jl(t),n=e.child,e=n.sibling,n=Za(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(f=t.deletions,f===null?(t.deletions=[e],t.flags|=16):f.push(e)),t.child=n,t.memoizedState=null,n)}function od(e,t){return t=zr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function zr(e,t){return e=Mn(22,e,null,t),e.lanes=0,e}function Ur(e,t,n){return us(t,e.child,null,n),e=od(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ib(e,t,n,a,s,r,f,p){if(n)return t.flags&256?(jl(t),t.flags&=-257,Ur(e,t,p)):t.memoizedState!==null?(Nl(),t.child=e.child,t.flags|=128,null):(Nl(),r=s.fallback,f=t.mode,s=zr({mode:"visible",children:s.children},f),r=ts(r,f,p,null),r.flags|=2,s.return=t,r.return=t,s.sibling=r,t.child=s,us(t,e.child,null,p),s=t.child,s.memoizedState=sd(p),s.childLanes=id(e,a,p),t.memoizedState=ld,Zi(null,s));if(jl(t),sf(r)){if(a=r.nextSibling&&r.nextSibling.dataset,a)var T=a.dgst;return a=T,a!==""&&(s=Error(u(419)),s.stack="",s.digest=a,Ui({value:s,source:null,stack:null})),Ur(e,t,p)}if(Zt||ls(e,t,p,!1),a=(p&e.childLanes)!==0,Zt||a){if(kl.current!==null)return Ur(e,t,p);if(a=jt,a!==null&&(s=Kl(a,p),s!==0&&s!==f.retryLane))throw f.retryLane=s,es(e,s),Dn(a,e,s),nd;return lf(r)||tc(),Ur(e,t,p)}return lf(r)?(t.flags|=192,t.child=e.child,null):(e=f.treeContext,Et=oa(r.nextSibling),ln=t,tt=!0,vl=null,sa=!1,e!==null&&fm(t,e),t=od(t,s.children),t.flags|=134221824,t)}function _p(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),pr(e.return,t,n)}function Rp(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Tr(n)===null&&(t=e),e=e.sibling}return t}function Hr(e,t,n,a,s,r){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:s,treeForkCount:r}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=a,f.tail=n,f.tailMode=s,f.treeForkCount=r)}function rd(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 cd(e,t,n){var a=t.pendingProps,s=a.revealOrder,r=a.tail;a=a.children;var f=fn.current;if(t.flags&128)return Yi(t,f),null;var p=(f&2)!==0;if(p?(f=f&1|2,t.flags|=128):f&=1,Yi(t,f),s==="backwards"&&e!==null?(rd(e),en(e,t,a,n),rd(e)):en(e,t,a,n),a=tt?zi:0,!p&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&_p(e,n,t);else if(e.tag===19)_p(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(s){case"backwards":n=Rp(t.child),n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null,rd(t)),Hr(t,!0,s,null,r,a);break;case"unstable_legacy-backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Tr(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}Hr(t,!0,n,null,r,a);break;case"together":Hr(t,!1,null,null,void 0,a);break;case"independent":t.memoizedState=null;break;default:n=Rp(t.child),n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),Hr(t,!1,s,n,r,a)}return t.child}function Op(e,t,n){var a=t.pendingProps;return xl(t,t.type,a.value),en(e,t,a.children,n),t.child}function tl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),_l|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ls(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=Za(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Za(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ud(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&gr(e)))}function Bb(e,t,n){switch(t.tag){case 3:$(t,t.stateNode.containerInfo),xl(t,Qt,e.memoizedState.cache),ns();break;case 27:case 5:Le(t);break;case 4:$(t,t.stateNode.containerInfo);break;case 10:xl(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Lu(t),null;break;case 13:var a=t.memoizedState;if(a!==null){if(a.dehydrated!==null)return jl(t),t.flags|=128,null;a=ls(e,t,n,!1);var s=t.child.childLanes;return a||(n&s)!==0?Mp(e,t,n):(jl(t),e=tl(e,t,n),e!==null?e.sibling:null)}jl(t);break;case 19:if(t.flags&128)return cd(e,t,n);if(s=(e.flags&128)!==0,a=(n&t.childLanes)!==0,a||(ls(e,t,n,!1),a=(n&t.childLanes)!==0),s){if(a)return cd(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Yi(t,fn.current),a)break;return null;case 22:return t.lanes=0,Tp(e,t,n,t.pendingProps);case 24:xl(t,Qt,e.memoizedState.cache)}return tl(e,t,n)}function Dp(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Zt=!0;else{if(!ud(e,n)&&(t.flags&128)===0)return Zt=!1,Bb(e,t,n);Zt=(e.flags&131072)!==0}else Zt=!1,tt&&(t.flags&1048576)!==0&&dm(t,zi,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=rs(t.elementType),t.type=e,typeof e=="function")yu(e)?(a=fs(e,a),t.tag=1,t=Ep(null,t,e,a,n)):(t.tag=0,t=ad(null,t,e,a,n));else{if(e!=null){var s=e.$$typeof;if(s===ae){t.tag=11,t=Sp(null,t,e,a,n);break e}else if(s===F){t.tag=14,t=wp(null,t,e,a,n);break e}else if(s===Ce){t.tag=10,t.type=e,t=Op(null,t,n);break e}}throw t=Oe(e)||e,Error(u(306,t,""))}}return t;case 0:return ad(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,s=fs(a,t.pendingProps),Ep(e,t,a,s,n);case 3:e:{if($(t,t.stateNode.containerInfo),e===null)throw Error(u(387));a=t.pendingProps;var r=t.memoizedState;s=r.element,Mu(e,t),Xi(t,a,null,n);var f=t.memoizedState;if(a=f.cache,xl(t,Qt,a),a!==r.cache&&Tu(t,[Qt],n,!0),$i(),a=f.element,r.isDehydrated)if(r={element:a,isDehydrated:!1,cache:f.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=Cp(e,t,a,n);break e}else if(a!==s){s=na(Error(u(424)),t),Ui(s),t=Cp(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(Et=oa(e.firstChild),ln=t,tt=!0,vl=null,sa=!0,n=Tm(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ns(),a===s){t=tl(e,t,n);break e}en(e,t,a,n)}t=t.child}return t;case 26:return Vs(e,t),e===null?(n=sy(t.type,null,t.pendingProps,null))?t.memoizedState=n:tt||(t.stateNode=Hg(t.type,t.pendingProps,xe.current,t)):t.memoizedState=sy(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Le(t),e===null&&tt&&(a=t.stateNode=ty(t.type,t.pendingProps,xe.current),ln=t,sa=!0,s=Et,Ll(t.type)?(of=s,Et=oa(a.firstChild)):Et=s),en(e,t,t.pendingProps.children,n),Vs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&tt&&((s=a=Et)&&(a=Dx(a,t.type,t.pendingProps,sa),a!==null?(t.stateNode=a,ln=t,Et=oa(a.firstChild),sa=!1,s=!0):s=!1),s||bl(t)),Le(t),s=t.type,r=t.pendingProps,f=e!==null?e.memoizedProps:null,a=r.children,Fd(s,r)?a=null:f!==null&&Fd(s,f)&&(t.flags|=32),t.memoizedState!==null&&(s=Hu(e,t,Cb,null,null,n),ui._currentValue=s),Vs(e,t),en(e,t,a,n),t.child;case 6:return e===null&&tt&&((e=n=Et)&&(n=Lx(n,t.pendingProps,sa),n!==null?(t.stateNode=n,ln=t,Et=null,e=!0):e=!1),e||bl(t)),null;case 13:return Mp(e,t,n);case 4:return $(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=us(t,null,a,n):en(e,t,a,n),t.child;case 11:return Sp(e,t,t.type,t.pendingProps,n);case 7:return a=t.pendingProps,Vs(e,t),en(e,t,a,n),t.child;case 8:return en(e,t,t.pendingProps.children,n),t.child;case 12:return en(e,t,t.pendingProps.children,n),t.child;case 10:return Op(e,t,n);case 9:return s=t.type._context,a=t.pendingProps.children,ss(t),s=un(s),a=a(s),t.flags|=1,en(e,t,a,n),t.child;case 14:return wp(e,t,t.type,t.pendingProps,n);case 15:return Ap(e,t,t.type,t.pendingProps,n);case 19:return cd(e,t,n);case 31:return Hb(e,t,n);case 22:return Tp(e,t,n,t.pendingProps);case 24:return ss(t),a=un(Qt),e===null?(s=Nu(),s===null&&(s=jt,r=ku(),s.pooledCache=r,r.refCount++,r!==null&&(s.pooledCacheLanes|=n),s=r),t.memoizedState={parent:a,cache:s},Cu(t),xl(t,Qt,s)):((e.lanes&n)!==0&&(Mu(e,t),Xi(t,null,null,n),$i()),s=e.memoizedState,r=t.memoizedState,s.parent!==a?(s={parent:a,cache:a},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),xl(t,Qt,a)):(a=r.cache,xl(t,Qt,a),a!==s.cache&&Tu(t,[Qt],n,!0))),en(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:tt&&hr(t),e!==null&&e.memoizedProps.name!==a.name?t.flags|=4194816:Vs(e,t),en(e,t,a.children,n),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function nl(e){e.flags|=4}function dd(e,t,n,a,s){var r;if((r=(e.mode&32)!==0)&&(r=n===null?cy(t,a):cy(t,a)&&(a.src!==n.src||a.srcSet!==n.srcSet)),r){if(e.flags|=16777216,(s&335544128)===s)if(e.stateNode.complete)e.flags|=8192;else if(pg())e.flags|=8192;else throw cs=xr,Eu}else e.flags&=-16777217}function Lp(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!uy(t))if(pg())e.flags|=8192;else throw cs=xr,Eu}function Ir(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?At():536870912,e.lanes|=t,Fs|=t)}function Pi(e,t){if(!tt)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 Ct(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,a|=s.subtreeFlags&1206910976,a|=s.flags&1206910976,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,a|=s.subtreeFlags,a|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function qb(e,t,n){var a=t.pendingProps;switch(xu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ct(t),null;case 1:return Ct(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Ja(Qt),De(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Is(t)?nl(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,wu())),Ct(t),null;case 26:var s=t.type,r=t.memoizedState;return e===null?(nl(t),r!==null?(Ct(t),Lp(t,r)):(Ct(t),dd(t,s,null,a,n))):r?r!==e.memoizedState?(nl(t),Ct(t),Lp(t,r)):(Ct(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&nl(t),Ct(t),dd(t,s,e,a,n)),null;case 27:if(dt(t),n=xe.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&nl(t);else{if(!a){if(t.stateNode===null)throw Error(u(166));return Ct(t),t.subtreeFlags&=-33554433,null}e=le.current,Is(t)?hm(t):(e=ty(s,a,n),t.stateNode=e,nl(t))}return Ct(t),t.subtreeFlags&=-33554433,null;case 5:if(dt(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&nl(t);else{if(!a){if(t.stateNode===null)throw Error(u(166));return Ct(t),t.subtreeFlags&=-33554433,null}if(r=le.current,Is(t))hm(t);else{var f=oo(xe.current);switch(r){case 1:r=f.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:r=f.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":r=f.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":r=f.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":r=f.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof a.is=="string"?f.createElement("select",{is:a.is}):f.createElement("select"),a.multiple?r.multiple=!0:a.size&&(r.size=a.size);break;default:r=typeof a.is=="string"?f.createElement(s,{is:a.is}):f.createElement(s)}}r[Yt]=t,r[Wt]=a;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)r.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=r;e:switch(mn(r,s,a),s){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&nl(t)}}return Ct(t),t.subtreeFlags&=-33554433,dd(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&nl(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(u(166));if(e=xe.current,Is(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,s=ln,s!==null)switch(s.tag){case 27:case 5:a=s.memoizedProps}e[Yt]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||Dg(e.nodeValue,n)),e||bl(t,!0)}else e=oo(e).createTextNode(a),e[Yt]=t,t.stateNode=e}return Ct(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Is(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[Yt]=t}else ns(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ct(t),e=!1}else n=wu(),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 Ct(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Is(t),a!==null&&a.dehydrated!==null){if(e===null){if(!s)throw Error(u(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(u(317));s[Yt]=t}else ns(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ct(t),s=!1}else s=wu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)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,s=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(s=a.alternate.memoizedState.cachePool.pool),r=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==s&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ir(t,t.updateQueue),Ct(t),null);case 4:return De(),e===null&&Vd(t.stateNode.containerInfo),t.flags|=67108864,Ct(t),null;case 10:return Ja(t.type),Ct(t),null;case 19:if(zu(t),a=t.memoizedState,a===null)return Ct(t),null;if(s=(t.flags&128)!==0,r=a.rendering,r===null)if(s)Pi(a,!1);else{if(It!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=Tr(e),r!==null){for(t.flags|=128,Pi(a,!1),e=r.updateQueue,t.updateQueue=e,Ir(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)rm(n,e),n=n.sibling;return Yi(t,fn.current&1|2),tt&&Pa(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&Ot()>Fr&&(t.flags|=128,s=!0,Pi(a,!1),t.lanes=4194304)}else{if(!s)if(e=Tr(r),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Ir(t,e),Pi(a,!0),a.tail===null&&a.tailMode!=="collapsed"&&a.tailMode!=="visible"&&!r.alternate&&!tt)return Ct(t),null}else 2*Ot()-a.renderingStartTime>Fr&&n!==536870912&&(t.flags|=128,s=!0,Pi(a,!1),t.lanes=4194304);a.isBackwards?(r.sibling=t.child,t.child=r):(e=a.last,e!==null?e.sibling=r:t.child=r,a.last=r)}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=Ot(),e.sibling=null,r=fn.current,r=s?r&1|2:r&1,a.tailMode==="visible"||a.tailMode==="collapsed"||!n||tt?Yi(t,r):(n=r,_e(dn,t),_e(fn,n),Sn===null&&(Sn=t)),tt&&Pa(t,a.treeForkCount),e}return Ct(t),null;case 22:case 23:return qn(t),Du(),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&&(Ct(t),t.subtreeFlags&6&&(t.flags|=8192)):Ct(t),n=t.updateQueue,n!==null&&Ir(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(os),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ja(Qt),Ct(t),null;case 25:return null;case 30:return t.flags|=33554432,Ct(t),null}throw Error(u(156,t.tag))}function Gb(e,t){switch(xu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ja(Qt),De(),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));ns()}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));ns()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return zu(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 De(),null;case 10:return Ja(t.type),null;case 22:case 23:return qn(t),Du(),e!==null&&Be(os),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ja(Qt),null;case 25:return null;default:return null}}function zp(e,t){switch(xu(t),t.tag){case 3:Ja(Qt),De();break;case 26:case 27:case 5:dt(t);break;case 4:De();break;case 31:t.memoizedState!==null&&qn(t);break;case 13:qn(t);break;case 19:zu(t);break;case 10:Ja(t.type);break;case 22:case 23:qn(t),Du(),e!==null&&Be(os);break;case 24:Ja(Qt)}}function Fi(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var s=a.next;n=s;do{if((n.tag&e)===e){a=void 0;var r=n.create,f=n.inst;a=r(),f.destroy=a}n=n.next}while(n!==s)}}catch(p){xt(t,t.return,p)}}function El(e,t,n){try{var a=t.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var r=s.next;a=r;do{if((a.tag&e)===e){var f=a.inst,p=f.destroy;if(p!==void 0){f.destroy=void 0,s=t;var T=n,R=p;try{R()}catch(q){xt(s,T,q)}}}a=a.next}while(a!==r)}}catch(q){xt(t,t.return,q)}}function Up(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{jm(t,n)}catch(a){xt(e,e.return,a)}}}function Hp(e,t,n){n.props=fs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){xt(e,t,a)}}function Ra(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 s=e.stateNode,r=Qa(e.memoizedProps,s);(s.ref===null||s.ref.name!==r)&&(s.ref=Yg(r)),a=s.ref;break;case 7:if(e.stateNode===null){var f=new Vn(e);v(e.child,!1,Rx,f,void 0,void 0),e.stateNode=f}a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(p){xt(e,t,p)}}function hn(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(s){xt(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(s){xt(e,t,s)}else n.current=null}function Br(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++)Fg(e.stateNode,t[n])}function Ip(e){for(var t=e.return;t!==null&&(hd(t)&&Fg(e.stateNode,t.stateNode),!fd(t));)t=t.return}function Ji(e){for(var t=e.return;t!==null&&(hd(t)&&Ox(e.stateNode,t.stateNode),!fd(t));)t=t.return}function fd(e){return e.tag===5||e.tag===3||e.tag===27}function hd(e){return e&&e.tag===7&&e.stateNode!==null}function md(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(s){xt(e,e.return,s)}}function pd(e,t,n){try{var a=e.stateNode;mx(a,e.type,n,t),a[Wt]=t}catch(s){xt(e,e.return,s)}}function Bp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ll(e.type)||e.tag===4}function gd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Bp(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&&Ll(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 yd(e,t,n,a){var s=e.tag;if(s===5||s===6)s=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(s,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(s),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ca)),Br(e,a),rt=!0;else if(s!==4&&(s===27&&(Br(e,a),a=null,Ll(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(yd(e,t,n,a),e=e.sibling;e!==null;)yd(e,t,n,a),e=e.sibling}function qr(e,t,n,a){var s=e.tag;if(s===5||s===6)s=e.stateNode,t?n.insertBefore(s,t):n.appendChild(s),Br(e,a),rt=!0;else if(s!==4&&(s===27&&(Br(e,a),a=null,Ll(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(qr(e,t,n,a),e=e.sibling;e!==null;)qr(e,t,n,a),e=e.sibling}function qp(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);mn(t,a,n),t[Yt]=e,t[Wt]=n}catch(r){xt(e,e.return,r)}}var Gr=!1,Gn=null;function Gp(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Gr=!0)}var Oa=null;function $p(){var e=Oa;return Oa=null,e}var _n=0;function Qs(e,t,n,a,s){return _n=0,Xp(e.child,t,n,a,s)}function Xp(e,t,n,a,s){for(var r=!1;e!==null;){if(e.tag===5){var f=e.stateNode;if(a!==null){var p=ef(f);a.push(p),p.view&&(r=!0)}else r||ef(f).view&&(r=!0);Gr=!0,$g(f,_n===0?t:t+"_"+_n,n),_n++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&s||Xp(e.child,t,n,a,s)&&(r=!0));e=e.sibling}return r}function Da(e,t){for(;e!==null;)e.tag===5?Xg(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Da(e.child,t)),e=e.sibling}function $r(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&($r(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=Ka(t.default,t.share),t!=="none"&&(Qs(e,n,t,null,!1)||Da(e.child,!1))}e=e.sibling}}function vd(e,t){if(e.tag===30){var n=e.stateNode,a=e.memoizedProps,s=Qa(a,n),r=Ka(a.default,n.paired?a.share:a.enter);r!=="none"?Qs(e,s,r,null,!1)?($r(e),n.paired||t||ti(e,a.onEnter)):Da(e.child,!1):$r(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)vd(e,t),e=e.sibling;else $r(e)}function bd(e){if(Gn!==null&&Gn.size!==0){var t=Gn;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 s=t.get(a);if(s!==void 0){var r=Ka(n.default,n.share);if(r!=="none"&&(Qs(e,a,r,null,!1)?(r=e.stateNode,s.paired=r,r.paired=s,ti(e,n.onShare)):Da(e.child,!1)),t.delete(a),t.size===0)break}}}bd(e)}e=e.sibling}}}function xd(e){if(e.tag===30){var t=e.memoizedProps,n=Qa(t,e.stateNode),a=Gn!==null?Gn.get(n):void 0,s=Ka(t.default,a!==void 0?t.share:t.exit);s!=="none"&&(Qs(e,n,s,null,!1)?a!==void 0?(s=e.stateNode,a.paired=s,s.paired=a,Gn.delete(n),ti(e,t.onShare)):ti(e,t.onExit):Da(e.child,!1)),Gn!==null&&bd(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)xd(e),e=e.sibling;else Gn!==null&&bd(e)}function Yp(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=Qa(t,e.stateNode);t=Ka(t.default,t.update),e.flags&=-5,t!=="none"&&Qs(e,n,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&Yp(e);e=e.sibling}}function Sd(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,Da(e.child,!1))}Sd(e)}e=e.sibling}}function Xr(e){if(e.tag===30)e.stateNode.paired=null,Da(e.child,!1),Sd(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Xr(e),e=e.sibling;else Sd(e)}function Vp(e){for(e=e.child;e!==null;)e.tag===30?Da(e.child,!1):(e.subtreeFlags&33554432)!==0&&Vp(e),e=e.sibling}function wd(e,t,n,a,s,r,f){for(var p=!1;t!==null;){if(t.tag===5){var T=t.stateNode;if(r!==null&&_n<r.length){var R=r[_n],q=ef(T);(R.view||q.view)&&(p=!0);var P;if(P=(e.flags&4)===0)if(q.clip)P=!0;else{P=R.rect;var M=q.rect;P=P.y!==M.y||P.x!==M.x||P.height!==M.height||P.width!==M.width}P&&(e.flags|=4),q.abs?q=!R.abs:(R=R.rect,q=q.rect,q=R.height!==q.height||R.width!==q.width),q&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&$g(T,_n===0?n:n+"_"+_n,s),p&&(e.flags&4)!==0||(Oa===null&&(Oa=[]),Oa.push(T,_n===0?a:a+"_"+_n,t.memoizedProps)),_n++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&f?e.flags|=t.flags&32:wd(e,t.child,n,a,s,r,f)&&(p=!0));t=t.sibling}return p}function Qp(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,a=e.stateNode,s=Qa(n,a),r=Ka(n.default,n.update),f;f=e.memoizedState,e.memoizedState=null,a=e;var p=e.child;_n=0,s=wd(a,p,s,s,r,f,!1),(e.flags&4)!==0&&s&&ti(e,n.onUpdate)}else(e.subtreeFlags&33554432)!==0&&Qp(e);e=e.sibling}}var sn=!1,pt=!1,La=!1,Ad=!1,Kp=typeof WeakSet=="function"?WeakSet:Set,on=null,za=!1,Wi=!1,Yr=!1,Td=!1;function $b(e,t,n){if(e=e.containerInfo,Zd=di,e=Jh(e),uu(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var s=a.getSelection&&a.getSelection();if(s&&s.rangeCount!==0){a=s.anchorNode;var r=s.anchorOffset,f=s.focusNode;s=s.focusOffset;try{a.nodeType,f.nodeType}catch{a=null;break e}var p=0,T=-1,R=-1,q=0,P=0,M=e,I=null;t:for(;;){for(var ge;M!==a||r!==0&&M.nodeType!==3||(T=p+r),M!==f||s!==0&&M.nodeType!==3||(R=p+s),M.nodeType===3&&(p+=M.nodeValue.length),(ge=M.firstChild)!==null;)I=M,M=ge;for(;;){if(M===e)break t;if(I===a&&++q===r&&(T=p),I===f&&++P===s&&(R=p),(ge=M.nextSibling)!==null)break;M=I,I=M.parentNode}M=ge}a=T===-1||R===-1?null:{start:T,end:R}}else a=null}a=a||{start:0,end:0}}else a=null;for(Pd={focusedElem:e,selectionRange:a},di=!1,n=(n&335544064)===n,on=t,t=n?9270:1024;on!==null;){if(e=on,n&&(a=e.deletions,a!==null))for(r=0;r<a.length;r++)n&&xd(a[r]);if(e.alternate===null&&(e.flags&2)!==0)n&&Gp(e),Vr(n);else{if(e.tag===22){if(a=e.alternate,e.memoizedState!==null){a!==null&&a.memoizedState===null&&n&&xd(a),Vr(n);continue}else if(a!==null&&a.memoizedState!==null){n&&Gp(e),Vr(n);continue}}a=e.child,(e.subtreeFlags&t)!==0&&a!==null?(a.return=e,on=a):(n&&Yp(e),Vr(n))}}Gn=null}function Vr(e){for(;on!==null;){var t=on,n=e,a=t.alternate,s=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((s&1024)!==0&&a!==null){n=void 0,s=a.memoizedProps,a=a.memoizedState;var r=t.stateNode;try{var f=fs(t.type,s);n=r.getSnapshotBeforeUpdate(f,a),r.__reactInternalSnapshotBeforeUpdate=n}catch(p){xt(t,t.return,p)}}break;case 3:if((s&1024)!==0){if(a=t.stateNode.containerInfo,n=a.nodeType,n===9)af(a);else if(n===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":af(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=Qa(a.memoizedProps,a.stateNode),s=t.memoizedProps,s=Ka(s.default,s.update),s!=="none"&&Qs(a,n,s,a.memoizedState=[],!0));break;default:if((s&1024)!==0)throw Error(u(163))}if(a=t.sibling,a!==null){a.return=t.return,on=a;break}on=t.return}}function Zp(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:Ua(e,n),a&4&&Fi(5,n);break;case 1:if(Ua(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(f){xt(n,n.return,f)}else{var s=fs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(f){xt(n,n.return,f)}}a&64&&Up(n),a&512&&Ra(n,n.return);break;case 3:if(Ua(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{jm(e,t)}catch(f){xt(n,n.return,f)}}break;case 27:t===null&&a&4&&qp(n);case 26:case 5:Ua(e,n),t===null&&a&4&&md(n),a&512&&Ra(n,n.return);break;case 12:Ua(e,n);break;case 31:Ua(e,n),a&4&&Wp(e,n);break;case 13:Ua(e,n),a&4&&eg(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=tx.bind(null,n),zx(e,n))));break;case 22:if(a=n.memoizedState!==null||sn,!a){var r=t!==null&&t.memoizedState!==null||pt;t=sn,s=pt,sn=a,(pt=r)&&!s?(a=2,(n.subtreeFlags&8772)!==0&&(a|=1),va(e,n,a)):Ua(e,n),sn=t,pt=s}break;case 30:Ua(e,n),a&512&&Ra(n,n.return);break;case 7:a&512&&Ra(n,n.return);default:Ua(e,n)}}function kd(e,t){for(e=e.child;e!==null;)Pp(e,t),e=e.sibling}function Pp(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 s=e.stateNode,r=e.memoizedProps.style,f=r!=null&&r.hasOwnProperty("display")?r.display:null;s.style.display=f==null||typeof f=="boolean"?"":(""+f).trim()}}catch(T){xt(e,e.return,T)}jd(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,rt=!0}catch(T){xt(e,e.return,T)}break;case 18:try{var p=e.stateNode;t?Gg(p,!0):Gg(e.stateNode,!1)}catch(T){xt(e,e.return,T)}break;case 22:case 23:e.memoizedState===null&&kd(e,t);break;default:kd(e,t)}}function jd(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var n=e,a=t;switch(n.tag){case 4:Pp(n,a);break e;case 22:n.memoizedState===null&&jd(n,a);break e;default:jd(n,a)}}e=e.sibling}}function Fp(e){var t=e.alternate;t!==null&&(e.alternate=null,Fp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&$a(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 Dt=null,Rn=!1;function ga(e,t,n){for(n=n.child;n!==null;)Jp(e,t,n),n=n.sibling}function Jp(e,t,n){if(qe&&typeof qe.onCommitFiberUnmount=="function")try{qe.onCommitFiberUnmount(Ye,n)}catch{}switch(n.tag){case 26:pt||hn(n,t),ga(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!pt&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:pt||hn(n,t),Ji(n);var a=Dt,s=Rn;Ll(n.type)&&(Dt=n.stateNode,Rn=!1),ga(e,t,n),ny(n.stateNode,n.type,n.memoizedProps),Dt=a,Rn=s;break;case 5:pt||hn(n,t),Ji(n);case 6:if(n.tag===6&&Ji(n),a=Dt,s=Rn,Dt=null,ga(e,t,n),Dt=a,Rn=s,Dt!==null)if(Rn)try{(Dt.nodeType===9?Dt.body:Dt.nodeName==="HTML"?Dt.ownerDocument.body:Dt).removeChild(n.stateNode),rt=!0}catch(r){xt(n,t,r)}else try{Dt.removeChild(n.stateNode),rt=!0}catch(r){xt(n,t,r)}break;case 18:Dt!==null&&(Rn?(e=Dt,qg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),fi(e)):qg(Dt,n.stateNode));break;case 4:a=Dt,s=Rn,Dt=n.stateNode.containerInfo,Rn=!0,ga(e,t,n),Dt=a,Rn=s;break;case 0:case 11:case 14:case 15:El(2,n,t),pt||El(4,n,t),ga(e,t,n);break;case 1:pt||(hn(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&Hp(n,t,a)),ga(e,t,n);break;case 21:ga(e,t,n);break;case 22:pt=(a=pt)||n.memoizedState!==null,ga(e,t,n),pt=a;break;case 30:hn(n,t),ga(e,t,n);break;case 7:pt||hn(n,t),ga(e,t,n);break;default:ga(e,t,n)}}function Wp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{fi(e)}catch(n){xt(t,t.return,n)}}}function eg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{fi(e)}catch(n){xt(t,t.return,n)}}function Xb(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Kp),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Kp),t;default:throw Error(u(435,e.tag))}}function Qr(e,t){var n=Xb(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var s=nx.bind(null,e,a);a.then(s,s)}})}function kn(e,t,n){var a=t.deletions;if(a!==null)for(var s=0;s<a.length;s++){var r=a[s],f=e,p=t,T=p;e:for(;T!==null;){switch(T.tag){case 27:if(Ll(T.type)){Dt=T.stateNode,Rn=!1;break e}break;case 5:Dt=T.stateNode,Rn=!1;break e;case 3:case 4:Dt=T.stateNode.containerInfo,Rn=!0;break e}T=T.return}if(Dt===null)throw Error(u(160));Jp(f,p,r),Dt=null,Rn=!1,f=r.alternate,f!==null&&(f.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)tg(t,e,n),t=t.sibling}var ya=null;function tg(e,t,n){var a=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(s&4&&(a=e.updateQueue,a=a!==null?a.events:null,a!==null))for(var r=0;r<a.length;r++){var f=a[r];f.ref.impl=f.nextImpl}kn(t,e,n),jn(e),s&4&&(El(3,e,e.return),Fi(3,e),El(5,e,e.return));break;case 1:kn(t,e,n),jn(e),s&512&&(pt||a===null||hn(a,a.return)),s&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(r=ya,kn(t,e,n),jn(e),s&512&&(pt||a===null||hn(a,a.return)),s&4)if(s=a!==null?a.memoizedState:null,n=e.memoizedState,a===null)if(n===null)if(e.stateNode===null)if(sn)e.stateNode=Hg(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,n=e.memoizedProps,s=r.ownerDocument||r;t:switch(t){case"title":a=s.getElementsByTagName("title")[0],(!a||a[ml]||a[Yt]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=s.createElement(t),s.head.insertBefore(a,s.querySelector("head > title"))),mn(a,t,n),a[Yt]=e,vt(a),t=a;break e;case"link":if(r=ry("link","href",s).get(t+(n.href||""))){for(f=0;f<r.length;f++)if(a=r[f],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)){r.splice(f,1);break t}}a=s.createElement(t),mn(a,t,n),s.head.appendChild(a);break;case"meta":if(r=ry("meta","content",s).get(t+(n.content||""))){for(f=0;f<r.length;f++)if(a=r[f],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)){r.splice(f,1);break t}}a=s.createElement(t),mn(a,t,n),s.head.appendChild(a);break;default:throw Error(u(468,t))}a[Yt]=e,vt(a),t=a}e.stateNode=t}else sn||df(r,e.type,e.stateNode);else e.stateNode=oy(r,n,e.memoizedProps);else s!==n?(s===null?(t=a.stateNode,t===null||pt||t.parentNode.removeChild(t)):s.count--,n===null?sn||df(r,e.type,e.stateNode):oy(r,n,e.memoizedProps)):n===null&&e.stateNode!==null&&pd(e,e.memoizedProps,a.memoizedProps);break;case 27:kn(t,e,n),jn(e),s&512&&(pt||a===null||hn(a,a.return)),a!==null&&s&4&&pd(e,e.memoizedProps,a.memoizedProps);break;case 5:if(r=La,La=!1,kn(t,e,n),La=r,jn(e),s&512&&(pt||a===null||hn(a,a.return)),e.flags&32){t=e.stateNode;try{Ut(t,""),rt=!0}catch(q){xt(e,e.return,q)}}s&4&&e.stateNode!=null&&(t=e.memoizedProps,pd(e,t,a!==null?a.memoizedProps:t)),s&1024&&(Ad=!0);break;case 6:if(kn(t,e,n),jn(e),s&4){if(e.stateNode===null)throw Error(u(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,rt=!0}catch(q){xt(e,e.return,q)}}break;case 3:if(rt=!1,rc=null,r=ya,ya=ro(t.containerInfo),kn(t,e,n),ya=r,jn(e),s&4&&a!==null&&a.memoizedState.isDehydrated)try{fi(t.containerInfo)}catch(q){xt(e,e.return,q)}Ad&&(Ad=!1,ng(e)),rt=!1;break;case 4:s=La,La=sn,a=Jo(),r=ya,ya=ro(e.stateNode.containerInfo),kn(t,e,n),jn(e),ya=r,rt&&Wi&&(Yr=!0),rt=a,La=s;break;case 12:kn(t,e,n),jn(e);break;case 31:kn(t,e,n),jn(e),s&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Qr(e,t)));break;case 13:kn(t,e,n),jn(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Pr=Ot()),s&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Qr(e,t)));break;case 22:r=e.memoizedState!==null,f=a!==null&&a.memoizedState!==null;var p=sn,T=pt,R=La;sn=p||r,La=R||r,pt=T||f,kn(t,e,n),pt=T,La=R,sn=p,jn(e),s&8192&&(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,!r||a===null||f||sn||pt||(t=f||pt,n=sn,a=pt,sn=r||sn,pt=t,Cl(e,2),sn=n,pt=a),!r&&La||kd(e,r)),s&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Qr(e,n))));break;case 19:kn(t,e,n),jn(e),s&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Qr(e,t)));break;case 30:s&512&&(pt||a===null||hn(a,a.return)),s=Jo(),r=Wi,f=(n&335544064)===n,p=e.memoizedProps,Wi=f&&Ka(p.default,p.update)!=="none",kn(t,e,n),jn(e),f&&a!==null&&rt&&(e.flags|=4),Wi=r,rt=s;break;case 21:break;case 7:s&512&&(pt||a===null||hn(a,a.return)),a&&a.stateNode!==null&&(a.stateNode._fragmentFiber=e);default:kn(t,e,n),jn(e)}}function jn(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(Bp(a)){n=a;break}a=a.return}a=null;for(var s=e.return;s!==null;){if(hd(s)){var r=s.stateNode;a===null?a=[r]:a.push(r)}if(fd(s))break;s=s.return}var f=a;if(n==null)throw Error(u(160));switch(n.tag){case 27:var p=n.stateNode,T=gd(e);qr(e,T,p,f);break;case 5:var R=n.stateNode;n.flags&32&&(Ut(R,""),n.flags&=-33);var q=gd(e);qr(e,q,R,f);break;case 3:case 4:var P=n.stateNode.containerInfo,M=gd(e);yd(e,M,P,f);break;default:throw Error(u(161))}}catch(I){xt(e,e.return,I)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ng(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ng(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,di=!0,t.reset(),di=!1),e=e.sibling}}function Ks(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)ag(t,e),t=t.sibling;else Qp(t)}function ag(e,t){var n=e.alternate;if(n===null)vd(e,!1);else switch(e.tag){case 3:if(Td=za=!1,$p(),Ks(t,e),!za&&!Yr){if(e=Oa,e!==null)for(var a=0;a<e.length;a+=3){n=e[a];var s=e[a+1];Xg(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("+s+")"})}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"})),Td=!0}Oa=null;break;case 5:Ks(t,e);break;case 4:a=za,za=!1,Ks(t,e),za&&(Yr=!0),za=a;break;case 22:e.memoizedState===null&&(n.memoizedState!==null?vd(e,!1):Ks(t,e));break;case 30:a=za,s=$p(),za=!1,Ks(t,e),za&&(e.flags|=4);var r=e.memoizedProps,f=e.stateNode;t=Qa(r,f),f=Qa(n.memoizedProps,f);var p=Ka(r.default,r.update);p==="none"?t=!1:(r=n.memoizedState,n.memoizedState=null,n=e.child,_n=0,t=wd(e,n,t,f,p,r,!0),_n!==(r===null?0:r.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(ti(e,e.memoizedProps.onUpdate),Oa=s):s!==null&&(s.push.apply(s,Oa),Oa=s),za=(e.flags&32)!==0?!0:a;break;default:Ks(t,e)}}function Ua(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Zp(e,t.alternate,t),t=t.sibling}function Cl(e,t){for(e=e.child;e!==null;){var n=e,a=t;switch(n.tag){case 0:case 11:case 14:case 15:El(4,n,n.return),Cl(n,a);break;case 1:hn(n,n.return);var s=n.stateNode;typeof s.componentWillUnmount=="function"&&Hp(n,n.return,s),Cl(n,a);break;case 27:(a&2)!==0&&ny(n.stateNode,n.type,n.memoizedProps);case 5:hn(n,n.return),n.tag!==5&&n.tag!==27||Ji(n),Cl(n,a);break;case 6:Ji(n);break;case 26:hn(n,n.return),s=n.stateNode,n.memoizedState!==null||s===null||pt||s.parentNode.removeChild(s),Cl(n,a);break;case 22:n.memoizedState===null&&Cl(n,a);break;case 30:hn(n,n.return),Cl(n,a);break;case 7:hn(n,n.return);default:Cl(n,a)}e=e.sibling}}function va(e,t,n){for(n=(t.subtreeFlags&8772)!==0?n:n&-2,t=t.child;t!==null;){var a=t.alternate,s=e,r=t,f=r.flags,p=(n&1)!==0;switch(r.tag){case 0:case 11:case 15:va(s,r,n),Fi(4,r);break;case 1:if(va(s,r,n),a=r,s=a.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(q){xt(a,a.return,q)}if(a=r,s=a.updateQueue,s!==null){var T=a.stateNode;try{var R=s.shared.hiddenCallbacks;if(R!==null)for(s.shared.hiddenCallbacks=null,s=0;s<R.length;s++)km(R[s],T)}catch(q){xt(a,a.return,q)}}p&&f&64&&Up(r),Ra(r,r.return);break;case 27:(n&2)!==0&&qp(r);case 5:r.tag!==5&&r.tag!==27||Ip(r),va(s,r,n),p&&a===null&&f&4&&md(r),Ra(r,r.return);break;case 6:Ip(r);break;case 26:T=r.stateNode,r.memoizedState!==null||T===null||sn||df(ro(T.ownerDocument),r.type,T),va(s,r,n),p&&a===null&&f&4&&md(r),Ra(r,r.return);break;case 12:va(s,r,n);break;case 31:va(s,r,n),p&&f&4&&Wp(s,r);break;case 13:va(s,r,n),p&&f&4&&eg(s,r);break;case 22:r.memoizedState===null&&va(s,r,n),Ra(r,r.return);break;case 30:va(s,r,n),Ra(r,r.return);break;case 7:Ra(r,r.return);default:va(s,r,n)}t=t.sibling}}function Nd(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&&Hi(n))}function Ed(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Hi(e))}function ia(e,t,n,a){var s=(n&335544064)===n;if(t.subtreeFlags&(s?10262:10256))for(t=t.child;t!==null;)lg(e,t,n,a),t=t.sibling;else s&&Vp(t)}function lg(e,t,n,a){var s=(n&335544064)===n;s&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Xr(t);var r=t.flags;switch(t.tag){case 0:case 11:case 15:ia(e,t,n,a),r&2048&&Fi(9,t);break;case 1:ia(e,t,n,a);break;case 3:ia(e,t,n,a),s&&Td&&(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="")),r&2048&&(r=null,t.alternate!==null&&(r=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==r&&(t.refCount++,r!=null&&Hi(r)));break;case 12:if(r&2048){ia(e,t,n,a),r=t.stateNode;try{var f=t.memoizedProps,p=f.id,T=f.onPostCommit;typeof T=="function"&&T(p,t.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(R){xt(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:f=t.stateNode,p=t.alternate,t.memoizedState!==null?(s&&p!==null&&p.memoizedState===null&&Xr(p),f._visibility&2?ia(e,t,n,a):eo(e,t)):(s&&p!==null&&p.memoizedState!==null&&Xr(t),f._visibility&2?ia(e,t,n,a):(f._visibility|=2,Zs(e,t,n,a,(t.subtreeFlags&10256)!==0||!1))),r&2048&&Nd(p,t);break;case 24:ia(e,t,n,a),r&2048&&Ed(t.alternate,t);break;case 30:s&&(r=t.alternate,r!==null&&(Da(r.child,!0),Da(t.child,!0))),ia(e,t,n,a);break;default:ia(e,t,n,a)}}function Zs(e,t,n,a,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var r=e,f=t,p=n,T=a,R=f.flags;switch(f.tag){case 0:case 11:case 15:Zs(r,f,p,T,s),Fi(8,f);break;case 23:break;case 22:var q=f.stateNode;f.memoizedState!==null?q._visibility&2?Zs(r,f,p,T,s):eo(r,f):(q._visibility|=2,Zs(r,f,p,T,s)),s&&R&2048&&Nd(f.alternate,f);break;case 24:Zs(r,f,p,T,s),s&&R&2048&&Ed(f.alternate,f);break;default:Zs(r,f,p,T,s)}t=t.sibling}}function eo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,s=a.flags;switch(a.tag){case 22:eo(n,a),s&2048&&Nd(a.alternate,a);break;case 24:eo(n,a),s&2048&&Ed(a.alternate,a);break;default:eo(n,a)}t=t.sibling}}var hs=8192;function ms(e,t,n){if(e.subtreeFlags&hs)for(e=e.child;e!==null;)sg(e,t,n),e=e.sibling}function sg(e,t,n){switch(e.tag){case 26:ms(e,t,n),e.flags&hs&&(e.memoizedState!==null?Px(n,ya,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&fy(n,e)));break;case 5:ms(e,t,n),e.flags&hs&&(e=e.stateNode,(t&335544128)===t&&fy(n,e));break;case 3:case 4:var a=ya;ya=ro(e.stateNode.containerInfo),ms(e,t,n),ya=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=hs,hs=16777216,ms(e,t,n),hs=a):ms(e,t,n));break;case 30:if((e.flags&hs)!==0&&(a=e.memoizedProps.name,a!=null&&a!=="auto")){var s=e.stateNode;s.paired=null,Gn===null&&(Gn=new Map),Gn.set(a,s)}ms(e,t,n);break;default:ms(e,t,n)}}function ig(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 to(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];on=a,rg(a,e)}ig(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)og(e),e=e.sibling}function og(e){switch(e.tag){case 0:case 11:case 15:to(e),e.flags&2048&&El(9,e,e.return);break;case 3:to(e);break;case 12:to(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Kr(e)):to(e);break;default:to(e)}}function Kr(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];on=a,rg(a,e)}ig(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:El(8,t,t.return),Kr(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Kr(t));break;default:Kr(t)}e=e.sibling}}function rg(e,t){for(;on!==null;){var n=on;switch(n.tag){case 0:case 11:case 15:El(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:Hi(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,on=a;else e:for(n=e;on!==null;){a=on;var s=a.sibling,r=a.return;if(Fp(a),a===n){on=null;break e}if(s!==null){s.return=r,on=s;break e}on=r}}}var Yb={getCacheForType:function(e){var t=un(Qt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return un(Qt).controller.signal}},Vb=typeof WeakMap=="function"?WeakMap:Map,ht=0,jt=null,lt=null,it=0,bt=0,$n=null,Ml=!1,Ps=!1,Cd=!1,al=0,It=0,_l=0,ps=0,Zr=0,Xn=0,Fs=0,no=null,On=null,Md=!1,Pr=0,cg=0,Fr=1/0,Jr=null,Rl=null,zt=0,ba=null,gs=null,Ha=0,_d=0,Rd=null,ug=null,Js=null,Ws=null,ei=null,ao=0,Wr=null;function Yn(){return(ht&2)!==0&&it!==0?it&-it:he.T!==null?Gd():hl()}function dg(){if(Xn===0)if((it&536870912)===0||tt){var e=je;je<<=1,(je&3932160)===0&&(je=262144),Xn=e}else Xn=536870912;return e=dn.current,e!==null&&(e.flags|=32),Xn}function ti(e,t){if(t!=null){var n=e.stateNode,a=n.ref;a===null&&(a=n.ref=Yg(Qa(e.memoizedProps,n))),Ws===null&&(Ws=[]),Ws.push(t.bind(null,a))}}function Dn(e,t,n){(e===jt&&(bt===2||bt===9)||e.cancelPendingCommit!==null)&&(ni(e,0),Ol(e,it,Xn,!1)),Jn(e,n),((ht&2)===0||e!==jt)&&(e===jt&&((ht&2)===0&&(ps|=n),It===4&&Ol(e,it,Xn,!1)),Ia(e))}function fg(e,t,n){if((ht&6)!==0)throw Error(u(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Nt(e,t),s=a?Zb(e,t):Dd(e,t,!0),r=a;do{if(s===0){Ps&&!a&&Ol(e,t,0,!1);break}else{if(n=e.current.alternate,r&&!Qb(n)){s=Dd(e,t,!1),r=!1;continue}if(s===2){if(r=t,e.errorRecoveryDisabledLanes&r)var f=0;else f=e.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){t=f;e:{var p=e;s=no;var T=p.current.memoizedState.isDehydrated;if(T&&(ni(p,f).flags|=256),f=Dd(p,f,!1),f!==2&&f!==6){if(Cd&&!T){p.errorRecoveryDisabledLanes|=r,ps|=r,s=4;break e}r=On,On=s,r!==null&&(On===null?On=r:On.push.apply(On,r))}s=f}if(r=!1,s!==2)continue}}if(s===1){ni(e,0),Ol(e,t,0,!0);break}e:{switch(a=e,r=s,r){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Ol(a,t,Xn,!Ml);break e;case 2:On=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(s=Pr+300-Ot(),10<s)){if(Ol(a,t,Xn,!Ml),bn(a,0,!0)!==0)break e;Ha=t,a.timeoutHandle=Wd(hg.bind(null,a,n,On,Jr,Md,t,Xn,ps,Fs,Ml,r,"Throttled",-0,0),s);break e}hg(a,n,On,Jr,Md,t,Xn,ps,Fs,Ml,r,null,-0,0)}}break}while(!0);Ia(e)}function hg(e,t,n,a,s,r,f,p,T,R,q,P,M,I){e.timeoutHandle=-1;var ge=t.subtreeFlags,Re=(r&335544064)===r;if(P=null,(Re||ge&8192||(ge&16785408)===16785408)&&(P={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ca},Gn=null,sg(t,r,P),Re&&(ge=P,Re=e.containerInfo,Re=(Re.nodeType===9?Re:Re.ownerDocument).__reactViewTransition,Re!=null&&(ge.count++,ge.waitingForViewTransition=!0,ge=fo.bind(ge),Re.finished.then(ge,ge))),ge=(r&62914560)===r?Pr-Ot():(r&4194048)===r?cg-Ot():0,ge=Fx(P,ge),ge!==null)){Ha=r,e.cancelPendingCommit=ge(Sg.bind(null,e,t,r,n,a,s,f,p,T,R,q,P,null,M,I)),Ol(e,r,f,!R);return}Sg(e,t,r,n,a,s,f,p,T,R,q,P)}function Qb(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 s=n[a],r=s.getSnapshot;s=s.value;try{if(!Bn(r(),s))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 Ol(e,t,n,a){t=nn(e,t),t&=~Zr,t&=~ps,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var s=t;0<s;){var r=31-yt(s),f=1<<r;a[r]=-1,s&=~f}n!==0&&fa(e,n,t)}function ec(){return(ht&6)===0?(lo(0),!1):!0}function Od(){if(lt!==null){if(bt===0)var e=lt.return;else e=lt,Fa=as=null,qu(e),Gs=null,qi=0,e=lt;for(;e!==null;)zp(e.alternate,e),e=e.return;lt=null}}function ni(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,yx(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ha=0,Od(),jt=e,lt=n=Za(e.current,null),it=t,bt=0,$n=null,Ml=!1,Ps=Nt(e,t),Cd=!1,Fs=Xn=Zr=ps=_l=It=0,On=no=null,Md=!1,al=nn(e,t),rr(),n}function mg(e,t){Pe=null,he.H=Or,t===qs||t===br?(t=Sm(),bt=3):t===Eu?(t=Sm(),bt=4):bt=t===nd?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,$n=t,lt===null&&(It=1,Dr(e,na(t,e.current)))}function pg(){var e=dn.current;return e===null?!0:(it&4194048)===it?Sn===null:(it&62914560)===it||(it&536870912)!==0?e===Sn:!1}function gg(){var e=he.H;return he.H=Or,e===null?Or:e}function yg(){var e=he.A;return he.A=Yb,e}function tc(){It=4,Ml||(it&4194048)!==it&&dn.current!==null||(Ps=!0),(_l&134217727)===0&&(ps&134217727)===0||jt===null||Ol(jt,it,Xn,!1)}function Dd(e,t,n){var a=ht;ht|=2;var s=gg(),r=yg();(jt!==e||it!==t)&&(Jr=null,ni(e,t)),t=!1;var f=It;e:do try{if(bt!==0&<!==null){var p=lt,T=$n;switch(bt){case 8:Od(),f=6;break e;case 3:case 2:case 9:case 6:dn.current===null&&(t=!0);var R=bt;if(bt=0,$n=null,ai(e,p,T,R),n&&Ps){f=0;break e}break;default:R=bt,bt=0,$n=null,ai(e,p,T,R)}}Kb(),f=It;break}catch(q){mg(e,q)}while(!0);return t&&e.shellSuspendCounter++,Fa=as=null,ht=a,he.H=s,he.A=r,lt===null&&(jt=null,it=0,rr()),f}function Kb(){for(;lt!==null;)vg(lt)}function Zb(e,t){var n=ht;ht|=2;var a=gg(),s=yg();jt!==e||it!==t?(Jr=null,Fr=Ot()+500,ni(e,t)):Ps=Nt(e,t);e:do try{if(bt!==0&<!==null){t=lt;var r=$n;t:switch(bt){case 1:bt=0,$n=null,ai(e,t,r,1);break;case 2:case 9:if(bm(r)){bt=0,$n=null,bg(t);break}t=function(){bt!==2&&bt!==9||jt!==e||(bt=7),Ia(e)},r.then(t,t);break e;case 3:bt=7;break e;case 4:bt=5;break e;case 7:bm(r)?(bt=0,$n=null,bg(t)):(bt=0,$n=null,ai(e,t,r,7));break;case 5:var f=null;switch(lt.tag){case 26:f=lt.memoizedState;case 5:case 27:var p=lt;if(f?uy(f):p.stateNode.complete){bt=0,$n=null;var T=p.sibling;if(T!==null)lt=T;else{var R=p.return;R!==null?(lt=R,nc(R)):lt=null}break t}}bt=0,$n=null,ai(e,t,r,5);break;case 6:bt=0,$n=null,ai(e,t,r,6);break;case 8:Od(),It=6;break e;default:throw Error(u(462))}}Pb();break}catch(q){mg(e,q)}while(!0);return Fa=as=null,he.H=a,he.A=s,ht=n,lt!==null?0:(jt=null,it=0,rr(),It)}function Pb(){for(;lt!==null&&!ua();)vg(lt)}function vg(e){var t=Dp(e.alternate,e,al);e.memoizedProps=e.pendingProps,t===null?nc(e):lt=t}function bg(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Np(n,t,t.pendingProps,t.type,void 0,it);break;case 11:t=Np(n,t,t.pendingProps,t.type.render,t.ref,it);break;case 5:qu(t);var a=t;a===ln&&(tt?(mr(a),a.tag===5&&a.stateNode!=null&&(Et=a.stateNode)):(mr(a),tt=!0));default:zp(n,t),t=lt=rm(t,al),t=Dp(n,t,al)}e.memoizedProps=e.pendingProps,t===null?nc(e):lt=t}function ai(e,t,n,a){Fa=as=null,qu(t),Gs=null,qi=0;var s=t.return;try{if(Ub(e,s,t,n,it)){It=1,Dr(e,na(n,e.current)),lt=null;return}}catch(r){if(s!==null)throw lt=s,r;It=1,Dr(e,na(n,e.current)),lt=null;return}t.flags&32768?(tt||a===1?e=!0:Ps||(it&536870912)!==0?e=!1:(Ml=e=!0,(a===2||a===9||a===3||a===6)&&(a=dn.current,a!==null&&a.tag===13&&(a.flags|=16384))),xg(t,e)):nc(t)}function nc(e){var t=e;do{if((t.flags&32768)!==0){xg(t,Ml);return}e=t.return;var n=qb(t.alternate,t,al);if(n!==null){lt=n;return}if(t=t.sibling,t!==null){lt=t;return}lt=t=e}while(t!==null);It===0&&(It=5)}function xg(e,t){do{var n=Gb(e.alternate,e);if(n!==null){n.flags&=32767,lt=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){lt=e;return}lt=e=n}while(e!==null);It=6,lt=null}function Sg(e,t,n,a,s,r,f,p,T,R,q,P){e.cancelPendingCommit=null;do ac();while(zt!==0);if((ht&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));e===jt&&(lt=jt=null,it=0),gs=t,ba=e,Ha=n,Rd=s,ug=a,Fb(e,t,n,f,p,T,P)}}function Fb(e,t,n,a,s,r,f){var p=t.lanes|t.childLanes;if(_d=p,p|=pu,Ns(e,n,p,a,s,r),Ws=null,(n&335544064)===n?(ei=kb(e),a=10262):(ei=null,a=10256),(t.subtreeFlags&a)!==0||(t.flags&a)!==0?(e.callbackNode=null,e.callbackPriority=0,ax(Un,function(){return Hd(),null})):(e.callbackNode=null,e.callbackPriority=0),Gr=!1,a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=he.T,he.T=null,s=be.p,be.p=2,r=ht,ht|=4;try{$b(e,t,n)}finally{ht=r,be.p=s,he.T=a}}zt=1,Gr?Js=Ax(f,e.containerInfo,ei,Ld,zd,Wb,Ud,Hd,Jb):(Ld(),zd(),Ud())}function Jb(e){if(zt!==0){var t=ba.onRecoverableError;t(e,{componentStack:null})}}function Wb(){zt===3&&(zt=0,ag(gs,ba),zt=4)}function Ld(){if(zt===1){zt=0;var e=ba,t=gs,n=Ha,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=he.T,he.T=null;var s=be.p;be.p=2;var r=ht;ht|=4;try{Wi=Yr=!1,tg(t,e,n),n=Pd;var f=Jh(e.containerInfo),p=n.focusedElem,T=n.selectionRange;if(f!==p&&p&&p.ownerDocument&&Fh(p.ownerDocument.documentElement,p)){if(T!==null&&uu(p)){var R=T.start,q=T.end;if(q===void 0&&(q=R),"selectionStart"in p)p.selectionStart=R,p.selectionEnd=Math.min(q,p.value.length);else{var P=p.ownerDocument||document,M=P&&P.defaultView||window;if(M.getSelection){var I=M.getSelection(),ge=p.textContent.length,Re=Math.min(T.start,ge),Fe=T.end===void 0?Re:Math.min(T.end,ge);!I.extend&&Re>Fe&&(f=Fe,Fe=Re,Re=f);var _=Ph(p,Re),C=Ph(p,Fe);if(_&&C&&(I.rangeCount!==1||I.anchorNode!==_.node||I.anchorOffset!==_.offset||I.focusNode!==C.node||I.focusOffset!==C.offset)){var L=P.createRange();L.setStart(_.node,_.offset),I.removeAllRanges(),Re>Fe?(I.addRange(L),I.extend(C.node,C.offset)):(L.setEnd(C.node,C.offset),I.addRange(L))}}}}for(P=[],I=p;I=I.parentNode;)I.nodeType===1&&P.push({element:I,left:I.scrollLeft,top:I.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<P.length;p++){var Z=P[p];Z.element.scrollLeft=Z.left,Z.element.scrollTop=Z.top}}di=!!Zd,Pd=Zd=null}finally{ht=r,be.p=s,he.T=a}}e.current=t,zt=2}}function zd(){if(zt===2){zt=0;var e=ba,t=gs,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=he.T,he.T=null;var a=be.p;be.p=2;var s=ht;ht|=4;try{Zp(e,t.alternate,t)}finally{ht=s,be.p=a,he.T=n}}zt=3}}function Ud(){if(zt===4||zt===3){zt=0;var e=Js;Js=null,da();var t=ba,n=gs,a=Ha,s=ug,r=(a&335544064)===a?10262:10256;if((n.subtreeFlags&r)!==0||(n.flags&r)!==0?zt=5:(zt=0,gs=ba=null,wg(t,t.pendingLanes)),r=t.pendingLanes,r===0&&(Rl=null),fl(a),n=n.stateNode,qe&&typeof qe.onCommitFiberRoot=="function")try{qe.onCommitFiberRoot(Ye,n,void 0,(n.current.flags&128)===128)}catch{}if(s!==null){n=he.T,r=be.p,be.p=2,he.T=null;try{for(var f=t.onRecoverableError,p=0;p<s.length;p++){var T=s[p];f(T.value,{componentStack:T.stack})}}finally{he.T=n,be.p=r}}if(s=Ws,f=ei,ei=null,s!==null&&(Ws=null,f===null&&(f=[]),e!==null))for(T=0;T<s.length;T++)n=(0,s[T])(f),n!==void 0&&e.finished.finally(n);(Ha&3)!==0&&ac(),Ia(t),r=t.pendingLanes,(a&261930)!==0&&(r&42)!==0?t===Wr?ao++:(ao=0,Wr=t):(ao=0,Wr=null),lo(0)}}function wg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Hi(t)))}function ac(){return Js!==null&&(Js.skipTransition(),Js=null),Ld(),zd(),Ud(),Hd()}function Hd(){if(zt!==5)return!1;var e=ba,t=_d;_d=0;var n=fl(Ha),a=he.T,s=be.p;try{be.p=32>n?32:n,he.T=null,n=Rd,Rd=null;var r=ba,f=Ha;if(zt=0,gs=ba=null,Ha=0,(ht&6)!==0)throw Error(u(331));var p=ht;if(ht|=4,og(r.current),lg(r,r.current,f,n),ht=p,lo(0,!1),qe&&typeof qe.onPostCommitFiberRoot=="function")try{qe.onPostCommitFiberRoot(Ye,r)}catch{}return!0}finally{be.p=s,he.T=a,wg(e,t)}}function Ag(e,t,n){t=na(n,t),t=td(e.stateNode,t,2),e=Tl(e,t,2),e!==null&&(Jn(e,2),Ia(e))}function xt(e,t,n){if(e.tag===3)Ag(e,e,n);else for(;t!==null;){if(t.tag===3){Ag(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Rl===null||!Rl.has(a))){e=na(n,e),n=bp(2),a=Tl(t,n,2),a!==null&&(xp(n,a,t,e),Jn(a,2),Ia(a));break}}t=t.return}}function Id(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new Vb;var s=new Set;a.set(t,s)}else s=a.get(t),s===void 0&&(s=new Set,a.set(t,s));s.has(n)||(Cd=!0,s.add(n),e=ex.bind(null,e,t,n),t.then(e,e))}function ex(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,jt===e&&(it&n)===n&&((It===4||It===3&&(it&62914560)===it&&300>Ot()-Pr)&&(ht&2)===0?ni(e,0):Zr|=n,Fs===it&&(Fs=0)),Ia(e)}function Tg(e,t){t===0&&(t=At()),e=es(e,t),e!==null&&(Jn(e,t),Ia(e))}function tx(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Tg(e,n)}function nx(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,s=e.memoizedState;s!==null&&(n=s.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),Tg(e,n)}function ax(e,t){return Bt(e,t)}var li=null,si=null,Bd=!1,lc=!1,qd=!1,Dl=0;function Ia(e){e!==si&&e.next===null&&(si===null?li=si=e:si=si.next=e),lc=!0,Bd||(Bd=!0,sx())}function lo(e,t){if(!qd&&lc){qd=!0;do for(var n=!1,a=li;a!==null;){if(e!==0){var s=a.pendingLanes;if(s===0)var r=0;else{var f=a.suspendedLanes,p=a.pingedLanes;r=(1<<31-yt(42|e)+1)-1,r&=s&~(f&~p),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(n=!0,Eg(a,r))}else r=it,r=bn(a,a===jt?r:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(r&3)===0||Nt(a,r)||(n=!0,Eg(a,r));a=a.next}while(n);qd=!1}}function lx(){kg()}function kg(){lc=Bd=!1;var e=0;Dl!==0&&gx()&&(e=Dl);for(var t=Ot(),n=null,a=li;a!==null;){var s=a.next,r=jg(a,t);r===0?(a.next=null,n===null?li=s:n.next=s,s===null&&(si=n)):(n=a,(e!==0||(r&3)!==0)&&(lc=!0)),a=s}zt!==0&&zt!==5||lo(e),Dl!==0&&(Dl=0)}function jg(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,s=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var f=31-yt(r),p=1<<f,T=s[f];T===-1?((p&n)===0||(p&a)!==0)&&(s[f]=Na(p,t)):T<=t&&(e.expiredLanes|=p),r&=~p}if(t=jt,n=it,n=bn(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(bt===2||bt===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&ka(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Nt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&ka(a),fl(n)){case 2:case 8:n=vn;break;case 32:n=Un;break;case 268435456:n=de;break;default:n=Un}return a=Ng.bind(null,e),n=Bt(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&ka(a),e.callbackPriority=2,e.callbackNode=null,2}function Ng(e,t){if(zt!==0&&zt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(ac()&&e.callbackNode!==n)return null;var a=it;return a=bn(e,e===jt?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(fg(e,a,t),jg(e,Ot()),e.callbackNode!=null&&e.callbackNode===n?Ng.bind(null,e):null)}function Eg(e,t){if(ac())return null;fg(e,t,!0)}function sx(){vx(function(){(ht&6)!==0?Bt(cn,lx):kg()})}function Gd(){if(Dl===0){var e=is;e===0&&(e=ve,ve<<=1,(ve&261888)===0&&(ve=256)),Dl=e}return Dl}function Cg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:er(e)}function ix(e,t,n,a,s){if(t==="submit"&&n&&n.stateNode===s){var r=Cg((s[Wt]||null).action),f=a.submitter;f&&(t=(t=f[Wt]||null)?Cg(t.formAction):f.getAttribute("formAction"),t!==null&&(r=t,f=null));var p=new lr("action","action",null,a,s);e.push({event:p,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Dl!==0){var T=new FormData(s,f);Pu(n,{pending:!0,data:T,method:s.method,action:r},null,T)}}else typeof r=="function"&&(p.preventDefault(),T=new FormData(s,f),Pu(n,{pending:!0,data:T,method:s.method,action:r},r,T))},currentTarget:s}]})}}for(var $d=0;$d<mu.length;$d++){var Xd=mu[$d],ox=Xd.toLowerCase(),rx=Xd[0].toUpperCase()+Xd.slice(1);pa(ox,"on"+rx)}pa(tm,"onAnimationEnd"),pa(nm,"onAnimationIteration"),pa(am,"onAnimationStart"),pa("dblclick","onDoubleClick"),pa("focusin","onFocus"),pa("focusout","onBlur"),pa(yb,"onTransitionRun"),pa(vb,"onTransitionStart"),pa(bb,"onTransitionCancel"),pa(lm,"onTransitionEnd"),Hn("onMouseEnter",["mouseout","mouseover"]),Hn("onMouseLeave",["mouseout","mouseover"]),Hn("onPointerEnter",["pointerout","pointerover"]),Hn("onPointerLeave",["pointerout","pointerover"]),Ea("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ea("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ea("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ea("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ea("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ea("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var so="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(" "),cx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(so));function Mg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],s=a.event;a=a.listeners;e:{var r=void 0;if(t)for(var f=a.length-1;0<=f;f--){var p=a[f],T=p.instance,R=p.currentTarget;if(p=p.listener,T!==r&&s.isPropagationStopped())break e;r=p,s.currentTarget=R;try{r(s)}catch(q){or(q)}s.currentTarget=null,r=T}else for(f=0;f<a.length;f++){if(p=a[f],T=p.instance,R=p.currentTarget,p=p.listener,T!==r&&s.isPropagationStopped())break e;r=p,s.currentTarget=R;try{r(s)}catch(q){or(q)}s.currentTarget=null,r=T}}}}function st(e,t){var n=t[Xo];n===void 0&&(n=t[Xo]=new Set);var a=e+"__bubble";n.has(a)||(_g(t,e,2,!1),n.add(a))}function Yd(e,t,n){var a=0;t&&(a|=4),_g(n,e,a,t)}var sc="_reactListening"+Math.random().toString(36).slice(2);function Vd(e){if(!e[sc]){e[sc]=!0,Pl.forEach(function(n){n!=="selectionchange"&&(cx.has(n)||Yd(n,!1,e),Yd(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[sc]||(t[sc]=!0,Yd("selectionchange",!1,t))}}function _g(e,t,n,a){switch(xy(t)){case 2:var s=tS;break;case 8:s=nS;break;default:s=hf}n=s.bind(null,t,n,e),s=void 0,!eu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),a?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Qd(e,t,n,a,s){var r=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var f=a.tag;if(f===3||f===4){var p=a.stateNode.containerInfo;if(p===s)break;if(f===4)for(f=a.return;f!==null;){var T=f.tag;if((T===3||T===4)&&f.stateNode.containerInfo===s)return;f=f.return}for(;p!==null;){if(f=ha(p),f===null)return;if(T=f.tag,T===5||T===6||T===26||T===27){a=r=f;continue e}p=p.parentNode}}a=a.return}_h(function(){var R=r,q=Jc(n),P=[];e:{var M=sm.get(e);if(M!==void 0){var I=lr,ge=e;switch(e){case"keypress":if(nr(n)===0)break e;case"keydown":case"keyup":I=Q0;break;case"focusin":ge="focus",I=lu;break;case"focusout":ge="blur",I=lu;break;case"beforeblur":case"afterblur":I=lu;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":I=Dh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":I=L0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":I=J0;break;case tm:case nm:case am:I=H0;break;case lm:I=eb;break;case"scroll":case"scrollend":I=O0;break;case"wheel":I=nb;break;case"copy":case"cut":case"paste":I=B0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":I=zh;break;case"submit":I=P0;break;case"toggle":case"beforetoggle":I=lb}var Re=(t&4)!==0,Fe=!Re&&(e==="scroll"||e==="scrollend"),_=Re?M!==null?M+"Capture":null:M;Re=[];for(var C=R,L;C!==null;){var Z=C;if(L=Z.stateNode,Z=Z.tag,Z!==5&&Z!==26&&Z!==27||L===null||_===null||(Z=Ni(C,_),Z!=null&&Re.push(io(C,Z,L))),Fe)break;C=C.return}0<Re.length&&(M=new I(M,ge,null,n,q),P.push({event:M,listeners:Re}))}}if((t&7)===0){e:{if(I=e==="mouseover"||e==="pointerover",M=e==="mouseout"||e==="pointerout",I&&n!==Fc&&(ge=n.relatedTarget||n.fromElement)&&(ha(ge)||ge[Cn]))break e;(M||I)&&(ge=q.window===q?q:(I=q.ownerDocument)?I.defaultView||I.parentWindow:window,M?(I=n.relatedTarget||n.toElement,M=R,I=I?ha(I):null,I!==null&&(Fe=h(I),Re=I.tag,I!==Fe||Re!==5&&Re!==27&&Re!==6)&&(I=null)):(M=null,I=R),M!==I&&(Re=Dh,Z="onMouseLeave",_="onMouseEnter",C="mouse",(e==="pointerout"||e==="pointerover")&&(Re=zh,Z="onPointerLeave",_="onPointerEnter",C="pointer"),Fe=M==null?ge:Wn(M),L=I==null?ge:Wn(I),ge=new Re(Z,C+"leave",M,n,q),ge.target=Fe,ge.relatedTarget=L,Z=null,ha(q)===R&&(Re=new Re(_,C+"enter",I,n,q),Re.target=L,Re.relatedTarget=Fe,Z=Re),Fe=Z,Re=M&&I?U(M,I,ux):null,M!==null&&Rg(P,ge,M,Re,!1),I!==null&&Fe!==null&&Rg(P,Fe,I,Re,!0)))}e:{if(M=R?Wn(R):window,I=M.nodeName&&M.nodeName.toLowerCase(),I==="select"||I==="input"&&M.type==="file")var Ee=Xh;else if(Gh(M))if(Yh)Ee=mb;else{Ee=fb;var ot=db}else I=M.nodeName,!I||I.toLowerCase()!=="input"||M.type!=="checkbox"&&M.type!=="radio"?R&&Pc(R.elementType)&&(Ee=Xh):Ee=hb;if(Ee&&(Ee=Ee(e,R))){$h(P,Ee,n,q);break e}ot&&ot(e,M,R)}switch(ot=R?Wn(R):window,e){case"focusin":(Gh(ot)||ot.contentEditable==="true")&&(Os=ot,du=R,Li=null);break;case"focusout":Li=du=Os=null;break;case"mousedown":fu=!0;break;case"contextmenu":case"mouseup":case"dragend":fu=!1,Wh(P,n,q);break;case"selectionchange":if(gb)break;case"keydown":case"keyup":Wh(P,n,q)}var ze;if(iu)e:{switch(e){case"compositionstart":var $e="onCompositionStart";break e;case"compositionend":$e="onCompositionEnd";break e;case"compositionupdate":$e="onCompositionUpdate";break e}$e=void 0}else Rs?Bh(e,n)&&($e="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&($e="onCompositionStart");$e&&(Uh&&n.locale!=="ko"&&(Rs||$e!=="onCompositionStart"?$e==="onCompositionEnd"&&Rs&&(ze=Rh()):(pl=q,tu="value"in pl?pl.value:pl.textContent,Rs=!0)),ot=ic(R,$e),0<ot.length&&($e=new Lh($e,e,null,n,q),P.push({event:$e,listeners:ot}),ze?$e.data=ze:(ze=qh(n),ze!==null&&($e.data=ze)))),(ze=ib?ob(e,n):rb(e,n))&&($e=ic(R,"onBeforeInput"),0<$e.length&&(ot=new Lh("onBeforeInput","beforeinput",null,n,q),P.push({event:ot,listeners:$e}),ot.data=ze)),ix(P,e,R,n,q)}Mg(P,t)})}function io(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ic(e,t){for(var n=t+"Capture",a=[];e!==null;){var s=e,r=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||r===null||(s=Ni(e,n),s!=null&&a.unshift(io(e,s,r)),s=Ni(e,t),s!=null&&a.push(io(e,s,r))),e.tag===3)return a;e=e.return}return[]}function ux(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Rg(e,t,n,a,s){for(var r=t._reactName,f=[];n!==null&&n!==a;){var p=n,T=p.alternate,R=p.stateNode;if(p=p.tag,T!==null&&T===a)break;p!==5&&p!==26&&p!==27||R===null||(T=R,s?(R=Ni(n,r),R!=null&&f.unshift(io(n,R,T))):s||(R=Ni(n,r),R!=null&&f.push(io(n,R,T)))),n=n.return}f.length!==0&&e.push({event:t,listeners:f})}var dx=/\r\n?/g,fx=/\u0000|\uFFFD/g;function Og(e){return(typeof e=="string"?e:""+e).replace(dx,`
|
|
49
|
-
`).replace(fx,"")}function Dg(e,t){return t=Og(t),Og(e)===t}function St(e,t,n,a,s,r){switch(n){case"children":if(typeof a=="string")t==="body"||t==="textarea"&&a===""||Ut(e,a);else if(typeof a=="number"||typeof a=="bigint")t!=="body"&&Ut(e,""+a);else return;break;case"className":Xa(e,"class",a);break;case"tabIndex":Xa(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Xa(e,n,a);break;case"style":Ch(e,a,r);return;case"data":if(t!=="object"){Xa(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=er(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 r=="function"&&(n==="formAction"?(t!=="input"&&St(e,t,"name",s.name,s,null),St(e,t,"formEncType",s.formEncType,s,null),St(e,t,"formMethod",s.formMethod,s,null),St(e,t,"formTarget",s.formTarget,s,null)):(St(e,t,"encType",s.encType,s,null),St(e,t,"method",s.method,s,null),St(e,t,"target",s.target,s,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=er(a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=Ca);return;case"onScroll":a!=null&&st("scroll",e);return;case"onScrollEnd":a!=null&&st("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(s.children!=null)throw Error(u(60));(r!=null?r.__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=er(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":st("beforetoggle",e),st("toggle",e),Fl(e,"popover",a);break;case"xlinkActuate":In(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":In(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":In(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":In(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":In(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":In(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":In(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":In(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":In(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Fl(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=_0.get(n)||n,Fl(e,n,a);else return}rt=!0}function Kd(e,t,n,a,s,r){switch(n){case"style":Ch(e,a,r);return;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(u(61));if(n=a.__html,n!=null){if(s.children!=null)throw Error(u(60));(r!=null?r.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"children":if(typeof a=="string")Ut(e,a);else if(typeof a=="number"||typeof a=="bigint")Ut(e,""+a);else return;break;case"onScroll":a!=null&&st("scroll",e);return;case"onScrollEnd":a!=null&&st("scrollend",e);return;case"onClick":a!=null&&(e.onclick=Ca);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Ko.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(s=n.endsWith("Capture"),r=n.slice(2,s?n.length-7:void 0),t=e[Wt]||null,t=t!=null?t[n]:null,typeof t=="function"&&e.removeEventListener(r,t,s),typeof a=="function")){typeof t!="function"&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(r,a,s);break e}rt=!0,n in e?e[n]=a:a===!0?e.setAttribute(n,""):Fl(e,n,a)}return}rt=!0}function mn(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":st("error",e),st("load",e);var a=!1,s=!1,r;for(r in n)if(n.hasOwnProperty(r)){var f=n[r];if(f!=null)switch(r){case"src":a=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:St(e,t,r,f,n,null)}}s&&St(e,t,"srcSet",n.srcSet,n,null),a&&St(e,t,"src",n.src,n,null);return;case"input":st("invalid",e);var p=r=f=s=null,T=null,R=null;for(a in n)if(n.hasOwnProperty(a)){var q=n[a];if(q!=null)switch(a){case"name":s=q;break;case"type":f=q;break;case"checked":T=q;break;case"defaultChecked":R=q;break;case"value":r=q;break;case"defaultValue":p=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(u(137,t));break;default:St(e,t,a,q,n,null)}}Mt(e,r,p,T,R,f,s,!1);return;case"select":st("invalid",e),a=f=r=null;for(s in n)if(n.hasOwnProperty(s)&&(p=n[s],p!=null))switch(s){case"value":r=p;break;case"defaultValue":f=p;break;case"multiple":a=p;default:St(e,t,s,p,n,null)}t=r,n=f,e.multiple=!!a,t!=null?Vt(e,!!a,t,!1):n!=null&&Vt(e,!!a,n,!0);return;case"textarea":st("invalid",e),r=s=a=null;for(f in n)if(n.hasOwnProperty(f)&&(p=n[f],p!=null))switch(f){case"value":a=p;break;case"defaultValue":s=p;break;case"children":r=p;break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(u(91));break;default:St(e,t,f,p,n,null)}Cs(e,a,s,r);return;case"option":for(T in n)if(n.hasOwnProperty(T)&&(a=n[T],a!=null))switch(T){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:St(e,t,T,a,n,null)}return;case"dialog":st("beforetoggle",e),st("toggle",e),st("cancel",e),st("close",e);break;case"iframe":case"object":st("load",e);break;case"video":case"audio":for(a=0;a<so.length;a++)st(so[a],e);break;case"image":st("error",e),st("load",e);break;case"details":st("toggle",e);break;case"embed":case"source":case"link":st("error",e),st("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:St(e,t,R,a,n,null)}return;default:if(Pc(t)){for(q in n)n.hasOwnProperty(q)&&(a=n[q],a!==void 0&&Kd(e,t,q,a,n,void 0));return}}for(p in n)n.hasOwnProperty(p)&&(a=n[p],a!=null&&St(e,t,p,a,n,null))}var hx={};function mx(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 s=null,r=null,f=null,p=null,T=null,R=null,q=null;for(I in n){var P=n[I];if(n.hasOwnProperty(I)&&P!=null)switch(I){case"checked":break;case"value":break;case"defaultValue":T=P;default:a.hasOwnProperty(I)||St(e,t,I,null,a,P)}}for(var M in a){var I=a[M];if(P=n[M],a.hasOwnProperty(M)&&(I!=null||P!=null))switch(M){case"type":I!==P&&(rt=!0),r=I;break;case"name":I!==P&&(rt=!0),s=I;break;case"checked":I!==P&&(rt=!0),R=I;break;case"defaultChecked":I!==P&&(rt=!0),q=I;break;case"value":I!==P&&(rt=!0),f=I;break;case"defaultValue":I!==P&&(rt=!0),p=I;break;case"children":case"dangerouslySetInnerHTML":if(I!=null)throw Error(u(137,t));break;default:I!==P&&St(e,t,M,I,a,P)}}at(e,f,p,T,R,q,r,s);return;case"select":I=f=p=M=null;for(r in n)if(T=n[r],n.hasOwnProperty(r)&&T!=null)switch(r){case"value":break;case"multiple":I=T;default:a.hasOwnProperty(r)||St(e,t,r,null,a,T)}for(s in a)if(r=a[s],T=n[s],a.hasOwnProperty(s)&&(r!=null||T!=null))switch(s){case"value":r!==T&&(rt=!0),M=r;break;case"defaultValue":r!==T&&(rt=!0),p=r;break;case"multiple":r!==T&&(rt=!0),f=r;default:r!==T&&St(e,t,s,r,a,T)}t=p,n=f,a=I,M!=null?Vt(e,!!n,M,!1):!!a!=!!n&&(t!=null?Vt(e,!!n,t,!0):Vt(e,!!n,n?[]:"",!1));return;case"textarea":I=M=null;for(p in n)if(s=n[p],n.hasOwnProperty(p)&&s!=null&&!a.hasOwnProperty(p))switch(p){case"value":break;case"children":break;default:St(e,t,p,null,a,s)}for(f in a)if(s=a[f],r=n[f],a.hasOwnProperty(f)&&(s!=null||r!=null))switch(f){case"value":s!==r&&(rt=!0),M=s;break;case"defaultValue":s!==r&&(rt=!0),I=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(u(91));break;default:s!==r&&St(e,t,f,s,a,r)}Ya(e,M,I);return;case"option":for(var ge in n)if(M=n[ge],n.hasOwnProperty(ge)&&M!=null&&!a.hasOwnProperty(ge))switch(ge){case"selected":e.selected=!1;break;default:St(e,t,ge,null,a,M)}for(T in a)if(M=a[T],I=n[T],a.hasOwnProperty(T)&&M!==I&&(M!=null||I!=null))switch(T){case"selected":M!==I&&(rt=!0),e.selected=M&&typeof M!="function"&&typeof M!="symbol";break;default:St(e,t,T,M,a,I)}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 Re in n)M=n[Re],n.hasOwnProperty(Re)&&M!=null&&!a.hasOwnProperty(Re)&&St(e,t,Re,null,a,M);for(R in a)if(M=a[R],I=n[R],a.hasOwnProperty(R)&&M!==I&&(M!=null||I!=null))switch(R){case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(u(137,t));break;default:St(e,t,R,M,a,I)}return;default:if(Pc(t)){for(var Fe in n)M=n[Fe],n.hasOwnProperty(Fe)&&M!==void 0&&!a.hasOwnProperty(Fe)&&Kd(e,t,Fe,void 0,a,M);for(q in a)M=a[q],I=n[q],!a.hasOwnProperty(q)||M===I||M===void 0&&I===void 0||Kd(e,t,q,M,a,I);return}}for(var _ in n)M=n[_],n.hasOwnProperty(_)&&M!=null&&!a.hasOwnProperty(_)&&St(e,t,_,null,a,M);for(P in a)M=a[P],I=n[P],!a.hasOwnProperty(P)||M===I||M==null&&I==null||St(e,t,P,M,a,I)}function Lg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function px(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var s=n[a],r=s.transferSize,f=s.initiatorType,p=s.duration;if(r&&p&&Lg(f)){for(f=0,p=s.responseEnd,a+=1;a<n.length;a++){var T=n[a],R=T.startTime;if(R>p)break;var q=T.transferSize,P=T.initiatorType;q&&Lg(P)&&(T=T.responseEnd,f+=q*(T<p?1:(p-R)/(T-R)))}if(--a,t+=8*(r+f)/(s.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 Zd=null,Pd=null;function oo(e){return e.nodeType===9?e:e.ownerDocument}function zg(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 Ug(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 Hg(e,t,n,a){return n=oo(n).createElement(e),n[Yt]=a,n[Wt]=t,mn(n,e,t),vt(n),n}function Fd(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 Jd=null;function gx(){var e=window.event;return e&&e.type==="popstate"?e===Jd?!1:(Jd=e,!0):(Jd=null,!1)}var Wd=typeof setTimeout=="function"?setTimeout:void 0,yx=typeof clearTimeout=="function"?clearTimeout:void 0,Ig=typeof Promise=="function"?Promise:void 0,Bg=typeof requestAnimationFrame=="function"?requestAnimationFrame:Wd,vx=typeof queueMicrotask=="function"?queueMicrotask:typeof Ig<"u"?function(e){return Ig.resolve(null).then(e).catch(bx)}:Wd;function bx(e){setTimeout(function(){throw e})}function Ll(e){return e==="head"}function qg(e,t){var n=t,a=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"||n==="/&"){if(a===0){e.removeChild(s),fi(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")rf(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,rf(n);for(var r=n.firstChild;r;){var f=r.nextSibling,p=r.nodeName;r[ml]||p==="SCRIPT"||p==="STYLE"||p==="LINK"&&r.rel.toLowerCase()==="stylesheet"||n.removeChild(r),r=f}}else n==="body"&&rf(e.ownerDocument.body);n=s}while(n);fi(t)}function Gg(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 $g(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 s=a=0;s<t.length;s++){var r=t[s];0<r.width&&0<r.height&&a++}a===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+n.paddingTop,e.marginBottom="-"+n.paddingBottom)}}function Xg(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 xx(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 ef(e){var t=e.getBoundingClientRect(),n=getComputedStyle(e);return xx(t,n,e)}function Sx(e){return e.documentElement.clientHeight}function wx(e){this.addEventListener("load",e),this.addEventListener("error",e)}function Ax(e,t,n,a,s,r,f,p,T){var R=t.nodeType===9?t:t.ownerDocument;try{var q=R.startViewTransition({update:function(){var M=R.defaultView,I=M.navigation&&M.navigation.transition,ge=R.fonts.status;a();var Re=[];if(ge==="loaded"&&(Sx(R),R.fonts.status==="loading"&&Re.push(R.fonts.ready)),ge=Re.length,e!==null)for(var Fe=e.suspenseyImages,_=0,C=0;C<Fe.length;C++){var L=Fe[C];if(!L.complete){var Z=L.getBoundingClientRect();if(0<Z.bottom&&0<Z.right&&Z.top<M.innerHeight&&Z.left<M.innerWidth){if(_+=dy(L),_>cc){Re.length=ge;break}L=new Promise(wx.bind(L)),Re.push(L)}}}if(0<Re.length)return M=Promise.race([Promise.all(Re),new Promise(function(Ee){return setTimeout(Ee,500)})]).then(s,s),(I?Promise.allSettled([I.finished,M]):M).then(r,r);if(s(),I)return I.finished.then(r,r);r()},types:n});R.__reactViewTransition=q;var P=[];return q.ready.then(function(){for(var M=R.documentElement.getAnimations({subtree:!0}),I=0;I<M.length;I++){var ge=M[I],Re=ge.effect,Fe=Re.pseudoElement;if(Fe!=null&&Fe.startsWith("::view-transition")){P.push(ge),ge=Re.getKeyframes();for(var _=Fe=void 0,C=!0,L=0;L<ge.length;L++){var Z=ge[L],Ee=Z.width;if(Fe===void 0)Fe=Ee;else if(Fe!==Ee){C=!1;break}if(Ee=Z.height,_===void 0)_=Ee;else if(_!==Ee){C=!1;break}delete Z.width,delete Z.height,Z.transform==="none"&&delete Z.transform}C&&Fe!==void 0&&_!==void 0&&(Re.setKeyframes(ge),C=getComputedStyle(Re.target,Re.pseudoElement),C.width!==Fe||C.height!==_)&&(C=ge[0],C.width=Fe,C.height=_,C=ge[ge.length-1],C.width=Fe,C.height=_,Re.setKeyframes(ge))}}f()},function(M){R.__reactViewTransition===q&&(R.__reactViewTransition=null);try{if(typeof M=="object"&&M!==null)switch(M.name){case"InvalidStateError":(M.message==="View transition was skipped because document visibility state is hidden."||M.message==="Skipping view transition because document visibility state has become hidden."||M.message==="Skipping view transition because viewport size changed."||M.message==="Transition was aborted because of invalid state")&&(M=null)}M!==null&&T(M)}finally{a(),s(),f()}}),q.finished.finally(function(){for(var M=0;M<P.length;M++)P[M].cancel();R.__reactViewTransition===q&&(R.__reactViewTransition=null),p()}),q}catch{return a(),s(),f(),null}}function ys(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}ys.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:V({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},ys.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),a=[],s=0;s<n.length;s++){var r=n[s].effect;r!==null&&r.target===e&&r.pseudoElement===t&&a.push(n[s])}return a},ys.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Yg(e){return{name:e,group:new ys("group",e),imagePair:new ys("image-pair",e),old:new ys("old",e),new:new ys("new",e)}}function Vn(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Vn.prototype.addEventListener=function(e,t,n){var a=null,s=null;if(!(n!=null&&typeof n!="boolean"&&(a=n.signal||null,a!==null&&a.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var r=this._eventListeners;if(Qg(r,e,t,n)===-1){var f=this,p=t;n!=null&&typeof n!="boolean"&&n.once===!0&&(p=function(T){f.removeEventListener(e,t,n),typeof t=="function"?t.call(this,T):t.handleEvent(T)}),a!==null&&(s=f.removeEventListener.bind(f,e,t,n),a.addEventListener("abort",s,{once:!0}),s=a.removeEventListener.bind(a,"abort",s)),a=ii(n),r.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:p,cleanup:s}),v(this._fragmentFiber.child,!1,Tx,e,p,a)}this._eventListeners=r}};function Tx(e,t,n,a){return B(e).addEventListener(t,n,a),!1}Vn.prototype.removeEventListener=function(e,t,n){var a=this._eventListeners;if(a!==null&&(t=Qg(a,e,t,n),t!==-1)){var s=a[t];n=s.attachedListener;var r=s.cleanup;s=ii(s.optionsOrUseCapture),v(this._fragmentFiber.child,!1,kx,e,n,s),a.splice(t,1),r!==null&&r()}};function kx(e,t,n,a){return B(e).removeEventListener(t,n,a),!1}function ii(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Vg(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function Qg(e,t,n,a){if(e.length===0)return-1;a=Vg(a);for(var s=0;s<e.length;s++){var r=e[s];if(r.type===t&&r.listener===n&&Vg(r.optionsOrUseCapture)===a)return s}return-1}Vn.prototype.dispatchEvent=function(e){var t=x(this._fragmentFiber);if(t===null)return!0;t=B(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 s=0;s<n.length;s++){var r=n[s];a.addEventListener(r.type,r.attachedListener,ii(r.optionsOrUseCapture))}if(t.appendChild(a),e=a.dispatchEvent(e),n)for(s=0;s<n.length;s++)r=n[s],a.removeEventListener(r.type,r.attachedListener,ii(r.optionsOrUseCapture));return t.removeChild(a),e}return t.dispatchEvent(e)},Vn.prototype.focus=function(e){v(this._fragmentFiber.child,!0,Kg,e,void 0,void 0)};function Kg(e,t){return e.tag===6?!1:(e=B(e),Ux(e,t))}Vn.prototype.focusLast=function(e){var t=[];v(this._fragmentFiber.child,!0,tf,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Kg(t[n],e);n--);};function tf(e,t){return t.push(e),!1}Vn.prototype.blur=function(){var e=x(this._fragmentFiber);e!==null&&(e=B(e),e=oo(e).activeElement,e!==null&&v(this._fragmentFiber.child,!1,jx,e,void 0,void 0))};function jx(e,t){return e.tag===6?!1:(e=B(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=B(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,Ex,e,void 0,void 0);for(var n=t=0;n<xa.length;n++){var a=xa[n];a.fragmentInstance===this&&a.observer===e?e.unobserve(a.instance):xa[t++]=a}xa.length=t}};function Ex(e,t){return e.tag===6||(e=B(e),t.unobserve(e)),!1}var xa=[],nf=!1;function Cx(e,t,n){xa.push({fragmentInstance:e,observer:t,instance:n}),nf||(nf=!0,Hx(function(){nf=!1;var a=xa;xa=[];for(var s=0;s<a.length;s++){var r=a[s];r.observer.unobserve(r.instance)}}))}Vn.prototype.getClientRects=function(){var e=[];return v(this._fragmentFiber.child,!1,Mx,e,void 0,void 0),e};function Mx(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=B(e),t.push.apply(t,e.getClientRects());return!1}Vn.prototype.getRootNode=function(e){var t=x(this._fragmentFiber);return t===null?this:B(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,tf,n,void 0,void 0);var a=B(t);if(n.length===0){if(n=a,k(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 s=a=n.compareDocumentPosition(e);return n===e?s=Node.DOCUMENT_POSITION_CONTAINS:a&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=O(t)[1],n===null?s=Node.DOCUMENT_POSITION_PRECEDING:(e=B(n).compareDocumentPosition(e),s=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),s|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=B(n[0]),s=B(n[n.length-1]);var r=k(this._fragmentFiber)?t.parentElement:a;if(r==null)return Node.DOCUMENT_POSITION_DISCONNECTED;a=r.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,r=r.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_CONTAINED_BY;var f=t.compareDocumentPosition(e),p=s.compareDocumentPosition(e),T=f&Node.DOCUMENT_POSITION_CONTAINED_BY||p&Node.DOCUMENT_POSITION_CONTAINED_BY;return p=a&&r&&f&Node.DOCUMENT_POSITION_FOLLOWING&&p&Node.DOCUMENT_POSITION_PRECEDING,t=a&&t===e||r&&s===e||T||p?Node.DOCUMENT_POSITION_CONTAINED_BY:!a&&t===e||!r&&s===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:f,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||_x(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function _x(e,t,n,a,s){var r=ha(s);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!r)e:{for(;r!==null;){if(r.tag===7&&(r===t||r.alternate===t)){n=!0;break e}r=r.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(r===null)return r=s.ownerDocument,s===r||s===r.documentElement||s===r.body;e:{for(r=t,t=x(t);r!==null;){if(!(r.tag!==5&&r.tag!==3&&r.tag!==27||r!==t&&r.alternate!==t)){r=!0;break e}r=r.return}r=!1}return r}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!r)&&!(t=r===n)&&(t=U(n,r,G),t===null?t=!1:(v(t,!0,fe,r,n),r=te,te=null,t=r!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!r)&&!(t=r===a)&&(t=U(a,r,G),t===null?t=!1:(v(t,!0,E,r,a),r=te,re=te=null,t=r!==null)),t):!1}function Zg(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,tf,t,void 0,void 0);var n=e!==!1;if(t.length===0){var a=O(this._fragmentFiber);if(a=n?a[1]||a[0]||x(this._fragmentFiber):a[0]||a[1],a===null)return;if(a.tag===6){e=B(a),Zg(e,n);return}if(a=B(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 s=t[a];s.tag===6?(s=B(s),Zg(s,n)):B(s).scrollIntoView(e),a+=n?-1:1}};function Rx(e,t){return e=B(e),Pg(e,t),!1}function Pg(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function Fg(e,t){var n=t._eventListeners;if(n!==null)for(var a=0;a<n.length;a++){var s=n[a];e.addEventListener(s.type,s.attachedListener,ii(s.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(r){for(var f=0,p=0;p<xa.length;p++){var T=xa[p];(T.fragmentInstance!==t||T.observer!==r||T.instance!==e)&&(xa[f++]=T)}xa.length=f,r.observe(e)}),Pg(e,t))}function Ox(e,t){var n=t._eventListeners;if(n!==null)for(var a=0;a<n.length;a++){var s=n[a];e.removeEventListener(s.type,s.attachedListener,ii(s.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(r){typeof r.rootMargin=="string"?Cx(t,r,e):r.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function af(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":af(n),$a(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Dx(e,t,n,a){for(;e.nodeType===1;){var s=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[ml])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(r!==s.rel||e.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||e.getAttribute("title")!==(s.title==null?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(r=e.getAttribute("src"),(r!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var r=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;if(e=oa(e.nextSibling),e===null)break}return null}function Lx(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=oa(e.nextSibling),e===null))return null;return e}function Jg(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=oa(e.nextSibling),e===null))return null;return e}function lf(e){return e.data==="$?"||e.data==="$~"}function sf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function zx(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 oa(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 of=null;function Wg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return oa(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function ey(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 Ux(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){Bg(function(){Bg(function(t){return e(t)})})}function ty(e,t,n){switch(t=oo(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 ny(e,t,n){for(var a in n){var s=n[a];n.hasOwnProperty(a)&&s!=null&&St(e,t,a,null,hx,s)}n.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===Ca&&(e.onclick=null),$a(e)}function rf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);$a(e)}var ra=new Map,ay=new Set;function ro(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 ll=be.d;be.d={f:Ix,r:Bx,D:qx,C:Gx,L:$x,m:Xx,X:Vx,S:Yx,M:Qx};function Ix(){var e=ll.f(),t=ec();return e||t}function Bx(e){var t=ma(e);t!==null&&t.tag===5&&t.type==="form"?sp(t):ll.r(e)}var oi=typeof document>"u"?null:document;function ly(e,t,n){var a=oi;if(a&&typeof t=="string"&&t){var s=Ge(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof n=="string"&&(s+='[crossorigin="'+n+'"]'),ay.has(s)||(ay.add(s),e={rel:e,crossOrigin:n,href:t},a.querySelector(s)===null&&(t=a.createElement("link"),mn(t,"link",e),vt(t),a.head.appendChild(t)))}}function qx(e){ll.D(e),ly("dns-prefetch",e,null)}function Gx(e,t){ll.C(e,t),ly("preconnect",e,t)}function $x(e,t,n){ll.L(e,t,n);var a=oi;if(a&&e&&t){var s='link[rel="preload"][as="'+Ge(t)+'"]';t==="image"&&n&&n.imageSrcSet?(s+='[imagesrcset="'+Ge(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(s+='[imagesizes="'+Ge(n.imageSizes)+'"]')):s+='[href="'+Ge(e)+'"]';var r=s;switch(t){case"style":r=ri(e);break;case"script":r=ci(e)}if(!(ra.has(r)||(e=V({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),ra.set(r,e),a.querySelector(s)!==null||t==="style"&&a.querySelector(co(r))||t==="script"&&a.querySelector(uo(r))))){var f=a.createElement("link");mn(f,"link",e),t==="style"&&(f[Zl]=!0,f.onload=f.onerror=function(){Qo(f)}),vt(f),a.head.appendChild(f)}}}function Xx(e,t){ll.m(e,t);var n=oi;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+Ge(a)+'"][href="'+Ge(e)+'"]',r=s;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=ci(e)}if(!ra.has(r)&&(e=V({rel:"modulepreload",href:e},t),ra.set(r,e),n.querySelector(s)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(uo(r)))return}a=n.createElement("link"),mn(a,"link",e),vt(a),n.head.appendChild(a)}}}function Yx(e,t,n){ll.S(e,t,n);var a=oi;if(a&&e){var s=ea(a).hoistableStyles,r=ri(e);t=t||"default";var f=s.get(r);if(!f){var p={loading:0,preload:null};if(f=a.querySelector(co(r)))p.loading=5;else{e=V({rel:"stylesheet",href:e,"data-precedence":t},n),(n=ra.get(r))&&cf(e,n);var T=f=a.createElement("link");vt(T),mn(T,"link",e),T._p=new Promise(function(R,q){T.onload=R,T.onerror=q}),T.addEventListener("load",function(){p.loading|=1}),T.addEventListener("error",function(){p.loading|=2}),p.loading|=4,oc(f,t,a)}f={type:"stylesheet",instance:f,count:1,state:p},s.set(r,f)}}}function Vx(e,t){ll.X(e,t);var n=oi;if(n&&e){var a=ea(n).hoistableScripts,s=ci(e),r=a.get(s);r||(r=n.querySelector(uo(s)),r||(e=V({src:e,async:!0},t),(t=ra.get(s))&&uf(e,t),r=n.createElement("script"),vt(r),mn(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(s,r))}}function Qx(e,t){ll.M(e,t);var n=oi;if(n&&e){var a=ea(n).hoistableScripts,s=ci(e),r=a.get(s);r||(r=n.querySelector(uo(s)),r||(e=V({src:e,async:!0,type:"module"},t),(t=ra.get(s))&&uf(e,t),r=n.createElement("script"),vt(r),mn(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(s,r))}}function sy(e,t,n,a){var s=(s=xe.current)?ro(s):null;if(!s)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(n=ri(n.href),t=ea(s).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=ri(n.href);var r=ea(s).hoistableStyles,f=r.get(e);if(f||(s=s.ownerDocument||s,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,f),(r=s.querySelector(co(e)))?r._p||(f.instance=r,f.state.loading=5):(r=ra.get(e),r||(r={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ra.set(e,r)),Kx(s,e,r,f.state))),t&&a===null)throw Error(u(528,""));return f}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=ci(n),t=ea(s).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 ri(e){return'href="'+Ge(e)+'"'}function co(e){return'link[rel="stylesheet"]['+e+"]"}function iy(e){return V({},e,{"data-precedence":e.precedence,precedence:null})}function Kx(e,t,n,a){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[Zl]!==!0){a.loading=1;return}}else t=e.createElement("link"),t[Zl]=!0,t.onload=t.onerror=Qo.bind(null,t),mn(t,"link",n),vt(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 ci(e){return'[src="'+Ge(e)+'"]'}function uo(e){return"script[async]"+e}function oy(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Ge(n.href)+'"]');if(a)return t.instance=a,vt(a),a;var s=V({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),vt(a),mn(a,"style",s),oc(a,n.precedence,e),t.instance=a;case"stylesheet":s=ri(n.href);var r=e.querySelector(co(s));if(r)return t.state.loading|=4,t.instance=r,vt(r),r;a=iy(n),(s=ra.get(s))&&cf(a,s),r=(e.ownerDocument||e).createElement("link"),vt(r);var f=r;return f._p=new Promise(function(p,T){f.onload=p,f.onerror=T}),mn(r,"link",a),t.state.loading|=4,oc(r,n.precedence,e),t.instance=r;case"script":return r=ci(n.src),(s=e.querySelector(uo(r)))?(t.instance=s,vt(s),s):(a=n,(s=ra.get(r))&&(a=V({},n),uf(a,s)),e=e.ownerDocument||e,s=e.createElement("script"),vt(s),mn(s,"link",a),e.head.appendChild(s),t.instance=s);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,oc(a,n.precedence,e));return t.instance}function oc(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=a.length?a[a.length-1]:null,r=s,f=0;f<a.length;f++){var p=a[f];if(p.dataset.precedence===t)r=p;else if(r!==s)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function cf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function uf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var rc=null;function ry(e,t,n){if(rc===null){var a=new Map,s=rc=new Map;s.set(n,a)}else s=rc,a=s.get(n),a||(a=new Map,s.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),s=0;s<n.length;s++){var r=n[s];if(!(r[ml]||r[Yt]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var f=r.getAttribute(t)||"";f=e+f;var p=a.get(f);p?p.push(r):a.set(f,[r])}}return a}function df(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Zx(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 cy(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function uy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function dy(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function fy(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=dy(t),e.suspenseyImages.push(t)),e=Jx.bind(e),t.decode().then(e,e))}function Px(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 s=ri(a.href),r=t.querySelector(co(s));if(r){t=r._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=fo.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=r,vt(r);return}r=t.ownerDocument||t,a=iy(a),(s=ra.get(s))&&cf(a,s),r=r.createElement("link"),vt(r);var f=r;f._p=new Promise(function(p,T){f.onload=p,f.onerror=T}),mn(r,"link",a),n.instance=r}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=fo.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var cc=0;function Fx(e,t){return e.stylesheets&&e.count===0&&dc(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&dc(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4+t);0<e.imgBytes&&cc===0&&(cc=62500*px());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&dc(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>cc?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(s)}}:null}function hy(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)dc(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function fo(){this.count--,hy(this)}function Jx(){this.imgCount--,hy(this)}var uc=null;function dc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,uc=new Map,t.forEach(Wx,e),uc=null,fo.call(e))}function Wx(e,t){if(!(t.state.loading&4)){var n=uc.get(e);if(n)var a=n.get(null);else{n=new Map,uc.set(e,n);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<s.length;r++){var f=s[r];(f.nodeName==="LINK"||f.getAttribute("media")!=="not all")&&(n.set(f.dataset.precedence,f),a=f)}a&&n.set(null,a)}s=t.instance,f=s.getAttribute("data-precedence"),r=n.get(f)||a,r===a&&n.set(null,s),n.set(f,s),this.count++,a=fo.bind(this),s.addEventListener("load",a),s.addEventListener("error",a),r?r.parentNode.insertBefore(s,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var ui={$$typeof:Ce,Provider:null,Consumer:null,_currentValue:gt,_currentValue2:gt,_threadCount:0};function eS(e,t,n,a,s,r,f,p,T){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=En(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=En(0),this.hiddenUpdates=En(null),this.identifierPrefix=a,this.onUncaughtError=s,this.onCaughtError=r,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=T,this.transitionTypes=null,this.incompleteTransitions=new Map}function my(e,t,n,a,s,r,f,p,T,R,q,P){return e=new eS(e,t,n,f,T,R,q,P,p),t=1,r===!0&&(t|=24),r=Mn(3,null,null,t),e.current=r,r.stateNode=e,t=ku(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:a,isDehydrated:n,cache:t},Cu(r),e}function py(e){return e?(e=zs,e):zs}function gy(e,t,n,a,s,r){s=py(s),a.context===null?a.context=s:a.pendingContext=s,a=Al(t),a.payload={element:n},r=r===void 0?null:r,r!==null&&(a.callback=r),n=Tl(e,a,t),n!==null&&(Dn(n,e,t),Gi(n,e,t))}function yy(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ff(e,t){yy(e,t),(e=e.alternate)&&yy(e,t)}function vy(e){if(e.tag===13||e.tag===31){var t=es(e,67108864);t!==null&&Dn(t,e,67108864),ff(e,67108864)}}function by(e){if(e.tag===13||e.tag===31){var t=Yn();t=dl(t);var n=es(e,t);n!==null&&Dn(n,e,t),ff(e,t)}}var di=!0;function tS(e,t,n,a){var s=he.T;he.T=null;var r=be.p;try{be.p=2,hf(e,t,n,a)}finally{be.p=r,he.T=s}}function nS(e,t,n,a){var s=he.T;he.T=null;var r=be.p;try{be.p=8,hf(e,t,n,a)}finally{be.p=r,he.T=s}}function hf(e,t,n,a){if(di){var s=mf(a);if(s===null)Qd(e,t,a,fc,n),Sy(e,a);else if(lS(s,e,t,n,a))a.stopPropagation();else if(Sy(e,a),t&4&&-1<aS.indexOf(e)){for(;s!==null;){var r=ma(s);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var f=et(r.pendingLanes);if(f!==0){var p=r;for(p.pendingLanes|=2,p.entangledLanes|=2;f;){var T=1<<31-yt(f);p.entanglements[1]|=T,f&=~T}Ia(r),(ht&6)===0&&(Fr=Ot()+500,lo(0))}}break;case 31:case 13:p=es(r,2),p!==null&&Dn(p,r,2),ec(),ff(r,2)}if(r=mf(a),r===null&&Qd(e,t,a,fc,n),r===s)break;s=r}s!==null&&a.stopPropagation()}else Qd(e,t,a,null,n)}}function mf(e){return e=Jc(e),pf(e)}var fc=null;function pf(e){if(fc=null,e=ha(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 fc=e,null}function xy(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(ja()){case cn:return 2;case vn:return 8;case Un:case z:return 32;case de:return 268435456;default:return 32}default:return 32}}var gf=!1,zl=null,Ul=null,Hl=null,ho=new Map,mo=new Map,Il=[],aS="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 Sy(e,t){switch(e){case"focusin":case"focusout":zl=null;break;case"dragenter":case"dragleave":Ul=null;break;case"mouseover":case"mouseout":Hl=null;break;case"pointerover":case"pointerout":ho.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":mo.delete(t.pointerId)}}function po(e,t,n,a,s,r){return e===null||e.nativeEvent!==r?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:r,targetContainers:[s]},t!==null&&(t=ma(t),t!==null&&vy(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function lS(e,t,n,a,s){switch(t){case"focusin":return zl=po(zl,e,t,n,a,s),!0;case"dragenter":return Ul=po(Ul,e,t,n,a,s),!0;case"mouseover":return Hl=po(Hl,e,t,n,a,s),!0;case"pointerover":var r=s.pointerId;return ho.set(r,po(ho.get(r)||null,e,t,n,a,s)),!0;case"gotpointercapture":return r=s.pointerId,mo.set(r,po(mo.get(r)||null,e,t,n,a,s)),!0}return!1}function wy(e){var t=ha(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,$o(e.priority,function(){by(n)});return}}else if(t===31){if(t=b(n),t!==null){e.blockedOn=t,$o(e.priority,function(){by(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 hc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=mf(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);Fc=a,n.target.dispatchEvent(a),Fc=null}else return t=ma(n),t!==null&&vy(t),e.blockedOn=n,!1;t.shift()}return!0}function Ay(e,t,n){hc(e)&&n.delete(t)}function sS(){gf=!1,zl!==null&&hc(zl)&&(zl=null),Ul!==null&&hc(Ul)&&(Ul=null),Hl!==null&&hc(Hl)&&(Hl=null),ho.forEach(Ay),mo.forEach(Ay)}function mc(e,t){e.blockedOn===t&&(e.blockedOn=null,gf||(gf=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,sS)))}var pc=null;function Ty(e){pc!==e&&(pc=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){pc===e&&(pc=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],s=e[t+2];if(typeof a!="function"){if(pf(a||n)===null)continue;break}var r=ma(n);r!==null&&(e.splice(t,3),t-=3,Pu(r,{pending:!0,data:s,method:n.method,action:a},a,s))}}))}function fi(e){function t(T){return mc(T,e)}zl!==null&&mc(zl,e),Ul!==null&&mc(Ul,e),Hl!==null&&mc(Hl,e),ho.forEach(t),mo.forEach(t);for(var n=0;n<Il.length;n++){var a=Il[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Il.length&&(n=Il[0],n.blockedOn===null);)wy(n),n.blockedOn===null&&Il.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var s=n[a],r=n[a+1],f=s[Wt]||null;if(typeof r=="function")f||Ty(n);else if(f){var p=null;if(r&&r.hasAttribute("formAction")){if(s=r,f=r[Wt]||null)p=f.formAction;else if(pf(s)!==null)continue}else p=f.action;typeof p=="function"?n[a+1]=p:(n.splice(a,3),a-=3),Ty(n)}}}function ky(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(f){return s=f})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),a||setTimeout(n,20)}function n(){if(!a&&!navigation.transition){var r=navigation.currentEntry;r&&r.url!=null&&navigation.navigate(r.url,{state:r.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,s=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),s!==null&&(s(),s=null)}}}function yf(e){this._internalRoot=e}gc.prototype.render=yf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var n=t.current,a=Yn();gy(n,a,e,t,null,null)},gc.prototype.unmount=yf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gy(e.current,2,null,e,null,null),ec(),t[Cn]=null}};function gc(e){this._internalRoot=e}gc.prototype.unstable_scheduleHydration=function(e){if(e){var t=hl();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Il.length&&t!==0&&t<Il[n].priority;n++);Il.splice(n,0,e),n===0&&wy(e)}};var jy=o.version;if(jy!=="19.3.0")throw Error(u(527,jy,"19.3.0"));be.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?g(e):null,e=e===null?null:e.stateNode,e};var iS={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:he,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var yc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yc.isDisabled&&yc.supportsFiber)try{Ye=yc.inject(iS),qe=yc}catch{}}return yo.createRoot=function(e,t){if(!d(e))throw Error(u(299));var n=!1,a="",s=pp,r=gp,f=yp;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(f=t.onRecoverableError)),t=my(e,1,!1,null,null,n,a,null,s,r,f,ky),e[Cn]=t.current,Vd(e),new yf(t)},yo.hydrateRoot=function(e,t,n){if(!d(e))throw Error(u(299));var a=!1,s="",r=pp,f=gp,p=yp,T=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(r=n.onUncaughtError),n.onCaughtError!==void 0&&(f=n.onCaughtError),n.onRecoverableError!==void 0&&(p=n.onRecoverableError),n.formState!==void 0&&(T=n.formState)),t=my(e,1,!0,t,n??null,a,s,T,r,f,p,ky),t.context=py(null),n=t.current,a=Yn(),a=dl(a),s=Al(a),s.callback=null,Tl(n,s,a),n=a,t.current.lanes=n,Jn(t,n),Ia(t),e[Cn]=t.current,Vd(e),new gc(t)},yo.version="19.3.0",yo}var Iy;function xS(){if(Iy)return xf.exports;Iy=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(o){console.error(o)}}return l(),xf.exports=bS(),xf.exports}var SS=xS();const wS=_v(SS);async function AS(){const l=await fetch("/api/models");if(!l.ok)throw new Error(await Xc(l)||`Failed to load models (${l.status})`);return(await l.json()).data}async function TS(){const l=await fetch("/api/kb");return l.ok?(await l.json()).docs:[]}async function kS(l,o){const c=await fetch("/api/kb",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:l,text:o})});if(!c.ok)throw new Error(await Xc(c)||`Failed to add document (${c.status})`);return(await c.json()).docs}async function jS(l){const o=await fetch(`/api/kb/${l}`,{method:"DELETE"});return o.ok?(await o.json()).docs:[]}async function eh(l,o){var S,g,v,x,k,O,Y;if(l.stream===!1)return NS(l,o);const c=Date.now(),u=await fetch("/api/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...l,stream:!0}),signal:o.signal});if(!u.ok||!u.body){o.onError(await Xc(u)||`Chat request failed (${u.status})`);return}const d=u.body.getReader(),h=new TextDecoder;let m="";const b={};let y=null;for(;;){const{value:B,done:te}=await d.read();if(te)break;m+=h.decode(B,{stream:!0});let re;for(;(re=m.indexOf(`
|
|
50
|
-
`))!==-1;){const fe=m.slice(0,re).replace(/\r$/,"");if(m=m.slice(re+1),!fe.startsWith("data:"))continue;const E=fe.slice(5).trim();if(E==="[DONE]"){By(b,o),o.onDone(y);return}let G;try{G=JSON.parse(E)}catch{continue}if(G.error){o.onError(G.error.message??"stream error");return}if(G.scx_sources){(S=o.onSources)==null||S.call(o,G.scx_sources);continue}const U=(g=G.choices)==null?void 0:g[0],V=U==null?void 0:U.delta;if(V!=null&&V.content&&o.onDelta(V.content),V!=null&&V.tool_calls)for(const J of V.tool_calls){const oe=J.index??0;b[oe]??(b[oe]={id:J.id??`call_${oe}`,type:"function",function:{name:"",arguments:""}}),J.id&&(b[oe].id=J.id),(v=J.function)!=null&&v.name&&(b[oe].function.name+=J.function.name),(x=J.function)!=null&&x.arguments&&(b[oe].function.arguments+=J.function.arguments)}U!=null&&U.finish_reason&&(y=U.finish_reason),G.usage&&((O=o.onUsage)==null||O.call(o,{prompt:G.usage.prompt_tokens,completion:G.usage.completion_tokens,reasoning:(k=G.usage.completion_tokens_details)==null?void 0:k.reasoning_tokens}))}}if(By(b,o),!y&&!((Y=o.signal)!=null&&Y.aborted)){const B=Math.round((Date.now()-c)/6e4);o.onError(`The connection closed before the model finished${B?` (after about ${B} min)`:""}. Long answers can hit a provider's time limit: try again, a faster model, or a smaller request.`);return}o.onDone(y)}async function NS(l,o){var m,b,y,S,g,v;const c=await fetch("/api/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...l,stream:!1}),signal:o.signal});if(!c.ok){o.onError(await Xc(c)||`Chat request failed (${c.status})`);return}const u=await c.json();u.scx_sources&&((m=o.onSources)==null||m.call(o,u.scx_sources));const d=(b=u.choices)==null?void 0:b[0],h=d==null?void 0:d.message;h!=null&&h.content&&o.onDelta(h.content),(y=h==null?void 0:h.tool_calls)!=null&&y.length&&((S=o.onToolCalls)==null||S.call(o,h.tool_calls)),u.usage&&((v=o.onUsage)==null||v.call(o,{prompt:u.usage.prompt_tokens,completion:u.usage.completion_tokens,reasoning:(g=u.usage.completion_tokens_details)==null?void 0:g.reasoning_tokens})),o.onDone((d==null?void 0:d.finish_reason)??null)}function By(l,o){const c=Object.values(l).filter(u=>u.function.name);c.length&&o.onToolCalls&&o.onToolCalls(c)}async function Xc(l){var o;try{const c=await l.json();return((o=c==null?void 0:c.error)==null?void 0:o.message)??""}catch{return""}}async function ES(l){const o=await fetch(`/api/agent/sessions?directory=${encodeURIComponent(l)}`);if(!o.ok)throw new Error(await zn(o)||`Could not list sessions (${o.status})`);return(await o.json()).sessions}async function CS(l,o){const c=await fetch(`/api/agent/session/${encodeURIComponent(l)}/messages?directory=${encodeURIComponent(o)}`);if(!c.ok)throw new Error(await zn(c)||`Could not load session (${c.status})`);return c.json()}async function MS(l,o){const c=await fetch(`/api/agent/session/${encodeURIComponent(l)}?directory=${encodeURIComponent(o)}`,{method:"DELETE"});if(!c.ok)throw new Error(await zn(c)||`Could not delete session (${c.status})`)}async function _S(l){const o=await fetch(`/api/agent/commands?directory=${encodeURIComponent(l)}`);return o.ok?(await o.json()).commands:[]}async function RS(l){const o=await fetch("/api/agent/command",{method:"POST",headers:cl(),body:JSON.stringify(l)});if(!o.ok)throw new Error(await zn(o)||`Command failed (${o.status})`)}async function OS(l,o,c){const u=await fetch("/api/agent/compact",{method:"POST",headers:cl(),body:JSON.stringify({sessionID:l,directory:o,model:c})});if(!u.ok)throw new Error(await zn(u)||`Compact failed (${u.status})`)}async function DS(){const l=await fetch("/api/agent/status");if(!l.ok)throw new Error(await zn(l)||`Agent server not ready (${l.status})`);return l.json()}async function Rv(l){const o=await fetch(`/api/agent/directory?directory=${encodeURIComponent(l)}`);if(!o.ok)throw new Error(await zn(o)||`Folder not found (${o.status})`);return(await o.json()).directory}async function LS(l,o){const c=await fetch(`/api/agent/pending?sessionID=${encodeURIComponent(l)}&directory=${encodeURIComponent(o)}`);return c.ok?c.json():{permissions:[],questions:[]}}async function zS(l){const o=await fetch("/api/agent/session",{method:"POST",headers:cl(),body:JSON.stringify({directory:l})});if(!o.ok)throw new Error(await zn(o)||`Could not create session (${o.status})`);return o.json()}async function US(l){const o=await fetch("/api/agent/prompt",{method:"POST",headers:cl(),body:JSON.stringify(l)});if(!o.ok)throw new Error(await zn(o)||`Prompt failed (${o.status})`)}async function HS(l){const o=await fetch("/api/agent/permission",{method:"POST",headers:cl(),body:JSON.stringify(l)});if(!o.ok)throw new Error(await zn(o)||`Permission reply failed (${o.status})`)}async function IS(l){const o=await fetch("/api/agent/question",{method:"POST",headers:cl(),body:JSON.stringify(l)});if(!o.ok)throw new Error(await zn(o)||`Answer failed (${o.status})`)}async function BS(l,o){await fetch("/api/agent/abort",{method:"POST",headers:cl(),body:JSON.stringify({sessionID:l,directory:o})})}async function qS(l,o){const c=await fetch(`/api/agent/diff?sessionID=${encodeURIComponent(l)}&directory=${encodeURIComponent(o)}`);return c.ok?(await c.json()).diff:null}async function GS(l,o,c,u,d){let h=1e3,m=!1;for(;!u.aborted;){try{await $S(l,o,c,u,()=>{h=1e3,m&&(d==null||d()),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 $S(l,o,c,u,d){const h=await fetch(`/api/agent/events?sessionID=${encodeURIComponent(l)}&directory=${encodeURIComponent(o)}`,{signal:u});if(!h.ok||!h.body)throw Object.assign(new Error(await zn(h)||`Event stream failed (${h.status})`),{fatal:!0});d();const m=h.body.getReader(),b=new TextDecoder;let y="";for(;;){const{value:S,done:g}=await m.read();if(g)break;y+=b.decode(S,{stream:!0});let v;for(;(v=y.indexOf(`
|
|
51
|
-
`))!==-1;){const x=y.slice(0,v).replace(/\r$/,"");if(y=y.slice(v+1),!!x.startsWith("data:"))try{c(JSON.parse(x.slice(5).trim()))}catch{}}}}async function XS(l){const o=await fetch("/api/agent/recon",{method:"POST",headers:cl(),body:JSON.stringify(l)});if(!o.ok)throw new Error(await zn(o)||`Could not start recon (${o.status})`);return(await o.json()).recon}async function qy(l){const o=await fetch(`/api/agent/recon?sessionID=${encodeURIComponent(l)}`);return o.ok?(await o.json()).recon:null}async function YS(l){const o=await fetch("/api/agent/recon/stop",{method:"POST",headers:cl(),body:JSON.stringify({sessionID:l})});return o.ok?(await o.json()).recon:null}const cl=()=>({"Content-Type":"application/json"});async function zn(l){var o,c;try{return((c=(o=await l.json())==null?void 0:o.error)==null?void 0:c.message)??""}catch{return""}}async function Uo(l,o){if(!l.ok)throw new Error(await zn(l)||`${o} failed (${l.status})`);return l.json()}const VS=()=>fetch("/api/workspaces").then(l=>Uo(l,"Listing workspaces")),QS=l=>fetch("/api/workspaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:l})}).then(o=>Uo(o,"Creating the workspace")),KS=l=>fetch(`/api/workspaces?directory=${encodeURIComponent(l)}`,{method:"DELETE"}).then(o=>Uo(o,"Deleting the workspace")),ZS=(l,o)=>fetch(`/api/agent/files?directory=${encodeURIComponent(l)}&path=${encodeURIComponent(o)}`).then(c=>Uo(c,"Listing files")),PS=(l,o,c)=>fetch(`/api/agent/upload?directory=${encodeURIComponent(l)}&path=${encodeURIComponent(o)}&name=${encodeURIComponent(c.name)}`,{method:"POST",headers:{"Content-Type":"application/octet-stream"},body:c}).then(u=>Uo(u,`Uploading ${c.name}`)),FS=(l,o)=>`/api/agent/file?directory=${encodeURIComponent(l)}&path=${encodeURIComponent(o)}`;let JS=0;const Uf=()=>`tool_${Date.now().toString(36)}_${(JS++).toString(36)}`,WS=l=>l.map(o=>o.id?o:{...o,id:Uf()}),e1=l=>l.map(({id:o,...c})=>c);function Ov({cursor:l=!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",l&&i.jsx("span",{className:"cursor big","aria-hidden":!0})]})]})}function t1({size:l=20,tagline:o=!0}){return i.jsxs("div",{className:"brand","aria-label":"BugXHunter",children:[i.jsx("span",{className:"logo",style:{fontSize:l},children:i.jsx(Ov,{})}),o&&i.jsxs("span",{className:"brand-sub",children:["Open-source AI security testing ",i.jsxs("span",{className:"brand-ver",title:"BugXHunter release v0.10.0",children:["v","0.10.0"]})]})]})}function th(){return typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition)}function Dv(l){const o=window.SpeechRecognition||window.webkitSpeechRecognition;if(!o)return{stop:()=>{},promise:Promise.resolve("")};const c=new o;c.lang=navigator.language||"en-US",c.interimResults=!0,c.continuous=!1;let u="";const d=new Promise(h=>{var m;c.onresult=b=>{var S;let y="";for(let g=b.resultIndex;g<b.results.length;g++){const v=b.results[g][0].transcript;b.results[g].isFinal?u+=v:y+=v}(S=l.onPartial)==null||S.call(l,u+y)},c.onend=()=>{var b;(b=l.onEnd)==null||b.call(l),h(u.trim())},c.onerror=()=>h(u.trim()),(m=l.onStart)==null||m.call(l),c.start()});return{stop:()=>c.stop(),promise:d}}let Nc=null;function n1(l){if(typeof window>"u"||!window.speechSynthesis)return;const o=l.replace(/[*_`#>]/g,"").replace(/\[(\d+)\]/g,"").trim();o&&(window.speechSynthesis.cancel(),Nc=new SpeechSynthesisUtterance(o),Nc.rate=1.05,window.speechSynthesis.speak(Nc))}function a1(){typeof window<"u"&&window.speechSynthesis&&window.speechSynthesis.cancel(),Nc=null}function Ho({title:l,tooltip:o,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:o??l,children:l}),c&&i.jsx("div",{className:"head-actions",children:c})]})}const l1={p:"$ ",out:"[*] ",ok:"[+] "};function Lv({lines:l}){const o=A.useMemo(()=>{var h;return typeof window<"u"&&!!((h=window.matchMedia)!=null&&h.call(window,"(prefers-reduced-motion: reduce)").matches)},[]),[c,u]=A.useState(()=>o?{line:l.length,chars:0,started:!0}:{line:0,chars:0,started:!1});A.useEffect(()=>{if(c.line>=l.length)return;const h=l[c.line],m=c.chars<h.text.length,b=c.started?m?h.pace??22:260:400,y=setTimeout(()=>{u(m?{line:c.line,chars:c.chars+1,started:!0}:{line:c.line+1,chars:0,started:!0})},b);return()=>clearTimeout(y)},[c,l]);const d=c.line>=l.length;return i.jsxs("div",{className:"boot",children:[l.map((h,m)=>{if(m>c.line)return i.jsx("div",{className:"line","aria-hidden":!0},m);const b=m<c.line,y=b?h.text:h.text.slice(0,c.chars);return i.jsxs("div",{className:"line",children:[i.jsx("span",{className:h.kind,children:l1[h.kind]}),y,b&&h.ok?i.jsxs("span",{className:"ok",children:[" ",h.ok]}):null,m===c.line&&c.started&&i.jsx("span",{className:"cursor"})]},m)}),d&&i.jsxs("div",{className:"line",children:[i.jsx("span",{className:"p",children:"$ "}),i.jsx("span",{className:"cursor"})]})]})}async function Nn(l,o){var u,d;const c=await fetch(l,{headers:{"Content-Type":"application/json"},...o});if(!c.ok){let h=`${c.status}`;try{h=((d=(u=await c.json())==null?void 0:u.error)==null?void 0:d.message)??h}catch{}throw new Error(h)}return c.json()}const Ql=l=>({method:"POST",body:l===void 0?void 0:JSON.stringify(l)}),s1=()=>Nn("/api/vault"),i1=(l,o)=>Nn("/api/vault/init",Ql({doc:l,dek:o})),zv=l=>Nn("/api/vault/unseal",Ql({dek:l})),o1=()=>Nn("/api/vault/seal",Ql()),r1=(l,o)=>Nn(`/api/vault/items/${encodeURIComponent(l)}`,{method:"PUT",body:JSON.stringify({value:o})}),c1=l=>Nn(`/api/vault/items/${encodeURIComponent(l)}`,{method:"DELETE"}),Gy=(l,o)=>Nn("/api/vault/methods",Ql({method:l,dek:o})),u1=l=>Nn(`/api/vault/methods/${encodeURIComponent(l)}`,{method:"DELETE"}),d1=l=>Nn("/api/vault",{method:"DELETE",body:JSON.stringify({dek:l})}),f1=()=>Nn("/api/auth/me"),Tf=()=>Nn("/api/auth/methods"),h1=()=>Nn("/api/auth/challenge",Ql()),m1=l=>Nn("/api/auth/passkey",Ql(l)),p1=l=>Nn("/api/auth/recover",Ql({dek:l})),g1=()=>Nn("/api/auth/logout",Ql()),y1=6e5,nh="bugxhunter-vault-prf-v1",v1="bugxhunter-vault-kek-v1",b1="bugxhunter-vault-ok",xi=new TextEncoder,Vl=crypto.subtle,yn={enc:l=>btoa(String.fromCharCode(...l instanceof Uint8Array?l:new Uint8Array(l))),dec:l=>Uint8Array.from(atob(l),o=>o.charCodeAt(0))},Ba={enc:l=>yn.enc(l).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),dec:l=>yn.dec(l.replace(/-/g,"+").replace(/_/g,"/")+"=".repeat((4-l.length%4)%4))},qa=l=>crypto.getRandomValues(new Uint8Array(l)),rl=l=>l.buffer.slice(l.byteOffset,l.byteOffset+l.byteLength);async function Uv(l,o){const c=await Vl.importKey("raw",xi.encode(l),"PBKDF2",!1,["deriveBits"]),u=await Vl.deriveBits({name:"PBKDF2",hash:o.hash,salt:rl(yn.dec(o.salt)),iterations:o.iterations},c,256);return new Uint8Array(u)}async function Hv(l,o,c){if(l.length!==32)throw new Error("PRF output must be 32 bytes");let u;if(o.passphrase){if(!c)throw new Error("This passkey was enrolled with a passphrase; enter it as well.");const m=await Uv(c,o.passphrase);u=new Uint8Array(64),u.set(l,0),u.set(m,32),m.fill(0)}else u=new Uint8Array(l);const d=await Vl.importKey("raw",rl(u),"HKDF",!1,["deriveKey"]),h=await Vl.deriveKey({name:"HKDF",hash:"SHA-256",salt:rl(yn.dec(o.hkdfSalt)),info:xi.encode(v1)},d,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"]);return u.fill(0),h}async function Yc(l,o){const c=await Uv(l,o),u=await Vl.importKey("raw",rl(c),"AES-GCM",!1,["encrypt","decrypt"]);return c.fill(0),u}async function Ro(l,o,c){const u=qa(12),d=await Vl.encrypt({name:"AES-GCM",iv:rl(u),additionalData:xi.encode(c)},l,rl(o));return{iv:yn.enc(u),ct:yn.enc(d)}}async function ah(l,o,c){const u=await Vl.decrypt({name:"AES-GCM",iv:rl(yn.dec(o.iv)),additionalData:xi.encode(c)},l,rl(yn.dec(o.ct)));return new Uint8Array(u)}const Hf="ABCDEFGHJKLMNPQRSTUVWXYZ23456789";function x1(){const l=qa(16);let o=0,c=0,u="";for(const d of l)for(c=c<<8|d,o+=8;o>=5;)u+=Hf[c>>>o-5&31],o-=5;return o>0&&(u+=Hf[c<<5-o&31]),u.match(/.{1,5}/g).join("-")}const lh=l=>l.toUpperCase().replace(/[^A-Z2-9]/g,"");function If(l){const o=lh(l);return o.length===26&&[...o].every(c=>Hf.includes(c))}const sh=l=>`${l}-${Ba.enc(qa(6))}`,Iv=()=>({name:"PBKDF2",hash:"SHA-256",iterations:y1,salt:yn.enc(qa(16))});async function Bv(l,o,c){const u={type:"passkey",id:sh("pk"),label:c,credentialId:o.credentialId,transports:o.transports,publicKey:o.publicKey,alg:o.alg,signCount:0,prfSalt:nh,hkdfSalt:yn.enc(qa(16)),wrapped:{iv:"",ct:""},createdAt:new Date().toISOString()};return u.wrapped=await Ro(await Hv(o.prf,u),l,u.id),u}async function ih(l,o){const c={type:"password",id:sh("pw"),label:"Backup passphrase",kdf:Iv(),wrapped:{iv:"",ct:""},createdAt:new Date().toISOString()};return c.wrapped=await Ro(await Yc(o,c.kdf),l,c.id),c}async function S1(l){const o=qa(32),c=await Vl.importKey("raw",rl(o),"AES-GCM",!1,["encrypt"]),u=new Date().toISOString(),d=[await Bv(o,l,l.label)];l.passphrase&&d.push(await ih(o,l.passphrase));const h=x1(),m={type:"recovery",id:sh("rc"),label:"Recovery code",kdf:Iv(),wrapped:{iv:"",ct:""},createdAt:u};m.wrapped=await Ro(await Yc(lh(h),m.kdf),o,m.id),d.push(m);const b={};for(const[g,v]of Object.entries(l.items))v&&(b[g]=await Ro(c,xi.encode(v),g));const y={version:1,createdAt:u,methods:d,verifier:await Ro(c,xi.encode(b1),"verifier"),items:b},S=yn.enc(o);return o.fill(0),{doc:y,dek:S,recoveryCode:h}}async function qv(l,o,c){const u=await Hv(o,l,c);return yn.enc(await ah(u,l.wrapped,l.id))}async function Gv(l,o){const c=await Yc(o,l.kdf);return yn.enc(await ah(c,l.wrapped,l.id))}async function $v(l,o){const c=await Yc(lh(o),l.kdf);return yn.enc(await ah(c,l.wrapped,l.id))}class ol extends Error{constructor(o){super(o),this.name="PrfUnsupportedError"}}class oh extends Error{constructor(){super("Passkey prompt cancelled or timed out."),this.name="PasskeyCancelledError"}}const Si=()=>typeof window<"u"&&!!window.PublicKeyCredential&&!!navigator.credentials,w1=new TextEncoder;function _c(){const l=location.hostname;if(/^\d{1,3}(\.\d{1,3}){3}$/.test(l)||l.startsWith("["))throw new ol(`Passkeys can't be bound to an IP address (${l}). Open the app via http://localhost:${location.port||80} or a hostname.`);return l}function Xv(l){const o=l;return(o==null?void 0:o.name)==="NotAllowedError"?new oh:(o==null?void 0:o.name)==="OperationError"?new ol("Another passkey request is pending in this tab. Close any stray OS dialog or reload, then try again."):(o==null?void 0:o.name)==="SecurityError"?new ol(`The browser refused the passkey request (SecurityError: ${o.message}). Passkeys need https or localhost, and a relying-party name equal to the page's host (${location.hostname}).`):(o==null?void 0:o.name)==="NotSupportedError"||(o==null?void 0:o.name)==="ConstraintError"?new ol(`The authenticator can't do this (${o.name}: ${o.message}).`):o instanceof Error?new Error(`${o.name??"Error"}: ${o.message}`):new Error(String(l))}const Yv=l=>({prf:{eval:{first:w1.encode(l)}}});async function Vv(l,o){var S,g,v,x;if(!Si())throw new ol("This browser has no passkey support.");let c;try{c=await navigator.credentials.create({publicKey:{rp:{id:_c(),name:"BugXHunter"},user:{id:qa(16),name:l,displayName:"BugXHunter vault"},challenge:qa(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:Yv(o)}})}catch(k){throw Xv(k)}if(!c)throw new oh;const u=c.getClientExtensionResults();if(!((S=u.prf)!=null&&S.enabled))throw new ol("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 d=c.response,h=(g=d.getPublicKey)==null?void 0:g.call(d);if(!h)throw new ol("This browser doesn't expose the passkey's public key (needed for sign-in). Use Chrome, Edge or Safari.");const m=((v=d.getTransports)==null?void 0:v.call(d))??void 0,b=Ba.enc(new Uint8Array(c.rawId)),y=(x=u.prf.results)!=null&&x.first?new Uint8Array(u.prf.results.first):(await rh({challenge:Ba.enc(qa(32)),rpId:_c(),allowCredentials:[{id:b,transports:m}]},o)).prf;return{credentialId:b,transports:m,prf:y,publicKey:yn.enc(h),alg:d.getPublicKeyAlgorithm()}}async function rh(l,o){var m,b;if(!Si())throw new ol("This browser has no passkey support.");const c=_c();l.rpId&&l.rpId!==c&&console.warn(`[vault] server suggested rpId ${l.rpId}; using the page's host ${c}`);let u;try{u=await navigator.credentials.get({publicKey:{rpId:c,challenge:Ba.dec(l.challenge),allowCredentials:l.allowCredentials.map(y=>({type:"public-key",id:Ba.dec(y.id),transports:y.transports})),userVerification:"required",timeout:12e4,extensions:Yv(o)}})}catch(y){throw Xv(y)}if(!u)throw new oh;const d=u.response,h=u.getClientExtensionResults();return{assertion:{credentialId:Ba.enc(new Uint8Array(u.rawId)),clientDataJSON:Ba.enc(new Uint8Array(d.clientDataJSON)),authenticatorData:Ba.enc(new Uint8Array(d.authenticatorData)),signature:Ba.enc(new Uint8Array(d.signature))},prf:(b=(m=h.prf)==null?void 0:m.results)!=null&&b.first?new Uint8Array(h.prf.results.first):void 0}}async function A1(l,o,c){const{prf:u}=await rh({challenge:Ba.enc(qa(32)),rpId:_c(),allowCredentials:[{id:l,transports:o}]},c);if(!u)throw new ol("The authenticator returned no PRF output. Use a passkey that supports PRF, or your recovery code.");return u}let ch=null;const Rc=l=>{ch=l},uh=()=>{ch=null},T1=()=>ch,Bf="or:unauthorized";async function k1(){uh(),await g1().catch(()=>{}),window.location.reload()}function j1({children:l}){const[o,c]=A.useState("checking");return A.useEffect(()=>{f1().then(d=>c(d.required?d.authenticated?"signed-in":"signed-out":"open")).catch(()=>c("open"));const u=()=>c("signed-out");return window.addEventListener(Bf,u),()=>window.removeEventListener(Bf,u)},[]),o==="checking"?null:o==="signed-out"?i.jsx(N1,{onSuccess:()=>c("signed-in")}):i.jsx(i.Fragment,{children:l})}function N1({onSuccess:l}){const[o,c]=A.useState("passkey"),[u,d]=A.useState(""),[h,m]=A.useState(""),[b,y]=A.useState(""),[S,g]=A.useState(!1),[v,x]=A.useState(!1),[k,O]=A.useState(!1),[Y,B]=A.useState(null),[te,re]=A.useState(null);A.useEffect(()=>{Tf().then(({methods:U})=>{g(U.some(V=>V.type==="passkey"&&!!V.passphrase)),x(U.some(V=>V.type==="password"))}).catch(()=>{})},[]);async function fe(){var U;O(!0),B(null),re(null);try{const V=await h1();if("open"in V)return l();const{methods:J}=await Tf(),oe=J.filter(ce=>ce.type==="passkey"),X=((U=oe[0])==null?void 0:U.prfSalt)??"bugxhunter-vault-prf-v1",{assertion:K,prf:Q}=await rh(V,X);await m1(K);const me=oe.find(ce=>ce.credentialId===K.credentialId);if(me&&Q)try{const ce=await qv(me,Q,me.passphrase?u:void 0);await zv(ce),Rc(ce)}catch{re(me.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.")}l()}catch(V){B(V.message),O(!1)}}async function E(U){O(!0),B(null);try{const{methods:V}=await Tf();let J;try{if(U==="password"){const oe=V.find(X=>X.type==="password");if(!oe)throw new Error("no method");J=await Gv(oe,h)}else{const oe=V.find(X=>X.type==="recovery");if(!oe)throw new Error("no method");J=await $v(oe,b)}}catch{throw new Error(U==="password"?"Wrong backup passphrase.":"That recovery code doesn't open the vault.")}await p1(J),Rc(J),l()}catch(V){B(V.message),O(!1)}}const G=()=>{o==="passkey"?fe():o==="password"?E("password"):o==="recovery"&&E("recovery")};return i.jsx("div",{className:"login-page grid-bg",children:i.jsxs("form",{className:"login-card",onSubmit:U=>{U.preventDefault(),G()},children:[i.jsx(Ho,{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(Ov,{cursor:!0})}),i.jsx("div",{className:"login-tag",children:"Open-source AI security testing"}),o==="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:U=>d(U.target.value)})]}),!Si()&&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:k||!Si(),children:k?"waiting for the passkey…":"./sign_in --passkey →"})}),i.jsxs("div",{className:"login-links",children:[v&&i.jsx("button",{type:"button",className:"link-btn",disabled:k,onClick:()=>{c("password"),B(null)},children:"use the backup passphrase"}),i.jsx("button",{type:"button",className:"link-btn",disabled:k,onClick:()=>{c("recovery"),B(null)},children:"use the recovery code"})]})]}),o==="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:U=>m(U.target.value)}),i.jsx("div",{className:"perm-actions center",children:i.jsx("button",{className:"btn primary wide",type:"submit",disabled:k||!h,children:k?"checking…":"./sign_in --passphrase →"})}),i.jsxs("div",{className:"login-links",children:[i.jsx("button",{type:"button",className:"link-btn",disabled:k,onClick:()=>{c("passkey"),B(null)},children:"back to the passkey"}),i.jsx("button",{type:"button",className:"link-btn",disabled:k,onClick:()=>{c("recovery"),B(null)},children:"use the recovery code"})]})]}),o==="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:U=>y(U.target.value)}),i.jsx("div",{className:"perm-actions center",children:i.jsx("button",{className:"btn primary wide",type:"submit",disabled:k||!If(b),children:k?"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:k,onClick:()=>{c("passkey"),B(null)},children:"back to the passkey"}),i.jsx("button",{type:"button",className:"link-btn",disabled:k,onClick:()=>{c("lost"),B(null)},children:"lost that too?"})]})]}),o==="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"),B(null)},children:"back"})]}),te&&i.jsx("div",{className:"form-status success",children:te}),Y&&i.jsx("div",{className:"form-status error",children:Y})]})]})})}function Ts({title:l,onClose:o,children:c}){return A.useEffect(()=>{if(!o)return;const u=d=>d.key==="Escape"&&o();return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[o]),i.jsx("div",{className:"overlay vault-dialog",onClick:o,children:i.jsxs("div",{className:"modal",role:"dialog","aria-label":l,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}),l]}),o&&i.jsx("button",{className:"icon-btn close-x",onClick:o,"aria-label":"Close",title:"Close (Esc)",children:"✕"})]}),i.jsx("div",{className:"modal-body",children:c})]})})}const Oo=10,Oc=()=>`BugXHunter vault (${location.hostname})`,kf="__custom__",mi=[{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:"ANTHROPIC_API_KEY",short:"Anthropic — Claude models",label:"Anthropic key — Claude Opus, Sonnet and Haiku (optional)"},{name:"OPENROUTER_API_KEY",short:"OpenRouter — one key, its whole catalogue",label:"OpenRouter key — unlocks its model catalogue (optional)"}],E1={SCX_API:"sk-scx-…",NVIDIA_API_KEY:"nvapi-…",ANTHROPIC_API_KEY:"sk-ant-…",OPENROUTER_API_KEY:"sk-or-…"};function C1(){const[l,o]=A.useState(null),[c,u]=A.useState(null),[d,h]=A.useState(Date.now()),m=A.useCallback(()=>s1().then(o).catch(()=>{}),[]);A.useEffect(()=>{m();const g=setInterval(()=>{m(),h(Date.now())},3e4);return()=>clearInterval(g)},[m]);const b=()=>{u(null),m()},y=A.useCallback(()=>{uh(),o1().then(o).catch(()=>{})},[]);if(A.useEffect(()=>{const g=v=>{(v.ctrlKey||v.metaKey)&&v.shiftKey&&v.key.toLowerCase()==="l"&&(v.preventDefault(),y())};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[y]),!l)return null;const S=l.initialised?l.unsealed?i.jsxs(i.Fragment,{children:[i.jsxs("span",{className:"vault-state open",title:l.idleMinutes?`Auto-locks after ${l.idleMinutes} min without activity`:"Auto-lock off",children:["vault open",l.sealsAt?` · locks in ${O1(l.sealsAt-d)}`:""]}),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(_1,{})}),i.jsx("button",{className:"icon-btn vault-btn",onClick:y,title:"Lock the vault (Ctrl+Shift+L)","aria-label":"Lock the vault (Ctrl+Shift+L)",children:i.jsx(R1,{})})]}):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(M1,{})})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"vault-state none",title:l.keySource==="none"?"No model key yet":l.keySource==="file"?"Model key comes from a key file":`Model key comes from ${l.keySource==="env"?".env":"OpenCode's auth.json"}, in the clear`,children:l.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(D1,{onClose:b}),c==="unlock"&&i.jsx(L1,{status:l,onClose:b}),c==="manage"&&i.jsx(z1,{status:l,onChange:o,onClose:b})]})}const M1=()=>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"})]}),_1=()=>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"})]}),R1=()=>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 O1(l){const o=Math.max(0,Math.round(l/6e4));return o>=60?`${Math.floor(o/60)}h ${String(o%60).padStart(2,"0")}m`:`${o}m`}const jf=["passkey","key","backups"];function D1({onClose:l}){const[o,c]=A.useState("passkey"),[u,d]=A.useState(null),[h,m]=A.useState("SCX_API"),[b,y]=A.useState(""),[S,g]=A.useState(""),[v,x]=A.useState(""),[k,O]=A.useState(null),[Y,B]=A.useState(!1),[te,re]=A.useState(!1),[fe,E]=A.useState(!1),[G,U]=A.useState(null);async function V(){E(!0),U(null);try{d(await Vv(Oc(),nh)),c("key")}catch(K){U(K.message)}finally{E(!1)}}async function J(){if(u){E(!0),U(null);try{O(await S1({...u,label:Oc(),items:b.trim()?{[h]:b.trim()}:{}})),c("backups")}catch(K){U(K.message)}finally{E(!1)}}}async function oe(){if(k){E(!0),U(null);try{let K=k.doc;S&&(K={...K,methods:[...K.methods,await ih(yn.dec(k.dek),S)]}),await i1(K,k.dek),Rc(k.dek),l()}catch(K){U(K.message),E(!1)}}}const X=!S||S.length>=Oo&&S===v;return i.jsxs(Ts,{title:"vault --init",onClose:o==="backups"?void 0:l,children:[i.jsx("div",{className:"steps",children:jf.map(K=>i.jsx("span",{className:K===o?"on":jf.indexOf(K)<jf.indexOf(o)?"done":"",children:K},K))}),o==="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."}),!Si()&&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:fe||!Si(),onClick:V,children:fe?"waiting for the authenticator…":"create passkey →"})})]}),o==="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:mi.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:E1[h]??"",value:b,onChange:K=>y(K.target.value)}),i.jsx("div",{className:"perm-actions center",children:i.jsx("button",{className:"btn primary wide",disabled:fe,onClick:J,children:fe?"sealing…":"next →"})})]}),o==="backups"&&k&&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"+(te?" copied":""),"aria-label":"Recovery code — click to copy",title:"Click to copy",onClick:()=>{var K;(K=navigator.clipboard)==null||K.writeText(k.recoveryCode).then(()=>{re(!0),setTimeout(()=>re(!1),2e3)}).catch(()=>{})},children:[i.jsx("span",{className:"code",children:k.recoveryCode}),i.jsx("span",{className:"copy-hint",children:te?"✓ copied":"click to copy"})]}),i.jsxs("label",{className:"check",children:[i.jsx("input",{type:"checkbox",checked:Y,onChange:K=>B(K.target.checked)})," I have stored this code somewhere safe."]}),i.jsxs("label",{htmlFor:"v-pass",children:["Backup passphrase (optional, at least ",Oo," characters)"]}),i.jsx("input",{id:"v-pass",type:"password",autoComplete:"new-password",value:S,onChange:K=>g(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:!Y||!X||fe,onClick:oe,children:fe?"creating…":"create vault →"})})]}),G&&i.jsx("div",{className:"form-status error",children:G})]})}function L1({status:l,onClose:o}){const[c,u]=A.useState("passkey"),[d,h]=A.useState(""),[m,b]=A.useState(""),[y,S]=A.useState(!1),[g,v]=A.useState(null),x=l.methods.find(E=>E.type==="passkey"),k=l.methods.find(E=>E.type==="password"),O=l.methods.find(E=>E.type==="recovery"),Y=!!(x!=null&&x.passphrase);async function B(E,G){S(!0),v(null);try{let U;try{U=await E()}catch(V){throw V instanceof Error&&/Passkey|authenticator|pending|origin/i.test(V.message)?V:new Error(G)}await zv(U),Rc(U),o()}catch(U){v(U.message),S(!1)}}const te=()=>x&&B(async()=>{const E=await A1(x.credentialId,x.transports,x.prfSalt);return qv(x,E,Y?d:void 0)},Y?"Wrong passphrase, or a different passkey than the one enrolled.":"A different passkey than the one enrolled."),re=()=>k&&B(()=>Gv(k,d),"Wrong backup passphrase."),fe=()=>O&&B(()=>$v(O,m),"That recovery code doesn't open the vault.");return i.jsxs(Ts,{title:"vault --unlock",onClose:o,children:[c==="passkey"&&i.jsxs(i.Fragment,{children:[i.jsx("p",{children:Y?"This passkey was enrolled with a passphrase: enter it, then confirm with the passkey.":"One touch: confirm with your passkey."}),Y&&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:d,onChange:E=>h(E.target.value),onKeyDown:E=>{E.key==="Enter"&&d&&te()}})]}),i.jsx("div",{className:"perm-actions center",children:i.jsx("button",{className:"btn primary wide",autoFocus:!Y,disabled:y||!x||Y&&!d,onClick:te,children:y?"waiting for the authenticator…":"unlock with passkey →"})}),i.jsxs("div",{className:"login-links",children:[k&&i.jsx("button",{className:"link-btn",disabled:y,onClick:()=>{u("password"),v(null)},children:"use the backup passphrase"}),O&&i.jsx("button",{className:"link-btn",disabled:y,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:d,onChange:E=>h(E.target.value),onKeyDown:E=>{E.key==="Enter"&&d&&re()}}),i.jsx("div",{className:"perm-actions center",children:i.jsx("button",{className:"btn primary wide",disabled:y||!d,onClick:re,children:y?"unlocking…":"unlock →"})}),i.jsxs("div",{className:"login-links",children:[i.jsx("button",{className:"link-btn",disabled:y,onClick:()=>{u("passkey"),v(null)},children:"use the passkey instead"}),O&&i.jsx("button",{className:"link-btn",disabled:y,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:E=>b(E.target.value),onKeyDown:E=>{E.key==="Enter"&&If(m)&&fe()}}),i.jsx("div",{className:"perm-actions center",children:i.jsx("button",{className:"btn primary wide",disabled:y||!If(m),onClick:fe,children:y?"unlocking…":"unlock →"})}),i.jsxs("div",{className:"login-links",children:[i.jsx("button",{className:"link-btn",disabled:y,onClick:()=>{u("passkey"),v(null)},children:"use the passkey instead"}),k&&i.jsx("button",{className:"link-btn",disabled:y,onClick:()=>{u("password"),v(null)},children:"use the backup passphrase"})]})]}),g&&i.jsx("div",{className:"form-status error",children:g})]})}function z1({status:l,onChange:o,onClose:c}){const[u,d]=A.useState("SCX_API"),[h,m]=A.useState(""),[b,y]=A.useState(""),[S,g]=A.useState(!1),[v,x]=A.useState(""),[k,O]=A.useState(!1),[Y,B]=A.useState(null),te=T1(),re=l.methods.filter(Q=>Q.type==="passkey"),fe=l.methods.find(Q=>Q.type==="password");async function E(Q){O(!0),B(null);try{const me=await Q();me&&o(me)}catch(me){B(me.message)}finally{O(!1)}}const G=()=>{if(!te)throw new Error("Unlock the vault in this tab first (the change must wrap the current key).");return yn.dec(te)},U=()=>E(async()=>{const Q=await r1(u.trim().toUpperCase(),h);return m(""),Q}),V=Q=>E(()=>c1(Q)),J=Q=>E(()=>u1(Q)),oe=()=>E(async()=>{const Q=G(),me=await Bv(Q,await Vv(Oc(),nh),Oc());return Gy(me,te)}),X=()=>E(async()=>{const Q=G(),me=await Gy(await ih(Q,b),te);return g(!1),y(""),me}),K=()=>E(async()=>{G();const Q=await d1(te);return uh(),c(),Q});return i.jsxs(Ts,{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:[mi.map(Q=>{const me=l.items.includes(Q.name);return i.jsxs("div",{className:"vault-item",children:[i.jsx("span",{className:me?"ok":"missing","aria-hidden":!0,children:me?"✓":"○"}),i.jsxs("span",{className:"name",children:[Q.name,i.jsxs("span",{className:"desc",children:[" — ",Q.label]})]}),me?i.jsx("button",{className:"btn danger",disabled:k,onClick:()=>V(Q.name),title:"Remove",children:"✕"}):i.jsx("button",{className:"btn sm",disabled:k,onClick:()=>{d(Q.name),setTimeout(()=>{var ce;return(ce=document.getElementById("v-value"))==null?void 0:ce.focus()},0)},children:"add"})]},Q.name)}),l.items.filter(Q=>!mi.some(me=>me.name===Q)).map(Q=>i.jsxs("div",{className:"vault-item",children:[i.jsx("span",{className:"ok","aria-hidden":!0,children:"✓"}),i.jsx("span",{className:"name",children:Q}),i.jsx("button",{className:"btn danger",disabled:k,onClick:()=>V(Q),title:"Remove",children:"✕"})]},Q))]}),i.jsx("label",{htmlFor:"v-name",children:"Key"}),i.jsxs("select",{id:"v-name",className:"mono",value:mi.some(Q=>Q.name===u)?u:kf,onChange:Q=>d(Q.target.value===kf?"":Q.target.value),children:[mi.map(Q=>i.jsxs("option",{value:Q.name,children:[Q.name,l.items.includes(Q.name)?" (replace)":""]},Q.name)),i.jsx("option",{value:kf,children:"custom…"})]}),!mi.some(Q=>Q.name===u)&&i.jsx("input",{type:"text",className:"mono",placeholder:"NAME_IN_UPPER_SNAKE_CASE","aria-label":"Custom key name",value:u,onChange:Q=>d(Q.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:Q=>m(Q.target.value),onKeyDown:Q=>{Q.key==="Enter"&&h&&U()}}),i.jsxs("div",{className:"perm-actions",children:[i.jsx("button",{className:"btn primary sm",disabled:k||!h||!u.trim(),onClick:U,children:k?"sealing…":"save"}),i.jsx("span",{className:"hint",style:{margin:0},children:l.idleMinutes?`Auto-locks after ${l.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:re.map(Q=>i.jsxs("div",{className:"vault-item",children:[i.jsx("span",{className:Q.canLogin?"ok":"warn","aria-hidden":!0,children:Q.canLogin?"✓":"!"}),i.jsxs("span",{className:"name",children:[Q.label,Q.passphrase?" — needs its passphrase (older enrolment)":"",Q.canLogin?"":" — unlock only, can't sign in; add a new passkey"]}),i.jsx("button",{className:"btn danger",disabled:k||re.length<=1,onClick:()=>J(Q.id),title:re.length<=1?"Add another passkey first":"Remove",children:"✕"})]},Q.id))}),i.jsx("div",{className:"perm-actions",children:i.jsx("button",{className:"btn sm",disabled:k||!te,onClick:oe,title:te?"":"Unlock the vault in this tab first",children:k?"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"})]}),fe&&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:k,onClick:()=>J(fe.id),title:"Remove",children:"✕"})]})]}),S?i.jsxs(i.Fragment,{children:[i.jsxs("label",{htmlFor:"v-newpass",children:[fe?"New backup passphrase":"Backup passphrase"," (at least ",Oo," characters)"]}),i.jsx("input",{id:"v-newpass",type:"password",autoFocus:!0,autoComplete:"new-password",value:b,onChange:Q=>y(Q.target.value),onKeyDown:Q=>{Q.key==="Enter"&&b.length>=Oo&&X()}}),i.jsxs("div",{className:"perm-actions",children:[i.jsx("button",{className:"btn primary sm",disabled:k||b.length<Oo,onClick:X,children:k?"sealing…":"save"}),i.jsx("button",{className:"btn sm",disabled:k,onClick:()=>g(!1),children:"cancel"})]})]}):i.jsx("div",{className:"perm-actions",children:i.jsx("button",{className:"btn sm",disabled:k||!te,onClick:()=>g(!0),title:te?"":"Unlock the vault in this tab first",children:fe?"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:Q=>x(Q.target.value),style:{width:160}}),i.jsx("button",{className:"btn danger-outline sm",disabled:k||v!=="DELETE"||!te,onClick:K,children:"delete vault"})]}),Y&&i.jsx("div",{className:"form-status error",children:Y})]})}function Gt({size:l=14,children:o,className:c}){return i.jsx("svg",{className:c,width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:o})}const dh=l=>i.jsxs(Gt,{...l,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"})]}),U1=l=>i.jsxs(Gt,{...l,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"})]}),H1=l=>i.jsxs(Gt,{...l,children:[i.jsx("path",{d:"M12 19h8"}),i.jsx("path",{d:"m4 17 6-6-6-6"})]}),$y=l=>i.jsxs(Gt,{...l,children:[i.jsx("path",{d:"m21 21-4.34-4.34"}),i.jsx("circle",{cx:"11",cy:"11",r:"8"})]}),I1=l=>i.jsxs(Gt,{...l,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"})]}),B1=l=>i.jsxs(Gt,{...l,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"})]}),q1=l=>i.jsxs(Gt,{...l,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"})]}),G1=l=>i.jsxs(Gt,{...l,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"})]}),$1=l=>i.jsxs(Gt,{...l,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"})]}),X1=l=>i.jsx(Gt,{...l,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"})}),Y1=l=>i.jsxs(Gt,{...l,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"})]}),Qv=l=>i.jsxs(Gt,{...l,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"})]}),V1=l=>i.jsxs(Gt,{...l,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"})]}),fh=l=>i.jsx(Gt,{...l,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"})}),Q1=l=>i.jsxs(Gt,{...l,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"})]}),K1=l=>i.jsxs(Gt,{...l,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"})]}),Z1=l=>i.jsxs(Gt,{...l,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"})]}),P1=l=>i.jsxs(Gt,{...l,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"})]}),F1=l=>i.jsxs(Gt,{...l,children:[i.jsx("path",{d:"M5 12h14"}),i.jsx("path",{d:"M12 5v14"})]}),J1=l=>i.jsxs(Gt,{...l,children:[i.jsx("path",{d:"M14 9 9 4 4 9"}),i.jsx("path",{d:"M20 20h-7a4 4 0 0 1-4-4V4"})]}),Vc=l=>i.jsx(Gt,{...l,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 W1({tool:l,size:o=14}){switch(l){case"read":return i.jsx(dh,{size:o});case"write":case"edit":case"patch":case"apply_patch":return i.jsx(U1,{size:o});case"bash":return i.jsx(H1,{size:o});case"grep":return i.jsx($y,{size:o});case"glob":case"list":return i.jsx(I1,{size:o});case"webfetch":return i.jsx(q1,{size:o});case"websearch":return i.jsx($y,{size:o});case"todowrite":case"todoread":return i.jsx(G1,{size:o});case"task":return i.jsx(B1,{size:o});case"question":return i.jsx($1,{size:o});default:return i.jsx(X1,{size:o})}}async function ks(l,o){var u,d;const c=await fetch(l,{headers:{"Content-Type":"application/json"},...o});if(!c.ok){let h=`${c.status}`;try{h=((d=(u=await c.json())==null?void 0:u.error)==null?void 0:d.message)??h}catch{}throw new Error(h)}return c.json()}const ew=()=>ks("/api/github"),tw=()=>ks("/api/github/repos").then(l=>l.repos),nw=l=>ks(`/api/github/branches?repo=${encodeURIComponent(l)}`).then(o=>o.branches),aw=l=>ks("/api/github/clone",{method:"POST",body:JSON.stringify(l)}),lw=()=>ks("/api/github/connect/start",{method:"POST"}),sw=l=>ks("/api/github/connect/poll",{method:"POST",body:JSON.stringify({id:l})}),iw=()=>ks("/api/github/connect",{method:"DELETE"});function Dc(l){if(!l)return"";const o=Math.max(0,(Date.now()-new Date(l).getTime())/1e3);return o<3600?`${Math.max(1,Math.round(o/60))} min ago`:o<86400?`${Math.round(o/3600)} h ago`:o<86400*30?`${Math.round(o/86400)} d ago`:o<86400*365?`${Math.round(o/(86400*30))} mo ago`:`${Math.round(o/(86400*365))} y ago`}function ow({onOpen:l,onClose:o}){const[c,u]=A.useState(null),[d,h]=A.useState(null),[m,b]=A.useState(null),[y,S]=A.useState(""),[g,v]=A.useState(null),[x,k]=A.useState(null),[O,Y]=A.useState(""),[B,te]=A.useState(null),[re,fe]=A.useState(null),[E,G]=A.useState(null),[U,V]=A.useState(!1),J=A.useCallback(()=>ew().then(F=>{u(F),h(null)}).catch(F=>h(F.message)),[]);A.useEffect(()=>{J()},[J]);const oe=!!(c!=null&&c.connected&&!c.sealed&&!c.error),X=A.useCallback(()=>{te("repos"),tw().then(b).catch(F=>fe(F.message)).finally(()=>te(F=>F==="repos"?null:F))},[]);A.useEffect(()=>{oe&&X()},[oe,X]),A.useEffect(()=>{if(!oe)return;const F=()=>X();return window.addEventListener("focus",F),()=>window.removeEventListener("focus",F)},[oe,X]);const K=A.useRef(null),Q=()=>{K.current&&(window.clearTimeout(K.current),K.current=null)};A.useEffect(()=>Q,[]);async function me(){te("connect"),fe(null);try{const F=await lw();G(F);try{await navigator.clipboard.writeText(F.userCode),V(!0)}catch{V(!1)}const we=async()=>{try{const nt=await sw(F.id);if(nt.status==="pending"){K.current=window.setTimeout(we,F.interval*1e3);return}if(G(null),te(null),nt.status==="connected"){await J();return}fe(nt.status==="denied"?"The sign-in was cancelled on GitHub.":"The code expired. Start again.")}catch(nt){G(null),te(null),fe(nt.message)}};K.current=window.setTimeout(we,F.interval*1e3)}catch(F){te(null),fe(F.message)}}function ce(){Q(),G(null),te(null)}async function Ce(){fe(null);try{await iw(),b(null),v(null),await J()}catch(F){fe(F.message)}}function ae(F){v(F),Y(F.defaultBranch),k(null),fe(null),te("branches"),nw(F.fullName).then(we=>{k(we),!we.some(nt=>nt.name===F.defaultBranch)&&we[0]&&Y(we[0].name)}).catch(we=>fe(we.message)).finally(()=>te(we=>we==="branches"?null:we))}async function W(){if(g){te("clone"),fe(null);try{const F=await aw({repo:g.fullName,branch:O});l(F.directory),o()}catch(F){fe(F.message)}finally{te(null)}}}const pe=A.useMemo(()=>{const F=y.trim().toLowerCase();return(m??[]).filter(we=>!F||we.fullName.toLowerCase().includes(F)||(we.description??"").toLowerCase().includes(F))},[m,y]);return i.jsxs(Ts,{title:"github --clone",onClose:o,children:[d&&i.jsx("div",{className:"hint danger",children:d}),c&&!c.connected&&!E&&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:B!==null,onClick:me,children:[i.jsx(Qv,{size:15})," ",B==="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."})]}),E&&i.jsxs(i.Fragment,{children:[i.jsxs("p",{children:["Enter this code on GitHub to connect. ",U?"It is on your clipboard.":"Click it to copy."]}),i.jsx("button",{className:"recovery-code gh-code",onClick:()=>navigator.clipboard.writeText(E.userCode).then(()=>V(!0)).catch(()=>{}),title:"Copy",children:E.userCode}),i.jsx("div",{className:"perm-actions center",children:i.jsx("a",{className:"btn primary wide",href:E.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:ce,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}),oe&&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:Ce,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(F=>i.jsxs("div",{className:"vault-item",children:[i.jsx("span",{className:"ok","aria-hidden":!0,children:"✓"}),i.jsxs("span",{className:"name",title:F.directory,children:[F.fullName,i.jsxs("span",{className:"desc",children:[" — ",F.branch??"detached"]})]}),i.jsx("button",{className:"btn sm",onClick:()=>{l(F.directory),o()},children:"open"})]},F.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:y,onChange:F=>S(F.target.value),spellCheck:!1,autoFocus:!0}),i.jsxs("div",{className:"gh-list",role:"listbox","aria-label":"Repositories",children:[B==="repos"&&!m&&i.jsx("div",{className:"hint",children:"loading…"}),m&&m.length>0&&pe.length===0&&i.jsx("div",{className:"hint",children:"Nothing matches."}),pe.map(F=>i.jsxs("button",{className:`gh-repo${(g==null?void 0:g.fullName)===F.fullName?" selected":""}`,role:"option","aria-selected":(g==null?void 0:g.fullName)===F.fullName,onClick:()=>ae(F),children:[i.jsxs("span",{className:"gh-name",children:[F.fullName,F.private&&i.jsx("span",{className:"badge",children:"private"}),F.archived&&i.jsx("span",{className:"badge",children:"archived"}),F.directory&&i.jsx("span",{className:"badge on",children:"in workspace"})]}),F.description&&i.jsx("span",{className:"gh-desc",children:F.description}),i.jsxs("span",{className:"gh-meta",children:[i.jsx(Y1,{size:11})," ",F.defaultBranch,F.pushedAt?` · pushed ${Dc(F.pushedAt)}`:""]})]},F.fullName))]})]}),g&&i.jsxs("div",{className:"gh-clone",children:[i.jsx("label",{htmlFor:"gh-branch",children:"Branch"}),i.jsx("select",{id:"gh-branch",className:"mono",value:O,onChange:F=>Y(F.target.value),disabled:!x,children:(x??[{name:O,isDefault:!0}]).map(F=>i.jsxs("option",{value:F.name,children:[F.name,F.isDefault?" (default)":""]},F.name))}),i.jsx("button",{className:"btn primary sm",disabled:B!==null||!O,onClick:W,children:B==="clone"?g.directory?"updating…":"cloning…":g.directory?"update & open":"clone & open"})]}),g&&i.jsxs("div",{className:"hint",children:["Lands in ",i.jsxs("span",{className:"mono",children:[c.cloneRoot,"/",g.fullName]}),". An existing clone is fast-forwarded, never reset; the agent's local edits stay."]})]}),re&&i.jsx("div",{className:"hint danger",children:re})]})}function rw({current:l,onOpen:o,onDeleted:c,onClose:u}){const[d,h]=A.useState(""),[m,b]=A.useState(null),[y,S]=A.useState(""),[g,v]=A.useState(null),[x,k]=A.useState(""),[O,Y]=A.useState(!1),[B,te]=A.useState(null),re=A.useCallback(()=>VS().then(U=>{h(U.root),b(U.workspaces)}).catch(U=>te(U.message)),[]);A.useEffect(()=>{re()},[re]);async function fe(U){Y(!0),te(null);try{await U()}catch(V){te(V.message)}finally{Y(!1)}}const E=()=>fe(async()=>{const U=await QS(y.trim());S(""),o(U.directory),u()}),G=U=>fe(async()=>{await KS(U.directory),c(U.directory),v(null),k(""),await re()});return i.jsxs(Ts,{title:"workspace --list",onClose:u,children:[i.jsxs("p",{children:["Each workspace is a folder the agent works in",d?i.jsxs(i.Fragment,{children:[" under ",i.jsx("span",{className:"mono",children:d})]}):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:y,spellCheck:!1,onChange:U=>S(U.target.value),onKeyDown:U=>{U.key==="Enter"&&y.trim()&&E()}}),i.jsxs("button",{className:"btn primary sm",disabled:O||!y.trim(),onClick:E,children:[i.jsx(F1,{size:13})," create"]})]}),i.jsxs("div",{className:"gh-list",role:"list",children:[!m&&!B&&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(U=>{const V=U.directory===l;return i.jsxs("div",{className:`ws-row${V?" current":""}`,role:"listitem",children:[i.jsxs("button",{className:"ws-open",onClick:()=>{o(U.directory),u()},disabled:V,title:V?"This is the open project":`Open ${U.directory}`,children:[i.jsx(fh,{size:14}),i.jsxs("span",{className:"gh-name",children:[U.name,V&&i.jsx("span",{className:"badge on",children:"open"}),!U.git&&i.jsx("span",{className:"badge",children:"no git"})]}),i.jsx("span",{className:"gh-meta",children:U.modified?`changed ${Dc(U.modified)}`:""})]}),i.jsx("button",{className:"icon-btn ws-del",disabled:O||V,onClick:()=>{v(U),k("")},title:V?"Open another project before deleting this one":`Delete ${U.name}`,"aria-label":`Delete ${U.name}`,children:i.jsx(P1,{size:14})})]},U.directory)})]}),g&&i.jsxs("div",{className:"ws-confirm",children:[i.jsxs("p",{children:[i.jsxs("b",{children:["Delete ",g.name,"?"]})," Everything in ",i.jsx("span",{className:"mono",children:g.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:g.name,"aria-label":"Type the workspace name to confirm",value:x,spellCheck:!1,onChange:U=>k(U.target.value),onKeyDown:U=>{U.key==="Enter"&&x===g.name&&G(g)}}),i.jsx("button",{className:"btn danger-outline sm",disabled:O||x!==g.name,onClick:()=>G(g),children:O?"deleting…":"delete"}),i.jsx("button",{className:"btn sm",disabled:O,onClick:()=>v(null),children:"cancel"})]})]}),B&&i.jsx("div",{className:"hint danger",children:B})]})}function Lo(l){return l>=1024*1024?(l/1024/1024).toFixed(1)+" MB":l>=1024?Math.round(l/1024)+" KB":l+" B"}function wi(l){return l>=1e6?(l/1e6).toFixed(l%1e6?1:0)+"M":l>=1e3?Math.round(l/1e3)+"k":String(l)}const Xy=l=>(l<1e4?(l/1e3).toFixed(1):Math.round(l/1e3))+"s";function Kv(l,o,c){const u=[];l.ttft!==void 0&&u.push(`${Xy(l.ttft)} to first token`);const d=c?l.total:l.total-(l.ttft??0);return o&&d>50&&u.push(`${Math.round(o/(d/1e3))} tok/s`),u.push(`${Xy(l.total)} total`),u.join(" · ")}function cw({directory:l,onClose:o}){const[c,u]=A.useState(""),[d,h]=A.useState(null),[m,b]=A.useState(null),[y,S]=A.useState([]),[g,v]=A.useState(null),[x,k]=A.useState(!1),O=A.useRef(null),Y=A.useCallback(E=>{v(null),ZS(l,E).then(G=>{h(G),u(G.path)}).catch(G=>v(G.message))},[l]);A.useEffect(()=>{Y("")},[Y]);async function B(E){const G=Array.from(E);if(!G.length)return;v(null);const U=[];for(let V=0;V<G.length;V++){const J=G[V];b(`uploading ${V+1} of ${G.length}: ${J.name}`);try{const oe=await PS(l,c,J);U.push(oe.name===J.name?`${oe.path} (${Lo(oe.bytes)})`:`${J.name} → ${oe.path}, as a file of that name exists`)}catch(oe){U.push(`${J.name}: ${oe.message}`)}}b(null),S(U),Y(c)}const te=E=>{E.preventDefault(),k(!1),E.dataTransfer.files.length&&B(E.dataTransfer.files)},re=c?c.split("/"):[],fe=l.split(/[\\/]/).filter(Boolean).pop()??l;return i.jsxs(Ts,{title:"files --browse",onClose:o,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:()=>Y(""),title:l,children:fe}),re.map((E,G)=>i.jsxs("span",{children:[i.jsx("span",{className:"sep",children:"/"}),i.jsx("button",{className:"link-btn",onClick:()=>Y(re.slice(0,G+1).join("/")),children:E})]},G))]}),i.jsxs("button",{className:"btn primary sm",disabled:!!m,onClick:()=>{var E;return(E=O.current)==null?void 0:E.click()},children:[i.jsx(K1,{size:13})," upload"]}),i.jsx("input",{ref:O,type:"file",multiple:!0,hidden:!0,onChange:E=>{E.target.files&&B(E.target.files),E.target.value=""}})]}),i.jsxs("div",{className:`gh-list files-list${x?" dragging":""}`,role:"list",onDragOver:E=>{E.preventDefault(),k(!0)},onDragLeave:()=>k(!1),onDrop:te,children:[!d&&!g&&i.jsx("div",{className:"hint",children:"loading…"}),c&&i.jsxs("button",{className:"file-row",onClick:()=>Y(re.slice(0,-1).join("/")),children:[i.jsx(J1,{size:14}),i.jsx("span",{className:"file-name",children:".."})]}),d&&d.entries.length===0&&i.jsx("div",{className:"hint",children:"Empty. Drop files here, or use upload."}),d==null?void 0:d.entries.map(E=>{const G=c?`${c}/${E.name}`:E.name;return E.type==="dir"?i.jsxs("button",{className:"file-row",onClick:()=>Y(G),children:[i.jsx(fh,{size:14}),i.jsxs("span",{className:"file-name",children:[E.name,"/"]}),i.jsx("span",{className:"gh-meta",children:E.modified?Dc(E.modified):""})]},E.name):i.jsxs("a",{className:"file-row",href:FS(l,G),download:E.name,title:`Download ${G}`,children:[i.jsx(Q1,{size:14}),i.jsx("span",{className:"file-name",children:E.name}),i.jsxs("span",{className:"gh-meta",children:[Lo(E.size),E.modified?` · ${Dc(E.modified)}`:""]}),i.jsx(Z1,{size:13,className:"file-dl"})]},E.name)}),(d==null?void 0:d.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."}),y.length>0&&i.jsx("ul",{className:"files-notes",children:y.map((E,G)=>i.jsx("li",{className:"mono",children:E},G))}),g&&i.jsx("div",{className:"hint danger",children:g})]})}const uw=/(embed|rerank|retriev|guard|safety|detector|deplot|calibration|reward|whisper|\bstt\b|\btts\b|parse|ocr|opir)/i;function Lc(l){return l.output_modalities.includes("text")?!uw.test(`${l.id} ${l.name}`):!1}function dw(l,o){const c=o.trim().toLowerCase();return!c||`${l.name} ${l.id}`.toLowerCase().includes(c)}const Zv=[{id:"A01:2025",name:"Broken Access Control",stride:"E",look:"object or function reachable by changing an id, role or URL; missing checks server-side; CORS, path traversal, IDOR, forced browsing, JWT or cookie tampering",fix:"deny by default, enforce ownership and role on the server for every object and function, log failures, rate-limit automation"},{id:"A02:2025",name:"Security Misconfiguration",stride:"I",look:"defaults left on, debug or admin interfaces exposed, verbose errors, permissive cloud storage, missing hardening headers, unneeded features and ports",fix:"hardened repeatable builds, minimal platform, configuration review per environment, automated drift checks"},{id:"A03:2025",name:"Software Supply Chain Failures",stride:"T",look:"unpinned or unverified dependencies, build and CI steps that can be tampered with, packages from untrusted registries, no SBOM, unsigned artifacts",fix:"pin and verify dependencies, signed builds with provenance, SBOM, dependency and container scanning, least privilege for CI tokens"},{id:"A04:2025",name:"Cryptographic Failures",stride:"I",look:"plaintext or weak transport, secrets or PII stored unencrypted, weak algorithms or key sizes, home-made crypto, keys in code, poor randomness",fix:"TLS everywhere, modern algorithms (AES-256-GCM, SHA-256+, Argon2 or bcrypt for passwords), key management, encrypt data at rest, no custom crypto"},{id:"A05:2025",name:"Injection",stride:"T",look:"user input reaching SQL, NoSQL, OS commands, LDAP, templates, XPath or HTML without separation; string-built queries; reflected or stored script",fix:"parameterised queries and safe APIs, allow-list validation, contextual output encoding, CSP, no shell from input"},{id:"A06:2025",name:"Insecure Design",stride:"STRIDE",look:"missing threat model, business-logic abuse (replay, race, quota bypass), trust placed in the client, recovery flows that leak or bypass, no abuse cases",fix:"threat modelling in design, secure design patterns and reference architectures, abuse-case tests, limits on business flows"},{id:"A07:2025",name:"Authentication Failures",stride:"S",look:"credential stuffing and brute force possible, weak or default passwords, no MFA on sensitive actions, session ids in URLs, sessions not rotated or expired, weak recovery",fix:"MFA, breached-password checks, rate limits and lockout, server-side session management with rotation and expiry, secure recovery"},{id:"A08:2025",name:"Software or Data Integrity Failures",stride:"T",look:"unsigned updates and plugins, insecure deserialisation, CI pipelines or auto-update channels that trust unverified input, integrity of data in transit between services unchecked",fix:"signatures and verification for code, updates and serialised data; integrity checks in pipelines; no deserialisation of untrusted input"},{id:"A09:2025",name:"Security Logging and Alerting Failures",stride:"R",look:"logins, access failures and high-value actions not logged, logs without context or integrity, no alerting, no response plan, logs that leak secrets",fix:"log auth and authorisation events with user and time, protect log integrity, alert on patterns, test the response playbook"},{id:"A10:2025",name:"Mishandling of Exceptional Conditions",stride:"D",look:"errors that fail open, unhandled exceptions, resource exhaustion, retries without limits, partial failures that leave state inconsistent, error messages with internals",fix:"fail closed, handle every error path, timeouts and limits, idempotent operations, generic errors to users with detail in logs"}],Pv=[{id:"API1:2023",name:"Broken Object Level Authorization",stride:"E",look:"endpoints that take an object id and never check the caller owns it",fix:"authorise every object access against the session's identity; random ids are not a control"},{id:"API2:2023",name:"Broken Authentication",stride:"S",look:"weak tokens, no expiry or rotation, credentials in URLs, unauthenticated sensitive endpoints, auth that differs between API versions",fix:"standard, tested auth on every endpoint; short-lived tokens; MFA for sensitive flows"},{id:"API3:2023",name:"Broken Object Property Level Authorization",stride:"I",look:"responses that return more fields than the client needs; mass assignment of fields the user may not set",fix:"explicit response schemas and allow-lists for writable properties"},{id:"API4:2023",name:"Unrestricted Resource Consumption",stride:"D",look:"no limits on request rate, payload size, pagination, uploads or paid third-party calls",fix:"rate limits, quotas, size and pagination caps, spend limits on paid services"},{id:"API5:2023",name:"Broken Function Level Authorization",stride:"E",look:"admin or privileged functions reachable by guessing the route or changing the method",fix:"deny by default, role checks on every function, one authorisation module"},{id:"API6:2023",name:"Unrestricted Access to Sensitive Business Flows",stride:"D",look:"flows like purchase, signup, voting or booking callable at scale by scripts",fix:"detect and slow automation: device fingerprinting, step-up, human checks, business limits"},{id:"API7:2023",name:"Server Side Request Forgery",stride:"I",look:"the API fetches a URL the client supplies: webhooks, imports, previews, image fetchers",fix:"allow-list destinations, block internal ranges and metadata endpoints, no redirects, isolated fetcher"},{id:"API8:2023",name:"Security Misconfiguration",stride:"I",look:"missing TLS, permissive CORS, verbose errors, unneeded HTTP methods, unpatched components",fix:"hardening baseline, automated configuration checks, patching"},{id:"API9:2023",name:"Improper Inventory Management",stride:"I",look:"old API versions, debug or staging endpoints still live, undocumented hosts and data flows",fix:"inventory of hosts, versions and data flows; retire old versions; document data sharing"},{id:"API10:2023",name:"Unsafe Consumption of APIs",stride:"T",look:"data from third-party APIs trusted without validation, followed redirects, unencrypted upstream calls",fix:"validate and limit upstream responses, TLS to upstreams, timeouts, no blind redirects"}],Fv=[{id:"LLM01:2025",name:"Prompt Injection",stride:"T",look:"user or retrieved content changes the model's instructions; indirect injection through documents, web pages, tool results, emails",fix:"treat all model input as untrusted, separate instructions from data, constrain output format, least privilege for what the model can trigger, human approval for consequential actions"},{id:"LLM02:2025",name:"Sensitive Information Disclosure",stride:"I",look:"secrets, PII or system details in training data, context or outputs; model repeats what one user told it to another",fix:"scrub data, scope context per user, output filtering, no secrets in prompts"},{id:"LLM03:2025",name:"Supply Chain",stride:"T",look:"third-party models, adapters, datasets, plugins or packages with no provenance; pickled or unsigned model files",fix:"verified sources, signed artifacts, AI bill of materials, scan model files, pin versions"},{id:"LLM04:2025",name:"Data and Model Poisoning",stride:"T",look:"training, fine-tuning or embedding data that an outsider can influence; backdoor triggers",fix:"dataset provenance and validation, anomaly checks, hold-out evaluation, sandbox fine-tuning"},{id:"LLM05:2025",name:"Improper Output Handling",stride:"T",look:"model output rendered as HTML, executed as code or SQL, or passed to a shell or another API without validation",fix:"treat output as untrusted input: encode, validate, parameterise, sandbox execution"},{id:"LLM06:2025",name:"Excessive Agency",stride:"E",look:"tools and permissions beyond the task, autonomous actions with no approval, one credential for every tool",fix:"minimal tools and scopes, per-action authorisation, human in the loop for consequential actions, kill switch"},{id:"LLM07:2025",name:"System Prompt Leakage",stride:"I",look:"system prompt holds secrets, roles or rules the security depends on; it can be extracted by asking",fix:"no secrets or security decisions in prompts; enforce rules outside the model"},{id:"LLM08:2025",name:"Vector and Embedding Weaknesses",stride:"I",look:"shared vector store across tenants, poisoned or stale documents, embedding inversion, retrieval of restricted documents",fix:"per-tenant and per-user access control on retrieval, validate sources, monitor retrieved content"},{id:"LLM09:2025",name:"Misinformation",stride:"R",look:"hallucinated facts, packages or citations acted on without checking; over-reliance in decisions",fix:"grounding with retrieval, verification steps, human review for decisions, communicate uncertainty"},{id:"LLM10:2025",name:"Unbounded Consumption",stride:"D",look:"no limits on tokens, requests, recursion or cost; model extraction through many queries",fix:"rate and spend limits, input size caps, timeouts, query monitoring, watermark or limit API detail"}],Jv=[{id:"ASI01:2026",name:"Agent Goal Hijack",stride:"T",look:"content the agent reads (pages, files, tool results, other agents) redirects what it is trying to do",fix:"isolate instructions from data, verify intent before acting, constrain plans to the task"},{id:"ASI02:2026",name:"Tool Misuse and Exploitation",stride:"E",look:"permitted tools used in loops, unsafe chains or at runaway volume; tool parameters from untrusted text",fix:"least-agency tool scoping, parameter validation, budgets and loop limits, approval for risky tools"},{id:"ASI03:2026",name:"Identity and Privilege Abuse",stride:"S",look:"agent acts with a human's or a service's broad credential; delegation with no bound identity or scope",fix:"per-agent identity, short-lived scoped tokens, delegation that carries the principal and the task"},{id:"ASI04:2026",name:"Agentic Supply Chain Vulnerabilities",stride:"T",look:"imported tools, MCP servers, schemas, prompts or other agents trusted without verification",fix:"verify and pin tool and agent sources, review tool definitions, sandbox third-party tools"},{id:"ASI05:2026",name:"Unexpected Code Execution",stride:"E",look:"generated code or commands run without validation or isolation; interpreters reachable from prompts",fix:"sandboxed execution, allow-listed commands, review before run, no shell from model text"},{id:"ASI06:2026",name:"Memory and Context Poisoning",stride:"T",look:"injected or leaked memory, notes or thread context keeps steering later runs",fix:"validate what is written to memory, scope memory per user and task, expiry, review of persistent context"},{id:"ASI07:2026",name:"Insecure Inter-Agent Communication",stride:"S",look:"messages between agents can be read, forged or altered; no authentication between agents",fix:"authenticated, integrity-protected channels; schemas; treat other agents' output as untrusted"},{id:"ASI08:2026",name:"Cascading Failures",stride:"D",look:"one bad output or outage propagates through chained tools and agents; no circuit breakers",fix:"isolation boundaries, timeouts, circuit breakers, idempotent actions, rollback"},{id:"ASI09:2026",name:"Human-Agent Trust Exploitation",stride:"R",look:"confident agent output accepted without verification; approvals rubber-stamped; UI that hides what the agent did",fix:"show evidence and provenance, require review for consequential actions, measure override rates"},{id:"ASI10:2026",name:"Rogue Agents",stride:"E",look:"agents acting outside their intended behaviour or scope, surviving beyond their task, no way to stop them",fix:"kill switch, task-bound lifetimes, monitoring of actions against policy, audit trail"}],fw=[{id:"M1:2024",name:"Improper Credential Usage",look:"hardcoded keys, credentials stored or transmitted insecurely",fix:"no secrets in the app, platform keystores, short-lived tokens"},{id:"M2:2024",name:"Inadequate Supply Chain Security",look:"unverified SDKs and libraries, compromised build",fix:"vetted dependencies, signed builds, integrity checks"},{id:"M3:2024",name:"Insecure Authentication/Authorization",look:"client-side auth decisions, weak session handling, missing server checks",fix:"server-side authorisation, MFA, secure session tokens"},{id:"M4:2024",name:"Insufficient Input/Output Validation",look:"injection via deep links, intents, WebViews, file inputs",fix:"validate and encode at every boundary, restrict WebView bridges"},{id:"M5:2024",name:"Insecure Communication",look:"plaintext or weakly validated TLS, no pinning where warranted",fix:"TLS with validation, pinning for high-value apps"},{id:"M6:2024",name:"Inadequate Privacy Controls",look:"over-collection, PII in logs, leakage to third parties",fix:"data minimisation, consent, scrub logs"},{id:"M7:2024",name:"Insufficient Binary Protections",look:"easy reverse engineering and tampering of the binary",fix:"obfuscation and integrity checks where the threat model needs them; keep secrets off the device"},{id:"M8:2024",name:"Security Misconfiguration",look:"debug flags, exported components, permissive permissions",fix:"hardened release config, minimal permissions"},{id:"M9:2024",name:"Insecure Data Storage",look:"sensitive data in plain files, caches, backups, clipboard",fix:"platform secure storage, encryption, exclude from backups"},{id:"M10:2024",name:"Insufficient Cryptography",look:"weak algorithms, poor key handling, custom crypto",fix:"platform crypto APIs, modern algorithms, key management"}],hw=[{id:"V1",name:"Encoding and Sanitization",covers:"injection prevention, output encoding, sanitisation of HTML, SQL, OS, templates"},{id:"V2",name:"Validation and Business Logic",covers:"input validation, business-logic limits, anti-automation, sequence and timing"},{id:"V3",name:"Web Frontend Security",covers:"browser security headers, CSP, cookies, CORS, clickjacking"},{id:"V4",name:"API and Web Service",covers:"REST, GraphQL, WebSocket, schema validation, HTTP method handling"},{id:"V5",name:"File Handling",covers:"uploads, downloads, path traversal, file type and size limits, storage"},{id:"V6",name:"Authentication",covers:"passwords, MFA, credential recovery, lookup secrets, out-of-band, rate limits"},{id:"V7",name:"Session Management",covers:"session ids, binding, timeout, logout, re-authentication, cookie attributes"},{id:"V8",name:"Authorization",covers:"object, function and field-level authorisation, ownership, admin interfaces"},{id:"V9",name:"Self-contained Tokens",covers:"JWT and similar: signature, algorithm, audience, expiry, revocation"},{id:"V10",name:"OAuth and OIDC",covers:"flows, PKCE, redirect validation, token handling, client registration"},{id:"V11",name:"Cryptography",covers:"algorithms, key management, randomness, password hashing, crypto agility"},{id:"V12",name:"Secure Communication",covers:"TLS configuration, certificate validation, internal service encryption"},{id:"V13",name:"Configuration",covers:"secrets management, dependencies, unneeded features, secure defaults, build integrity"},{id:"V14",name:"Data Protection",covers:"classification, encryption at rest, minimisation, caching, data in logs and backups"},{id:"V15",name:"Secure Coding and Architecture",covers:"threat modelling, trust boundaries, defensive coding, memory safety, concurrency"},{id:"V16",name:"Security Logging and Error Handling",covers:"what to log, log protection, error handling that fails closed"},{id:"V17",name:"WebRTC",covers:"media and signalling security, TURN, DoS resistance"}],mw=[{id:"4.1",code:"WSTG-INFO",name:"Information Gathering",tests:"search engine and metadata leakage, fingerprint server and framework, enumerate applications and entry points, map architecture and execution paths"},{id:"4.2",code:"WSTG-CONF",name:"Configuration and Deployment Management",tests:"platform and framework configuration, file extensions and backups, admin interfaces, HTTP methods, HSTS, cloud storage, subdomain takeover, path confusion"},{id:"4.3",code:"WSTG-IDNT",name:"Identity Management",tests:"role definitions, registration and provisioning, account enumeration, username policy"},{id:"4.4",code:"WSTG-ATHN",name:"Authentication",tests:"credentials over encrypted channel, default credentials, lockout, bypass, remember-me, cache, password policy and reset, MFA"},{id:"4.5",code:"WSTG-ATHZ",name:"Authorization",tests:"directory traversal and file include, authorisation bypass, privilege escalation, IDOR, OAuth"},{id:"4.6",code:"WSTG-SESS",name:"Session Management",tests:"session schema, cookie attributes, fixation, exposed variables, CSRF, logout, timeout, puzzling, hijacking, JWT"},{id:"4.7",code:"WSTG-INPV",name:"Injection",tests:"reflected and stored XSS, HTTP verb and parameter tampering, SQL, LDAP, XML, SSI, XPath, IMAP/SMTP, code, command, format string, buffer, HTTP splitting, request smuggling, SSRF, mass assignment"},{id:"4.8",code:"WSTG-ERRH",name:"Error Handling",tests:"improper error handling, stack traces"},{id:"4.9",code:"WSTG-CRYP",name:"Weak Cryptography",tests:"TLS, padding oracle, sensitive data over unencrypted channels, weak encryption"},{id:"4.10",code:"WSTG-BUSL",name:"Business Logic",tests:"data validation, request forgery, integrity checks, process timing, function limits, workflow circumvention, defences against misuse, unexpected file types, malicious file upload, payment functionality"},{id:"4.11",code:"WSTG-CLNT",name:"Client-side",tests:"DOM XSS, JavaScript execution, HTML and CSS injection, client-side redirect, resource manipulation, CORS, cross-site flashing, clickjacking, WebSockets, web messaging, browser storage, script inclusion, reverse tabnabbing"},{id:"4.12",code:"WSTG-APIT",name:"API Testing",tests:"GraphQL (introspection, batching, injection), API reconnaissance, broken object-level authorisation"}],qf=[{id:"AML.TA0002",name:"Reconnaissance",techniques:["AML.T0000 Search Open Technical Databases","AML.T0001 Search Open AI Vulnerability Analysis","AML.T0003 Search Victim-Owned Websites","AML.T0004 Search Application Repositories","AML.T0006 Active Scanning","AML.T0064 Gather RAG-Indexed Targets","AML.T0087 Gather Victim Identity Information","AML.T0095 Search Open Websites/Domains"]},{id:"AML.TA0003",name:"Resource Development",techniques:["AML.T0002 Acquire Public AI Artifacts","AML.T0008 Acquire Infrastructure","AML.T0016 Obtain Capabilities","AML.T0017 Develop Capabilities","AML.T0019 Publish Poisoned Datasets","AML.T0020 Poison Training Data","AML.T0021 Establish Accounts","AML.T0058 Publish Poisoned Models","AML.T0060 Publish Hallucinated Entities","AML.T0065 LLM Prompt Crafting","AML.T0066 Retrieval Content Crafting","AML.T0079 Stage Capabilities","AML.T0104 Publish Poisoned AI Agent Tool"]},{id:"AML.TA0004",name:"Initial Access",techniques:["AML.T0010 AI Supply Chain Compromise (hardware, AI software, data, model, container registry, AI agent tool)","AML.T0012 Valid Accounts","AML.T0015 Evade AI Model","AML.T0049 Exploit Public-Facing Application","AML.T0052 Phishing (LLM-written spearphishing, deepfake-assisted)","AML.T0078 Drive-by Compromise","AML.T0093 Prompt Infiltration via Public-Facing Application"]},{id:"AML.TA0000",name:"AI Model Access",techniques:["AML.T0040 AI Model Inference API Access","AML.T0041 Physical Environment Access","AML.T0044 Full AI Model Access","AML.T0047 AI-Enabled Product or Service"]},{id:"AML.TA0005",name:"Execution",techniques:["AML.T0011 User Execution (unsafe AI artifacts, malicious package, poisoned AI agent tool, malicious link)","AML.T0050 Command and Scripting Interpreter","AML.T0051 LLM Prompt Injection (AML.T0051.000 direct, AML.T0051.001 indirect, AML.T0051.002 triggered)","AML.T0053 AI Agent Tool Invocation","AML.T0100 AI Agent Clickbait","AML.T0103 Deploy AI Agent"]},{id:"AML.TA0006",name:"Persistence",techniques:["AML.T0018 Manipulate AI Model (poison, modify architecture, embed malware)","AML.T0020 Poison Training Data","AML.T0061 LLM Prompt Self-Replication","AML.T0070 RAG Poisoning","AML.T0080 AI Agent Context Poisoning (memory, thread)","AML.T0081 Modify AI Agent Configuration","AML.T0093 Prompt Infiltration via Public-Facing Application","AML.T0099 AI Agent Tool Data Poisoning","AML.T0110 AI Agent Tool Poisoning"]},{id:"AML.TA0012",name:"Privilege Escalation",techniques:["AML.T0012 Valid Accounts","AML.T0053 AI Agent Tool Invocation","AML.T0054 LLM Jailbreak","AML.T0105 Escape to Host"]},{id:"AML.TA0007",name:"Defense Evasion",techniques:["AML.T0015 Evade AI Model","AML.T0054 LLM Jailbreak","AML.T0067 LLM Trusted Output Components Manipulation (citations)","AML.T0068 LLM Prompt Obfuscation","AML.T0071 False RAG Entry Injection","AML.T0073 Impersonation","AML.T0074 Masquerading","AML.T0076 Corrupt AI Model","AML.T0081 Modify AI Agent Configuration","AML.T0092 Manipulate User LLM Chat History","AML.T0094 Delay Execution of LLM Instructions","AML.T0097 Virtualization/Sandbox Evasion","AML.T0107 Exploitation for Defense Evasion","AML.T0109 AI Supply Chain Rug Pull","AML.T0111 AI Supply Chain Reputation Inflation"]},{id:"AML.TA0013",name:"Credential Access",techniques:["AML.T0055 Unsecured Credentials","AML.T0082 RAG Credential Harvesting","AML.T0083 Credentials from AI Agent Configuration","AML.T0090 OS Credential Dumping","AML.T0098 AI Agent Tool Credential Harvesting","AML.T0106 Exploitation for Credential Access"]},{id:"AML.TA0008",name:"Discovery",techniques:["AML.T0007 Discover AI Artifacts","AML.T0013 Discover AI Model Ontology","AML.T0014 Discover AI Model Family","AML.T0062 Discover LLM Hallucinations","AML.T0063 Discover AI Model Outputs","AML.T0069 Discover LLM System Information (special character sets, system instruction keywords, system prompt)","AML.T0075 Cloud Service Discovery","AML.T0084 Discover AI Agent Configuration (embedded knowledge, tool definitions, activation triggers, call chains)","AML.T0089 Process Discovery"]},{id:"AML.TA0015",name:"Lateral Movement",techniques:["AML.T0052 Phishing (from a compromised assistant)","AML.T0091 Use Alternate Authentication Material (application access token)"]},{id:"AML.TA0009",name:"Collection",techniques:["AML.T0035 AI Artifact Collection","AML.T0036 Data from Information Repositories","AML.T0037 Data from Local System","AML.T0085 Data from AI Services (RAG databases, AI agent tools)"]},{id:"AML.TA0001",name:"AI Attack Staging",techniques:["AML.T0005 Create Proxy AI Model","AML.T0018 Manipulate AI Model","AML.T0042 Verify Attack","AML.T0043 Craft Adversarial Data (white-box, black-box, transfer, manual, backdoor trigger)","AML.T0088 Generate Deepfakes","AML.T0102 Generate Malicious Commands"]},{id:"AML.TA0014",name:"Command and Control",techniques:["AML.T0072 Reverse Shell","AML.T0096 AI Service API","AML.T0108 AI Agent"]},{id:"AML.TA0010",name:"Exfiltration",techniques:["AML.T0024 Exfiltration via AI Inference API (membership inference, model inversion, model extraction)","AML.T0025 Exfiltration via Cyber Means","AML.T0056 Extract LLM System Prompt","AML.T0057 LLM Data Leakage","AML.T0077 LLM Response Rendering (markdown images, links that carry data)","AML.T0086 Exfiltration via AI Agent Tool Invocation"]},{id:"AML.TA0011",name:"Impact",techniques:["AML.T0015 Evade AI Model","AML.T0029 Denial of AI Service","AML.T0031 Erode AI Model Integrity","AML.T0034 Cost Harvesting (excessive queries, resource-intensive queries, agentic resource consumption)","AML.T0046 Spamming AI System with Chaff Data","AML.T0048 External Harms (financial, reputational, societal, user, AI IP theft)","AML.T0059 Erode Dataset Integrity","AML.T0101 Data Destruction via AI Agent Tool Invocation","AML.T0112 Machine Compromise (local AI agent, AI artifacts)"]}],pw=[{id:"AML.M0000",name:"Limit Public Release of Information"},{id:"AML.M0001",name:"Limit Model Artifact Release"},{id:"AML.M0002",name:"Passive AI Output Obfuscation"},{id:"AML.M0003",name:"Model Hardening"},{id:"AML.M0004",name:"Restrict Number of AI Model Queries"},{id:"AML.M0005",name:"Control Access to AI Models and Data at Rest"},{id:"AML.M0006",name:"Use Ensemble Methods"},{id:"AML.M0007",name:"Sanitize Training Data"},{id:"AML.M0008",name:"Validate AI Model"},{id:"AML.M0009",name:"Use Multi-Modal Sensors"},{id:"AML.M0010",name:"Input Restoration"},{id:"AML.M0011",name:"Restrict Library Loading"},{id:"AML.M0012",name:"Encrypt Sensitive Information"},{id:"AML.M0013",name:"Code Signing"},{id:"AML.M0014",name:"Verify AI Artifacts"},{id:"AML.M0015",name:"Adversarial Input Detection"},{id:"AML.M0016",name:"Vulnerability Scanning"},{id:"AML.M0017",name:"AI Model Distribution Methods"},{id:"AML.M0018",name:"User Training"},{id:"AML.M0019",name:"Control Access to AI Models and Data in Production"},{id:"AML.M0020",name:"Generative AI Guardrails"},{id:"AML.M0021",name:"Generative AI Guidelines"},{id:"AML.M0022",name:"Generative AI Model Alignment"},{id:"AML.M0023",name:"AI Bill of Materials"},{id:"AML.M0024",name:"AI Telemetry Logging"},{id:"AML.M0025",name:"Maintain AI Dataset Provenance"},{id:"AML.M0026",name:"Privileged AI Agent Permissions Configuration"},{id:"AML.M0027",name:"Single-User AI Agent Permissions Configuration"},{id:"AML.M0028",name:"AI Agent Tools Permissions Configuration"},{id:"AML.M0029",name:"Human In-the-Loop for AI Agent Actions"},{id:"AML.M0030",name:"Restrict AI Agent Tool Invocation on Untrusted Data"},{id:"AML.M0031",name:"Memory Hardening"},{id:"AML.M0032",name:"Segmentation of AI Agent Components"},{id:"AML.M0033",name:"Input and Output Validation for AI Agent Components"},{id:"AML.M0034",name:"Deepfake Detection"}],gw=[{letter:"S",name:"Spoofing",violates:"authentication",asks:"can someone pretend to be this user, service or device?"},{letter:"T",name:"Tampering",violates:"integrity",asks:"can data, code, config or a message be changed without detection?"},{letter:"R",name:"Repudiation",violates:"non-repudiation",asks:"can an action be denied later because nothing trustworthy recorded it?"},{letter:"I",name:"Information disclosure",violates:"confidentiality",asks:"can data be read by someone who should not?"},{letter:"D",name:"Denial of service",violates:"availability",asks:"can it be exhausted, crashed or locked?"},{letter:"E",name:"Elevation of privilege",violates:"authorisation",asks:"can a lower-privileged party do a higher-privileged thing?"}],yw={actor:"SR",external:"SRD",service:"STRIDE",ai:"STRIDE",datastore:"TRID",flow:"TID"},Io=(l,o,c=!0)=>`${l}
|
|
54
|
-
`+o.map(u=>`- ${u.id} ${u.name}: look for ${u.look}.${c?` Fix: ${u.fix}.`:""}`).join(`
|
|
55
|
-
`),Xl=(l=!0)=>Io("OWASP Top 10:2025 (web applications):",Zv,l),pi=(l=!0)=>Io("OWASP API Security Top 10:2023:",Pv,l),sl=(l=!0)=>Io("OWASP Top 10 for LLM Applications 2025:",Fv,l),gi=(l=!0)=>Io("OWASP Top 10 for Agentic Applications 2026:",Jv,l),Wv=(l=!0)=>Io("OWASP Mobile Top 10 2024:",fw,l),jo=()=>`OWASP ASVS 5.0 chapters (the requirements a control is verified against):
|
|
56
|
-
`+hw.map(l=>`- ${l.id} ${l.name}: ${l.covers}`).join(`
|
|
57
|
-
`),vw=()=>`OWASP WSTG 4.2 test categories (the order a web test runs in):
|
|
58
|
-
`+mw.map(l=>`- ${l.id} ${l.code} ${l.name}: ${l.tests}`).join(`
|
|
59
|
-
`),vs=()=>`MITRE ATLAS tactics and techniques (attacks on AI systems, ids AML.Txxxx; cite them for AI components):
|
|
60
|
-
`+qf.map(l=>`- ${l.id} ${l.name}: ${l.techniques.join("; ")}`).join(`
|
|
61
|
-
`),Ec=()=>`MITRE ATLAS mitigations (cite the id in a fix for an AI component):
|
|
62
|
-
`+pw.map(l=>`${l.id} ${l.name}`).join("; "),hh=()=>`STRIDE, per element:
|
|
63
|
-
`+gw.map(l=>`- ${l.letter} ${l.name} (violates ${l.violates}): ${l.asks}`).join(`
|
|
64
|
-
`)+`
|
|
65
|
-
Applicable categories by element: `+Object.entries(yw).map(([l,o])=>`${l} ${o}`).join(", ")+".",e0=`Severity (rate by what an attacker gets, not by how clever the bug is):
|
|
66
|
-
- critical: unauthenticated, or any user, reaches other users' or regulated data, runs code, or takes over accounts or infrastructure; no mitigating control in the way.
|
|
67
|
-
- high: the same with one precondition (a low-privilege account, user interaction, an internal position), or a sensitive-data exposure at scale.
|
|
68
|
-
- medium: limited data or limited users, needs chaining or an unlikely precondition, or a missing defence-in-depth control that the threat model relies on.
|
|
69
|
-
- low: hygiene, information with no direct path to harm, or an issue needing an already-compromised position.
|
|
70
|
-
Business-critical data (regulated, financial, safety) raises a rating one step; a tested compensating control lowers it one step. Say which applied.`,bw=`Working rules:
|
|
71
|
-
- Only assess systems the user owns or is authorised to test (engagements, labs, CTFs). Decline to help attack anything else, and say so briefly.
|
|
72
|
-
- Separate evidence from inference. Only report what the material shows; say what you assumed and what you could not check. Never invent components, findings or citations.
|
|
73
|
-
- Cite the reference for every finding: the OWASP id (A01:2025, API1:2023, LLM01:2025, ASI01:2026, M1:2024), the CWE, and for AI components the ATLAS technique (AML.Txxxx) and mitigation (AML.Mxxxx); ATT&CK ids (Txxxx) for adversary behaviour outside the AI system.
|
|
74
|
-
- Every finding carries a concrete fix a developer can act on, and the ASVS chapter it is verified against.
|
|
75
|
-
- Rate severity with the rubric below and show the reasoning in one line.
|
|
76
|
-
- Finish with a coverage line: which categories you considered and found nothing for, so silence is not mistaken for safety.`,xw=()=>[Xl(),pi(),sl(),gi(),Wv(!1),jo(),vs(),Ec()].join(`
|
|
77
|
-
|
|
78
|
-
`),Sw=()=>[`OWASP Top 10:2025: ${Zv.map(l=>`${l.id} ${l.name}`).join("; ")}.`,`OWASP API Top 10:2023: ${Pv.map(l=>`${l.id} ${l.name}`).join("; ")}.`,`OWASP LLM Top 10 2025: ${Fv.map(l=>`${l.id} ${l.name}`).join("; ")}.`,`OWASP Agentic Top 10 2026: ${Jv.map(l=>`${l.id} ${l.name}`).join("; ")}.`,`ATLAS tactics: ${qf.map(l=>`${l.id} ${l.name}`).join("; ")}.`,`ATLAS techniques to cite on AI components: ${qf.flatMap(l=>l.techniques).filter((l,o,c)=>c.indexOf(l)===o).map(l=>l.replace(/ \(.*\)$/,"")).join("; ")}.`].join(`
|
|
79
|
-
`),ww=[{id:"web",name:"Web",first:["read the page source, robots.txt, sitemap.xml, .git/, .env, backup names (index.php~, .bak, .old), and every JS bundle for routes and secrets","map every parameter (query, body, cookie, header) and what each changes; note the stack from headers and error pages","try the obvious on each input: a quote, {{7*7}}, ../, a URL you control, an id one off yours, a different HTTP method"],families:["injection: SQL (error, union, blind, time), NoSQL ($ne, $regex), command, SSTI ({{7*7}}, ${7*7}, Jinja2 and Twig gadget chains), XXE, LDAP","access: IDOR, forced browsing, JWT (alg none, key confusion, weak secret, kid injection), session fixation, mass assignment","files: LFI with wrappers (php://filter, data://, zip://), log poisoning, upload bypass (double extension, content-type, polyglot, .htaccess)","client: XSS (reflected, stored, DOM, in attributes and JS strings), CSRF, prototype pollution, postMessage, open redirect","server: SSRF to 127.0.0.1, 169.254.169.254 and internal names, deserialisation (PHP, Java, Python pickle, .NET), race conditions, HTTP smuggling, cache poisoning","logic: coupon and quantity tricks, negative numbers, unicode normalisation, type juggling (== in PHP, 0e hashes), length limits that truncate"],tools:["curl -i -s (see the raw response), ffuf -w wordlist -u URL/FUZZ (directories, parameters, vhosts), katana (crawl), httpx (fingerprint)","sqlmap -u URL --batch (once a manual probe shows injection), jwt_tool or a python one-liner for JWT, Burp or mitmproxy for a repeater","python requests scripts for anything repetitive; a race needs threads or h2 single-packet"],stuck:["what does the challenge name or theme hint at?","which parameter have you not fuzzed?","does an error page or a stack trace name the framework and version?","is the flag perhaps in a file you can read rather than a shell you must get?"],refs:"A01, A05, A07, A08 of OWASP Top 10:2025; API1, API3, API7; WSTG-INPV, WSTG-ATHZ, WSTG-SESS"},{id:"api",name:"API",first:["find the spec: /swagger, /openapi.json, /graphql with introspection, /.well-known","list every endpoint with its auth; try each without a token and with another user's id","look at versions (/v1 vs /v2) and verbs the UI never uses"],families:["BOLA and BFLA, mass assignment, excessive data in responses, GraphQL introspection, batching and aliases for brute force, nested query DoS, JWT and API-key handling, rate-limit absence on sensitive flows, SSRF through webhooks and imports"],tools:["curl and a python script per endpoint, ffuf for parameters and ids, graphql-voyager or inql for schema, jwt_tool"],stuck:["which object ids are predictable?","what does the mobile or admin client call that the web client does not?","can a write endpoint set a field you were never shown?"],refs:"OWASP API Security Top 10:2023; WSTG-APIT"},{id:"crypto",name:"Cryptography",first:["identify the scheme before touching maths: key sizes, moduli, block size, IV reuse, encoding (base64, hex), any reuse across messages","check the classics against the numbers: small e, small d, common modulus, shared primes across keys, p close to q, known plaintext","if it is a custom scheme, find the invariant that leaks (a linear step, a predictable nonce, a padding check that returns a different error)"],families:["RSA: small e with no padding (cube root), Wiener (small d), common modulus, Fermat (p near q), Hastad broadcast, partial key exposure (Coppersmith), textbook signatures","symmetric: ECB cut-and-paste and byte-at-a-time, CBC bit-flipping and padding oracle, CTR nonce reuse (XOR of plaintexts), key reuse","hashes: length extension (MD5, SHA-1, SHA-256), weak or unsalted hashes, collisions, HMAC misuse (hash(key||msg))","classical: Caesar, Vigenere (Kasiski, index of coincidence), substitution (frequency), XOR with a repeating key, bacon, railfence","number theory: discrete log with weak groups, ECC with a singular or small-order curve, invalid-curve points, LCG and Mersenne Twister state recovery, nonce reuse in ECDSA"],tools:["python with pycryptodome and gmpy2, SageMath for lattices and curves, RsaCtfTool for the RSA classics, hashpump or hash_extender for length extension, CyberChef for encodings, z3 for constraint puzzles, factordb.com for a quick factor lookup"],stuck:["what is the same across the samples you have?","what happens to the ciphertext when you change one bit of the input?","is the randomness really random (timestamp seed, reused nonce)?","is the padding check or the error message an oracle?"],refs:"A04:2025 Cryptographic Failures; ASVS V11"},{id:"forensics",name:"Forensics and steganography",first:["file, strings -n 8, exiftool, binwalk -e, xxd | head: what is it really, and what is appended, prepended or embedded","for images: pngcheck, zsteg (PNG/BMP), steghide and stegseek (JPEG with a passphrase), check LSB planes and the alpha channel, compare dimensions in the header with the data","for captures: tshark -r file.pcap -q -z conv,tcp, follow streams, export objects (HTTP, SMB, DNS tunnels), look at unusual protocols","for disk and memory images: Volatility 3 (windows.pslist, cmdline, filescan, hashdump), Autopsy or sleuthkit, carve with foremost or photorec"],families:["appended archives and polyglots, LSB steganography, audio spectrograms, metadata and thumbnails, deleted files and slack space, base64 in DNS or ICMP, keystrokes in USB captures, Office and PDF embedded objects, git history leaks"],tools:["file, strings, exiftool, binwalk, foremost, xxd, zsteg, steghide, stegseek, pngcheck, tshark and Wireshark, Volatility 3, sleuthkit, Audacity or sox for audio, CyberChef"],stuck:["have you looked at the end of the file and at what comes after the declared length?","is there a second file inside (binwalk -e, 7z l)?","what does the challenge text say about a password or a person?","have you tried every channel: text, metadata, pixels, audio, timing?"],refs:"no OWASP category: evidence handling and data-at-rest protection (ASVS V14)"},{id:"reverse",name:"Reverse engineering",first:["file, strings, checksec; run it in a sandbox and watch (ltrace, strace); find main and the comparison that decides success","open in Ghidra or radare2 (aaa; afl; pdf @main); rename as you go; look for the flag check, the decryption loop, the anti-debug","for scripts and bytecode: pyinstaller extraction and decompile (pycdc), JADX for Android, dnSpy or ILSpy for .NET, de4js or a prettifier for JavaScript"],families:["string comparison with a transform (XOR, add, table), hand-rolled crypto, VM-based obfuscation, anti-debugging (ptrace, timing), packed binaries (UPX), flag built at runtime, checks that can be patched or solved with angr or z3"],tools:["Ghidra, radare2 or rizin with Cutter, gdb with gef or pwndbg, ltrace, strace, angr, z3, upx -d, pycdc, JADX, dnSpy"],stuck:["where is the first thing the input touches?","can you make the check pass by patching rather than understanding?","is the transform invertible, and can a solver do it?","does running it with a debugger attached change behaviour?"],refs:"ASVS V15 Secure Coding and Architecture; Mobile M7 Insufficient Binary Protections"},{id:"pwn",name:"Binary exploitation",first:["checksec (RELRO, canary, NX, PIE), file (static or dynamic, stripped), the libc version if given","find the bug: overflow (gets, strcpy, scanf %s), format string (printf(buf)), use after free, integer overflow, off by one","work out what you control and what you need: a return address, a GOT entry, a function pointer, a leak"],families:["stack overflow to ret2win, ret2libc or ROP (ropper, ROPgadget, one_gadget), format string read and write, heap (tcache poisoning, fastbin dup, unsorted bin leak, house of x), SROP, ret2dlresolve, kernel and sandbox escapes in harder sets"],tools:["pwntools (process, remote, ELF, ROP, cyclic, fmtstr_payload), gdb with gef or pwndbg, ropper, ROPgadget, one_gadget, patchelf and pwninit to match the libc, checksec"],stuck:["what is your exact offset (cyclic)?","what leaks (puts of a GOT entry, a format string %p chain)?","which protection is off, and which does that remove from the problem?","does the challenge give a libc, and does your local one match?"],refs:"CWE-120, CWE-134, CWE-416; ASVS V15"},{id:"osint",name:"OSINT",first:["pin down what is known: a name, a handle, an image, a domain; then widen one hop at a time","reverse image search and EXIF; username search across sites; WHOIS, DNS history, certificate transparency; archive.org for what was removed"],families:["usernames reused across platforms, geolocation from image details, leaked documents and metadata, social graph pivots, company registries, commit history and paste sites"],tools:["sherlock or maigret, exiftool, Google and Bing dorks, crt.sh, dnsdumpster, Wayback Machine, Google Earth and Street View, theHarvester"],stuck:["what is the smallest unusual detail in the image or text?","has the target used this handle elsewhere?","what did the page look like a year ago?"],refs:"no OWASP category: ATT&CK Reconnaissance"},{id:"cloud",name:"Cloud",first:["identify the provider from hostnames, headers and bucket URLs; try the metadata endpoint through any SSRF; list public buckets and their ACLs","with any credential found: whoami (sts get-caller-identity), enumerate what it can read, look for role chains and over-broad policies"],families:["public or listable storage, metadata credentials via SSRF, over-privileged roles and assume-role chains, secrets in user data and environment, exposed serverless endpoints, misconfigured OIDC trust, Kubernetes service-account tokens and dashboards"],tools:["aws, az and gcloud CLIs, pacu, enumerate-iam, s3scanner, kube-hunter and kubectl, ScoutSuite"],stuck:["what does the credential's own policy let it do?","which service trusts which role?","is there a public resource whose name you can guess from the company name?"],refs:"A01:2025, A02:2025; API7:2023 SSRF; ASVS V13"},{id:"ai",name:"AI and LLM",first:["learn the system: what it was told (ask it to summarise its instructions), what tools it has, what it can read (files, URLs, other users' data), what checks its output","classify the challenge: extract a secret from the prompt, make it call a tool, make it read content you control, bypass a guardrail, poison its memory or retrieval"],families:["direct injection and jailbreak framings (role-play, translation, continuation, hypothetical, format tricks): AML.T0051.000 and AML.T0054","indirect injection through a document, web page, image or tool result the model reads: AML.T0051.001, AML.T0070 RAG poisoning","system prompt extraction (ask for it in another language, as code, as a poem, piecewise): AML.T0056 and AML.T0069","exfiltration through rendering (markdown image URLs that carry data), tool invocation or links: AML.T0077 and AML.T0086","obfuscation to pass a filter (encodings, homoglyphs, splitting, payload in a code block): AML.T0068","memory and context poisoning across turns or sessions: AML.T0080; tool poisoning and malicious tool definitions: AML.T0110","guardrail evasion of input and output classifiers; model extraction and membership inference on inference APIs: AML.T0024"],tools:["a notebook of your attempts with exact prompts and responses, promptfoo and garak for systematic probes against your own endpoint, CyberChef for encodings"],stuck:["what does the model see that you do not (system prompt, tool results, retrieved text)?","which channel is unfiltered: input, retrieval, tool output, rendering?","can the model be made to do the step for you (write the code, summarise the secret) instead of revealing it directly?"],refs:"OWASP LLM01, LLM02, LLM05, LLM06, LLM07, LLM08; ASI01, ASI02, ASI06; MITRE ATLAS AML.T0051, AML.T0054, AML.T0056, AML.T0057, AML.T0068, AML.T0070, AML.T0077, AML.T0080, AML.T0086"},{id:"misc",name:"Misc and scripting",first:["read the whole challenge text twice; note the flag format; connect to the service and see what it says before sending anything","if it is a game or a puzzle, write a client and automate; if it is a jail (Python, bash, SQL), list what characters and names are allowed"],families:["Python jails (builtins, attribute walking, format string, unicode), bash jails (globbing, $0, env), esoteric languages, QR and barcode layers, encodings stacked (base64, base32, hex, rot, morse, brainfuck), protocol puzzles over nc"],tools:["pwntools remote for sockets, CyberChef magic, dcode.fr for classical ciphers, zbarimg for QR, a quick python script for anything repetitive"],stuck:["what is the flag format, and what in the output already looks like it?","what does the service do with input it does not expect?","which characters are blocked, and what can be built from the rest?"],refs:"A05:2025 Injection; ASVS V1 and V2"}],Aw=`First look, for any challenge:
|
|
80
|
-
1. Read the challenge text, name and category twice; write down the flag format and every hint.
|
|
81
|
-
2. For a file: file, strings -n 8, exiftool, binwalk, xxd | head and tail; a hash lookup if it looks like a known file; list archives with 7z l. Keep the original untouched; work on a copy.
|
|
82
|
-
3. For a service: connect once and read what it prints; note the protocol and the prompts before sending anything.
|
|
83
|
-
4. For a URL: source, robots.txt, the JS bundles, the headers and the error page; map parameters.
|
|
84
|
-
5. Name the category and the two or three families most likely; write the next three experiments, cheapest first.
|
|
85
|
-
6. Keep a notes file: every attempt, exact input, exact output. When stuck, read it back and ask the stuck questions for the category.`,Tw=l=>`${l.name} (${l.id}):
|
|
86
|
-
- first: ${l.first.join("; ")}
|
|
87
|
-
- families: ${l.families.join(" | ")}
|
|
88
|
-
- tools: ${l.tools.join("; ")}
|
|
89
|
-
- when stuck: ${l.stuck.join(" ")}
|
|
90
|
-
- refs: ${l.refs}`,kw=()=>`${Aw}
|
|
91
|
-
|
|
92
|
-
By category:
|
|
93
|
-
${ww.map(Tw).join(`
|
|
94
|
-
|
|
95
|
-
`)}`,jw=`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:
|
|
96
|
-
|
|
97
|
-
\`\`\`drawio
|
|
98
|
-
title: Order flow # required
|
|
99
|
-
layout: auto # let the app place nodes; omit x/y on nodes
|
|
100
|
-
direction: right # right (default) or down
|
|
101
|
-
nodes: # id, label, kind are required; sub is an optional second line
|
|
102
|
-
- {id: user, label: Shopper, kind: actor}
|
|
103
|
-
- {id: api, label: Orders API, kind: service, sub: "Node 22"}
|
|
104
|
-
- {id: db, label: Postgres, kind: datastore}
|
|
105
|
-
edges: # from, to required; label optional; style optional
|
|
106
|
-
- {from: user, to: api, label: HTTPS}
|
|
107
|
-
- {from: api, to: db, label: SQL, style: data}
|
|
108
|
-
legend: true
|
|
109
|
-
\`\`\`
|
|
110
|
-
|
|
111
|
-
kind (colour means type only, the label carries the meaning): actor, external, service, ai, worker, datastore, queue, ui, gov, security, decision, step, terminal, note.
|
|
112
|
-
edge style: sync (default), async, data, ai, weak. Edge keys: from, to, label, style, both, curved.
|
|
113
|
-
Zones need manual layout (x, y, w, h on zones and x, y on every node), so prefer layout: auto without zones.
|
|
114
|
-
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.
|
|
115
|
-
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.`,Sa=(l,...o)=>[l,bw,e0,...o].join(`
|
|
116
|
-
|
|
117
|
-
`),Gf=[{id:"code-review",label:"Code reviewer",system:Sa("You are a senior application security engineer reviewing code. For each finding give: severity, the vulnerable line(s), why it is exploitable, the OWASP id and CWE, the ASVS chapter, and a corrected snippet. Work through the OWASP Top 10:2025 for every review, the API Top 10 when the code serves an API, the LLM and Agentic lists when it calls a model or runs an agent, and the Mobile list for app code. If the code is safe for a category, say so in the coverage line; do not invent issues.",Xl(),pi(!1),sl(!1),gi(!1),jo()),starters:[`Review this code for security vulnerabilities:
|
|
118
|
-
|
|
119
|
-
`,`Is this SQL query safe from injection?
|
|
120
|
-
|
|
121
|
-
`,`Review this tool-calling agent code against the OWASP Agentic Top 10:
|
|
122
|
-
|
|
123
|
-
`,`What are the security risks in this auth middleware?
|
|
124
|
-
|
|
125
|
-
`]},{id:"threat-model",label:"Threat modeller",system:Sa("You are a threat-modelling specialist. For the system described: (1) list assets, actors, trust boundaries and entry points; (2) decompose into elements (actors, services, AI components, data stores, flows); (3) for each element walk the STRIDE categories that apply to it and the OWASP categories that fit its technology (web, API, LLM, agent, mobile); (4) produce a table: threat, element, STRIDE, OWASP or ATLAS id, likelihood, impact, severity, mitigation with its ASVS chapter or ATLAS mitigation; (5) prioritise the top risks and list the assumptions. Flows that cross a trust boundary without authentication or encryption are always threats. AI components (models, agents, RAG, tools) are assessed with the LLM and Agentic lists and ATLAS as well as STRIDE.",hh(),Xl(!1),pi(!1),sl(!1),gi(!1),Wv(!1),jo(),vs(),Ec()),starters:["Threat-model a password-reset flow that emails a link with a token.","Threat-model a customer-support chatbot with RAG over our ticket history and a tool that issues refunds.","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:"ai-review",label:"AI system reviewer (LLM, agents, RAG)",system:Sa("You review AI-enabled systems: LLM applications, agents with tools, RAG pipelines, model APIs, copilots and the pipelines that train or fine-tune them. Map the system (inputs the model reads, what it can trigger, what it can reach, who can influence its context and its data), then assess it against the OWASP LLM Top 10, the OWASP Agentic Top 10 and MITRE ATLAS: for each applicable technique say whether the system is exposed, the evidence, the severity, and the mitigation with its ATLAS id. Treat every input the model reads as attacker-controlled unless the source is shown to be trusted, and every model output as untrusted input to whatever consumes it. When asked to design tests, propose defensive checks (red-team probes, guardrail evaluations, permission reviews) for the user's own system, with the technique each test covers.",sl(),gi(),vs(),Ec()),starters:[`Review this LLM application design for prompt-injection and data-leak paths:
|
|
126
|
-
|
|
127
|
-
`,`This agent has these tools and permissions. Which ATLAS techniques apply and what should change?
|
|
128
|
-
|
|
129
|
-
`,"Design a red-team test plan (promptfoo/garak probes) for our chatbot, mapped to ATLAS and the LLM Top 10.","Our RAG index is shared by all tenants. What are the risks and the fixes?"]},{id:"pentest-plan",label:"Pentest planner (WSTG)",system:Sa("You plan authorised web and API penetration tests. From the scope given, produce a test plan ordered by the OWASP WSTG categories: for each, the tests that apply to this target, the tool or manual step for each (the BugXHunter agent has httpx, katana, nuclei, ffuf, testssl, subfinder, nmap, gitleaks, cargo audit, govulncheck, and can install promptfoo and garak for LLM targets), the evidence to capture, and the OWASP or ATLAS id the test covers. Scope beats speed: fingerprint first, then target templates to the stack. Include the rules of engagement checks (authorisation, windows, rate limits, data handling) at the top and a reporting template at the end.",vw(),Xl(!1),pi(!1),sl(!1),jo()),starters:["Plan a pentest of https://staging.example.com (a React SPA over a REST API, OAuth login). We are authorised in writing.",`Plan an API-only test for an OpenAPI spec I will paste:
|
|
130
|
-
|
|
131
|
-
`,"Plan a review of a customer chatbot (web widget calling an LLM with RAG) for our own product."]},{id:"diagram",label:"Diagram & screenshot reviewer",system:Sa("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, the OWASP or ATLAS id, and the fix. Look for exposed ports, plaintext protocols, hardcoded secrets, missing auth or MFA, flows crossing a trust boundary without a control, public storage, outdated software, missing logging, and for AI components the paths by which untrusted content reaches a model and what the model can trigger. Only report what is visible and flag any assumptions.",Xl(!1),pi(!1),sl(!1),gi(!1),vs()),starters:["Review the attached diagram for security issues.","What would an attacker target first in this screenshot?","Which flows in this diagram cross a trust boundary without authentication?","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, citing OWASP, CWE, ATT&CK or ATLAS ids where they fit.
|
|
132
|
-
|
|
133
|
-
`+jw,starters:[`Draw the request flow of this code, from the user to every data store:
|
|
134
|
-
|
|
135
|
-
`,`Draw the attack path for these findings, from initial access to impact:
|
|
136
|
-
|
|
137
|
-
`,`Draw this system's components and data flows, marking which links are unencrypted:
|
|
138
|
-
|
|
139
|
-
`,`Draw how untrusted content reaches the model in this AI system and what the model can trigger:
|
|
140
|
-
|
|
141
|
-
`]},{id:"tabletop",label:"Tabletop exercise facilitator",system:Sa("You design and facilitate tabletop exercises (TTX) for security teams, defensively: nothing you produce is an attack tool, it is a rehearsal of detection, decision and recovery. When asked for an exercise, produce: (1) objectives and the capabilities under test; (2) participants and roles (incident lead, SOC, engineering, legal, comms, executive, a facilitator and a note-taker); (3) a scenario grounded in real technique ids: ATT&CK for the intrusion, ATLAS for anything involving the organisation's AI systems, OWASP ids for the weaknesses exploited; (4) a master scenario events list (MSEL): timed injects, each with the information released, the question to the room, the expected action and the decision point; (5) a hot-wash and after-action report template whose gaps map to the control that closes them (ASVS chapter, ATLAS mitigation, or a process change). When facilitating live, release one inject at a time, ask what the team does and why, and never give the answer before the room has tried. Keep scenarios plausible for the organisation described and avoid gratuitous detail of how the attack is performed.",vs(),Ec(),Xl(!1),sl(!1),gi(!1)),starters:["Design a 90-minute tabletop: an attacker uses indirect prompt injection in our support chatbot to exfiltrate customer data. Participants: SOC, platform team, legal, comms.","Design a tabletop for a compromised CI token that pushes a poisoned dependency to production.","Run the next inject. We have isolated the host and are reviewing the agent's tool logs.",`Write the after-action report from these notes:
|
|
142
|
-
|
|
143
|
-
`]},{id:"ctf",label:"CTF and lab coach",system:Sa("You coach people solving capture-the-flag challenges and deliberately vulnerable labs (their own CTF, a public CTF they are registered for, or training labs). First confirm the challenge is a CTF or lab and ask for the category and what has been tried. Then help by method, not by handing over the flag: identify the vulnerability class (map web and API challenges to the OWASP categories, AI and prompt-injection challenges to the LLM Top 10 and ATLAS techniques), explain the technique, propose the next experiment, and escalate hints in steps (nudge, then the idea, then the concrete step) only when asked. For a solved challenge, help write the write-up: the vulnerability, the OWASP or ATLAS id, the steps, the lesson, and the real-world fix. Cover the usual categories: web, API, crypto, forensics, reverse engineering, binary exploitation, OSINT, cloud, and AI/LLM.",kw(),Xl(!1),pi(!1),sl(!1),vs()),starters:["Web CTF: the login form reflects my username on error and the cookie is a base64 JSON. What should I try next?","LLM CTF: the bot refuses to reveal the secret in its system prompt. Which techniques does this challenge expect, and how do they map to ATLAS?",`Write a CTF write-up for this challenge from my notes:
|
|
144
|
-
|
|
145
|
-
`,"Give me a nudge, not the answer: a PHP upload form that checks the extension."]},{id:"phishing",label:"Phishing analyst",system:Sa("You analyse suspicious emails, messages, voice notes and URLs. Give a verdict (phishing / suspicious / likely legitimate) with a confidence level, list the red flags (sender, links, urgency, attachments, headers, signs of LLM-written or deepfake-assisted lures: ATLAS AML.T0052), and the recommended action for the user and for the SOC. Never visit links; reason from the text provided."),starters:[`Is this email phishing?
|
|
146
|
-
|
|
147
|
-
`,`Analyse these email headers for spoofing:
|
|
148
|
-
|
|
149
|
-
`,"Write a 5-point phishing awareness checklist for staff, including AI-generated lures."]},{id:"logs",label:"Log triage (SOC)",system:Sa("You are a SOC analyst triaging logs. Identify suspicious events, group them into likely attack stages with MITRE ATT&CK technique ids where clear, and ATLAS technique ids when the logs come from an AI system (model API gateways, agent tool calls, RAG retrieval, prompt logs), rate severity, and give next investigative steps and containment actions. Separate evidence from inference.",vs()),starters:[`Triage these auth logs for brute force or credential stuffing:
|
|
150
|
-
|
|
151
|
-
`,`Do these web server logs show SQL injection attempts?
|
|
152
|
-
|
|
153
|
-
`,`Triage these agent tool-call logs: did a prompt injection make the agent exfiltrate anything?
|
|
154
|
-
|
|
155
|
-
`,"Write a Sigma rule to detect password spraying against Entra ID."]},{id:"explainer",label:"Vulnerability explainer",system:Sa("You teach application and AI security to developers. Explain the vulnerability class clearly, name its OWASP category and CWE (and the ATLAS technique for AI weaknesses), show a minimal vulnerable example and the fixed version, describe the real-world impact, and list prevention controls with the ASVS chapter they belong to. Keep it educational and defensive.",Xl(!1),sl(!1),jo()),starters:["Explain SSRF with a vulnerable example and the fix.","Explain indirect prompt injection with an example and the defences.","Explain IDOR and how to test for it in an API.","What is prototype pollution in JavaScript?"]}];Sa("You are a security engineer with the whole catalogue below at hand.",hh(),xw());const Nw=["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?
|
|
156
|
-
|
|
157
|
-
`,`Review this code for security vulnerabilities:
|
|
158
|
-
|
|
159
|
-
`];function t0(l){return Gf.find(o=>o.system===l.trim())}const $f="or_flag_pattern",Ti="\\b[A-Za-z][A-Za-z0-9_-]{1,15}\\{[^{}\\s]{3,120}\\}";let ws=Ti;try{ws=localStorage.getItem($f)||Ti}catch{}const mh=()=>ws;function Ew(l){const o=l.trim();ws=o&&n0(o)?o:Ti;try{o?localStorage.setItem($f,o):localStorage.removeItem($f)}catch{}return ws}function n0(l){try{return new RegExp(l,"g"),!0}catch{return!1}}const a0=(l=ws)=>new RegExp(l,"g");function Cw(l,o=ws){if(o===Ti&&!l.includes("{"))return l;const c=a0(o);return l.split(/(<[^>]+>)/).map(u=>u.startsWith("<")||!u?u:u.replace(c,d=>`<mark class="flag">${d}</mark>`)).join("")}function Mw(l,o=ws){if(o===Ti&&!l.includes("{"))return[l];const c=a0(o),u=[];let d=0;for(const h of l.matchAll(c)){const m=h.index??0;h[0]&&(u.push(l.slice(d,m),h[0]),d=m+h[0].length)}return u.push(l.slice(d)),u}const _w={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 Rw({onCollapse:l,sessions:o,mode:c,setMode:u,runner:d,status:h,statusError:m,onOpenDirectory:b,onForgetDirectory:y,config:S,setConfig:g,models:v,modelError:x,activeModel:k,onReset:O,saved:Y}){var xe,Xe;const[B,te]=A.useState(mh()),re=($,De)=>g(Le=>({...Le,[$]:De})),[fe,E]=A.useState(!1);A.useEffect(()=>{const $=()=>fetch("/api/auth/me").then(Le=>Le.json()).then(Le=>E(!!Le.required)).catch(()=>{});$();const De=setInterval($,3e4);return()=>clearInterval(De)},[]);const[G,U]=A.useState([]),[V,J]=A.useState(""),[oe,X]=A.useState(""),[K,Q]=A.useState(!1),[me,ce]=A.useState(null),[Ce,ae]=A.useState(null);A.useEffect(()=>{TS().then(U).catch(()=>{})},[]);async function W(){if(oe.trim()){Q(!0),ce(null);try{const $=await kS(V.trim()||`Document ${G.length+1}`,oe);U($),J(""),X(""),S.useKnowledge||re("useKnowledge",!0)}catch($){ce(String($.message??$))}finally{Q(!1)}}}async function pe($){U(await jS($))}const F=(k==null?void 0:k.supported_features)??[],we=F.includes("tools"),nt=F.includes("json_mode"),Lt=F.includes("reasoning"),[mt,j]=A.useState(""),[ne,Te]=A.useState(!1),ye=v.filter($=>$.output_modalities.includes("text")),Ie=ye.filter($=>ne||Lc($)||$.id===S.model),Oe=ye.filter($=>!Lc($)).length,Ne=Ie.filter($=>dw($,mt)||$.id===S.model),he=["scx","anthropic","nvidia","openrouter"].map($=>[$,Ne.filter(De=>(De.provider??"scx")===$)]).filter(([,$])=>$.length>0),be=t0(S.system),gt=v.some($=>$.provider==="nvidia"),[H,Me]=A.useState([]);A.useEffect(()=>{gt&&fetch("/api/models/nvidia-health").then($=>$.ok?$.json():null).then($=>Me(Array.isArray($==null?void 0:$.retired)?$.retired:[])).catch(()=>{})},[gt,v]);function ke($,De){g(Le=>{const dt=Le.tools.slice();return dt[$]={...dt[$],function:{...dt[$].function,...De}},{...Le,tools:dt}})}function Be($,De){try{const Le=JSON.parse(De);ke($,{parameters:Le})}catch{}}function _e($){if(!$)return null;const De=$.function??$;return De!=null&&De.name?{type:"function",id:Uf(),function:{name:De.name,description:De.description,parameters:De.parameters??De.schema}}:null}async function le(){ae(null);try{const $=await fetch("/example-tools.json",{cache:"no-store"});if(!$.ok)throw new Error(`No example-tools.json yet (${$.status}) — add web/public/example-tools.json first.`);const De=await $.json(),Le=(Array.isArray(De)?De:De.tools??[]).map(_e).filter(Boolean);if(!Le.length)throw new Error("File had no valid tools.");let dt=0;g(Ze=>{const ft=new Set(Ze.tools.map($t=>$t.function.name)),Ke=Le.filter($t=>!ft.has($t.function.name));return dt=Ke.length,{...Ze,tools:[...Ze.tools,...Ke]}}),ae(dt?`Loaded ${dt} tool${dt>1?"s":""}.`:"Already loaded.")}catch($){ae(String($.message??$))}}function Se(){const $=new Blob([JSON.stringify(S,null,2)],{type:"application/json"}),De=URL.createObjectURL($),Le=document.createElement("a");Le.href=De,Le.download=`${S.name.replace(/\s+/g,"-").toLowerCase()||"bot"}.json`,Le.click(),URL.revokeObjectURL(De)}return i.jsxs("aside",{className:"sidebar",children:[i.jsxs("div",{className:"sidebar-head",children:[i.jsxs("div",{className:"sidebar-top",children:[i.jsx(t1,{}),i.jsx("button",{className:"sidebar-toggle",onClick:l,title:"Hide sidebar (Ctrl+B)","aria-label":"Hide sidebar",children:"«"})]}),i.jsx("div",{className:"mode-switch",children:["runner","playground"].map($=>i.jsx("button",{className:"seg"+(c===$?" on":""),onClick:()=>u($),children:$==="runner"?"Runner":"Playground"},$))})]}),c==="runner"?i.jsx(Ow,{runner:d,status:h,statusError:m,onOpen:b,onForget:y,sessions:o}):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:$=>re("name",$.target.value)})]}),i.jsxs("div",{className:"field",children:[i.jsx("label",{children:"Model"}),i.jsx("input",{type:"search",placeholder:`Search ${Ie.length} models…`,value:mt,onChange:$=>j($.target.value),style:{marginBottom:6},"aria-label":"Search models"}),i.jsx("select",{value:S.model,onChange:$=>re("model",$.target.value),children:he.map(([$,De])=>i.jsx("optgroup",{label:$==="openrouter"?"OpenRouter":$==="nvidia"?"NVIDIA NIM":$==="anthropic"?"Anthropic":"SCX.ai",children:De.map(Le=>i.jsxs("option",{value:Le.id,children:[Le.name,Le.context_length?` · ${Math.round(Le.context_length/1e3)}k ctx`:""]},Le.id))},$))}),Oe>0&&i.jsxs("label",{className:"hint",style:{display:"flex",gap:6,alignItems:"center",cursor:"pointer"},children:[i.jsx("input",{type:"checkbox",checked:ne,onChange:$=>Te($.target.checked)}),"Show non-chat models (",Oe," hidden: embeddings, guards, speech…)"]}),H.length>0&&i.jsxs("div",{className:"hint",title:H.join(", "),children:[H.length," retired NVIDIA model",H.length===1?"":"s"," hidden (no longer served)"]}),x&&i.jsx("div",{className:"hint",style:{color:"var(--danger)"},children:x}),(k==null?void 0:k.description)&&i.jsx("div",{className:"hint",children:k.description}),i.jsxs("div",{className:"cap-badges",children:[i.jsx("span",{className:"badge"+(we?" on":""),children:"tools"}),i.jsx("span",{className:"badge"+(nt?" on":""),children:"json"}),i.jsx("span",{className:"badge"+(Lt?" on":""),children:"reasoning"}),i.jsx("span",{className:"badge"+((xe=k==null?void 0:k.input_modalities)!=null&&xe.includes("image")?" on":""),children:"vision"}),(Xe=k==null?void 0:k.datacenters)==null?void 0:Xe.map($=>i.jsx("span",{className:"badge",children:$.country_code},$.country_code))]})]}),i.jsxs("div",{className:"field",children:[i.jsx("label",{children:"Security preset"}),i.jsxs("select",{value:(be==null?void 0:be.id)??"custom",onChange:$=>{const De=Gf.find(Le=>Le.id===$.target.value);De&&re("system",De.system)},children:[i.jsx("option",{value:"custom",children:"Custom (your own system prompt)"}),Gf.map($=>i.jsx("option",{value:$.id,children:$.label},$.id))]})]}),i.jsxs("div",{className:"field",children:[i.jsx("label",{children:"System prompt"}),i.jsx("textarea",{value:S.system,onChange:$=>re("system",$.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:$=>re("temperature",Number($.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:$=>re("topP",Number($.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:(k==null?void 0:k.max_output_length)??4096,step:64,value:Math.min(S.maxTokens,(k==null?void 0:k.max_output_length)??4096),onChange:$=>re("maxTokens",Number($.target.value))}),i.jsx("span",{className:"range-val",children:S.maxTokens})]})]}),i.jsx(vc,{label:"Stream responses",sub:"Token-by-token output via SSE",checked:S.stream,onChange:$=>re("stream",$)}),i.jsx(vc,{label:"JSON mode",sub:nt?"Force valid JSON output":"Not supported by this model",checked:S.jsonMode&&nt,disabled:!nt,onChange:$=>re("jsonMode",$)}),i.jsxs("div",{className:"section-title",children:["Tools ",we?"":"(model has no tool support)"]}),S.tools.map(($,De)=>i.jsxs("div",{className:"tool-card",children:[i.jsxs("div",{className:"tc-head",children:[i.jsx("input",{type:"text",value:$.function.name,placeholder:"function_name",onChange:Le=>ke(De,{name:Le.target.value})}),i.jsx("button",{className:"btn danger",onClick:()=>g(Le=>({...Le,tools:Le.tools.filter((dt,Ze)=>Ze!==De)})),children:"✕"})]}),i.jsx("input",{type:"text",value:$.function.description??"",placeholder:"description",style:{marginBottom:8},onChange:Le=>ke(De,{description:Le.target.value})}),i.jsx("textarea",{defaultValue:JSON.stringify($.function.parameters??{},null,2),onChange:Le=>Be(De,Le.target.value),spellCheck:!1}),i.jsx("div",{className:"hint",children:"JSON Schema for the function parameters."})]},$.id??De)),i.jsxs("div",{className:"btn-row",children:[i.jsx("button",{className:"btn block ghost mini",disabled:!we,onClick:()=>g($=>({...$,tools:[...$.tools,{...structuredClone(_w),id:Uf()}]})),children:"+ Add tool"}),i.jsx("button",{className:"btn block ghost mini",onClick:le,title:"Import tools from web/public/example-tools.json",children:"↓ Load example tools"})]}),Ce&&i.jsx("div",{className:"hint",style:{color:Ce.startsWith("Loaded")?"var(--accent-2)":"var(--muted-2)"},children:Ce}),i.jsx("div",{className:"section-title",children:"Knowledge (RAG)"}),i.jsx(vc,{label:"Ground answers in knowledge",sub:G.length?`Retrieve from ${G.length} doc${G.length>1?"s":""} via embeddings`:"Add a document to enable",checked:S.useKnowledge&&G.length>0,disabled:G.length===0,onChange:$=>re("useKnowledge",$)}),G.map($=>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:$.name}),i.jsxs("div",{className:"hint",style:{margin:0},children:[$.chunks," chunks · ",$.chars.toLocaleString()," chars"]})]}),i.jsx("button",{className:"btn danger",onClick:()=>pe($.id),children:"✕"})]},$.id)),i.jsxs("div",{className:"field",style:{marginTop:10},children:[i.jsx("input",{type:"text",placeholder:"Document name (optional)",value:V,onChange:$=>J($.target.value),style:{marginBottom:8}}),i.jsx("textarea",{placeholder:"Paste text to give your bot a knowledge base…",value:oe,onChange:$=>X($.target.value),style:{minHeight:80}}),me&&i.jsx("div",{className:"hint",style:{color:"var(--danger)"},children:me}),i.jsx("button",{className:"btn block ghost mini",style:{marginTop:8},disabled:K||!oe.trim(),onClick:W,children:K?"Embedding…":"+ Add to knowledge base"})]}),i.jsx("div",{className:"section-title",children:"Voice"}),i.jsx(vc,{label:"Speak replies aloud",sub:"Browser text-to-speech",checked:S.speak,onChange:$=>re("speak",$)}),i.jsxs("div",{className:"hint",children:[th()?"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:$=>re("saveSessions",$.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:O,children:"+ New chat"}),i.jsx("button",{className:"btn block ghost",onClick:Se,title:"Download the bot settings as JSON",children:"Export settings"})]}),Y.status&&i.jsx("div",{className:"hint",style:{color:Y.status.ok?"var(--muted)":"var(--amber)"},children:Y.status.text}),i.jsx(Dw,{saved:Y})]}),i.jsxs("div",{className:"sidebar-foot",children:[i.jsxs("div",{className:"field",children:[i.jsx("label",{children:"Flag format"}),i.jsx("input",{type:"text",value:B,placeholder:Ti,spellCheck:!1,onChange:$=>{te($.target.value),Ew($.target.value)},title:"A regular expression. Anything matching it is highlighted in replies and tool output (CTFs, labs). Blank = the default: a short prefix before braces, e.g. flag{...}."}),B.trim()&&!n0(B)&&i.jsx("div",{className:"hint",style:{color:"var(--amber)"},children:"Not a valid regular expression; the default is in use."})]}),i.jsx(C1,{}),fe&&i.jsx("button",{className:"btn ghost sm block",onClick:k1,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 Ow({runner:l,status:o,statusError:c,onOpen:u,onForget:d,sessions:h}){const[m,b]=A.useState(l.directory),[y,S]=A.useState(null),[g,v]=A.useState(!1),[x,k]=A.useState(!1),[O,Y]=A.useState(!1),[B,te]=A.useState(!1);A.useEffect(()=>b(l.directory),[l.directory]);async function re(G=m){if(G.trim()){v(!0),S(null);try{u(await Rv(G))}catch(U){S(String(U.message??U))}finally{v(!1)}}}const fe=l.recent.filter(G=>G!==l.directory),E=(o==null?void 0:o.models.filter(G=>G.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:G=>{G.preventDefault(),re()},children:[i.jsx("input",{type:"text",className:"mono",value:m,onChange:G=>b(G.target.value),placeholder:"C:\\code\\my-project",spellCheck:!1}),i.jsx("button",{className:"btn sm",type:"submit",disabled:g||!m.trim()||m===l.directory,children:"Open"})]}),y&&i.jsx("div",{className:"hint danger",children:y}),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:()=>Y(!0),title:"Create, open or delete workspaces",children:[i.jsx(V1,{size:13})," workspaces"]}),i.jsxs("button",{className:"btn sm gh-open",onClick:()=>te(!0),disabled:!l.directory,title:"Browse, upload and download this project's files",children:[i.jsx(fh,{size:13})," files"]}),i.jsxs("button",{className:"btn sm gh-open",onClick:()=>k(!0),title:"Clone a repository into the workspace (read-only)",children:[i.jsx(Qv,{size:13})," clone from GitHub"]})]}),x&&i.jsx(ow,{onOpen:G=>re(G),onClose:()=>k(!1)}),O&&i.jsx(rw,{current:l.directory,onOpen:G=>re(G),onDeleted:d,onClose:()=>Y(!1)}),B&&l.directory&&i.jsx(cw,{directory:l.directory,onClose:()=>te(!1)})]}),fe.length>0&&i.jsxs("div",{className:"field",children:[i.jsx("label",{children:"Recent"}),i.jsx("div",{className:"recent-list",children:fe.map(G=>i.jsxs("button",{className:"recent-item",onClick:()=>re(G),title:G,children:[i.jsx("span",{className:"recent-name",children:G.split(/[\\/]/).filter(Boolean).pop()}),i.jsx("span",{className:"recent-path mono",children:G})]},G))})]}),l.directory&&i.jsx(Lw,{directory:l.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 · ",E," models"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"muted",children:"Default"}),i.jsx("span",{className:"mono",children:(o==null?void 0:o.defaultModel)??"…"})]})]})]})}function Dw({saved:l}){const[o,c]=A.useState(null),[u,d]=A.useState(!1);A.useEffect(()=>{if(!o)return;const b=setTimeout(()=>c(null),3e3);return()=>clearTimeout(b)},[o]);const h=l.list??[];if(l.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===l.activeId?" on":""),children:[i.jsxs("button",{className:"session-open",onClick:()=>l.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:l0(Date.parse(b.updatedAt))})]}),i.jsx("button",{className:"session-del"+(o===b.id?" confirm":""),onClick:()=>{if(o!==b.id)return c(b.id);c(null),l.onDelete(b.id)},title:o===b.id?"Click again to delete":"Delete chat","aria-label":o===b.id?"Confirm delete":"Delete chat",children:o===b.id?"Delete?":"✕"})]},b.id))}),h.length>8&&i.jsx("button",{className:"btn ghost sm block",onClick:()=>d(b=>!b),children:u?"Show fewer":`Show all ${h.length}`})]})}function Lw({directory:l,nav:o}){const[c,u]=A.useState(null),[d,h]=A.useState(null),[m,b]=A.useState(null),[y,S]=A.useState(!1);A.useEffect(()=>{let x=!0;return ES(l).then(k=>{x&&(u(k),h(null))}).catch(k=>x&&h(String(k.message??k))),()=>{x=!1}},[l,o.version,o.active]),A.useEffect(()=>{if(!m)return;const x=setTimeout(()=>b(null),3e3);return()=>clearTimeout(x)},[m]);async function g(x){if(m!==x){b(x);return}b(null);try{await MS(x,l),o.active===x&&o.open(null),u(k=>(k==null?void 0:k.filter(O=>O.id!==x))??null)}catch(k){h(String(k.message??k))}}const v=y?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:()=>o.open(null),children:"+ New session"}),d&&i.jsx("div",{className:"hint danger",children:d}),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===o.active?" on":""),children:[i.jsxs("button",{className:"session-open",onClick:()=>o.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:[l0(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:()=>g(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:y?"Show fewer":`Show all ${c.length}`})]})}function l0(l){if(!l)return"";const o=Math.max(0,(Date.now()-l)/1e3);return o<60?"just now":o<3600?`${Math.floor(o/60)}m ago`:o<86400?`${Math.floor(o/3600)}h ago`:o<7*86400?`${Math.floor(o/86400)}d ago`:new Date(l).toLocaleDateString()}function vc({label:l,sub:o,checked:c,onChange:u,disabled:d}){return i.jsxs("div",{className:"toggle",children:[i.jsxs("div",{className:"tg-label",children:[l,o&&i.jsx("small",{children:o})]}),i.jsxs("label",{className:"switch"+(d?" disabled":""),children:[i.jsx("input",{type:"checkbox",checked:c,disabled:d,onChange:h=>u(h.target.checked)}),i.jsx("span",{})]})]})}function s0({text:l}){const o=mh(),c=A.useMemo(()=>Mw(l,o),[l,o]);return c.length===1?i.jsx(i.Fragment,{children:l}):i.jsx(i.Fragment,{children:c.map((u,d)=>d%2?i.jsx("mark",{className:"flag",children:u},d):u)})}const zw=5*1024*1024,Nf=4,Uw=3*1024*1024-2048,Yy=3,ph="image/*,.drawio,.xml,.svg";function Hw(l){return new Promise((o,c)=>{const u=new FileReader;u.onload=()=>o(String(u.result)),u.onerror=()=>c(u.error),u.readAsDataURL(l)})}const Iw=l=>/\.drawio(\.(svg|xml))?$/i.test(l)||/\.xml$/i.test(l);async function Bw(l){if(/\.drawio\.png$/i.test(l.name))return!1;if(Iw(l.name))return!0;if(l.type==="image/svg+xml"||/\.svg$/i.test(l.name)){const o=await l.slice(0,4096).text();return/content="[^"]*(mxfile|mxGraphModel)/.test(o)||/<mxfile/.test(o)}return!1}async function qw(l){var u;const o=await fetch("/api/render/outline",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:await l.text()})}),c=await o.json().catch(()=>({}));if(!o.ok)throw new Error(((u=c==null?void 0:c.error)==null?void 0:u.message)||`Reading ${l.name} failed (${o.status})`);return{name:l.name,text:c.outline,pages:c.pages}}function gh(){const[l,o]=A.useState([]),[c,u]=A.useState([]),[d,h]=A.useState(0),[m,b]=A.useState(null);async function y(v){b(null);const x=Array.from(v),k=[],O=[];for(const Y of x)await Bw(Y)?O.push(Y):Y.type.startsWith("image/")?Y.size>zw?b(`${Y.name} is over 5 MB.`):k.push({name:Y.name||"pasted-image.png",url:await Hw(Y)}):b(`${Y.name}: attach images or draw.io files (.drawio, .drawio.svg).`);o(Y=>{const B=[...Y,...k];return B.length>Nf&&b(`Up to ${Nf} images per message.`),B.slice(0,Nf)});for(const Y of O){if(Y.size>Uw){b(`${Y.name} is over 3 MB.`);continue}h(B=>B+1);try{const B=await qw(Y);u(te=>te.length>=Yy?(b(`Up to ${Yy} diagrams per message.`),te):[...te,B])}catch(B){b(String(B.message??B))}finally{h(B=>B-1)}}}function S(v){const x=Array.from(v.clipboardData.files);x.length&&(v.preventDefault(),y(x))}function g(v){v.dataTransfer.files.length&&(v.preventDefault(),y(v.dataTransfer.files))}return{images:l,docs:c,reading:d>0,attachError:m,addImages:y,onPaste:S,onDrop:g,remove:v=>o(x=>x.filter((k,O)=>O!==v)),removeDoc:v=>u(x=>x.filter((k,O)=>O!==v)),clear:()=>{o([]),u([]),b(null)}}}function yh({images:l,docs:o=[],onRemove:c,onRemoveDoc:u,reading:d}){return!l.length&&!o.length&&!d?null:i.jsxs("div",{className:"attach-row",children:[l.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}`)),o.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}`)),d&&i.jsx("span",{className:"attach-chip doc",children:i.jsx("span",{className:"attach-name",children:"reading diagram…"})})]})}function vh(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var js=vh();function i0(l){js=l}var xs={exec:()=>null};function hi(l){let o=[];return c=>{let u=Math.max(0,Math.min(3,c-1)),d=o[u];return d||(d=l(u),o[u]=d),d}}function Je(l,o=""){let c=typeof l=="string"?l:l.source,u={replace:(d,h)=>{let m=typeof h=="string"?h:h.source;return m=m.replace(gn.caret,"$1"),c=c.replace(d,m),u},getRegex:()=>new RegExp(c,o)};return u}var Gw=((l="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+l)}catch{return!1}})(),gn={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:l=>new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:hi(l=>new RegExp(`^ {0,${l}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:hi(l=>new RegExp(`^ {0,${l}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:hi(l=>new RegExp(`^ {0,${l}}(?:\`\`\`|~~~)`)),headingBeginRegex:hi(l=>new RegExp(`^ {0,${l}}#`)),htmlBeginRegex:hi(l=>new RegExp(`^ {0,${l}}(?:</?(?:${qo})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:hi(l=>new RegExp(`^ {0,${l}}>`))},$w=/^(?:[ \t]*(?:\n|$))+/,Xw=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Yw=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Bo=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Vw=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,bh=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,o0=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,r0=Je(o0).replace(/bull/g,bh).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(),Qw=Je(o0).replace(/bull/g,bh).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(),xh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Kw=/^[^\n]+/,Sh=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Zw=Je(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Sh).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Pw=Je(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,bh).getRegex(),qo="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",wh=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Fw=Je("^ {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",wh).replace("tag",qo).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),c0=l=>Je(xh).replace("hr",Bo).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",l).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",qo).getRegex(),Jw=c0(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Ww=c0(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),eA=Je(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ww).getRegex(),Ah={blockquote:eA,code:Xw,def:Zw,fences:Yw,heading:Vw,hr:Bo,html:Fw,lheading:r0,list:Pw,newline:$w,paragraph:Jw,table:xs,text:Kw},Vy=Je("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Bo).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",qo).getRegex(),tA={...Ah,lheading:Qw,table:Vy,paragraph:Je(xh).replace("hr",Bo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Vy).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",qo).getRegex()},nA={...Ah,html:Je(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",wh).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:xs,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Je(xh).replace("hr",Bo).replace("heading",` *#{1,6} *[^
|
|
160
|
-
]`).replace("lheading",r0).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},aA=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,lA=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,u0=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,sA=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ul=/[\p{P}\p{S}]/u,ki=/[\s\p{P}\p{S}]/u,Go=/[^\s\p{P}\p{S}]/u,iA=Je(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ki).getRegex(),oA=/[\p{Pi}\p{Ps}"']/u,d0=/(?!~)[\p{P}\p{S}]/u,rA=/(?!~)[\s\p{P}\p{S}]/u,cA=/(?:[^\s\p{P}\p{S}]|~)/u,uA=Je(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Gw?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),f0=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,dA=Je(f0,"u").replace(/punct/g,ul).getRegex(),fA=Je(f0,"u").replace(/punct/g,d0).getRegex(),hA=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,mA=Je(hA,"u").replace(/openQuote/g,oA).replace(/punct/g,ul).getRegex(),h0="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",pA=Je(h0,"gu").replace(/notPunctSpace/g,Go).replace(/punctSpace/g,ki).replace(/punct/g,ul).getRegex(),gA=Je(h0,"gu").replace(/notPunctSpace/g,cA).replace(/punctSpace/g,rA).replace(/punct/g,d0).getRegex(),yA="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",vA=Je(yA,"gu").replace(/notPunctSpace/g,Go).replace(/punctSpace/g,ki).replace(/punct/g,ul).getRegex(),bA=Je("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Go).replace(/punctSpace/g,ki).replace(/punct/g,ul).getRegex(),xA="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",SA=Je(xA,"gu").replace(/notPunctSpace/g,Go).replace(/punctSpace/g,ki).replace(/punct/g,ul).getRegex(),wA=Je(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ul).getRegex(),AA="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",TA=Je(AA,"gu").replace(/notPunctSpace/g,Go).replace(/punctSpace/g,ki).replace(/punct/g,ul).getRegex(),kA=Je(/\\(punct)/,"gu").replace(/punct/g,ul).getRegex(),jA=Je(/^<(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(),NA=Je(wh).replace("(?:-->|$)","-->").getRegex(),EA=Je("^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",NA).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),m0=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,zc=Je(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",m0).getRegex(),CA=Je(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",zc).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),MA=Je(/^!?\[(label)\]\[(ref)\]/).replace("label",zc).replace("ref",Sh).getRegex(),_A=Je(/^!?\[(ref)\](?:\[\])?/).replace("ref",Sh).getRegex(),Qy=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,RA=Je(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",m0).getRegex(),OA=Je("reflink|nolink(?!\\()","g").replace("reflink",Je(/^!?\[(label)\]\[(ref)\]/).replace("label",RA).replace("ref",Qy).getRegex()).replace("nolink",Je(/^!?\[(ref)\](?:\[\])?/).replace("ref",Qy).getRegex()).getRegex(),Ky=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,DA=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,LA=Je(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,DA).getRegex(),Th={_backpedal:xs,anyPunctuation:kA,autolink:jA,blockSkip:uA,br:u0,code:lA,del:xs,delLDelim:xs,delRDelim:xs,emStrongLDelim:dA,emStrongRDelimAst:pA,emStrongRDelimUnd:bA,escape:aA,link:CA,nolink:_A,punctuation:iA,reflink:MA,reflinkSearch:OA,tag:EA,text:sA,url:xs},zA={...Th,emStrongLDelim:mA,emStrongRDelimAst:vA,emStrongRDelimUnd:SA,link:Je(/^!?\[(label)\]\((.*?)\)/).replace("label",zc).getRegex(),reflink:Je(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",zc).getRegex()},Xf={...Th,emStrongRDelimAst:gA,emStrongLDelim:fA,delLDelim:wA,delRDelim:TA,url:Je(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",LA).replace("protocol",Ky).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:Je(/^(?:[^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",Ky).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},UA={...Xf,br:Je(u0).replace("{2,}","*").getRegex(),text:Je(Xf.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},bc={normal:Ah,gfm:tA,pedantic:nA},vo={normal:Th,gfm:Xf,breaks:UA,pedantic:zA},HA={"&":"&","<":"<",">":">",'"':""","'":"'"},Zy=l=>HA[l];function Kn(l,o){if(o){if(gn.escapeTest.test(l))return l.replace(gn.escapeReplace,Zy)}else if(gn.escapeTestNoEncode.test(l))return l.replace(gn.escapeReplaceNoEncode,Zy);return l}function IA(l){return l.replace(gn.numericCharacterReference,(o,c,u)=>{let d=c===void 0?Number.parseInt(u,16):Number.parseInt(c,10);return d===0||d>1114111||d>=55296&&d<=57343?"�":String.fromCodePoint(d)})}function Py(l){try{l=encodeURI(l).replace(gn.percentDecode,"%")}catch{return null}return l}function Fy(l,o){var h;let c=l.replace(gn.findPipe,(m,b,y)=>{let S=!1,g=b;for(;--g>=0&&y[g]==="\\";)S=!S;return S?"|":" |"}),u=c.split(gn.splitPipe),d=0;if(u[0].trim()||u.shift(),u.length>0&&!((h=u.at(-1))!=null&&h.trim())&&u.pop(),o)if(u.length>o)u.splice(o);else for(;u.length<o;)u.push("");for(;d<u.length;d++)u[d]=u[d].trim().replace(gn.slashPipe,"|");return u}function ql(l,o,c){let u=l.length;if(u===0)return"";let d=0;for(;d<u&&l.charAt(u-d-1)===o;)d++;return l.slice(0,u-d)}function Jy(l){let o=l.split(`
|
|
161
|
-
`),c=o.length-1;for(;c>=0&&gn.blankLine.test(o[c]);)c--;return o.length-c<=2?l:o.slice(0,c+1).join(`
|
|
162
|
-
`)}function Uc(l){return l.trim().toLowerCase().toUpperCase().toLowerCase()}function Wy(l,o){if(l.indexOf(o[0])===-1&&l.indexOf(o[1])===-1)return-1;let c=0;for(let u=0;u<l.length;u++)if(l[u]==="\\")u++;else if(l[u]===o[0])c++;else if(l[u]===o[1]&&(c--,c<0))return u;return c>0?-2:-1}function ev(l,o=0){let c=o,u="";for(let d of l)if(d===" "){let h=4-c%4;u+=" ".repeat(h),c+=h}else u+=d,c++;return u}function tv(l,o,c,u,d){let h=o.href,m=o.title||null,b=l[1].replace(d.other.outputLinkReplace,"$1"),y=l[0].charAt(0)==="!";u.state.inLink=!0;let S=u.state.linkEmitted,g=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,!y){if(x){u.state.inRawBlock=g;return}u.state.linkEmitted=!0}return{type:y?"image":"link",raw:c,href:h,title:m,text:b,tokens:v}}function BA(l,o,c){let u=l.match(c.other.indentCodeCompensation);if(u===null)return o;let d=u[1];return o.split(`
|
|
163
|
-
`).map(h=>{let m=h.match(c.other.beginningSpace);if(m===null)return h;let[b]=m;return h.slice(Math.min(b.length,d.length))}).join(`
|
|
164
|
-
`)}function nv(l,o,c,u){if(!o.includes("<"))return!1;for(let d=0;d<o.length;d++){if(o[d]==="\\"){d++;continue}if(o[d]==="`"){let b=u.inline.code.exec(o.slice(d));if(b){d+=b[0].length-1;continue}}if(o[d]!=="<")continue;let h=l.slice(c+d),m=u.inline.tag.exec(h)||u.inline.autolink.exec(h);if(m){if(m[0].length>o.length-d)return!0;d+=m[0].length-1}}return!1}var Hc=class{constructor(l){kt(this,"options");kt(this,"rules");kt(this,"lexer");this.options=l||js}space(l){let o=this.rules.block.newline.exec(l);if(o&&o[0].length>0)return{type:"space",raw:o[0]}}code(l){let o=this.rules.block.code.exec(l);if(o){let c=this.options.pedantic?o[0]:Jy(o[0]),u=c.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:c,codeBlockStyle:"indented",text:u}}}fences(l){let o=this.rules.block.fences.exec(l);if(o){let c=o[0],u=BA(c,o[3]||"",this.rules);return{type:"code",raw:c,lang:o[2]?o[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):o[2],text:u}}}heading(l){let o=this.rules.block.heading.exec(l);if(o){let c=o[2].trim();if(this.rules.other.endingHash.test(c)){let u=ql(c,"#");(this.options.pedantic||!u||this.rules.other.endingSpaceTabChar.test(u))&&(c=u.trim())}return{type:"heading",raw:ql(o[0],`
|
|
165
|
-
`),depth:o[1].length,text:c,tokens:this.lexer.inline(c)}}}hr(l){let o=this.rules.block.hr.exec(l);if(o)return{type:"hr",raw:ql(o[0],`
|
|
166
|
-
`)}}blockquote(l){let o=this.rules.block.blockquote.exec(l);if(o){let c=ql(o[0],`
|
|
167
|
-
`).split(`
|
|
168
|
-
`),u="",d="",h=[];for(;c.length>0;){let m=!1,b=[],y;for(y=0;y<c.length;y++)if(this.rules.other.blockquoteStart.test(c[y]))b.push(c[y]),m=!0;else if(!m)b.push(c[y]);else break;c=c.slice(y);let S=b.join(`
|
|
169
|
-
`),g=S.replace(this.rules.other.blockquoteSetextReplace,`
|
|
170
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");u=u?`${u}
|
|
171
|
-
${S}`:S,d=d?`${d}
|
|
172
|
-
${g}`:g;let v=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(g,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 k=x,O=c.join(`
|
|
173
|
-
`),Y=k.raw+`
|
|
174
|
-
`+O.replace(this.rules.other.blockquoteSetextReplace2,""),B=this.blockquote(Y);h[h.length-1]=B;let te=Y.substring(B.raw.length).replace(/^\n/,""),re=te?te.split(`
|
|
175
|
-
`).length:0,fe=re?c.slice(0,-re):c;fe.length>0&&(u=`${u}
|
|
176
|
-
${fe.join(`
|
|
177
|
-
`)}`),d=d.substring(0,d.length-k.text.length)+B.text;break}else if((x==null?void 0:x.type)==="list"){let k=x,O=k.raw+`
|
|
178
|
-
`+c.join(`
|
|
179
|
-
`),Y=this.list(O);h[h.length-1]=Y,u=u.substring(0,u.length-x.raw.length)+Y.raw,d=d.substring(0,d.length-k.raw.length)+Y.raw,c=O.substring(h.at(-1).raw.length).split(`
|
|
180
|
-
`);continue}}return{type:"blockquote",raw:u,tokens:h,text:d}}}list(l){let o=this.rules.block.list.exec(l);if(o){let c=o[1].trim(),u=c.length>1,d={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(;l;){let y=!1,S="",g="";if(!(o=h.exec(l))||this.rules.block.hr.test(l))break;S=o[0],l=l.substring(S.length);let v=o[2].split(`
|
|
181
|
-
`,1)[0],x=o[1].length,k=this.options.pedantic?ev(v,x):v.replace(this.rules.other.leadingSpaceTab,te=>ev(te,x)),O=l.split(`
|
|
182
|
-
`,1)[0],Y=!k.trim(),B=0;if(this.options.pedantic?(B=2,g=k.trimStart()):Y?B=x+1:(B=k.search(this.rules.other.nonSpaceChar),B=B>4?1:B,g=k.slice(B),B+=x),Y&&this.rules.other.blankLine.test(O)&&(S+=O+`
|
|
183
|
-
`,l=l.substring(O.length+1),y=!0),!y){let te=this.rules.other.nextBulletRegex(B),re=this.rules.other.hrRegex(B),fe=this.rules.other.fencesBeginRegex(B),E=this.rules.other.headingBeginRegex(B),G=this.rules.other.htmlBeginRegex(B),U=this.rules.other.blockquoteBeginRegex(B);for(;l;){let V=l.split(`
|
|
184
|
-
`,1)[0],J;if(O=V,this.options.pedantic?(O=O.replace(this.rules.other.listReplaceNesting," "),J=O):J=O.replace(this.rules.other.leadingSpaceTab,oe=>oe.replace(this.rules.other.tabCharGlobal," ")),fe.test(O)||E.test(O)||G.test(O)||U.test(O)||te.test(O)||re.test(O))break;if(J.search(this.rules.other.nonSpaceChar)>=B||!O.trim())g+=`
|
|
185
|
-
`+J.slice(B);else{if(Y||k.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||fe.test(k)||E.test(k)||re.test(k))break;g+=`
|
|
186
|
-
`+O}Y=!O.trim(),S+=V+`
|
|
187
|
-
`,l=l.substring(V.length+1),k=J.slice(B)}}d.loose||(m?d.loose=!0:this.rules.other.doubleBlankLine.test(S)&&(m=!0)),d.items.push({type:"list_item",raw:S,task:!!this.options.gfm&&this.rules.other.listIsTask.test(g),loose:!1,text:g,tokens:[]}),d.raw+=S}let b=d.items.at(-1);if(b)b.raw=b.raw.trimEnd(),b.text=b.text.trimEnd();else return;d.raw=d.raw.trimEnd();for(let y of d.items)if(this.lexer.state.top=!1,y.tokens=this.lexer.blockTokens(y.text,[]),!d.loose){let S=y.tokens.filter(v=>v.type==="space"),g=S.length>0&&S.some(v=>this.rules.other.anyLine.test(v.raw));d.loose=g}for(let y of d.items){let S=y.tokens[0];if(y.task&&((S==null?void 0:S.type)==="text"||(S==null?void 0:S.type)==="paragraph")){y.text=y.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 g=this.rules.other.listTaskCheckbox.exec(y.raw);if(g){let v={type:"checkbox",raw:g[0]+" ",checked:g[0]!=="[ ]"};y.checked=v.checked,d.loose?y.tokens[0]&&["paragraph","text"].includes(y.tokens[0].type)&&"tokens"in y.tokens[0]&&y.tokens[0].tokens?(y.tokens[0].raw=v.raw+y.tokens[0].raw,y.tokens[0].text=v.raw+y.tokens[0].text,y.tokens[0].tokens.unshift(v)):y.tokens.unshift({type:"paragraph",raw:v.raw,text:v.raw,tokens:[v]}):y.tokens.unshift(v)}}else y.task&&(y.task=!1)}if(d.loose)for(let y of d.items){y.loose=!0;for(let S of y.tokens)S.type==="text"&&(S.type="paragraph")}return d}}html(l){let o=this.rules.block.html.exec(l);if(o){let c=Jy(o[0]);return{type:"html",block:!0,raw:c,pre:o[1]==="pre"||o[1]==="script"||o[1]==="style",text:c}}}def(l){let o=this.rules.block.def.exec(l);if(o){if(!this.rules.other.startAngleBracket.test(o[2])&&Wy(o[2],"()")!==-1)return;let c=Uc(o[1]).replace(this.rules.other.multipleSpaceGlobal," "),u=o[2]?o[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",d=o[3]?o[3].substring(1,o[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):o[3];return{type:"def",tag:c,raw:ql(o[0],`
|
|
188
|
-
`),href:u,title:d}}}table(l){var m;let o=this.rules.block.table.exec(l);if(!o||!this.rules.other.tableDelimiter.test(o[2]))return;let c=Fy(o[1]),u=o[2].replace(this.rules.other.tableAlignChars,"").split("|"),d=(m=o[3])!=null&&m.trim()?o[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
189
|
-
`):[],h={type:"table",raw:ql(o[0],`
|
|
190
|
-
`),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 d)h.rows.push(Fy(b,h.header.length).map((y,S)=>({text:y,tokens:this.lexer.inline(y),header:!1,align:h.align[S]})));return h}}lheading(l){let o=this.rules.block.lheading.exec(l);if(o){let c=o[1].trim();return{type:"heading",raw:ql(o[0],`
|
|
191
|
-
`),depth:o[2].charAt(0)==="="?1:2,text:c,tokens:this.lexer.inline(c)}}}paragraph(l){let o=this.rules.block.paragraph.exec(l);if(o){let c=o[1].charAt(o[1].length-1)===`
|
|
192
|
-
`?o[1].slice(0,-1):o[1];return{type:"paragraph",raw:o[0],text:c,tokens:this.lexer.inline(c)}}}text(l){let o=this.rules.block.text.exec(l);if(o)return{type:"text",raw:o[0],text:o[0],tokens:this.lexer.inline(o[0])}}escape(l){let o=this.rules.inline.escape.exec(l);if(o)return{type:"escape",raw:o[0],text:o[1]}}tag(l){let o=this.rules.inline.tag.exec(l);if(o)return!this.lexer.state.inLink&&this.rules.other.startATag.test(o[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(o[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(o[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(o[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:o[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:o[0]}}link(l){if(this.lexer.state.linkParenPossible===!1)return;let o=this.rules.inline.link.exec(l);if(o){let c=o[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&nv(l,o[1],c,this.rules))return;let u=o[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(u)){if(!this.rules.other.endAngleBracket.test(u))return;let m=ql(u.slice(0,-1),"\\");if((u.length-m.length)%2===0)return}else{let m=Wy(o[2],"()");if(m===-2)return;if(m>-1){let b=(o[0].indexOf("!")===0?5:4)+o[1].length+m;o[2]=o[2].substring(0,m),o[0]=o[0].substring(0,b).trim(),o[3]=""}}let d=o[2],h="";if(this.options.pedantic){let m=this.rules.other.pedanticHrefTitle.exec(d);m&&(d=m[1],h=m[3])}else h=o[3]?o[3].slice(1,-1):"";return d=d.trim(),this.rules.other.startAngleBracket.test(d)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(u)?d=d.slice(1):d=d.slice(1,-1)),tv(o,{href:d&&d.replace(this.rules.inline.anyPunctuation,"$1"),title:h&&h.replace(this.rules.inline.anyPunctuation,"$1")},o[0],this.lexer,this.rules)}}reflink(l,o){let c;if((c=this.rules.inline.reflink.exec(l))||(c=this.rules.inline.nolink.exec(l))){let u=c[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&nv(l,c[1],u,this.rules))return;let d=(c[2]||c[1]).replace(this.rules.other.multipleSpaceGlobal," "),h=o[Uc(d)];if(!h){let m=c[0].charAt(0);return{type:"text",raw:m,text:m}}return tv(c,h,c[0],this.lexer,this.rules)}}emStrong(l,o,c=""){let u=this.rules.inline.emStrongLDelim.exec(l);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 d=[...u[0]].length-1,h,m,b=d,y=0,S=u[0][0],g=c===S,v=S==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(v.lastIndex=0,o=o.slice(-1*l.length+d);(u=v.exec(o))!==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(d%3&&!((d+m)%3)){y+=m;continue}if(g)break}if(b-=m,b>0)continue;m=Math.min(m,m+b+y);let x=[...u[0]][0].length,k=l.slice(0,d+u.index+x+m);if(Math.min(d,m)%2){let Y=k.slice(1,-1);return{type:"em",raw:k,text:Y,tokens:this.lexer.inlineTokens(Y)}}let O=k.slice(2,-2);return{type:"strong",raw:k,text:O,tokens:this.lexer.inlineTokens(O)}}}}codespan(l){let o=this.rules.inline.code.exec(l);if(o){let c=o[2].replace(this.rules.other.newLineCharGlobal," "),u=this.rules.other.nonSpaceChar.test(c),d=this.rules.other.startingSpaceChar.test(c)&&this.rules.other.endingSpaceChar.test(c);return u&&d&&(c=c.substring(1,c.length-1)),{type:"codespan",raw:o[0],text:c}}}br(l){let o=this.rules.inline.br.exec(l);if(o)return{type:"br",raw:o[0]}}del(l,o,c=""){let u=this.rules.inline.delLDelim.exec(l);if(u&&(!u[1]||!c||this.rules.inline.punctuation.exec(c))){let d=[...u[0]].length-1,h,m,b=d,y=this.rules.inline.delRDelim;for(y.lastIndex=0,o=o.slice(-1*l.length+d);(u=y.exec(o))!==null;){if(h=u[1]||u[2]||u[3]||u[4]||u[5]||u[6],!h||(m=[...h].length,m!==d))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,g=l.slice(0,d+u.index+S+m),v=g.slice(d,-d);return{type:"del",raw:g,text:v,tokens:this.lexer.inlineTokens(v)}}}}autolink(l){let o=this.rules.inline.autolink.exec(l);if(o){let c,u;return o[2]==="@"?(c=o[1],u="mailto:"+c):(c=o[1],u=c),{type:"link",raw:o[0],text:c,href:u,autolink:!0,tokens:[{type:"text",raw:c,text:c}]}}}url(l){var c;let o;if(o=this.rules.inline.url.exec(l)){let u,d;if(o[2]==="@")u=o[0],d="mailto:"+u;else{let h;do h=o[0],o[0]=((c=this.rules.inline._backpedal.exec(o[0]))==null?void 0:c[0])??"";while(h!==o[0]);u=o[0],o[1]==="www."?d="http://"+o[0]:d=o[0]}return{type:"link",raw:o[0],text:u,href:d,autolink:!0,tokens:[{type:"text",raw:u,text:u}]}}}inlineText(l){let o=this.rules.inline.text.exec(l);if(o){let c=this.lexer.state.inRawBlock;return{type:"text",raw:o[0],text:c?o[0]:IA(o[0]),escaped:c}}}},$c,p0,Ss,wa=(Ss=class{constructor(o){Ey(this,$c);kt(this,"tokens");kt(this,"options");kt(this,"state");kt(this,"inlineQueue");kt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=o||js,this.options.tokenizer=this.options.tokenizer||new Hc,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:gn,block:bc.normal,inline:vo.normal};this.options.pedantic?(c.block=bc.pedantic,c.inline=vo.pedantic):this.options.gfm&&(c.block=bc.gfm,this.options.breaks?c.inline=vo.breaks:c.inline=vo.gfm),this.tokenizer.rules=c}static get rules(){return{block:bc,inline:vo}}static lex(o,c){return new Ss(c).lex(o)}static lexInline(o,c){return new Ss(c).inlineTokens(o)}lex(o){o=o.replace(gn.carriageReturn,`
|
|
193
|
-
`),this.blockTokens(o,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(o,c=[],u=!1){var h,m,b;this.tokenizer.lexer=this,this.options.pedantic&&(o=o.replace(gn.tabCharGlobal," ").replace(gn.spaceLine,""));let d=1/0;for(;o;){if(o.length<d)d=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}let y;if((m=(h=this.options.extensions)==null?void 0:h.block)!=null&&m.some(g=>(y=g.call({lexer:this},o,c))?(o=o.substring(y.raw.length),c.push(y),!0):!1))continue;if(y=this.tokenizer.space(o)){o=o.substring(y.raw.length);let g=c.at(-1);y.raw.length===1&&g!==void 0?g.raw+=`
|
|
194
|
-
`:c.push(y);continue}if(y=this.tokenizer.code(o)){o=o.substring(y.raw.length);let g=c.at(-1);(g==null?void 0:g.type)==="paragraph"||(g==null?void 0:g.type)==="text"?(g.raw+=(g.raw.endsWith(`
|
|
195
|
-
`)?"":`
|
|
196
|
-
`)+y.raw,g.text+=`
|
|
197
|
-
`+y.text,this.inlineQueue.at(-1).src=g.text):c.push(y);continue}if(y=this.tokenizer.fences(o)){o=o.substring(y.raw.length),c.push(y);continue}if(y=this.tokenizer.heading(o)){o=o.substring(y.raw.length),c.push(y);continue}if(y=this.tokenizer.hr(o)){o=o.substring(y.raw.length),c.push(y);continue}if(y=this.tokenizer.blockquote(o)){o=o.substring(y.raw.length),c.push(y);continue}if(y=this.tokenizer.list(o)){o=o.substring(y.raw.length),c.push(y);continue}if(y=this.tokenizer.html(o)){o=o.substring(y.raw.length),c.push(y);continue}if(y=this.tokenizer.def(o)){o=o.substring(y.raw.length);let g=c.at(-1);(g==null?void 0:g.type)==="paragraph"||(g==null?void 0:g.type)==="text"?(g.raw+=(g.raw.endsWith(`
|
|
198
|
-
`)?"":`
|
|
199
|
-
`)+y.raw,g.text+=`
|
|
200
|
-
`+y.raw,this.inlineQueue.at(-1).src=g.text):this.tokens.links[y.tag]||(this.tokens.links[y.tag]={href:y.href,title:y.title},c.push(y));continue}if(y=this.tokenizer.table(o)){o=o.substring(y.raw.length),c.push(y);continue}if(y=this.tokenizer.lheading(o)){o=o.substring(y.raw.length),c.push(y);continue}let S=o;if((b=this.options.extensions)!=null&&b.startBlock){let g=1/0,v=o.slice(1),x;this.options.extensions.startBlock.forEach(k=>{x=k.call({lexer:this},v),typeof x=="number"&&x>=0&&(g=Math.min(g,x))}),g<1/0&&g>=0&&(S=o.substring(0,g+1))}if(this.state.top&&(y=this.tokenizer.paragraph(S))){let g=c.at(-1);u&&(g==null?void 0:g.type)==="paragraph"?(g.raw+=(g.raw.endsWith(`
|
|
201
|
-
`)?"":`
|
|
202
|
-
`)+y.raw,g.text+=`
|
|
203
|
-
`+y.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=g.text):c.push(y),u=S.length!==o.length,o=o.substring(y.raw.length);continue}if(y=this.tokenizer.text(o)){o=o.substring(y.raw.length);let g=c.at(-1);(g==null?void 0:g.type)==="text"?(g.raw+=(g.raw.endsWith(`
|
|
204
|
-
`)?"":`
|
|
205
|
-
`)+y.raw,g.text+=`
|
|
206
|
-
`+y.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=g.text):c.push(y);continue}if(o){this.infiniteLoopError(o.charCodeAt(0));break}}return this.state.top=!0,c}inline(o,c=[]){return this.inlineQueue.push({src:o,tokens:c}),c}linkInText(o){if(!o.includes("["))return!1;let c=this.tokenizer.rules.inline.link;for(let u of o.matchAll(this.tokenizer.rules.inline.blockSkip))if(c.test(u[0])&&o.charAt(u.index-1)!=="!")return!0;for(let u of o.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let d=u[0],h=d.lastIndexOf("[");if(!(d.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,Uc(d.slice(h+1,-1))))&&!(h>1&&this.linkInText(d.slice(1,h-1))))return!0}return!1}inlineTokens(o,c=[]){this.tokenizer.lexer=this;let u=this.state.linkParenPossible;this.state.linkParenPossible=u&&o.includes(")");try{return Cy(this,$c,p0).call(this,o,c)}finally{this.state.linkParenPossible=u}}infiniteLoopError(o){let c="Infinite loop on byte: "+o;if(this.options.silent)console.error(c);else throw new Error(c)}},$c=new WeakSet,p0=function(o,c){var b,y,S,g,v;let u=o;if(this.tokens.links&&o.includes("[")){let x=this.tokenizer.rules.inline.reflinkSearch,k=O=>{let Y=O.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,Uc(O.slice(Y+1,-1))))return O;if(Y>1&&O.charAt(0)!=="!"){let B=O.slice(1,Y-1);if(this.linkInText(B))return"["+B.replace(x,k)+"]["+"a".repeat(O.length-Y-2)+"]"}return"["+"a".repeat(O.length-2)+"]"};u=u.replace(x,k)}u=u.replace(this.tokenizer.rules.inline.anyPunctuation,x=>"+".repeat(x.length)),u=u.replace(this.tokenizer.rules.inline.blockSkip,(x,k,O)=>{let Y=O?O.length:0;return x.slice(0,Y)+"["+"a".repeat(x.length-Y-2)+"]"}),u=((y=(b=this.options.hooks)==null?void 0:b.emStrongMask)==null?void 0:y.call({lexer:this},u))??u;let d=!1,h="",m=1/0;for(;o;){if(o.length<m)m=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}d||(h=""),d=!1;let x;if((g=(S=this.options.extensions)==null?void 0:S.inline)!=null&&g.some(O=>(x=O.call({lexer:this},o,c))?(o=o.substring(x.raw.length),c.push(x),!0):!1))continue;if(x=this.tokenizer.escape(o)){o=o.substring(x.raw.length),c.push(x);continue}if(x=this.tokenizer.tag(o)){o=o.substring(x.raw.length),c.push(x);continue}if(x=this.tokenizer.link(o)){o=o.substring(x.raw.length),c.push(x);continue}if(x=this.tokenizer.reflink(o,this.tokens.links)){o=o.substring(x.raw.length);let O=c.at(-1);x.type==="text"&&(O==null?void 0:O.type)==="text"?(O.raw+=x.raw,O.text+=x.text):c.push(x);continue}if(x=this.tokenizer.emStrong(o,u,h)){o=o.substring(x.raw.length),c.push(x);continue}if(x=this.tokenizer.codespan(o)){o=o.substring(x.raw.length),c.push(x);continue}if(x=this.tokenizer.br(o)){o=o.substring(x.raw.length),c.push(x);continue}if(x=this.tokenizer.del(o,u,h)){o=o.substring(x.raw.length),c.push(x);continue}if(x=this.tokenizer.autolink(o)){o=o.substring(x.raw.length),c.push(x);continue}if(!this.state.inLink&&(x=this.tokenizer.url(o))){o=o.substring(x.raw.length),c.push(x);continue}let k=o;if((v=this.options.extensions)!=null&&v.startInline){let O=1/0,Y=o.slice(1),B;this.options.extensions.startInline.forEach(te=>{B=te.call({lexer:this},Y),typeof B=="number"&&B>=0&&(O=Math.min(O,B))}),O<1/0&&O>=0&&(k=o.substring(0,O+1))}if(x=this.tokenizer.inlineText(k)){o=o.substring(x.raw.length),x.raw.slice(-1)!=="_"&&(h=x.raw.slice(-1)),d=!0;let O=c.at(-1);(O==null?void 0:O.type)==="text"?(O.raw+=x.raw,O.text+=x.text):c.push(x);continue}if(o){this.infiniteLoopError(o.charCodeAt(0));break}}return c},Ss),Ic=class{constructor(l){kt(this,"options");kt(this,"parser");this.options=l||js}space(l){return""}code({text:l,lang:o,escaped:c}){var h;let u=(h=(o||"").match(gn.notSpaceStart))==null?void 0:h[0],d=l?l.replace(gn.endingNewline,"")+`
|
|
207
|
-
`:"";return u?'<pre><code class="language-'+Kn(u)+'">'+(c?d:Kn(d,!0))+`</code></pre>
|
|
208
|
-
`:"<pre><code>"+(c?d:Kn(d,!0))+`</code></pre>
|
|
209
|
-
`}blockquote({tokens:l}){return`<blockquote>
|
|
210
|
-
${this.parser.parse(l)}</blockquote>
|
|
211
|
-
`}html({text:l}){return l}def(l){return""}heading({tokens:l,depth:o}){return`<h${o}>${this.parser.parseInline(l)}</h${o}>
|
|
212
|
-
`}hr(l){return`<hr>
|
|
213
|
-
`}list(l){let o=l.ordered,c=l.start,u="";for(let m=0;m<l.items.length;m++){let b=l.items[m];u+=this.listitem(b)}let d=o?"ol":"ul",h=o&&c!==1?' start="'+c+'"':"";return"<"+d+h+`>
|
|
214
|
-
`+u+"</"+d+`>
|
|
215
|
-
`}listitem(l){return`<li>${this.parser.parse(l.tokens)}</li>
|
|
216
|
-
`}checkbox({checked:l}){return"<input "+(l?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:l}){return`<p>${this.parser.parseInline(l)}</p>
|
|
217
|
-
`}table(l){let o="",c="";for(let d=0;d<l.header.length;d++)c+=this.tablecell(l.header[d]);o+=this.tablerow({text:c});let u="";for(let d=0;d<l.rows.length;d++){let h=l.rows[d];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>
|
|
218
|
-
<thead>
|
|
219
|
-
`+o+`</thead>
|
|
220
|
-
`+u+`</table>
|
|
221
|
-
`}tablerow({text:l}){return`<tr>
|
|
222
|
-
${l}</tr>
|
|
223
|
-
`}tablecell(l){let o=this.parser.parseInline(l.tokens),c=l.header?"th":"td";return(l.align?`<${c} align="${l.align}">`:`<${c}>`)+o+`</${c}>
|
|
224
|
-
`}strong({tokens:l}){return`<strong>${this.parser.parseInline(l)}</strong>`}em({tokens:l}){return`<em>${this.parser.parseInline(l)}</em>`}codespan({text:l}){return`<code>${Kn(l,!0)}</code>`}br(l){return"<br>"}del({tokens:l}){return`<del>${this.parser.parseInline(l)}</del>`}link({href:l,title:o,text:c,tokens:u,autolink:d}){let h=d?Kn(c,!0):this.parser.parseInline(u),m=Py(l);if(m===null)return h;l=Kn(m,d);let b='<a href="'+l+'"';return o&&(b+=' title="'+Kn(o)+'"'),b+=">"+h+"</a>",b}image({href:l,title:o,text:c,tokens:u}){u&&(c=this.parser.parseInline(u,this.parser.textRenderer));let d=Py(l);if(d===null)return Kn(c);l=d;let h=`<img src="${Kn(l)}" alt="${Kn(c)}"`;return o&&(h+=` title="${Kn(o)}"`),h+=">",h}text(l){return"tokens"in l&&l.tokens?this.parser.parseInline(l.tokens):"escaped"in l&&l.escaped?l.text:Kn(l.text)}},kh=class{strong({text:l}){return l}em({text:l}){return l}codespan({text:l}){return l}del({text:l}){return l}html({text:l}){return l}text({text:l}){return l}link({text:l}){return""+l}image({text:l}){return""+l}br(){return""}checkbox({raw:l}){return l}},Aa=class Yf{constructor(o){kt(this,"options");kt(this,"renderer");kt(this,"textRenderer");this.options=o||js,this.options.renderer=this.options.renderer||new Ic,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new kh}static parse(o,c){return new Yf(c).parse(o)}static parseInline(o,c){return new Yf(c).parseInline(o)}parse(o){var u,d;this.renderer.parser=this;let c="";for(let h=0;h<o.length;h++){let m=o[h];if((d=(u=this.options.extensions)==null?void 0:u.renderers)!=null&&d[m.type]){let y=m,S=this.options.extensions.renderers[y.type].call({parser:this},y);if(S!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(y.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 y='Token with "'+b.type+'" type was not found.';if(this.options.silent)return console.error(y),"";throw new Error(y)}}}return c}parseInline(o,c=this.renderer){var d,h;this.renderer.parser=this;let u="";for(let m=0;m<o.length;m++){let b=o[m];if((h=(d=this.options.extensions)==null?void 0:d.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 y=b;switch(y.type){case"escape":{u+=c.text(y);break}case"html":{u+=c.html(y);break}case"link":{u+=c.link(y);break}case"image":{u+=c.image(y);break}case"checkbox":{u+=c.checkbox(y);break}case"strong":{u+=c.strong(y);break}case"em":{u+=c.em(y);break}case"codespan":{u+=c.codespan(y);break}case"br":{u+=c.br(y);break}case"del":{u+=c.del(y);break}case"text":{u+=c.text(y);break}default:{let S='Token with "'+y.type+'" type was not found.';if(this.options.silent)return console.error(S),"";throw new Error(S)}}}return u}},jc,No=(jc=class{constructor(l){kt(this,"options");kt(this,"block");this.options=l||js}preprocess(l){return l}postprocess(l){return l}processAllTokens(l){return l}emStrongMask(l){return l}provideLexer(l=this.block){return l?wa.lex:wa.lexInline}provideParser(l=this.block){return l?Aa.parse:Aa.parseInline}},kt(jc,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),kt(jc,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),jc),qA=class{constructor(...l){kt(this,"defaults",vh());kt(this,"options",this.setOptions);kt(this,"parse",this.parseMarkdown(!0));kt(this,"parseInline",this.parseMarkdown(!1));kt(this,"Parser",Aa);kt(this,"Renderer",Ic);kt(this,"TextRenderer",kh);kt(this,"Lexer",wa);kt(this,"Tokenizer",Hc);kt(this,"Hooks",No);this.use(...l)}walkTokens(l,o){var u,d;let c=[];for(let h of l)switch(c=c.concat(o.call(this,h)),h.type){case"table":{let m=h;for(let b of m.header)c=c.concat(this.walkTokens(b.tokens,o));for(let b of m.rows)for(let y of b)c=c.concat(this.walkTokens(y.tokens,o));break}case"list":{let m=h;c=c.concat(this.walkTokens(m.items,o));break}default:{let m=h;(d=(u=this.defaults.extensions)==null?void 0:u.childTokens)!=null&&d[m.type]?this.defaults.extensions.childTokens[m.type].forEach(b=>{let y=m[b].flat(1/0);c=c.concat(this.walkTokens(y,o))}):m.tokens&&(c=c.concat(this.walkTokens(m.tokens,o)))}}return c}use(...l){let o=this.defaults.extensions||{renderers:{},childTokens:{}};return l.forEach(c=>{let u={...c};if(u.async=this.defaults.async||u.async||!1,c.extensions&&(c.extensions.forEach(d=>{if(!d.name)throw new Error("extension name required");if("renderer"in d){let h=o.renderers[d.name];h?o.renderers[d.name]=function(...m){let b=d.renderer.apply(this,m);return b===!1&&(b=h.apply(this,m)),b}:o.renderers[d.name]=d.renderer}if("tokenizer"in d){if(!d.level||d.level!=="block"&&d.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let h=o[d.level];h?h.unshift(d.tokenizer):o[d.level]=[d.tokenizer],d.start&&(d.level==="block"?o.startBlock?o.startBlock.push(d.start):o.startBlock=[d.start]:d.level==="inline"&&(o.startInline?o.startInline.push(d.start):o.startInline=[d.start]))}"childTokens"in d&&d.childTokens&&(o.childTokens[d.name]=d.childTokens)}),u.extensions=o),c.renderer){let d=this.defaults.renderer||new Ic(this.defaults);for(let h in c.renderer){if(!(h in d))throw new Error(`renderer '${h}' does not exist`);if(["options","parser"].includes(h))continue;let m=h,b=c.renderer[m],y=d[m];d[m]=(...S)=>{let g=b.apply(d,S);return g===!1&&(g=y.apply(d,S)),g||""}}u.renderer=d}if(c.tokenizer){let d=this.defaults.tokenizer||new Hc(this.defaults);for(let h in c.tokenizer){if(!(h in d))throw new Error(`tokenizer '${h}' does not exist`);if(["options","rules","lexer"].includes(h))continue;let m=h,b=c.tokenizer[m],y=d[m];d[m]=(...S)=>{let g=b.apply(d,S);return g===!1&&(g=y.apply(d,S)),g}}u.tokenizer=d}if(c.hooks){let d=this.defaults.hooks||new No;for(let h in c.hooks){if(!(h in d))throw new Error(`hook '${h}' does not exist`);if(["options","block"].includes(h))continue;let m=h,b=c.hooks[m],y=d[m];No.passThroughHooks.has(h)?d[m]=S=>{if(this.defaults.async&&No.passThroughHooksRespectAsync.has(h))return(async()=>{let v=await b.call(d,S);return y.call(d,v)})();let g=b.call(d,S);return y.call(d,g)}:d[m]=(...S)=>{if(this.defaults.async)return(async()=>{let v=await b.apply(d,S);return v===!1&&(v=await y.apply(d,S)),v})();let g=b.apply(d,S);return g===!1&&(g=y.apply(d,S)),g}}u.hooks=d}if(c.walkTokens){let d=this.defaults.walkTokens,h=c.walkTokens;u.walkTokens=function(m){let b=[];return b.push(h.call(this,m)),d&&(b=b.concat(d.call(this,m))),b}}this.defaults={...this.defaults,...u}}),this}setOptions(l){return this.defaults={...this.defaults,...l},this}lexer(l,o){return wa.lex(l,o??this.defaults)}parser(l,o){return Aa.parse(l,o??this.defaults)}parseMarkdown(l){return(o,c)=>{let u={...c},d={...this.defaults,...u},h=this.onError(!!d.silent,!!d.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 o>"u"||o===null)return h(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return h(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"));if(d.hooks&&(d.hooks.options=d,d.hooks.block=l),d.async)return(async()=>{let m=d.hooks?await d.hooks.preprocess(o):o,b=await(d.hooks?await d.hooks.provideLexer(l):l?wa.lex:wa.lexInline)(m,d),y=d.hooks?await d.hooks.processAllTokens(b):b;d.walkTokens&&await Promise.all(this.walkTokens(y,d.walkTokens));let S=await(d.hooks?await d.hooks.provideParser(l):l?Aa.parse:Aa.parseInline)(y,d);return d.hooks?await d.hooks.postprocess(S):S})().catch(h);try{d.hooks&&(o=d.hooks.preprocess(o));let m=(d.hooks?d.hooks.provideLexer(l):l?wa.lex:wa.lexInline)(o,d);d.hooks&&(m=d.hooks.processAllTokens(m)),d.walkTokens&&this.walkTokens(m,d.walkTokens);let b=(d.hooks?d.hooks.provideParser(l):l?Aa.parse:Aa.parseInline)(m,d);return d.hooks&&(b=d.hooks.postprocess(b)),b}catch(m){return h(m)}}}onError(l,o){return c=>{if(c.message+=`
|
|
225
|
-
Please report this to https://github.com/markedjs/marked.`,l){let u="<p>An error occurred:</p><pre>"+Kn(c.message+"",!0)+"</pre>";return o?Promise.resolve(u):u}if(o)return Promise.reject(c);throw c}}},As=new qA;function wt(l,o){return As.parse(l,o)}wt.options=wt.setOptions=function(l){return As.setOptions(l),wt.defaults=As.defaults,i0(wt.defaults),wt};wt.getDefaults=vh;wt.defaults=js;function GA(...l){return As.use(...l),wt.defaults=As.defaults,i0(wt.defaults),wt}wt.use=GA;wt.walkTokens=function(l,o){return As.walkTokens(l,o)};wt.parseInline=As.parseInline;wt.Parser=Aa;wt.parser=Aa.parse;wt.Renderer=Ic;wt.TextRenderer=kh;wt.Lexer=wa;wt.lexer=wa.lex;wt.Tokenizer=Hc;wt.Hooks=No;wt.parse=wt;wt.options;wt.setOptions;wt.walkTokens;wt.parseInline;Aa.parse;wa.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 av(l,o){(o==null||o>l.length)&&(o=l.length);for(var c=0,u=Array(o);c<o;c++)u[c]=l[c];return u}function $A(l){if(Array.isArray(l))return l}function XA(l,o){var c=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(c!=null){var u,d,h,m,b=[],y=!0,S=!1;try{if(h=(c=c.call(l)).next,o!==0)for(;!(y=(u=h.call(c)).done)&&(b.push(u.value),b.length!==o);y=!0);}catch(g){S=!0,d=g}finally{try{if(!y&&c.return!=null&&(m=c.return(),Object(m)!==m))return}finally{if(S)throw d}}return b}}function YA(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
226
|
-
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 VA(l,o){return $A(l)||XA(l,o)||QA(l,o)||YA()}function QA(l,o){if(l){if(typeof l=="string")return av(l,o);var c={}.toString.call(l).slice(8,-1);return c==="Object"&&l.constructor&&(c=l.constructor.name),c==="Map"||c==="Set"?Array.from(l):c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?av(l,o):void 0}}const g0=Object.entries,lv=Object.setPrototypeOf,KA=Object.isFrozen,ZA=Object.getPrototypeOf,PA=Object.getOwnPropertyDescriptor;let tn=Object.freeze,rn=Object.seal,yi=Object.create,y0=typeof Reflect<"u"&&Reflect,Vf=y0.apply,Qf=y0.construct;tn||(tn=function(o){return o});rn||(rn=function(o){return o});Vf||(Vf=function(o,c){for(var u=arguments.length,d=new Array(u>2?u-2:0),h=2;h<u;h++)d[h-2]=arguments[h];return o.apply(c,d)});Qf||(Qf=function(o){for(var c=arguments.length,u=new Array(c>1?c-1:0),d=1;d<c;d++)u[d-1]=arguments[d];return new o(...u)});const bs=Ft(Array.prototype.forEach),FA=Ft(Array.prototype.lastIndexOf),sv=Ft(Array.prototype.pop),bo=Ft(Array.prototype.push),JA=Ft(Array.prototype.splice),bi=Array.isArray,Eo=Ft(String.prototype.toLowerCase),Ef=Ft(String.prototype.toString),iv=Ft(String.prototype.match),xo=Ft(String.prototype.replace),ov=Ft(String.prototype.indexOf),WA=Ft(String.prototype.trim),eT=Ft(Number.prototype.toString),tT=Ft(Boolean.prototype.toString),rv=typeof BigInt>"u"?null:Ft(BigInt.prototype.toString),cv=typeof Symbol>"u"?null:Ft(Symbol.prototype.toString),Ln=Ft(Object.prototype.hasOwnProperty),So=Ft(Object.prototype.toString),wn=Ft(RegExp.prototype.test),Gl=nT(TypeError);function Ft(l){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var c=arguments.length,u=new Array(c>1?c-1:0),d=1;d<c;d++)u[d-1]=arguments[d];return Vf(l,o,u)}}function nT(l){return function(){for(var o=arguments.length,c=new Array(o),u=0;u<o;u++)c[u]=arguments[u];return Qf(l,c)}}function ut(l,o){let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Eo;if(lv&&lv(l,null),!bi(o))return l;let u=o.length;for(;u--;){let d=o[u];if(typeof d=="string"){const h=c(d);h!==d&&(KA(o)||(o[u]=h),d=h)}l[d]=!0}return l}function aT(l){for(let o=0;o<l.length;o++)Ln(l,o)||(l[o]=null);return l}function Zn(l){const o=yi(null);for(const u of g0(l)){var c=VA(u,2);const d=c[0],h=c[1];Ln(l,d)&&(bi(h)?o[d]=aT(h):h&&typeof h=="object"&&h.constructor===Object?o[d]=Zn(h):o[d]=h)}return o}function lT(l){switch(typeof l){case"string":return l;case"number":return eT(l);case"boolean":return tT(l);case"bigint":return rv?rv(l):"0";case"symbol":return cv?cv(l):"Symbol()";case"undefined":return So(l);case"function":case"object":{if(l===null)return So(l);const o=l,c=ca(o,"toString");if(typeof c=="function"){const u=c(o);return typeof u=="string"?u:So(u)}return So(l)}default:return So(l)}}function ca(l,o){for(;l!==null;){const u=PA(l,o);if(u){if(u.get)return Ft(u.get);if(typeof u.value=="function")return Ft(u.value)}l=ZA(l)}function c(){return null}return c}function sT(l){try{return wn(l,""),!0}catch{return!1}}const uv=tn(["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"]),Cf=tn(["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"]),Mf=tn(["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"]),iT=tn(["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"]),_f=tn(["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"]),oT=tn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),dv=tn(["#text"]),fv=tn(["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"]),Rf=tn(["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"]),hv=tn(["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"]),xc=tn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),rT=rn(/{{[\w\W]*|^[\w\W]*}}/g),cT=rn(/<%[\w\W]*|^[\w\W]*%>/g),uT=rn(/\${[\w\W]*/g),dT=rn(/^data-[\-\w.\u00B7-\uFFFF]+$/),fT=rn(/^aria-[\-\w]+$/),mv=rn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),hT=rn(/^(?:\w+script|data):/i),mT=rn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),pT=rn(/^html$/i),gT=rn(/^[a-z][.\w]*(-[.\w]+)+$/i),pv=rn(/<[/\w!]/g),gv=rn(/<[/\w]/g),yT=rn(/<\/no(script|embed|frames)/i),vT=rn(/\/>/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},v0=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],bT=tn(ut({},v0)),xT=(function(){const l={};return bs(v0,o=>{l[o]=rn(new RegExp("</"+o+"(?=[\\t\\n\\f\\r />])","i"))}),tn(l)})(),ST=function(){return typeof window>"u"?null:window},wT=function(o,c){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let u=null;const d="data-tt-policy-suffix";c&&c.hasAttribute(d)&&(u=c.getAttribute(d));const h="dompurify"+(u?"#"+u:"");try{return o.createPolicy(h,{createHTML(m){return m},createScriptURL(m){return m}})}catch{return console.warn("TrustedTypes policy "+h+" could not be created."),null}},yv=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},$l=function(o,c,u,d){return Ln(o,c)&&bi(o[c])?ut(d.base?Zn(d.base):{},o[c],d.transform):u},Of=function(o,c,u){const d=Ln(o,c)?o[c]:void 0;return d&&typeof d=="object"?Zn(d):u()};function b0(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ST();const o=se=>b0(se);if(o.version="3.4.16",o.removed=[],!l||!l.document||l.document.nodeType!==Qn.document||!l.Element)return o.isSupported=!1,o;let c=l.document;const u=c,d=u.currentScript;l.DocumentFragment;const h=l.HTMLTemplateElement,m=l.Node,b=l.Element,y=l.NodeFilter;l.NamedNodeMap===void 0&&(l.NamedNodeMap||l.MozNamedAttrMap),l.HTMLFormElement;const S=l.DOMParser,g=l.trustedTypes,v=b.prototype,x=ca(v,"cloneNode"),k=ca(v,"remove"),O=ca(v,"removeAttributeNode"),Y=ca(v,"nextSibling"),B=ca(v,"childNodes"),te=ca(v,"parentNode"),re=ca(v,"shadowRoot"),fe=ca(v,"attributes"),E=m&&m.prototype?ca(m.prototype,"nodeType"):null,G=m&&m.prototype?ca(m.prototype,"nodeName"):null,U=m&&m.prototype?ca(m.prototype,"ownerDocument"):null,V=function(w){return E?E(w):w.nodeType},J=function(w){return G?G(w):w.nodeName};if(typeof h=="function"){const se=c.createElement("template");se.content&&se.content.ownerDocument&&(c=se.content.ownerDocument)}let oe,X="",K,Q=!1,me=0;const ce=function(){if(me>0)throw Gl('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.')},Ce=function(w){ce(),me++;try{return oe.createHTML(w)}finally{me--}},ae=function(w){ce(),me++;try{return oe.createScriptURL(w)}finally{me--}},W=function(){return Q||(K=wT(g,d),Q=!0),K},pe=c,F=pe.implementation,we=pe.createNodeIterator,nt=pe.createDocumentFragment,Lt=pe.getElementsByTagName,mt=u.importNode;let j=yv();o.isSupported=typeof g0=="function"&&typeof te=="function"&&F&&F.createHTMLDocument!==void 0;const ne=rT,Te=cT,ye=uT,Ie=dT,Oe=fT,Ne=hT,he=mT,be=gT;let gt=mv,H=null;const Me=ut({},[...uv,...Cf,...Mf,..._f,...dv]);let ke=null;const Be=ut({},[...fv,...Rf,...hv,...xc]);let _e=Object.seal(yi(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}})),le=null,Se=null;const xe=Object.seal(yi(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Xe=!0,$=!0,De=!1,Le=!0,dt=!1,Ze=!0,ft=!1,Ke=!1,$t=null,Fn=null,Ta=!1,Xt=!1,Rt=!1,Bt=!1,ka=!0,ua=!1;const da="user-content-";let Ot=!0,ja=!1,cn={},vn=null;const Un=ut({},["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 z=null;const de=ut({},["audio","video","img","source","image","track"]);let Ae=null;const Ue=ut({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ye="http://www.w3.org/1998/Math/MathML",qe="http://www.w3.org/2000/svg",Qe="http://www.w3.org/1999/xhtml";let yt=Qe,Jt=!1,N=null;const ee=ut({},[Ye,qe,Qe],Ef),ve=tn(["mi","mo","mn","ms","mtext"]);let je=ut({},ve);const We=tn(["annotation-xml"]);let et=ut({},We);const bn=ut({},["title","style","font","a","script"]);let Nt=null;const nn=["application/xhtml+xml","text/html"],Na="text/html";let At=null,En=null;const Jn=c.createElement("form"),Ns=function(w){return w instanceof RegExp||w instanceof Function},fa=function(){let w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(En&&En===w)return;(!w||typeof w!="object")&&(w={}),w=Zn(w),Nt=nn.indexOf(w.PARSER_MEDIA_TYPE)===-1?Na:w.PARSER_MEDIA_TYPE,At=Nt==="application/xhtml+xml"?Ef:Eo,H=$l(w,"ALLOWED_TAGS",Me,{transform:At}),ke=$l(w,"ALLOWED_ATTR",Be,{transform:At}),N=$l(w,"ALLOWED_NAMESPACES",ee,{transform:Ef}),Ae=$l(w,"ADD_URI_SAFE_ATTR",Ue,{transform:At,base:Ue}),z=$l(w,"ADD_DATA_URI_TAGS",de,{transform:At,base:de}),vn=$l(w,"FORBID_CONTENTS",Un,{transform:At}),le=$l(w,"FORBID_TAGS",Zn({}),{transform:At}),Se=$l(w,"FORBID_ATTR",Zn({}),{transform:At}),cn=Ln(w,"USE_PROFILES")?w.USE_PROFILES&&typeof w.USE_PROFILES=="object"?Zn(w.USE_PROFILES):w.USE_PROFILES:!1,Xe=w.ALLOW_ARIA_ATTR!==!1,$=w.ALLOW_DATA_ATTR!==!1,De=w.ALLOW_UNKNOWN_PROTOCOLS||!1,Le=w.ALLOW_SELF_CLOSE_IN_ATTR!==!1,dt=w.SAFE_FOR_TEMPLATES||!1,Ze=w.SAFE_FOR_XML!==!1,ft=w.WHOLE_DOCUMENT||!1,Xt=w.RETURN_DOM||!1,Rt=w.RETURN_DOM_FRAGMENT||!1,Bt=w.RETURN_TRUSTED_TYPE||!1,Ta=w.FORCE_BODY||!1,ka=w.SANITIZE_DOM!==!1,ua=w.SANITIZE_NAMED_PROPS||!1,Ot=w.KEEP_CONTENT!==!1,ja=w.IN_PLACE||!1,gt=sT(w.ALLOWED_URI_REGEXP)?w.ALLOWED_URI_REGEXP:mv,yt=typeof w.NAMESPACE=="string"?w.NAMESPACE:Qe,je=Of(w,"MATHML_TEXT_INTEGRATION_POINTS",()=>ut({},ve)),et=Of(w,"HTML_INTEGRATION_POINTS",()=>ut({},We));const D=Of(w,"CUSTOM_ELEMENT_HANDLING",()=>yi(null));if(_e=yi(null),Ln(D,"tagNameCheck")&&Ns(D.tagNameCheck)&&(_e.tagNameCheck=D.tagNameCheck),Ln(D,"attributeNameCheck")&&Ns(D.attributeNameCheck)&&(_e.attributeNameCheck=D.attributeNameCheck),Ln(D,"allowCustomizedBuiltInElements")&&typeof D.allowCustomizedBuiltInElements=="boolean"&&(_e.allowCustomizedBuiltInElements=D.allowCustomizedBuiltInElements),rn(_e),dt&&($=!1),Rt&&(Xt=!0),cn&&(H=ut({},dv),ke=yi(null),cn.html===!0&&(ut(H,uv),ut(ke,fv)),cn.svg===!0&&(ut(H,Cf),ut(ke,Rf),ut(ke,xc)),cn.svgFilters===!0&&(ut(H,Mf),ut(ke,Rf),ut(ke,xc)),cn.mathMl===!0&&(ut(H,_f),ut(ke,hv),ut(ke,xc))),xe.tagCheck=null,xe.attributeCheck=null,Ln(w,"ADD_TAGS")&&(typeof w.ADD_TAGS=="function"?xe.tagCheck=w.ADD_TAGS:bi(w.ADD_TAGS)&&(H===Me&&(H=Zn(H)),ut(H,w.ADD_TAGS,At))),Ln(w,"ADD_ATTR")&&(typeof w.ADD_ATTR=="function"?xe.attributeCheck=w.ADD_ATTR:bi(w.ADD_ATTR)&&(ke===Be&&(ke=Zn(ke)),ut(ke,w.ADD_ATTR,At))),Ln(w,"ADD_FORBID_CONTENTS")&&bi(w.ADD_FORBID_CONTENTS)&&(vn===Un&&(vn=Zn(vn)),ut(vn,w.ADD_FORBID_CONTENTS,At)),Ot&&(H["#text"]=!0),ft&&ut(H,["html","head","body"]),H.table&&(ut(H,["tbody"]),delete le.tbody),w.TRUSTED_TYPES_POLICY){if(typeof w.TRUSTED_TYPES_POLICY.createHTML!="function")throw Gl('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof w.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Gl('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const ie=oe;oe=w.TRUSTED_TYPES_POLICY;try{X=Ce("")}catch(ue){throw oe=ie,ue}}else w.TRUSTED_TYPES_POLICY===null?(oe=void 0,X=""):(oe===void 0&&(oe=W()),oe&&typeof X=="string"&&(X=Ce("")));tn&&tn(w),En=w},Ga=ut({},[...Cf,...Mf,...iT]),Kl=ut({},[..._f,...oT]),dl=function(w,D,ie){return D.namespaceURI===Qe?w==="svg":D.namespaceURI===Ye?w==="svg"&&(ie==="annotation-xml"||je[ie]):!!Ga[w]},fl=function(w,D,ie){return D.namespaceURI===Qe?w==="math":D.namespaceURI===qe?w==="math"&&et[ie]:!!Kl[w]},hl=function(w,D,ie){return D.namespaceURI===qe&&!et[ie]||D.namespaceURI===Ye&&!je[ie]?!1:!Kl[w]&&(bn[w]||!Ga[w])},$o=function(w){let D=te(w);(!D||!D.tagName)&&(D={namespaceURI:yt,tagName:"template"});const ie=Eo(w.tagName),ue=Eo(D.tagName);return N[w.namespaceURI]?w.namespaceURI===qe?dl(ie,D,ue):w.namespaceURI===Ye?fl(ie,D,ue):w.namespaceURI===Qe?hl(ie,D,ue):!!(Nt==="application/xhtml+xml"&&N[w.namespaceURI]):!1},an=function(w){bo(o.removed,{element:w});try{te(w).removeChild(w)}catch{if(k(w),!te(w))throw Gl("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Yt=function(w,D,ie){try{O(w,D)}catch{try{w.removeAttribute(ie)}catch{}}},Wt=function(w){Es(w);const D=B(w);if(D){const ue=[];bs(D,He=>{bo(ue,He)}),bs(ue,He=>{try{k(He)}catch{}})}const ie=fe(w);if(ie)for(let ue=ie.length-1;ue>=0;--ue){const He=ie[ue],Ge=He&&He.name;typeof Ge=="string"&&Yt(w,He,Ge)}},Cn=function(w,D,ie){if(!ie)try{ie=D.getAttributeNode(w)}catch{ie=null}bo(o.removed,{attribute:ie||null,from:D});try{ie?O(D,ie):D.removeAttribute(w)}catch{try{D.removeAttribute(w)}catch{}}if(w==="is")if(Xt||Rt)try{an(D)}catch{}else try{D.setAttribute(w,"")}catch{}},Xo=function(w){const D=fe(w);if(D)for(let ie=D.length-1;ie>=0;--ie){const ue=D[ie],He=ue&&ue.name;typeof He!="string"||ke[At(He)]||Yt(w,ue,He)}},Es=function(w){const D=[w];for(;D.length>0;){const ie=D.pop();V(ie)===Qn.element&&Xo(ie);const ue=B(ie);if(ue)for(let He=ue.length-1;He>=0;--He)D.push(ue[He])}},Yo=function(w,D){return Ze?w==="patchsrc"?!0:w==="for"&&D!=="label"&&D!=="output":!1},Vo=function(w){if(!Ze)return;const D=[w];for(;D.length>0;){const ie=D.pop(),ue=V(ie);if(ue===Qn.processingInstruction||ue===Qn.comment&&wn(gv,ie.data)){try{k(ie)}catch{}continue}if(ue===Qn.element){const Ge=ie,at=At(J(ie));try{Ge.hasAttribute&&Ge.hasAttribute("patchsrc")&&Ge.removeAttribute("patchsrc"),Ge.hasAttribute&&Ge.hasAttribute("for")&&Yo("for",at)&&Ge.removeAttribute("for")}catch{}}const He=B(ie);if(He)for(let Ge=He.length-1;Ge>=0;--Ge)D.push(He[Ge])}},ml=function(w){let D=null,ie=null;if(Ta)w="<remove></remove>"+w;else{const Ge=iv(w,/^[\r\n\t ]+/);ie=Ge&&Ge[0]}Nt==="application/xhtml+xml"&&yt===Qe&&(w='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+w+"</body></html>");const ue=oe?Ce(w):w;if(yt===Qe)try{D=new S().parseFromString(ue,Nt)}catch{}if(!D||!D.documentElement){D=F.createDocument(yt,"template",null);try{D.documentElement.innerHTML=Jt?X:ue}catch{}}const He=D.body||D.documentElement;return w&&ie&&He.insertBefore(c.createTextNode(ie),He.childNodes[0]||null),yt===Qe?Lt.call(D,ft?"html":"body")[0]:ft?D.documentElement:He},Zl=function(w){const D=U?U(w):w.ownerDocument;return we.call(D||w,w,y.SHOW_ELEMENT|y.SHOW_COMMENT|y.SHOW_TEXT|y.SHOW_PROCESSING_INSTRUCTION|y.SHOW_CDATA_SECTION,null)},$a=function(w){return w=xo(w,ne," "),w=xo(w,Te," "),w=xo(w,ye," "),w},ha=function(w){var D;w.normalize();const ie=U?U(w):w.ownerDocument,ue=we.call(ie||w,w,y.SHOW_TEXT|y.SHOW_COMMENT|y.SHOW_CDATA_SECTION|y.SHOW_PROCESSING_INSTRUCTION,null);let He=ue.nextNode();for(;He;)He.data=$a(He.data),He=ue.nextNode();const Ge=(D=w.querySelectorAll)===null||D===void 0?void 0:D.call(w,"template");Ge&&bs(Ge,at=>{Wn(at.content)&&ha(at.content)})},ma=function(w){const D=G?G(w):null;return typeof D!="string"||At(D)!=="form"?!1:typeof w.nodeName!="string"||typeof w.textContent!="string"||typeof w.removeChild!="function"||w.attributes!==fe(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!==E(w)||w.childNodes!==B(w)},Wn=function(w){if(!E||typeof w!="object"||w===null)return!1;try{return E(w)===Qn.documentFragment}catch{return!1}},ea=function(w){if(!E||typeof w!="object"||w===null)return!1;try{return typeof E(w)=="number"}catch{return!1}};function vt(se,w,D){se.length!==0&&bs(se,ie=>{ie.call(o,w,D,En)})}const Qo=function(w,D){return!!(Ze&&w.hasChildNodes()&&!ea(w.firstElementChild)&&wn(pv,w.textContent)&&wn(pv,w.innerHTML)||Ze&&w.namespaceURI===Qe&&bT[D]&&(ea(w.firstElementChild)||typeof w.textContent=="string"&&wn(xT[D],w.textContent))||w.nodeType===Qn.processingInstruction||Ze&&w.nodeType===Qn.comment&&wn(gv,w.data))},Pl=function(w,D){if(w instanceof RegExp)return wn(w,D);if(w instanceof Function){for(var ie=arguments.length,ue=new Array(ie>2?ie-2:0),He=2;He<ie;He++)ue[He-2]=arguments[He];return!!w(D,...ue)}return!1},Ko=function(w,D,ie){if(!le[D]&&Fo(D)&&Pl(_e.tagNameCheck,D))return!1;if(Ot&&!vn[D]){const ue=te(w),He=B(w);if(He&&ue){const Ge=He.length;for(let at=Ge-1;at>=0;--at){const Mt=w===ie?x(He[at],!0):He[at];ue.insertBefore(Mt,Y(w))}}}return an(w),!0},Ea=function(w,D,ie,ue){return w.length===0?D:D===ie||D===ue?Zn(D):D},Hn=function(w,D){return w===D||te(w)!==null?!1:(ja&&Es(w),!0)},Zo=function(w,D){if(vt(j.beforeSanitizeElements,w,null),Hn(w,D))return!0;if(ma(w))return an(w),!0;const ie=At(J(w));if(H=Ea(j.uponSanitizeElement,H,Me,$t),vt(j.uponSanitizeElement,w,{tagName:ie,allowedTags:H}),Hn(w,D))return!0;if(Qo(w,ie))return an(w),!0;if(le[ie]||!(xe.tagCheck instanceof Function&&xe.tagCheck(ie))&&!H[ie]){const ue=Ko(w,ie,D);return ue===!1&&(vt(j.afterSanitizeElements,w,null),Hn(w,D))?!0:ue}if(V(w)===Qn.element&&!$o(w)||(ie==="noscript"||ie==="noembed"||ie==="noframes")&&wn(yT,w.innerHTML))return an(w),!0;if(dt&&w.nodeType===Qn.text){const ue=$a(w.textContent);w.textContent!==ue&&(bo(o.removed,{element:w.cloneNode()}),w.textContent=ue)}return vt(j.afterSanitizeElements,w,null),Hn(w,D)},ji=function(w,D,ie){if(Se[D]||Yo(D,w)||ka&&(D==="id"||D==="name")&&(ie in c||ie in Jn))return!1;const ue=ke[D]||xe.attributeCheck instanceof Function&&xe.attributeCheck(D,w);return $&&wn(Ie,D)||Xe&&wn(Oe,D)?!0:ue?Ae[D]||wn(gt,xo(ie,he,""))||(D==="src"||D==="xlink:href"||D==="href")&&w!=="script"&&ov(ie,"data:")===0&&z[w]||De&&!wn(Ne,xo(ie,he,""))?!0:!ie:Fo(w)&&Pl(_e.tagNameCheck,w)&&Pl(_e.attributeNameCheck,D,w)||D==="is"&&_e.allowCustomizedBuiltInElements&&Pl(_e.tagNameCheck,ie)},Po=ut({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Fo=function(w){return!Po[Eo(w)]&&wn(be,w)},rt=function(w,D,ie,ue){if(oe&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!ie)switch(g.getAttributeType(w,D)){case"TrustedHTML":return Ce(ue);case"TrustedScriptURL":return ae(ue)}return ue},Jo=function(w,D,ie,ue){try{return ie?w.setAttributeNS(ie,D,ue):w.setAttribute(D,ue),ma(w)?(an(w),!1):!0}catch{return Cn(D,w),!1}},Fl=function(w,D){if(vt(j.beforeSanitizeAttributes,w,null),Hn(w,D))return;const ie=w.attributes;if(!ie||ma(w))return;ke=Ea(j.uponSanitizeAttribute,ke,Be,Fn);const ue={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ke,forceKeepAttr:void 0};let He=ie.length;const Ge=At(w.nodeName);for(;He--;){const at=ie[He],Mt=at.name,xn=at.namespaceURI,Vt=at.value,Ya=At(Mt),Cs=Vt;let Ut=Mt==="value"?Cs:WA(Cs),Wo=!1;if(ue.attrName=Ya,ue.attrValue=Ut,ue.keepAttr=!0,ue.forceKeepAttr=void 0,vt(j.uponSanitizeAttribute,w,ue),Ut=ue.attrValue,ua&&(Ya==="id"||Ya==="name")&&ov(Ut,da)!==0&&(Cn(Mt,w,at),Ut=da+Ut,Wo=!0),Ze&&wn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ut)){Cn(Mt,w,at);continue}if(Ya==="attributename"&&iv(Ut,"href")){Cn(Mt,w,at);continue}if(!ue.forceKeepAttr){if(!ue.keepAttr){Cn(Mt,w,at);continue}if(!Le&&wn(vT,Ut)){Cn(Mt,w,at);continue}if(dt&&(Ut=$a(Ut)),!ji(Ge,Ya,Ut)){Cn(Mt,w,at);continue}Ut=rt(Ge,Ya,xn,Ut),Ut!==Cs&&Jo(w,Mt,xn,Ut)&&Wo&&sv(o.removed)}}vt(j.afterSanitizeAttributes,w,null),Hn(w,D)},Xa=function(w){let D=null;const ie=Zl(w);for(vt(j.beforeSanitizeShadowDOM,w,null);D=ie.nextNode();)if(vt(j.uponSanitizeShadowNode,D,null),Zo(D,w),Fl(D,w),Wn(D.content)&&Xa(D.content),V(D)===Qn.element){const ue=re(D);Wn(ue)&&(In(ue),Xa(ue))}vt(j.afterSanitizeShadowDOM,w,null)},In=function(w){const D=[{node:w,shadow:null}];for(;D.length>0;){const ie=D.pop();if(ie.shadow){Xa(ie.shadow);continue}const ue=ie.node,He=V(ue)===Qn.element,Ge=B(ue);if(Ge)for(let at=Ge.length-1;at>=0;--at)D.push({node:Ge[at],shadow:null});if(He){const at=G?G(ue):null;if(typeof at=="string"&&At(at)==="template"){const Mt=ue.content;Wn(Mt)&&D.push({node:Mt,shadow:null})}}if(He){const at=re(ue);Wn(at)&&D.push({node:null,shadow:at},{node:at,shadow:null})}}};return o.sanitize=function(se){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},D=null,ie=null,ue=null,He=null;if(Jt=!se,Jt&&(se="<!-->"),typeof se!="string"&&!ea(se)&&(se=lT(se),typeof se!="string"))throw Gl("dirty is not a string, aborting");if(!o.isSupported)return se;Ke?(H=$t,ke=Fn):fa(w),(j.uponSanitizeElement.length>0||j.uponSanitizeAttribute.length>0)&&(H=Zn(H)),j.uponSanitizeAttribute.length>0&&(ke=Zn(ke)),o.removed=[];const Ge=ja&&typeof se!="string"&&ea(se);if(Ge){Vo(se);const xn=J(se);if(typeof xn=="string"){const Vt=At(xn);if(!H[Vt]||le[Vt])throw Wt(se),Gl("root node is forbidden and cannot be sanitized in-place")}if(ma(se))throw Wt(se),Gl("root node is clobbered and cannot be sanitized in-place");try{In(se)}catch(Vt){throw Wt(se),Vt}}else if(ea(se))D=ml("<!---->"),ie=D.ownerDocument.importNode(se,!0),ie.nodeType===Qn.element&&ie.nodeName==="BODY"||ie.nodeName==="HTML"?D=ie:D.appendChild(ie),In(D);else{if(!Xt&&!dt&&!ft&&se.indexOf("<")===-1)return oe&&Bt?Ce(se):se;if(D=ml(se),!D)return Xt?null:Bt?X:""}D&&Ta&&an(D.firstChild);const at=Ge?se:D;try{const xn=Zl(at);for(;ue=xn.nextNode();)Zo(ue,at),Fl(ue,at),Wn(ue.content)&&Xa(ue.content)}catch(xn){throw Ge&&(Wt(se),bs(o.removed,Vt=>{Vt.element&&Es(Vt.element)})),xn}if(Ge){let xn=!1;if(bs(o.removed,Vt=>{Vt.element&&(Vt.element===se&&(xn=!0),Es(Vt.element))}),xn)throw Gl("a node selected for removal could not be safely returned; refusing to sanitize in place");return dt&&ha(se),se}if(Xt){if(dt&&ha(D),Rt)for(He=nt.call(D.ownerDocument);D.firstChild;)He.appendChild(D.firstChild);else He=D;return(ke.shadowroot||ke.shadowrootmode)&&(He=mt.call(u,He,!0)),He}let Mt=ft?D.outerHTML:D.innerHTML;return ft&&H["!doctype"]&&D.ownerDocument&&D.ownerDocument.doctype&&D.ownerDocument.doctype.name&&wn(pT,D.ownerDocument.doctype.name)&&(Mt="<!DOCTYPE "+D.ownerDocument.doctype.name+`>
|
|
227
|
-
`+Mt),dt&&(Mt=$a(Mt)),oe&&Bt?Ce(Mt):Mt},o.setConfig=function(){let se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};fa(se),Ke=!0,$t=H,Fn=ke},o.clearConfig=function(){En=null,Ke=!1,$t=null,Fn=null,oe=K,X=""},o.isValidAttribute=function(se,w,D){En||fa({});const ie=At(se),ue=At(w);return ji(ie,ue,D)},o.addHook=function(se,w){typeof w=="function"&&Ln(j,se)&&bo(j[se],w)},o.removeHook=function(se,w){if(Ln(j,se)){if(w!==void 0){const D=FA(j[se],w);return D===-1?void 0:JA(j[se],D,1)[0]}return sv(j[se])}},o.removeHooks=function(se){Ln(j,se)&&(j[se]=[])},o.removeAllHooks=function(){j=yv()},o}var x0=b0();let jh=[],Qc="";function AT(l,o=[]){Qc=l,jh=[l,...o].filter(Boolean)}const TT=()=>jh,kT=()=>Qc,jT=l=>l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),NT=l=>l.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");function ET(l,o=Qc){return`/api/agent/file?directory=${encodeURIComponent(o)}&path=${encodeURIComponent(l)}`}function CT(l){if(!l.length)return null;const o=l.map(c=>jT(c.replace(/[\\/]+$/,"")).replace(/\\\\|\//g,"[\\\\/]")).join("|");return new RegExp(`(?:${o})(?:[\\\\/][^\\s"'<>\`()\\[\\]{}|]*?)+?\\.[A-Za-z0-9]{1,8}(?=[\\s"'<>\`()\\[\\]{}|.,;:!?]|$)`,"g")}function MT(l,o=jh,c=Qc){const u=CT(o);if(!u)return l;let d=0;return l.split(/(<[^>]+>)/).map(h=>h.startsWith("<")?(/^<a[\s>]/i.test(h)?d++:/^<\/a>/i.test(h)&&(d=Math.max(0,d-1)),h):d||!h?h:h.replace(u,m=>`<a class="file-link" href="${ET(_T(m),c)}" download title="Download ${NT(m)}">${m}</a>`)).join("")}function _T(l){return l.replace(/"/g,'"').replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}wt.setOptions({gfm:!0,breaks:!1});const RT=[];x0.addHook("afterSanitizeAttributes",l=>{l.tagName==="A"&&(l.setAttribute("target","_blank"),l.setAttribute("rel","noopener noreferrer"))});function Bc({text:l,className:o="",files:c=!1}){const u=c?TT():RT,d=c?kT():"",h=mh(),m=A.useMemo(()=>{const b=x0.sanitize(wt.parse(l,{async:!1}));return Cw(c?MT(b,u,d):b,h)},[l,c,u,d,h]);return i.jsx("div",{className:"md "+o,dangerouslySetInnerHTML:{__html:m}})}const OT=/^ {0,3}(`{3,}|~{3,})[ \t]*(?:drawio|drawgen)\b[^\n]*$/i;function DT(l){const o=l.split(`
|
|
228
|
-
`),c=[];let u=[];const d=()=>{u.join(`
|
|
229
|
-
`).trim()&&c.push({type:"md",text:u.join(`
|
|
230
|
-
`)}),u=[]};for(let h=0;h<o.length;h++){const m=o[h].match(OT);if(!m){u.push(o[h]);continue}const b=m[1],y=new RegExp(`^ {0,3}${b[0]==="`"?"`":"~"}{${b.length},}[ \\t]*$`),S=[];let g=h+1;for(;g<o.length&&!y.test(o[g]);)S.push(o[g++]);d(),c.push({type:"drawio",spec:S.join(`
|
|
231
|
-
`),closed:g<o.length}),h=g}return d(),c}function LT(l,o){return["The diagram renderer reported these problems with your drawio spec:",...(l?l.split(`
|
|
232
|
-
`).filter(Boolean):o.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(`
|
|
233
|
-
`)}const zT=l=>l.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,48)||"diagram",wo=new Map;let UT=null;const S0=()=>UT??(UT=fetch("/api/render/status").then(l=>l.json()).then(l=>!!(l!=null&&l.ok)).catch(()=>!1));function w0(l){const o=typeof l=="string"?l:JSON.stringify(l);let c=wo.get(o);return c||(c=fetch("/api/render/drawio",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({spec:l})}).then(async u=>{var h;const d=await u.json().catch(()=>({}));return u.ok?{ok:!0,r:d}:{ok:!1,error:((h=d==null?void 0:d.error)==null?void 0:h.message)||`Rendering failed (${u.status})`}}).catch(u=>({ok:!1,error:String((u==null?void 0:u.message)??u)})),wo.set(o,c),wo.size>60&&wo.delete(wo.keys().next().value)),c}function vv(l,o,c){const u=URL.createObjectURL(new Blob([o],{type:c}));Object.assign(document.createElement("a"),{href:u,download:l}).click(),setTimeout(()=>URL.revokeObjectURL(u),1e3)}function HT({text:l,streaming:o,onFix:c}){const u=A.useMemo(()=>DT(l),[l]);return u.length===1&&u[0].type==="md"?i.jsx(Bc,{text:l}):i.jsx(i.Fragment,{children:u.map((d,h)=>d.type==="md"?i.jsx(Bc,{text:d.text},h):i.jsx(IT,{spec:d.spec,pending:!d.closed&&o,onFix:c},h))})}function IT({spec:l,pending:o,onFix:c}){const[u,d]=A.useState(null),[h,m]=A.useState(null),[b,y]=A.useState(!1);A.useEffect(()=>{S0().then(d)},[]),A.useEffect(()=>{if(o||!u||!l.trim())return;let k=!0;return m(null),w0(l).then(O=>k&&m(O)),()=>{k=!1}},[l,o,u]);const S=A.useMemo(()=>h!=null&&h.ok?URL.createObjectURL(new Blob([h.r.svg],{type:"image/svg+xml"})):null,[h]);A.useEffect(()=>()=>{S&&URL.revokeObjectURL(S)},[S]);const g=i.jsx("pre",{className:"diagram-spec",children:i.jsx("code",{children:l})});if(o)return i.jsxs("div",{className:"diagram-card",children:[i.jsxs("div",{className:"diagram-head",children:[i.jsx("span",{className:"diagram-tag",children:"drawio"})," drawing…"]}),g]});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)."]}),g]});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?zT(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(k=>`${k.severity} ${k.code} ${k.cell}: ${k.message}`).join(`
|
|
234
|
-
`),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:()=>vv(`${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:()=>vv(`${x}.drawio`,h.r.xml,"application/xml"),children:".drawio"}),i.jsx("button",{className:"btn ghost sm",onClick:()=>y(k=>!k),children:b?"hide spec":"spec"}),c&&(!h.ok||v.length>0)&&i.jsx("button",{className:"btn sm",onClick:()=>c(LT(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&&g]})}function BT({config:l,activeModel:o,messages:c,busy:u,error:d,onSend:h,onStop:m,onReset:b,onToolResult:y,onCompare:S,onCanvas:g}){var ae;const[v,x]=A.useState(""),k=gh(),O=k.images,[Y,B]=A.useState(!1),te=A.useRef(null),re=A.useRef(null),fe=A.useRef(null),E=A.useRef(null),G=((ae=o==null?void 0:o.input_modalities)==null?void 0:ae.includes("image"))??!1,U=O.length>0&&!G;A.useEffect(()=>{const W=fe.current;W&&(W.style.height="auto",W.style.height=Math.min(W.scrollHeight,260)+"px")},[v]);function V(W){var F;W.target.closest("button, select, input, textarea, a")||(F=fe.current)==null||F.focus()}function J(){var pe;if(Y){(pe=te.current)==null||pe.stop();return}const W=Dv({onStart:()=>B(!0),onEnd:()=>{B(!1),te.current=null},onPartial:F=>x(F)});te.current=W}A.useEffect(()=>{var W;(W=re.current)==null||W.scrollTo({top:re.current.scrollHeight,behavior:"smooth"})},[c]);function oe(){!v.trim()&&!O.length&&!k.docs.length||u||U||k.reading||(h(v,O.length?O:void 0,k.docs.length?k.docs:void 0),x(""),k.clear())}function X(W){W.key==="Enter"&&!W.shiftKey&&(W.preventDefault(),oe())}const K=c.filter(W=>W.role!=="system"),Q=(o==null?void 0:o.name)??l.model,me=t0(l.system),ce=(me==null?void 0:me.starters)??Nw;function Ce(W){x(W),requestAnimationFrame(()=>{const pe=fe.current;pe&&(pe.focus(),pe.setSelectionRange(W.length,W.length))})}return i.jsxs("main",{className:"main",children:[i.jsxs(Ho,{title:`bugxhunter@playground: ~/${Q}`,children:[i.jsxs("span",{className:"status-pill"+(u?" live":""),children:[i.jsx("span",{className:"dot"}),u?l.stream?"streaming":"thinking":"ready"]}),i.jsx("button",{className:"btn ghost sm",onClick:g,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:re,children:i.jsxs("div",{className:"transcript-inner",children:[K.length===0&&i.jsxs("div",{className:"empty-state",children:[i.jsx(Lv,{lines:[{kind:"p",text:`./bxh --playground --model ${Q}`,pace:26},{kind:"out",text:"Direct model access: no agent, no file system."},{kind:"out",text:me?`Preset: ${me.label}.${G?" 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"}]},Q),i.jsx("div",{className:"suggestions",children:ce.map(W=>i.jsx("button",{className:"chip",onClick:()=>Ce(W),title:"Puts this in the message box",children:W.trim()},W))})]}),K.map((W,pe)=>i.jsx(qT,{msg:W,streaming:u&&pe===K.length-1,onToolResult:y,onFix:u?void 0:F=>h(F)},pe)),d&&i.jsx("div",{className:"error-banner",children:d})]})}),i.jsxs("div",{className:"composer",children:[i.jsxs("div",{className:"composer-box",onClick:V,onDragOver:W=>W.preventDefault(),onDrop:k.onDrop,children:[i.jsx(yh,{images:O,docs:k.docs,reading:k.reading,onRemove:k.remove,onRemoveDoc:k.removeDoc}),i.jsx("textarea",{ref:fe,value:v,onChange:W=>x(W.target.value),onKeyDown:X,onPaste:k.onPaste,rows:3,placeholder:Y?"Listening…":G?`Message ${Q}… (attach, paste or drop an image or a .drawio file to review)`:`Message ${Q}… (attach or drop a .drawio file to review a diagram)`}),i.jsxs("div",{className:"composer-bar",children:[i.jsx("input",{ref:E,type:"file",accept:ph,multiple:!0,hidden:!0,onChange:W=>{W.target.files&&k.addImages(W.target.files),W.target.value=""}}),i.jsx("button",{className:"icon-btn attach-btn",onClick:()=>{var W;return(W=E.current)==null?void 0:W.click()},disabled:u,title:G?"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(Vc,{})}),!U&&!k.attachError&&k.docs.length>0&&l.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 ",l.maxTokens.toLocaleString(),"."]}),(U||k.attachError)&&i.jsx("span",{className:"hint",style:{color:"var(--amber)",margin:"0 8px"},children:U?`${Q} can't see images — pick a vision model (e.g. Nemotron 3.5 Super VL)`:k.attachError}),i.jsx("div",{className:"spacer"}),th()&&i.jsx("button",{className:"send-btn mic"+(Y?" stop":""),onClick:J,title:Y?"Stop dictation":"Dictate",children:Y?"●":"🎤"}),u?i.jsx("button",{className:"send-btn stop",onClick:m,title:"Stop",children:"■"}):i.jsx("button",{className:"send-btn",onClick:oe,disabled:!v.trim()&&!O.length||U,title:"Send",children:"↑"})]})]}),i.jsx("div",{className:"composer-hint",children:"Enter to send · Shift+Enter for a new line"})]})]})}function qT({msg:l,streaming:o,onToolResult:c,onFix:u}){var m,b,y,S,g;const d=l.role==="user";return l.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:i.jsx(s0,{text:String(l.content??"")})})]})})]}):d?i.jsx("div",{className:"msg user",children:i.jsxs("div",{className:"bubble user-bubble",children:[l.content,(m=l.images)!=null&&m.length?i.jsx("div",{className:"bubble-images",children:l.images.map((v,x)=>i.jsx("img",{src:v.url,alt:v.name,title:v.name},x))}):null,(b=l.docs)!=null&&b.length?i.jsx("div",{className:"attach-row bubble-docs",children:l.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:[l.content?i.jsx(HT,{text:l.content,streaming:o,onFix:u}):null,o&&!l.tool_calls&&i.jsx("span",{className:"cursor"}),(y=l.tool_calls)==null?void 0:y.map(v=>i.jsx(GT,{call:v,onResult:c},v.id))]}),l.sources&&l.sources.length>0&&i.jsxs("div",{className:"sources",children:[i.jsx("span",{className:"sources-label",children:"grounded in"}),l.sources.map((v,x)=>i.jsx("span",{className:"badge on",title:`similarity ${v.score}`,children:v.doc},x))]}),(l.usage||l.timing)&&i.jsxs("div",{className:"msg-meta",children:[l.timing&&Kv(l.timing,(S=l.usage)==null?void 0:S.completion,(g=l.usage)==null?void 0:g.reasoning),l.timing&&l.usage&&" · ",l.usage&&i.jsxs(i.Fragment,{children:[l.usage.prompt??0," in · ",l.usage.completion??0," out",l.usage.reasoning?` · ${l.usage.reasoning} reasoning`:""," tokens"]})]})]})]})}function GT({call:l,onResult:o}){const[c,u]=A.useState(""),[d,h]=A.useState(!1);let m=l.function.arguments;try{m=JSON.stringify(JSON.parse(l.function.arguments),null,2)}catch{}return i.jsxs("div",{className:"tool-call",children:[i.jsxs("span",{className:"tc-name",children:[l.function.name,"()"]}),i.jsx("pre",{children:m}),d?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:()=>{o(l,c),h(!0)},children:"Submit result & continue"})]})]})}function $T(l,o){if(!(o!=null&&o.length))return l;const c=o.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.
|
|
235
|
-
|
|
236
|
-
<diagram file="${u.name.replace(/"/g,"'")}">
|
|
237
|
-
${u.text.trimEnd()}
|
|
238
|
-
</diagram>`);return[(l==null?void 0:l.trim())||"Review this diagram for security issues.",...c].join(`
|
|
239
|
-
|
|
240
|
-
`)}function Nh(l,o,c){const u=$T(l,c);return o!=null&&o.length?[{type:"text",text:(u==null?void 0:u.trim())||"Describe this image."},...o.map(d=>({type:"image_url",image_url:{url:d.url}}))]:u}const XT=3,YT={scx:"SCX.ai",anthropic:"Anthropic",nvidia:"NVIDIA NIM",openrouter:"OpenRouter"},Ao=l=>({model:l,text:"",busy:!1,error:null});function bv(l,o){var d;const c=l.find(h=>h.id===o[0]),u=l.filter(h=>!o.includes(h.id));return(d=u.find(h=>(h.provider??"scx")!==((c==null?void 0:c.provider)??"scx"))??u[0])==null?void 0:d.id}function VT({config:l,models:o,onExit:c}){const u=o.filter(Lc),[d,h]=A.useState(()=>[l.model,bv(u,[l.model])].filter(E=>!!E).map(Ao)),[m,b]=A.useState(""),[y,S]=A.useState(null),g=gh(),v=A.useRef(null),x=A.useRef([]),k=d.some(E=>E.busy),O=(E,G)=>h(U=>U.map((V,J)=>J===E?{...V,...G}:V));function Y(){x.current.forEach(E=>E.abort()),x.current=[]}function B(){if(!m.trim()&&!g.images.length&&!g.docs.length||k||g.reading)return;Y();const E=g.images,G=[...l.system.trim()?[{role:"system",content:l.system}]:[],{role:"user",content:Nh(m,E,g.docs)}],U=[E.length?`${E.length} image${E.length>1?"s":""}`:"",...g.docs.map(V=>V.name)].filter(Boolean);S((m.trim()||(g.docs.length?"Review this diagram for security issues.":"Describe this image."))+(U.length?` [+${U.join(", ")}]`:"")),x.current=d.map(()=>new AbortController),d.forEach((V,J)=>{var Q,me;const oe=o.find(ce=>ce.id===V.model);if(E.length&&!((Q=oe==null?void 0:oe.input_modalities)!=null&&Q.includes("image"))){h(ce=>ce.map((Ce,ae)=>ae===J?{...Ao(Ce.model),skipped:"This model can't see images, so it was skipped."}:Ce));return}h(ce=>ce.map((Ce,ae)=>ae===J?{...Ao(Ce.model),busy:!0}:Ce));const X=performance.now();let K;eh({model:V.model,messages:G,temperature:l.temperature,top_p:l.topP,max_tokens:l.maxTokens,response_format:l.jsonMode?{type:"json_object"}:void 0,stream:l.stream},{signal:(me=x.current[J])==null?void 0:me.signal,onDelta:ce=>{K??(K=performance.now()-X),h(Ce=>Ce.map((ae,W)=>W===J?{...ae,text:ae.text+ce}:ae))},onUsage:ce=>O(J,{usage:ce}),onError:ce=>O(J,{error:ce}),onDone:()=>O(J,{timing:{ttft:K,total:performance.now()-X}})}).catch(ce=>{(ce==null?void 0:ce.name)!=="AbortError"&&O(J,{error:String((ce==null?void 0:ce.message)??ce)})}).finally(()=>O(J,{busy:!1}))}),b(""),g.clear()}function te(E){E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),B())}const re=["scx","anthropic","nvidia","openrouter"].map(E=>[E,u.filter(G=>(G.provider??"scx")===E)]).filter(([,E])=>E.length>0),fe=d.some(E=>{var G,U;return(U=(G=o.find(V=>V.id===E.model))==null?void 0:G.input_modalities)==null?void 0:U.includes("image")});return i.jsxs("main",{className:"main",children:[i.jsxs(Ho,{title:`bugxhunter@playground: ~/compare (${d.length} models)`,children:[i.jsxs("span",{className:"status-pill"+(k?" live":""),children:[i.jsx("span",{className:"dot"}),k?"running":"ready"]}),d.length<XT&&i.jsx("button",{className:"btn ghost sm",disabled:k,onClick:()=>h(E=>[...E,Ao(bv(u,E.map(G=>G.model))??l.model)]),children:"+ model"}),i.jsx("button",{className:"btn ghost sm",onClick:()=>{Y(),c()},children:"back to chat"})]}),i.jsxs("div",{className:"transcript grid-bg",children:[y&&i.jsxs("div",{className:"compare-prompt mono",children:["$ ",y]}),i.jsx("div",{className:"compare-grid",style:{"--cols":d.length},children:d.map((E,G)=>{var U,V;return i.jsxs("section",{className:"compare-col",children:[i.jsxs("div",{className:"compare-head",children:[i.jsxs("select",{value:E.model,disabled:k,onChange:J=>O(G,{...Ao(J.target.value)}),"aria-label":`Model ${G+1}`,children:[!u.some(J=>J.id===E.model)&&i.jsx("option",{value:E.model,children:E.model}),re.map(([J,oe])=>i.jsx("optgroup",{label:YT[J],children:oe.map(X=>{var K;return i.jsxs("option",{value:X.id,children:[X.name,(K=X.input_modalities)!=null&&K.includes("image")?" · vision":""]},X.id)})},J))]}),d.length>1&&i.jsx("button",{className:"attach-x",disabled:k,onClick:()=>h(J=>J.filter((oe,X)=>X!==G)),"aria-label":"Remove this model",children:"✕"})]}),i.jsxs("div",{className:"compare-body",children:[E.skipped&&i.jsx("div",{className:"hint",style:{color:"var(--amber)"},children:E.skipped}),E.error&&i.jsx("div",{className:"error-banner",children:E.error}),E.text&&i.jsx(Bc,{text:E.text}),E.busy&&i.jsx("span",{className:"cursor"}),!E.text&&!E.busy&&!E.skipped&&!E.error&&i.jsx("p",{className:"muted mono",style:{margin:0},children:y?"No answer.":"Waiting for a prompt…"})]}),(E.timing||E.usage)&&i.jsxs("div",{className:"msg-meta",children:[E.timing&&Kv(E.timing,(U=E.usage)==null?void 0:U.completion,(V=E.usage)==null?void 0:V.reasoning),E.usage&&`${E.timing?" · ":""}${E.usage.prompt??0} in · ${E.usage.completion??0} out tokens`]})]},G)})})]}),i.jsxs("div",{className:"composer",children:[i.jsxs("div",{className:"composer-box",onDragOver:E=>E.preventDefault(),onDrop:g.onDrop,children:[i.jsx(yh,{images:g.images,docs:g.docs,reading:g.reading,onRemove:g.remove,onRemoveDoc:g.removeDoc}),i.jsx("textarea",{value:m,onChange:E=>b(E.target.value),onKeyDown:te,onPaste:g.onPaste,rows:3,placeholder:`Ask all ${d.length} models the same thing…${fe?" (images go to the vision models)":""}`}),i.jsxs("div",{className:"composer-bar",children:[i.jsx("input",{ref:v,type:"file",accept:ph,multiple:!0,hidden:!0,onChange:E=>{E.target.files&&g.addImages(E.target.files),E.target.value=""}}),i.jsx("button",{className:"icon-btn attach-btn",onClick:()=>{var E;return(E=v.current)==null?void 0:E.click()},disabled:k,title:"Attach images (or paste / drop them)","aria-label":"Attach images",children:i.jsx(Vc,{})}),g.attachError&&i.jsx("span",{className:"hint",style:{color:"var(--amber)",margin:"0 8px"},children:g.attachError}),i.jsx("div",{className:"spacer"}),k?i.jsx("button",{className:"send-btn stop",onClick:Y,title:"Stop all",children:"■"}):i.jsx("button",{className:"send-btn",onClick:B,disabled:!m.trim()&&!g.images.length&&!g.docs.length||g.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 Ai=["data","management","attestation","identity","control","blocked"],zo={data:"Data",management:"Management",attestation:"Attestation / evidence",identity:"Identity / credential",control:"Control / config",blocked:"Blocked"},QT=["actor","service","ai","datastore","external"],A0=["critical","high","medium","low"],qc={critical:0,high:1,medium:2,low:3},Sc=()=>({title:"Untitled threat model",nodes:[],edges:[]}),_t=(l,o="")=>typeof l=="string"?l.trim():o,Co=l=>l.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,40)||"node";function KT(l){const o=_t(l).toLowerCase();return QT.includes(o)?o:/user|client|admin|customer|attacker|person|internet/.test(o)?"actor":/\b(ai|llm|model|agent|copilot|assistant|rag|retriev|inference|embedding)/.test(o)?"ai":/db|database|store|bucket|storage|cache|queue|file|repo|config|secret/.test(o)?"datastore":/third|external|saas|vendor|partner/.test(o)?"external":"service"}function ZT(l,o){const c=_t(l).toLowerCase();return Ai.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(o)?"blocked":"data"}function xv(l,o){return(Array.isArray(l)?l:[]).flatMap((c,u)=>{if(!c||typeof c!="object")return[];const d=c,h=_t(d.title)||_t(d.issue)||_t(d.name);if(!h)return[];const m=_t(d.status).toLowerCase();return[{id:`${o}-f${u+1}`,title:h,severity:PT(d.severity),fix:_t(d.fix)||_t(d.mitigation)||void 0,ref:_t(d.ref)||_t(d.cwe)||void 0,status:m==="fixed"||m==="verified"?m:"open"}]})}function PT(l){const o=_t(l).toLowerCase();return A0.includes(o)?o:o.startsWith("crit")||o==="p1"?"critical":o.startsWith("hi")||o==="p2"?"high":o.startsWith("lo")||o==="p4"||o==="p5"||o.startsWith("info")?"low":"medium"}function FT(l){const o=l.match(/```(?:json)?\s*([\s\S]*?)```/i),c=o?o[1]:l,u=c.indexOf("{"),d=c.lastIndexOf("}");if(u<0||d<=u)throw new Error("No JSON object in the model's reply.");return JSON.parse(c.slice(u,d+1))}function To(l){if(!l||typeof l!="object")throw new Error("Threat model must be a JSON object.");const o=l,c=new Set,u=b=>{let y=b;for(let S=2;c.has(y);S++)y=`${b}-${S}`;return c.add(y),y},d=new Map,h=(Array.isArray(o.nodes)?o.nodes:[]).flatMap((b,y)=>{if(!b||typeof b!="object")return[];const S=b,g=_t(S.label)||_t(S.name)||`Component ${y+1}`,v=_t(S.id)||Co(g),x=u(Co(v));d.has(v)||d.set(v,x),d.has(g)||d.set(g,x);const k=xv(S.findings,x);return[{id:x,label:g,kind:KT(S.kind??S.type),details:(Array.isArray(S.details)?S.details:[]).map(O=>_t(O)).filter(Boolean).slice(0,8),inScope:S.inScope!==!1,tested:S.tested===!0,findings:k,x:typeof S.x=="number"?S.x:void 0,y:typeof S.y=="number"?S.y:void 0}]}),m=(Array.isArray(o.edges)?o.edges:[]).flatMap((b,y)=>{if(!b||typeof b!="object")return[];const S=b,g=d.get(_t(S.from))??d.get(Co(_t(S.from))),v=d.get(_t(S.to))??d.get(Co(_t(S.to)));if(!g||!v||g===v)return[];let x=_t(S.label);const k=/\s*\(implied\)\s*$/i.test(x);k&&(x=x.replace(/\s*\(implied\)\s*$/i,""));const O=`e${y+1}`;return[{id:O,from:g,to:v,label:x||_t(S.protocol)||void 0,kind:ZT(S.kind??S.type,x),encrypted:typeof S.encrypted=="boolean"?S.encrypted:void 0,implied:S.implied===!0||k||void 0,protocol:_t(S.protocol)||void 0,auth:_t(S.auth)||_t(S.authentication)||void 0,findings:xv(S.findings,O)}]});return{title:_t(o.title)||"Untitled threat model",nodes:h,edges:m}}const Pn=200,il=86,JT=120,WT=40,Kf=Pn+JT,Do=il+WT,Sv=6,wc={actor:0,external:1,service:2,ai:3,datastore:4},Df=l=>l.x!==void 0&&l.y!==void 0;function Yl(l){const o=l.nodes.filter(b=>!Df(b));if(!o.length)return l;if(o.length===l.nodes.length)return{...l,nodes:tk(l.nodes,l.edges)};const c=l.nodes.filter(Df),u=Math.min(...c.map(b=>b.x)),d=Math.max(...c.map(b=>b.y))+Do;let h=0;const m=l.nodes.map(b=>{if(Df(b))return b;const y=h++;return{...b,x:u+y%4*Kf,y:d+Math.floor(y/4)*Do}});return{...l,nodes:m}}function ek(l){return Yl({...l,nodes:l.nodes.map(({x:o,y:c,...u})=>u)})}function tk(l,o){var oe;const c=new Map(l.map((X,K)=>[X.id,K])),u=new Map(l.map(X=>[X.id,new Set])),d=new Map(l.map(X=>[X.id,new Set]));for(const X of o)X.from===X.to||!u.has(X.from)||!u.has(X.to)||(u.get(X.from).add(X.to),d.get(X.to).add(X.from));const h=l.filter(X=>u.get(X.id).size||d.get(X.id).size),m=l.filter(X=>!u.get(X.id).size&&!d.get(X.id).size),b=[...h].sort((X,K)=>(d.get(X.id).size?1:0)-(d.get(K.id).size?1:0)||wc[X.kind]-wc[K.kind]||c.get(X.id)-c.get(K.id)),y=new Map(h.map(X=>[X.id,[]])),S=new Map(h.map(X=>[X.id,[]])),g=new Map,v=X=>{g.set(X,1);for(const K of u.get(X))g.get(K)!==1&&(y.get(X).push(K),S.get(K).push(X),g.has(K)||v(K));g.set(X,2)};for(const X of b)g.has(X.id)||v(X.id);const x=[],k=new Map(h.map(X=>[X.id,S.get(X.id).length])),O=h.filter(X=>!k.get(X.id)).map(X=>X.id);for(;O.length;){const X=O.shift();x.push(X);for(const K of y.get(X))k.set(K,k.get(K)-1),k.get(K)||O.push(K)}const Y=new Map;for(const X of x)Y.set(X,Math.max(0,...S.get(X).map(K=>Y.get(K)+1)));for(const X of[...x].reverse()){const K=l[c.get(X)];S.get(X).length||!y.get(X).length||K.kind==="actor"||Y.set(X,Math.max(0,Math.min(...y.get(X).map(Q=>Y.get(Q)))-1))}const B=[];for(const X of x)(B[oe=Y.get(X)]??(B[oe]=[])).push(X);const te=B.filter(Boolean),re=new Map;te.forEach(X=>X.forEach((K,Q)=>re.set(K,Q-(X.length-1)/2)));for(let X=0;X<8;X++){const K=X%2===0;for(const Q of K?te:[...te].reverse()){const me=Y.get(Q[0]),ce=new Map(Q.map(Ce=>{const ae=[...d.get(Ce),...u.get(Ce)].filter(W=>Y.has(W)&&(K?Y.get(W)<me:Y.get(W)>me));return[Ce,ae.length?ae.reduce((W,pe)=>W+re.get(pe),0)/ae.length:re.get(Ce)]}));Q.sort((Ce,ae)=>ce.get(Ce)-ce.get(ae)),Q.forEach((Ce,ae)=>re.set(Ce,ae-(Q.length-1)/2))}}const E=Math.min(Sv,Math.max(0,...te.map(X=>X.length))),G=new Map;let U=0;for(const X of te){const K=Math.ceil(X.length/Sv),Q=Math.ceil(X.length/K);X.forEach((me,ce)=>{const Ce=Math.floor(ce/Q),ae=Math.min(Q,X.length-Ce*Q);G.set(me,{x:40+(U+Ce)*Kf,y:40+((E-ae)/2+ce%Q)*Do})}),U+=K}const V=te.length?40+(E+.5)*Do:40,J=Math.max(4,U);return[...m].sort((X,K)=>wc[X.kind]-wc[K.kind]||c.get(X.id)-c.get(K.id)).forEach((X,K)=>G.set(X.id,{x:40+K%J*Kf,y:V+Math.floor(K/J)*Do})),l.map(X=>({...X,...G.get(X.id)}))}function wv(l){let o=null;for(const c of l.findings)c.status==="open"&&(!o||qc[c.severity]<qc[o])&&(o=c.severity);return o}function nk(l){const o={critical:0,high:0,medium:0,low:0};let c=0;for(const h of[...l.nodes.flatMap(m=>m.findings),...l.edges.flatMap(m=>m.findings??[])])h.status==="open"?o[h.severity]++:c++;const u=Object.fromEntries(Ai.map(h=>[h,0]));for(const h of l.edges)u[h.kind??"data"]++;const d=l.nodes.filter(h=>h.inScope);return{components:l.nodes.length,inScope:d.length,tested:d.filter(h=>h.tested).length,open:o,fixed:c,plaintextFlows:l.edges.filter(h=>h.encrypted===!1).length,flows:l.edges.length,impliedFlows:l.edges.filter(h=>h.implied).length,blockedFlows:u.blocked,byKind:u}}function ak(l){const o=new Map(l.nodes.map(h=>[h.id,h.label])),c=[...l.nodes.flatMap(h=>h.findings.map(m=>({where:h.label,f:m}))),...l.edges.flatMap(h=>(h.findings??[]).map(m=>({where:`${o.get(h.from)??h.from} → ${o.get(h.to)??h.to} (${zo[h.kind??"data"].toLowerCase()} flow)`,f:m})))].sort((h,m)=>qc[h.f.severity]-qc[m.f.severity]),u=(h="")=>h.replace(/\|/g,"\\|").replace(/\n/g," ");return[`# ${u(l.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(`
|
|
241
|
-
`)+`
|
|
242
|
-
`}function lk(l){const o=Yl(l),c=new Map(o.nodes.map((b,y)=>[b.id,`n${y}-${Co(b.id)}`])),u=(b,y)=>b.length>y?b.slice(0,y-1)+"…":b,d=b=>{if(!b.inScope)return"out of scope";const y=A0.map(S=>[S,b.findings.filter(g=>g.status==="open"&&g.severity===S).length]).filter(([,S])=>S>0);return y.length?y.map(([S,g])=>`${g} ${S}`).join(" · "):"no open findings"},h=Math.min(...o.nodes.map(b=>b.x??0)),m=Math.min(...o.nodes.map(b=>b.y??0));return{title:u(l.title||"Threat model",80),nodes:o.nodes.map(b=>({id:c.get(b.id),label:u(b.label,40),kind:b.kind,sub:d(b),x:Math.round((b.x??0)-h+40),y:Math.round((b.y??0)-m+90),w:Pn,h:il})),edges:o.edges.filter(b=>c.has(b.from)&&c.has(b.to)).map(b=>{const y=b.kind??"data",S=b.encrypted===!1&&!/plain/i.test(b.label??""),g=S?"async":y==="blocked"?"weak":y==="management"||y==="control"?"sync":y==="attestation"||y==="identity"?"ai":"data",v=[y==="data"?"":`${y}:`,b.label,S?"(plaintext)":"",b.implied?"(implied)":""].filter(Boolean).join(" ");return{from:c.get(b.from),to:c.get(b.to),style:g,...v?{label:u(v,48)}:{}}}),legend:{edges:[]}}}function sk(l,o,c){const u=Math.max(l,o?65536:8192);return c&&c>0?Math.min(u,Math.max(c,1024)):u}let ko;function ik(){if(ko!==void 0)return ko;try{ko=typeof document<"u"?document.createElement("canvas").getContext("2d"):null}catch{ko=null}return ko}function Zf(l,o){var h;const c=ik();if(c)return c.font=o,c.measureText(l).width;const u=Number(((h=/(\d+(?:\.\d+)?)px/.exec(o))==null?void 0:h[1])??12),d=/mono/i.test(o)||/\b[6-9]00\b|bold/.test(o)?.6:.56;return l.length*u*d}function Ac(l,o,c){if(o<=0)return"";if(Zf(l,c)<=o)return l;const u=Array.from(l);let d=0,h=u.length;for(;d<h;){const m=Math.ceil((d+h)/2);Zf(u.slice(0,m).join("").trimEnd()+"…",c)<=o?d=m:h=m-1}return d?u.slice(0,d).join("").trimEnd()+"…":"…"}const ok="700 14px Inter, system-ui, sans-serif",rk="10px JetBrains Mono, monospace",ck="11px Inter, system-ui, sans-serif",Av="11px JetBrains Mono, monospace",uk=`You are a security architect building a threat model of a system the user owns or is authorised to assess.
|
|
243
|
-
From the diagram, screenshot or description you are given, map the system and its weaknesses.
|
|
244
|
-
|
|
245
|
-
Reply with ONE JSON object and nothing else, in exactly this shape:
|
|
246
|
-
{
|
|
247
|
-
"title": "short name of the system",
|
|
248
|
-
"nodes": [
|
|
249
|
-
{
|
|
250
|
-
"id": "short-kebab-id",
|
|
251
|
-
"label": "Component name as shown",
|
|
252
|
-
"kind": "actor" | "service" | "ai" | "datastore" | "external",
|
|
253
|
-
"details": ["facts read off the source: versions, ports, settings"],
|
|
254
|
-
"findings": [
|
|
255
|
-
{ "title": "the weakness, one line", "severity": "critical" | "high" | "medium" | "low", "fix": "the remediation, one line", "ref": "ids: OWASP (A01:2025, API1:2023, LLM01:2025, ASI01:2026), CWE-xxx, ATLAS AML.Txxxx for AI components" }
|
|
256
|
-
]
|
|
257
|
-
}
|
|
258
|
-
],
|
|
259
|
-
"edges": [
|
|
260
|
-
{
|
|
261
|
-
"from": "node-id", "to": "node-id", "label": "what flows, short",
|
|
262
|
-
"kind": "data" | "management" | "attestation" | "identity" | "control" | "blocked",
|
|
263
|
-
"encrypted": true | false, "protocol": "e.g. Redfish/HTTPS", "auth": "e.g. mTLS",
|
|
264
|
-
"implied": true,
|
|
265
|
-
"findings": [ { "title": "...", "severity": "...", "fix": "...", "ref": "..." } ]
|
|
266
|
-
}
|
|
267
|
-
]
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
Rules:
|
|
271
|
-
- actor = people or the internet; service = servers, apps, APIs; ai = models, LLM endpoints, agents, copilots, RAG retrievers, inference services; datastore = databases, buckets, files, config, secrets stores, vector indexes, model weights; external = third-party systems.
|
|
272
|
-
- 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.
|
|
273
|
-
- Only report what the source shows or states. Do not invent components or weaknesses. If something is unclear, leave it out.
|
|
274
|
-
- 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, prompts and tool definitions an AI component loads; blocked = a path the source shows as disabled or cut.
|
|
275
|
-
- 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.
|
|
276
|
-
- 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.
|
|
277
|
-
- A weakness of the connection itself (a classical signature on evidence, missing authentication, a protocol downgrade, untrusted content flowing into an AI component, model output flowing unchecked into a tool or a shell) goes in that flow's "findings"; a weakness of a component goes on the component.
|
|
278
|
-
- Notes, legends and markers (a red X, a "blocked" note) are not components: turn a blocked path into a flow with kind "blocked".
|
|
279
|
-
- 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.
|
|
280
|
-
- Walk every component and flow through the STRIDE categories that apply to it, and the OWASP list that fits its technology; for an "ai" component also walk the ATLAS tactics. A flow between components of different trust (internet to service, tenant to shared store, untrusted content to an AI component) with no authentication or encryption shown is a finding on that flow. Where you considered a category and found nothing, say nothing: the canvas records findings, not coverage.
|
|
281
|
-
- "ref" holds the ids only, space-separated, e.g. "A01:2025 CWE-284" or "LLM01:2025 AML.T0051.001". Prefer the most specific id you are sure of; omit "ref" rather than guess.
|
|
282
|
-
- Keep every string short. No markdown, no commentary outside the JSON.
|
|
283
|
-
|
|
284
|
-
${e0}
|
|
285
|
-
|
|
286
|
-
${hh()}
|
|
287
|
-
|
|
288
|
-
${Sw()}`;function dk(l,o){const c=o?"the attached diagram or screenshot":"the system described below",u=l.trim()?`
|
|
289
|
-
|
|
290
|
-
Context from the user:
|
|
291
|
-
${l.trim()}`:"";return`Build the threat model JSON for ${c}.${u}`}const Mo=()=>crypto.randomUUID().toLowerCase(),Kc=l=>`/api/playground/sessions/${l}`;async function Zc(l,o){var u,d;if(l.ok)return l.json();let c="";try{c=((d=(u=await l.json())==null?void 0:u.error)==null?void 0:d.message)??""}catch{}throw new Error(c||`${o} failed (${l.status})`)}const Cc=l=>fetch(Kc(l)).then(o=>Zc(o,"Listing saved sessions")).then(o=>o.sessions),Pf=(l,o)=>fetch(`${Kc(l)}/${o}`).then(c=>Zc(c,"Opening the session")),Mc=(l,o,c,u)=>fetch(`${Kc(l)}/${o}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:c,body:u})}).then(d=>Zc(d,"Saving")),T0=(l,o)=>fetch(`${Kc(l)}/${o}`,{method:"DELETE"}).then(c=>Zc(c,"Deleting")),Tv="or_threat_model",fk=1200,k0="or_canvas_panel",j0=340,N0=260,E0=640;function hk(){try{const l=JSON.parse(localStorage.getItem(k0)??"null");if(l&&typeof l.width=="number")return{width:Math.min(E0,Math.max(N0,l.width)),collapsed:l.collapsed===!0}}catch{}return{width:j0,collapsed:!1}}const kv={actor:"#00e5ff",service:"#8fa8ff",ai:"#c58cff",datastore:"#ffb300",external:"#b4bcc6"},_o={critical:"#ff3c3c",high:"#ff7a45",medium:"#ffb300",low:"#6e7681"},Ff=["critical","high","medium","low"],mk=["actor","service","ai","datastore","external"],vi={data:"#9aa4b2",management:"#c792ea",attestation:"#e3b341",identity:"#3fb950",control:"#58a6ff",blocked:"#5c6370"},Jf="#ff3c3c";function pk(l,o){const c=(l.x??0)+Pn/2,u=(l.y??0)+il/2,d=(o.x??0)+Pn/2,h=(o.y??0)+il/2;if(Math.abs(d-c)>Pn){const v=d>c?1:-1,x=c+v*Pn/2,k=d-v*(Pn/2+2),O=Math.max(40,Math.abs(k-x)/2)*v;return{d:`M${x},${u} C${x+O},${u} ${k-O},${h} ${k},${h}`,ax:x,ay:u,ex:k,ey:h}}const m=d-c,b=h-u,y=Math.min(Math.abs(Pn/2/(m||1e-6)),Math.abs(il/2/(b||1e-6)),1),S=d-m*y,g=h-b*y;return{d:`M${c},${u} L${S},${g}`,ax:c,ay:u,ex:S,ey:g}}function gk(l){const o=l.encrypted===!1,c=o?Jf:vi[l.kind??"data"],u=l.kind==="blocked"?"2 5":o?"7 5":l.implied?"4 4":void 0;return{plain:o,color:c,dash:u,opacity:l.implied?.6:1,marker:o?"tm-arrow-plain":`tm-arrow-${l.kind??"data"}`}}const yk=(l,o)=>l.length>o?l.slice(0,o-1)+"…":l;function Tc(l,o,c){const u=URL.createObjectURL(new Blob([o],{type:c})),d=document.createElement("a");d.href=u,d.download=l,d.click(),URL.revokeObjectURL(u)}function vk({config:l,models:o,onExit:c}){var Qe,yt,Jt;const[u,d]=A.useState(Sc),[h,m]=A.useState(Mo),[b,y]=A.useState(null),[S,g]=A.useState([]),[v,x]=A.useState(null),[k,O]=A.useState(!1),Y=A.useRef(""),[B,te]=A.useState(null),[re,fe]=A.useState(null),[E,G]=A.useState(hk);A.useEffect(()=>{try{localStorage.setItem(k0,JSON.stringify(E))}catch{}},[E]);const U=A.useRef(null);function V(N){var et;N.preventDefault();const ee=N.currentTarget;ee.setPointerCapture(N.pointerId),document.body.classList.add("resizing");const ve=((et=U.current)==null?void 0:et.getBoundingClientRect().right)??window.innerWidth,je=bn=>G(Nt=>({...Nt,width:Math.round(Math.min(E0,Math.max(N0,ve-bn.clientX)))})),We=()=>{ee.removeEventListener("pointermove",je),ee.removeEventListener("pointerup",We),document.body.classList.remove("resizing")};ee.addEventListener("pointermove",je),ee.addEventListener("pointerup",We)}const[J,oe]=A.useState(""),[X,K]=A.useState(!1),[Q,me]=A.useState(null),ce=gh(),Ce=A.useRef(null),ae=A.useRef(null),W=A.useRef(null),pe=A.useRef(null),F=()=>Cc("canvas").then(g).catch(N=>x({ok:!1,text:String(N.message??N)}));function we(N,ee,ve){d(N),m(ee),te(null),fe(null),Xt(null),Y.current=ve?JSON.stringify(N):""}A.useEffect(()=>{let N=!0;return(async()=>{try{let ee=null;try{ee=localStorage.getItem(Tv)}catch{}if(ee){const je=Yl(To(JSON.parse(ee)));je.nodes.length&&await Mc("canvas",Mo(),je.title,je);try{localStorage.removeItem(Tv)}catch{}}const ve=await Cc("canvas");if(!N)return;if(g(ve),ve[0]){const je=await Pf("canvas",ve[0].id);N&&we(Yl(To(je.body)),ve[0].id,!0)}}catch(ee){N&&x({ok:!1,text:`Saved canvases unavailable: ${String(ee.message??ee)}`})}finally{N&&O(!0)}})(),()=>{N=!1}},[]),A.useEffect(()=>{if(!k||!u.nodes.length)return;const N=JSON.stringify(u);if(N===Y.current)return;const ee=setTimeout(()=>{Mc("canvas",h,u.title,u).then(()=>(Y.current=N,x({ok:!0,text:"Saved, encrypted with your vault"}),Cc("canvas").then(g))).catch(ve=>x({ok:!1,text:`Not saved: ${String(ve.message??ve)}`}))},fk);return()=>clearTimeout(ee)},[u,h,k]);async function nt(N){try{const ee=await Pf("canvas",N);y(null),we(Yl(To(ee.body)),N,!0)}catch(ee){x({ok:!1,text:String(ee.message??ee)})}}async function Lt(N){try{await T0("canvas",N),N===h&&we(Sc(),Mo(),!1),await F()}catch(ee){x({ok:!1,text:String(ee.message??ee)})}}const mt=o.filter(Lc),j=mt.filter(N=>{var ee;return(ee=N.input_modalities)==null?void 0:ee.includes("image")}),ne=ce.images.length>0,Te=ne?j:mt,[ye,Ie]=A.useState(l.model),Oe=Te.some(N=>N.id===ye)?ye:((Qe=Te[0])==null?void 0:Qe.id)??"",Ne=nk(u),he=u.nodes.find(N=>N.id===B)??null,be=u.edges.find(N=>N.id===re)??null;function gt(N){u.nodes.length&&JSON.stringify(u)!==Y.current&&Mc("canvas",h,u.title,u).catch(()=>{}),y({model:u,id:h}),we(N,Mo(),!1)}const H=(N,ee)=>d(ve=>({...ve,nodes:ve.nodes.map(je=>je.id===N?{...je,...ee}:je)})),Me=(N,ee,ve)=>d(je=>({...je,nodes:je.nodes.map(We=>We.id===N?{...We,findings:We.findings.map(et=>et.id===ee?{...et,...ve}:et)}:We)}));function ke(){const N=`component-${Date.now().toString(36)}`;d(ee=>Yl({...ee,nodes:[...ee.nodes,{id:N,label:"New component",kind:"service",details:[],inScope:!0,tested:!1,findings:[]}]})),te(N)}function Be(N){d(ee=>({...ee,nodes:ee.nodes.filter(ve=>ve.id!==N),edges:ee.edges.filter(ve=>ve.from!==N&&ve.to!==N)})),te(null)}const _e=(N,ee)=>d(ve=>({...ve,edges:ve.edges.map(je=>je.id===N?{...je,...ee}:je)})),le=(N,ee,ve)=>d(je=>({...je,edges:je.edges.map(We=>We.id===N?{...We,findings:We.findings.map(et=>et.id===ee?{...et,...ve}:et)}:We)}));function Se(N,ee,ve){const je=`e-${Date.now().toString(36)}`;d(We=>({...We,edges:[...We.edges,{id:je,from:N,to:ee,kind:ve,findings:[]}]})),te(null),fe(je)}function xe(N){d(ee=>({...ee,edges:ee.edges.filter(ve=>ve.id!==N)})),fe(null)}function Xe(N,ee){N.stopPropagation(),te(null),fe(ee)}function $(){var ve;if(X||!J.trim()&&!ce.images.length&&!ce.docs.length||ce.reading||!Oe)return;K(!0),me(null);const N=new AbortController;pe.current=N;let ee="";eh({model:Oe,messages:[{role:"system",content:uk},{role:"user",content:Nh(dk(J,ce.images.length>0||ce.docs.length>0),ce.images,ce.docs)}],temperature:.2,max_tokens:sk(l.maxTokens,ce.docs.length>0,(ve=mt.find(je=>je.id===Oe))==null?void 0:ve.max_output_length),stream:!0},{signal:N.signal,onDelta:je=>{ee+=je},onError:je=>me(je),onDone:je=>{if(!ee.trim()){me(je==="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 We=Yl(To(FT(ee)));if(!We.nodes.length)throw new Error("The model returned no components.");gt(We),oe(""),ce.clear()}catch(We){me(je==="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: ${We.message}`)}}}).catch(je=>{(je==null?void 0:je.name)!=="AbortError"&&me(String((je==null?void 0:je.message)??je))}).finally(()=>{K(!1),pe.current=null})}async function De(N){try{gt(Yl(To(JSON.parse(await N.text()))))}catch(ee){me(`Import failed: ${ee.message}`)}}const Le=u.title.replace(/[^a-z0-9]+/gi,"-").toLowerCase().replace(/^-|-$/g,"")||"threat-model",[dt,Ze]=A.useState(!1),[ft,Ke]=A.useState(!1);A.useEffect(()=>{S0().then(Ze)},[]);async function $t(){Ke(!0);const N=await w0(lk(u));Ke(!1),N.ok?Tc(`${Le}.drawio.svg`,N.r.svg,"image/svg+xml"):x({ok:!1,text:`draw.io export failed: ${N.error}`})}function Fn(){const N=W.current;if(!N)return;const ee=N.cloneNode(!0);ee.setAttribute("xmlns","http://www.w3.org/2000/svg"),ee.removeAttribute("class"),ee.removeAttribute("style"),ee.setAttribute("viewBox",`${Rt.x} ${Rt.y} ${Rt.w} ${Rt.h}`),ee.setAttribute("width",String(Math.round(Rt.w))),ee.setAttribute("height",String(Math.round(Rt.h))),Tc(`${Le}.svg`,new XMLSerializer().serializeToString(ee),"image/svg+xml")}const[Ta,Xt]=A.useState(null),Rt=A.useMemo(()=>{if(!u.nodes.length)return{x:0,y:0,w:900,h:520};const N=u.nodes.map(We=>We.x??0),ee=u.nodes.map(We=>We.y??0),ve=Math.min(...N)-40,je=Math.min(...ee)-40;return{x:ve,y:je,w:Math.max(900,Math.max(...N)+Pn+40-ve),h:Math.max(520,Math.max(...ee)+il+40-je)}},[u.nodes]),Bt=Ta??Rt,ka=Math.round(Rt.w/Bt.w*100),ua=A.useRef(Rt);ua.current=Rt;function da(N,ee,ve){Xt(je=>{const We=ua.current,et=je??We,bn=Math.min(We.w*4,Math.max(We.w/4,et.w/N)),Nt=et.w/bn,nn=ee??et.x+et.w/2,Na=ve??et.y+et.h/2;return{x:nn-(nn-et.x)/Nt,y:Na-(Na-et.y)/Nt,w:bn,h:et.h/Nt}})}function Ot(N,ee){const ve=new DOMPoint(N,ee).matrixTransform(W.current.getScreenCTM().inverse());return{x:ve.x,y:ve.y}}const ja=u.nodes.length>0;A.useEffect(()=>{const N=W.current;if(!N)return;const ee=ve=>{ve.preventDefault();const je=Ot(ve.clientX,ve.clientY);da(ve.deltaY<0?1.15:1/1.15,je.x,je.y)};return N.addEventListener("wheel",ee,{passive:!1}),()=>N.removeEventListener("wheel",ee)},[ja]);const cn=A.useRef(null),vn=A.useRef(null),[Un,z]=A.useState(!1);function de(N,ee){var je;N.stopPropagation(),Xt(Bt);const ve=Ot(N.clientX,N.clientY);cn.current={id:ee.id,dx:ve.x-(ee.x??0),dy:ve.y-(ee.y??0)},(je=W.current)==null||je.setPointerCapture(N.pointerId),te(ee.id),fe(null)}function Ae(N){var ve;const ee=W.current.getBoundingClientRect();vn.current={cx:N.clientX,cy:N.clientY,start:Bt,scale:Math.max(Bt.w/ee.width,Bt.h/ee.height)},(ve=W.current)==null||ve.setPointerCapture(N.pointerId),z(!0)}function Ue(N){const ee=cn.current;if(ee){const je=Ot(N.clientX,N.clientY);H(ee.id,{x:Math.round(je.x-ee.dx),y:Math.round(je.y-ee.dy)});return}const ve=vn.current;ve&&Xt({...ve.start,x:ve.start.x-(N.clientX-ve.cx)*ve.scale,y:ve.start.y-(N.clientY-ve.cy)*ve.scale})}function Ye(){cn.current=null,vn.current=null,z(!1)}const qe=new Map(u.nodes.map(N=>[N.id,N]));return i.jsxs("main",{className:"main",children:[i.jsxs(Ho,{title:`bugxhunter@playground: ~/canvas: ${yk(u.title,40)}`,children:[i.jsxs("span",{className:"status-pill",children:[i.jsx("span",{className:"dot"}),Ne.components," components · ",Ne.tested,"/",Ne.inScope," tested · ",Ne.open.critical+Ne.open.high," crit/high open"]}),i.jsx("button",{className:"btn ghost sm",onClick:ke,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:()=>{y({model:u,id:h}),d(ek(u)),Xt(null)},children:"tidy"}),i.jsx("button",{className:"btn ghost sm",onClick:()=>{var N;return(N=ae.current)==null?void 0:N.click()},children:"import"}),i.jsx("button",{className:"btn ghost sm",disabled:!u.nodes.length,onClick:()=>Tc(`${Le}.json`,JSON.stringify(u,null,2),"application/json"),children:"json"}),i.jsx("button",{className:"btn ghost sm",disabled:!u.nodes.length,onClick:()=>Tc(`${Le}-findings.md`,ak(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||ft,onClick:$t,title:"An editable diagram: opens in draw.io and its VS Code extension",children:ft?"draw.io…":"draw.io"}),b&&i.jsx("button",{className:"btn ghost sm",onClick:()=>{we(b.model,b.id,!1),y(null)},children:"undo"}),i.jsx("button",{className:"btn ghost sm",disabled:!u.nodes.length,onClick:()=>gt(Sc()),children:"clear"}),i.jsx("button",{className:"btn ghost sm",onClick:()=>{var N;(N=pe.current)==null||N.abort(),c()},children:"back to chat"}),i.jsx("input",{ref:ae,type:"file",accept:"application/json,.json",hidden:!0,onChange:N=>{var ve;const ee=(ve=N.target.files)==null?void 0:ve[0];ee&&De(ee),N.target.value=""}})]}),i.jsxs("div",{className:"canvas-wrap",ref:U,children:[i.jsxs("div",{className:"canvas-stage grid-bg",onPointerDown:()=>{te(null),fe(null)},children:[ja&&i.jsxs("div",{className:"canvas-zoom",onPointerDown:N=>N.stopPropagation(),children:[i.jsx("button",{onClick:()=>da(1/1.25),title:"Zoom out","aria-label":"Zoom out",children:"−"}),i.jsxs("span",{title:"Zoom (100% = fit)",children:[ka,"%"]}),i.jsx("button",{onClick:()=>da(1.25),title:"Zoom in","aria-label":"Zoom in",children:"+"}),i.jsx("button",{onClick:()=>Xt(null),title:"Fit the whole model",children:"fit"})]}),u.nodes.length?i.jsxs("svg",{ref:W,className:"canvas-svg",viewBox:`${Bt.x} ${Bt.y} ${Bt.w} ${Bt.h}`,preserveAspectRatio:"xMidYMin meet",onPointerMove:Ue,onPointerUp:Ye,onPointerCancel:Ye,style:{cursor:Un?"grabbing":void 0},children:[i.jsxs("defs",{children:[[...Ai.map(N=>[`tm-arrow-${N}`,vi[N]]),["tm-arrow-plain",Jf],["tm-arrow-sel","#ffffff"]].map(([N,ee])=>i.jsx("marker",{id:N,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})},N)),i.jsx("clipPath",{id:"tm-card-clip",children:i.jsx("rect",{width:Pn,height:il,rx:10})})]}),i.jsx("rect",{x:"-100000",y:"-100000",width:"200000",height:"200000",fill:"#0a0e14",style:{cursor:Un?"grabbing":"grab"},onPointerDown:Ae}),u.edges.map(N=>{var fl;const ee=qe.get(N.from),ve=qe.get(N.to);if(!ee||!ve)return null;const{d:je,ax:We,ay:et,ex:bn,ey:Nt}=pk(ee,ve),nn=gk(N),Na=re===N.id,At=(We+bn)/2,En=(et+Nt)/2,Jn=[N.label,nn.plain&&!/plain/i.test(N.label??"")?"(plaintext)":"",N.implied?"(implied)":""].filter(Boolean).join(" "),Ns=Math.min(240,Math.max(70,Math.hypot(bn-We,Nt-et)-24)),fa=Jn?Ac(Jn,Ns,Av):"",Ga=fa?Zf(fa,Av)+10:0,Kl=wv(N),dl=((fl=N.findings)==null?void 0:fl.filter(hl=>hl.status==="open").length)??0;return i.jsxs("g",{opacity:nn.opacity,style:{cursor:"pointer"},onPointerDown:hl=>Xe(hl,N.id),children:[i.jsx("title",{children:`${zo[N.kind??"data"]} flow${N.implied?" (implied)":""}${Jn?`: ${Jn}`:""}`}),i.jsx("path",{d:je,fill:"none",stroke:"transparent",strokeWidth:14}),i.jsx("path",{d:je,fill:"none",stroke:Na?"#ffffff":nn.color,strokeWidth:Na?3:2,strokeDasharray:nn.dash,markerEnd:`url(#${Na?"tm-arrow-sel":nn.marker})`}),N.kind==="blocked"&&i.jsxs("g",{transform:`translate(${At},${En})`,children:[i.jsx("circle",{r:8,fill:"#0a0e14",stroke:vi.blocked,strokeWidth:2}),i.jsx("line",{x1:-5,y1:5,x2:5,y2:-5,stroke:vi.blocked,strokeWidth:2})]}),fa&&i.jsxs("g",{transform:`translate(${At},${En-(N.kind==="blocked"?18:10)})`,children:[i.jsx("rect",{x:-Ga/2,y:-9,width:Ga,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})]}),dl>0&&i.jsxs("g",{transform:`translate(${At+Ga/2+4},${En-20})`,children:[i.jsx("rect",{width:20,height:16,rx:8,fill:_o[Kl??"low"]}),i.jsx("text",{x:10,y:12,fill:"#0a0e14",fontSize:10,fontWeight:700,textAnchor:"middle",fontFamily:"Inter, system-ui, sans-serif",children:dl})]})]},N.id)}),u.nodes.map(N=>{const ee=wv(N),ve=N.findings.filter(Nt=>Nt.status==="open").length,je=N.x??0,We=N.y??0,et=Pn-16-12,bn=`${N.kind.toUpperCase()}${N.inScope?"":" · OUT OF SCOPE"}${N.tested?" · TESTED ✓":""}`;return i.jsxs("g",{transform:`translate(${je},${We})`,opacity:N.inScope?1:.45,style:{cursor:"grab"},onPointerDown:Nt=>de(Nt,N),children:[i.jsx("title",{children:[N.label,...N.details].join(`
|
|
292
|
-
`)}),i.jsx("rect",{width:Pn,height:il,rx:10,fill:"#161b22",stroke:B===N.id?"#ffffff":kv[N.kind],strokeWidth:B===N.id?2.5:1.5,strokeDasharray:N.inScope?void 0:"5 4"}),i.jsxs("g",{clipPath:"url(#tm-card-clip)",children:[ee&&i.jsx("rect",{width:6,height:il,fill:_o[ee]}),i.jsx("text",{x:16,y:22,fill:"#e6edf3",fontSize:14,fontWeight:700,fontFamily:"Inter, system-ui, sans-serif",children:Ac(N.label,et-(ve>0?30:0),ok)}),i.jsx("text",{x:16,y:40,fill:kv[N.kind],fontSize:10,fontFamily:"JetBrains Mono, monospace",children:Ac(bn,et,rk)}),N.details.slice(0,2).map((Nt,nn)=>i.jsx("text",{x:16,y:58+nn*14,fill:"#8b949e",fontSize:11,fontFamily:"Inter, system-ui, sans-serif",children:Ac(Nt,et,ck)},nn))]}),ve>0&&i.jsxs("g",{transform:`translate(${Pn-30},8)`,children:[i.jsx("rect",{width:22,height:18,rx:9,fill:_o[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})]})]},N.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."]})}),E.collapsed&&i.jsx("button",{className:"sidebar-toggle floating canvas-panel-show",onPointerDown:N=>N.stopPropagation(),onClick:()=>G(N=>({...N,collapsed:!1})),title:"Show panel","aria-label":"Show panel",children:"«"})]}),!E.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:V,onDoubleClick:()=>G(N=>({...N,width:j0}))}),i.jsxs("aside",{className:"canvas-panel",hidden:E.collapsed,style:{width:E.width},children:[i.jsxs("div",{className:"canvas-panel-head",children:[i.jsx("span",{className:"section-title",children:he?"Component":be?"Flow":"Canvas"}),i.jsx("button",{className:"sidebar-toggle",onClick:()=>G(N=>({...N,collapsed:!0})),title:"Hide panel","aria-label":"Hide panel",children:"»"})]}),he?i.jsx(xk,{node:he,others:u.nodes.filter(N=>N.id!==he.id),onChange:N=>H(he.id,N),onFinding:(N,ee)=>Me(he.id,N,ee),onAddFinding:N=>H(he.id,{findings:[...he.findings,N]}),onRemoveFinding:N=>H(he.id,{findings:he.findings.filter(ee=>ee.id!==N)}),onAddFlow:(N,ee)=>Se(he.id,N,ee),onDelete:()=>Be(he.id)}):be?i.jsx(Sk,{edge:be,fromLabel:((yt=qe.get(be.from))==null?void 0:yt.label)??be.from,toLabel:((Jt=qe.get(be.to))==null?void 0:Jt.label)??be.to,onChange:N=>_e(be.id,N),onFinding:(N,ee)=>le(be.id,N,ee),onAddFinding:N=>_e(be.id,{findings:[...be.findings,N]}),onRemoveFinding:N=>_e(be.id,{findings:be.findings.filter(ee=>ee.id!==N)}),onDelete:()=>xe(be.id)}):i.jsxs("div",{className:"canvas-summary",children:[i.jsx("label",{children:"Title"}),i.jsx("input",{type:"text",value:u.title,onChange:N=>d(ee=>({...ee,title:N.target.value}))}),i.jsx("div",{className:"section-title",children:"Summary"}),i.jsxs("ul",{className:"canvas-stats",children:[i.jsxs("li",{children:[Ne.components," components, ",Ne.inScope," in scope"]}),i.jsxs("li",{children:["Coverage: ",Ne.tested,"/",Ne.inScope," tested"]}),Ff.map(N=>i.jsxs("li",{children:[i.jsx("span",{className:"sev-dot",style:{background:_o[N]}}),Ne.open[N]," ",N," open"]},N)),i.jsxs("li",{children:[Ne.fixed," fixed or verified"]}),i.jsxs("li",{children:[Ne.flows," flow",Ne.flows===1?"":"s",": ",Ne.plaintextFlows," plaintext, ",Ne.impliedFlows," implied, ",Ne.blockedFlows," blocked"]})]}),i.jsx("div",{className:"section-title",children:"Flows"}),i.jsxs("ul",{className:"canvas-legend",children:[Ai.map(N=>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:vi[N],strokeWidth:"2",strokeDasharray:N==="blocked"?"2 5":void 0})}),zo[N]," ",i.jsxs("span",{className:"muted",children:["(",Ne.byKind[N],")"]})]},N)),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:Jf,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:vi.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:()=>gt(Sc()),disabled:!u.nodes.length,children:"+ New canvas"}),i.jsx(bk,{list:S,activeId:h,onOpen:N=>void nt(N),onDelete:N=>void Lt(N)})]})]})]}),i.jsxs("div",{className:"composer",children:[i.jsxs("div",{className:"composer-box",onDragOver:N=>N.preventDefault(),onDrop:ce.onDrop,children:[i.jsx(yh,{images:ce.images,docs:ce.docs,reading:ce.reading,onRemove:ce.remove,onRemoveDoc:ce.removeDoc}),i.jsx("textarea",{value:J,onChange:N=>oe(N.target.value),onPaste:ce.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:Ce,type:"file",accept:ph,multiple:!0,hidden:!0,onChange:N=>{N.target.files&&ce.addImages(N.target.files),N.target.value=""}}),i.jsx("button",{className:"icon-btn attach-btn",onClick:()=>{var N;return(N=Ce.current)==null?void 0:N.click()},disabled:X,title:"Attach a diagram (or paste / drop it)","aria-label":"Attach a diagram",children:i.jsx(Vc,{})}),i.jsxs("select",{className:"canvas-builder",value:Oe,onChange:N=>Ie(N.target.value),disabled:X,"aria-label":"Model that builds the threat model",children:[!Te.length&&i.jsx("option",{value:"",children:ne?"No vision model available":"No models"}),Te.map(N=>{var ee;return i.jsxs("option",{value:N.id,children:[N.name,(ee=N.input_modalities)!=null&&ee.includes("image")?" · vision":""]},N.id)})]}),(Q||ce.attachError)&&i.jsx("span",{className:"hint",style:{color:"var(--amber)",margin:"0 8px"},children:Q??ce.attachError}),i.jsx("div",{className:"spacer"}),X?i.jsx("button",{className:"send-btn stop",onClick:()=>{var N;return(N=pe.current)==null?void 0:N.abort()},title:"Stop",children:"■"}):i.jsx("button",{className:"btn primary sm",onClick:$,disabled:!J.trim()&&!ce.images.length&&!ce.docs.length||ce.reading||!Oe,children:u.nodes.length?"rebuild":"build"})]})]}),i.jsx("div",{className:"composer-hint",children:X?"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 bk({list:l,activeId:o,onOpen:c,onDelete:u}){const[d,h]=A.useState(null);return A.useEffect(()=>{if(!d)return;const m=setTimeout(()=>h(null),3e3);return()=>clearTimeout(m)},[d]),l.length?i.jsx("div",{className:"session-list",children:l.map(m=>i.jsxs("div",{className:"session-item"+(m.id===o?" 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"+(d===m.id?" confirm":""),onClick:()=>{if(d!==m.id)return h(m.id);h(null),u(m.id)},title:d===m.id?"Click again to delete":"Delete canvas","aria-label":d===m.id?"Confirm delete":"Delete canvas",children:d===m.id?"Delete?":"✕"})]},m.id))}):i.jsx("div",{className:"hint",children:"No saved canvases yet. Build one and it saves itself."})}function C0({ownerId:l,findings:o,onFinding:c,onAddFinding:u,onRemoveFinding:d}){const[h,m]=A.useState(""),[b,y]=A.useState("medium");return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"section-title",children:["Findings (",o.length,")"]}),o.map(S=>i.jsxs("div",{className:"canvas-finding",children:[i.jsxs("div",{className:"cf-head",children:[i.jsx("span",{className:"sev-pill",style:{background:_o[S.severity]},children:S.severity}),i.jsx("span",{className:"cf-title",children:S.title}),i.jsx("button",{className:"attach-x",onClick:()=>d(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:g=>c(S.id,{severity:g.target.value}),"aria-label":"Severity",children:Ff.map(g=>i.jsx("option",{value:g,children:g},g))}),i.jsxs("select",{value:S.status,onChange:g=>c(S.id,{status:g.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=>y(S.target.value),children:Ff.map(S=>i.jsx("option",{value:S,children:S},S))}),i.jsx("button",{className:"btn mini",disabled:!h.trim(),onClick:()=>{u({id:`${l}-f${Date.now().toString(36)}`,title:h.trim(),severity:b,status:"open"}),m("")},children:"add"})]})]})}function xk({node:l,others:o,onChange:c,onFinding:u,onAddFinding:d,onRemoveFinding:h,onAddFlow:m,onDelete:b}){const[y,S]=A.useState(""),[g,v]=A.useState("data");return i.jsxs("div",{className:"canvas-inspector",children:[i.jsx("label",{children:"Component"}),i.jsx("input",{type:"text",value:l.label,onChange:x=>c({label:x.target.value})}),i.jsx("label",{children:"Kind"}),i.jsx("select",{value:l.kind,onChange:x=>c({kind:x.target.value}),children:mk.map(x=>i.jsx("option",{value:x,children:x},x))}),i.jsxs("label",{className:"check",children:[i.jsx("input",{type:"checkbox",checked:l.inScope,onChange:x=>c({inScope:x.target.checked})})," In scope"]}),i.jsxs("label",{className:"check",children:[i.jsx("input",{type:"checkbox",checked:l.tested,onChange:x=>c({tested:x.target.checked})})," Tested"]}),l.details.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"section-title",children:"Details"}),i.jsx("ul",{className:"canvas-details",children:l.details.map((x,k)=>i.jsx("li",{children:x},k))})]}),i.jsx(C0,{ownerId:l.id,findings:l.findings,onFinding:u,onAddFinding:d,onRemoveFinding:h}),o.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:y,onChange:x=>S(x.target.value),"aria-label":"Flow goes to",children:[i.jsx("option",{value:"",children:"to…"}),o.map(x=>i.jsx("option",{value:x.id,children:x.label},x.id))]}),i.jsx("select",{value:g,onChange:x=>v(x.target.value),"aria-label":"Flow type",children:Ai.map(x=>i.jsx("option",{value:x,children:zo[x]},x))}),i.jsx("button",{className:"btn mini",disabled:!y,onClick:()=>{m(y,g),S("")},children:"add"})]})]}),i.jsx("button",{className:"btn danger-outline sm",style:{marginTop:14},onClick:b,children:"delete component"})]})}function Sk({edge:l,fromLabel:o,toLabel:c,onChange:u,onFinding:d,onAddFinding:h,onRemoveFinding:m,onDelete:b}){const y=l.encrypted===!0?"yes":l.encrypted===!1?"no":"unknown";return i.jsxs("div",{className:"canvas-inspector",children:[i.jsx("label",{children:"Flow"}),i.jsxs("div",{className:"cf-route",title:`${o} → ${c}`,children:[o," ",i.jsx("span",{className:"muted",children:"→"})," ",c]}),i.jsx("label",{children:"Label"}),i.jsx("input",{type:"text",value:l.label??"",placeholder:"what it carries",onChange:S=>u({label:S.target.value||void 0})}),i.jsx("label",{children:"Type"}),i.jsx("select",{value:l.kind??"data",onChange:S=>u({kind:S.target.value}),children:Ai.map(S=>i.jsx("option",{value:S,children:zo[S]},S))}),i.jsx("label",{children:"Encrypted"}),i.jsxs("select",{value:y,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:l.protocol??"",placeholder:"not stated",onChange:S=>u({protocol:S.target.value||void 0})}),i.jsx("label",{children:"Authentication"}),i.jsx("input",{type:"text",value:l.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:l.implied===!0,onChange:S=>u({implied:S.target.checked||void 0})})," Implied (not drawn in the source)"]}),i.jsx(C0,{ownerId:l.id,findings:l.findings??[],onFinding:d,onAddFinding:h,onRemoveFinding:m}),i.jsx("button",{className:"btn danger-outline sm",style:{marginTop:14},onClick:b,children:"delete flow"})]})}const wk={done:"the executor reported the in-scope surface exhausted",idle:"a round found nothing new",budget:"the token budget is spent",rounds:"the round limit was reached",stuck:"the executor stayed stuck, even after escalating","rate-limited":"every model is rate-limited",error:"a round failed",aborted:"stopped by you"};function Ak({onStart:l,onClose:o}){const[c,u]=A.useState(""),[d,h]=A.useState("Map the attack surface and test access control, authentication and injection, one hypothesis at a time."),[m,b]=A.useState("staging"),[y,S]=A.useState(""),[g,v]=A.useState(""),[x,k]=A.useState(!1),[O,Y]=A.useState(!1),[B,te]=A.useState(null),re=c.trim()&&d.trim()&&y.trim()&&x&&!O;async function fe(){Y(!0),te(null);try{const E=g.split(",").map(G=>G.trim()).filter(Boolean);await l({scope:c.trim(),objective:d.trim(),env:{kind:m,divergences:y.trim(),...E.length?{nonProdSettings:E}:{}}}),o()}catch(E){te(E.message),Y(!1)}}return i.jsxs(Ts,{title:"recon --supervised",onClose:O?void 0:o,children:[i.jsx("p",{children:"The agent tests one target round after round: it enumerates, forms a hypothesis, probes it and hands candidates to a verifier. Read-only requests to the target run on their own; anything else waits for your approval."}),i.jsxs("div",{className:"field",children:[i.jsx("label",{htmlFor:"recon-scope",children:"Target (one host or URL)"}),i.jsx("input",{id:"recon-scope",type:"text",className:"mono",autoFocus:!0,spellCheck:!1,placeholder:"https://staging.example.com",value:c,onChange:E=>u(E.target.value)})]}),i.jsxs("div",{className:"field",children:[i.jsx("label",{htmlFor:"recon-objective",children:"Objective"}),i.jsx("textarea",{id:"recon-objective",rows:3,value:d,onChange:E=>h(E.target.value)})]}),i.jsxs("div",{className:"field",children:[i.jsx("label",{htmlFor:"recon-kind",children:"Environment"}),i.jsxs("select",{id:"recon-kind",value:m,onChange:E=>b(E.target.value),children:[i.jsx("option",{value:"local",children:"local"}),i.jsx("option",{value:"staging",children:"staging"}),i.jsx("option",{value:"production",children:"production"})]})]}),i.jsxs("div",{className:"field",children:[i.jsx("label",{htmlFor:"recon-div",children:"How it differs from production"}),i.jsx("textarea",{id:"recon-div",rows:2,placeholder:"e.g. seed data, SSO replaced by a test login; or: none, this is production",value:y,onChange:E=>S(E.target.value)})]}),i.jsxs("div",{className:"field",children:[i.jsx("label",{htmlFor:"recon-settings",children:"Non-production settings (optional, comma-separated)"}),i.jsx("input",{id:"recon-settings",type:"text",className:"mono",spellCheck:!1,placeholder:"DEBUG=1, AUTH_DISABLED",value:g,onChange:E=>v(E.target.value)})]}),i.jsxs("label",{className:"recon-consent",children:[i.jsx("input",{type:"checkbox",checked:x,onChange:E=>k(E.target.checked)}),i.jsx("span",{children:"I am authorised to test this target, and it is the only one in scope."})]}),B&&i.jsx("div",{className:"hint danger",children:B}),i.jsxs("div",{className:"perm-actions recon-actions",children:[i.jsx("button",{className:"btn primary sm",disabled:!re,onClick:fe,children:O?"starting…":"start recon"}),i.jsx("button",{className:"btn sm",disabled:O,onClick:o,children:"cancel"})]})]})}function Tk({recon:l,onStop:o,onDismiss:c}){const u=l.status==="running";return i.jsxs("div",{className:"recon-strip"+(u?" live":""),role:"status",children:[i.jsx("span",{className:"recon-name",children:"recon"}),i.jsx("span",{className:"mono",title:l.objective,children:l.scope}),i.jsxs("span",{children:["round ",u?l.rounds+1:l.rounds,"/",l.maxRounds]}),i.jsxs("span",{children:[wi(l.tokens),"/",wi(l.budgetTokens)," tokens"]}),u&&l.model&&i.jsx("span",{title:`profile ${l.profile}`,children:l.model}),i.jsxs("span",{title:"Approvals the gate answered itself, and the ones it left for you",children:["auto-allowed ",l.gate.allowed," · asked ",l.gate.asked," · blocked ",l.gate.denied]}),u?i.jsx("button",{className:"btn sm danger-outline",onClick:o,children:"stop"}):i.jsxs(i.Fragment,{children:[i.jsxs("span",{className:"recon-end",children:["ended: ",l.stopped?wk[l.stopped]:"finished"]}),i.jsx("button",{className:"link-btn",onClick:c,children:"dismiss"})]})]})}function kk({recon:l}){return l.status==="running"&&!l.findings.length?null:i.jsxs("div",{className:"recon-findings",children:[i.jsxs("div",{className:"perm-title recon-title",children:["Recon findings (",l.findings.length,") · ",l.env.kind]}),l.error&&i.jsx("div",{className:"hint danger",children:l.error}),!l.findings.length&&i.jsx("div",{className:"hint",children:"The verifier confirmed no findings in this run."}),l.findings.map((o,c)=>i.jsx(jk,{f:o},c))]})}function jk({f:l}){return i.jsxs("div",{className:"recon-finding",children:[i.jsxs("div",{className:"recon-finding-head",children:[i.jsx("span",{className:`badge sev-${l.severity}`,children:l.severity}),i.jsx("span",{className:"recon-finding-title",children:l.title}),l.standardId&&i.jsx("span",{className:"badge",children:l.standardId}),l.verdict==="config-dependent"&&i.jsx("span",{className:"badge sev-medium",children:"config-dependent"})]}),i.jsx("pre",{className:"recon-repro",children:l.repro}),l.prodCaveat&&i.jsxs("div",{className:"hint",children:["Re-test against production: ",l.prodCaveat]})]})}const Gc=[{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:""}],Nk=25*1024*1024,jv=30*1024*1024,M0="or_cmd_history";function Ek(){try{const l=localStorage.getItem(M0);if(l)return JSON.parse(l)}catch{}return[]}function Ck({agent:l,setAgent:o,model:c,setModel:u,models:d,commands:h,busy:m,onSend:b,onStop:y,draft:S,onDraftUsed:g}){var gt;const[v,x]=A.useState(""),[k,O]=A.useState([]),[Y,B]=A.useState(null),[te,re]=A.useState(!1),[fe,E]=A.useState(0),G=A.useRef(null),U=A.useRef(null),[V,J]=A.useState(!1),oe=A.useRef(null);function X(){var ke,Be;if(V){(ke=oe.current)==null||ke.stop();return}const H=v.trim(),Me=Dv({onStart:()=>J(!0),onEnd:()=>{J(!1),oe.current=null},onPartial:_e=>x(H?H+" "+_e:_e)});oe.current=Me,(Be=G.current)==null||Be.focus()}const[K,Q]=A.useState(Ek),me=A.useRef(-1),ce=A.useRef("");function Ce(H){H.trim()&&Q(Me=>{const ke=(Me[Me.length-1]===H?Me:[...Me,H]).slice(-200);try{localStorage.setItem(M0,JSON.stringify(ke))}catch{}return ke})}function ae(){requestAnimationFrame(()=>{const H=G.current;H&&(H.selectionStart=H.selectionEnd=H.value.length)})}const W=()=>{const H=G.current;return!H||!H.value.slice(0,H.selectionStart??0).includes(`
|
|
293
|
-
`)},pe=()=>{const H=G.current;return!H||!H.value.slice(H.selectionEnd??0).includes(`
|
|
294
|
-
`)};function F(H){if(!K.length)return!1;if(me.current===-1){if(H===1)return!1;ce.current=v,me.current=K.length-1}else{const Me=me.current+H;if(Me<0)return!0;if(Me>=K.length)return me.current=-1,x(ce.current),ae(),!0;me.current=Me}return x(K[me.current]),ae(),!0}A.useEffect(()=>{var H;S!==null&&(x(S),g(),(H=G.current)==null||H.focus())},[S,g]),A.useEffect(()=>{const H=G.current;H&&(H.style.height="auto",H.style.height=Math.min(H.scrollHeight,260)+"px")},[v]);function we(H){var ke;H.target.closest("button, select, input, textarea, a")||(ke=G.current)==null||ke.focus()}const nt=A.useMemo(()=>{const H=new Set(Gc.map(Me=>Me.name));return[...Gc,...h.filter(Me=>!H.has(Me.name))]},[h]),Lt=(gt=/^\/(\S*)$/.exec(v))==null?void 0:gt[1],mt=Lt!==void 0?nt.filter(H=>H.name.startsWith(Lt.toLowerCase())):[],j=mt.length>0;A.useEffect(()=>E(0),[Lt]);function ne(H){var Me;H.hint?(x(`/${H.name} `),(Me=G.current)==null||Me.focus()):Ie(`/${H.name}`)}async function Te(H){B(null);const Me=[];let ke=k.reduce((Be,_e)=>Be+_e.size,0);for(const Be of Array.from(H)){if(Be.size>Nk){B(`${Be.name} is over 25 MB.`);continue}if(ke+Be.size>jv){B(`Attachments are limited to ${Lo(jv)} per message; ${Be.name} doesn't fit.`);continue}ke+=Be.size;const _e=await Mk(Be);Me.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:_e.slice(_e.indexOf(",")+1),preview:Be.type.startsWith("image/")?_e:void 0})}O(Be=>[...Be,...Me])}function ye(H){const Me=Array.from(H.clipboardData.files);Me.length&&(H.preventDefault(),Te(Me))}function Ie(H=v){!H.trim()&&!k.length||(Ce(H),me.current=-1,b(H,k),x(""),O([]),B(null))}function Oe(H){if(j){if(H.key==="ArrowDown"){H.preventDefault(),E(Me=>(Me+1)%mt.length);return}if(H.key==="ArrowUp"){H.preventDefault(),E(Me=>(Me-1+mt.length)%mt.length);return}if(H.key==="Tab"||H.key==="Enter"&&!H.shiftKey){H.preventDefault(),ne(mt[fe]);return}if(H.key==="Escape"){H.preventDefault(),x("");return}}if(H.key==="ArrowUp"&&W()&&F(-1)){H.preventDefault();return}if(H.key==="ArrowDown"&&me.current!==-1&&pe()&&F(1)){H.preventDefault();return}H.key==="Enter"&&!H.shiftKey&&(H.preventDefault(),Ie())}const Ne=d.find(H=>H.id===c),he=A.useMemo(()=>{const H=new Map;for(const Me of d)H.set(Me.provider,[...H.get(Me.provider)??[],Me]);return[...H.entries()]},[d]),be=k.some(H=>H.mime.startsWith("image/"));return i.jsxs("div",{className:"composer-wrap",children:[j&&i.jsx("div",{className:"slash-menu",role:"listbox",children:mt.map((H,Me)=>i.jsxs("button",{role:"option","aria-selected":Me===fe,className:"slash-item"+(Me===fe?" on":""),onMouseEnter:()=>E(Me),onMouseDown:ke=>{ke.preventDefault(),ne(H)},children:[i.jsxs("span",{className:"slash-name mono",children:["/",H.name,H.hint?i.jsxs("span",{className:"slash-hint",children:[" ",H.hint]}):null]}),i.jsx("span",{className:"slash-desc",children:H.description})]},H.name))}),i.jsxs("div",{className:"composer-box"+(te?" dragging":""),onClick:we,onDragOver:H=>{H.dataTransfer.types.includes("Files")&&(H.preventDefault(),re(!0))},onDragLeave:()=>re(!1),onDrop:H=>{H.preventDefault(),re(!1),H.dataTransfer.files.length&&Te(H.dataTransfer.files)},children:[k.length>0&&i.jsx("div",{className:"attach-row",children:k.map((H,Me)=>i.jsxs("span",{className:"attach-chip",title:`${H.name} · ${Lo(H.size)}`,children:[H.preview?i.jsx("img",{src:H.preview,alt:""}):i.jsx("span",{className:"attach-icon",children:i.jsx(dh,{})}),i.jsx("span",{className:"attach-name",children:H.name}),i.jsx("button",{className:"attach-x",onClick:()=>O(ke=>ke.filter((Be,_e)=>_e!==Me)),"aria-label":`Remove ${H.name}`,children:"✕"})]},Me))}),i.jsx("textarea",{ref:G,value:v,onChange:H=>{x(H.target.value),me.current=-1},onKeyDown:Oe,onPaste:ye,rows:3,placeholder:V?"Listening…":l==="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 H;return(H=U.current)==null?void 0:H.click()},title:"Attach files (or paste / drop them)","aria-label":"Attach files",children:i.jsx(Vc,{size:20})}),i.jsx("input",{ref:U,type:"file",multiple:!0,hidden:!0,onChange:H=>{H.target.files&&Te(H.target.files),H.target.value=""}}),i.jsx("div",{className:"agent-switch",role:"tablist",children:["build","plan"].map(H=>i.jsx("button",{className:"seg"+(l===H?" on":""),onClick:()=>o(H),disabled:m,children:H},H))}),i.jsxs("select",{className:"model-select",value:c,onChange:H=>u(H.target.value),disabled:m,title:"Model",children:[!Ne&&i.jsx("option",{value:c,children:c}),he.map(([H,Me])=>i.jsx("optgroup",{label:H,children:Me.map(ke=>i.jsxs("option",{value:ke.id,children:[ke.name,ke.images?" · sees images":"",ke.output?` · ${wi(ke.output)} out`:""]},ke.id))},H))]}),i.jsx("div",{className:"spacer"}),th()&&i.jsx("button",{className:"send-btn mic"+(V?" stop":""),onClick:X,disabled:m,title:V?"Stop dictation":"Dictate","aria-label":V?"Stop dictation":"Dictate",children:V?"●":"🎤"}),m?i.jsx("button",{className:"send-btn stop",onClick:y,title:"Stop",children:"■"}):i.jsx("button",{className:"send-btn",onClick:()=>Ie(),disabled:!v.trim()&&!k.length,title:"Send (Enter)",children:"↑"})]})]}),i.jsx("div",{className:"composer-hint",children:Y?i.jsx("span",{className:"danger",children:Y}):be&&Ne&&!Ne.images?i.jsxs("span",{className:"warn",children:[Ne.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 Mk(l){return new Promise((o,c)=>{const u=new FileReader;u.onload=()=>o(String(u.result)),u.onerror=()=>c(u.error),u.readAsDataURL(l)})}const _k={completed:"✓",in_progress:"◐",pending:"○",cancelled:"✕"};function Rk({todos:l}){const[o,c]=A.useState(!0);if(!l.length)return null;const u=l.filter(h=>h.status==="completed").length,d=l.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":o,children:[i.jsx("span",{className:"chev"+(o?" open":""),children:"›"}),i.jsx("span",{className:"todo-title",children:"Tasks"}),i.jsxs("span",{className:"todo-count",children:[u,"/",l.length]}),i.jsx("span",{className:"todo-bar",children:i.jsx("span",{style:{width:`${u/l.length*100}%`}})}),!o&&d&&i.jsx("span",{className:"todo-current",children:d.content})]}),o&&i.jsx("ul",{className:"todo-list",children:l.map((h,m)=>i.jsxs("li",{className:"todo s-"+h.status,children:[i.jsx("span",{className:"todo-icon","aria-hidden":!0,children:_k[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 Ok(l){var u,d;const o=[];let c=!1;for(const h of l.split(`
|
|
295
|
-
`)){const m=h.replace(/\r$/,"");if(m.startsWith("@@")){o.push(null),c=!0;continue}!c||m.startsWith("\\")||(m.startsWith("+")?o.push({kind:"add",text:m.slice(1)}):m.startsWith("-")?o.push({kind:"del",text:m.slice(1)}):o.push({kind:"same",text:m.slice(1)}))}return o[0]===null&&o.shift(),o.length&&((u=o[o.length-1])==null?void 0:u.kind)==="same"&&((d=o[o.length-1])==null?void 0:d.text)===""&&o.pop(),o}function Dk(l,o){const c=l?l.split(`
|
|
296
|
-
`):[],u=o?o.split(`
|
|
297
|
-
`):[];if(c.length*u.length>4e6)return[...c.map(g=>({kind:"del",text:g})),...u.map(g=>({kind:"add",text:g}))];const d=c.length,h=u.length,m=Array.from({length:d+1},()=>new Uint32Array(h+1));for(let g=d-1;g>=0;g--)for(let v=h-1;v>=0;v--)m[g][v]=c[g]===u[v]?m[g+1][v+1]+1:Math.max(m[g+1][v],m[g][v+1]);const b=[];let y=0,S=0;for(;y<d&&S<h;)c[y]===u[S]?(b.push({kind:"same",text:c[y]}),y++,S++):m[y+1][S]>=m[y][S+1]?b.push({kind:"del",text:c[y++]}):b.push({kind:"add",text:u[S++]});for(;y<d;)b.push({kind:"del",text:c[y++]});for(;S<h;)b.push({kind:"add",text:u[S++]});return b}function Lk(l,o=3){const c=new Array(l.length).fill(!1);l.forEach((h,m)=>{if(h.kind!=="same")for(let b=Math.max(0,m-o);b<=Math.min(l.length-1,m+o);b++)c[b]=!0});const u=[];let d=!1;return l.forEach((h,m)=>{c[m]?(u.push(h),d=!1):d||(u.push(null),d=!0)}),u}function zk({diff:l,onClose:o}){return A.useEffect(()=>{const c=u=>u.key==="Escape"&&o();return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[o]),i.jsx("div",{className:"overlay",onClick:o,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:o,"aria-label":"Close",title:"Close (Esc)",children:"✕"})]}),i.jsx("div",{className:"modal-body",children:typeof l=="string"?i.jsx("pre",{className:"diff-raw",children:l}):l.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."]}):l.map((c,u)=>i.jsx(Uk,{f:c},`${c.turn??0}-${c.file}-${u}`))})]})})}function Uk({f:l}){const[o,c]=A.useState(!0),u=A.useMemo(()=>l.patch!==void 0?Ok(l.patch):Lk(Dk(l.before??"",l.after??"")),[l.patch,l.before,l.after]);return i.jsxs("div",{className:"file-diff",children:[i.jsxs("button",{className:"file-diff-head",onClick:()=>c(d=>!d),children:[i.jsx("span",{className:"chev"+(o?" open":""),children:"›"}),i.jsx("span",{className:"mono",children:l.file}),l.turn?i.jsxs("span",{className:"muted turn",children:["prompt ",l.turn]}):null,i.jsxs("span",{className:"adds",children:["+",l.additions??0]}),i.jsxs("span",{className:"dels",children:["−",l.deletions??0]})]}),o&&i.jsx("pre",{className:"diff-lines",children:u.map((d,h)=>d===null?i.jsx("div",{className:"dl gap",children:"⋯"},h):i.jsxs("div",{className:"dl "+d.kind,children:[d.kind==="add"?"+ ":d.kind==="del"?"- ":" ",d.text]},h))})]})}function Hk({req:l,onAnswer:o,onDismiss:c}){const[u,d]=A.useState(()=>l.questions.map(()=>[])),[h,m]=A.useState(()=>l.questions.map(()=>""));function b(g,v,x){d(k=>k.map((O,Y)=>Y!==g?O:x?O.includes(v)?O.filter(B=>B!==v):[...O,v]:O[0]===v?[]:[v])),x||m(k=>k.map((O,Y)=>Y===g?"":O))}const y=l.questions.map((g,v)=>{const x=h[v].trim();return!g.multiple&&x?[x]:x?[...u[v],x]:u[v]}),S=y.every(g=>g.length>0);return i.jsxs("div",{className:"question-card",children:[i.jsxs("div",{className:"perm-title",children:["The agent has a question",l.subagent&&i.jsxs("span",{className:"perm-sub",children:["subagent · ",l.subagent]})]}),l.questions.map((g,v)=>i.jsxs("div",{className:"q-block",children:[g.header&&i.jsx("span",{className:"q-header",children:g.header}),i.jsx("div",{className:"q-text",children:g.question}),g.multiple&&i.jsx("div",{className:"hint",style:{marginTop:0},children:"Choose any that apply."}),i.jsx("div",{className:"q-options",role:g.multiple?"group":"radiogroup",children:g.options.map(x=>{const k=u[v].includes(x.label);return i.jsxs("button",{className:"q-option"+(k?" on":""),role:g.multiple?"checkbox":"radio","aria-checked":k,onClick:()=>b(v,x.label,g.multiple),children:[i.jsx("span",{className:"q-mark"+(g.multiple?" box":""),"aria-hidden":!0,children:k?"✓":""}),i.jsx("span",{className:"q-label",children:x.label}),x.description&&i.jsx("span",{className:"q-desc",children:x.description})]},x.label)})}),g.custom!==!1&&i.jsx("input",{type:"text",className:"q-custom",placeholder:"Or type your own answer…",value:h[v],onChange:x=>{const k=x.target.value;m(O=>O.map((Y,B)=>B===v?k:Y)),!g.multiple&&k.trim()&&d(O=>O.map((Y,B)=>B===v?[]:Y))},onKeyDown:x=>{x.key==="Enter"&&S&&o(y)}})]},v)),i.jsxs("div",{className:"perm-actions",children:[i.jsx("button",{className:"btn primary sm",disabled:!S,onClick:()=>o(y),children:"Send answer"}),i.jsx("button",{className:"btn sm",onClick:c,children:"Dismiss"})]})]})}const Ik={build:"Edits files and runs commands. You approve each change.",plan:"Read-only. Explores the code and writes a plan."};function Bk(l,o){return[{kind:"p",text:`./bxh --project ${l} --agent ${o}`,pace:26},{kind:"out",text:"Loading project context..."},{kind:"out",text:Ik[o],pace:18},{kind:"ok",text:"Agent ready ",ok:"OK"}]}const qk=["Summarise the architecture of this project.","Find and explain the main entry points.","Review this project against the OWASP Top 10:2025 and report findings with ids and fixes.","Map every place this code calls a model or runs an agent, and assess it against the OWASP LLM and Agentic Top 10 and ATLAS.","/init"],Gk=80;function $k({status:l,statusError:o,directory:c,model:u,setModel:d,resume:h,onActiveSession:m,onSessionsChanged:b}){const[y,S]=A.useState("build"),[g,v]=A.useState(null),[x,k]=A.useState([]),[O,Y]=A.useState([]),[B,te]=A.useState([]),[re,fe]=A.useState([]),[E,G]=A.useState(!1),[U,V]=A.useState(!1),[J,oe]=A.useState(null),[X,K]=A.useState(null),[Q,me]=A.useState(null),[ce,Ce]=A.useState([]),[ae,W]=A.useState(null),[pe,F]=A.useState(!0),[we,nt]=A.useState(null),[Lt,mt]=A.useState(!1),j=A.useRef(!1),[ne,Te]=A.useState([]),ye=A.useRef([]),Ie=A.useRef(0),Oe=A.useRef(!1),Ne=A.useRef(()=>{}),he=A.useRef({}),be=A.useRef(""),gt=A.useRef(0),H=A.useRef(null),Me=A.useRef(null),ke=A.useRef(!0);A.useEffect(()=>{_S(c).then(Ce).catch(()=>{}),AT(c,["/workspace"])},[c]);function Be(){const z=Me.current;if(!z)return;const de=z.scrollHeight-z.scrollTop-z.clientHeight<Gk;ke.current=de,F(de)}function _e(z=!0){const de=Me.current;de&&(ke.current=!0,F(!0),de.scrollTo({top:de.scrollHeight,behavior:z?"smooth":"auto"}))}A.useEffect(()=>{var z;ke.current&&((z=Me.current)==null||z.scrollTo({top:Me.current.scrollHeight}))},[x,O,B]);const le=A.useCallback((z,de,Ae)=>{k(Ue=>{const Ye=Ue.slice();let qe=Ye.findIndex(yt=>yt.id===z);qe===-1&&(Ye.push({id:z,role:"assistant",parts:[]}),qe=Ye.length-1);const Qe={...Ye[qe],parts:Ye[qe].parts.slice()};return Ae&&(Qe.subagent=Ae),de(Qe),Ye[qe]=Qe,Ye})},[]),Se=A.useCallback(z=>{switch(z.kind){case"message":he.current[z.messageID]=z.role,z.role==="assistant"&&le(z.messageID,de=>{de.tokens=z.tokens,de.cost=z.cost,de.model=z.model},z.subagent);break;case"text":case"reasoning":{const de=he.current[z.messageID];if(de==="user"||!de&&z.text.trim()===be.current.trim())break;const Ae=z.partID??`${z.kind}-${z.messageID}`;le(z.messageID,Ue=>{const Ye=Ue.parts.findIndex(Qe=>Qe.type===z.kind&&"id"in Qe&&Qe.id===Ae),qe={type:z.kind,id:Ae,text:z.text};Ye===-1?Ue.parts.push(qe):Ue.parts[Ye]=qe},z.subagent);break}case"tool":le(z.messageID,de=>{const Ae=de.parts.findIndex(Ye=>Ye.type==="tool"&&Ye.callID===z.callID),Ue={type:"tool",callID:z.callID,tool:z.tool,status:z.status,title:z.title,input:z.input,output:z.output,error:z.error};Ae===-1?de.parts.push(Ue):de.parts[Ae]={...de.parts[Ae],...Ue}},z.subagent);break;case"todo":fe(z.todos);break;case"session":b();break;case"permission":Y(de=>de.some(Ae=>Ae.permissionID===z.permissionID)?de:[...de,z]);break;case"permission-replied":Y(de=>de.filter(Ae=>Ae.permissionID!==z.permissionID));break;case"question":te(de=>de.some(Ae=>Ae.requestID===z.requestID)?de:[...de,{requestID:z.requestID,questions:z.questions,subagent:z.subagent}]);break;case"question-closed":te(de=>de.filter(Ae=>Ae.requestID!==z.requestID));break;case"idle":k(de=>de.map(Xk)),b(),j.current||Ne.current();break;case"error":oe(z.message),j.current||Ne.current();break}},[le,b]);function xe(){var z;(z=H.current)==null||z.abort(),H.current=null,v(null),k([]),Y([]),te([]),fe([]),oe(null),K(null),G(!1),nt(null),j.current=!1,ye.current=[],Ke(),Oe.current=!1,he.current={},ke.current=!0,F(!0)}function Xe(z){var Ae;(Ae=H.current)==null||Ae.abort();const de=new AbortController;H.current=de,GS(z,c,Se,de.signal,()=>$(z,de)).catch(Ue=>{(Ue==null?void 0:Ue.name)!=="AbortError"&&oe(String((Ue==null?void 0:Ue.message)??Ue))}),$(z,de)}function $(z,de){LS(z,c).then(({permissions:Ae,questions:Ue})=>{de.signal.aborted||(Ae.length&&(Y(Ye=>{const qe=new Set(Ye.map(Qe=>Qe.permissionID));return[...Ye,...Ae.filter(Qe=>!qe.has(Qe.permissionID))]}),G(!0)),Ue.length&&(te(Ye=>{const qe=new Set(Ye.map(Qe=>Qe.requestID));return[...Ye,...Ue.filter(Qe=>!qe.has(Qe.requestID)).map(Qe=>({requestID:Qe.requestID,questions:Qe.questions,subagent:Qe.subagent}))]}),G(!0)))}).catch(()=>{})}async function De(){if(g)return g;const z=await zS(c);return v(z.id),m(z.id),Xe(z.id),z.id}function Le(){xe(),m(null)}A.useEffect(()=>{if(!h)return;if(!h.id){Le();return}const z=h.id;xe(),V(!0),CS(z,c).then(({messages:de,todos:Ae})=>{for(const Ue of de)he.current[Ue.id]=Ue.role;k(de.map(Yk)),fe(Ae??[]),v(z),m(z),Xe(z),qy(z).then(dt).catch(()=>{}),requestAnimationFrame(()=>_e(!1))}).catch(de=>oe(String(de.message??de))).finally(()=>V(!1))},[h==null?void 0:h.n]);function dt(z){nt(z),(z==null?void 0:z.status)==="running"&&(j.current=!0,Oe.current=!0,G(!0))}async function Ze(z){oe(null),K(null);const de=await De(),Ae=await XS({sessionID:de,directory:c,...z,authorised:!0}),Ue=`local-${gt.current++}`,Ye=`Supervised recon of ${z.scope} (${z.env.kind})
|
|
298
|
-
${z.objective}`;k(qe=>[...qe,{id:Ue,role:"user",parts:[{type:"text",id:Ue,text:Ye}]}]),dt(Ae),_e()}const ft=(we==null?void 0:we.status)==="running";A.useEffect(()=>{if(!ft||!g)return;const z=setInterval(()=>{qy(g).then(de=>{de&&(nt(de),de.status!=="running"&&(j.current=!1,Ne.current(),b()))}).catch(()=>{})},2500);return()=>clearInterval(z)},[ft,g,b]);const Ke=()=>Te([...ye.current]);function $t(z,de=[]){if(!(!z.trim()&&!de.length)){if(Oe.current){ye.current.push({id:Ie.current++,text:z,files:de}),Ke(),_e();return}Bt(z,de)}}function Fn(z){ye.current=ye.current.filter(de=>de.id!==z),Ke()}function Ta(){if(Oe.current)return;const z=ye.current.shift();Ke(),z&&Bt(z.text,z.files)}const Xt=A.useRef(!1);function Rt(){Oe.current=!1,G(!1),!Xt.current&&(Xt.current=!0,requestAnimationFrame(()=>{Xt.current=!1,Ta()}))}Ne.current=Rt;async function Bt(z,de=[]){const Ae=z.trim();oe(null),K(null),_e();const Ue=/^\/(\S+)(?:\s+([\s\S]*))?$/.exec(Ae);if(Ue&&!de.length){await ka(Ue[1].toLowerCase(),(Ue[2]??"").trim()),Oe.current||Ta();return}try{Oe.current=!0;const Ye=await De();be.current=Ae;const qe=`local-${gt.current++}`,Qe=de.map((Jt,N)=>({type:"file",id:`${qe}-f${N}`,filename:Jt.name,mime:Jt.mime,url:Jt.preview,size:Jt.size}));k(Jt=>[...Jt,{id:qe,role:"user",parts:[...Ae?[{type:"text",id:qe,text:Ae}]:[],...Qe]}]),G(!0);const yt=l==null?void 0:l.models.find(Jt=>Jt.id===u);await US({sessionID:Ye,text:Ae,agent:y,model:u,directory:c,files:de.map(({name:Jt,mime:N,data:ee})=>({name:Jt,mime:N,data:ee})),inlineImages:!!(yt!=null&&yt.images)})}catch(Ye){oe(String(Ye.message??Ye)),Rt()}}async function ka(z,de){switch(z){case"new":Le();return;case"plan":case"build":S(z),K(`Switched to the ${z} agent.`);return;case"help":{const Ae=[...Gc,...ce.filter(Ue=>!Gc.some(Ye=>Ye.name===Ue.name))];K(Ae.map(Ue=>`/${Ue.name}${Ue.hint?" "+Ue.hint:""} — ${Ue.description}`).join(`
|
|
299
|
-
`));return}case"model":{const Ae=de.toLowerCase(),Ue=(l==null?void 0:l.models)??[],Ye=Ae&&(Ue.find(qe=>qe.id.toLowerCase()===Ae||qe.name.toLowerCase()===Ae)??Ue.find(qe=>qe.id.toLowerCase().includes(Ae)||qe.name.toLowerCase().includes(Ae)));if(!Ye){oe(Ae?`No model matches “${de}”.`:"Usage: /model <name>, e.g. /model kimi");return}d(Ye.id),K(`Model: ${Ye.name}`);return}case"compact":if(!g){oe("Nothing to compact yet.");return}try{Oe.current=!0,G(!0),await OS(g,c,u),K("Compacting the conversation…")}catch(Ae){oe(String(Ae.message??Ae)),Rt()}return}if(!ce.some(Ae=>Ae.name===z)){oe(`Unknown command /${z}. Type / to see the list.`);return}try{const Ae=await De(),Ue=`local-${gt.current++}`,Ye=`/${z}${de?" "+de:""}`;be.current=Ye,k(qe=>[...qe,{id:Ue,role:"user",parts:[{type:"text",id:Ue,text:Ye}]}]),Oe.current=!0,G(!0),await RS({sessionID:Ae,command:z,arguments:de,agent:y,model:u,directory:c})}catch(Ae){oe(String(Ae.message??Ae)),Rt()}}async function ua(z,de){Y(Ae=>Ae.filter(Ue=>Ue.permissionID!==z.permissionID));try{await HS({sessionID:z.sessionID,permissionID:z.permissionID,response:de,directory:c})}catch(Ae){oe(String(Ae.message??Ae))}}async function da(z,de){te(Ae=>Ae.filter(Ue=>Ue.requestID!==z.requestID));try{await IS(de?{requestID:z.requestID,answers:de,directory:c}:{requestID:z.requestID,reject:!0,directory:c})}catch(Ae){oe(String(Ae.message??Ae))}}async function Ot(){if(ye.current=[],Ke(),j.current&&g){await YS(g).catch(()=>{});return}Oe.current=!1,G(!1),g&&await BS(g,c).catch(()=>{})}async function ja(){if(!g)return;const z=await qS(g,c);me(Array.isArray(z)||typeof z=="string"?z:z?JSON.stringify(z,null,2):[])}A.useEffect(()=>()=>{var z;return(z=H.current)==null?void 0:z.abort()},[]);const cn=c.split(/[\\/]/).filter(Boolean).pop()??c,vn=A.useMemo(()=>x.reduce((z,de)=>{var Ae,Ue;return z+(((Ae=de.tokens)==null?void 0:Ae.input)??0)+(((Ue=de.tokens)==null?void 0:Ue.output)??0)},0),[x]),Un=O.length>0||B.length>0;return i.jsxs("main",{className:"main",children:[i.jsxs(Ho,{title:`bugxhunter@redteam: ~/${cn}`,tooltip:c,children:[i.jsxs("span",{className:"status-pill"+(E?" live":""),children:[i.jsx("span",{className:"dot"}),E?Un?"waiting for you":"running":g?"idle":"ready"]}),vn>0&&i.jsxs("span",{className:"token-pill",children:[wi(vn)," tokens"]}),i.jsx("button",{className:"btn ghost sm",onClick:()=>mt(!0),disabled:E||!(l!=null&&l.ready),title:"Supervised recon: test one target round after round, approving anything that is not a read-only request",children:"recon"}),i.jsx("button",{className:"btn ghost sm",onClick:ja,disabled:!g,children:"changes"}),i.jsx("button",{className:"btn ghost sm",onClick:Le,disabled:E,children:"new_session"})]}),i.jsxs("div",{className:"transcript-wrap",children:[i.jsx("div",{className:"transcript grid-bg",ref:Me,onScroll:Be,children:i.jsxs("div",{className:"transcript-inner",children:[U&&i.jsx("p",{className:"muted center mono",children:"Loading session…"}),!U&&x.length===0&&i.jsxs("div",{className:"empty-state",children:[i.jsx(Lv,{lines:Bk(cn,y)},`${cn}:${y}`),i.jsx("div",{className:"suggestions",children:qk.map(z=>i.jsx("button",{className:"chip",onClick:()=>z.startsWith("/")?$t(z):W(z),children:z==="/init"?"/init — create AGENTS.md, the project's memory for future sessions":z},z))}),o&&i.jsx("div",{className:"error-banner",children:o})]}),x.map(z=>i.jsx(Vk,{msg:z},z.id)),we&&i.jsx(kk,{recon:we}),O.map(z=>i.jsxs("div",{className:"perm-card",children:[i.jsxs("div",{className:"perm-title",children:["Approval needed",z.subagent&&i.jsxs("span",{className:"perm-sub",children:["subagent · ",z.subagent]})]}),i.jsxs("div",{className:"perm-body",children:[i.jsx("span",{className:"perm-type",children:z.permType??"action"})," ",z.title??(Array.isArray(z.pattern)?z.pattern.join(", "):z.pattern)??""]}),i.jsxs("div",{className:"perm-actions",children:[i.jsx("button",{className:"btn primary sm",onClick:()=>ua(z,"once"),children:"Approve"}),!ft&&i.jsx("button",{className:"btn sm",onClick:()=>ua(z,"always"),children:"Always allow"}),i.jsx("button",{className:"btn sm danger-outline",onClick:()=>ua(z,"reject"),children:"Reject"})]})]},z.permissionID)),B.map(z=>i.jsx(Hk,{req:z,onAnswer:de=>da(z,de),onDismiss:()=>da(z,null)},z.requestID)),E&&!Un&&i.jsxs("div",{className:"working",children:[i.jsx("span",{}),i.jsx("span",{}),i.jsx("span",{})]}),ne.map(z=>i.jsx("div",{className:"msg user",children:i.jsxs("div",{className:"user-col",children:[i.jsx("div",{className:"bubble user-bubble queued-bubble",children:z.text||`(${z.files.length} file${z.files.length>1?"s":""})`}),i.jsxs("div",{className:"queued-label",children:["queued · ",i.jsx("button",{className:"link-btn",onClick:()=>Fn(z.id),children:"cancel"})]})]})},z.id)),X&&i.jsx("div",{className:"notice",children:X}),J&&i.jsx("div",{className:"error-banner",children:J})]})}),!pe&&i.jsx("button",{className:"jump-btn",onClick:()=>_e(),"aria-label":"Scroll to latest",children:"↓ latest"})]}),i.jsxs("div",{className:"composer",children:[we&&i.jsx(Tk,{recon:we,onStop:Ot,onDismiss:()=>nt(null)}),i.jsx(Rk,{todos:re}),i.jsx(Ck,{agent:y,setAgent:S,model:u,setModel:d,models:(l==null?void 0:l.models)??[],commands:ce,busy:E,onSend:$t,onStop:Ot,draft:ae,onDraftUsed:A.useCallback(()=>W(null),[])})]}),Q!==null&&i.jsx(zk,{diff:Q,onClose:()=>me(null)}),Lt&&i.jsx(Ak,{onStart:Ze,onClose:()=>mt(!1)})]})}function Xk(l){return l.parts.some(o=>o.type==="tool"&&(o.status==="running"||o.status==="pending"))?{...l,parts:l.parts.map(o=>o.type==="tool"&&(o.status==="running"||o.status==="pending")?{...o,status:"interrupted"}:o)}:l}function Yk(l){return{id:l.id,role:l.role,parts:l.parts,tokens:l.tokens,cost:l.cost,model:l.model,error:l.error,subagent:l.subagent}}function Vk({msg:l}){if(l.role==="user"){const o=l.parts.map(u=>u.type==="text"?u.text:"").join(""),c=l.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(dh,{})}),i.jsx("span",{className:"attach-name",children:u.filename}),u.size?i.jsx("span",{className:"attach-size",children:Lo(u.size)}):null]},u.id))}),o&&i.jsx("div",{className:"bubble user-bubble",children:o})]})})}return!l.parts.length&&!l.error?null:i.jsxs("div",{className:"msg assistant"+(l.subagent?" subagent":""),children:[i.jsx("div",{className:"avatar","aria-hidden":!0,children:l.subagent?"↳":"▶"}),i.jsxs("div",{className:"msg-body",children:[l.subagent&&i.jsxs("div",{className:"subagent-tag",title:l.subagent,children:["subagent · ",l.subagent]}),l.parts.map((o,c)=>o.type==="tool"?i.jsx(Kk,{t:o},o.callID):o.type==="reasoning"?i.jsx(Qk,{text:o.text},o.id):o.type==="text"?i.jsx(Bc,{text:o.text,files:!0},o.id):i.jsx("span",{},o.id??c)),l.error&&i.jsx("div",{className:"error-banner",children:l.error}),l.tokens&&(l.tokens.output??0)>0&&i.jsxs("div",{className:"msg-meta",children:[l.model&&i.jsx("span",{children:l.model}),i.jsxs("span",{children:[wi(l.tokens.input??0)," in · ",wi(l.tokens.output??0)," out"]}),l.cost?i.jsxs("span",{children:["$",l.cost.toFixed(4)]}):null]})]})]})}function Qk({text:l}){const[o,c]=A.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"+(o?" open":""),children:"›"})," Thinking"]}),o&&i.jsx("div",{className:"reasoning-body",children:l})]})}function Kk({t:l}){const[o,c]=A.useState(!1),u=l.title||(l.input?String(Object.values(l.input)[0]??""):""),d=!!(l.output||l.error);return i.jsxs("div",{className:"tool s-"+l.status,children:[i.jsxs("button",{className:"tool-head",onClick:()=>d&&c(h=>!h),disabled:!d,children:[i.jsx("span",{className:"tool-icon",children:i.jsx(W1,{tool:l.tool})}),i.jsx("span",{className:"tool-name",children:l.tool}),i.jsx("span",{className:"tool-summary",children:u.slice(0,120)}),i.jsx("span",{className:"tool-state",children:l.status==="running"||l.status==="pending"?i.jsx("span",{className:"spin"}):l.status==="error"?"failed":l.status==="interrupted"?"interrupted":""}),d&&i.jsx("span",{className:"chev"+(o?" open":""),children:"›"})]}),o&&d&&i.jsx("pre",{className:"tool-output",children:i.jsx(s0,{text:l.error?"error: "+l.error:String(l.output??"")})})]})}const Nv="or_playground_config",Lf="or_runner",Ev="or_mode",Cv="or_layout",Mv=320,Zk=240,Pk=560,Fk={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 kc(l,o){try{const c=localStorage.getItem(l);if(c)return{...o,...JSON.parse(c)}}catch{}return o}function zf(l,o){try{localStorage.setItem(l,JSON.stringify(o))}catch{}}function Jk(){const[l,o]=A.useState(()=>{try{return localStorage.getItem(Ev)||"runner"}catch{return"runner"}}),[c,u]=A.useState(null),[d,h]=A.useState(null),[m,b]=A.useState(()=>kc(Lf,{directory:"",model:"",recent:[]}));A.useEffect(()=>{DS().then(async le=>{u(le);const Se=kc(Lf,{directory:"",model:"",recent:[]}).directory,xe=Se?await Rv(Se).catch(()=>le.directory):le.directory;b(Xe=>({...Xe,directory:xe,model:le.models.some($=>$.id===Xe.model)?Xe.model:le.defaultModel}))}).catch(le=>h(String(le.message??le)))},[]),A.useEffect(()=>zf(Lf,m),[m]),A.useEffect(()=>{try{localStorage.setItem(Ev,l)}catch{}},[l]);const[y,S]=A.useState(null),[g,v]=A.useState(null),[x,k]=A.useState(0),O=le=>{o("runner"),v(Se=>({id:le,n:((Se==null?void 0:Se.n)??0)+1}))},Y=A.useCallback(()=>k(le=>le+1),[]),[B,te]=A.useState(()=>kc(Cv,{width:Mv,collapsed:!1}));A.useEffect(()=>zf(Cv,B),[B]);const re=()=>te(le=>({...le,collapsed:!le.collapsed}));A.useEffect(()=>{const le=Se=>{(Se.ctrlKey||Se.metaKey)&&Se.key.toLowerCase()==="b"&&(Se.preventDefault(),re())};return window.addEventListener("keydown",le),()=>window.removeEventListener("keydown",le)},[]);function fe(le){le.preventDefault();const Se=le.currentTarget;Se.setPointerCapture(le.pointerId),document.body.classList.add("resizing");const xe=$=>te(De=>({...De,width:Math.round(Math.min(Pk,Math.max(Zk,$.clientX)))})),Xe=()=>{Se.removeEventListener("pointermove",xe),Se.removeEventListener("pointerup",Xe),document.body.classList.remove("resizing")};Se.addEventListener("pointermove",xe),Se.addEventListener("pointerup",Xe)}function E(le){S(null),v(null),b(Se=>({...Se,directory:le,recent:[le,...Se.recent.filter(xe=>xe!==le)].slice(0,8)}))}function G(le){b(Se=>({...Se,recent:Se.recent.filter(xe=>xe!==le)}))}const[U,V]=A.useState(()=>{const le=kc(Nv,Fk);return{...le,tools:WS(le.tools??[])}}),[J,oe]=A.useState([]),[X,K]=A.useState(null),[Q,me]=A.useState([]),[ce,Ce]=A.useState(!1),[ae,W]=A.useState(null),[pe,F]=A.useState("chat"),we=A.useRef(null);A.useEffect(()=>{AS().then(le=>{oe(le),V(Se=>{var xe;return le.some(Xe=>Xe.id===Se.model)?Se:{...Se,model:((xe=le[0])==null?void 0:xe.id)??Se.model}})}).catch(le=>K(String(le.message??le)))},[]),A.useEffect(()=>zf(Nv,U),[U]);const nt=A.useMemo(()=>J.find(le=>le.id===U.model),[J,U.model]),[Lt,mt]=A.useState(null),[j,ne]=A.useState(null),[Te,ye]=A.useState(null),Ie=A.useRef(null),Oe=A.useRef(null),Ne=A.useCallback(()=>{Cc("chat").then(le=>ne(le)).catch(le=>ye({ok:!1,text:String(le.message??le)}))},[]);A.useEffect(()=>{l==="playground"&&Ne()},[l,Ne]),A.useEffect(()=>{var Xe,$,De;if(ce||!U.saveSessions||Q===Ie.current)return;const le=Q.find(Le=>Le.role==="user");if(!le)return;Ie.current=Q;const Se=Oe.current??Mo();Oe.current=Se,mt(Se);const xe=(((Xe=le.content)==null?void 0:Xe.trim())||(($=le.docs)!=null&&$.length?`Diagram review: ${le.docs[0].name}`:(De=le.images)!=null&&De.length?"Image review":"Chat")).replace(/\s+/g," ").slice(0,80);Mc("chat",Se,xe,{v:1,model:U.model,system:U.system,messages:Q}).then(()=>{ye({ok:!0,text:"Saved, encrypted with your vault"}),Ne()}).catch(Le=>ye({ok:!1,text:`Not saved: ${String(Le.message??Le)}`}))},[ce,Q,U.saveSessions,U.model,U.system,Ne]);async function he(le){var Se;if(!ce)try{const xe=await Pf("chat",le),Xe=Array.isArray((Se=xe.body)==null?void 0:Se.messages)?xe.body.messages:[];Ie.current=Xe,Oe.current=le,mt(le),me(Xe),W(null),F("chat"),V($=>({...$,...xe.body.model&&J.some(De=>De.id===xe.body.model)?{model:xe.body.model}:{},...typeof xe.body.system=="string"?{system:xe.body.system}:{}}))}catch(xe){ye({ok:!1,text:String(xe.message??xe)})}}async function be(le){try{await T0("chat",le),Oe.current===le&&_e(),Ne()}catch(Se){ye({ok:!1,text:String(Se.message??Se)})}}function gt(le){var xe;const Se=[];U.system.trim()&&Se.push({role:"system",content:U.system});for(const Xe of le)Xe.role==="assistant"&&((xe=Xe.tool_calls)!=null&&xe.length)?Se.push({role:"assistant",content:Xe.content??"",tool_calls:Xe.tool_calls}):Xe.role==="tool"?Se.push({role:"tool",content:Xe.content,tool_call_id:Xe.tool_call_id}):Se.push({role:Xe.role,content:Xe.role==="user"?Nh(Xe.content,Xe.images,Xe.docs):Xe.content});return Se}async function H(le){Ce(!0),W(null);const Se=new AbortController;we.current=Se;const xe=le.length;me([...le,{role:"assistant",content:""}]);const Xe=U.tools.length?e1(U.tools):void 0;let $="";const De=performance.now();let Le;const dt=()=>me(Ze=>{const ft=[...Ze],Ke=ft[xe];return Ke&&(ft[xe]={...Ke,timing:{ttft:Le,total:performance.now()-De}}),ft});await eh({model:U.model,messages:gt(le),temperature:U.temperature,top_p:U.topP,max_tokens:U.maxTokens,tools:Xe,response_format:U.jsonMode?{type:"json_object"}:void 0,rag:U.useKnowledge,stream:U.stream},{signal:Se.signal,onDelta:Ze=>{Le??(Le=performance.now()-De),$+=Ze,me(ft=>{const Ke=[...ft],$t=Ke[xe];return Ke[xe]={...$t,content:($t.content??"")+Ze},Ke})},onToolCalls:Ze=>me(ft=>{const Ke=[...ft];return Ke[xe]={...Ke[xe],tool_calls:Ze},Ke}),onSources:Ze=>me(ft=>{const Ke=[...ft];return Ke[xe]={...Ke[xe],sources:Ze},Ke}),onUsage:Ze=>me(ft=>{const Ke=[...ft];return Ke[xe]={...Ke[xe],usage:Ze},Ke}),onError:Ze=>W(Ze),onDone:()=>{dt(),U.speak&&$.trim()&&n1($)}}).catch(Ze=>{(Ze==null?void 0:Ze.name)!=="AbortError"&&W(String((Ze==null?void 0:Ze.message)??Ze))}),Ce(!1),we.current=null}function Me(le,Se,xe){if(!le.trim()&&!(Se!=null&&Se.length)&&!(xe!=null&&xe.length)||ce)return;const Xe=[...Q,{role:"user",content:le,...Se!=null&&Se.length?{images:Se}:{},...xe!=null&&xe.length?{docs:xe}:{}}];me(Xe),H(Xe)}function ke(le,Se){const xe=[...Q,{role:"tool",tool_call_id:le.id,content:Se}];me(xe),H(xe)}function Be(){var le;(le=we.current)==null||le.abort(),a1(),Ce(!1)}function _e(){Be(),me([]),W(null),Oe.current=null,mt(null),Ie.current=null}return i.jsxs("div",{className:"app"+(B.collapsed?" collapsed":""),style:{"--sidebar-w":`${B.width}px`},children:[B.collapsed&&i.jsx("button",{className:"sidebar-toggle floating",onClick:re,title:"Show sidebar (Ctrl+B)","aria-label":"Show sidebar",children:"»"}),i.jsx(Rw,{onCollapse:re,sessions:{active:y,version:x,open:O},mode:l,setMode:o,runner:m,status:c,statusError:d,onOpenDirectory:E,onForgetDirectory:G,config:U,setConfig:V,models:J,modelError:X,activeModel:nt,onReset:_e,saved:{list:j,activeId:Lt,status:Te,onOpen:le=>void he(le),onDelete:le=>void be(le)}}),i.jsx("div",{className:"splitter",role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize · double-click to reset",onPointerDown:fe,onDoubleClick:()=>te(le=>({...le,width:Mv}))}),l==="runner"?m.directory?i.jsx($k,{status:c,statusError:d,directory:m.directory,model:m.model||(c==null?void 0:c.defaultModel)||"",setModel:le=>b(Se=>({...Se,model:le})),resume:g,onActiveSession:S,onSessionsChanged:Y},m.directory):i.jsx("main",{className:"main",children:i.jsx("div",{className:"transcript grid-bg",children:i.jsx("div",{className:"empty-state center",children:d?i.jsx("div",{className:"error-banner",children:d}):i.jsx("p",{className:"muted mono",children:"Starting OpenCode…"})})})}):pe==="compare"?i.jsx(VT,{config:U,models:J,onExit:()=>F("chat")}):pe==="canvas"?i.jsx(vk,{config:U,models:J,onExit:()=>F("chat")}):i.jsx(BT,{config:U,activeModel:nt,messages:Q,busy:ce,error:ae,onSend:Me,onStop:Be,onReset:_e,onToolResult:ke,onCompare:()=>F("compare"),onCanvas:()=>F("canvas")})]})}const Wk=window.fetch.bind(window);window.fetch=async(l,o)=>{const c=await Wk(l,o),u=typeof l=="string"?l:l instanceof URL?l.pathname:l.url;return c.status===401&&u.startsWith("/api/")&&!u.startsWith("/api/auth/")&&c.headers.get("WWW-Authenticate")==="BXH-Passkey"&&window.dispatchEvent(new Event(Bf)),c};wS.createRoot(document.getElementById("root")).render(i.jsx(mS.StrictMode,{children:i.jsx(j1,{children:i.jsx(Jk,{})})}));
|